500 Error Can't POST Patient into OpenMRS

I have spun up the demo version of OpenMRS in docker and am not able to POST a patient via the FHIR interface. I am getting the following error.

"‘Patient#null’ failed to validate with reason: Select a preferred identifier"

Is there something i need to setup in order to get OpenMRS to create a Patient and assign an OpenMRS ID?

Does the FHIR2 module require the resources to contain an external number of some sort?

I haven’t; been able to find much in the docs on the config required to Create New patients via the FHIR Interface

This isn’t a requirement of the FHIR module per se, but a requirement of OpenMRS. The FHIR module provides a FHIR interface, but POSTing a Patient resource isn’t really the correct way to create a patient in an EMR. A patient should be registered, which would be some kind of FHIR operation (which doesn’t currently exist, but is something we could look into adding).

The cheating way around this would be to generate a valid OpenMRS identifier (using the idgen module’s rest interface) add that identifier to your patient and POST that.

@ibacher Ok I created an ID with the idgen module, and have tried posting a simple Patient but am still getting a 500 error.

{
    "resourceType": "Patient",
    "id": "4c67ad95-5d46-4bd0-82c7-ce0f7d2622e7",
    "identifier": [
        {
            "extension": [
                {
                    "url": "http://fhir.openmrs.org/ext/patient/identifier#location",
                    "valueReference": {
                        "reference": "Location/58c57d25-8d39-41ab-8422-108a0c277d98",
                        "type": "Location",
                        "display": "Outpatient Clinic"
                    }
                }
            ],
            "use": "official",
            "type": {
                "text": "OpenMRS ID"
            },
            "value": "10002T"
        }
    ],
    "name": [
        {
            "given": [
                "Adam"
            ],
            "family": "John"
        }
    ],
    "gender": "male",
    "birthDate": "2004-08-12",
    "address": [
        {
            "state": "Mukono",
            "city": "Kampala",
            "country": "Uganda"
        }
    ]
}
{
    "resourceType": "OperationOutcome",
    "text": {
        "status": "generated",
        "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><tr><td style=\"font-weight: bold;\">ERROR</td><td>[]</td><td><pre>Failed to call access method: org.hibernate.exception.ConstraintViolationException: could not execute statement</pre></td>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t</tr>\n\t\t</table>\n\t</div>"
    },
    "issue": [
        {
            "severity": "error",
            "code": "processing",
            "diagnostics": "Failed to call access method: org.hibernate.exception.ConstraintViolationException: could not execute statement"
        }
    ]
}

I dug into the logs and I am getting this error, but not sure which uuid is missing

ERROR - SqlExceptionHelper.logExceptions(142) |2022-01-12T15:27:27,728| Column 'uuid' cannot be null