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
- 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.
-
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 ?