Notifications
Clear all

How to obtain Appointment ID after Creating an Appointment


(@derek)
Eminent Member
Blev medlem: 4 månader sedan
Inlägg: 20
Topic starter  

I'm wondering how to reliably discover the appointment ID for the newly created appointment, so that this may be chained in further operations. I note that when a new appointment is created, the HTTP response status code is: 201 - Created, but the response body is empty! Is this normal? I would have expected the body to return at the very least the appointmentID of the newly created appointment?

Otherwise, how do you find out what the appointment ID is for the newly created appointment? Do you have to run a subsequent query for a list of appointments for that patient and try to figure out the correct appointmentId based on the start and end dates? (As retrieving appointments like this doesn't return the timeslot Id either!).
e.g. ` https://api.openservices.cambio.se/fhir/Appointment/_search?patient:identifier=urn:oid:1.2.752.129.2.1.3.1|<patientIdentifier>`

Having to try to search and match for the appointment resource that you've just created in order to figure out what the appointment Id is seems awfully fragile, prone to ambiguities and inefficient. Is there an alternative way of obtaining the appointment ID for newly created appointments that I may have missed?

Thank you!

Note: This question was raised in this thread ( https://www.cambio.se/sv/innovationsforum/postid/4646/) but I was afraid that it may have got buried and gone unnoticed, so I've surfaced it in a new thread since the answer is important to me. Apologies for any duplication!


   
Citera
(@derek)
Eminent Member
Blev medlem: 4 månader sedan
Inlägg: 20
Topic starter  

An additional point to note is that other FHIR based systems return the newly created appointment object in the response body as you would expect, which also therefore includes includes appointment id#, which is what I'm looking for.

e.g. This other/alternative FHIR based API (also based on Hapi FHIR) behaves like this and returns the appointment object:-

http://hapi.fhir.org/baseR4/Appointment

Posting to that particular system would return the appointment object like this, containing the id# :-

{
    "resourceType": "Appointment",
    "id": "44348408",

    ...etc...
}

 

It would be great if the Cosmic FHIR api for resource object creation could do something similar! 
Or maybe it does and I'm just missing something?

Thanks again!

Derek


   
SvaraCitera