phdi
phdi copied to clipboard
BUG: Fix values for demographics info when missing
Description
In the (extremely rare) case when Patient Name, Vital Status, and/or Contact info are unavailable, these three fields still show up in the eCR Viewer as following:
- Patient Name:
' '(string with a single space) - Vital Status:
Alive - Contact:
\n
This is an issue because even when the info is unavailable, they will always show up as "available" in the eCR Viewer (& when calling evaluateData).
Acceptance Criteria
- [ ] Confirm with Sarah about what Vital Status should display when nothing is given (i.e., should it default to
Alive? See #1551) - [ ] Fix the values for Patient Name, Contact, and Vital Status (depending on point above) that show up when unavailable
- [ ] In
AccordionContent.test.tsx, uncomment-out the test that checks that the info message for Patient Info shows up when the whole section is missing, and re-run the test. It should now pass. (See #2383 for context)
Steps to reproduce
- Add the following empty bundle to the db (through Postico or some other db client):
{
"type": "batch",
"entry": [
],
"resourceType": "Bundle"
}
- Run
npm run devand check the localhost link of the empty bundle. You should see this:
Expected Result
- If Patient Name is unavailable,
evaluatePatientNameshould return an empty string'' - If Vital Status is unavailable,
evaluateDemographicsDatashould return ??? - If Contact is unavailable,
evaluatePatientContactshould return an empty string''
Actual result
- When Patient Name is unavailable,
evaluatePatientNamecurrently returns a string with a single space' ' - When Vital Status in unavailable,
evaluateDemographicsDatacurrently returnsAlive - When Contact is unavailable,
evaluatePatientContactcurrently returns a newline\n
[
{
"title": "Patient Name",
"value": " "
},
{
"title": "Vital Status",
"value": "Alive"
},
{
"title": "Contact",
"value": "\n"
}
]
Priority
Provide an estimate for level of impact the bug has today by placing an X in the applicable bracket
Priority
- [x] Low priority The bug does not have to be fixed immediately. High and medium priority bugs should be addressed first.
- [ ] Medium priority Typically, medium-priority bugs do not affect customers directly and therefore can be fixed in the normal course of testing and development.
- [ ] High priority High priority bugs must be addressed immediately. They often affect the app’s functionality and impact customers and their user experience. They must take priority.
Notes
Relevant files:
- In
evaluateFhirDataService.ts:evaluatePatientName- where to edit the Patient Name logicevaluateDemographicsData- where to edit the Vital Status logic (front-end)evaluatePatientContactInfo- where to edit the Contact logic
Resource/_Patient.liquid- location of Vital Status FHIR conversion logic"deceasedBoolean": {% if deceasedValue == "true" %} true {% else %} false {% endif %},