How to generate patient Identifier in patient registration.

Hello There, I am trying to post the api /patient but I don’t know how to generate the patient identifier because . I am thinking of auto generated identifier hence I am passing null to patient identifier. 'But in response showing bad request as message identifier should not be null or blank. Thanks

@atiq does this help

Thanks for the response @gcliff actually end point is working but I need to pass the unique identifier each time Is there any way to put it on server to generate identifier for the patient.

@atiq the patient identifier you pass wont be approved by the validator if its not the right format in openmrs unless you set the identifier validator to none here https://qa-refapp.openmrs.org/openmrs/admin/patients/patientIdentifierType.form?patientIdentifierTypeId=3

1 Like

How about first generating the identifier via REST like: https://qa-refapp.openmrs.org/openmrs/ws/rest/v1/idgen/nextIdentifier?source=1

1 Like

I will try it, Thanks @gcliff for the response.

Oh cool !!! that is what I am looking for. Thanks @dkayiwa for this.

Or this: http://demo.openmrs.org/openmrs/module/idgen/generateIdentifier.form?source=1&username=admin&password=Admin123

2 Likes

showing “message”: “Resource does not exist. Please check documentation for implemented resources and their paths [Unknown resource: v1/idgen/nextIdentifier]”,

Already have idgen module.

That requires the latest snapshot version (4.7.0-SNAPSHOT) of the idgen module. Alternatively, you can use the second link that i sent.

1 Like

Is it compatible with 2.3.0 openmrs-core

Oh yes man! :slight_smile:

1 Like

Yes @dkayiwa its working updated idgen module. Thanks a ton.