# Patient Identifier Validation not working properly

**URL:** <https://talk.openmrs.org/t/patient-identifier-validation-not-working-properly/27017>\
**Category:** Bahmni\
**Created:** [February 26, 2020, 5:41am UTC](https://talk.openmrs.org/t/patient-identifier-validation-not-working-properly/27017 "2020-02-26T05:41:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sonarvanashri](https://talk.openmrs.org/letter_avatar/sonarvanashri/32/6_22734026db12803ebb3e059622ac3534.png) [@sonarvanashri](https://talk.openmrs.org/u/sonarvanashri)\
**Post date:** [February 26, 2020, 5:41am UTC](https://talk.openmrs.org/t/patient-identifier-validation-not-working-properly/27017/1 "2020-02-26T05:41:32Z")

</div>

Hello Team,

Patient Identifier Validation is not working properly on Bahmni EMR registration page.

While creating any new additional patient identifier, validation changes are not getting reflected.

Validations like:

- min length
- max length
- suffix
- base character value
- auto generation

Eg. Even if “Min Length” is set as 4 and “Max Length” is set as 12 for the identifier,on UI the identifier field accepts any number of characters.

Also even if “Base Character Set” validation is set to only numbers, it accepts alphabetical characters.

In Auto-Generation Options if “Manual Entry Enabled?” option is selected, identifier is auto generated when the form is saved.

Even if form is saved without entering any value in the identifier field, an auto generated ID is saved against that form.

 ![identifier_validation3](https://talk.openmrs.org/uploads/default/original/2X/8/840f1d04e2b794bf9edbed6e2b633a534ac643af.png)

Please suggest the steps, if I am missing anything to configure.

---

<div class="post-metadata">

**Author:** ![rajasijaywant](https://talk.openmrs.org/letter_avatar/rajasijaywant/32/6_22734026db12803ebb3e059622ac3534.png) [@rajasijaywant](https://talk.openmrs.org/u/rajasijaywant)\
**Post date:** [February 27, 2020, 1:34pm UTC](https://talk.openmrs.org/t/patient-identifier-validation-not-working-properly/27017/2 "2020-02-27T13:34:22Z")

</div>

@sonarvanashri,

For achieving above scenario we can configure the “Patient Identifier Type” with following steps:

- Go to openmrs (login as superman)

- Navigate to [Manage Identifier Types](https://demo.mybahmni.org/openmrs/admin/patients/patientIdentifierType.list).

- Click on “Add Patient Identifier type” and fill the details like the following screenshot (i.e. Aadhar Card).

 ![OpenMRS_max_length](https://talk.openmrs.org/uploads/default/original/2X/5/5ece96e1ca0952be2ed75c807acf94926e941f6f.png)

 ![Patient Registration](https://talk.openmrs.org/uploads/default/original/2X/b/b5165c41a2d2189ae987b2da0a5a9ba4f43ed643.png)

- Copy the UUID of Aadhar Card Patient Identifier type

- Navigate to [Advanced Settings](https://192.168.33.10/openmrs/admin/maintenance/globalProps.form) in that add UUID to bahmni.extraPatientIdentifierTypes

- Then you can check if you achieved your validation scenario.

---

<div class="post-metadata">

**Author:** ![sonarvanashri](https://talk.openmrs.org/letter_avatar/sonarvanashri/32/6_22734026db12803ebb3e059622ac3534.png) [@sonarvanashri](https://talk.openmrs.org/u/sonarvanashri)\
**Post date:** [March 2, 2020, 6:54am UTC](https://talk.openmrs.org/t/patient-identifier-validation-not-working-properly/27017/3 "2020-03-02T06:54:13Z")

</div>

Thanks @rajasijaywantI am now able to put validations for identifier with above scenario.
