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

Support displaying non-numerical observation results #453

Merged
merged 8 commits into from
Mar 29, 2024

Conversation

jean-the-coder
Copy link
Contributor

Description

Right now Fasten is only trying to display values from valueString and valueQuantity in bar chart form. Since the bar chart only displays numerical values, string and boolean values are not displayed requiring the user to dig into the individual observation through the debug json.

This PR adds a new ObservationVisualization component that will switch between a bar chart and a table based on the value type of the observation.

This PR also adds support for more Observation value types.

Fixes #360

Also fixes a few minor unlikely but possible bugs in the bar chart:

  • Value ranges with no max were displayed as if they were ranges with only a max due to how chartjs parsed the data
  • Ranges with no max would not extend to end of bar chart if the only result value in the chart was a range with now maximum range

Not sure if an observation value of > x is an actual thing, but if it is, it should display properly now.

Changes

  • Added new ObservationVisualization and ObservationTable components. ObservationVisualization will choose between ObservationTable and ObservationBarChart based on the observations passed
  • Refactored ObservationBarChart
  • Added more fhir datatype models used for Observation's value types
    • Supported value types: valueQuantity, valueString, valueInteger, valueBoolean, valueCodeableConcept, dataAbsentReason
    • Not-yet supported value types: valueRange, valueRatio, valueSampledData, valueTime, valueDateTime, valuePeriod, component values
  • Extracted value and reference range parsing out of the Observation model to the related datatype model
  • Added a max-height limit to the visualization section of the report-labs-observation-component. Overflow chart is scrollable, but this will prevent the page from growing ridiculously long if there are a lot of observations.
  • Updated the observation component
    • will not display the observation visualization if only a table view is supported since this component already displays the text version of the value in a table
    • updated the display values of info to use new models or the correct model in the case of code (was using coding model instead of codeable concept model)

@AnalogJ
Copy link
Member

AnalogJ commented Mar 25, 2024

🥳
@jean-the-coder Any chance you have some screenshots of the table or barchart modes so I can include them in the release notes?

@jean-the-coder
Copy link
Contributor Author

@AnalogJ Here's a few screenshots for the report-labs-observation component with sandbox data:

bar-chart table table2

Let me know if you want more or specific screenshots.

@AnalogJ AnalogJ merged commit 6264415 into fastenhealth:main Mar 29, 2024
4 checks passed
@jean-the-coder jean-the-coder deleted the visualization-type-review branch March 30, 2024 04:25
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.

Observations with string/boolean Values display as blank in Charts and fhir-card
2 participants