Regarding the way we Upload resources to a FHIR store ,
We currently do a POST, ie
POST : fhir_base_url/Patient
Note that , when POSTing , it has the following downsides
- The hapi Fhir server will generate a unique internal id for the new Resource ,this could be sequential or a uuid depending on the server_id_mode
- This can lead to resource duplication ,Because even when the same Resource is POSTed several times , the server will simply assign it a new internal ID
- The final resource ID in the HAPI FHIR server will be different from the original Client (OpenMRS) id which is a uuid .
I would Propose we instead do a PUT ,
PUT : fhir_base_url/Patient/patient_uuid
Note that With PUTing , it has the following benefits ,
- The HapiFhir server will Persist the Client_id ,hence we keep same Resource IDS in the HAPI FHIR as in OpenMRS
- This guards against duplicating data in the HAPI FHIR , Only a new Resource is Created if the Resource Id doesn’t exist yet ,other wise it simply updates the existing resource or doesn’t do anything if there no resource modification.