Customise display order of First name, Last name and Middle name in Patient registration in EMR

We have Registration Page, where display order of First Name, Middle Name and Last Name for Patient Name field is fixed.

We need to make this configurable. As discussed in PAT call [Dated: 3 June 2020], will make this change, as below: 1. Introduce a configuration to change the order of names 2. An array of strings to show the names Note: backward compatibility

As per Bahmni default config First Name is mandatory, where as hide/show options exists for middleName and lastName

For reordering option that we are creating for Patient Name (FirstName, MiddleName and LastName) using array ,

"nameFieldsOrder": ["firstName", "lastName", "middleName"]

This array should always contain all the three fields (FirstName, MiddleName and LastName) in the order which they should appear and we will still use existing hide/show options of config for middleName and lastName

The array that we are creating will have below features

  1. Should always contain all the three fields FirstName, Middle Name and LastName in desired order For instance, if user wants only FirstName and LastName to be displayed, array will look
   "nameFieldsOrder": ["firstName", "lastName", "middleName"]

and existing setting “showMiddleName” needs to be set to false.

2 . If the array is not declared properly, it will fall back to default order of display which is (FirstName, MiddleName and LastName) For instance, if array is declared with only 2 values

    "nameFieldsOrder": ["firstName", "lastName"]

then settings will fall back to default value which is (FirstName, Middle Name and LastName) always.

  1. If array is declared with some inappropriate values like

     "nameFieldsOrder": ["firstName", "abcd", "middleName"],
    

even in this case, then settings will fall back to default value which is (FirstName, Middle Name and LastName) always.

Backword Compatability: If array is NOT defined in config, even in this case, settings will fall back to default value which is (FirstName, Middle Name and LastName) always.

Please let me know your thoughts on this and is the approach fine ?

renamed “nameFieldsOrder” to “patientNameDisplayOrder”

"patientNameDisplayOrder": ["firstName", "lastName", "middleName"]

Thanks @neha.

What’s the impact of this?

  1. Just for patients, on the registration page.
  2. Just for patients, anywhere where a patient name displays.
  3. Potentially beyond patients, anywhere where a person name displays.

This would affect how you’d name that config IMO. If the latter this could become something like personNameDisplay or personNameDisplayConfig.

As for the content of the array, I’d stick to the field member names from PersonName, eg.:

"personNameDisplay": ["givenName", "middleName", "familyName"]

@jdick @nickjhill, something you may want to consider as well?

Hello @mksd,

Impact of this change is only for Registration Page.

Regarding Field member names, I have name them as per the placeholder values that get displayed in UI for the respective fields.

“patientNameDisplayOrder”: [“firstName”, “middleName”, “lastName”]