Skip to content

Commit

Permalink
Merge pull request #10 from HL7Austria/6-initial-OperationDefinitions
Browse files Browse the repository at this point in the history
#6 Initial hold operation
  • Loading branch information
sa-bre authored Feb 7, 2025
2 parents 6578a58 + a7fd36e commit b8bf58c
Show file tree
Hide file tree
Showing 6 changed files with 199 additions and 0 deletions.
33 changes: 33 additions & 0 deletions input/fsh/at-scheduling-operationDefinition-book.fsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*##############################################################################
# Type: FSH-File for a FHIR® OperationDefinition
# About: HL7® Austria FHIR® Scheduling Operation $book.
# Created by: HL7® Austria, TC FHIR®
##############################################################################*/

Instance: appointment-book
InstanceOf: OperationDefinition
Usage: #definition

* name = "Book_Appointment_Operation"
* status = #active
* kind = #operation
* description = "Request to book a selected Appointment. This operation follows the appointment availability and optional hold interactions. This operation completes the booking of an appointment. The server determines if the nominated appointment is still available (i.e., all the required actors and physical assets needed for the appointment are still available) and either accepts or rejects the book request and updates the resource status accordingly. "
* affectsState = true
* code = #book
* resource = #Appointment
* system = false
* type = true
* instance = false
* parameter[0].name = #appointment-resource
* parameter[=].use = #in
* parameter[=].min = 1
* parameter[=].max = "1"
* parameter[=].documentation = "The full appointment resource is needed for this operation. The appointment SHALL have the status \"proposed\"."
* parameter[=].type = #Resource
* parameter[=].targetProfile = Canonical(HL7ATSchedulingAppointment)
* parameter[+].name = #return
* parameter[=].use = #out
* parameter[=].min = 1
* parameter[=].max = "1"
* parameter[=].documentation = "The response will be a Parameters resource consisting of the requested Appointment resource and an OperationOutcome with errors, warnings or information as a result of processing the operation. The Appointment resource will have an updated `status` of \"booked\" if the request is approved or \"cancelled\" if it is rejected."
* parameter[=].type = #Parameters
74 changes: 74 additions & 0 deletions input/fsh/at-scheduling-operationDefinition-findHSP.fsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*##############################################################################
# Type: FSH-File for a FHIR® OperationDefinition
# About: HL7® Austria FHIR® Scheduling Operation $findHSP.
# Created by: HL7® Austria, TC FHIR®
##############################################################################*/

Instance: healthcareService-provider-find
InstanceOf: OperationDefinition
Usage: #definition

* name = "Find_HealthcareService_Provider"
* status = #active
* kind = #query
* description = "A query operation that allows to search for healthcare service providers that offer a specific healthcare service. The general information about the HealthcareService identification itself is already available in advance, either as resource or via codes. "
* affectsState = false
* code = #findHSP
* resource = #HealthcareService
* system = false
* type = true
* instance = false
* parameter[0].name = #healthcareService-reference
* parameter[=].use = #in
* parameter[=].min = 0
* parameter[=].max = "1"
* parameter[=].documentation = "The full HealthcareService resource can be provided for this operation. The HealthcareService SHALL have be active (HealthcareService.active=true). "
* parameter[=].type = #Resource
* parameter[=].targetProfile = Canonical(HL7ATSchedulingHealthcareService)
* parameter[+].name = #healthcareService-category
* parameter[=].use = #in
* parameter[=].min = 0
* parameter[=].max = "1"
* parameter[=].documentation = "The code of the category of the healthcare service. Each parameter value SHALL contain *both* the system property and the code property for a code using the general syntax `healthcareService-category=[system]|[code]`. See the examples below for how this is implemented."
* parameter[=].type = #string
* parameter[=].searchType = #token
* parameter[+].name = #healthcareService-type
* parameter[=].use = #in
* parameter[=].min = 0
* parameter[=].max = "1"
* parameter[=].documentation = "The code of the type of the healthcare service. Each parameter value SHALL contain *both* the system property and the code property for a code using the general syntax `healthcareService-type=[system]|[code]`. See the examples below for how this is implemented."
* parameter[=].type = #string
* parameter[=].searchType = #token
* parameter[+].name = #healthcareService-specialty
* parameter[=].use = #in
* parameter[=].min = 0
* parameter[=].max = "1"
* parameter[=].documentation = "The code of the specialty of the healthcare service. Each parameter value SHALL contain *both* the system property and the code property for a code using the general syntax `healthcareService-specialty=[system]|[code]`. See the examples below for how this is implemented."
* parameter[=].type = #string
* parameter[=].searchType = #token
* parameter[+].name = #healthcareService-location
* parameter[=].use = #in
* parameter[=].min = 0
* parameter[=].max = "*"
* parameter[=].documentation = "The (physical) location where a healthcare service should be provided can be used as a search parameter."
* parameter[=].type = #Reference
* parameter[=].targetProfile = Canonical(Location)
* parameter[+].name = #healthcareService-zipCodeArea
* parameter[=].use = #in
* parameter[=].min = 0
* parameter[=].max = "*"
* parameter[=].documentation = "The aera in which a healthcare service should be offered can be provided as search parameter. For that purpose the zip code(s) shall be used."
* parameter[=].type = #string
* parameter[=].searchType = #string
* parameter[+].name = #healthcareService-availability
* parameter[=].use = #in
* parameter[=].min = 0
* parameter[=].max = "*"
* parameter[=].documentation = "The desired availabilities for the healthcare service. "
* parameter[=].type = #Availability
* parameter[+].name = #result
* parameter[=].use = #out
* parameter[=].min = 1
* parameter[=].max = "1"
* parameter[=].documentation = "The response will be a Bundle consisting of the HealthcareService resource and a list of healthcare service providers (Organization, Practitioner, PractitionerRole) that offer the requested service and an OperationOutcome with errors, warnings or information as a result of processing the operation."
* parameter[=].type = #Bundle
39 changes: 39 additions & 0 deletions input/fsh/at-scheduling-operationDefinition-hold.fsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*##############################################################################
# Type: FSH-File for a FHIR® OperationDefinition
# About: HL7® Austria FHIR® Scheduling Operation $hold.
# Created by: HL7® Austria, TC FHIR®
##############################################################################*/

Instance: slot-hold
InstanceOf: OperationDefinition
Usage: #definition

* name = "Hold_Slot_Operation"
* status = #active
* kind = #operation
* description = "Request for a hold on a selected Slot in order for the user to complete entering data for booking an appointment. This operation precedes the booking and follows the appointment availability interaction. The server determines if the nominated slot is still available (i.e., all the required actors and physical assets needed for the appointment are still available) and either accepts or rejects the hold request and updates the resource status accordingly. "
* affectsState = true
* code = #hold
* resource = #Slot
* system = false
* type = true
* instance = false
* parameter[0].name = #slot-reference
* parameter[=].use = #in
* parameter[=].min = 0
* parameter[=].max = "1"
* parameter[=].documentation = "A resource id for one of proposed Slots returned by a prior $find operation (e.g., Resource/1234). References can be to an absolute URL, but servers only perform this operation on their own slots."
* parameter[=].type = #Reference
* parameter[=].targetProfile = Canonical(HL7ATSchedulingSlot)
* parameter[+].name = #slot-identifier
* parameter[=].use = #in
* parameter[=].min = 0
* parameter[=].max = "*"
* parameter[=].documentation = "When slot-identifiers are provided, the server is expected to perform an internal lookup to identify the corresponding slot instance. The server SHALL reject the request if the provided identifiers do not resolve to a single slot instance."
* parameter[=].type = #Identifier
* parameter[+].name = #return
* parameter[=].use = #out
* parameter[=].min = 1
* parameter[=].max = "1"
* parameter[=].documentation = "The response will be a Parameters resource consisting of the requested held Slot resource and an OperationOutcome with errors, warnings or information as a result of processing the operation. The Appointment resource will have an updated `status` of \"busy-tentative\" if the hold is approved or \"busy-unavailable\" if the hold is rejected."
* parameter[=].type = #Parameters
18 changes: 18 additions & 0 deletions input/pagecontent/OperationDefinition-appointment-book-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

<h4> Book a New Appointment </h4>
This operation is used by the Scheduling Client to request the booking of an appointment from a Scheduling Server. The Scheduling Cliet provides a full Appointment resource that SHALL have the status \"proposed\".

If the appointment ```$book``` operation was successful the Scheduling Server returns an Appointment resource with the the value of ```Appointment.status``` set to \"booked\"

The Scheduling Client is expected to convey the outcome to the user who requested the creation of the appointment, and to record the current state of the appointment in the corresponding system(s), including any error conditions..

<h5> Pre-Conditions </h5>
The following pre-conditions must be fullfilled for the $book operation to be successful:
- The referenced patient in ```Appointment.subject``` SHALL already exist on or must be known to the Scheduling Server
- If a HealthcareService is provided in ```Appointment.serviceType``` it SHALL already exist on or must be known to and supported by the Scheduling Server
- If a Slot is provided in ```Appointment.slot``` the Slot SHALL exist and must be available for booking on the Scheduling Server

If any of those pre-conditions are not met, the Scheduling Server SHALL reject the operation and provide a corresponding explanation in the OperationOutcome.

<h5> Examples </h5>
ToDo
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

- For input parameters that are codes, the simple FHIR [token](https://hl7.org/fhir/R5/search.html#token) search parameter type is used instead of the complex ```CodeableConcept``` datatype. This allows either the 'GET' or the 'POST' syntax to be used to initiate the interaction in many cases. The ```Reference``` datatype is used for resources references, which allows the requester to use either a reference to existing resource, or an identifier ([logical reference](https://hl7.org/fhir/R5/references-definitions.html#Reference.identifier)).
- To set the upper limit on the total number of available appointment options to return use the standard [```_count```](https://hl7.org/fhir/R5/search.html#count) search parameter.

<h4> For the Scheduling Client </h4>
This query operation is used by the Scheduling Client to find healthcare service providers that offer a specific healthcare service. This can be achieved by:
- using a HealthcareService instance (as full resource) as search input
- identifying the healthcare service via a code (```HealthcareService.category```, ```HealthcareService.type``` or ```HealthcareService.specialty```)

In addition to that a Scheduling Client can provide further filter criteria in its search like:
- a region where a healthcare service should ideally be offered with either a Location reference or a zip code
- the desired availablity time of a healthcare service

<h5> Pre-Conditions </h5>
The following pre-conditions must be fullfilled for the ```$findHSP``` operation to be successful:
- The general information about the HealthcareService identification itself is already available in advance
- This means that either the client has already searched for the healthcare service and has fetched the corresponding HealthcareService resource instance or the client is aware of the codes for category, type or specialty of it.

If a healthcare service information is not provided by the client in this query operation, the Scheduling Server SHALL reject the operation and provide a corresponding explanation in the OperationOutcome.

<h4> For the Scheduling Server </h4>
Based on the search input the Scheduling Server has to look up the corresponding healthcare service as well as the healthcare service providers that offer it. Depending on the implementation and the supported scenarios for the scheduling workflow, the server has to do this internally and/or with its connected systems.
It SHALL respond to the client with a Bundle containing the HealthcareService resource and a list of healthcare service providers (Organization, Practitioner, PractitionerRole) that offer the requested service. Furthermore it SHALL contain an OperationOutcome with errors, warnings or information as a result of processing the operation.

<h4> Examples </h4>
ToDo
9 changes: 9 additions & 0 deletions input/pagecontent/OperationDefinition-slot-hold-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

This operation is used by the Scheduling Client and Scheduling Server Actors. The Hold Slot operation is used to request that a specific appointment-slot (selected from one of the available potential slots returned with the response of a preceding query) is held by the Scheduling Server, until the appointment is booked, cancelled, or the hold on the slot expires.

The Scheduling Server is expected to hold the necessary time slots and resources for the potential appointment to take place at the given time and for the given duration.

Note that it is possible that between the time the Find Potential Appointments response was received, and the time the Hold Slot request is issued, the requested slot is no longer available. In such case, the server SHALL respond with an OperationOutcome that describes the issue.

<h4> Examples </h4>
ToDo

0 comments on commit b8bf58c

Please sign in to comment.