How to add new fields in Patient Registration?

Hi, i am completely new in OpenMrs. I need to add some new fields in the Registration Patient,.I have been able to create but when i save the patient record the values are not save in the DB. Eventually i create the personne attribute and i add ID in the JSON app. still the values are not stored in the DB.

Your help will be appreciate.

Hi @ornella, hoping you are utilising the Registration+App+Configuration documentation, how does your JSON config look like? You could share it via

Thank you, here is JSON config:

You probably will have to ensure the Person Attribute Types you created are configured accurately ensuring their uuids and their corresponding uicommons widgets match. Also remember to format the JSON config so you are able to clean it up before using it, for example the config you shared has an empty question.

Hi @ruhanga, thank you for your help. Please where can i see the uicommons widgets to ensure that it corresponds to the uuids? As you can see below here is my uuids for the “Assurance Medicale” that i have created.

@ornella, sorry about the misinformation. I meant that the widget configuration should relatively match the added Person Attribute Type for example, “Assurance Medicale” person attribute type should be saved with a format expected by the widget i.e. java.lang.String instead of java.lang.Integer.


There exist a number of such built in fragment widgets you can use with the Reference Application 2.x. Such could be found here and here or perhaps develop your own custom ones via a module. From the above snippet, the providerName is the name of the module providing the widget, fragmentId is the path to the widget relative the module’s webapp's folder and the config is the json config that the widget expects.

There is more to fragments documented here you can refer to @ornella.

Ok thank you, let me try it right now.

@ruhanga thank you for your help but still getting the same result when i add a new section i can only see it when i register the new patient as you can see below:

But if i try to edit the registration informations the new section does not appear , only Demographic and the contact info sections

I think i follow all the steps, here is the JSON configuration { "id":"referenceapplication.registrationapp.myRegisterPat", "instanceOf -

@ruhanga please can you advise me where i can find the global property as shown below

@ornella, could you troubleshoot the problem by replacing the appId in the url to point to your custom app-definition id, i.e. appId=referenceapplication.registrationapp.myRegisterPat to see if you get all your defined sections and fields?

@ruhanga i did it

And does it resolve the problem @ornella?

Hi @ruhanga it does not resolve here is the result that i get. i can only see the new section only on registration process

but when i want to edit the registration information see the error

it says “java.lang.StringIndexOutOfBoundsException: String index out of range: -1”

here is the JSON config { "id": "referenceapplication.registrationapp.registerPat", "instanceO -

@ornella could you take note of and ensure the following

NB .Ensure your new Id contains a string " registerPatient" say “referenceapplication.registerPatient.MyRegister” as that string will be required when Generating a comprehensive registration summary ID when you try to acces the Edit registration link to the Registration Summary Page

… from the documentation?

@ruhanga yes you are right Thank you, now it’s working

@ruhanga thank you again, i add some more person attributes in the registration app. Now i am trying to add a dropdown widget with concept-set Civil Status following the documentation Registration App Configuration - Documentation - OpenMRS Wiki

After saving, unfortunately the status does not appear as you can see below

i do not know if i missed a step here is my code { "id": "referenceapplication.registerPatient.myregisterPat", "instanc -

@ornella could you correct this below and use the correct uuid in your config?

when i change it, see the error that i get below

@ruhanga when i change i get this error

here is the JSON file { "id": "referenceapplication.registerPatient.myregisterPat", "instanc -