drajer-health / eCRNow

Repository for eCRNow app.
Apache License 2.0
40 stars 54 forks source link

Conditions query (fhir) - seperate problem list query from encounter diagnosis query (ERSD) #616

Closed dp8ton closed 6 months ago

dp8ton commented 10 months ago

As a clinician, when I review the Initial Case Report, I want to only see the active patient problems in the Problem List section w/o Encounter Diagnosis information.

Background Issue

Current Conditions fhir query in the eRSD file is used for the both the Problem List section and the Encounters (history of) section of the eCR report. The applicaiton performs a query based on the patientId, which is over the entire history of the patient. And becuase Conditions (fhir) have both problem-list-item and encounter-diagnosis the problem section ends up with past encounter-diagnosis information.

A custom-query could be defined to query based on the encountId, however, you would not return all active patient problems if they are being tracked by the encounter. Or, you could limit the query by cateory=problem-list-item, but you would be missing the encounter diagnosis. And fhir queries don't really support an "or" operation for something like this.

GOAL: Need a way to only retrive all active problems for the entire patient (condition.subject.patientId) history for the patient problem list, but only return the encounter-diagnosis for the current encounter (condition.encounter.encounterId) section.

Recommendation

Suggest breaking out the query used for condition into two seperate queries for each section of the eCR report

There are three (3) spots in the eRSD file that reference the Condtion (fhir) resource. Not sure which is used for Loading Query Data

dp8ton commented 10 months ago

Example of the Condition query from the eRSD file -

image

mmatiasalt commented 7 months ago

@dp8ton can you please share a loading query for us to investigate further? thank you.

dp8ton commented 7 months ago

@mmatiasalt Are you looking for the Loading Query Data or just the query? I have examples above.

We're currently using a custom query for the conditions fhir resource - "conditions=/Condition?patient={{context.patientId}}&clinical-status=active"

Like I mentioned above, based on the current application design, there will always be an issue where the patient's problem list has too much historical information becuase it doesn't filter based on the categories "problem-item-list" vs "encounter-diagnosis".

Problem List and Encounter Diagnosis needs to be split into two seperate queries.

mmatiasalt commented 7 months ago

Hi @dp8ton we would need the actual loading query data. Thanks so much.

dp8ton commented 7 months ago

Here's an example of a Loading Query Data with a bunch of condtion resources over several years.

I've gone through and removed patient identifiable data and masked IDs. Hope this is usable. LQD_CondtionExample.json

mmatiasalt commented 7 months ago

@dp8ton thank you so much. We will review and advise as soon as possible.

VenkatSaiReddyTeegala commented 6 months ago

Resolved as part of 3.1.4