WHO Clinical Care in Crisis Implementation Guide for Children
0.1.0 - ci-build

WHO Clinical Care in Crisis Implementation Guide for Children - Local Development build (v0.1.0). See the Directory of published versions

: che.b7-9.lti-dangersigns - XML Representation

Active as of 2023-10-04

Raw xml | Download



<StructureMap xmlns="http://hl7.org/fhir">
  <id value="che.b7-9.lti-dangersigns"/>
  <text>
    <status value="generated"/>
    <div xmlns="http://www.w3.org/1999/xhtml"><pre>map &quot;https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureMap/che.b7-9.lti-dangersigns&quot; = &quot;che.b7-9.lti-dangersigns&quot;


uses &quot;http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaireresponse&quot; alias 'questionnaireResponse' as source
uses &quot;http://hl7.org/fhir/StructureDefinition/Bundle&quot; alias 'Bundle' as target
uses &quot;https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/observation&quot; alias 'Observation' as target
uses &quot;https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/cheobservation&quot; alias 'CHE Observation' as produced

group bundletrans(source src : questionnaireResponse, target bundle : Bundle) {
  src -&gt; bundle.id = uuid() &quot;id&quot;;
  src -&gt; bundle.type = 'batch' &quot;type&quot;;
  src.item first as itm1 where linkId = 'LTI' then {
    itm1.item first as item where (linkId = 'CHE.B7.DE01') and answer.exists() then {
      src -&gt; bundle.entry as entry then {
        src -&gt;  entry.request as request,  request.method = 'POST',  uuid() as uuid,  request.url = append('/Observation/', uuid) &quot;b50ac4c5&quot;;
        src -&gt; entry.resource = create('Observation') as tgt then {
          src -&gt; tgt then cheobservationcheb7de01(src, tgt) &quot;a737c0cf&quot;;
        } &quot;7ed3dafb&quot;;
      } &quot;6b07d1d0&quot;;
    } &quot;642a35ec&quot;;
  } &quot;07284d23&quot;;
  src.item first as itm1 where linkId = 'LTI' then {
    itm1.item first as item where (linkId = 'CHE.B7.DE01-tt') and answer.exists() then {
      src -&gt; bundle.entry as entry then {
        src -&gt;  entry.request as request,  request.method = 'POST',  uuid() as uuid,  request.url = append('/Observation/', uuid) &quot;b50ac4c5&quot;;
        src -&gt; entry.resource = create('Observation') as tgt then {
          src -&gt; tgt then cheobservationcheb7de01tt(src, tgt) &quot;22007021&quot;;
        } &quot;2902e0da&quot;;
      } &quot;323917cf&quot;;
    } &quot;4334332a&quot;;
  } &quot;839bb3dc&quot;;
  src.item first as itm1 where linkId = 'LTI' then {
    itm1.item first as item where (linkId = 'CHE.B7.DE02') and answer.exists() then {
      src -&gt; bundle.entry as entry then {
        src -&gt;  entry.request as request,  request.method = 'POST',  uuid() as uuid,  request.url = append('/Observation/', uuid) &quot;b50ac4c5&quot;;
        src -&gt; entry.resource = create('Observation') as tgt then {
          src -&gt; tgt then cheobservationcheb7de02(src, tgt) &quot;a316e259&quot;;
        } &quot;8c650123&quot;;
      } &quot;da4e89ff&quot;;
    } &quot;8687c6e9&quot;;
  } &quot;af7472fe&quot;;
  src.item first as itm1 where linkId = 'LTI' then {
    itm1.item first as item where (linkId = 'CHE.B7.B8.B9.DE01') and answer.exists() then {
      src -&gt; bundle.entry as entry then {
        src -&gt;  entry.request as request,  request.method = 'POST',  uuid() as uuid,  request.url = append('/Observation/', uuid) &quot;b50ac4c5&quot;;
        src -&gt; entry.resource = create('Observation') as tgt then {
          src -&gt; tgt then cheobservationcheb7b8b9de01(src, tgt) &quot;5299ff27&quot;;
        } &quot;c9fd04f0&quot;;
      } &quot;2db2051c&quot;;
    } &quot;60dc9938&quot;;
  } &quot;eaf027f6&quot;;
  src.item first as itm1 where linkId = 'ds' then {
    itm1.item first as item where (linkId = 'CHE.B7.DE03') and answer.exists() then {
      src -&gt; bundle.entry as entry then {
        src -&gt;  entry.request as request,  request.method = 'POST',  uuid() as uuid,  request.url = append('/Observation/', uuid) &quot;b50ac4c5&quot;;
        src -&gt; entry.resource = create('Observation') as tgt then {
          src -&gt; tgt then cheobservationcheb7de03(src, tgt) &quot;2fa6fcb2&quot;;
        } &quot;2e8b07ff&quot;;
      } &quot;4b26f549&quot;;
    } &quot;8c2ad30a&quot;;
  } &quot;7f69e1ab&quot;;
  src.item first as itm1 where linkId = 'ds' then {
    itm1.item first as item where (linkId = 'CHE.B7.DE04') and answer.exists() then {
      src -&gt; bundle.entry as entry then {
        src -&gt;  entry.request as request,  request.method = 'POST',  uuid() as uuid,  request.url = append('/Observation/', uuid) &quot;b50ac4c5&quot;;
        src -&gt; entry.resource = create('Observation') as tgt then {
          src -&gt; tgt then cheobservationcheb7de04(src, tgt) &quot;8c54d7aa&quot;;
        } &quot;3064d931&quot;;
      } &quot;7dd019b4&quot;;
    } &quot;29259e14&quot;;
  } &quot;c38fa949&quot;;
  src.item first as itm1 where linkId = 'ds' then {
    itm1.item first as item where (linkId = 'CHE.B7.DE07') and answer.exists() then {
      src -&gt; bundle.entry as entry then {
        src -&gt;  entry.request as request,  request.method = 'POST',  uuid() as uuid,  request.url = append('/Observation/', uuid) &quot;b50ac4c5&quot;;
        src -&gt; entry.resource = create('Observation') as tgt then {
          src -&gt; tgt then cheobservationcheb7de07(src, tgt) &quot;8dbaa8c1&quot;;
        } &quot;96641261&quot;;
      } &quot;fa37b236&quot;;
    } &quot;f2f40226&quot;;
  } &quot;5706ca59&quot;;
  src.item first as itm1 where linkId = 'ds' then {
    itm1.item first as item where (linkId = 'CHE.B7.DE08') and answer.exists() then {
      src -&gt; bundle.entry as entry then {
        src -&gt;  entry.request as request,  request.method = 'POST',  uuid() as uuid,  request.url = append('/Observation/', uuid) &quot;b50ac4c5&quot;;
        src -&gt; entry.resource = create('Observation') as tgt then {
          src -&gt; tgt then cheobservationcheb7de08(src, tgt) &quot;fc95b380&quot;;
        } &quot;39e6456e&quot;;
      } &quot;ff32ff5b&quot;;
    } &quot;f4014d39&quot;;
  } &quot;24a7a9bb&quot;;
  src.item first as itm1 where linkId = 'ds' then {
    itm1.item first as item where (linkId = 'CHE.B7.DE09') and answer.exists() then {
      src -&gt; bundle.entry as entry then {
        src -&gt;  entry.request as request,  request.method = 'POST',  uuid() as uuid,  request.url = append('/Observation/', uuid) &quot;b50ac4c5&quot;;
        src -&gt; entry.resource = create('Observation') as tgt then {
          src -&gt; tgt then cheobservationcheb7de09(src, tgt) &quot;dbcf420b&quot;;
        } &quot;b167af1c&quot;;
      } &quot;1f4cd941&quot;;
    } &quot;22230b35&quot;;
  } &quot;3bdc0ae6&quot;;
  src.item first as itm1 where linkId = 'ds' then {
    itm1.item first as item where (linkId = 'CHE.B7.DE10') and answer.exists() then {
      src -&gt; bundle.entry as entry then {
        src -&gt;  entry.request as request,  request.method = 'POST',  uuid() as uuid,  request.url = append('/Observation/', uuid) &quot;b50ac4c5&quot;;
        src -&gt; entry.resource = create('Observation') as tgt then {
          src -&gt; tgt then cheobservationcheb7de10(src, tgt) &quot;11652079&quot;;
        } &quot;d5f13abf&quot;;
      } &quot;5112eabc&quot;;
    } &quot;40e6e7f6&quot;;
  } &quot;29197ec4&quot;;
}

group cheobservationcheb7de01(source src, target tgt) {
  src -&gt;  tgt.identifier = create('Identifier') as CodeID,  CodeID.system = 'http://hl7.org/fhir/namingsystem-identifier-type',  CodeID.use = 'official',  CodeID.value = 'uuid',  CodeID.id = uuid() &quot;id-cheb7de01&quot;;
  src.encounter as encounter -&gt; tgt.encounter = encounter &quot;35bc6b82&quot;;
  src.subject as subject -&gt;  tgt.subject = subject,  tgt.meta = create('Meta') as newMeta,  newMeta.profile = 'https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/cheobservation',  tgt.code = create('CodeableConcept') as concept,  concept.coding = create('Coding') as coding,  coding.system = 'https://fhir.dk.swisstph-mis.ch/matchbox/fhir/CodeSystem/che-custom-codes',  coding.code = 'CHE.B7.DE01' &quot;code-cheb7de01&quot;;
  src.item as itemtimestamp where linkId = 'timestamp' then {
    itemtimestamp.answer first as atimestamp then {
      atimestamp.value as val -&gt; tgt.issued = val &quot;5af77f2c&quot;;
    } &quot;7f22f29f&quot;;
  } &quot;aae7a11d&quot;;
  src.subject as subject -&gt; tgt.subject = subject &quot;patient&quot;;
  src.item first as itm1 where linkId = 'LTI' then {
    itm1.item first as item where (linkId = 'CHE.B7.DE01') and answer.exists() then {
      item.answer first as a then {
        a where a.value = true -&gt;  tgt.status = 'final',  tgt.value = true &quot;final-cheb7de01&quot;;
        a where a.value = false -&gt;  tgt.status = 'cancelled',  tgt.value = false &quot;notfound-cheb7de01&quot;;
      } &quot;bdab9370&quot;;
    } &quot;31c15607&quot;;
  } &quot;4e154863&quot;;
}

group cheobservationcheb7de01tt(source src, target tgt) {
  src -&gt;  tgt.identifier = create('Identifier') as CodeID,  CodeID.system = 'http://hl7.org/fhir/namingsystem-identifier-type',  CodeID.use = 'official',  CodeID.value = 'uuid',  CodeID.id = uuid() &quot;id-cheb7de01tt&quot;;
  src.encounter as encounter -&gt; tgt.encounter = encounter &quot;35bc6b82&quot;;
  src.subject as subject -&gt;  tgt.subject = subject,  tgt.meta = create('Meta') as newMeta,  newMeta.profile = 'https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/cheobservation',  tgt.code = create('CodeableConcept') as concept,  concept.coding = create('Coding') as coding,  coding.system = 'https://fhir.dk.swisstph-mis.ch/matchbox/fhir/CodeSystem/che-custom-codes',  coding.code = 'CHE.B7.DE01-tt' &quot;code-cheb7de01tt&quot;;
  src.item as itemtimestamp where linkId = 'timestamp' then {
    itemtimestamp.answer first as atimestamp then {
      atimestamp.value as val -&gt; tgt.issued = val &quot;5af77f2c&quot;;
    } &quot;7f22f29f&quot;;
  } &quot;aae7a11d&quot;;
  src.subject as subject -&gt; tgt.subject = subject &quot;patient&quot;;
  src.item first as itm1 where linkId = 'LTI' then {
    itm1.item first as item where (linkId = 'CHE.B7.DE01-tt') and answer.exists() then {
      item.answer first as a then {
        a where a.value = true -&gt;  tgt.status = 'final',  tgt.value = true &quot;final-cheb7de01tt&quot;;
        a where a.value = false -&gt;  tgt.status = 'cancelled',  tgt.value = false &quot;notfound-cheb7de01tt&quot;;
      } &quot;bdab9370&quot;;
    } &quot;015ed333&quot;;
  } &quot;6029e684&quot;;
}

group cheobservationcheb7de02(source src, target tgt) {
  src -&gt;  tgt.identifier = create('Identifier') as CodeID,  CodeID.system = 'http://hl7.org/fhir/namingsystem-identifier-type',  CodeID.use = 'official',  CodeID.value = 'uuid',  CodeID.id = uuid() &quot;id-cheb7de02&quot;;
  src.encounter as encounter -&gt; tgt.encounter = encounter &quot;35bc6b82&quot;;
  src.subject as subject -&gt;  tgt.subject = subject,  tgt.meta = create('Meta') as newMeta,  newMeta.profile = 'https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/cheobservation',  tgt.code = create('CodeableConcept') as concept,  concept.coding = create('Coding') as coding,  coding.system = 'https://fhir.dk.swisstph-mis.ch/matchbox/fhir/CodeSystem/che-custom-codes',  coding.code = 'CHE.B7.DE02' &quot;code-cheb7de02&quot;;
  src.item as itemtimestamp where linkId = 'timestamp' then {
    itemtimestamp.answer first as atimestamp then {
      atimestamp.value as val -&gt; tgt.issued = val &quot;5af77f2c&quot;;
    } &quot;7f22f29f&quot;;
  } &quot;aae7a11d&quot;;
  src.subject as subject -&gt; tgt.subject = subject &quot;patient&quot;;
  src.item first as itm1 where linkId = 'LTI' then {
    itm1.item first as item where (linkId = 'CHE.B7.DE02') and answer.exists() then {
      item.answer first as a then {
        a where a.value = true -&gt;  tgt.status = 'final',  tgt.value = true &quot;final-cheb7de02&quot;;
        a where a.value = false -&gt;  tgt.status = 'cancelled',  tgt.value = false &quot;notfound-cheb7de02&quot;;
      } &quot;bdab9370&quot;;
    } &quot;5ab27008&quot;;
  } &quot;2f78f394&quot;;
}

group cheobservationcheb7b8b9de01(source src, target tgt) {
  src -&gt;  tgt.identifier = create('Identifier') as CodeID,  CodeID.system = 'http://hl7.org/fhir/namingsystem-identifier-type',  CodeID.use = 'official',  CodeID.value = 'uuid',  CodeID.id = uuid() &quot;id-cheb7b8b9de01&quot;;
  src.encounter as encounter -&gt; tgt.encounter = encounter &quot;35bc6b82&quot;;
  src.subject as subject -&gt;  tgt.subject = subject,  tgt.meta = create('Meta') as newMeta,  newMeta.profile = 'https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/cheobservation',  tgt.code = create('CodeableConcept') as concept,  concept.coding = create('Coding') as coding,  coding.system = 'https://fhir.dk.swisstph-mis.ch/matchbox/fhir/CodeSystem/che-custom-codes',  coding.code = 'CHE.B7.B8.B9.DE01' &quot;code-cheb7b8b9de01&quot;;
  src.item as itemtimestamp where linkId = 'timestamp' then {
    itemtimestamp.answer first as atimestamp then {
      atimestamp.value as val -&gt; tgt.issued = val &quot;5af77f2c&quot;;
    } &quot;7f22f29f&quot;;
  } &quot;aae7a11d&quot;;
  src.subject as subject -&gt; tgt.subject = subject &quot;patient&quot;;
  src.item first as itm1 where linkId = 'LTI' then {
    itm1.item first as item where (linkId = 'CHE.B7.B8.B9.DE01') and answer.exists() then {
      item.answer first as a then {
        a.value as val then {
          val where val.code = 'none' -&gt; tgt.status = 'cancelled' &quot;8ab1d7a5&quot;;
          val where val.code != 'none' -&gt;  tgt.value = create('CodeableConcept') as cc,  cc.coding = val,  tgt.status = 'final' &quot;a1050460&quot;;
        } &quot;4ca9082e&quot;;
      } &quot;7c587a4b&quot;;
    } &quot;fc6944d0&quot;;
  } &quot;37fe0ecf&quot;;
}

group cheobservationcheb7de03(source src, target tgt) {
  src -&gt;  tgt.identifier = create('Identifier') as CodeID,  CodeID.system = 'http://hl7.org/fhir/namingsystem-identifier-type',  CodeID.use = 'official',  CodeID.value = 'uuid',  CodeID.id = uuid() &quot;id-cheb7de03&quot;;
  src.encounter as encounter -&gt; tgt.encounter = encounter &quot;35bc6b82&quot;;
  src.subject as subject -&gt;  tgt.subject = subject,  tgt.meta = create('Meta') as newMeta,  newMeta.profile = 'https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/cheobservation',  tgt.code = create('CodeableConcept') as concept,  concept.coding = create('Coding') as coding,  coding.system = 'https://fhir.dk.swisstph-mis.ch/matchbox/fhir/CodeSystem/che-custom-codes',  coding.code = 'CHE.B7.DE03' &quot;code-cheb7de03&quot;;
  src.item as itemtimestamp where linkId = 'timestamp' then {
    itemtimestamp.answer first as atimestamp then {
      atimestamp.value as val -&gt; tgt.issued = val &quot;5af77f2c&quot;;
    } &quot;7f22f29f&quot;;
  } &quot;aae7a11d&quot;;
  src.subject as subject -&gt; tgt.subject = subject &quot;patient&quot;;
  src.item first as itm1 where linkId = 'ds' then {
    itm1.item first as item where (linkId = 'CHE.B7.DE03') and answer.exists() then {
      item.answer first as a then {
        a where a.value = true -&gt;  tgt.status = 'final',  tgt.value = true &quot;final-cheb7de03&quot;;
        a where a.value = false -&gt;  tgt.status = 'cancelled',  tgt.value = false &quot;notfound-cheb7de03&quot;;
      } &quot;bdab9370&quot;;
    } &quot;b2289b9b&quot;;
  } &quot;e2cab342&quot;;
}

group cheobservationcheb7de04(source src, target tgt) {
  src -&gt;  tgt.identifier = create('Identifier') as CodeID,  CodeID.system = 'http://hl7.org/fhir/namingsystem-identifier-type',  CodeID.use = 'official',  CodeID.value = 'uuid',  CodeID.id = uuid() &quot;id-cheb7de04&quot;;
  src.encounter as encounter -&gt; tgt.encounter = encounter &quot;35bc6b82&quot;;
  src.subject as subject -&gt;  tgt.subject = subject,  tgt.meta = create('Meta') as newMeta,  newMeta.profile = 'https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/cheobservation',  tgt.code = create('CodeableConcept') as concept,  concept.coding = create('Coding') as coding,  coding.system = 'https://fhir.dk.swisstph-mis.ch/matchbox/fhir/CodeSystem/che-custom-codes',  coding.code = 'CHE.B7.DE04' &quot;code-cheb7de04&quot;;
  src.item as itemtimestamp where linkId = 'timestamp' then {
    itemtimestamp.answer first as atimestamp then {
      atimestamp.value as val -&gt; tgt.issued = val &quot;5af77f2c&quot;;
    } &quot;7f22f29f&quot;;
  } &quot;aae7a11d&quot;;
  src.subject as subject -&gt; tgt.subject = subject &quot;patient&quot;;
  src.item first as itm1 where linkId = 'ds' then {
    itm1.item first as item where (linkId = 'CHE.B7.DE04') and answer.exists() then {
      item.answer first as a then {
        a.value as val then {
          val where val.code = 'none' -&gt; tgt.status = 'cancelled' &quot;8ab1d7a5&quot;;
          val where val.code != 'none' -&gt;  tgt.value = create('CodeableConcept') as cc,  cc.coding = val,  tgt.status = 'final' &quot;a1050460&quot;;
        } &quot;4ca9082e&quot;;
      } &quot;7c587a4b&quot;;
    } &quot;439124b7&quot;;
  } &quot;d2667a29&quot;;
}

group cheobservationcheb7de07(source src, target tgt) {
  src -&gt;  tgt.identifier = create('Identifier') as CodeID,  CodeID.system = 'http://hl7.org/fhir/namingsystem-identifier-type',  CodeID.use = 'official',  CodeID.value = 'uuid',  CodeID.id = uuid() &quot;id-cheb7de07&quot;;
  src.encounter as encounter -&gt; tgt.encounter = encounter &quot;35bc6b82&quot;;
  src.subject as subject -&gt;  tgt.subject = subject,  tgt.meta = create('Meta') as newMeta,  newMeta.profile = 'https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/cheobservation',  tgt.code = create('CodeableConcept') as concept,  concept.coding = create('Coding') as coding,  coding.system = 'https://fhir.dk.swisstph-mis.ch/matchbox/fhir/CodeSystem/che-custom-codes',  coding.code = 'CHE.B7.DE07' &quot;code-cheb7de07&quot;;
  src.item as itemtimestamp where linkId = 'timestamp' then {
    itemtimestamp.answer first as atimestamp then {
      atimestamp.value as val -&gt; tgt.issued = val &quot;5af77f2c&quot;;
    } &quot;7f22f29f&quot;;
  } &quot;aae7a11d&quot;;
  src.subject as subject -&gt; tgt.subject = subject &quot;patient&quot;;
  src.item first as itm1 where linkId = 'ds' then {
    itm1.item first as item where (linkId = 'CHE.B7.DE07') and answer.exists() then {
      item.answer first as a then {
        a where a.value = true -&gt;  tgt.status = 'final',  tgt.value = true &quot;final-cheb7de07&quot;;
        a where a.value = false -&gt;  tgt.status = 'cancelled',  tgt.value = false &quot;notfound-cheb7de07&quot;;
      } &quot;bdab9370&quot;;
    } &quot;97792e44&quot;;
  } &quot;3dd9674b&quot;;
}

group cheobservationcheb7de08(source src, target tgt) {
  src -&gt;  tgt.identifier = create('Identifier') as CodeID,  CodeID.system = 'http://hl7.org/fhir/namingsystem-identifier-type',  CodeID.use = 'official',  CodeID.value = 'uuid',  CodeID.id = uuid() &quot;id-cheb7de08&quot;;
  src.encounter as encounter -&gt; tgt.encounter = encounter &quot;35bc6b82&quot;;
  src.subject as subject -&gt;  tgt.subject = subject,  tgt.meta = create('Meta') as newMeta,  newMeta.profile = 'https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/cheobservation',  tgt.code = create('CodeableConcept') as concept,  concept.coding = create('Coding') as coding,  coding.system = 'https://fhir.dk.swisstph-mis.ch/matchbox/fhir/CodeSystem/che-custom-codes',  coding.code = 'CHE.B7.DE08' &quot;code-cheb7de08&quot;;
  src.item as itemtimestamp where linkId = 'timestamp' then {
    itemtimestamp.answer first as atimestamp then {
      atimestamp.value as val -&gt; tgt.issued = val &quot;5af77f2c&quot;;
    } &quot;7f22f29f&quot;;
  } &quot;aae7a11d&quot;;
  src.subject as subject -&gt; tgt.subject = subject &quot;patient&quot;;
  src.item first as itm1 where linkId = 'ds' then {
    itm1.item first as item where (linkId = 'CHE.B7.DE08') and answer.exists() then {
      item.answer first as a then {
        a where a.value = true -&gt;  tgt.status = 'final',  tgt.value = true &quot;final-cheb7de08&quot;;
        a where a.value = false -&gt;  tgt.status = 'cancelled',  tgt.value = false &quot;notfound-cheb7de08&quot;;
      } &quot;bdab9370&quot;;
    } &quot;0c6e49a5&quot;;
  } &quot;1cb8e50b&quot;;
}

group cheobservationcheb7de09(source src, target tgt) {
  src -&gt;  tgt.identifier = create('Identifier') as CodeID,  CodeID.system = 'http://hl7.org/fhir/namingsystem-identifier-type',  CodeID.use = 'official',  CodeID.value = 'uuid',  CodeID.id = uuid() &quot;id-cheb7de09&quot;;
  src.encounter as encounter -&gt; tgt.encounter = encounter &quot;35bc6b82&quot;;
  src.subject as subject -&gt;  tgt.subject = subject,  tgt.meta = create('Meta') as newMeta,  newMeta.profile = 'https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/cheobservation',  tgt.code = create('CodeableConcept') as concept,  concept.coding = create('Coding') as coding,  coding.system = 'https://fhir.dk.swisstph-mis.ch/matchbox/fhir/CodeSystem/che-custom-codes',  coding.code = 'CHE.B7.DE09' &quot;code-cheb7de09&quot;;
  src.item as itemtimestamp where linkId = 'timestamp' then {
    itemtimestamp.answer first as atimestamp then {
      atimestamp.value as val -&gt; tgt.issued = val &quot;5af77f2c&quot;;
    } &quot;7f22f29f&quot;;
  } &quot;aae7a11d&quot;;
  src.subject as subject -&gt; tgt.subject = subject &quot;patient&quot;;
  src.item first as itm1 where linkId = 'ds' then {
    itm1.item first as item where (linkId = 'CHE.B7.DE09') and answer.exists() then {
      item.answer first as a then {
        a where a.value = true -&gt;  tgt.status = 'final',  tgt.value = true &quot;final-cheb7de09&quot;;
        a where a.value = false -&gt;  tgt.status = 'cancelled',  tgt.value = false &quot;notfound-cheb7de09&quot;;
      } &quot;bdab9370&quot;;
    } &quot;95ee9897&quot;;
  } &quot;50c338e5&quot;;
}

group cheobservationcheb7de10(source src, target tgt) {
  src -&gt;  tgt.identifier = create('Identifier') as CodeID,  CodeID.system = 'http://hl7.org/fhir/namingsystem-identifier-type',  CodeID.use = 'official',  CodeID.value = 'uuid',  CodeID.id = uuid() &quot;id-cheb7de10&quot;;
  src.encounter as encounter -&gt; tgt.encounter = encounter &quot;35bc6b82&quot;;
  src.subject as subject -&gt;  tgt.subject = subject,  tgt.meta = create('Meta') as newMeta,  newMeta.profile = 'https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/cheobservation',  tgt.code = create('CodeableConcept') as concept,  concept.coding = create('Coding') as coding,  coding.system = 'https://fhir.dk.swisstph-mis.ch/matchbox/fhir/CodeSystem/che-custom-codes',  coding.code = 'CHE.B7.DE10' &quot;code-cheb7de10&quot;;
  src.item as itemtimestamp where linkId = 'timestamp' then {
    itemtimestamp.answer first as atimestamp then {
      atimestamp.value as val -&gt; tgt.issued = val &quot;5af77f2c&quot;;
    } &quot;7f22f29f&quot;;
  } &quot;aae7a11d&quot;;
  src.subject as subject -&gt; tgt.subject = subject &quot;patient&quot;;
  src.item first as itm1 where linkId = 'ds' then {
    itm1.item first as item where (linkId = 'CHE.B7.DE10') and answer.exists() then {
      item.answer first as a then {
        a.value as val then {
          val where val.code = 'none' -&gt; tgt.status = 'cancelled' &quot;8ab1d7a5&quot;;
          val where val.code != 'none' -&gt;  tgt.value = create('CodeableConcept') as cc,  cc.coding = val,  tgt.status = 'final' &quot;a1050460&quot;;
        } &quot;4ca9082e&quot;;
      } &quot;7c587a4b&quot;;
    } &quot;88b2075a&quot;;
  } &quot;ad934662&quot;;
}

</pre></div>
  </text>
  <url
       value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureMap/che.b7-9.lti-dangersigns"/>
  <version value="0.1.0"/>
  <name value="che.b7-9.lti-dangersigns"/>
  <status value="active"/>
  <date value="2023-10-04T12:32:21+00:00"/>
  <publisher value="WHO"/>
  <contact>
    <name value="WHO"/>
    <telecom>
      <system value="url"/>
      <value value="http://who.int"/>
    </telecom>
  </contact>
  <structure>
    <url
         value="http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaireresponse"/>
    <mode value="source"/>
    <alias value="'questionnaireResponse'"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/StructureDefinition/Bundle"/>
    <mode value="target"/>
    <alias value="'Bundle'"/>
  </structure>
  <structure>
    <url
         value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/observation"/>
    <mode value="target"/>
    <alias value="'Observation'"/>
  </structure>
  <structure>
    <url
         value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/cheobservation"/>
    <mode value="produced"/>
    <alias value="'CHE Observation'"/>
  </structure>
  <group>
    <name value="bundletrans"/>
    <typeMode value="none"/>
    <input>
      <name value="src"/>
      <type value="questionnaireResponse"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="bundle"/>
      <type value="Bundle"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="id"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="bundle"/>
        <contextType value="variable"/>
        <element value="id"/>
        <transform value="uuid"/>
      </target>
    </rule>
    <rule>
      <name value="type"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="bundle"/>
        <contextType value="variable"/>
        <element value="type"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="batch"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="07284d23"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="itm1"/>
        <condition value="linkId = 'LTI'"/>
      </source>
      <rule>
        <name value="642a35ec"/>
        <source>
          <context value="itm1"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition value="(linkId = 'CHE.B7.DE01') and answer.exists()"/>
        </source>
        <rule>
          <name value="6b07d1d0"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="bundle"/>
            <contextType value="variable"/>
            <element value="entry"/>
            <variable value="entry"/>
          </target>
          <rule>
            <name value="b50ac4c5"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="entry"/>
              <contextType value="variable"/>
              <element value="request"/>
              <variable value="request"/>
            </target>
            <target>
              <context value="request"/>
              <contextType value="variable"/>
              <element value="method"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="POST"/>
              </parameter>
            </target>
            <target>
              <contextType value="variable"/>
              <variable value="uuid"/>
              <transform value="uuid"/>
            </target>
            <target>
              <context value="request"/>
              <contextType value="variable"/>
              <element value="url"/>
              <transform value="append"/>
              <parameter>
                <valueString value="/Observation/"/>
              </parameter>
              <parameter>
                <valueId value="uuid"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="7ed3dafb"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="entry"/>
              <contextType value="variable"/>
              <element value="resource"/>
              <variable value="tgt"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Observation"/>
              </parameter>
            </target>
            <rule>
              <name value="a737c0cf"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <contextType value="variable"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="tgt"/>
                </parameter>
              </target>
              <dependent>
                <name value="cheobservationcheb7de01"/>
                <variable value="src"/>
                <variable value="tgt"/>
              </dependent>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="839bb3dc"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="itm1"/>
        <condition value="linkId = 'LTI'"/>
      </source>
      <rule>
        <name value="4334332a"/>
        <source>
          <context value="itm1"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition value="(linkId = 'CHE.B7.DE01-tt') and answer.exists()"/>
        </source>
        <rule>
          <name value="323917cf"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="bundle"/>
            <contextType value="variable"/>
            <element value="entry"/>
            <variable value="entry"/>
          </target>
          <rule>
            <name value="b50ac4c5"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="entry"/>
              <contextType value="variable"/>
              <element value="request"/>
              <variable value="request"/>
            </target>
            <target>
              <context value="request"/>
              <contextType value="variable"/>
              <element value="method"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="POST"/>
              </parameter>
            </target>
            <target>
              <contextType value="variable"/>
              <variable value="uuid"/>
              <transform value="uuid"/>
            </target>
            <target>
              <context value="request"/>
              <contextType value="variable"/>
              <element value="url"/>
              <transform value="append"/>
              <parameter>
                <valueString value="/Observation/"/>
              </parameter>
              <parameter>
                <valueId value="uuid"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="2902e0da"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="entry"/>
              <contextType value="variable"/>
              <element value="resource"/>
              <variable value="tgt"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Observation"/>
              </parameter>
            </target>
            <rule>
              <name value="22007021"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <contextType value="variable"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="tgt"/>
                </parameter>
              </target>
              <dependent>
                <name value="cheobservationcheb7de01tt"/>
                <variable value="src"/>
                <variable value="tgt"/>
              </dependent>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="af7472fe"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="itm1"/>
        <condition value="linkId = 'LTI'"/>
      </source>
      <rule>
        <name value="8687c6e9"/>
        <source>
          <context value="itm1"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition value="(linkId = 'CHE.B7.DE02') and answer.exists()"/>
        </source>
        <rule>
          <name value="da4e89ff"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="bundle"/>
            <contextType value="variable"/>
            <element value="entry"/>
            <variable value="entry"/>
          </target>
          <rule>
            <name value="b50ac4c5"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="entry"/>
              <contextType value="variable"/>
              <element value="request"/>
              <variable value="request"/>
            </target>
            <target>
              <context value="request"/>
              <contextType value="variable"/>
              <element value="method"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="POST"/>
              </parameter>
            </target>
            <target>
              <contextType value="variable"/>
              <variable value="uuid"/>
              <transform value="uuid"/>
            </target>
            <target>
              <context value="request"/>
              <contextType value="variable"/>
              <element value="url"/>
              <transform value="append"/>
              <parameter>
                <valueString value="/Observation/"/>
              </parameter>
              <parameter>
                <valueId value="uuid"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="8c650123"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="entry"/>
              <contextType value="variable"/>
              <element value="resource"/>
              <variable value="tgt"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Observation"/>
              </parameter>
            </target>
            <rule>
              <name value="a316e259"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <contextType value="variable"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="tgt"/>
                </parameter>
              </target>
              <dependent>
                <name value="cheobservationcheb7de02"/>
                <variable value="src"/>
                <variable value="tgt"/>
              </dependent>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="eaf027f6"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="itm1"/>
        <condition value="linkId = 'LTI'"/>
      </source>
      <rule>
        <name value="60dc9938"/>
        <source>
          <context value="itm1"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition
                     value="(linkId = 'CHE.B7.B8.B9.DE01') and answer.exists()"/>
        </source>
        <rule>
          <name value="2db2051c"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="bundle"/>
            <contextType value="variable"/>
            <element value="entry"/>
            <variable value="entry"/>
          </target>
          <rule>
            <name value="b50ac4c5"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="entry"/>
              <contextType value="variable"/>
              <element value="request"/>
              <variable value="request"/>
            </target>
            <target>
              <context value="request"/>
              <contextType value="variable"/>
              <element value="method"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="POST"/>
              </parameter>
            </target>
            <target>
              <contextType value="variable"/>
              <variable value="uuid"/>
              <transform value="uuid"/>
            </target>
            <target>
              <context value="request"/>
              <contextType value="variable"/>
              <element value="url"/>
              <transform value="append"/>
              <parameter>
                <valueString value="/Observation/"/>
              </parameter>
              <parameter>
                <valueId value="uuid"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="c9fd04f0"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="entry"/>
              <contextType value="variable"/>
              <element value="resource"/>
              <variable value="tgt"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Observation"/>
              </parameter>
            </target>
            <rule>
              <name value="5299ff27"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <contextType value="variable"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="tgt"/>
                </parameter>
              </target>
              <dependent>
                <name value="cheobservationcheb7b8b9de01"/>
                <variable value="src"/>
                <variable value="tgt"/>
              </dependent>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="7f69e1ab"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="itm1"/>
        <condition value="linkId = 'ds'"/>
      </source>
      <rule>
        <name value="8c2ad30a"/>
        <source>
          <context value="itm1"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition value="(linkId = 'CHE.B7.DE03') and answer.exists()"/>
        </source>
        <rule>
          <name value="4b26f549"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="bundle"/>
            <contextType value="variable"/>
            <element value="entry"/>
            <variable value="entry"/>
          </target>
          <rule>
            <name value="b50ac4c5"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="entry"/>
              <contextType value="variable"/>
              <element value="request"/>
              <variable value="request"/>
            </target>
            <target>
              <context value="request"/>
              <contextType value="variable"/>
              <element value="method"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="POST"/>
              </parameter>
            </target>
            <target>
              <contextType value="variable"/>
              <variable value="uuid"/>
              <transform value="uuid"/>
            </target>
            <target>
              <context value="request"/>
              <contextType value="variable"/>
              <element value="url"/>
              <transform value="append"/>
              <parameter>
                <valueString value="/Observation/"/>
              </parameter>
              <parameter>
                <valueId value="uuid"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="2e8b07ff"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="entry"/>
              <contextType value="variable"/>
              <element value="resource"/>
              <variable value="tgt"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Observation"/>
              </parameter>
            </target>
            <rule>
              <name value="2fa6fcb2"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <contextType value="variable"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="tgt"/>
                </parameter>
              </target>
              <dependent>
                <name value="cheobservationcheb7de03"/>
                <variable value="src"/>
                <variable value="tgt"/>
              </dependent>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="c38fa949"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="itm1"/>
        <condition value="linkId = 'ds'"/>
      </source>
      <rule>
        <name value="29259e14"/>
        <source>
          <context value="itm1"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition value="(linkId = 'CHE.B7.DE04') and answer.exists()"/>
        </source>
        <rule>
          <name value="7dd019b4"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="bundle"/>
            <contextType value="variable"/>
            <element value="entry"/>
            <variable value="entry"/>
          </target>
          <rule>
            <name value="b50ac4c5"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="entry"/>
              <contextType value="variable"/>
              <element value="request"/>
              <variable value="request"/>
            </target>
            <target>
              <context value="request"/>
              <contextType value="variable"/>
              <element value="method"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="POST"/>
              </parameter>
            </target>
            <target>
              <contextType value="variable"/>
              <variable value="uuid"/>
              <transform value="uuid"/>
            </target>
            <target>
              <context value="request"/>
              <contextType value="variable"/>
              <element value="url"/>
              <transform value="append"/>
              <parameter>
                <valueString value="/Observation/"/>
              </parameter>
              <parameter>
                <valueId value="uuid"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="3064d931"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="entry"/>
              <contextType value="variable"/>
              <element value="resource"/>
              <variable value="tgt"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Observation"/>
              </parameter>
            </target>
            <rule>
              <name value="8c54d7aa"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <contextType value="variable"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="tgt"/>
                </parameter>
              </target>
              <dependent>
                <name value="cheobservationcheb7de04"/>
                <variable value="src"/>
                <variable value="tgt"/>
              </dependent>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="5706ca59"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="itm1"/>
        <condition value="linkId = 'ds'"/>
      </source>
      <rule>
        <name value="f2f40226"/>
        <source>
          <context value="itm1"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition value="(linkId = 'CHE.B7.DE07') and answer.exists()"/>
        </source>
        <rule>
          <name value="fa37b236"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="bundle"/>
            <contextType value="variable"/>
            <element value="entry"/>
            <variable value="entry"/>
          </target>
          <rule>
            <name value="b50ac4c5"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="entry"/>
              <contextType value="variable"/>
              <element value="request"/>
              <variable value="request"/>
            </target>
            <target>
              <context value="request"/>
              <contextType value="variable"/>
              <element value="method"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="POST"/>
              </parameter>
            </target>
            <target>
              <contextType value="variable"/>
              <variable value="uuid"/>
              <transform value="uuid"/>
            </target>
            <target>
              <context value="request"/>
              <contextType value="variable"/>
              <element value="url"/>
              <transform value="append"/>
              <parameter>
                <valueString value="/Observation/"/>
              </parameter>
              <parameter>
                <valueId value="uuid"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="96641261"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="entry"/>
              <contextType value="variable"/>
              <element value="resource"/>
              <variable value="tgt"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Observation"/>
              </parameter>
            </target>
            <rule>
              <name value="8dbaa8c1"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <contextType value="variable"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="tgt"/>
                </parameter>
              </target>
              <dependent>
                <name value="cheobservationcheb7de07"/>
                <variable value="src"/>
                <variable value="tgt"/>
              </dependent>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="24a7a9bb"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="itm1"/>
        <condition value="linkId = 'ds'"/>
      </source>
      <rule>
        <name value="f4014d39"/>
        <source>
          <context value="itm1"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition value="(linkId = 'CHE.B7.DE08') and answer.exists()"/>
        </source>
        <rule>
          <name value="ff32ff5b"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="bundle"/>
            <contextType value="variable"/>
            <element value="entry"/>
            <variable value="entry"/>
          </target>
          <rule>
            <name value="b50ac4c5"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="entry"/>
              <contextType value="variable"/>
              <element value="request"/>
              <variable value="request"/>
            </target>
            <target>
              <context value="request"/>
              <contextType value="variable"/>
              <element value="method"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="POST"/>
              </parameter>
            </target>
            <target>
              <contextType value="variable"/>
              <variable value="uuid"/>
              <transform value="uuid"/>
            </target>
            <target>
              <context value="request"/>
              <contextType value="variable"/>
              <element value="url"/>
              <transform value="append"/>
              <parameter>
                <valueString value="/Observation/"/>
              </parameter>
              <parameter>
                <valueId value="uuid"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="39e6456e"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="entry"/>
              <contextType value="variable"/>
              <element value="resource"/>
              <variable value="tgt"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Observation"/>
              </parameter>
            </target>
            <rule>
              <name value="fc95b380"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <contextType value="variable"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="tgt"/>
                </parameter>
              </target>
              <dependent>
                <name value="cheobservationcheb7de08"/>
                <variable value="src"/>
                <variable value="tgt"/>
              </dependent>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="3bdc0ae6"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="itm1"/>
        <condition value="linkId = 'ds'"/>
      </source>
      <rule>
        <name value="22230b35"/>
        <source>
          <context value="itm1"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition value="(linkId = 'CHE.B7.DE09') and answer.exists()"/>
        </source>
        <rule>
          <name value="1f4cd941"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="bundle"/>
            <contextType value="variable"/>
            <element value="entry"/>
            <variable value="entry"/>
          </target>
          <rule>
            <name value="b50ac4c5"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="entry"/>
              <contextType value="variable"/>
              <element value="request"/>
              <variable value="request"/>
            </target>
            <target>
              <context value="request"/>
              <contextType value="variable"/>
              <element value="method"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="POST"/>
              </parameter>
            </target>
            <target>
              <contextType value="variable"/>
              <variable value="uuid"/>
              <transform value="uuid"/>
            </target>
            <target>
              <context value="request"/>
              <contextType value="variable"/>
              <element value="url"/>
              <transform value="append"/>
              <parameter>
                <valueString value="/Observation/"/>
              </parameter>
              <parameter>
                <valueId value="uuid"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="b167af1c"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="entry"/>
              <contextType value="variable"/>
              <element value="resource"/>
              <variable value="tgt"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Observation"/>
              </parameter>
            </target>
            <rule>
              <name value="dbcf420b"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <contextType value="variable"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="tgt"/>
                </parameter>
              </target>
              <dependent>
                <name value="cheobservationcheb7de09"/>
                <variable value="src"/>
                <variable value="tgt"/>
              </dependent>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="29197ec4"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="itm1"/>
        <condition value="linkId = 'ds'"/>
      </source>
      <rule>
        <name value="40e6e7f6"/>
        <source>
          <context value="itm1"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition value="(linkId = 'CHE.B7.DE10') and answer.exists()"/>
        </source>
        <rule>
          <name value="5112eabc"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="bundle"/>
            <contextType value="variable"/>
            <element value="entry"/>
            <variable value="entry"/>
          </target>
          <rule>
            <name value="b50ac4c5"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="entry"/>
              <contextType value="variable"/>
              <element value="request"/>
              <variable value="request"/>
            </target>
            <target>
              <context value="request"/>
              <contextType value="variable"/>
              <element value="method"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="POST"/>
              </parameter>
            </target>
            <target>
              <contextType value="variable"/>
              <variable value="uuid"/>
              <transform value="uuid"/>
            </target>
            <target>
              <context value="request"/>
              <contextType value="variable"/>
              <element value="url"/>
              <transform value="append"/>
              <parameter>
                <valueString value="/Observation/"/>
              </parameter>
              <parameter>
                <valueId value="uuid"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="d5f13abf"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="entry"/>
              <contextType value="variable"/>
              <element value="resource"/>
              <variable value="tgt"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Observation"/>
              </parameter>
            </target>
            <rule>
              <name value="11652079"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <contextType value="variable"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="tgt"/>
                </parameter>
              </target>
              <dependent>
                <name value="cheobservationcheb7de10"/>
                <variable value="src"/>
                <variable value="tgt"/>
              </dependent>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
  <group>
    <name value="cheobservationcheb7de01"/>
    <typeMode value="none"/>
    <input>
      <name value="src"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="id-cheb7de01"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="identifier"/>
        <variable value="CodeID"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Identifier"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="http://hl7.org/fhir/namingsystem-identifier-type"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="use"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="official"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="value"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="uuid"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="id"/>
        <transform value="uuid"/>
      </target>
    </rule>
    <rule>
      <name value="35bc6b82"/>
      <source>
        <context value="src"/>
        <element value="encounter"/>
        <variable value="encounter"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="encounter"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="encounter"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="code-cheb7de01"/>
      <source>
        <context value="src"/>
        <element value="subject"/>
        <variable value="subject"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="subject"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="subject"/>
        </parameter>
      </target>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="meta"/>
        <variable value="newMeta"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Meta"/>
        </parameter>
      </target>
      <target>
        <context value="newMeta"/>
        <contextType value="variable"/>
        <element value="profile"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/cheobservation"/>
        </parameter>
      </target>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="code"/>
        <variable value="concept"/>
        <transform value="create"/>
        <parameter>
          <valueString value="CodeableConcept"/>
        </parameter>
      </target>
      <target>
        <context value="concept"/>
        <contextType value="variable"/>
        <element value="coding"/>
        <variable value="coding"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Coding"/>
        </parameter>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/CodeSystem/che-custom-codes"/>
        </parameter>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="code"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="CHE.B7.DE01"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="aae7a11d"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <variable value="itemtimestamp"/>
        <condition value="linkId = 'timestamp'"/>
      </source>
      <rule>
        <name value="7f22f29f"/>
        <source>
          <context value="itemtimestamp"/>
          <element value="answer"/>
          <listMode value="first"/>
          <variable value="atimestamp"/>
        </source>
        <rule>
          <name value="5af77f2c"/>
          <source>
            <context value="atimestamp"/>
            <element value="value"/>
            <variable value="val"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="issued"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="val"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="patient"/>
      <source>
        <context value="src"/>
        <element value="subject"/>
        <variable value="subject"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="subject"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="subject"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="4e154863"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="itm1"/>
        <condition value="linkId = 'LTI'"/>
      </source>
      <rule>
        <name value="31c15607"/>
        <source>
          <context value="itm1"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition value="(linkId = 'CHE.B7.DE01') and answer.exists()"/>
        </source>
        <rule>
          <name value="bdab9370"/>
          <source>
            <context value="item"/>
            <element value="answer"/>
            <listMode value="first"/>
            <variable value="a"/>
          </source>
          <rule>
            <name value="final-cheb7de01"/>
            <source>
              <context value="a"/>
              <condition value="a.value = true"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="final"/>
              </parameter>
            </target>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="value"/>
              <transform value="copy"/>
              <parameter>
                <valueBoolean value="true"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="notfound-cheb7de01"/>
            <source>
              <context value="a"/>
              <condition value="a.value = false"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="cancelled"/>
              </parameter>
            </target>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="value"/>
              <transform value="copy"/>
              <parameter>
                <valueBoolean value="false"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
  <group>
    <name value="cheobservationcheb7de01tt"/>
    <typeMode value="none"/>
    <input>
      <name value="src"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="id-cheb7de01tt"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="identifier"/>
        <variable value="CodeID"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Identifier"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="http://hl7.org/fhir/namingsystem-identifier-type"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="use"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="official"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="value"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="uuid"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="id"/>
        <transform value="uuid"/>
      </target>
    </rule>
    <rule>
      <name value="35bc6b82"/>
      <source>
        <context value="src"/>
        <element value="encounter"/>
        <variable value="encounter"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="encounter"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="encounter"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="code-cheb7de01tt"/>
      <source>
        <context value="src"/>
        <element value="subject"/>
        <variable value="subject"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="subject"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="subject"/>
        </parameter>
      </target>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="meta"/>
        <variable value="newMeta"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Meta"/>
        </parameter>
      </target>
      <target>
        <context value="newMeta"/>
        <contextType value="variable"/>
        <element value="profile"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/cheobservation"/>
        </parameter>
      </target>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="code"/>
        <variable value="concept"/>
        <transform value="create"/>
        <parameter>
          <valueString value="CodeableConcept"/>
        </parameter>
      </target>
      <target>
        <context value="concept"/>
        <contextType value="variable"/>
        <element value="coding"/>
        <variable value="coding"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Coding"/>
        </parameter>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/CodeSystem/che-custom-codes"/>
        </parameter>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="code"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="CHE.B7.DE01-tt"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="aae7a11d"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <variable value="itemtimestamp"/>
        <condition value="linkId = 'timestamp'"/>
      </source>
      <rule>
        <name value="7f22f29f"/>
        <source>
          <context value="itemtimestamp"/>
          <element value="answer"/>
          <listMode value="first"/>
          <variable value="atimestamp"/>
        </source>
        <rule>
          <name value="5af77f2c"/>
          <source>
            <context value="atimestamp"/>
            <element value="value"/>
            <variable value="val"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="issued"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="val"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="patient"/>
      <source>
        <context value="src"/>
        <element value="subject"/>
        <variable value="subject"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="subject"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="subject"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="6029e684"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="itm1"/>
        <condition value="linkId = 'LTI'"/>
      </source>
      <rule>
        <name value="015ed333"/>
        <source>
          <context value="itm1"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition value="(linkId = 'CHE.B7.DE01-tt') and answer.exists()"/>
        </source>
        <rule>
          <name value="bdab9370"/>
          <source>
            <context value="item"/>
            <element value="answer"/>
            <listMode value="first"/>
            <variable value="a"/>
          </source>
          <rule>
            <name value="final-cheb7de01tt"/>
            <source>
              <context value="a"/>
              <condition value="a.value = true"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="final"/>
              </parameter>
            </target>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="value"/>
              <transform value="copy"/>
              <parameter>
                <valueBoolean value="true"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="notfound-cheb7de01tt"/>
            <source>
              <context value="a"/>
              <condition value="a.value = false"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="cancelled"/>
              </parameter>
            </target>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="value"/>
              <transform value="copy"/>
              <parameter>
                <valueBoolean value="false"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
  <group>
    <name value="cheobservationcheb7de02"/>
    <typeMode value="none"/>
    <input>
      <name value="src"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="id-cheb7de02"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="identifier"/>
        <variable value="CodeID"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Identifier"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="http://hl7.org/fhir/namingsystem-identifier-type"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="use"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="official"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="value"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="uuid"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="id"/>
        <transform value="uuid"/>
      </target>
    </rule>
    <rule>
      <name value="35bc6b82"/>
      <source>
        <context value="src"/>
        <element value="encounter"/>
        <variable value="encounter"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="encounter"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="encounter"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="code-cheb7de02"/>
      <source>
        <context value="src"/>
        <element value="subject"/>
        <variable value="subject"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="subject"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="subject"/>
        </parameter>
      </target>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="meta"/>
        <variable value="newMeta"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Meta"/>
        </parameter>
      </target>
      <target>
        <context value="newMeta"/>
        <contextType value="variable"/>
        <element value="profile"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/cheobservation"/>
        </parameter>
      </target>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="code"/>
        <variable value="concept"/>
        <transform value="create"/>
        <parameter>
          <valueString value="CodeableConcept"/>
        </parameter>
      </target>
      <target>
        <context value="concept"/>
        <contextType value="variable"/>
        <element value="coding"/>
        <variable value="coding"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Coding"/>
        </parameter>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/CodeSystem/che-custom-codes"/>
        </parameter>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="code"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="CHE.B7.DE02"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="aae7a11d"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <variable value="itemtimestamp"/>
        <condition value="linkId = 'timestamp'"/>
      </source>
      <rule>
        <name value="7f22f29f"/>
        <source>
          <context value="itemtimestamp"/>
          <element value="answer"/>
          <listMode value="first"/>
          <variable value="atimestamp"/>
        </source>
        <rule>
          <name value="5af77f2c"/>
          <source>
            <context value="atimestamp"/>
            <element value="value"/>
            <variable value="val"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="issued"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="val"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="patient"/>
      <source>
        <context value="src"/>
        <element value="subject"/>
        <variable value="subject"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="subject"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="subject"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="2f78f394"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="itm1"/>
        <condition value="linkId = 'LTI'"/>
      </source>
      <rule>
        <name value="5ab27008"/>
        <source>
          <context value="itm1"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition value="(linkId = 'CHE.B7.DE02') and answer.exists()"/>
        </source>
        <rule>
          <name value="bdab9370"/>
          <source>
            <context value="item"/>
            <element value="answer"/>
            <listMode value="first"/>
            <variable value="a"/>
          </source>
          <rule>
            <name value="final-cheb7de02"/>
            <source>
              <context value="a"/>
              <condition value="a.value = true"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="final"/>
              </parameter>
            </target>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="value"/>
              <transform value="copy"/>
              <parameter>
                <valueBoolean value="true"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="notfound-cheb7de02"/>
            <source>
              <context value="a"/>
              <condition value="a.value = false"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="cancelled"/>
              </parameter>
            </target>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="value"/>
              <transform value="copy"/>
              <parameter>
                <valueBoolean value="false"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
  <group>
    <name value="cheobservationcheb7b8b9de01"/>
    <typeMode value="none"/>
    <input>
      <name value="src"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="id-cheb7b8b9de01"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="identifier"/>
        <variable value="CodeID"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Identifier"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="http://hl7.org/fhir/namingsystem-identifier-type"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="use"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="official"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="value"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="uuid"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="id"/>
        <transform value="uuid"/>
      </target>
    </rule>
    <rule>
      <name value="35bc6b82"/>
      <source>
        <context value="src"/>
        <element value="encounter"/>
        <variable value="encounter"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="encounter"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="encounter"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="code-cheb7b8b9de01"/>
      <source>
        <context value="src"/>
        <element value="subject"/>
        <variable value="subject"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="subject"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="subject"/>
        </parameter>
      </target>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="meta"/>
        <variable value="newMeta"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Meta"/>
        </parameter>
      </target>
      <target>
        <context value="newMeta"/>
        <contextType value="variable"/>
        <element value="profile"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/cheobservation"/>
        </parameter>
      </target>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="code"/>
        <variable value="concept"/>
        <transform value="create"/>
        <parameter>
          <valueString value="CodeableConcept"/>
        </parameter>
      </target>
      <target>
        <context value="concept"/>
        <contextType value="variable"/>
        <element value="coding"/>
        <variable value="coding"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Coding"/>
        </parameter>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/CodeSystem/che-custom-codes"/>
        </parameter>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="code"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="CHE.B7.B8.B9.DE01"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="aae7a11d"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <variable value="itemtimestamp"/>
        <condition value="linkId = 'timestamp'"/>
      </source>
      <rule>
        <name value="7f22f29f"/>
        <source>
          <context value="itemtimestamp"/>
          <element value="answer"/>
          <listMode value="first"/>
          <variable value="atimestamp"/>
        </source>
        <rule>
          <name value="5af77f2c"/>
          <source>
            <context value="atimestamp"/>
            <element value="value"/>
            <variable value="val"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="issued"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="val"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="patient"/>
      <source>
        <context value="src"/>
        <element value="subject"/>
        <variable value="subject"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="subject"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="subject"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="37fe0ecf"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="itm1"/>
        <condition value="linkId = 'LTI'"/>
      </source>
      <rule>
        <name value="fc6944d0"/>
        <source>
          <context value="itm1"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition
                     value="(linkId = 'CHE.B7.B8.B9.DE01') and answer.exists()"/>
        </source>
        <rule>
          <name value="7c587a4b"/>
          <source>
            <context value="item"/>
            <element value="answer"/>
            <listMode value="first"/>
            <variable value="a"/>
          </source>
          <rule>
            <name value="4ca9082e"/>
            <source>
              <context value="a"/>
              <element value="value"/>
              <variable value="val"/>
            </source>
            <rule>
              <name value="8ab1d7a5"/>
              <source>
                <context value="val"/>
                <condition value="val.code = 'none'"/>
              </source>
              <target>
                <context value="tgt"/>
                <contextType value="variable"/>
                <element value="status"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="cancelled"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="a1050460"/>
              <source>
                <context value="val"/>
                <condition value="val.code != 'none'"/>
              </source>
              <target>
                <context value="tgt"/>
                <contextType value="variable"/>
                <element value="value"/>
                <variable value="cc"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="CodeableConcept"/>
                </parameter>
              </target>
              <target>
                <context value="cc"/>
                <contextType value="variable"/>
                <element value="coding"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="val"/>
                </parameter>
              </target>
              <target>
                <context value="tgt"/>
                <contextType value="variable"/>
                <element value="status"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="final"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
  <group>
    <name value="cheobservationcheb7de03"/>
    <typeMode value="none"/>
    <input>
      <name value="src"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="id-cheb7de03"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="identifier"/>
        <variable value="CodeID"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Identifier"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="http://hl7.org/fhir/namingsystem-identifier-type"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="use"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="official"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="value"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="uuid"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="id"/>
        <transform value="uuid"/>
      </target>
    </rule>
    <rule>
      <name value="35bc6b82"/>
      <source>
        <context value="src"/>
        <element value="encounter"/>
        <variable value="encounter"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="encounter"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="encounter"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="code-cheb7de03"/>
      <source>
        <context value="src"/>
        <element value="subject"/>
        <variable value="subject"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="subject"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="subject"/>
        </parameter>
      </target>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="meta"/>
        <variable value="newMeta"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Meta"/>
        </parameter>
      </target>
      <target>
        <context value="newMeta"/>
        <contextType value="variable"/>
        <element value="profile"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/cheobservation"/>
        </parameter>
      </target>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="code"/>
        <variable value="concept"/>
        <transform value="create"/>
        <parameter>
          <valueString value="CodeableConcept"/>
        </parameter>
      </target>
      <target>
        <context value="concept"/>
        <contextType value="variable"/>
        <element value="coding"/>
        <variable value="coding"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Coding"/>
        </parameter>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/CodeSystem/che-custom-codes"/>
        </parameter>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="code"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="CHE.B7.DE03"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="aae7a11d"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <variable value="itemtimestamp"/>
        <condition value="linkId = 'timestamp'"/>
      </source>
      <rule>
        <name value="7f22f29f"/>
        <source>
          <context value="itemtimestamp"/>
          <element value="answer"/>
          <listMode value="first"/>
          <variable value="atimestamp"/>
        </source>
        <rule>
          <name value="5af77f2c"/>
          <source>
            <context value="atimestamp"/>
            <element value="value"/>
            <variable value="val"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="issued"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="val"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="patient"/>
      <source>
        <context value="src"/>
        <element value="subject"/>
        <variable value="subject"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="subject"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="subject"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="e2cab342"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="itm1"/>
        <condition value="linkId = 'ds'"/>
      </source>
      <rule>
        <name value="b2289b9b"/>
        <source>
          <context value="itm1"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition value="(linkId = 'CHE.B7.DE03') and answer.exists()"/>
        </source>
        <rule>
          <name value="bdab9370"/>
          <source>
            <context value="item"/>
            <element value="answer"/>
            <listMode value="first"/>
            <variable value="a"/>
          </source>
          <rule>
            <name value="final-cheb7de03"/>
            <source>
              <context value="a"/>
              <condition value="a.value = true"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="final"/>
              </parameter>
            </target>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="value"/>
              <transform value="copy"/>
              <parameter>
                <valueBoolean value="true"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="notfound-cheb7de03"/>
            <source>
              <context value="a"/>
              <condition value="a.value = false"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="cancelled"/>
              </parameter>
            </target>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="value"/>
              <transform value="copy"/>
              <parameter>
                <valueBoolean value="false"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
  <group>
    <name value="cheobservationcheb7de04"/>
    <typeMode value="none"/>
    <input>
      <name value="src"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="id-cheb7de04"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="identifier"/>
        <variable value="CodeID"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Identifier"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="http://hl7.org/fhir/namingsystem-identifier-type"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="use"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="official"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="value"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="uuid"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="id"/>
        <transform value="uuid"/>
      </target>
    </rule>
    <rule>
      <name value="35bc6b82"/>
      <source>
        <context value="src"/>
        <element value="encounter"/>
        <variable value="encounter"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="encounter"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="encounter"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="code-cheb7de04"/>
      <source>
        <context value="src"/>
        <element value="subject"/>
        <variable value="subject"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="subject"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="subject"/>
        </parameter>
      </target>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="meta"/>
        <variable value="newMeta"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Meta"/>
        </parameter>
      </target>
      <target>
        <context value="newMeta"/>
        <contextType value="variable"/>
        <element value="profile"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/cheobservation"/>
        </parameter>
      </target>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="code"/>
        <variable value="concept"/>
        <transform value="create"/>
        <parameter>
          <valueString value="CodeableConcept"/>
        </parameter>
      </target>
      <target>
        <context value="concept"/>
        <contextType value="variable"/>
        <element value="coding"/>
        <variable value="coding"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Coding"/>
        </parameter>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/CodeSystem/che-custom-codes"/>
        </parameter>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="code"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="CHE.B7.DE04"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="aae7a11d"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <variable value="itemtimestamp"/>
        <condition value="linkId = 'timestamp'"/>
      </source>
      <rule>
        <name value="7f22f29f"/>
        <source>
          <context value="itemtimestamp"/>
          <element value="answer"/>
          <listMode value="first"/>
          <variable value="atimestamp"/>
        </source>
        <rule>
          <name value="5af77f2c"/>
          <source>
            <context value="atimestamp"/>
            <element value="value"/>
            <variable value="val"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="issued"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="val"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="patient"/>
      <source>
        <context value="src"/>
        <element value="subject"/>
        <variable value="subject"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="subject"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="subject"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="d2667a29"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="itm1"/>
        <condition value="linkId = 'ds'"/>
      </source>
      <rule>
        <name value="439124b7"/>
        <source>
          <context value="itm1"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition value="(linkId = 'CHE.B7.DE04') and answer.exists()"/>
        </source>
        <rule>
          <name value="7c587a4b"/>
          <source>
            <context value="item"/>
            <element value="answer"/>
            <listMode value="first"/>
            <variable value="a"/>
          </source>
          <rule>
            <name value="4ca9082e"/>
            <source>
              <context value="a"/>
              <element value="value"/>
              <variable value="val"/>
            </source>
            <rule>
              <name value="8ab1d7a5"/>
              <source>
                <context value="val"/>
                <condition value="val.code = 'none'"/>
              </source>
              <target>
                <context value="tgt"/>
                <contextType value="variable"/>
                <element value="status"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="cancelled"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="a1050460"/>
              <source>
                <context value="val"/>
                <condition value="val.code != 'none'"/>
              </source>
              <target>
                <context value="tgt"/>
                <contextType value="variable"/>
                <element value="value"/>
                <variable value="cc"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="CodeableConcept"/>
                </parameter>
              </target>
              <target>
                <context value="cc"/>
                <contextType value="variable"/>
                <element value="coding"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="val"/>
                </parameter>
              </target>
              <target>
                <context value="tgt"/>
                <contextType value="variable"/>
                <element value="status"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="final"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
  <group>
    <name value="cheobservationcheb7de07"/>
    <typeMode value="none"/>
    <input>
      <name value="src"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="id-cheb7de07"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="identifier"/>
        <variable value="CodeID"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Identifier"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="http://hl7.org/fhir/namingsystem-identifier-type"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="use"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="official"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="value"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="uuid"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="id"/>
        <transform value="uuid"/>
      </target>
    </rule>
    <rule>
      <name value="35bc6b82"/>
      <source>
        <context value="src"/>
        <element value="encounter"/>
        <variable value="encounter"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="encounter"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="encounter"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="code-cheb7de07"/>
      <source>
        <context value="src"/>
        <element value="subject"/>
        <variable value="subject"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="subject"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="subject"/>
        </parameter>
      </target>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="meta"/>
        <variable value="newMeta"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Meta"/>
        </parameter>
      </target>
      <target>
        <context value="newMeta"/>
        <contextType value="variable"/>
        <element value="profile"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/cheobservation"/>
        </parameter>
      </target>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="code"/>
        <variable value="concept"/>
        <transform value="create"/>
        <parameter>
          <valueString value="CodeableConcept"/>
        </parameter>
      </target>
      <target>
        <context value="concept"/>
        <contextType value="variable"/>
        <element value="coding"/>
        <variable value="coding"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Coding"/>
        </parameter>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/CodeSystem/che-custom-codes"/>
        </parameter>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="code"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="CHE.B7.DE07"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="aae7a11d"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <variable value="itemtimestamp"/>
        <condition value="linkId = 'timestamp'"/>
      </source>
      <rule>
        <name value="7f22f29f"/>
        <source>
          <context value="itemtimestamp"/>
          <element value="answer"/>
          <listMode value="first"/>
          <variable value="atimestamp"/>
        </source>
        <rule>
          <name value="5af77f2c"/>
          <source>
            <context value="atimestamp"/>
            <element value="value"/>
            <variable value="val"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="issued"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="val"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="patient"/>
      <source>
        <context value="src"/>
        <element value="subject"/>
        <variable value="subject"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="subject"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="subject"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="3dd9674b"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="itm1"/>
        <condition value="linkId = 'ds'"/>
      </source>
      <rule>
        <name value="97792e44"/>
        <source>
          <context value="itm1"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition value="(linkId = 'CHE.B7.DE07') and answer.exists()"/>
        </source>
        <rule>
          <name value="bdab9370"/>
          <source>
            <context value="item"/>
            <element value="answer"/>
            <listMode value="first"/>
            <variable value="a"/>
          </source>
          <rule>
            <name value="final-cheb7de07"/>
            <source>
              <context value="a"/>
              <condition value="a.value = true"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="final"/>
              </parameter>
            </target>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="value"/>
              <transform value="copy"/>
              <parameter>
                <valueBoolean value="true"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="notfound-cheb7de07"/>
            <source>
              <context value="a"/>
              <condition value="a.value = false"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="cancelled"/>
              </parameter>
            </target>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="value"/>
              <transform value="copy"/>
              <parameter>
                <valueBoolean value="false"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
  <group>
    <name value="cheobservationcheb7de08"/>
    <typeMode value="none"/>
    <input>
      <name value="src"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="id-cheb7de08"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="identifier"/>
        <variable value="CodeID"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Identifier"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="http://hl7.org/fhir/namingsystem-identifier-type"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="use"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="official"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="value"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="uuid"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="id"/>
        <transform value="uuid"/>
      </target>
    </rule>
    <rule>
      <name value="35bc6b82"/>
      <source>
        <context value="src"/>
        <element value="encounter"/>
        <variable value="encounter"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="encounter"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="encounter"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="code-cheb7de08"/>
      <source>
        <context value="src"/>
        <element value="subject"/>
        <variable value="subject"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="subject"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="subject"/>
        </parameter>
      </target>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="meta"/>
        <variable value="newMeta"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Meta"/>
        </parameter>
      </target>
      <target>
        <context value="newMeta"/>
        <contextType value="variable"/>
        <element value="profile"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/cheobservation"/>
        </parameter>
      </target>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="code"/>
        <variable value="concept"/>
        <transform value="create"/>
        <parameter>
          <valueString value="CodeableConcept"/>
        </parameter>
      </target>
      <target>
        <context value="concept"/>
        <contextType value="variable"/>
        <element value="coding"/>
        <variable value="coding"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Coding"/>
        </parameter>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/CodeSystem/che-custom-codes"/>
        </parameter>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="code"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="CHE.B7.DE08"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="aae7a11d"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <variable value="itemtimestamp"/>
        <condition value="linkId = 'timestamp'"/>
      </source>
      <rule>
        <name value="7f22f29f"/>
        <source>
          <context value="itemtimestamp"/>
          <element value="answer"/>
          <listMode value="first"/>
          <variable value="atimestamp"/>
        </source>
        <rule>
          <name value="5af77f2c"/>
          <source>
            <context value="atimestamp"/>
            <element value="value"/>
            <variable value="val"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="issued"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="val"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="patient"/>
      <source>
        <context value="src"/>
        <element value="subject"/>
        <variable value="subject"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="subject"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="subject"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="1cb8e50b"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="itm1"/>
        <condition value="linkId = 'ds'"/>
      </source>
      <rule>
        <name value="0c6e49a5"/>
        <source>
          <context value="itm1"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition value="(linkId = 'CHE.B7.DE08') and answer.exists()"/>
        </source>
        <rule>
          <name value="bdab9370"/>
          <source>
            <context value="item"/>
            <element value="answer"/>
            <listMode value="first"/>
            <variable value="a"/>
          </source>
          <rule>
            <name value="final-cheb7de08"/>
            <source>
              <context value="a"/>
              <condition value="a.value = true"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="final"/>
              </parameter>
            </target>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="value"/>
              <transform value="copy"/>
              <parameter>
                <valueBoolean value="true"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="notfound-cheb7de08"/>
            <source>
              <context value="a"/>
              <condition value="a.value = false"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="cancelled"/>
              </parameter>
            </target>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="value"/>
              <transform value="copy"/>
              <parameter>
                <valueBoolean value="false"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
  <group>
    <name value="cheobservationcheb7de09"/>
    <typeMode value="none"/>
    <input>
      <name value="src"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="id-cheb7de09"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="identifier"/>
        <variable value="CodeID"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Identifier"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="http://hl7.org/fhir/namingsystem-identifier-type"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="use"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="official"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="value"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="uuid"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="id"/>
        <transform value="uuid"/>
      </target>
    </rule>
    <rule>
      <name value="35bc6b82"/>
      <source>
        <context value="src"/>
        <element value="encounter"/>
        <variable value="encounter"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="encounter"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="encounter"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="code-cheb7de09"/>
      <source>
        <context value="src"/>
        <element value="subject"/>
        <variable value="subject"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="subject"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="subject"/>
        </parameter>
      </target>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="meta"/>
        <variable value="newMeta"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Meta"/>
        </parameter>
      </target>
      <target>
        <context value="newMeta"/>
        <contextType value="variable"/>
        <element value="profile"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/cheobservation"/>
        </parameter>
      </target>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="code"/>
        <variable value="concept"/>
        <transform value="create"/>
        <parameter>
          <valueString value="CodeableConcept"/>
        </parameter>
      </target>
      <target>
        <context value="concept"/>
        <contextType value="variable"/>
        <element value="coding"/>
        <variable value="coding"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Coding"/>
        </parameter>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/CodeSystem/che-custom-codes"/>
        </parameter>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="code"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="CHE.B7.DE09"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="aae7a11d"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <variable value="itemtimestamp"/>
        <condition value="linkId = 'timestamp'"/>
      </source>
      <rule>
        <name value="7f22f29f"/>
        <source>
          <context value="itemtimestamp"/>
          <element value="answer"/>
          <listMode value="first"/>
          <variable value="atimestamp"/>
        </source>
        <rule>
          <name value="5af77f2c"/>
          <source>
            <context value="atimestamp"/>
            <element value="value"/>
            <variable value="val"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="issued"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="val"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="patient"/>
      <source>
        <context value="src"/>
        <element value="subject"/>
        <variable value="subject"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="subject"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="subject"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="50c338e5"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="itm1"/>
        <condition value="linkId = 'ds'"/>
      </source>
      <rule>
        <name value="95ee9897"/>
        <source>
          <context value="itm1"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition value="(linkId = 'CHE.B7.DE09') and answer.exists()"/>
        </source>
        <rule>
          <name value="bdab9370"/>
          <source>
            <context value="item"/>
            <element value="answer"/>
            <listMode value="first"/>
            <variable value="a"/>
          </source>
          <rule>
            <name value="final-cheb7de09"/>
            <source>
              <context value="a"/>
              <condition value="a.value = true"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="final"/>
              </parameter>
            </target>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="value"/>
              <transform value="copy"/>
              <parameter>
                <valueBoolean value="true"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="notfound-cheb7de09"/>
            <source>
              <context value="a"/>
              <condition value="a.value = false"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="cancelled"/>
              </parameter>
            </target>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="value"/>
              <transform value="copy"/>
              <parameter>
                <valueBoolean value="false"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
  <group>
    <name value="cheobservationcheb7de10"/>
    <typeMode value="none"/>
    <input>
      <name value="src"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="id-cheb7de10"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="identifier"/>
        <variable value="CodeID"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Identifier"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="http://hl7.org/fhir/namingsystem-identifier-type"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="use"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="official"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="value"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="uuid"/>
        </parameter>
      </target>
      <target>
        <context value="CodeID"/>
        <contextType value="variable"/>
        <element value="id"/>
        <transform value="uuid"/>
      </target>
    </rule>
    <rule>
      <name value="35bc6b82"/>
      <source>
        <context value="src"/>
        <element value="encounter"/>
        <variable value="encounter"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="encounter"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="encounter"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="code-cheb7de10"/>
      <source>
        <context value="src"/>
        <element value="subject"/>
        <variable value="subject"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="subject"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="subject"/>
        </parameter>
      </target>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="meta"/>
        <variable value="newMeta"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Meta"/>
        </parameter>
      </target>
      <target>
        <context value="newMeta"/>
        <contextType value="variable"/>
        <element value="profile"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/cheobservation"/>
        </parameter>
      </target>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="code"/>
        <variable value="concept"/>
        <transform value="create"/>
        <parameter>
          <valueString value="CodeableConcept"/>
        </parameter>
      </target>
      <target>
        <context value="concept"/>
        <contextType value="variable"/>
        <element value="coding"/>
        <variable value="coding"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Coding"/>
        </parameter>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/CodeSystem/che-custom-codes"/>
        </parameter>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="code"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="CHE.B7.DE10"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="aae7a11d"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <variable value="itemtimestamp"/>
        <condition value="linkId = 'timestamp'"/>
      </source>
      <rule>
        <name value="7f22f29f"/>
        <source>
          <context value="itemtimestamp"/>
          <element value="answer"/>
          <listMode value="first"/>
          <variable value="atimestamp"/>
        </source>
        <rule>
          <name value="5af77f2c"/>
          <source>
            <context value="atimestamp"/>
            <element value="value"/>
            <variable value="val"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="issued"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="val"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="patient"/>
      <source>
        <context value="src"/>
        <element value="subject"/>
        <variable value="subject"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="subject"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="subject"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="ad934662"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="itm1"/>
        <condition value="linkId = 'ds'"/>
      </source>
      <rule>
        <name value="88b2075a"/>
        <source>
          <context value="itm1"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition value="(linkId = 'CHE.B7.DE10') and answer.exists()"/>
        </source>
        <rule>
          <name value="7c587a4b"/>
          <source>
            <context value="item"/>
            <element value="answer"/>
            <listMode value="first"/>
            <variable value="a"/>
          </source>
          <rule>
            <name value="4ca9082e"/>
            <source>
              <context value="a"/>
              <element value="value"/>
              <variable value="val"/>
            </source>
            <rule>
              <name value="8ab1d7a5"/>
              <source>
                <context value="val"/>
                <condition value="val.code = 'none'"/>
              </source>
              <target>
                <context value="tgt"/>
                <contextType value="variable"/>
                <element value="status"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="cancelled"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="a1050460"/>
              <source>
                <context value="val"/>
                <condition value="val.code != 'none'"/>
              </source>
              <target>
                <context value="tgt"/>
                <contextType value="variable"/>
                <element value="value"/>
                <variable value="cc"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="CodeableConcept"/>
                </parameter>
              </target>
              <target>
                <context value="cc"/>
                <contextType value="variable"/>
                <element value="coding"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="val"/>
                </parameter>
              </target>
              <target>
                <context value="tgt"/>
                <contextType value="variable"/>
                <element value="status"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="final"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
</StructureMap>