Unable to overridePrimary Patient Identifier

Tags: #<Tag:0x00007f23d93dfca8> #<Tag:0x00007f23d93dfb18> #<Tag:0x00007f23d93df8c0>

(Nicolas Piaget) #1

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

(Daniel Kayiwa) #2

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

(Nicolas Piaget) #3

It revert to the old one.

(Daniel Kayiwa) #4

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

(Nicolas Piaget) #5

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

Sorry, I was not too clear.

(Daniel Kayiwa) #6

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

(Nicolas Piaget) #7

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.

(Daniel Kayiwa) #8

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.

(Nicolas Piaget) #9

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

(Nicolas Piaget) #10

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?

(Daniel Kayiwa) #11

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

(Nicolas Piaget) #12

Here is the screenshot:


(Daniel Kayiwa) #13

Does it work if you remove the regex format?

(Nicolas Piaget) #14

No I still have the same error message:

Validation errors found: Select a preferred identifier

(Daniel Kayiwa) #15

Can you share the log at pastebin.com?

(Nicolas Piaget) #16

Here a short version of the log:


And here the full version of the log:


(Daniel Kayiwa) #17

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

(Nicolas Piaget) #18

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!

(Daniel Kayiwa) #19

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

(Nicolas Piaget) #20

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: