Skip to content

Commit

Permalink
Search for free slots
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonny Rylands committed Oct 6, 2021
1 parent 9ecb2a8 commit ae77a96
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"meta": {
"tag": [
{
"system": "https://fhir.nhs.uk/STU3/CodeSystem/GPConnect-ServiceIdFilteringStatus-1",
"code": "organisation-switch-off"
"system": "https://fhir.nhs.uk/STU3/CodeSystem/GPConnect-ServiceFilteringStatus-1",
"code": "disabled-organization-switch"
}
]
},
Expand Down
23 changes: 12 additions & 11 deletions pages/appointments/appointments_use_case_search_for_free_slots.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Consumer systems SHALL send the following parameters in the request:

Where a Consumer system has used [Directory of Services (DOS) to locate a service to book at](appointments_service_discovery.html#directory-of-services-dos---currently-for-uec-consumers-only), the consumer system SHALL send the following parameter in the request:

- The `service.identifier` parameter with the service ID of the chosen DOS service, e.g. `service.identifier=https://fhir.nhs.uk/Id/uec-dos-service-id|1000123` (see [Service filtering](appointments_serviceid_filtering.html) for more information)
- The `service.identifier` parameter with the service ID of the chosen DOS service, e.g. `service.identifier=https://fhir.nhs.uk/Id/uec-dos-service-id|1000123` (see [Service filtering](appointments_service_filtering.html) for more information)

Consumer systems SHOULD send the following parameters in the request:

Expand Down Expand Up @@ -103,7 +103,7 @@ In order to prevent incorrect or unsuitable bookings, and to allow a patient to
- End date and time, or duration
- Delivery channel (in-person, telephone, video)
- Slot type and schedule type (see `Slot.serviceType` and `Schedule.serviceCategory`)
- Service name (where present, see [service filtering](appointments_serviceid_filtering.html) for more information)
- Service name (where present, see [service filtering](appointments_service_filtering.html) for more information)
- Location name and address
- Practitioner role (e.g. General Medical Practitioner, Nurse)
- Practitioner name and gender
Expand Down Expand Up @@ -204,10 +204,10 @@ Provider systems:
- **and** which match the search filter parameters of booking organisation (ODS code) and/or organisation type, or are not restricted for booking by ODS code and/or organisation type
- **and** reference a `Schedule` with a `actor` of type `HealthcareService`, **where**:
- the consumer has sent a `service.identifier` search parameter in the request
- **and** the service filtering [organisation switch is ON](appointments_serviceid_configuration.html#organisation-switch-set-to-on)
- **and** the service filtering [organisation switch is ON](appointments_service_configuration.html#organisation-switch-set-to-on)
- **and** a `HealthcareService.identifier` element matches the token passed in the `service` parameter

{% include important.html content="The `service.identifier` and the HealthcareService `_include` parameters do not take effect (i.e. are ignored) if the provider organisation has the service filtering [organisation switch set to OFF](appointments_serviceid_configuration.html#organisation-switch-set-to-off)" %}
{% include important.html content="The `service.identifier` and the HealthcareService `_include` parameters do not take effect (i.e. are ignored) if the provider organisation has the service filtering [organisation switch set to OFF](appointments_service_configuration.html#organisation-switch-set-to-off)" %}

- `Schedule` resources associated with the returned `Slot` resources

Expand All @@ -221,9 +221,9 @@ Provider systems:

- SHALL populate the `Location` resource according to population requirements for [Read a location](foundations_use_case_read_a_location.html#payload-response-body)

- `HealthcareService` resources associated with the returned `Schedule` resources where requested by the consumer using the `_include:recurse=Schedule:actor:HealthcareService` parameter and where the service filtering [organisation switch is ON](appointments_serviceid_configuration.html#organisation-switch-set-to-on)
- `HealthcareService` resources associated with the returned `Schedule` resources where requested by the consumer using the `_include:recurse=Schedule:actor:HealthcareService` parameter and where the service filtering [organisation switch is ON](appointments_service_configuration.html#organisation-switch-set-to-on)

- `HealthcareService` resources and their reference in `Schedule.actor` SHALL NOT be populated when the service filtering [organisation switch is OFF](appointments_serviceid_configuration.html#organisation-switch-set-to-off) regardless of the parameters sent by the consumer
- `HealthcareService` resources and their reference in `Schedule.actor` SHALL NOT be populated when the service filtering [organisation switch is OFF](appointments_service_configuration.html#organisation-switch-set-to-off) regardless of the parameters sent by the consumer

- SHALL populate the `HealthcareService` resource according to population requirements for [Read a healthcare service](foundations_use_case_read_a_healthcareservice.html#payload-response-body)

Expand All @@ -250,7 +250,8 @@ Provider systems:

- SHALL indicate the service filtering status of the search:
- only when the consumer sends the `service.identifier` parameter in the request
- by using the `Bundle.meta.tag` element populating the system and code elements with [GPConnect-ServiceFilteringStatus]((https://fhir.nhs.uk/STU3/CodeSystem/GPConnect-ServiceFilteringStatus-1))
- by using the `Bundle.meta.tag` element populating the system and code elements with [GPConnect-ServiceFilteringStatus-1]((https://fhir.nhs.uk/STU3/CodeSystem/GPConnect-ServiceFilteringStatus-1))
- matching the `disabled-supplier-switch`, `disabled-organization-switch`, `enabled` values with the current state of the supplier switch and organisation switch

### Error handling ####

Expand All @@ -265,8 +266,8 @@ The provider system:

- SHALL return a [RECORD_NOT_FOUND](development_fhir_error_handling_guidance.html#example-resource-not-found) error with the diagnostics element providing detail of the issue when:
- the consumer system has populated the `service.identifier` parameter in the request
- *AND* the provider organisation has the [service filtering switch set to ON](appointments_serviceid_configuration.html#organisation-switch-set-to-on)
- *AND* the DOS service ID in the `service.identifier` parameter value is not contained in the provider organisation's [service list](appointments_serviceid_configuration.html#service-list)
- *AND* the provider organisation has the [service filtering switch set to ON](appointments_service_configuration.html#organisation-switch-set-to-on)
- *AND* the DOS service ID in the `service.identifier` parameter value is not contained in the provider organisation's [service list](appointments_service_configuration.html#service-list)

Refer to [Error handling guidance](development_fhir_error_handling_guidance.html) for details of error codes.

Expand Down Expand Up @@ -322,7 +323,7 @@ The example below shows a typical search for free slots request from a consumer

The example response includes two Slot resources matching the search criteria, and associated Schedule, Location, Practitioner and Organization resources.

The consumer has searched with a service ID from DOS, however in this example the provider organisation has not enabled [service filtering](appointments_serviceid_filtering.html) and has therefore ignored the service.identifier parameter sent in the request. Because the consumer sent the service.identifier parameter in the request, the `Bundle.meta.tag` element is populated to indicate whether the parameter was applied when filtering the returned slots.
The consumer has searched with a service ID from DOS, however in this example the provider organisation has not enabled [service filtering](appointments_service_filtering.html) and has therefore ignored the service.identifier parameter sent in the request. Because the consumer sent the service.identifier parameter in the request, the `Bundle.meta.tag` element is populated to indicate whether the parameter was applied when filtering the returned slots.

```json
{% include appointments/search-for-free-slots-response-payload-2.json %}
Expand All @@ -348,7 +349,7 @@ The example below shows a typical search for free slots request:

The example response includes two Slot resources matching the search criteria, and associated Schedule and Organization resources.

In this example the provider organisation has not enabled [service filtering](appointments_serviceid_filtering.html). This can be seen in the example response below as the Schedule resource is not linked to a HealthcareService resource, and there are no HealthcareService resources in the response Bundle. Please see the example above for a response where a HealthcareService resource is returned.
In this example the provider organisation has not enabled [service filtering](appointments_service_filtering.html). This can be seen in the example response below as the Schedule resource is not linked to a HealthcareService resource, and there are no HealthcareService resources in the response Bundle. Please see the example above for a response where a HealthcareService resource is returned.

This example also shows the absence of a Practitioner resource. This may happen where a provider organisation has not yet assigned a named practitioner to an appointment schedule.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ Provider systems:

An GP Connect CapabilityStatement is shown in the example section below ready for customisation and embedding into GP Connect assured provider systems. Providers should use this CapabilityStatement as a base for their own CapabilityStatement, replacing the element in square brackets (`[` & `]`) with specific information of their implementation. The main version at the top of the CapabilityStatement should represent the GP Connect specification version which the FHIR server implements.

{% include important.html content="The HealthcareService endpoint and service.identifier parameter should be visible in the capability statement regardless of the state of the service filtering organisation switch [appointment service ID filtering](appointments_serviceid_filtering.html)." %}


### Examples ###

#### Get the FHIR capability statement ####
Expand Down

0 comments on commit ae77a96

Please sign in to comment.