CDA to FHIR Maps - Local Development build (v0.1.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions
Draft as of 2024-04-11 |
<StructureMap xmlns="http://hl7.org/fhir">
<id value="cda2fhirVaccination"/>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>map "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirVaccination" = "cda2fhirVaccination"
uses "http://hl7.org/fhir/cda/StructureDefinition/ClinicalDocument" alias ClinicalDocument as source
uses "http://hl7.org/fhir/cda/StructureDefinition/AssignedAuthor" alias AssignedAuthor as queried
uses "http://hl7.org/fhir/cda/StructureDefinition/AssignedEntity" alias AssignedEntity as queried
uses "http://hl7.org/fhir/cda/StructureDefinition/AssociatedEntity" alias AssociatedEntity as queried
uses "http://hl7.org/fhir/cda/StructureDefinition/CustodianOrganization" alias CustodianOrganization as queried
uses "http://hl7.org/fhir/cda/StructureDefinition/OrganizationPartOf" alias OrganizationPartOf as queried
uses "http://hl7.org/fhir/cda/StructureDefinition/Organization" alias rapresentedOrganization as queried
uses "http://hl7.org/fhir/cda/StructureDefinition/Section" alias Section as queried
uses "http://hl7.org/fhir/cda/StructureDefinition/PatientRole" alias PatientRole as queried
uses "http://hl7.org/fhir/cda/StructureDefinition/AD" alias AD as source
uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as target
uses "http://hl7.org/fhir/StructureDefinition/Composition" alias Composition as produced
uses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as produced
uses "http://hl7.org/fhir/StructureDefinition/Encounter" alias Encounter as produced
uses "http://hl7.org/fhir/StructureDefinition/Person" alias Patient as produced
uses "http://hl7.org/fhir/StructureDefinition/Practitioner" alias Practitioner as produced
uses "http://hl7.org/fhir/StructureDefinition/Organization" alias Organization as produced
uses "http://hl7.org/fhir/cda/StructureDefinition/Act" alias Act as produced
uses "http://hl7.org/fhir/cda/StructureDefinition/IVL-PQ" alias IVL_PQ as source
uses "http://hl7.org/fhir/cda/StructureDefinition/PQ" alias PQ as source
uses "http://hl7.org/fhir/StructureDefinition/SimpleQuantity" alias SimpleQuantity as target
uses "http://hl7.org/fhir/StructureDefinition/Immunization" alias Immunization as target
imports "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirDataTypes"
imports "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirHeader"
group CdaToBundle(source cda : ClinicalDocument, target bundle : Bundle) {
cda -> bundle.entry as e, e.request = create('BackboneElement') as request, request.method = 'POST', e.resource = create('Composition') as composition, composition.id = uuid() as uuid1, e.fullUrl = append('https://example/Composition/', uuid1), request.url = 'Composition', bundle.entry as e2, e2.request = create('BackboneElement') as requestPAT, requestPAT.method = 'PUT', e2.resource = create('Patient') as patient, patient.id = uuid() as uuid2, e2.fullUrl = append('https://example/Patient/', uuid2), bundle.entry as e3, e3.request = create('BackboneElement') as request, request.method = 'POST', e3.resource = create('Encounter') as encounter, encounter.id = uuid() as uuid3, e3.fullUrl = append('https://example/Encounter/', uuid3), request.url = 'Encounter', bundle.entry as e5, e5.request = create('BackboneElement') as request, request.method = 'POST', e5.resource = create('DocumentReference') as DocumentReference, DocumentReference.id = uuid() as uuid5, e5.fullUrl = append('https://example/DocumentReference/', uuid5), request.url = 'DocumentReference' then {
cda then ClinicalDocumentToBundle(cda, patient, composition, encounter, bundle, DocumentReference) "cdatobundle";
cda.recordTarget as recordTarget then {
recordTarget.patientRole as patient then {
patient.id as id -> patient.identifier as identifier then {
id.root as r -> identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') "root1";
id.extension as ext1 -> identifier.value = ext1 "value";
id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;
} "idfr";
patient.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') or (root = '2.16.840.1.113883.2.9.4.3.7') or (root = '2.16.840.1.113883.2.9.4.3.3') or (root = '2.16.840.1.113883.2.9.4.3.17') or (root = '2.16.840.1.113883.2.9.4.3.18') or (root = '2.16.840.1.113883.2.9.2.10.4.1.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1.1') or (root = '2.16.840.1.113883.2.9.2.10.4.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1') or (root = '2.16.840.1.113883.2.9.4.3.15') then {
id.extension as ext -> requestPAT.url = append('Patient?identifier=', ext) "UUID";
} "ext";
} "record";
} "recPat";
} "ClinicalDocumentToBody";
}
group ClinicalDocumentToBundle(source cda : ClinicalDocument, target patient : Patient, target composition : Composition, target encounter : Encounter, target bundle : Bundle, target DocumentReference : DocumentReference) {
cda -> encounter.status = 'finished' "finished";
cda -> encounter.class = create('Coding') as coding then {
cda -> coding.code = 'AMB' "amb";
} "coding";
cda -> bundle.id = uuid() "id";
cda.id -> bundle.identifier "identifier";
cda -> bundle.type = 'transaction' "type";
cda -> bundle.timestamp = (timestamp.now()) "date";
cda then ClinicalDocumentComposition(cda, composition, patient, encounter, bundle, DocumentReference) "composition";
cda.component as component then {
component.structuredBody as body then {
body.component as component then {
component.section as srcSection then {
srcSection -> composition.section as tgtSection then ClinicalDocumentSection(cda, srcSection, patient, tgtSection, bundle, encounter) "TerapiaFarmacologicaAllaDimissione";
};
};
} "body";
};
}
// --------------------------------
group ClinicalDocumentSection(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {
src.title as t -> tgt.title = (t.dataString);
src.code -> tgt.code;
src.text as cdaText -> tgt.text as fhirText then {
cdaText -> fhirText.status = 'generated' "narrativeStatus";
cdaText as t -> fhirText.div = t "narrativeText";
} "cdaText";
src.entry as entry1 then {
entry1.substanceAdministration as substance then {
substance.templateId where (root = '2.16.840.1.113883.2.9.10.1.11.4.1') -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Immunization') as immunization, immunization.id = uuid() as uuid1, e1.fullUrl = append('https://example/Immunization/', uuid1), request.url = 'Immunization', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Immunization/' + %immunization.id) then {
substance -> immunization.patient = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "patientRef";
// substance.templateId as tid -> immunization.identifier as idf then{
substance.statusCode as statusc where (code = 'completed') -> immunization.status = 'completed';
substance.statusCode as statusc where (code = 'aborted') -> immunization.status = 'final';
substance.statusCode as statusc where (code = 'suspended') -> immunization.status = 'enterer-in-error';
substance.statusCode as statusc where (code = 'cancelled') -> immunization.status = 'not-done';
substance.effectiveTime as eff where (value.exists()) -> immunization.occurrence = create('dateTime') as value then TSDateTime(eff, value) "value1";
substance.effectiveTime as eff where (low.exists()) -> immunization.occurrence = create('Period') as value then IVLTSPeriod(eff, value) "valuePeriod";
substance.routeCode -> immunization.route "route";
substance.approachSiteCode -> immunization.site "site";
substance -> immunization.doseQuantity = create('SimpleQuantity') as quantity then {
substance.doseQuantity as q then {
q -> quantity.value = (q.value) "val";
q -> quantity.unit = (q.unit) "uni";
} "qua";
} "q";
substance.consumable as cons then {
cons.manufacturedProduct as manufact then {
manufact.manufacturedMaterial as manufactmat then {
manufactmat.code -> immunization.vaccineCode;
manufactmat.lotNumberText as t -> immunization.lotNumber = (t.dataString);
} "manufactmat";
manufact.manufacturerOrganization as manufactOrg -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Organization') as organization then {
manufactOrg -> organization.meta as meta then {
manufactOrg -> meta.tag = create('Coding') as coding then {
manufactOrg -> coding.system = 'http://algoritmodiscoring' "system";
manufactOrg -> coding.code = 'ClinicalDocument/body/manufacturerOrganization' "code";
} "coding";
} "meta";
manufactOrg.id as id -> organization.identifier as identifier then {
id.root as r -> identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') "root1";
id.extension as ext -> identifier.value = ext then {
ext -> request.url = append('Organization?identifier=', ext) "UUID";
} "ext";
id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;
id.root as r then {
id.extension as ext -> organization.id = (r + '-' + ext) as uuid5, e1.fullUrl = append('https://example/Organization/', uuid5), immunization.manufacturer = create('Reference') as reference, reference.reference = ('https://example/Organization/' + %uuid5);
} "r";
} "identifier";
// manufactOrg.id as id then{
manufactOrg.name as n -> organization.name = (n.other);
} "manufactOrg";
} "manufact";
} "cons";
substance.participant as part -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Location') as location then {
part -> location.meta as meta then {
part -> meta.tag = create('Coding') as coding then {
part -> coding.system = 'http://algoritmodiscoring' "system";
part -> coding.code = 'ClinicalDocument/body/participant' "code";
} "coding";
} "meta";
part.participantRole as partRole then {
partRole.id as id -> location.identifier as identifier then {
id.root as r -> identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') "root1";
id.extension as ext -> identifier.value = ext then {
ext -> request.url = append('Location?identifier=', ext) "UUID";
} "ext";
id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;
id.root as r then {
id.extension as ext -> location.id = (r + '-' + ext) as uuid6, e1.fullUrl = append('https://example/Location/', uuid6), immunization.location = create('Reference') as reference, reference.reference = ('https://example/Location/' + %uuid6) "ref";
} "r";
} "identifier";
} "role";
} "part";
cda -> immunization.protocolApplied as prot then {
substance.entryRelationship as entrirel4 then {
entrirel4.observation as obs then {
obs.code where (code = '75323-6') then {
obs.value -> prot.targetDisease;
} "codeControl";
} "entrirel2";
entrirel4.observation as obsdosenumber then {
obsdosenumber.code where (code = '30973-2') then {
obsdosenumber.value as v then {
v.value as int -> prot.doseNumber = (int.toString());
} "v";
} "codeControl";
} "entrirel2";
} "entrirel4";
} "protocolAp";
substance.entryRelationship as entrirel2 then {
entrirel2.observation as obs then {
obs.code where ((code = '59778-1') or (code = '30981-5') or (code = '30980-7') or (code = '59777-3')) then {
obs.value as value then {
value.high as h then {
h.value as date -> immunization.expirationDate = truncate(date, 10);
} "da";
};
} "codeControl";
} "obs";
} "entrirel2";
substance.entryRelationship as entrirel3 then {
entrirel3.observation as obs then {
obs.code where (code = '95715-9') -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Observation') as observation, observation.id = uuid() as uuid1, e1.fullUrl = append('https://example/Observation/', uuid1), request.url = 'Observation', immunization.reasonReference = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {
obs then Observation(entrirel3, patient, tgt, bundle, enc, observation) "observation";
} "codeControl";
} "obs";
} "entrirel2";
substance.entryRelationship as entrirel4 then {
entrirel4.observation as obs then {
obs.code where (code = '59785-6') -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Observation') as observation, observation.id = uuid() as uuid1, e1.fullUrl = append('https://example/Observation/', uuid1), request.url = 'Observation', immunization.reasonReference = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {
obs then Observation1(entrirel4, patient, tgt, bundle, enc, observation) "observation";
} "codeControl";
} "obs";
} "entrirel2";
substance.entryRelationship as entrirel4 then {
entrirel4.observation as obs then {
obs.code where (code = '31044-1') -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Observation') as observation, observation.id = uuid() as uuid1, e1.fullUrl = append('https://example/Observation/', uuid1), request.url = 'Observation', immunization.reasonReference = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {
obs then Observation1(entrirel4, patient, tgt, bundle, enc, observation) "observation";
} "codeControl";
} "obs";
} "entrirel2";
} "ControlloImmunization";
substance.templateId where (root = '2.16.840.1.113883.2.9.10.1.11.4.2') -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Immunization') as immunization, immunization.id = uuid() as uuid1, e1.fullUrl = append('https://example/Immunization/', uuid1), request.url = 'Immunization', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Immunization/' + %immunization.id) then {
substance -> immunization.patient = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "patientRef";
// substance.templateId as tid -> immunization.identifier as idf then{
substance.statusCode as statusc where (code = 'completed') -> immunization.status = 'completed';
substance.statusCode as statusc where (code = 'aborted') -> immunization.status = 'final';
substance.statusCode as statusc where (code = 'suspended') -> immunization.status = 'enterer-in-error';
substance.statusCode as statusc where (code = 'cancelled') -> immunization.status = 'not-done';
substance.effectiveTime as eff where (value.exists()) -> immunization.occurrence = create('dateTime') as value then TSDateTime(eff, value) "value1";
substance.effectiveTime as eff where (low.exists()) -> immunization.occurrence = create('Period') as value then IVLTSPeriod(eff, value) "valuePeriod";
substance.consumable as cons then {
cons.manufacturedProduct as manufact then {
manufact.manufacturedMaterial as manufactmat then {
manufactmat.code -> immunization.vaccineCode;
manufactmat.lotNumberText as t -> immunization.lotNumber = (t.dataString);
} "manufactmat";
manufact.manufacturerOrganization as manufactOrg -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Organization') as organization then {
manufactOrg -> organization.meta as meta then {
manufactOrg -> meta.tag = create('Coding') as coding then {
manufactOrg -> coding.system = 'http://algoritmodiscoring' "system";
manufactOrg -> coding.code = 'ClinicalDocument/body/manufacturerOrganization' "code";
} "coding";
} "meta";
manufactOrg.id as id -> organization2.identifier as identifier then {
id.root as r -> identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') "root1";
id.extension as ext -> identifier.value = ext then {
manufactOrg -> request.url = append('Organization?identifier=', ext) "UUID";
} "ext";
id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;
id.root as r then {
id.extension as ext -> organization1.id = (r + '-' + ext) as uuid23, e1.fullUrl = append('https://example/Organization/', uuid23), immunization.manufacturer = create('Reference') as reference, reference.reference = ('https://example/Organization/' + %uuid23) "org";
} "r";
} "identifier";
manufactOrg.name as n -> organization.name = (n.other);
} "manufactOrg";
} "manufact";
} "cons";
cda -> immunization.protocolApplied as prot then {
substance.entryRelationship as entrirel4 then {
entrirel4.observation as obs then {
obs.code where (code = '75323-6') then {
obs.value -> prot.targetDisease;
} "codeControl";
} "entrirel2";
entrirel4.observation as obsdosenumber then {
obsdosenumber.code where (code = '30973-2') then {
obsdosenumber.value as v then {
v.value as int -> prot.doseNumber = (int.toString());
} "v";
} "codeControl";
} "entrirel2";
} "entrirel4";
} "protocolAp";
substance.entryRelationship as entrirel1 then {
entrirel1.observation as obs then {
obs.code where (code = '85714-4') then {
obs.code -> immunization.statusReason;
} "codeControl";
obs.code where (code = '59784-9') then {
obs.value as val then {
val.originalText as original -> immunization.statusReason = create('CodeableConcept') as cod then {
original.reference as reff -> cod.text = (reff.value);
} "cod";
} "val";
} "codeControl";
} "obs";
} "entrirel1";
substance.participant as part -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Location') as location then {
part -> location.meta as meta then {
part -> meta.tag = create('Coding') as coding then {
part -> coding.system = 'http://algoritmodiscoring' "system";
part -> coding.code = 'ClinicalDocument/body/participant' "code";
} "coding";
} "meta";
part.participantRole as partRole then {
partRole.id as id -> location.identifier as identifier then {
id.root as r -> identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') "root1";
id.extension as ext -> identifier.value = ext then {
ext -> request.url = append('Location?identifier=', ext) "UUID";
} "ext";
id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;
id.root as r then {
id.extension as ext -> location.id = (r + '-' + ext) as uuid7, e1.fullUrl = append('https://example/Location/', uuid7), immunization.location = create('Reference') as reference, reference.reference = ('https://example/Location/' + %uuid7) "ref";
} "r";
} "identifier";
} "role";
} "location";
} "sub2";
} "substance";
};
}
group Observation(source entrirel2 : entryRelationship, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter, target obs : Observation) {
entrirel2.observation as observation then {
// observation.templateId as tid -> obs.identifier as idf then{
observation.code -> obs.code;
observation.statusCode as statusc where (code = 'completed') -> obs.status = 'final';
observation.statusCode as statusc where (code = 'active') -> obs.status = 'registered';
observation.statusCode as statusc where (code = 'aborted') -> obs.status = 'cancelled';
observation.statusCode as statusc where (code = 'suspended') -> obs.status = 'partial';
observation -> obs.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
observation -> obs.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";
observation -> obs.referenceRange as refRange then {
observation.value -> refRange.appliesTo;
observation -> refRange.text = 'string' "text";
} "refRange";
} "obs";
}
group Observation1(source entrirel4 : entryRelationship, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter, target obs : Observation) {
entrirel4.observation as observation then {
// observation.templateId as tid -> obs.identifier as idf then{
observation.code -> obs.code;
observation.statusCode as statusc where (code = 'completed') -> obs.status = 'final';
observation.statusCode as statusc where (code = 'active') -> obs.status = 'registered';
observation.statusCode as statusc where (code = 'aborted') -> obs.status = 'cancelled';
observation.statusCode as statusc where (code = 'suspended') -> obs.status = 'partial';
observation -> obs.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
observation -> obs.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";
observation.effectiveTime as eff where (value.exists()) -> obs.effective = create('dateTime') as value then TSDateTime(eff, value) "value1";
observation.effectiveTime as eff -> obs.effective = create('Period') as period then IVLTSPeriod(eff, period) "period";
observation -> obs.value = create('CodeableConcept') as concept then {
observation.value -> concept.coding = create('Coding') as coding then {
observation.value as v -> coding.code = (v.code);
observation.value as v then {
v.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
} "vv";
observation.value as v -> coding.display = (v.displayName);
} "coding";
observation.value as valu then {
valu.originalText as txt then {
txt.reference as ref -> concept.text = (ref.value);
} "txt";
};
} "refRange";
} "obs";
}
</pre>
</div>
</text>
<url value="http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirVaccination"/>
<version value="0.1.0"/>
<name value="cda2fhirVaccination"/>
<status value="draft"/>
<date value="2024-04-11T15:38:19+02:00"/>
<publisher value="HL7 Italy"/>
<contact>
<name value="HL7 Italy"/>
<telecom>
<system value="url"/>
<value value="http://hl7.it"/>
</telecom>
</contact>
<jurisdiction>
<coding>
<system value="urn:iso:std:iso:3166"/>
<code value="IT"/>
<display value="Italy"/>
</coding>
</jurisdiction>
<structure>
<url
value="http://hl7.org/fhir/cda/StructureDefinition/ClinicalDocument"/>
<mode value="source"/>
<alias value="ClinicalDocument"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/cda/StructureDefinition/AssignedAuthor"/>
<mode value="queried"/>
<alias value="AssignedAuthor"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/cda/StructureDefinition/AssignedEntity"/>
<mode value="queried"/>
<alias value="AssignedEntity"/>
</structure>
<structure>
<url
value="http://hl7.org/fhir/cda/StructureDefinition/AssociatedEntity"/>
<mode value="queried"/>
<alias value="AssociatedEntity"/>
</structure>
<structure>
<url
value="http://hl7.org/fhir/cda/StructureDefinition/CustodianOrganization"/>
<mode value="queried"/>
<alias value="CustodianOrganization"/>
</structure>
<structure>
<url
value="http://hl7.org/fhir/cda/StructureDefinition/OrganizationPartOf"/>
<mode value="queried"/>
<alias value="OrganizationPartOf"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/cda/StructureDefinition/Organization"/>
<mode value="queried"/>
<alias value="rapresentedOrganization"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/cda/StructureDefinition/Section"/>
<mode value="queried"/>
<alias value="Section"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/cda/StructureDefinition/PatientRole"/>
<mode value="queried"/>
<alias value="PatientRole"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/cda/StructureDefinition/AD"/>
<mode value="source"/>
<alias value="AD"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Bundle"/>
<mode value="target"/>
<alias value="Bundle"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Composition"/>
<mode value="produced"/>
<alias value="Composition"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Patient"/>
<mode value="produced"/>
<alias value="Patient"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
<mode value="produced"/>
<alias value="Encounter"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Person"/>
<mode value="produced"/>
<alias value="Patient"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Practitioner"/>
<mode value="produced"/>
<alias value="Practitioner"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Organization"/>
<mode value="produced"/>
<alias value="Organization"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/cda/StructureDefinition/Act"/>
<mode value="produced"/>
<alias value="Act"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/cda/StructureDefinition/IVL-PQ"/>
<mode value="source"/>
<alias value="IVL_PQ"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/cda/StructureDefinition/PQ"/>
<mode value="source"/>
<alias value="PQ"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/SimpleQuantity"/>
<mode value="target"/>
<alias value="SimpleQuantity"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Immunization"/>
<mode value="target"/>
<alias value="Immunization"/>
</structure>
<import value="http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirDataTypes"/>
<import value="http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirHeader"/>
<group>
<name value="CdaToBundle"/>
<typeMode value="none"/>
<input>
<name value="cda"/>
<type value="ClinicalDocument"/>
<mode value="source"/>
</input>
<input>
<name value="bundle"/>
<type value="Bundle"/>
<mode value="target"/>
</input>
<rule>
<name value="ClinicalDocumentToBody"/>
<source>
<context value="cda"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="request"/>
<variable value="request"/>
<transform value="create"/>
<parameter>
<valueString value="BackboneElement"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="method"/>
<transform value="copy"/>
<parameter>
<valueString value="POST"/>
</parameter>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="composition"/>
<transform value="create"/>
<parameter>
<valueString value="Composition"/>
</parameter>
</target>
<target>
<context value="composition"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid1"/>
<transform value="uuid"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="https://example/Composition/"/>
</parameter>
<parameter>
<valueId value="uuid1"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="Composition"/>
</parameter>
</target>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e2"/>
</target>
<target>
<context value="e2"/>
<contextType value="variable"/>
<element value="request"/>
<variable value="requestPAT"/>
<transform value="create"/>
<parameter>
<valueString value="BackboneElement"/>
</parameter>
</target>
<target>
<context value="requestPAT"/>
<contextType value="variable"/>
<element value="method"/>
<transform value="copy"/>
<parameter>
<valueString value="PUT"/>
</parameter>
</target>
<target>
<context value="e2"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="patient"/>
<transform value="create"/>
<parameter>
<valueString value="Patient"/>
</parameter>
</target>
<target>
<context value="patient"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid2"/>
<transform value="uuid"/>
</target>
<target>
<context value="e2"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="https://example/Patient/"/>
</parameter>
<parameter>
<valueId value="uuid2"/>
</parameter>
</target>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e3"/>
</target>
<target>
<context value="e3"/>
<contextType value="variable"/>
<element value="request"/>
<variable value="request"/>
<transform value="create"/>
<parameter>
<valueString value="BackboneElement"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="method"/>
<transform value="copy"/>
<parameter>
<valueString value="POST"/>
</parameter>
</target>
<target>
<context value="e3"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="encounter"/>
<transform value="create"/>
<parameter>
<valueString value="Encounter"/>
</parameter>
</target>
<target>
<context value="encounter"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid3"/>
<transform value="uuid"/>
</target>
<target>
<context value="e3"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="https://example/Encounter/"/>
</parameter>
<parameter>
<valueId value="uuid3"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="Encounter"/>
</parameter>
</target>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e5"/>
</target>
<target>
<context value="e5"/>
<contextType value="variable"/>
<element value="request"/>
<variable value="request"/>
<transform value="create"/>
<parameter>
<valueString value="BackboneElement"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="method"/>
<transform value="copy"/>
<parameter>
<valueString value="POST"/>
</parameter>
</target>
<target>
<context value="e5"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="DocumentReference"/>
<transform value="create"/>
<parameter>
<valueString value="DocumentReference"/>
</parameter>
</target>
<target>
<context value="DocumentReference"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid5"/>
<transform value="uuid"/>
</target>
<target>
<context value="e5"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="https://example/DocumentReference/"/>
</parameter>
<parameter>
<valueId value="uuid5"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="DocumentReference"/>
</parameter>
</target>
<rule>
<name value="cdatobundle"/>
<source>
<context value="cda"/>
</source>
<dependent>
<name value="ClinicalDocumentToBundle"/>
<variable value="cda"/>
<variable value="patient"/>
<variable value="composition"/>
<variable value="encounter"/>
<variable value="bundle"/>
<variable value="DocumentReference"/>
</dependent>
</rule>
<rule>
<name value="recPat"/>
<source>
<context value="cda"/>
<element value="recordTarget"/>
<variable value="recordTarget"/>
</source>
<rule>
<name value="record"/>
<source>
<context value="recordTarget"/>
<element value="patientRole"/>
<variable value="patient"/>
</source>
<rule>
<name value="idfr"/>
<source>
<context value="patient"/>
<element value="id"/>
<variable value="id"/>
</source>
<target>
<context value="patient"/>
<contextType value="variable"/>
<element value="identifier"/>
<variable value="identifier"/>
</target>
<rule>
<name value="root1"/>
<source>
<context value="id"/>
<element value="root"/>
<variable value="r"/>
</source>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="translate"/>
<parameter>
<valueId value="r"/>
</parameter>
<parameter>
<valueString
value="http://hl7.org/fhir/ConceptMap/special-oid2uri"/>
</parameter>
<parameter>
<valueString value="uri"/>
</parameter>
</target>
</rule>
<rule>
<name value="value"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext1"/>
</source>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="ext1"/>
</parameter>
</target>
</rule>
<rule>
<name value="assigningAuthorityName"/>
<source>
<context value="id"/>
<element value="assigningAuthorityName"/>
<variable value="s"/>
</source>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="assigner"/>
<variable value="a"/>
</target>
<target>
<context value="a"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueId value="s"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="ext"/>
<source>
<context value="patient"/>
<element value="id"/>
<variable value="id"/>
<condition
value="(root = '2.16.840.1.113883.2.9.4.3.2') or (root = '2.16.840.1.113883.2.9.4.3.7') or (root = '2.16.840.1.113883.2.9.4.3.3') or (root = '2.16.840.1.113883.2.9.4.3.17') or (root = '2.16.840.1.113883.2.9.4.3.18') or (root = '2.16.840.1.113883.2.9.2.10.4.1.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1.1') or (root = '2.16.840.1.113883.2.9.2.10.4.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1') or (root = '2.16.840.1.113883.2.9.4.3.15')"/>
</source>
<rule>
<name value="UUID"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext"/>
</source>
<target>
<context value="requestPAT"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="append"/>
<parameter>
<valueString value="Patient?identifier="/>
</parameter>
<parameter>
<valueId value="ext"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</group>
<group>
<name value="ClinicalDocumentToBundle"/>
<typeMode value="none"/>
<input>
<name value="cda"/>
<type value="ClinicalDocument"/>
<mode value="source"/>
</input>
<input>
<name value="patient"/>
<type value="Patient"/>
<mode value="target"/>
</input>
<input>
<name value="composition"/>
<type value="Composition"/>
<mode value="target"/>
</input>
<input>
<name value="encounter"/>
<type value="Encounter"/>
<mode value="target"/>
</input>
<input>
<name value="bundle"/>
<type value="Bundle"/>
<mode value="target"/>
</input>
<input>
<name value="DocumentReference"/>
<type value="DocumentReference"/>
<mode value="target"/>
</input>
<rule>
<name value="finished"/>
<source>
<context value="cda"/>
</source>
<target>
<context value="encounter"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="finished"/>
</parameter>
</target>
</rule>
<rule>
<name value="coding"/>
<source>
<context value="cda"/>
</source>
<target>
<context value="encounter"/>
<contextType value="variable"/>
<element value="class"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<rule>
<name value="amb"/>
<source>
<context value="cda"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="AMB"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="id"/>
<source>
<context value="cda"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="id"/>
<transform value="uuid"/>
</target>
</rule>
<rule>
<name value="identifier"/>
<source>
<context value="cda"/>
<element value="id"/>
<variable value="vvv"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="identifier"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="type"/>
<source>
<context value="cda"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="type"/>
<transform value="copy"/>
<parameter>
<valueString value="transaction"/>
</parameter>
</target>
</rule>
<rule>
<name value="date"/>
<source>
<context value="cda"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="timestamp"/>
<transform value="evaluate"/>
<parameter>
<valueString value="timestamp.now()"/>
</parameter>
</target>
</rule>
<rule>
<name value="composition"/>
<source>
<context value="cda"/>
</source>
<dependent>
<name value="ClinicalDocumentComposition"/>
<variable value="cda"/>
<variable value="composition"/>
<variable value="patient"/>
<variable value="encounter"/>
<variable value="bundle"/>
<variable value="DocumentReference"/>
</dependent>
</rule>
<rule>
<name value="component"/>
<source>
<context value="cda"/>
<element value="component"/>
<variable value="component"/>
</source>
<rule>
<name value="body"/>
<source>
<context value="component"/>
<element value="structuredBody"/>
<variable value="body"/>
</source>
<rule>
<name value="component"/>
<source>
<context value="body"/>
<element value="component"/>
<variable value="component"/>
</source>
<rule>
<name value="section"/>
<source>
<context value="component"/>
<element value="section"/>
<variable value="srcSection"/>
</source>
<rule>
<name value="TerapiaFarmacologicaAllaDimissione"/>
<source>
<context value="srcSection"/>
</source>
<target>
<context value="composition"/>
<contextType value="variable"/>
<element value="section"/>
<variable value="tgtSection"/>
</target>
<dependent>
<name value="ClinicalDocumentSection"/>
<variable value="cda"/>
<variable value="srcSection"/>
<variable value="patient"/>
<variable value="tgtSection"/>
<variable value="bundle"/>
<variable value="encounter"/>
</dependent>
</rule>
</rule>
</rule>
</rule>
</rule>
</group>
<group>
<name value="ClinicalDocumentSection"/>
<typeMode value="none"/>
<documentation value="--------------------------------"/>
<input>
<name value="cda"/>
<type value="ClinicalDocument"/>
<mode value="source"/>
</input>
<input>
<name value="src"/>
<type value="Section"/>
<mode value="source"/>
</input>
<input>
<name value="patient"/>
<type value="Patient"/>
<mode value="target"/>
</input>
<input>
<name value="tgt"/>
<mode value="target"/>
</input>
<input>
<name value="bundle"/>
<type value="Bundle"/>
<mode value="target"/>
</input>
<input>
<name value="enc"/>
<type value="Encounter"/>
<mode value="target"/>
</input>
<rule>
<name value="title"/>
<source>
<context value="src"/>
<element value="title"/>
<variable value="t"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="title"/>
<transform value="evaluate"/>
<parameter>
<valueString value="t.dataString"/>
</parameter>
</target>
</rule>
<rule>
<name value="code"/>
<source>
<context value="src"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="cdaText"/>
<source>
<context value="src"/>
<element value="text"/>
<variable value="cdaText"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="text"/>
<variable value="fhirText"/>
</target>
<rule>
<name value="narrativeStatus"/>
<source>
<context value="cdaText"/>
</source>
<target>
<context value="fhirText"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="generated"/>
</parameter>
</target>
</rule>
<rule>
<name value="narrativeText"/>
<source>
<context value="cdaText"/>
<variable value="t"/>
</source>
<target>
<context value="fhirText"/>
<contextType value="variable"/>
<element value="div"/>
<transform value="copy"/>
<parameter>
<valueId value="t"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="entry"/>
<source>
<context value="src"/>
<element value="entry"/>
<variable value="entry1"/>
</source>
<rule>
<name value="substance"/>
<source>
<context value="entry1"/>
<element value="substanceAdministration"/>
<variable value="substance"/>
</source>
<rule>
<name value="ControlloImmunization"/>
<source>
<context value="substance"/>
<element value="templateId"/>
<condition value="(root = '2.16.840.1.113883.2.9.10.1.11.4.1')"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e1"/>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="request"/>
<variable value="request"/>
<transform value="create"/>
<parameter>
<valueString value="BackboneElement"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="method"/>
<transform value="copy"/>
<parameter>
<valueString value="POST"/>
</parameter>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="immunization"/>
<transform value="create"/>
<parameter>
<valueString value="Immunization"/>
</parameter>
</target>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid1"/>
<transform value="uuid"/>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="https://example/Immunization/"/>
</parameter>
<parameter>
<valueId value="uuid1"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="Immunization"/>
</parameter>
</target>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="reference"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="reference"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString
value="'https://example/Immunization/' + %immunization.id"/>
</parameter>
</target>
<rule>
<name value="patientRef"/>
<source>
<context value="substance"/>
</source>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="patient"/>
<variable value="reference"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="reference"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString
value="'https://example/Patient/' + %patient.id"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="substance"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'completed')"/>
</source>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="completed"/>
</parameter>
</target>
<documentation
value="substance.templateId as tid -> immunization.identifier as idf then{"/>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="substance"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'aborted')"/>
</source>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="substance"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'suspended')"/>
</source>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="enterer-in-error"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="substance"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'cancelled')"/>
</source>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="not-done"/>
</parameter>
</target>
</rule>
<rule>
<name value="value1"/>
<source>
<context value="substance"/>
<element value="effectiveTime"/>
<variable value="eff"/>
<condition value="(value.exists())"/>
</source>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="occurrence"/>
<variable value="value"/>
<transform value="create"/>
<parameter>
<valueString value="dateTime"/>
</parameter>
</target>
<dependent>
<name value="TSDateTime"/>
<variable value="eff"/>
<variable value="value"/>
</dependent>
</rule>
<rule>
<name value="valuePeriod"/>
<source>
<context value="substance"/>
<element value="effectiveTime"/>
<variable value="eff"/>
<condition value="(low.exists())"/>
</source>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="occurrence"/>
<variable value="value"/>
<transform value="create"/>
<parameter>
<valueString value="Period"/>
</parameter>
</target>
<dependent>
<name value="IVLTSPeriod"/>
<variable value="eff"/>
<variable value="value"/>
</dependent>
</rule>
<rule>
<name value="route"/>
<source>
<context value="substance"/>
<element value="routeCode"/>
<variable value="vvv"/>
</source>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="route"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="site"/>
<source>
<context value="substance"/>
<element value="approachSiteCode"/>
<variable value="vvv"/>
</source>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="site"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="q"/>
<source>
<context value="substance"/>
</source>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="doseQuantity"/>
<variable value="quantity"/>
<transform value="create"/>
<parameter>
<valueString value="SimpleQuantity"/>
</parameter>
</target>
<rule>
<name value="qua"/>
<source>
<context value="substance"/>
<element value="doseQuantity"/>
<variable value="q"/>
</source>
<rule>
<name value="val"/>
<source>
<context value="q"/>
</source>
<target>
<context value="quantity"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="q.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="uni"/>
<source>
<context value="q"/>
</source>
<target>
<context value="quantity"/>
<contextType value="variable"/>
<element value="unit"/>
<transform value="evaluate"/>
<parameter>
<valueString value="q.unit"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="cons"/>
<source>
<context value="substance"/>
<element value="consumable"/>
<variable value="cons"/>
</source>
<rule>
<name value="manufact"/>
<source>
<context value="cons"/>
<element value="manufacturedProduct"/>
<variable value="manufact"/>
</source>
<rule>
<name value="manufactmat"/>
<source>
<context value="manufact"/>
<element value="manufacturedMaterial"/>
<variable value="manufactmat"/>
</source>
<rule>
<name value="code"/>
<source>
<context value="manufactmat"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="vaccineCode"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="lotNumberText"/>
<source>
<context value="manufactmat"/>
<element value="lotNumberText"/>
<variable value="t"/>
</source>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="lotNumber"/>
<transform value="evaluate"/>
<parameter>
<valueString value="t.dataString"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="manufactOrg"/>
<source>
<context value="manufact"/>
<element value="manufacturerOrganization"/>
<variable value="manufactOrg"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e1"/>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="request"/>
<variable value="request"/>
<transform value="create"/>
<parameter>
<valueString value="BackboneElement"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="method"/>
<transform value="copy"/>
<parameter>
<valueString value="PUT"/>
</parameter>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="organization"/>
<transform value="create"/>
<parameter>
<valueString value="Organization"/>
</parameter>
</target>
<rule>
<name value="meta"/>
<source>
<context value="manufactOrg"/>
</source>
<target>
<context value="organization"/>
<contextType value="variable"/>
<element value="meta"/>
<variable value="meta"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="manufactOrg"/>
</source>
<target>
<context value="meta"/>
<contextType value="variable"/>
<element value="tag"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<rule>
<name value="system"/>
<source>
<context value="manufactOrg"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://algoritmodiscoring"/>
</parameter>
</target>
</rule>
<rule>
<name value="code"/>
<source>
<context value="manufactOrg"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString
value="ClinicalDocument/body/manufacturerOrganization"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="identifier"/>
<source>
<context value="manufactOrg"/>
<element value="id"/>
<variable value="id"/>
</source>
<target>
<context value="organization"/>
<contextType value="variable"/>
<element value="identifier"/>
<variable value="identifier"/>
</target>
<rule>
<name value="root1"/>
<source>
<context value="id"/>
<element value="root"/>
<variable value="r"/>
</source>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="translate"/>
<parameter>
<valueId value="r"/>
</parameter>
<parameter>
<valueString
value="http://hl7.org/fhir/ConceptMap/special-oid2uri"/>
</parameter>
<parameter>
<valueString value="uri"/>
</parameter>
</target>
</rule>
<rule>
<name value="ext"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext"/>
</source>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="ext"/>
</parameter>
</target>
<rule>
<name value="UUID"/>
<source>
<context value="ext"/>
</source>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="append"/>
<parameter>
<valueString value="Organization?identifier="/>
</parameter>
<parameter>
<valueId value="ext"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="assigningAuthorityName"/>
<source>
<context value="id"/>
<element value="assigningAuthorityName"/>
<variable value="s"/>
</source>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="assigner"/>
<variable value="a"/>
</target>
<target>
<context value="a"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueId value="s"/>
</parameter>
</target>
</rule>
<rule>
<name value="r"/>
<source>
<context value="id"/>
<element value="root"/>
<variable value="r"/>
</source>
<rule>
<name value="extension"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext"/>
</source>
<target>
<context value="organization"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid5"/>
<transform value="evaluate"/>
<parameter>
<valueString value="r + '-' + ext"/>
</parameter>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="https://example/Organization/"/>
</parameter>
<parameter>
<valueId value="uuid5"/>
</parameter>
</target>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="manufacturer"/>
<variable value="reference"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="reference"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString
value="'https://example/Organization/' + %uuid5"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="name"/>
<source>
<context value="manufactOrg"/>
<element value="name"/>
<variable value="n"/>
</source>
<target>
<context value="organization"/>
<contextType value="variable"/>
<element value="name"/>
<transform value="evaluate"/>
<parameter>
<valueString value="n.other"/>
</parameter>
</target>
<documentation value="manufactOrg.id as id then{"/>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="part"/>
<source>
<context value="substance"/>
<element value="participant"/>
<variable value="part"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e1"/>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="request"/>
<variable value="request"/>
<transform value="create"/>
<parameter>
<valueString value="BackboneElement"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="method"/>
<transform value="copy"/>
<parameter>
<valueString value="PUT"/>
</parameter>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="location"/>
<transform value="create"/>
<parameter>
<valueString value="Location"/>
</parameter>
</target>
<rule>
<name value="meta"/>
<source>
<context value="part"/>
</source>
<target>
<context value="location"/>
<contextType value="variable"/>
<element value="meta"/>
<variable value="meta"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="part"/>
</source>
<target>
<context value="meta"/>
<contextType value="variable"/>
<element value="tag"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<rule>
<name value="system"/>
<source>
<context value="part"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://algoritmodiscoring"/>
</parameter>
</target>
</rule>
<rule>
<name value="code"/>
<source>
<context value="part"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="ClinicalDocument/body/participant"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="role"/>
<source>
<context value="part"/>
<element value="participantRole"/>
<variable value="partRole"/>
</source>
<rule>
<name value="identifier"/>
<source>
<context value="partRole"/>
<element value="id"/>
<variable value="id"/>
</source>
<target>
<context value="location"/>
<contextType value="variable"/>
<element value="identifier"/>
<variable value="identifier"/>
</target>
<rule>
<name value="root1"/>
<source>
<context value="id"/>
<element value="root"/>
<variable value="r"/>
</source>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="translate"/>
<parameter>
<valueId value="r"/>
</parameter>
<parameter>
<valueString
value="http://hl7.org/fhir/ConceptMap/special-oid2uri"/>
</parameter>
<parameter>
<valueString value="uri"/>
</parameter>
</target>
</rule>
<rule>
<name value="ext"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext"/>
</source>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="ext"/>
</parameter>
</target>
<rule>
<name value="UUID"/>
<source>
<context value="ext"/>
</source>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="append"/>
<parameter>
<valueString value="Location?identifier="/>
</parameter>
<parameter>
<valueId value="ext"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="assigningAuthorityName"/>
<source>
<context value="id"/>
<element value="assigningAuthorityName"/>
<variable value="s"/>
</source>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="assigner"/>
<variable value="a"/>
</target>
<target>
<context value="a"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueId value="s"/>
</parameter>
</target>
</rule>
<rule>
<name value="r"/>
<source>
<context value="id"/>
<element value="root"/>
<variable value="r"/>
</source>
<rule>
<name value="ref"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext"/>
</source>
<target>
<context value="location"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid6"/>
<transform value="evaluate"/>
<parameter>
<valueString value="r + '-' + ext"/>
</parameter>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="https://example/Location/"/>
</parameter>
<parameter>
<valueId value="uuid6"/>
</parameter>
</target>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="location"/>
<variable value="reference"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="reference"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString
value="'https://example/Location/' + %uuid6"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="protocolAp"/>
<source>
<context value="cda"/>
</source>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="protocolApplied"/>
<variable value="prot"/>
</target>
<rule>
<name value="entrirel4"/>
<source>
<context value="substance"/>
<element value="entryRelationship"/>
<variable value="entrirel4"/>
</source>
<rule>
<name value="entrirel2"/>
<source>
<context value="entrirel4"/>
<element value="observation"/>
<variable value="obs"/>
</source>
<rule>
<name value="codeControl"/>
<source>
<context value="obs"/>
<element value="code"/>
<condition value="(code = '75323-6')"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="obs"/>
<element value="value"/>
<variable value="vvv"/>
</source>
<target>
<context value="prot"/>
<contextType value="variable"/>
<element value="targetDisease"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="entrirel2"/>
<source>
<context value="entrirel4"/>
<element value="observation"/>
<variable value="obsdosenumber"/>
</source>
<rule>
<name value="codeControl"/>
<source>
<context value="obsdosenumber"/>
<element value="code"/>
<condition value="(code = '30973-2')"/>
</source>
<rule>
<name value="v"/>
<source>
<context value="obsdosenumber"/>
<element value="value"/>
<variable value="v"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="v"/>
<element value="value"/>
<variable value="int"/>
</source>
<target>
<context value="prot"/>
<contextType value="variable"/>
<element value="doseNumber"/>
<transform value="evaluate"/>
<parameter>
<valueString value="int.toString()"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="entrirel2"/>
<source>
<context value="substance"/>
<element value="entryRelationship"/>
<variable value="entrirel2"/>
</source>
<rule>
<name value="obs"/>
<source>
<context value="entrirel2"/>
<element value="observation"/>
<variable value="obs"/>
</source>
<rule>
<name value="codeControl"/>
<source>
<context value="obs"/>
<element value="code"/>
<condition
value="((code = '59778-1') or (code = '30981-5') or (code = '30980-7') or (code = '59777-3'))"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="obs"/>
<element value="value"/>
<variable value="value"/>
</source>
<rule>
<name value="da"/>
<source>
<context value="value"/>
<element value="high"/>
<variable value="h"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="h"/>
<element value="value"/>
<variable value="date"/>
</source>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="expirationDate"/>
<transform value="truncate"/>
<parameter>
<valueId value="date"/>
</parameter>
<parameter>
<valueInteger value="10"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="entrirel2"/>
<source>
<context value="substance"/>
<element value="entryRelationship"/>
<variable value="entrirel3"/>
</source>
<rule>
<name value="obs"/>
<source>
<context value="entrirel3"/>
<element value="observation"/>
<variable value="obs"/>
</source>
<rule>
<name value="codeControl"/>
<source>
<context value="obs"/>
<element value="code"/>
<condition value="(code = '95715-9')"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e1"/>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="request"/>
<variable value="request"/>
<transform value="create"/>
<parameter>
<valueString value="BackboneElement"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="method"/>
<transform value="copy"/>
<parameter>
<valueString value="POST"/>
</parameter>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="observation"/>
<transform value="create"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid1"/>
<transform value="uuid"/>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="https://example/Observation/"/>
</parameter>
<parameter>
<valueId value="uuid1"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="reasonReference"/>
<variable value="reference"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="reference"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString
value="'https://example/Observation/' + %observation.id"/>
</parameter>
</target>
<rule>
<name value="observation"/>
<source>
<context value="obs"/>
</source>
<dependent>
<name value="Observation"/>
<variable value="entrirel3"/>
<variable value="patient"/>
<variable value="tgt"/>
<variable value="bundle"/>
<variable value="enc"/>
<variable value="observation"/>
</dependent>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="entrirel2"/>
<source>
<context value="substance"/>
<element value="entryRelationship"/>
<variable value="entrirel4"/>
</source>
<rule>
<name value="obs"/>
<source>
<context value="entrirel4"/>
<element value="observation"/>
<variable value="obs"/>
</source>
<rule>
<name value="codeControl"/>
<source>
<context value="obs"/>
<element value="code"/>
<condition value="(code = '59785-6')"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e1"/>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="request"/>
<variable value="request"/>
<transform value="create"/>
<parameter>
<valueString value="BackboneElement"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="method"/>
<transform value="copy"/>
<parameter>
<valueString value="POST"/>
</parameter>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="observation"/>
<transform value="create"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid1"/>
<transform value="uuid"/>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="https://example/Observation/"/>
</parameter>
<parameter>
<valueId value="uuid1"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="reasonReference"/>
<variable value="reference"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="reference"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString
value="'https://example/Observation/' + %observation.id"/>
</parameter>
</target>
<rule>
<name value="observation"/>
<source>
<context value="obs"/>
</source>
<dependent>
<name value="Observation1"/>
<variable value="entrirel4"/>
<variable value="patient"/>
<variable value="tgt"/>
<variable value="bundle"/>
<variable value="enc"/>
<variable value="observation"/>
</dependent>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="entrirel2"/>
<source>
<context value="substance"/>
<element value="entryRelationship"/>
<variable value="entrirel4"/>
</source>
<rule>
<name value="obs"/>
<source>
<context value="entrirel4"/>
<element value="observation"/>
<variable value="obs"/>
</source>
<rule>
<name value="codeControl"/>
<source>
<context value="obs"/>
<element value="code"/>
<condition value="(code = '31044-1')"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e1"/>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="request"/>
<variable value="request"/>
<transform value="create"/>
<parameter>
<valueString value="BackboneElement"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="method"/>
<transform value="copy"/>
<parameter>
<valueString value="POST"/>
</parameter>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="observation"/>
<transform value="create"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid1"/>
<transform value="uuid"/>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="https://example/Observation/"/>
</parameter>
<parameter>
<valueId value="uuid1"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="reasonReference"/>
<variable value="reference"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="reference"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString
value="'https://example/Observation/' + %observation.id"/>
</parameter>
</target>
<rule>
<name value="observation"/>
<source>
<context value="obs"/>
</source>
<dependent>
<name value="Observation1"/>
<variable value="entrirel4"/>
<variable value="patient"/>
<variable value="tgt"/>
<variable value="bundle"/>
<variable value="enc"/>
<variable value="observation"/>
</dependent>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="sub2"/>
<source>
<context value="substance"/>
<element value="templateId"/>
<condition value="(root = '2.16.840.1.113883.2.9.10.1.11.4.2')"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e1"/>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="request"/>
<variable value="request"/>
<transform value="create"/>
<parameter>
<valueString value="BackboneElement"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="method"/>
<transform value="copy"/>
<parameter>
<valueString value="POST"/>
</parameter>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="immunization"/>
<transform value="create"/>
<parameter>
<valueString value="Immunization"/>
</parameter>
</target>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid1"/>
<transform value="uuid"/>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="https://example/Immunization/"/>
</parameter>
<parameter>
<valueId value="uuid1"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="Immunization"/>
</parameter>
</target>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="reference"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="reference"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString
value="'https://example/Immunization/' + %immunization.id"/>
</parameter>
</target>
<rule>
<name value="patientRef"/>
<source>
<context value="substance"/>
</source>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="patient"/>
<variable value="reference"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="reference"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString
value="'https://example/Patient/' + %patient.id"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="substance"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'completed')"/>
</source>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="completed"/>
</parameter>
</target>
<documentation
value="substance.templateId as tid -> immunization.identifier as idf then{"/>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="substance"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'aborted')"/>
</source>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="substance"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'suspended')"/>
</source>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="enterer-in-error"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="substance"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'cancelled')"/>
</source>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="not-done"/>
</parameter>
</target>
</rule>
<rule>
<name value="value1"/>
<source>
<context value="substance"/>
<element value="effectiveTime"/>
<variable value="eff"/>
<condition value="(value.exists())"/>
</source>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="occurrence"/>
<variable value="value"/>
<transform value="create"/>
<parameter>
<valueString value="dateTime"/>
</parameter>
</target>
<dependent>
<name value="TSDateTime"/>
<variable value="eff"/>
<variable value="value"/>
</dependent>
</rule>
<rule>
<name value="valuePeriod"/>
<source>
<context value="substance"/>
<element value="effectiveTime"/>
<variable value="eff"/>
<condition value="(low.exists())"/>
</source>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="occurrence"/>
<variable value="value"/>
<transform value="create"/>
<parameter>
<valueString value="Period"/>
</parameter>
</target>
<dependent>
<name value="IVLTSPeriod"/>
<variable value="eff"/>
<variable value="value"/>
</dependent>
</rule>
<rule>
<name value="cons"/>
<source>
<context value="substance"/>
<element value="consumable"/>
<variable value="cons"/>
</source>
<rule>
<name value="manufact"/>
<source>
<context value="cons"/>
<element value="manufacturedProduct"/>
<variable value="manufact"/>
</source>
<rule>
<name value="manufactmat"/>
<source>
<context value="manufact"/>
<element value="manufacturedMaterial"/>
<variable value="manufactmat"/>
</source>
<rule>
<name value="code"/>
<source>
<context value="manufactmat"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="vaccineCode"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="lotNumberText"/>
<source>
<context value="manufactmat"/>
<element value="lotNumberText"/>
<variable value="t"/>
</source>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="lotNumber"/>
<transform value="evaluate"/>
<parameter>
<valueString value="t.dataString"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="manufactOrg"/>
<source>
<context value="manufact"/>
<element value="manufacturerOrganization"/>
<variable value="manufactOrg"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e1"/>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="request"/>
<variable value="request"/>
<transform value="create"/>
<parameter>
<valueString value="BackboneElement"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="method"/>
<transform value="copy"/>
<parameter>
<valueString value="PUT"/>
</parameter>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="organization"/>
<transform value="create"/>
<parameter>
<valueString value="Organization"/>
</parameter>
</target>
<rule>
<name value="meta"/>
<source>
<context value="manufactOrg"/>
</source>
<target>
<context value="organization"/>
<contextType value="variable"/>
<element value="meta"/>
<variable value="meta"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="manufactOrg"/>
</source>
<target>
<context value="meta"/>
<contextType value="variable"/>
<element value="tag"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<rule>
<name value="system"/>
<source>
<context value="manufactOrg"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://algoritmodiscoring"/>
</parameter>
</target>
</rule>
<rule>
<name value="code"/>
<source>
<context value="manufactOrg"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString
value="ClinicalDocument/body/manufacturerOrganization"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="identifier"/>
<source>
<context value="manufactOrg"/>
<element value="id"/>
<variable value="id"/>
</source>
<target>
<context value="organization2"/>
<contextType value="variable"/>
<element value="identifier"/>
<variable value="identifier"/>
</target>
<rule>
<name value="root1"/>
<source>
<context value="id"/>
<element value="root"/>
<variable value="r"/>
</source>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="translate"/>
<parameter>
<valueId value="r"/>
</parameter>
<parameter>
<valueString
value="http://hl7.org/fhir/ConceptMap/special-oid2uri"/>
</parameter>
<parameter>
<valueString value="uri"/>
</parameter>
</target>
</rule>
<rule>
<name value="ext"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext"/>
</source>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="ext"/>
</parameter>
</target>
<rule>
<name value="UUID"/>
<source>
<context value="manufactOrg"/>
</source>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="append"/>
<parameter>
<valueString value="Organization?identifier="/>
</parameter>
<parameter>
<valueId value="ext"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="assigningAuthorityName"/>
<source>
<context value="id"/>
<element value="assigningAuthorityName"/>
<variable value="s"/>
</source>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="assigner"/>
<variable value="a"/>
</target>
<target>
<context value="a"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueId value="s"/>
</parameter>
</target>
</rule>
<rule>
<name value="r"/>
<source>
<context value="id"/>
<element value="root"/>
<variable value="r"/>
</source>
<rule>
<name value="org"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext"/>
</source>
<target>
<context value="organization1"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid23"/>
<transform value="evaluate"/>
<parameter>
<valueString value="r + '-' + ext"/>
</parameter>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="https://example/Organization/"/>
</parameter>
<parameter>
<valueId value="uuid23"/>
</parameter>
</target>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="manufacturer"/>
<variable value="reference"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="reference"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString
value="'https://example/Organization/' + %uuid23"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="name"/>
<source>
<context value="manufactOrg"/>
<element value="name"/>
<variable value="n"/>
</source>
<target>
<context value="organization"/>
<contextType value="variable"/>
<element value="name"/>
<transform value="evaluate"/>
<parameter>
<valueString value="n.other"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="protocolAp"/>
<source>
<context value="cda"/>
</source>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="protocolApplied"/>
<variable value="prot"/>
</target>
<rule>
<name value="entrirel4"/>
<source>
<context value="substance"/>
<element value="entryRelationship"/>
<variable value="entrirel4"/>
</source>
<rule>
<name value="entrirel2"/>
<source>
<context value="entrirel4"/>
<element value="observation"/>
<variable value="obs"/>
</source>
<rule>
<name value="codeControl"/>
<source>
<context value="obs"/>
<element value="code"/>
<condition value="(code = '75323-6')"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="obs"/>
<element value="value"/>
<variable value="vvv"/>
</source>
<target>
<context value="prot"/>
<contextType value="variable"/>
<element value="targetDisease"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="entrirel2"/>
<source>
<context value="entrirel4"/>
<element value="observation"/>
<variable value="obsdosenumber"/>
</source>
<rule>
<name value="codeControl"/>
<source>
<context value="obsdosenumber"/>
<element value="code"/>
<condition value="(code = '30973-2')"/>
</source>
<rule>
<name value="v"/>
<source>
<context value="obsdosenumber"/>
<element value="value"/>
<variable value="v"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="v"/>
<element value="value"/>
<variable value="int"/>
</source>
<target>
<context value="prot"/>
<contextType value="variable"/>
<element value="doseNumber"/>
<transform value="evaluate"/>
<parameter>
<valueString value="int.toString()"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="entrirel1"/>
<source>
<context value="substance"/>
<element value="entryRelationship"/>
<variable value="entrirel1"/>
</source>
<rule>
<name value="obs"/>
<source>
<context value="entrirel1"/>
<element value="observation"/>
<variable value="obs"/>
</source>
<rule>
<name value="codeControl"/>
<source>
<context value="obs"/>
<element value="code"/>
<condition value="(code = '85714-4')"/>
</source>
<rule>
<name value="code"/>
<source>
<context value="obs"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="statusReason"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</rule>
<rule>
<name value="codeControl"/>
<source>
<context value="obs"/>
<element value="code"/>
<condition value="(code = '59784-9')"/>
</source>
<rule>
<name value="val"/>
<source>
<context value="obs"/>
<element value="value"/>
<variable value="val"/>
</source>
<rule>
<name value="cod"/>
<source>
<context value="val"/>
<element value="originalText"/>
<variable value="original"/>
</source>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="statusReason"/>
<variable value="cod"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<rule>
<name value="reference"/>
<source>
<context value="original"/>
<element value="reference"/>
<variable value="reff"/>
</source>
<target>
<context value="cod"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="evaluate"/>
<parameter>
<valueString value="reff.value"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="location"/>
<source>
<context value="substance"/>
<element value="participant"/>
<variable value="part"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e1"/>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="request"/>
<variable value="request"/>
<transform value="create"/>
<parameter>
<valueString value="BackboneElement"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="method"/>
<transform value="copy"/>
<parameter>
<valueString value="PUT"/>
</parameter>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="location"/>
<transform value="create"/>
<parameter>
<valueString value="Location"/>
</parameter>
</target>
<rule>
<name value="meta"/>
<source>
<context value="part"/>
</source>
<target>
<context value="location"/>
<contextType value="variable"/>
<element value="meta"/>
<variable value="meta"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="part"/>
</source>
<target>
<context value="meta"/>
<contextType value="variable"/>
<element value="tag"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<rule>
<name value="system"/>
<source>
<context value="part"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://algoritmodiscoring"/>
</parameter>
</target>
</rule>
<rule>
<name value="code"/>
<source>
<context value="part"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="ClinicalDocument/body/participant"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="role"/>
<source>
<context value="part"/>
<element value="participantRole"/>
<variable value="partRole"/>
</source>
<rule>
<name value="identifier"/>
<source>
<context value="partRole"/>
<element value="id"/>
<variable value="id"/>
</source>
<target>
<context value="location"/>
<contextType value="variable"/>
<element value="identifier"/>
<variable value="identifier"/>
</target>
<rule>
<name value="root1"/>
<source>
<context value="id"/>
<element value="root"/>
<variable value="r"/>
</source>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="translate"/>
<parameter>
<valueId value="r"/>
</parameter>
<parameter>
<valueString
value="http://hl7.org/fhir/ConceptMap/special-oid2uri"/>
</parameter>
<parameter>
<valueString value="uri"/>
</parameter>
</target>
</rule>
<rule>
<name value="ext"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext"/>
</source>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="ext"/>
</parameter>
</target>
<rule>
<name value="UUID"/>
<source>
<context value="ext"/>
</source>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="append"/>
<parameter>
<valueString value="Location?identifier="/>
</parameter>
<parameter>
<valueId value="ext"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="assigningAuthorityName"/>
<source>
<context value="id"/>
<element value="assigningAuthorityName"/>
<variable value="s"/>
</source>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="assigner"/>
<variable value="a"/>
</target>
<target>
<context value="a"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueId value="s"/>
</parameter>
</target>
</rule>
<rule>
<name value="r"/>
<source>
<context value="id"/>
<element value="root"/>
<variable value="r"/>
</source>
<rule>
<name value="ref"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext"/>
</source>
<target>
<context value="location"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid7"/>
<transform value="evaluate"/>
<parameter>
<valueString value="r + '-' + ext"/>
</parameter>
</target>
<target>
<context value="e1"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="https://example/Location/"/>
</parameter>
<parameter>
<valueId value="uuid7"/>
</parameter>
</target>
<target>
<context value="immunization"/>
<contextType value="variable"/>
<element value="location"/>
<variable value="reference"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="reference"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString
value="'https://example/Location/' + %uuid7"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
</group>
<group>
<name value="Observation"/>
<typeMode value="none"/>
<input>
<name value="entrirel2"/>
<type value="entryRelationship"/>
<mode value="source"/>
</input>
<input>
<name value="patient"/>
<type value="Patient"/>
<mode value="target"/>
</input>
<input>
<name value="tgt"/>
<mode value="target"/>
</input>
<input>
<name value="bundle"/>
<type value="Bundle"/>
<mode value="target"/>
</input>
<input>
<name value="enc"/>
<type value="Encounter"/>
<mode value="target"/>
</input>
<input>
<name value="obs"/>
<type value="Observation"/>
<mode value="target"/>
</input>
<rule>
<name value="obs"/>
<source>
<context value="entrirel2"/>
<element value="observation"/>
<variable value="observation"/>
</source>
<rule>
<name value="code"/>
<source>
<context value="observation"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="obs"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<documentation
value="observation.templateId as tid -> obs.identifier as idf then{"/>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="observation"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'completed')"/>
</source>
<target>
<context value="obs"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="observation"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'active')"/>
</source>
<target>
<context value="obs"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="registered"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="observation"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'aborted')"/>
</source>
<target>
<context value="obs"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="cancelled"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="observation"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'suspended')"/>
</source>
<target>
<context value="obs"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="partial"/>
</parameter>
</target>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="observation"/>
</source>
<target>
<context value="obs"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="reference"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="reference"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'https://example/Patient/' + %patient.id"/>
</parameter>
</target>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="observation"/>
</source>
<target>
<context value="obs"/>
<contextType value="variable"/>
<element value="encounter"/>
<variable value="reference"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="reference"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'https://example/Encounter/' + %enc.id"/>
</parameter>
</target>
</rule>
<rule>
<name value="refRange"/>
<source>
<context value="observation"/>
</source>
<target>
<context value="obs"/>
<contextType value="variable"/>
<element value="referenceRange"/>
<variable value="refRange"/>
</target>
<rule>
<name value="value"/>
<source>
<context value="observation"/>
<element value="value"/>
<variable value="vvv"/>
</source>
<target>
<context value="refRange"/>
<contextType value="variable"/>
<element value="appliesTo"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="text"/>
<source>
<context value="observation"/>
</source>
<target>
<context value="refRange"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</group>
<group>
<name value="Observation1"/>
<typeMode value="none"/>
<input>
<name value="entrirel4"/>
<type value="entryRelationship"/>
<mode value="source"/>
</input>
<input>
<name value="patient"/>
<type value="Patient"/>
<mode value="target"/>
</input>
<input>
<name value="tgt"/>
<mode value="target"/>
</input>
<input>
<name value="bundle"/>
<type value="Bundle"/>
<mode value="target"/>
</input>
<input>
<name value="enc"/>
<type value="Encounter"/>
<mode value="target"/>
</input>
<input>
<name value="obs"/>
<type value="Observation"/>
<mode value="target"/>
</input>
<rule>
<name value="obs"/>
<source>
<context value="entrirel4"/>
<element value="observation"/>
<variable value="observation"/>
</source>
<rule>
<name value="code"/>
<source>
<context value="observation"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="obs"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<documentation
value="observation.templateId as tid -> obs.identifier as idf then{"/>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="observation"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'completed')"/>
</source>
<target>
<context value="obs"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="observation"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'active')"/>
</source>
<target>
<context value="obs"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="registered"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="observation"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'aborted')"/>
</source>
<target>
<context value="obs"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="cancelled"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="observation"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'suspended')"/>
</source>
<target>
<context value="obs"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="partial"/>
</parameter>
</target>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="observation"/>
</source>
<target>
<context value="obs"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="reference"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="reference"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'https://example/Patient/' + %patient.id"/>
</parameter>
</target>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="observation"/>
</source>
<target>
<context value="obs"/>
<contextType value="variable"/>
<element value="encounter"/>
<variable value="reference"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="reference"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'https://example/Encounter/' + %enc.id"/>
</parameter>
</target>
</rule>
<rule>
<name value="value1"/>
<source>
<context value="observation"/>
<element value="effectiveTime"/>
<variable value="eff"/>
<condition value="(value.exists())"/>
</source>
<target>
<context value="obs"/>
<contextType value="variable"/>
<element value="effective"/>
<variable value="value"/>
<transform value="create"/>
<parameter>
<valueString value="dateTime"/>
</parameter>
</target>
<dependent>
<name value="TSDateTime"/>
<variable value="eff"/>
<variable value="value"/>
</dependent>
</rule>
<rule>
<name value="period"/>
<source>
<context value="observation"/>
<element value="effectiveTime"/>
<variable value="eff"/>
</source>
<target>
<context value="obs"/>
<contextType value="variable"/>
<element value="effective"/>
<variable value="period"/>
<transform value="create"/>
<parameter>
<valueString value="Period"/>
</parameter>
</target>
<dependent>
<name value="IVLTSPeriod"/>
<variable value="eff"/>
<variable value="period"/>
</dependent>
</rule>
<rule>
<name value="refRange"/>
<source>
<context value="observation"/>
</source>
<target>
<context value="obs"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="concept"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<rule>
<name value="coding"/>
<source>
<context value="observation"/>
<element value="value"/>
</source>
<target>
<context value="concept"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<rule>
<name value="value"/>
<source>
<context value="observation"/>
<element value="value"/>
<variable value="v"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="evaluate"/>
<parameter>
<valueString value="v.code"/>
</parameter>
</target>
</rule>
<rule>
<name value="vv"/>
<source>
<context value="observation"/>
<element value="value"/>
<variable value="v"/>
</source>
<rule>
<name value="codeSystem"/>
<source>
<context value="v"/>
<element value="codeSystem"/>
<variable value="system"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="translate"/>
<parameter>
<valueId value="system"/>
</parameter>
<parameter>
<valueString
value="http://hl7.org/fhir/ConceptMap/special-oid2uri"/>
</parameter>
<parameter>
<valueString value="uri"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="observation"/>
<element value="value"/>
<variable value="v"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="evaluate"/>
<parameter>
<valueString value="v.displayName"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="observation"/>
<element value="value"/>
<variable value="valu"/>
</source>
<rule>
<name value="txt"/>
<source>
<context value="valu"/>
<element value="originalText"/>
<variable value="txt"/>
</source>
<rule>
<name value="reference"/>
<source>
<context value="txt"/>
<element value="reference"/>
<variable value="ref"/>
</source>
<target>
<context value="concept"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="evaluate"/>
<parameter>
<valueString value="ref.value"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</group>
</StructureMap>