phdi icon indicating copy to clipboard operation
phdi copied to clipboard

BUG: Fix values for demographics info when missing

Open angelathe opened this issue 1 year ago • 2 comments

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

  1. Add the following empty bundle to the db (through Postico or some other db client):
{
  "type": "batch",
  "entry": [
  ],
  "resourceType": "Bundle"
}
  1. Run npm run dev and check the localhost link of the empty bundle. You should see this: Screenshot 2024-08-14 at 12.40.22.png

Expected Result

  • If Patient Name is unavailable,evaluatePatientName should return an empty string ''
  • If Vital Status is unavailable, evaluateDemographicsData should return ???
  • If Contact is unavailable, evaluatePatientContact should return an empty string ''

Actual result

  • When Patient Name is unavailable,evaluatePatientName currently returns a string with a single space ' '
  • When Vital Status in unavailable, evaluateDemographicsData currently returns Alive
  • When Contact is unavailable, evaluatePatientContact currently 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:
    1. evaluatePatientName - where to edit the Patient Name logic
    2. evaluateDemographicsData - where to edit the Vital Status logic (front-end)
    3. 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 %},

angelathe avatar Aug 14 '24 18:08 angelathe