ahdis / fhir-mapping-tutorial

13 stars 12 forks source link

limit in the 'output parameter of the translate transformation #34

Open Rosnyni opened 2 months ago

Rosnyni commented 2 months ago

Hello,

In a structuremap, I want to map a non coded unit :

"valueQuantity" : {
  "value" : 3700,
  "unit" : "g"
}

to a ucum coded one :

"valueQuantity": {
  "value": 3700,
  "code": "g",
  "unit": "g",
  "system": "http://unitsofmeasure.org"
}

I have created a conceptMap:

  * source = "localCoding"
  * target = "http://unitsofmeasure.org"
  * element[0]
    * code = #g
    * target[0]
      * code = #g
      * display = "g" 

My idea was to do:

srcQuantity.unit as srcQuantityUnit-> tgtQty.unit = translate(srcQuantityUnit, 'ConceptMap/Unit', display), 
          tgtQty.system = translate(srcQuantityUnit, 'ConceptMap/Unit', 'system'), 
          tgtQty.code= translate(srcQuantityUnit, 'ConceptMap/Unit', 'code') "setQuantityUnit";

But only the target with the 'code' parameter works in matchbox, the two other are not working.

oliveregger commented 2 months ago

Would it be possible to provide a map and example with transform via a pr?