Just to share some info on a potential problem.
As an example, lets say that you’re POSTing a FHIR patient resource into OpenMRS. Now, a Patient resource may be linked to other resources (etc. location) In most cases, the Patient resource will have a link to the location resource. basically, we’ll capture the patient resource, identify the location its pointing to using its UUID, and then store the patient.
Now, problem is, what to do if the UUID is for a Location that doesn’t already exist in OpenMRS? HAPI doesn’t provide any in built functionality to make a return call on the client server, and ask it to POST the missing location to us.
At this point, we have the following options:
- (a) make sure that these resources are sent as contained resources within the parent resource, and not as references
- (b) post references only to sub resources that already exist in OpenMRS
- © inform our clients to post resources in proper order, so that they don’t encounter any missing data