π fromFHIRQuantityUnitToString
- Human readable text
- Dosage
- Configuration
{
"doseAndRate": [
{
"doseQuantity": {
"value": "25",
"system": "http://unitsofmeasure.org",
"code": "ug"
}
}
]
}
{
fromFHIRQuantityUnitToString: ({ quantity, language }) => {
let unit = quantity.code || quantity.unit;
let system = quantity.system || "";
return `[${language} translation of "${unit}" (${system})]`;
};
}
tip
Possible cases in production :
- SNOMED CT - http://snomed.info/sct
- UCUM - http://unitsofmeasure.org
- Other Code System than SNOMED CT / UCUM, such as LOINC - http://loinc.org/
- (Local) Value Set, e.g. https://www.ehealth.fgov.be/standards/fhir/core/ValueSet/be-cd-administration-unit
- Hardcoded unit without any system
To support them all in your fromFHIRQuantityUnitToString
implementation, here are some hints :
- 3rd party library (such as @lhncbc/ucum-lhc, ...) to turn your code to human readable text
- 3rd party FHIR Terminology / Conversion server
- Translation file(s) of your (local) Value Sets
- Extensions put on Quantity, depending of your implementation guide
- ...