Mapping ContactPoints to OpenMRS

Tags: #<Tag:0x00007f302563b148> #<Tag:0x00007f302563b080>

So one of the things that has come up in our on-going efforts to implement the FHIR module for OpenMRS is how we deal with the ContactPoints FHIR data type. ContactPoints in FHIR represent a means of contacting an individual, for example, a phone, fax, email, pager, etc. In OpenMRS, we think these data are usually stored as Attributes (PersonAttributes, LocationAttributes, ProviderAttributes). That’s all well and good. The problem is in determining the relative priority of the different values (what FHIR calls their “rank”). I.e., if a person has multiple phone numbers, which phone number should we prefer using?

There are two ways to address this that we’ve come up with (thanks to @corneliouzbett and @jecihjoy):

  1. Add a preferred flag to the appropriate *Attribute classes, similar to what is done for PersonName, PersonIdentifier, etc. Alternatively, we could add a “ranking” value similar to the rank in the FHIR data model.

  2. Setup a different *AttributeType to indicate preferred phone number, etc.

The first of these involves making a change to the platform data model, but is otherwise relatively clean. The second of these does not involve changes to the core data model but may involve changes to implementations to, e.g., implement a “Preferred Phone Number” PersonAttributeType.

We thought it would be best to reach out to the OpenMRS community to see if there were any options we hadn’t considered or any preferences one way or the other.

My preferred option is 2

The reason why i do not like adding a preferred field to person attribute types is, unlike PersonName, PersonAddress, or PatientIdentifier, which are a specific type or category of something, person attribute types are too generic that there are many uses of them where the preferred flag does not apply.