Giter Site home page Giter Site logo

Comments (4)

ziegm avatar ziegm commented on June 12, 2024

Try to take the value in the same call -> does not change the output

quantity.unit as unit then {
      quantity.value as value -> medDispQuantity.value = value "value";
      unit -> medDispQuantity.unit = unit "unit";
      unit -> medDispQuantity.system = 'http://unitsofmeasure.org' "ucum";
      unit -> medDispQuantity.code = unit "code";
    } "unit";

from cda-fhir-maps.

ziegm avatar ziegm commented on June 12, 2024

Correct Mapping from the Data Type quantity for the element Medication.amount
(numerator and denominator are from Data Type quantity)

<amount>
    <numerator>
        <value value="100"/>
        <unit value="mg"/>
        <system value="http://unitsofmeasure.org"/>
        <code value="mg"/>
    </numerator>
    <denominator>
        <value value="1"/>
        <unit value="Package"/>
        <system value="http://unitsofmeasure.org"/>
        <code value="1"/>
    </denominator>
</amount>

Mapping for this case:
(Map: input\maps\CdaChEmedMedicationDispenseDocumentToBundle.map)

capacityQuantity where $this.unit.exists() then {
                capacityQuantity.unit as unit then {
                  capacityQuantity.value as value -> ratio.numerator = create('Quantity') as quantity, 
                      quantity.value = value, 
                      quantity.unit = unit, 
                      quantity.system = 'http://unitsofmeasure.org',
                      quantity.code = unit,
                      ratio.denominator	 = create('Quantity') as denominator
                      , 
                      denominator.value = '1',
                      denominator.unit = 'Package',
                      denominator.system = 'http://unitsofmeasure.org',
                      denominator.code = '1'
                      "capacityQuantity"; 
                } "capQuantUnit";
              } "unit";

from cda-fhir-maps.

oliveregger avatar oliveregger commented on June 12, 2024
        <quantity>
          <value value="20"/>
          <unit value="mg"/>
          <system value="http://unitsofmeasure.org"/>
          <code value="mg"/>
        </quantity>

with the current Dispense map the quantity works:

  src.quantity as quantity -> medicationDispense.quantity as medDispQuantity then {
    // IHE-DIS: If the product-element contains package information, the unit attribute is not be present
    quantity.value as value -> medDispQuantity.value = value "value";

    // IHE-DIS: If the product-element does not contain package information, the unit attribut is present and the value SHALL be out of the UCUM code system
    quantity.unit as unit then {
      unit -> medDispQuantity.unit = unit "unit";
      unit -> medDispQuantity.system = 'http://unitsofmeasure.org' "ucum";
      unit -> medDispQuantity.code = unit "code";
    } "unit";
  } "quantity";

@ziegm can you confirm and close?

from cda-fhir-maps.

ziegm avatar ziegm commented on June 12, 2024

checked, it works correctly

from cda-fhir-maps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.