Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

display custom columns #158

Merged
merged 8 commits into from
Nov 15, 2022

Conversation

achen2401
Copy link
Contributor

@achen2401 achen2401 commented Oct 28, 2022

Part of #143
allow configurations of custom columns.
A config, FHIR_REST_EXTRA_PARAMS_LIST is added to allow specification of additional FHIR resource(s) needed for each patient.

For instance, tried, for DCW:
FHIR_REST_EXTRA_PARAMS_LIST = os.getenv("FHIR_REST_EXTRA_PARAMS_LIST", ["QuestionnaireResponse?_elements=resourceType,authored,subject&_sort=-authored"])

DASHBOARD_COLUMNS = [
        {
            "label": "MRN",
            "expr": "$.identifier[?(@.system=='https://hl7.org/mrn')].value"
        },
        {
            "label": "First Name",
            "expr": "$.name[0].given[0]",
        },
        {
            "label": "Last Name",
            "expr": "$.name[0].family",
        },
        {
            "label": "Birth Date",
            "expr": "$.birthDate",
        },
        {
            "label": "Last Assessed",
            "expr": "$.resources[?(@.resourceType=='QuestionnaireResponse')].authored",
             "sorting": False,
        },
    ]

Screen Shot 2022-10-27 at 5 35 22 PM

Note, I tried _revinclude parameter to include additional resources, example. However, including such parameter returns a flat array of Patient resources and other resources, which I fear may mess up paging. Another issue with using _revinclude or _include parameters to query for additional FHIR resources for the patient is that one cannot seem to sort the additionally included resource(s). This is problematic if sorting the additional results is important (e.g. for DCW, to obtain last assessed date, one needs to sort the questionnaireResponses by authored date in descending order).

As a consequence, it seems the frontend needs to separately query for additional needed resources.

Also noting that sorting by Last Assessed doesn't seem feasible via FHIR query when combined with Patient resources and sorting by MRN will only show the ones that have relevant FHIR identifier (ones that don't won't show)

@achen2401 achen2401 requested review from ivan-c and pbugni October 28, 2022 22:27
@mcjustin
Copy link
Member

mcjustin commented Nov 2, 2022

We decided to populate these fields, have them all sortable except for "last assessed", since that's very tricky.

Copy link
Contributor

@pbugni pbugni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good solution, thanks @achen2401

@achen2401 achen2401 marked this pull request as ready for review November 10, 2022 05:44
Copy link
Member

@ivan-c ivan-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

@achen2401 achen2401 merged commit ff021cf into feature/customize-columns Nov 15, 2022
@achen2401 achen2401 deleted the feature/display-custom-columns branch November 15, 2022 20:06
pbugni added a commit that referenced this pull request Nov 15, 2022
…RI (#156)

* Add `DASHBOARD_COLUMNS` to config, with defaults to match current COSRI

* whitespace - keep linter happy :)

* more lint cleanup

* correct case of `birthDate` to fit FHIR patient spec

* Adding test files for extraction of referenced resources

* formatting to keep black happy.

* display custom columns (#158)

* display custom columns

* remove un-intended changes

* re-code queries

* remove un-needed code

* remove extra line

* Update PatientListTable.js

* add count param

Co-authored-by: Amy Chen <clone@cesium.cirg.washington.edu>

* error check for dashboard column config

* Need to load DASHBOARD_COLUMNS as JSON.

* Black whitespace fix.

Co-authored-by: Paul F Bugni <pbugni@uw.edu>
Co-authored-by: Amy Chen <achen2401@gmail.com>
Co-authored-by: Amy Chen <clone@cesium.cirg.washington.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants