Difference between revisions of "Scheduling Support"
From Hiasobi - FHIR
Brett Esler (Talk | contribs) (→RESPONSE) |
Brett Esler (Talk | contribs) (→REQUEST) |
||
| (32 intermediate revisions by the same user not shown) | |||
| Line 6: | Line 6: | ||
See: Core FHIR Resources [http://hl7.org/fhir/STU3/appointment.html Appointment], [http://hl7.org/fhir/STU3/schedule.html Schedule], [http://hl7.org/fhir/STU3/schedule.html Slot] | See: Core FHIR Resources [http://hl7.org/fhir/STU3/appointment.html Appointment], [http://hl7.org/fhir/STU3/schedule.html Schedule], [http://hl7.org/fhir/STU3/schedule.html Slot] | ||
| + | |||
| + | Sample Web App Using this API | ||
| + | http://oridashi.com.au/site/scheduling.html | ||
===REQUEST=== | ===REQUEST=== | ||
| − | Appointment books may be broken in to periods during a single day. | + | * Appointment books may be broken in to periods during a single day. |
| + | * NOTE: Authorization is generally required in production | ||
Get 'all' is 6 weeks of all practitioners as Schedule resource: | Get 'all' is 6 weeks of all practitioners as Schedule resource: | ||
| − | GET [base]/Schedule | + | GET [base]/Schedule HTTP/1.1 |
| + | Accept: application/fhir+json | ||
Get all schedules for a practitioner: | Get all schedules for a practitioner: | ||
| − | GET [base]/Schedule?actor=Practitioner/<practitioner id> | + | GET [base]/Schedule?actor=Practitioner/<practitioner id> HTTP/1.1 |
| + | Accept: application/fhir+json | ||
Get all schedules for a location: | Get all schedules for a location: | ||
| − | GET [base]/Schedule?actor=Location/<location id> | + | GET [base]/Schedule?actor=Location/<location id> HTTP/1.1 |
| + | Accept: application/fhir+json | ||
Get all schedules for a practitioner at a location on a date: | Get all schedules for a practitioner at a location on a date: | ||
| − | GET [base]/Schedule?date=<date>&actor=Practitioner/<practitioner id>&actor=Location/<location id> | + | GET [base]/Schedule?date=<date>&actor=Practitioner/<practitioner id>&actor=Location/<location id> HTTP/1.1 |
| + | Accept: application/fhir+json | ||
Can include Practitioner and Locations details also | Can include Practitioner and Locations details also | ||
| Line 30: | Line 38: | ||
* Return a FHIR [http://hl7.org/fhir/bundle.html Bundle] | * Return a FHIR [http://hl7.org/fhir/bundle.html Bundle] | ||
* Bundle.entry will contain [http://hl7.org/fhir/schedule.html Schedule] entries | * Bundle.entry will contain [http://hl7.org/fhir/schedule.html Schedule] entries | ||
| − | * Example response in xml and json format | + | * Example response in xml and json format [[example-schedule-bundle]] |
| − | [[ | + | |
==Search available slots as Slot resource== | ==Search available slots as Slot resource== | ||
| Line 37: | Line 44: | ||
===REQUEST=== | ===REQUEST=== | ||
| − | LIMITED SUPPORT Get all slots in a given schedule (appointment book) | + | * LIMITED SUPPORT Get all slots in a given schedule (appointment book) |
| + | * add $_count=10000 if you don't want response bundle paging | ||
| + | * NOTE: Authorization is generally required in production | ||
| − | GET [base]/Slot?schedule=<schedule.id> | + | GET [base]/Slot?schedule=<schedule.id> HTTP/1.1 |
| + | Accept: application/fhir+json | ||
===RESPONSE=== | ===RESPONSE=== | ||
* Return a FHIR [http://hl7.org/fhir/bundle.html Bundle] | * Return a FHIR [http://hl7.org/fhir/bundle.html Bundle] | ||
* Bundle.entry will contain [http://hl7.org/fhir/slot.html Slot] entries | * Bundle.entry will contain [http://hl7.org/fhir/slot.html Slot] entries | ||
| − | * Example response in xml + json format: | + | * Example response in xml + json format:[[example-slot-bundle]] |
| − | [[ | + | |
| + | ==Appointment Details== | ||
| + | * Create a FHIR Appointment resource instance to submit based on the slot start/end and practitioner info | ||
| + | * 1..1 status : pending (appointment is proposed) | ||
| + | * 1..1 start/ 1..1 end : date-time period for the appointment | ||
| + | * 0..1 description : top line summary text for the appointment | ||
| + | * 0..* participant : entities involved with the appointment | ||
| + | ** actor.reference : reference the FHIR id of the entity | ||
| + | ** 1..1 Practitioner participant must be provided (by reference); required = required (must attend); status = needs-action (system yet to accept) | ||
| + | ** 0..1 Patient reference a patient if you can to link automatically in the PMS ; required = required (must attend); status = accepted (already confirmed) | ||
| + | * comment : further notes to include in the appointment | ||
| + | |||
| + | ===REQUEST=== | ||
| + | * Make an appointment via API | ||
| + | * NOTE: Authorization is generally required in production | ||
| + | |||
| + | <pre>POST [base]/Appointment HTTP/1.1 | ||
| + | Content-Length: 424 | ||
| + | Accept: application/fhir+json | ||
| + | Content-Type: application/fhir+json | ||
| + | { | ||
| + | "resourceType":"Appointment", | ||
| + | "status":"pending", | ||
| + | "start":"2018-06-21T09:30:00+10:00", | ||
| + | "end":"2018-06-21T09:45:00+10:00", | ||
| + | "description":"Online Appointment", | ||
| + | "participant":[ | ||
| + | { | ||
| + | "actor":{ | ||
| + | "reference":"Practitioner/6FA2AA1CA439ABFB38D48297E0ACC3FF.1" | ||
| + | }, | ||
| + | "required":"required", | ||
| + | "status":"needs-action" | ||
| + | }, | ||
| + | { | ||
| + | "actor":{ | ||
| + | "reference":"Patient/6FA2AA1CA439ABFB38D48297E0ACC3FF.2" | ||
| + | }, | ||
| + | "required":"required", | ||
| + | "status":"accepted" | ||
| + | } | ||
| + | ], | ||
| + | "comment":"test notes" | ||
| + | } | ||
| + | </pre> | ||
| + | |||
| + | ===RESPONSE=== | ||
| + | * content is returned + the allocated Appointment.id | ||
| + | * can keep this id to remove appointments later | ||
| + | * for example | ||
| + | |||
| + | <pre> | ||
| + | {"resourceType":"Appointment", | ||
| + | "id":"6FA2AA1CA439ABFB38D48297E0ACC3FF.653", | ||
| + | ... | ||
| + | } | ||
| + | </pre> | ||
==Typical Usage== | ==Typical Usage== | ||
| Line 53: | Line 118: | ||
Get calendars and include practitioners and locations; then get slots | Get calendars and include practitioners and locations; then get slots | ||
| − | <pre>https://localhost.oridashi.com.au:8102/Schedule?date=2018-06-19&_include=Schedule:actor</pre> | + | <pre>GET https://localhost.oridashi.com.au:8102/Schedule?date=2018-06-19&_include=Schedule:actor HTTP/1.1 |
| + | Authorization: Basic c2FtcGxlczo2Nzc2M0YxQTZBNjE0NkQ5QjVBREE4NTg= | ||
| + | Accept: application/fhir+json | ||
| + | </pre> | ||
| + | |||
| + | |||
| + | Get slots from all schedules e.g. slots for each schedule by id like: | ||
| + | |||
| + | <pre>GET https://localhost.oridashi.com.au:8102/Slot?schedule=6FA2AA1CA439ABFB38D48297E0ACC3FF.1-20180619-32400-3600-900-1 HTTP/1.1 | ||
| + | Authorization: Basic c2FtcGxlczo2Nzc2M0YxQTZBNjE0NkQ5QjVBREE4NTg= | ||
| + | Accept: application/fhir+json | ||
| + | </pre> | ||
| + | Use the details of a free slot to make an appointment by posting | ||
| − | + | <pre>POST https://localhost.oridashi.com.au:8102/Appointment HTTP/1.1 | |
| + | Authorization: Basic c2FtcGxlczo2Nzc2M0YxQTZBNjE0NkQ5QjVBREE4NTg= | ||
| + | Content-Length: 424 | ||
| + | Accept: application/fhir+json | ||
| + | Content-Type: application/fhir+json | ||
| + | ...body... | ||
| + | </pre> | ||
| − | |||
| − | |||
Archive Material: [[Appointment Management]] | Archive Material: [[Appointment Management]] | ||
Latest revision as of 15:21, 19 June 2018
Contents
Search appointment books as Schedule resource
See: Core FHIR Resources Appointment, Schedule, Slot
Sample Web App Using this API
http://oridashi.com.au/site/scheduling.html
REQUEST
- Appointment books may be broken in to periods during a single day.
- NOTE: Authorization is generally required in production
Get 'all' is 6 weeks of all practitioners as Schedule resource:
GET [base]/Schedule HTTP/1.1 Accept: application/fhir+json
Get all schedules for a practitioner:
GET [base]/Schedule?actor=Practitioner/<practitioner id> HTTP/1.1 Accept: application/fhir+json
Get all schedules for a location:
GET [base]/Schedule?actor=Location/<location id> HTTP/1.1 Accept: application/fhir+json
Get all schedules for a practitioner at a location on a date:
GET [base]/Schedule?date=<date>&actor=Practitioner/<practitioner id>&actor=Location/<location id> HTTP/1.1 Accept: application/fhir+json
Can include Practitioner and Locations details also
&_include=Schedule:actor
RESPONSE
- Return a FHIR Bundle
- Bundle.entry will contain Schedule entries
- Example response in xml and json format example-schedule-bundle
Search available slots as Slot resource
REQUEST
- LIMITED SUPPORT Get all slots in a given schedule (appointment book)
- add $_count=10000 if you don't want response bundle paging
- NOTE: Authorization is generally required in production
GET [base]/Slot?schedule=<schedule.id> HTTP/1.1 Accept: application/fhir+json
RESPONSE
- Return a FHIR Bundle
- Bundle.entry will contain Slot entries
- Example response in xml + json format:example-slot-bundle
Appointment Details
- Create a FHIR Appointment resource instance to submit based on the slot start/end and practitioner info
- 1..1 status : pending (appointment is proposed)
- 1..1 start/ 1..1 end : date-time period for the appointment
- 0..1 description : top line summary text for the appointment
- 0..* participant : entities involved with the appointment
- actor.reference : reference the FHIR id of the entity
- 1..1 Practitioner participant must be provided (by reference); required = required (must attend); status = needs-action (system yet to accept)
- 0..1 Patient reference a patient if you can to link automatically in the PMS ; required = required (must attend); status = accepted (already confirmed)
- comment : further notes to include in the appointment
REQUEST
- Make an appointment via API
- NOTE: Authorization is generally required in production
POST [base]/Appointment HTTP/1.1
Content-Length: 424
Accept: application/fhir+json
Content-Type: application/fhir+json
{
"resourceType":"Appointment",
"status":"pending",
"start":"2018-06-21T09:30:00+10:00",
"end":"2018-06-21T09:45:00+10:00",
"description":"Online Appointment",
"participant":[
{
"actor":{
"reference":"Practitioner/6FA2AA1CA439ABFB38D48297E0ACC3FF.1"
},
"required":"required",
"status":"needs-action"
},
{
"actor":{
"reference":"Patient/6FA2AA1CA439ABFB38D48297E0ACC3FF.2"
},
"required":"required",
"status":"accepted"
}
],
"comment":"test notes"
}
RESPONSE
- content is returned + the allocated Appointment.id
- can keep this id to remove appointments later
- for example
{"resourceType":"Appointment",
"id":"6FA2AA1CA439ABFB38D48297E0ACC3FF.653",
...
}
Typical Usage
Get calendars and include practitioners and locations; then get slots
GET https://localhost.oridashi.com.au:8102/Schedule?date=2018-06-19&_include=Schedule:actor HTTP/1.1 Authorization: Basic c2FtcGxlczo2Nzc2M0YxQTZBNjE0NkQ5QjVBREE4NTg= Accept: application/fhir+json
Get slots from all schedules e.g. slots for each schedule by id like:
GET https://localhost.oridashi.com.au:8102/Slot?schedule=6FA2AA1CA439ABFB38D48297E0ACC3FF.1-20180619-32400-3600-900-1 HTTP/1.1 Authorization: Basic c2FtcGxlczo2Nzc2M0YxQTZBNjE0NkQ5QjVBREE4NTg= Accept: application/fhir+json
Use the details of a free slot to make an appointment by posting
POST https://localhost.oridashi.com.au:8102/Appointment HTTP/1.1 Authorization: Basic c2FtcGxlczo2Nzc2M0YxQTZBNjE0NkQ5QjVBREE4NTg= Content-Length: 424 Accept: application/fhir+json Content-Type: application/fhir+json ...body...
Archive Material: Appointment Management