Proposed OpenMRS Domain Object to FHIR Resource Mapping
Shown below is an example of how a number of OpenMRS module objects would map to FHIR resources, as proposed by @Grahame Grieve.
The left side of the relationship indicates the OpenMRS attribute, while the right indicated the FHIR resource mapping.
Patient
Integer patientId :: n/a - unused
Set<PatientIdentifier> identifiers :: Patient.identifier
Integer patientIdentifierId :: not mapped
Patient patient :: not mapped
String identifier :: patient.identifier.value
PatientIdentifierType identifierType ::
Integer patientIdentifierTypeId :: mapping table, type id ==> URL
String format :: not mapped
Boolean required = Boolean.FALSE :: not mapped
String formatDescription :: not mapped
Boolean checkDigit = Boolean.FALSE :: not mapped
String validator :: not mapped
LocationBehavior locationBehavior :: not mapped
UniquenessBehavior uniquenessBehavior :: not mapped
Location location :: Patient.identifier.assigner (URL)
Boolean preferred = false :: if true, Patient.identifier.use = usual
Person
Integer personId :: [base]/Patient/[personId]
Set<PersonAddress> addresses = null :: Patient.address
Integer personAddressId :: not mapped
Person person :: not mapped
Boolean preferred = false :: Patient.address.use ? mapping
String address1 :: Patient.address.line
String address2 :: Patient.address.line
String address3 :: Patient.address.line
String address4 :: Patient.address.line
String address5 :: Patient.address.line
String address6 :: Patient.address.line
String cityVillage :: Patient.address.city
String countyDistrict :: Patient.address.extension : "http://hl7.org/fhir/Profile/iso-21090#address-part-county", valueString
String stateProvince :: Patient.address.state
String country :: Patient.address.country
String postalCode :: Patient.address.zip
String latitude :: Patient.address.extension -> Location
String longitude :: Patient.address.extension -> Location
Date startDate :: Patient.address.period.start
Date endDate :: Patient.address.period.end
Set<PersonName> names = null :: Patient.name
Integer personNameId :: not mapped
Person person :: not mapped
Boolean preferred = false :: Patient.name.use = usual
String prefix :: Patient.name.prefix
String givenName :: Patient.name.given
String middleName :: Patient.name.given
String familyNamePrefix :: folded into Patent.name.family (else, Patient.name.family with extension http://hl7.org/fhir/Profile/iso-21090#name-qualifer, valueCode = PFX)
String familyName :: Patent.name.family
String familyName2 :: Patent.name.family
String familyNameSuffix :: Patent.name.suffix
String degree :: Patent.name.suffix
Set<PersonAttribute> attributes = null ::
integer personAttributeTypeId :: mapping table that defines how attributes map - whether existing elements or extensions
String value :: depends on mapping
String gender :: Patient.gender (mapped: code = M or code = F, code system is http://hl7.org/fhir/v2/0001)
Date birthdate :: Patient.birthDate
Boolean birthdateEstimated = false :: Extension if worth mapping
Boolean deathdateEstimated = false :: Extension if worth mapping
Boolean dead = false :: if true, and no date, then Patient.deceasedBoolean= true
Date deathDate :: Patient.deceasedDate
Concept causeOfDeath :: Patient.extension
User personCreator :: not mapped (would be in provenance if worth mapping)
Date personDateCreated :: not mapped (would be in provenance if worth mapping)
User personChangedBy :: not mapped (would be in provenance if worth mapping)
Date personDateChanged :: not mapped (would be in provenance if worth mapping)
Boolean personVoided = false :: if true, Patient.active = false, else Patient.active = true
User personVoidedBy :: not mapped (would be in provenance if worth mapping)
Date personDateVoided :: not mapped (would be in provenance if worth mapping)
String personVoidReason :: not mapped (would be in provenance if worth mapping)
boolean isPatient :: not mapped
Obs
String accessionNumber :: Observation.identifier
String comment :: Observation.comments
ComplexData complexData :: -- not mapped --
Concept concept :: Observation.Name
Encounter encounter :: Observation.extension http://resources.openmrs.org/doc/fhir/profiles/vitalsigns.xml#encounter "Indicates that the information in the resource was gathered at a particular location"
Set<Obs> groupMembers:: Observation.relatedItem.target (type = has-component)
Location location :: Observation.extension http://resources.openmrs.org/doc/fhir/profiles/vitalsigns.xml#location
Date obsDatetime :: Observation.appliesDateTime
Obs obsGroup:: n/a - back links are implicit not explicit
Integer obsId :: n/a - goes in the URL e.g. [base]/Observation/[obsId]
Order order :: not mapped (at least for now)
Person person :: Observation.subject
Integer personId :: not mapped
static long serialVersionUID :: not mapped
Concept valueCoded :: Observation.valueCodeableConcept
ConceptName valueCodedName :: Observation.valueCodeableConcept
String valueComplex :: Observation.valueAttachment
Date valueDatetime :: Observation.valueDateTime
Drug valueDrug :: Observation.valueCodeableConcept
Integer valueGroupId :: not mapped
String valueModifier :: not mapped
Double valueNumeric :: Observation.valueQuantity
String valueText:: Observation.valueString
Location
FHIR Family history resource is map to patient's relations in OpenMRS as follow
FamilyHistory
FHIR Encounter resource is map with both the visit and encounter of OpenMRS. Below shows the mapping of encounter resource of OpenMRS to FHIR Encounter
Encounter
Below shows the mapping of visit resource of OpenMRS to FHIR Encounter
Encounter
OpenMRS Encounter is map to FHIR composition resource