Stream: mapping-framework
Topic: Mapping Complex Data Types
Robinette Renner (Jan 17 2019 at 17:06):
I am struggling to use the FHIR mapping language to map complex data types such as quantity. I found a Zulip thread from 30 May 2017 that recommended the following approach:
rule_value : for src.value as v make create("Quantity") as q, tgt.value = q, q.value = v
Based on that, I used the following snippet to map a questionnaire response to an observation quantity. This snippet represents only my attempt to populate the value. Once I get this to work, I will then populate the unit of measure.
"Questionnaire.value": for answerQuantity.value as answerValue make create("Quantity") as quantity, observation.value = quantity, quantity.value = answerValue
Unfortunately, I get the following error message:
“Failure: Unable to convert a org.hl7.fhir.r4.elementmodel.Element to a Decimal"
I have not yet converted my code to the new syntax. Is my problem related to the syntax changes to the FHIR mapping language? Any advice on how to fix this issue is greatly appreciated.
Grahame Grieve (Jan 17 2019 at 17:53):
that's a problem with the engine. I'll fix it up. how are you running the engine?
Robinette Renner (Jan 17 2019 at 18:08):
I am running it using the Terminal application in Mac OS.
Grahame Grieve (Jan 17 2019 at 18:20):
but what are you running?
Robinette Renner (Jan 17 2019 at 23:45):
I am running the FHIR validator to do the transform.
Robinette Renner (Jan 17 2019 at 23:49):
Not sure if I am answering your question. I am using the FHIR validator to transform QuestionnaireResponse to a bundle of Observation resources. Is there additional information that you need?
Grahame Grieve (Jan 18 2019 at 00:01):
validator
ok.
Last updated: Apr 12 2022 at 19:14 UTC