How to add new fields in Patient Registration?

the error shows that the id you are trying to use already exists, make sure that you are using a different app Id on the (ID APP) section and don’t forget to update your json file with it

i fixed it, thank you

1 Like

@ruhanga @herber24 when i register a new patient it get this error message

it means you are using a wrong uuid let me look at your current json file

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

the problem is the civil status when i remove the code, i am able to regiter a new patient everything works fine.

with the civil status code i got now this error

it says: Unrecognized field “legend” (Class org.openmrs.module.registrationapp.model.Section)

here is the JSON file with the civil status { “id”: “referenceapplication.registerPatient.myregisterPat”, "instanc - Pastebin.com

What exactly are you trying to do @ornella? Your configuration seems to be evolving, working and at times failing. Do you have a fairly final registration configuration(App definition) that you’d want help getting it to work?

Otherwise just for the most recent config above, could you re-try it and share the exact error traces you get?

Sorry if i was not clear, everything is working except when i add the new field with the dropdown widget concept-set civilt status. i dit what you said @ruhanga with uuid now i get this error when i try to register a new patient

This is the error that when i click on “register a patient”, it says "Unrecognized field “legend”

my final JSON config { “id”: “referenceapplication.registerPatient.myregisterPat”, "instanc - Pastebin.com Thank you for your help

@ornella I suppose you are adding Civil status as a subsection in which case your final config would look like this. Remember to format the json before using so you are visually able to correct your app definition configs. jsonformatter is one good online tool to do so.

@ruhanga thank you a lot, now everything works fine. I do not know if you have any idea the code for html form to get the value from the registration. Here is what i use to get the value .

Civil Status

it displays the concepId not the value

How are you generating the above result and for what reason @ornella, could you briefly explain?

I would like to display the value that i fill in the registration process in my form. here is the html code that i use

			<tr><td>Civil Status:</td>
			<td><lookup class="value" expression="personAttributes.get('Civil Status').name.name"/></td>
		</tr>

i succeed to display all the new fields that i add in the registration app except for the civil status as you can see below. It displays the conceptId

@ornella if configured correctly the person attribute should display as expected. Could you share screen-shots of the concepts you created, both the concept set consumed in the registration app-definition, the question concept configured for the person attribute type and the person attribute type as-well?

@ruhanga here is what i did, i create one concept Civil status which i set the members

here is the personn Attribute

@ornella, could you add the concept Id as the Foreign Key to the person attribute type and try again?

@ruhanga yes i have already done it but it did not work

Could you share the html form definition?

@ornella alternatively you could try to reproduce the issue at demo.openmrs.org with a simple registration app and html form involving the concept person attribute type so we can assess the issue together.

@ i did the same steps using the demo demo.openmrs.org it is working. So what can be the problem?

@ruhanga thank you it is working now the problem was the html code here is the correct one:

<tr><td>  Civil Status:</td><td><lookup class="value" expression="personAttributes.get('CivilStatus').name.name"/></td></tr>