Unable to overridePrimary Patient Identifier

I have trouble to set up another Patient Identifier Type using OpenMRS 2.1.3 with the ref app 2.8.0. I get a validation error when I want to confirm the new patient:

Here are the steps that I did:

  1. Create a new Patient Identifier Type (ELWA ID) with the required option
  2. Remove the required option from OpenMRS ID
  3. Create a generator for the ELWA ID(Local Pool of Identifiers) and uploaded 8 ID.
  4. Change metadata_uuid in the table metadatamapping_metadata_term_mapping for the emr.primaryIdentifierType code

Am I missing any step?

Thanks for your help

After restarting OpenMRS, does the emr.primaryIdentifierType property maintain the new value that you set? Or does it revert to the old one?

It revert to the old one.

Before restarting, and hence reverting, does it work well?

No, it does not work, both before and after.

Sorry, I was not too clear.

Are you able to successfully register the patient using your equivalent of this page? http://localhost:8080/openmrs/findPatient.htm

Yes, but I have to manually select the ID and check the generate option. But maybe it is the correct behaviour ? Thanks Daniel for your help.

The reference application overwrites your values on restart. Can you instead use the default OpenMRS ID identifier type? Just edit it to have the attributes that you would want for your identifier type. The other alternative is, create a ticket to prevent the overwriting of the custom value for emr.primaryIdentifierType.

OK thanks for the idea. I will try it on Monday.

Hi Daniel,

Following your advice I changed the OpenMRS ID to fit my needs. But I’m now getting the following error: “Validation errors found: Select a preferred identifier”.

I’m able to create a patient using the findPatient.htm form.

I have empty the following table in mysql: idgen_auto_generation_option, idgen_seq_id_gen, idgen_identifier_source, because I needed to change the source from Local Identifier Generator to Local Pool of identifiers. I removed as well the Identifier validator and change the name of the OpenMRS ID.

Does any of this step could affect the validation in the registration app?

Can you share a screenshot of your equivalent for this? https://demo.openmrs.org/openmrs/admin/patients/patientIdentifierType.form?patientIdentifierTypeId=3

Here is the screenshot:


Does it work if you remove the regex format?

No I still have the same error message:

Validation errors found: Select a preferred identifier

Can you share the log at pastebin.com?

Here a short version of the log:


And here the full version of the log:


Are you able to reproduce it here? http://demo.openmrs.org

I just did it now, but I only add a new source without deleting the existing one. However I changed the auto-generation. Sadly I still get the same error.

Anything else I can do to help solve this issue?

Thank you very much for your help Daniel!

I thought you are only changing the attributes of the OpenMRS ID identifier type. Not so? If yes, do you get the same problem when you do it here? https://uat-refapp.openmrs.org/openmrs/admin/patients/patientIdentifierType.form?patientIdentifierTypeId=3

I’m changing the attributes of the OpenMRS ID identifier as follow:


But I also need to create a new source since, my IDs are different:


And I change the source in the auto-generation options:


The file that I use to upload ID in the Local Pool of Identifiers is contains the following line: