Been looking into fhir and how its integrated with OpenMRS. I looked at the the openmrs fhir module and after looking at the code, I came with these diagrams to explain what is happening there. Correct me if I’m wrong.
From the diagram above, it shows that fhir system is built on top of openmrs without any modification of our data model and api which I think is a good thing. The OpenMRS FHIR java api stands as an interface between fhir specific classes and openmrs. My question now is, since this is meant to be used when fhir type resources are requested, it has to be fhir strict. So what happens if a user assuming the system is completely fhir makes a post to say /DiagnosticOrder. What do we do with fields in DiagnosticOrder that we don’t have in our data model. Do we just ignore them or what? And also I’m curious as to how the decision to map fhir resources to openmrs data model is made. For example we have RadiologyOrder in radiology. While looking at http://hl7.org/fhir/DSTU2/diagnosticorder.html which just became an old specification, there are 3 resources that can work as RadiologyOrder. We have DiagnosticOrder, ReferralRequest, and ProcedureOrder. I understand what all the three fhir resources mean as explained by the spec but it would seem RadiologyOrder is used for all 3 purposes. So in building the fhir module, how do we decide that radiology orders will map to DiagnosticOrder, ReferralRequest or ProcedureOrder?
NOTE: These are not uml diagrams. I didn’t have any other tool to express what I want so I used uml components but they by no means bare uml meaning. The arrows just show which components interact with which.