"I'm not 100% sure if we should block this case, since it could be that the patient's sex was registered incorrectly
and should be updated instead... but I'm willing to hear proposals for best practice around this. Ultimately, I
assume it should be a fairly rare event."
I tried a "Danger" message, but had to close the new visit dialog for that to work, which was confusing. I also tried a secondary Modal popup with a warning message, but had other issues.
Hopefully this error is rare and the data entry person will realize the problem if a woman cannot be marked as pregnant.
Perhaps one way to address this is to insert a line below the patient identifier line with patient sex, age, etc, when a patient is selected. That should make the problem a little clearer to the data entry person. That could be done as part of this PR or as a separate issue.
TESTING
Use bhima_test
Try admitting patient 'Test Patient 1'. This is a female, and the pregnancy field should be visible and usable.
Try admitting patient 'Test Patient 2'. This is a male, and the pregnancy field should not be visible.
Prevent marking a male patient as pregnant during admission.
This PR prevents the "Is pregnant" yes/no selection from being displayed for male patients during admission. It also:
Closes https://github.com/Third-Culture-Software/bhima/issues/7847
Note that I considered the comment in the issue:
I tried a "Danger" message, but had to close the new visit dialog for that to work, which was confusing. I also tried a secondary Modal popup with a warning message, but had other issues.
Hopefully this error is rare and the data entry person will realize the problem if a woman cannot be marked as pregnant. Perhaps one way to address this is to insert a line below the patient identifier line with patient sex, age, etc, when a patient is selected. That should make the problem a little clearer to the data entry person. That could be done as part of this PR or as a separate issue.
TESTING