Validate patient identifier on html form

I need to build an html form that would take in patient identifier and that field should be able to validate if the identifier exists for another patient before submiting.

Any clue as to how I could do this on openmrs html form module is much appreciated.

Are you using this to register new patients?

No I am not, the patient would be registered before the form would be filled, the field is just a way of collecting additional ID for that patient.

Can you describe the exact use case in detail?

take for example a client needs to be tested for HIV via the client intake form.

step 1: register the client as a patient on openmrs. step 2: fill the client intake form for the patient.

Note: The client intake form for HTS contains two(2) additional IDs for the patient namely: client code and recency Id. so I need to capture these IDs as patient identifier for that patient…not as concepts.

What I have achieve so far: on the form I could use the patient tag to capture the data for client code and that works but when I try to use another patient tag to capture the recency ID that breaks the form…and it refuse to submit.

Did you evaluate registering the patient using this form? https://uat-refapp.openmrs.org/openmrs/registrationapp/registerPatient.page?appId=referenceapplication.registrationapp.registerPatient

Or this? https://uat-refapp.openmrs.org/openmrs/admin/patients/shortPatientForm.form?addName=Moris+Somesingi&addBirthdate=&addAge=88&addGender=M

Yes Daniel, that was what I meant by step 1. so the patient first be registered using https://uat-refapp.openmrs.org/openmrs/registrationapp/registerPatient.page?appId=referenceapplication.registrationapp.registerPatient

then from the patient dashboard the client intake form would be filled.

How about using this to add more identifiers? https://uat-refapp.openmrs.org/openmrs/admin/patients/shortPatientForm.form?patientId=57

Where can I find the source code for that form, I need to verify the form tags used on the form.