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

Bug fix: Add units to lab component values #2920

Merged
merged 8 commits into from
Nov 19, 2024
Merged

Conversation

angelathe
Copy link
Collaborator

@angelathe angelathe commented Nov 17, 2024

PULL REQUEST

Summary

  • Update FHIR path to include units to lab component values if available
  • Update test lab bundle to include example of value/units in snapshot test

Related Issue

Fixes #2671

Acceptance Criteria

  • If units are available, they should be concatenated to the value

Screenshots

Before (10e5b07b-5d3f-426f-a7e1-13ea909ff5a5):
Screenshot 2024-11-17 at 16 56 42

After (10e5b07b-5d3f-426f-a7e1-13ea909ff5a5):
Screenshot 2024-11-17 at 16 57 26

Checklist

Examples from QA process:

@angelathe angelathe self-assigned this Nov 17, 2024
@angelathe angelathe marked this pull request as ready for review November 17, 2024 23:00
@angelathe
Copy link
Collaborator Author

@ashton-skylight Hi, this is ready for review!

Just a quick question, do you have any thoughts on whether or not you want a space between the value and the unit? Right now, there's a space, so that something like 5 g/mL would be more readable, but that also means that there would be a space for something like 50 %.

@@ -126,7 +126,7 @@ specimenReceivedTime: "Observation.extension[0].extension.where(url = 'specimen
specimenSource: "Observation.extension[0].extension.where(url = 'specimen source').valueString"
observationReferenceValue: "Observation.extension[0].extension.where(url = 'observation entry reference value').valueString"
observationComponent: "code.coding.display.first()"
observationValue: (valueQuantity.value.toString() | valueString | valueCodeableConcept.coding.display | iif(interpretation.coding.display.exists(), ' (' | interpretation.coding.display | ')', '')).join('')
observationValue: (valueQuantity.value.toString() | valueString | valueCodeableConcept.coding.display | iif(valueQuantity.unit.exists(), ' ' | valueQuantity.unit, '') | iif(interpretation.coding.display.exists(), ' (' | interpretation.coding.display | ')', '')).join('')
Copy link
Collaborator

Choose a reason for hiding this comment

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

if the value quantity unit and interpretation coding display both exist, would we get double units now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't believe so! The interpretation coding usually interprets the value, i.e. High or Low, but it does not include the units itself.

Screenshot below of example when both unit and interpretation coding both exist:
Screenshot 2024-11-18 at 09 44 43

Copy link
Collaborator

Choose a reason for hiding this comment

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

thanks! the fhirpath logic is a lot to parse (as a human) there - do you think it would be worth adding a comment, something like

# <value> <units> (<flag>)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added! TY Mary!

@ashton-skylight
Copy link
Collaborator

@angelathe This looks great! Is there a way that we could remove the space for %?

@angelathe
Copy link
Collaborator Author

@angelathe This looks great! Is there a way that we could remove the space for %?

Hi @ashton-skylight, yes we can! Should that also be the case for units under the Ref Range column? Example below.

Screenshot 2024-11-18 at 09 51 23

@ashton-skylight
Copy link
Collaborator

@angelathe Amazing yes please! Preferably, it would be best to only remove the space for percentages in the value and ref range. If removing the space in the % affects everything (ie. M/ml or days), we'll keep it with the space as is.

@angelathe
Copy link
Collaborator Author

@angelathe Amazing yes please! Preferably, it would be best to only remove the space for percentages in the value and ref range. If removing the space in the % affects everything (ie. M/ml or days), we'll keep it with the space as is.

Making a note that fixing the ref range unit spacing will be be made into its own ticket

Copy link
Collaborator

@mcmcgrath13 mcmcgrath13 left a comment

Choose a reason for hiding this comment

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

thanks!

@angelathe angelathe added this pull request to the merge queue Nov 19, 2024
Merged via the queue into main with commit 0d45dfb Nov 19, 2024
11 checks passed
@angelathe angelathe deleted the angela/2671-lab-value-units branch November 19, 2024 00:40
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.

BUG: Units of value are missing from Labs Component table
3 participants