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

Implement "units" grammar #246

Closed
markkramerus opened this issue Feb 21, 2020 · 0 comments · Fixed by #276
Closed

Implement "units" grammar #246

markkramerus opened this issue Feb 21, 2020 · 0 comments · Fixed by #276
Assignees
Labels
released Available in an official SUSHI release

Comments

@markkramerus
Copy link
Collaborator

Our documentation describes using the word "units" to clarify that when fixing a code or binding to a Quantity, you are actually fixing or binding the units of that quantity. Functionally, the word units has zero impact; it can be ignored. Nonetheless, it is part of the grammar that needs to be implemented.

Here's the excerpt from the doc:

Quantity
In addition to having a quantitative value, a FHIR Quantity has a coded value that is interpreted as the units of measure. As such, a Quantity can be bound to a value set or assigned a coded value. The shorthand is:

  • {Quantity type} = {system}#{code} "{display text}"

Although this appears the quantity is being set to a coded value, it is legal.

🚧 To make this a bit more intuitive, FSH allows you to use the word units, as follows:

  • {Quantity type} units = {system}#{code} "{display text}"

🚧 and for binding:

  • {Quantity type} units from {value set} ({strength})

Note: Use of the word units is suggested for clarity, but is optional.

Examples:

Set the units of the valueQuantity of an Observation to millimeters (assuming UCUM has been defined as an alias for http://unitsofmeasure.org):

  • valueQuantity = UCUM#mm "millimeters"

🚧 Alternate syntax for the same operation (addition of ‘units’):

  • valueQuantity units = UCUM#mm "millimeters"

🚧 Bind a value set to the units of a Quantity (using alternate syntax):

@cmoesel cmoesel added the released Available in an official SUSHI release label Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Available in an official SUSHI release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants