FHIR API: booking appointment "Unscheduled status" none ...

This forum is for programmers who have questions about the source code.
Post Reply
bravegag
Posts: 49
Joined: Fri May 24, 2019 3:37 pm

FHIR API: booking appointment "Unscheduled status" none ...

Post by bravegag » Wed Jun 12, 2019 3:02 am

Hello,

I'm on version 19.1.32.0 and I manage to book an appointment via FHIR as described here (in "Use Case 3 –Find an opening and create an appointment"):
https://www.opendental.com/resources/Op ... -1Spec.pdf

However, the resulting appointment for Jon Snow shows its Unscheduled status to "none" and the Confirmed field to "Not Called". How can this be changed to Unscheduled status to "Appointment Scheduled" and the Confirmed field to "Appointment Confirmed"?
Image

My current POST request looks like this:

Code: Select all

[debug] c.FhirApiController - FHIR POST request https://api.opendental.com/fhir/appointment with body
 {"end":"2019-06-12T16:00:00","minutesDuration":60,"participant":[{"actor":{"reference":"Patient/25"},"status":"needsaction","type":[{"code":[{"code":"PART","system":"http://hl7.org/fhir/participant-type"}]}]},{"actor":{"reference":"Practitioner/1"},"type":[{"code":[{"code":"PPRF","system":"http://hl7.org/fhir/participant-type"}]}]},{"actor":{"reference":"Location/1"},"type":[{"code":[{"code":"PART","system":"http://hl7.org/fhir/participant-type"}]}]}],"priority":5,"start":"2019-06-12T15:00:00","status":"booked"}
TIA,
Best regards,
Giovanni

User avatar
cmcgehee
Posts: 711
Joined: Tue Aug 25, 2015 5:06 pm
Location: Salem, Oregon

Re: FHIR API: booking appointment "Unscheduled status" none

Post by cmcgehee » Wed Jun 12, 2019 8:34 am

When booking an appointment, you should leave the Unscheduled Status as none. You only need to set that when the appointment is unscheduled and you want to indicate why it is unscheduled.

To set the Confirmed field to Appointment Confirmed, set the "status" field on the patient participant to "accepted".

Code: Select all

{"end":"2019-06-12T16:00:00","minutesDuration":60,"participant":[{"actor":{"reference":"Patient/25"},"status":"accepted","type":[{"code":[{"code":"PART","system":"http://hl7.org/fhir/participant-type"}]}]},{"actor":{"reference":"Practitioner/1"},"type":[{"code":[{"code":"PPRF","system":"http://hl7.org/fhir/participant-type"}]}]},{"actor":{"reference":"Location/1"},"type":[{"code":[{"code":"PART","system":"http://hl7.org/fhir/participant-type"}]}]}],"priority":5,"start":"2019-06-12T15:00:00","status":"booked"}
To change the appointment back Unconfirmed, set the "status" field to "needsaction".
Chris McGehee
Open Dental Software
http://www.opendental.com

bravegag
Posts: 49
Joined: Fri May 24, 2019 3:37 pm

Re: FHIR API: booking appointment "Unscheduled status" none

Post by bravegag » Wed Jun 12, 2019 9:50 am

Hi,

It works perfectly, thanks!

And finally to cancel an existing appointment how does it work?

TIA,
Best regards,
Giovanni

User avatar
cmcgehee
Posts: 711
Joined: Tue Aug 25, 2015 5:06 pm
Location: Salem, Oregon

Re: FHIR API: booking appointment "Unscheduled status" none

Post by cmcgehee » Wed Jun 12, 2019 11:57 am

There are a couple ways you can do this.

The first way is to change "status" to "noshow". This will change the appointment to a Broken appointment in Open Dental and I believe it will stay on the appointment book.
The other way is to change "status" to "pending". This will send the appointment to the Unscheduled List. It will no longer remain on the appointment book, but the office can find it in their Unscheduled List where they can try to reschedule it at a later date.

Completely deleting an appointment is not support via the API.
Chris McGehee
Open Dental Software
http://www.opendental.com

bravegag
Posts: 49
Joined: Fri May 24, 2019 3:37 pm

Re: FHIR API: booking appointment "Unscheduled status" none

Post by bravegag » Wed Jun 12, 2019 12:46 pm

Hi Chris,

Thanks again, do you have a MVCE POST request? I have tried adapting my create appointment post request changing the status etc but I only get errors e.g.

Code: Select all

{"issue":[{"severity":"error","code":"structure","details":{"text":"'participant[0].status=pending' is not a valid value."}}]}
TIA,
Best regards,
Giovanni

bravegag
Posts: 49
Joined: Fri May 24, 2019 3:37 pm

Re: FHIR API: booking appointment "Unscheduled status" none

Post by bravegag » Wed Jun 12, 2019 1:08 pm

Hi again,

Sorry never mind, I found the use-case in the doc. I think I can make it.

Cheers!

bravegag
Posts: 49
Joined: Fri May 24, 2019 3:37 pm

Re: FHIR API: booking appointment "Unscheduled status" none

Post by bravegag » Wed Jun 12, 2019 3:10 pm

Hi Chris,

Thanks it all works now.

Best!

Post Reply