Patient without MRN

Has any senaite.patient users switched off the “Require Medical Record Number (MRN)” setting? I switched it off but if I leave the MRN field blank when creating a patient, I get the error “Patient Medical Record is missing or empty”. Am I missing something or should I log an issue?

So I get the error when testing manually but when I extend Patients.rst with the test below, it creates a patient without the MRN

Create patient with no MRN should fail:
    >>> patient_api.is_patient_required()
    >>> api.create(patients, "Patient")
    Traceback (most recent call last):
    >>> plone_api.portal.set_registry_record("senaite.patient.require_patient", False)
    >>> patient_api.is_patient_required()
    >>> patient = api.create(patients, "Patient")
    >>> patient
    <Patient at /plone/patients/P000002>

Hi Mike,

yes, this is a bug in senaite.patient.

The check api.is_patient_required is missing here:

You can directly create a PR for this if possible.

Cheers, Ramon