π» fromCodeableConceptToString
- Human readable text
- Dosage
- Configuration
{
"method": {
"coding": [
{
"system": "http://hl7.org/fhir/ValueSet/administration-method-codes",
"code": "738996007",
"display": "Spray"
}
]
}
}
{
fromCodeableConceptToString: ({ language, code }) => {
// If no code, skip it
if (code === undefined) {
return undefined;
}
// If empty code, return text or undefined
if (code.coding === undefined || code.coding.length === 0) {
return code.text;
}
// Do the magic here ;)
let firstCode = code.coding[0];
return `${language} translation of ${firstCode.code} (${firstCode.system})`;
};
}