I am getting the following error in the http response while trying to create a patient using “Old Identification Number” as an identifier type.
https://pastebin.com/pfU7xXZd
I have actually created a patient create component which is having option for all the identifier types. While selecting either OpenMRS ID or Openmrs Identification Number, it works fine. I tested the Openmrs id type by generating id’s through module id-gen and for Openmrs Identification Number, it throws a genuine error that the id generated is not for the validation scheme "Luhn CheckDigit Validator ". So, this makes sense. But in case of Old Identification Number, I am getting that I am missing a required identifier “OpenMRS ID”.
If we go as per this reference, I haven’t missed any required field needed in order to create a patient (as both identifier types except this one are working fine).
So, Am I missing something or is it normal to get this error with an invalid identifier.
I didn’t even found any patient record having old identification number to get some reference. So, its getting a bit tougher to find the reason for this error.
Note : I am using openmrs standalone platform v2.6.0
Patient is missing the following required identifier(s): OpenMRS ID
This is the error message. It means that you are trying to create a patient without a value for one or more of the required identifiers (in this case OpenMRS ID). Query the identifierType resource and note which identifiers have "required": true. There must be a value for all of those identifiers when creating a patient.
While selecting either OpenMRS ID or Openmrs Identification Number, it works fine.
You said that you got a validation error when trying Openmrs Identification Number. My suspicion is that if you try with a value that passes the Luhn check, you will get the same error as above if you try to create the patient without a value for OpenMRS ID (because this identifier is configured as required).
That means that only OpenMRS ID is required. In other words, there must always be a value for the OpenMRS ID identifier when creating a patient.
So, when you try to create patient with only a value for Old Identification Number (and not for OpenMRS ID), then you will see the error you posted above.
As the refapp only presents me the patient data with the “OpenMRS ID” identifier, so I was wondering, is there any way to search patients through their identifiertype ? or do you have any patient data having identifier type as “old identification number” ? so that I can get an idea of the structure i.e where to put the OpenMRS Id in the json structure while creating patient.
I went through this example, but here also openmrs id is used as the identifier type.