Page 1 of 1

API to update appointment status

Posted: Wed Feb 05, 2020 10:06 pm
by arm5060
Hello,

I need a small help regarding updating Appointment status to confirmed/cancelled etc using API.
I do have appointment ID.

Can any one provide me sample request to do it?

Much appreciated.

Thanks,
Arpit

Re: API to update appointment status

Posted: Thu Feb 06, 2020 7:49 am
by cmcgehee
When you GET an appointment, you will see there is a participant where the actor is a patient. One of the fields on the participant object is "status". This will be "needsaction" when the patient has not confirmed the appointment and will be "accepted" once the patient has confirmed. You can send a PUT request to change the status to accepted. Keep in mind that you have to include all other fields in your request so that don't inadvertently change a different field. Here is an example PUT request to change an appointment to confirmed:

Code: Select all

{
  "resourceType": "Appointment",
  "status": "booked",
  "priority": 1,
  "description": "CmpEx",
  "start": "2020-03-20T14:20:00",
  "end": "2020-03-20T15:00:00",
  "minutesDuration": 40,
  "participant": [{
      "type": [{
          "coding": [{
              "system": "http://hl7.org/fhir/participant-type",
              "code": "PART",
              "display": "Participation"
            }
          ]
        }
      ],
      "actor": {
        "reference": "patient/149",
        "display": "Hannah Abbott"
      },
      "required": "required",
      "status": "accepted"
    }, {
      "type": [{
          "coding": [{
              "system": "http://hl7.org/fhir/participant-type",
              "code": "PPRF",
              "display": "primary performer"
            }
          ]
        }
      ],
      "actor": {
        "reference": "practitioner/1",
        "display": "Madame Pomprey, DMD"
      },
      "required": "required",
      "status": "accepted"
    }, {
      "type": [{
          "coding": [{
              "system": "http://hl7.org/fhir/participant-type",
              "code": "PART",
              "display": "Participation"
            }
          ]
        }
      ],
      "actor": {
        "reference": "location/3",
        "display": "OP-3"
      },
      "required": "required",
      "status": "accepted"
    }
  ],
  "basedOn": [{
      "reference": "servicerequest/7854856268706751589",
      "display": "CmpEx"
    }
  ]
}
To indicate that a patient will not show up for their appointment, set the "status" on the Appointment resource to "noshow". This will display as a broken appointment within Open Dental. Here's an example:

Code: Select all

{
  "resourceType": "Appointment",
  "status": "noshow",
  "priority": 1,
  "description": "CmpEx",
  "start": "2020-03-20T14:20:00",
  "end": "2020-03-20T15:00:00",
  "minutesDuration": 40,
  "participant": [{
      "type": [{
          "coding": [{
              "system": "http://hl7.org/fhir/participant-type",
              "code": "PART",
              "display": "Participation"
            }
          ]
        }
      ],
      "actor": {
        "reference": "patient/149",
        "display": "Hannah Abbott"
      },
      "required": "required",
      "status": "accepted"
    }, {
      "type": [{
          "coding": [{
              "system": "http://hl7.org/fhir/participant-type",
              "code": "PPRF",
              "display": "primary performer"
            }
          ]
        }
      ],
      "actor": {
        "reference": "practitioner/1",
        "display": "Madame Pomprey, DMD"
      },
      "required": "required",
      "status": "accepted"
    }, {
      "type": [{
          "coding": [{
              "system": "http://hl7.org/fhir/participant-type",
              "code": "PART",
              "display": "Participation"
            }
          ]
        }
      ],
      "actor": {
        "reference": "location/3",
        "display": "OP-3"
      },
      "required": "required",
      "status": "accepted"
    }
  ],
  "basedOn": [{
      "reference": "servicerequest/7854856268706751589",
      "display": "CmpEx"
    }
  ]
}

Re: API to update appointment status

Posted: Mon Sep 14, 2020 12:03 pm
by poonam
Hi,

I am trying to cancel the appointment through API call but it gives server error.

I am using following body-code with PUT request for updating the appointment status.

Code: Select all

{
                "status": "cancelled",
                "priority": 5,
                "description": "Flo",
                "start": "2020-09-15T16:00:00",
                "end": "2020-09-15T16:45:00",
                "minutesDuration": 45,
                "participant": [
                    {
                        "type": [
                            {
                                "coding": [
                                    {
                                        "system": "http://hl7.org/fhir/participant-type",
                                        "code": "PART",
                                        "display": "Participation"
                                    }
                                ]
                            }
                        ],
                        "actor": {
                            "reference": "patient/13",
                            "display": "test"
                        },
                        "required": "required",
                        "status": "needsaction"
                    },
                    {
                        "type": [
                            {
                                "coding": [
                                    {
                                        "system": "http://hl7.org/fhir/participant-type",
                                        "code": "PPRF",
                                        "display": "primary performer"
                                    }
                                ]
                            }
                        ],
                        "actor": {
                            "reference": "practitioner/3",
                            "display": "Practitioner"
                        },
                        "required": "required",
                        "status": "accepted"
                    },
                    {
                        "type": [
                            {
                                "coding": [
                                    {
                                        "system": "http://hl7.org/fhir/participant-type",
                                        "code": "PART",
                                        "display": "Participation"
                                    }
                                ]
                            }
                        ],
                        "actor": {
                            "reference": "location/1",
                            "display": "OP-1"
                        },
                        "required": "required",
                        "status": "accepted"
                    }
                ],
                "basedOn": [
                    {
                        "reference": "servicerequest/40"
                    }
                ],
                "reasonReference": []
}

The response for the same is

Code: Select all

{
    "resourceType": "OperationOutcome",
    "issue": [
        {
            "severity": "error",
            "code": "exception",
            "details": {
                "text": "The server has encountered an error."
            }
        }
    ]
}
On the other hand, when I am trying status from the below list:
proposed | pending | booked | arrived | fulfilled | cancelled | noshow | entered-in-error | checked-in | waitlist
Only booked and no-show works.

So please let me know how to change status from booked to cancelled through API?

Thanks in Advance!

Re: API to update appointment status

Posted: Mon Sep 21, 2020 10:57 am
by cmcgehee
We've committed the fix for this error. It will be available in 20.2.44 and 20.3.27. We still might have some more work to do after this because we noticed that when using the status "cancelled" it will give the appointment a status of "noshow".

Re: API to update appointment status

Posted: Tue Sep 22, 2020 9:48 am
by poonam
Hi Chris,

Thank you for your response and we will update the opendental once next version will be released. Also can you help me with finding free slots from multiple operatory in single API call?

For example,
https://api.opendental.com/fhir/v2/slot ... tatus=free
here, we get free slots from operatory 1 and in the same api call if we want free slots from operatory 2 and 3 as well then how to define the condition in API header.

Appreciate your help and time with this!

Sincerely,
Poonam

Re: API to update appointment status

Posted: Mon Sep 28, 2020 8:22 am
by cmcgehee
Poonam,

You should be able to use commas to include multiple schedules to get slots for multiple operatories in one request. For example:

Code: Select all

https://api.opendental.com/fhir/v2/slot?schedule=20200921L1,20200921L2,20200921L3&status=free

Re: API to update appointment status

Posted: Mon Sep 28, 2020 1:04 pm
by poonam
Hi Chris,
Thank you for your reply!

I tried using comma but I am getting response for only last schedule given in the parameters list.

For eg,

Code: Select all

https://api.opendental.com/fhir/v2/slot?schedule=20200921L1,20200921L2,20200921L3&status=free
For the above request I am getting response only for schedule 20200921L3.

Appreciate your time!

Sincerely,
Poonam

Re: API to update appointment status

Posted: Mon Sep 28, 2020 5:19 pm
by cmcgehee
Would you mind telling me the version of Open Dental the database is on that you are sending requests to? In 20.2.29 we fixed an issue that had to do with Slots.

Re: API to update appointment status

Posted: Wed Sep 30, 2020 1:00 pm
by poonam
Hi Chris,

The version of opendental that we are using is 20.2.40.0 which was last updated on 09/10/20.

Thanks and regards,
Poonam

Re: API to update appointment status

Posted: Mon Oct 05, 2020 2:00 pm
by cmcgehee
Thanks, I'll have one of our engineers look into this issue.

Re: API to update appointment status

Posted: Fri Oct 16, 2020 1:36 pm
by poonam
Hi Chris,

Any update on passing multiple schedule?

Thanks,

Re: API to update appointment status

Posted: Mon Oct 19, 2020 11:33 am
by rochelle
Poonam,
I apologize for the delay in getting back to you. I have investigate this and you are correct, presently we only return the slots for 1 schedule. I will be creating a fix for this and will update this thread the moment it is live.

Re: API to update appointment status

Posted: Tue Oct 20, 2020 11:12 am
by poonam
Thank you for your reply!

Hope to receive the update soon on this.

Thanks,
Poonam

Re: API to update appointment status

Posted: Tue Dec 08, 2020 5:44 am
by rochelle
This problem should be fixed now, please let me know if you have further concerns.

Re: API to update appointment status

Posted: Tue Dec 29, 2020 12:06 pm
by poonam
Hi,

I am trying to get all the free slots for all the operatories of a particular day using

Code: Select all

https://api.opendental.com/fhir/v2/slot?schedule=20201230L2,20201230L1,20201230L3&status=free
But, I am getting for only 20201230L3 so just wanted to check am I using right endpoint with multiple parameters?

Please suggest!

Thanks and regards,
Poonam

Re: API to update appointment status

Posted: Wed Jan 06, 2021 8:00 am
by rochelle
Your request looks good to me. When I test this on my side, I return both operatories. This makes me curious if there is a schedule for the other locations in your request for the given day? or that maybe those operatories do not have providers? It's hard to say without seeing your set up but I can say that testing it on my side with a day that had completely open schedules in multiple operatories, which had providers attached to them, did return all the locations. If this is not helpful, I may request calling in to see what your setup is like and if we can help you more directly.

Re: API to update appointment status

Posted: Thu Jan 21, 2021 12:02 pm
by poonam
Hi,

Thank you for your response!
If I check the above operatory individually then I get free slot for each of them. So schedules are open I assume, but if you want to see the set up then let me know the best way to connect.

Thank you again!

Re: API to update appointment status

Posted: Fri Jan 22, 2021 10:45 am
by jordansparks
I don't like the logic in the FHIR API for this. It assumes that you have attached a schedule to an operatory, which is not how most users do it. Usually, you attach a schedule to a provider and then a provider to an operatory. So the FHIR API will miss those. The new non-FHIR API will get it right so that it always matches what you see in the Appointments module.

Re: API to update appointment status

Posted: Mon Jun 28, 2021 1:44 pm
by poonam
Hi,
Can we connect your technical team to know about getting the free slots for a week time in one API call?

Thanks and regards,
Poonam

Re: API to update appointment status

Posted: Mon Jun 28, 2021 3:13 pm
by jordansparks
I will answer this over in the API forum.