CDA to FHIR Maps, published by HL7 Italy. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/hl7-it/cda2fhir/ and changes regularly. See the Directory of published versions
Draft as of 2024-09-15 |
<StructureMap xmlns="http://hl7.org/fhir">
<id value="cda2fhirLdo"/>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>map "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirLdo" = "cda2fhirLdo"
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
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 ext -> identifier.value = ext;
id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;
} "record";
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";
} "recPat";
} "patient";
} "ClinicalDocumentToBody";
}
group ClinicalDocumentToBundle(source cda : ClinicalDocument, target patient : Patient, target composition : Composition, target encounter : Encounter, target bundle : Bundle, target DocumentReference : DocumentReference) {
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 {
// discretizzi il primo livello di component
component.section as srcSection then {
srcSection.code where (code = '46241-6') -> composition.section as tgtSection then ClinicalDocumentSectionMotivoRicovero(cda, srcSection, patient, tgtSection, bundle, encounter) "motivoRicovero";
srcSection.code where (code = '47039-3') -> composition.section as tgtSection then ClinicalDocumentSectionInquadramentoClinico(cda, srcSection, patient, tgtSection, bundle, encounter) "inquadramentoClinico";
srcSection.code where (code = '8648-8') -> composition.section as tgtSection then ClinicalDocumentSectionDecorsoOspedaliero(cda, srcSection, patient, tgtSection, bundle, encounter) "DecorsoOspedaliero";
srcSection.code where (code = '55109-3') -> composition.section as tgtSection then ClinicalDocumentSectionComplicanze(cda, srcSection, patient, tgtSection, bundle, encounter) "Complicazioni";
srcSection.code where (code = '11493-4') -> composition.section as tgtSection then ClinicalDocumentSectionRiscontri(cda, srcSection, patient, tgtSection, bundle, encounter) "HospitalDischargeStudiesSummary";
srcSection.code where (code = '34104-0') -> composition.section as tgtSection then ClinicalDocumentSectionConsulenza(cda, srcSection, patient, tgtSection, bundle, encounter) "HospitalDischargeStudiesSummary";
srcSection.code where (code = '30954-2') -> composition.section as tgtSection then ClinicalDocumentSectionEsamiEseguitiRicovero(cda, srcSection, patient, tgtSection, bundle, encounter) "EsamiEseguitiDuranteilRicovero";
srcSection.code where (code = '47519-4') -> composition.section as tgtSection then ClinicalDocumentSectionProcedureEseguiteRicovero(cda, srcSection, patient, tgtSection, bundle, encounter) "HistoryOfProceduresDocument";
srcSection.code where (code = '48765-2') -> composition.section as tgtSection then ClinicalDocumentSectionAllergie(cda, srcSection, patient, tgtSection, bundle, encounter) "EsamiEseguitiDuranteIlRicovero";
srcSection.code where (code = '10160-0') -> composition.section as tgtSection then ClinicalDocumentSectionTerapiaFarmacologicaDuranteRicovero(cda, srcSection, patient, tgtSection, bundle, encounter) "TerapiaFarmacologicaAllaDimissione";
srcSection.code where (code = '11535-2') -> composition.section as tgtSection then ClinicalDocumentSectionDiagnosiDimissione(cda, srcSection, patient, tgtSection, bundle, encounter) "DiagnosiDiDimissione";
srcSection.code where (code = '18776-5') -> composition.section as tgtSection then ClinicalDocumentSectionIstruzioniFollowUp(cda, srcSection, patient, tgtSection, bundle, encounter) "DiagnosiDiDimissione";
srcSection.code where (code = '10183-2') -> composition.section as tgtSection then ClinicalDocumentSectionTerapiaDimissione(cda, srcSection, patient, tgtSection, bundle, encounter) "TerapiaFarmacologicaAllaDimissione";
};
};
} "body";
};
}
// -------------------------------------------------------------------------------------------------------------------
group ClinicalDocumentSectionMotivoRicovero(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 where src.entry.exists() then {
src.text as cdaText -> tgt.text as fhirText then {
cdaText -> fhirText.status = 'generated' "narrativeStatus";
cdaText as t -> fhirText.div = t "narrativeText";
} "cdaText";
} "cText";
src.entry as entry1 -> 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', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {
entry1.observation as obs then Observation(obs, patient, enc, observation, bundle) "act";
};
src where src.entry.exists().not() then {
src.text as cdaText -> bundle.entry as e8, e8.request = create('BackboneElement') as request, request.method = 'POST', e8.resource = create('Observation') as Observation, Observation.id = uuid() as uuid8, e8.fullUrl = append('https://example/Observation/', uuid8), request.url = 'Observation', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %Observation.id) then {
src -> Observation.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
src -> Observation.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";
src.code -> Observation.code;
src where observation.statusCode.exists().not() then {
src -> Observation.status = 'final' "status";
} "statuscode";
cdaText -> Observation.note as note then {
cdaText as t -> note.text = t "reference";
} "reference";
} "cdaText";
} "where";
}
group ClinicalDocumentSectionInquadramentoClinico(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 -> 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', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id), tgt.text as fhirText then {
cdaText -> observation.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
cdaText -> observation.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";
cdaText -> fhirText.status = 'generated' "narrativeStatus";
cdaText as t -> fhirText.div = t "narrativeText";
src.code -> observation.code;
src where observation.statusCode.exists().not() then {
src -> observation.status = 'final' "status";
} "statuscode";
cdaText -> observation.note as note then {
cdaText as t -> note.text = t "reference";
} "reference";
} "cdaText";
src.component as component then {
component.section as section2 then {
// ANAMNESI
section2 -> tgt.section as sec2 then {
section2.code where (code = '11329-0') -> sec2.code;
section2.title as t -> sec2.title = (t.dataString);
// section2.code -> sec2.code;
src where src.entry.exists() then {
section2.text as cdaText -> sec2.text as fhirText then {
cdaText -> fhirText.status = 'generated' "narrativeStatus";
cdaText as t -> fhirText.div = t "narrativeText";
} "cdaText";
} "exist";
src where src.entry.exists().not() then {
section2.text as cdaText -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Observation') as condition, condition.id = uuid() as uuid1, e1.fullUrl = append('https://example/Observation/', uuid1), request.url = 'Observation', sec2.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %condition.id) then {
section2.code -> condition.code;
src where condition.statusCode.exists().not() then {
src -> condition.status = 'final' "status";
} "statuscode";
cdaText -> condition.note as note then {
cdaText -> condition.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
cdaText -> condition.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";
cdaText as t -> note.text = t "reference";
} "reference";
} "cdaText";
} "where";
section2.entry as entry1 then {
entry1.observation as obs then {
// EntryRelationship per il Problem
obs.code where (code = '75326-9') then {
obs -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Condition') as condition, condition.id = uuid() as uuid1, e1.fullUrl = append('https://example/Condition/', uuid1), request.url = 'Condition', sec2.entry = create('Reference') as reference, reference.reference = ('https://example/Condition/' + %condition.id) then {
obs.code -> condition.category;
obs -> condition.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
obs -> condition.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";
obs.statusCode as status where (code = 'completed') -> condition.verificationStatus as status2 then {
status -> status2.coding as status3 then {
status -> status3.code = 'confirmed' "finald";
status -> status3.system = 'http://terminology.hl7.org/CodeSystem/condition-ver-status' "system";
} "st3";
} "status";
obs.effectiveTime as effective1 then {
effective1 where effective1.low.exists() or effective1.high.exists() then {
effective1 -> condition.onset = create('Period') as periodonset then IVLTSPeriod(effective1, periodonset) "onsetperiod";
} "ef";
} "effectivetime1";
obs.value : CD as val then {
val -> condition.code = create('CodeableConcept') as ce then {
val.originalText -> ce.text;
val -> ce.coding as coding then {
val.code as code -> coding.code = cast(code, 'string');
val.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
val.displayName as display -> coding.display = cast(display, 'string');
} "coding";
} "Ce";
} "Value";
obs.entryRelationship as entriRel then {
entriRel -> condition.evidence = create('BackboneElement') as evidence then {
entriRel.observation as observation2 then {
observation2.code as code then {
code.code where (code.code = '89261-2') then {
obs -> 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' then {
entriRel -> evidence.detail = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) "ref";
observation2.code -> observation.code;
observation2 where observation.statusCode.exists().not() then {
observation2 -> observation.status = 'final' "status";
} "statuscode";
observation2.text as text -> observation.note = create('Annotation') as note then {
text.reference as ref -> note.text = (ref.value) "val";
} "Annontation";
obs -> observation.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
obs -> observation.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";
observation2.statusCode as statusc where (code = 'completed') -> ob.status = 'final';
observation2.statusCode as statusc where (code = 'active') -> ob.status = 'registered';
observation2.statusCode as statusc where (code = 'aborted') -> ob.status = 'cancelled';
observation2.statusCode as statusc where (code = 'suspended') -> ob.status = 'partial';
observation2.value : INT as int -> ob.value = (int.value);
observation2.value : BL as boolean -> ob.value = (boolean.value) "boolean";
observation2.value : CD as val then {
val -> ob.value = create('CodeableConcept') as ce then {
val.originalText as originalText then {
originalText.reference as reference -> ce.text = reference;
} "originltext";
val -> ce.coding as coding then {
val.code as code -> coding.code = cast(code, 'string');
val.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
val.displayName as display -> coding.display = cast(display, 'string');
val.codeSystemVersion as version -> coding.version = cast(version, 'string');
} "code";
val.translation as translation -> ce.coding as coding then {
translation.code as code -> coding.code = cast(code, 'string');
translation.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
translation.displayName as display -> coding.display = cast(display, 'string');
translation.codeSystemVersion as version -> coding.version = cast(version, 'string');
translation.qualifier as qualifier then {
qualifier.value as value -> ce.coding as coding then {
value.code as code -> coding.code = cast(code, 'string');
value.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
value.displayName as display -> coding.display = cast(display, 'string');
value.codeSystemVersion as version -> coding.version = cast(version, 'string');
};
};
};
} "coding";
} "val";
observation2.value : PQ as val then {
val -> ob.value = create('Quantity') as quantity then {
val.value as value -> quantity.value = value;
val.unit as unit -> quantity.unit = unit;
} "quantity";
} "valueQuantity";
observation2.value : ST as value -> ob.value = create('string'), ob.value = (value.dataString);
observation2.value : CE as val then {
val -> observation.value = create('CodeableConcept') as ce then {
val.originalText -> ce.text;
val -> ce.coding as coding then {
val.code as code -> coding.code = cast(code, 'string');
val.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
val.displayName as display -> coding.display = cast(display, 'string');
} "coding";
} "Ce";
} "Value";
} "obser";
} "whereDecorsoClinico";
};
} "Observation2";
} "evidence";
} "EntryRelationship1";
obs.entryRelationship as entriRel then {
entriRel.observation as observation2 then {
observation2.code as code then {
code.code where (code.code = '33999-4') then {
observation2 -> condition.clinicalStatus = create('CodeableConcept') as status then {
observation2.text as text then {
text.reference as refstat -> status.text = (refstat.value) "statref";
} "textstat";
observation2 -> status.coding = create('Coding') as coding then {
observation2.value as value then {
value.code where (value.code = 'LA16666-2') -> coding.code = 'active' "active";
value.code where (value.code = 'LA18632-2') -> coding.code = 'inactive' "inactive";
value.codeSystem as system -> coding.system = 'http://terminology.hl7.org/CodeSystem/condition-clinical' "system";
value.displayName as display -> coding.display = cast(display, 'string');
} "value1";
} "coding";
} "code";
} "whereDecorsoClinico";
} "codestatus";
} "observationstatus";
} "entryrelationshipstatus";
} "whereEntryPatologicaProssima";
} "observationcondition";
} "entry";
} "subsection1";
// ESAME PBIETTIVO
section2.code where (code = '29545-1') then ClinicalDocumentSottoSectionOBS(section2, sec2, bundle, enc, patient) "esameObiettivo";
// TETAPIA FARMACOLOGICA
section2.code where (code = '42346-7') then ClinicalDocumentSottoSectionMS(section2, sec2, bundle, patient, enc) "TerapiaFarmacologicaAllIngresso";
} "sec2fhir";
} "componentSec";
};
}
group ClinicalDocumentSectionDecorsoOspedaliero(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 -> 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', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id), tgt.text as fhirText then {
cdaText -> fhirText.status = 'generated' "narrativeStatus";
cdaText as t -> fhirText.div = t "narrativeText";
src.code -> observation.code;
src where observation.statusCode.exists().not() then {
src -> observation.status = 'final' "status";
} "statuscode";
src -> observation.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
src -> observation.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";
cdaText -> observation.note as note then {
cdaText as t -> note.text = t "reference";
} "reference";
} "cdaText";
src.component as component then {
component.section as section2 then {
src then ClinicalDocumentSottoSectionOBS(section2, tgt, bundle, enc, patient) "Decorso";
} "1";
} "2";
}
group ClinicalDocumentSectionComplicanze(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 where src.entry.exists() then {
src.text as cdaText -> tgt.text as fhirText then {
cdaText -> fhirText.status = 'generated' "narrativeStatus";
cdaText as t -> fhirText.div = t "narrativeText";
} "cdaText";
} "exist";
src where src.entry.exists().not() then {
src.text as cdaText -> 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', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {
src -> observation.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
src -> observation.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";
src.code -> observation.code;
src where observation.statusCode.exists().not() then {
src -> observation.status = 'final' "status";
} "statuscode";
cdaText -> observation.note as note then {
cdaText as t -> note.text = t "reference";
} "reference";
} "cdaText";
} "where";
src.entry as entry1 -> 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', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {
entry1.observation as obs then Observation(obs, patient, enc, observation, bundle) "act";
};
}
group ClinicalDocumentSectionRiscontri(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 -> 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', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id), tgt.text as fhirText then {
cdaText -> fhirText.status = 'generated' "narrativeStatus";
cdaText as t -> fhirText.div = t "narrativeText";
src.code -> observation.code;
src where observation.statusCode.exists().not() then {
src -> observation.status = 'final' "status";
} "statuscode";
src -> observation.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
src -> observation.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";
cdaText -> observation.note as note then {
cdaText as t -> note.text = t "reference";
} "reference";
} "cdaText";
src.component as component then {
component.section as section2 then {
src then ClinicalDocumentSottoSectionOBS(section2, tgt, bundle, enc, patient) "Decorso";
} "1";
} "2";
}
group ClinicalDocumentSectionConsulenza(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 where src.entry.exists() then {
src.text as cdaText -> tgt.text as fhirText then {
cdaText -> fhirText.status = 'generated' "narrativeStatus";
cdaText as t -> fhirText.div = t "narrativeText";
} "cdaText";
} "exist";
src where src.entry.exists().not() then {
src.text as cdaText -> 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', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {
src -> observation.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
src -> observation.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";
src.code -> observation.code;
src where observation.statusCode.exists().not() then {
src -> observation.status = 'final' "status";
} "statuscode";
cdaText -> observation.note as note then {
cdaText as t -> note.text = t "reference";
} "reference";
} "cdaText";
} "where";
src.entry as entry1 -> 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', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {
entry1.observation as obs then ObservationConsulenza(obs, patient, enc, observation, bundle) "act";
};
}
group ClinicalDocumentSectionEsamiEseguitiRicovero(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 where src.entry.exists() then {
src.text as cdaText -> tgt.text as fhirText then {
cdaText -> fhirText.status = 'generated' "narrativeStatus";
cdaText as t -> fhirText.div = t "narrativeText";
} "cdaText";
} "exists";
src where src.entry.exists().not() then {
src.text as cdaText -> 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', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {
src -> observation.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
src -> observation.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";
src.code -> observation.code;
src where observation.statusCode.exists().not() then {
src -> observation.status = 'final' "status";
} "statuscode";
cdaText -> observation.note as note then {
cdaText as t -> note.text = t "reference";
} "reference";
} "cdaText";
} "where";
src.entry as entry1 -> 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', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {
entry1.observation as obs then ObservationEsamiDuranteRicovero(obs, patient, enc, observation, bundle) "act";
};
}
group ClinicalDocumentSectionProcedureEseguiteRicovero(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 where src.entry.exists() then {
src.text as cdaText -> tgt.text as fhirText then {
cdaText -> fhirText.status = 'generated' "narrativeStatus";
cdaText as t -> fhirText.div = t "narrativeText";
} "cdaText";
} "exists";
src where src.entry.exists().not() then {
src.text as cdaText -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Procedure') as procedure, procedure.id = uuid() as uuid1, e1.fullUrl = append('https://example/Procedure/', uuid1), request.url = 'Procedure', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Procedure/' + %procedure.id) then {
src -> procedure.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
src -> procedure.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";
src -> procedure.status = 'unknown' "statuscode";
cdaText -> procedure.note as note then {
cdaText as t -> note.text = t "reference";
} "reference";
} "cdaText";
} "where";
src.entry as entry1 -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Procedure') as procedure, procedure.id = uuid() as uuid1, e1.fullUrl = append('https://example/Procedure/', uuid1), request.url = 'Procedure', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Procedure/' + %procedure.id) then {
src -> procedure.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
src -> procedure.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";
entry1.procedure as proceduresrc then {
proceduresrc.code -> procedure.code;
proceduresrc.text as txt -> procedure.note as note then {
txt.reference as ref -> note.text = (ref.value);
};
proceduresrc where proc.statusCode.exists().not() then {
proceduresrc -> procedure.status = 'unknown' "statuscode";
} "status";
proceduresrc.statusCode as statusc where (code = 'completed') -> procedure.status = 'completed';
proceduresrc.statusCode as statusc where (code = 'active') -> procedure.status = 'in-progress';
proceduresrc.statusCode as statusc where (code = 'aborted') -> procedure.status = 'stopped';
proceduresrc.statusCode as statusc where (code = 'suspended') -> procedure.status = 'on-hold';
proceduresrc.statusCode as statusc where (code = 'cancelled') -> procedure.status = 'not-done';
proceduresrc.statusCode as statusc where (code = 'held') -> procedure.status = 'on-hold';
proceduresrc.statusCode as statusc where (code = 'new') -> procedure.status = 'preparation';
proceduresrc.statusCode as statusc where (code = 'obsolete') -> procedure.status = 'entered-in-error';
proceduresrc.statusCode as statusc where (code = 'nullified') -> procedure.status = 'unknown';
proceduresrc.effectiveTime as efft -> procedure.performed = create('Period') as period then IVLTSPeriod(efft, period);
proceduresrc.entryRelationship as entriRel -> 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', procedure.reasonReference = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {
entriRel -> observation.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
entriRel -> observation.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";
entriRel.observation as obs then {
obs.code -> observation.code;
obs where observation.statusCode.exists().not() then {
obs -> observation.status = 'final' "status";
} "statuscode";
} "ObservationValue";
} "Observation";
} "Procedure";
} "Entry";
}
group ClinicalDocumentSectionAllergie(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 where src.entry.exists() then {
src.text as cdaText -> tgt.text as fhirText then {
cdaText -> fhirText.status = 'generated' "narrativeStatus";
cdaText as t -> fhirText.div = t "narrativeText";
} "cdaText";
} "exists";
src where src.entry.exists().not() then {
src.text as cdaText -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('AllergyIntolerance') as allergy, allergy.id = uuid() as uuid1, e1.fullUrl = append('https://example/AllergyIntolerance/', uuid1), request.url = 'AllergyIntolerance', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/AllergyIntolerance/' + %allergy.id) then {
src -> allergy.patient = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
src -> allergy.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";
src -> allergy.clinicalStatus = create('CodeableConcept') as status then {
src -> status.text = 'string' "text";
src -> status.coding = create('Coding') as coding then {
src -> coding.code = 'active' "active";
src -> coding.system = 'http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical' "system";
} "coding";
} "allergy";
src.code -> allergy.code;
cdaText -> allergy.note as note then {
cdaText as t -> note.text = t "reference";
} "reference";
} "cdaText";
} "where";
src.entry as entry1 -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('AllergyIntolerance') as allergy, allergy.id = uuid() as uuid1, e1.fullUrl = append('https://example/AllergyIntolerance/', uuid1), request.url = 'AllergyIntolerance', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/AllergyIntolerance/' + %allergy.id) then {
src -> allergy.patient = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
src -> allergy.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";
entry1.act as actallint then {
actallint.effectiveTime as eff -> allergy.onset = create('Period') as per then IVLTSPeriod(eff, per);
actallint.entryRelationship as entryact then {
entryact.observation as entryobs then {
entryobs.value as code then {
code.code as code1 -> allergy.type = translate(code1, '#AllergyTypeMap', 'code') "type";
code.code as code2 -> allergy.category = translate(code2, '#AllergyCategoryMap', 'code') "category";
} "code";
entryobs.participant as partic then {
partic.participantRole as pratRole then {
pratRole.playingEntity as pratent then {
pratent -> allergy.reaction = create('BackboneElement') as reaction then {
pratent.code -> reaction.substance "subs";
entryobs.entryRelationship as entryobs1 where (typeCode = 'MFST') then {
entryobs1.observation as entobs then {
entobs.effectiveTime as eff then {
eff.low as l -> reaction.onset = create('dateTime') as start then TSDateTime(l, start) "val";
} "eff";
entobs.value -> reaction.manifestation "manifest";
} "observ";
} "entry";
} "cod";
} "react";
} "pratentit";
} "PratRole";
entryobs.entryRelationship as entryobs2 then {
entryobs2.observation as entobs then {
entobs.code as code where (code = 'SEV') then {
entobs.value as value then {
value.code where (value.code = 'M') -> allergy.criticality = 'unable-to-assess' "active";
value.code where (value.code = 'L') -> allergy.criticality = 'low' "active";
value.code where (value.code = 'H') -> allergy.criticality = 'high' "active";
} "entobs";
} "sev";
} "severity";
} "observ";
entryobs.entryRelationship as entryobs3 then {
entryobs3.observation as entobs then {
entobs.code as code where (code = '33999-4') then {
entobs -> allergy.clinicalStatus = create('CodeableConcept') as status then {
entobs -> status.coding = create('Coding') as coding then {
entobs.value as value then {
value.code where (value.code = 'LA16666-2') -> coding.code = 'active' "active";
value.code where (value.code = 'LA18632-2') -> coding.code = 'inactive' "active";
value.codeSystem as system -> coding.system = 'http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical' "system";
value.displayName as display -> coding.display = cast(display, 'string');
} "value1";
} "coding";
} "clinicalStatus";
} "stat";
} "obobs3serv";
} "entry3";
entryobs.entryRelationship as entryobs4 then {
entryobs4.act as entact then {
entact.text as actext then {
actext.reference as reftxt -> allergy.note = create('BackboneElement') as note then {
reftxt as ref -> note.text = (ref.value) "notxt";
} "notetxt";
} "txtact";
} "obobs4serv";
} "entry4";
} "partic";
};
};
} "allergy";
}
group ClinicalDocumentSectionDiagnosiDimissione(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 where src.entry.exists() then {
src.text as cdaText -> tgt.text as fhirText then {
cdaText -> fhirText.status = 'generated' "narrativeStatus";
cdaText as t -> fhirText.div = t "narrativeText";
} "cdaText";
} "exists";
src where src.entry.exists().not() then {
src.text as cdaText -> 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', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {
src -> observation.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
src -> observation.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";
src.code -> observation.code;
src where observation.statusCode.exists().not() then {
src -> observation.status = 'final' "status";
} "statuscode";
cdaText -> observation.note as note then {
cdaText as t -> note.text = t "reference";
} "reference";
} "cdaText";
} "where";
src.entry as entry1 -> 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', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {
entry1.observation as obs then Observation(obs, patient, enc, observation, bundle) "act";
};
}
group ClinicalDocumentSectionIstruzioniFollowUp(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.text as cdaText -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('CarePlan') as carePlan, carePlan.id = uuid() as uuid1, e1.fullUrl = append('https://example/CarePlan/', uuid1), request.url = 'CarePlan', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/CarePlan/' + %carePlan.id) then {
cdaText -> carePlan.note as note then {
cdaText as t -> note.text = t "reference";
} "reference";
src -> carePlan.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
src -> carePlan.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";
src -> carePlan.status = 'active' "status";
src -> carePlan.intent = 'order' "intent";
} "entry";
}
group ClinicalDocumentSectionTerapiaFarmacologicaDuranteRicovero(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 where src.entry.exists() then {
src.text as cdaText -> tgt.text as fhirText then {
cdaText -> fhirText.status = 'generated' "narrativeStatus";
cdaText as t -> fhirText.div = t "narrativeText";
} "cdaText";
} "exists";
src where src.entry.exists().not() then {
src.text as cdaText -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('MedicationAdministration') as medicationAdm, medicationAdm.id = uuid() as uuid1, e1.fullUrl = append('https://example/MedicationAdministration/', uuid1), request.url = 'MedicationAdministration', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/MedicationAdministration/' + %medicationAdm.id) then {
cdaText -> medicationAdm.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
cdaText -> medicationAdm.context = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";
cdaText -> medicationAdm.medication = create('CodeableConcept') as codecon then {
cdaText -> codecon.text = 'string' "text";
} "code";
src -> medicationAdm.effective = create('Period') as period then {
src -> period.start = (start.now()) "low";
src -> period.end = (end.now()) "high";
} "Period";
src where sub.statusCode.exists().not() then {
src -> medicationAdm.status = 'completed' "status";
} "statuscode";
cdaText -> medicationAdm.note as note then {
cdaText as t -> note.text = t "reference";
} "reference";
} "cdaText";
} "where";
src.entry as entry1 -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('MedicationAdministration') as medicationAdm, medicationAdm.id = uuid() as uuid1, e1.fullUrl = append('https://example/MedicationAdministration/', uuid1), request.url = 'MedicationAdministration', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/MedicationAdministration/' + %medicationAdm.id) then {
entry1 -> medicationAdm.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
entry1 -> medicationAdm.context = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";
entry1.substanceAdministration as sa then {
sa.text as tx -> medicationAdm.note as note then {
sa.performer as performer -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as practitioner then {
performer.time as ti -> note.time = (ti.value);
performer.assignedEntity as assEnty then {
assEnty -> practitioner.meta as meta then {
assEnty -> meta.tag = create('Coding') as coding then {
assEnty -> coding.system = 'http://algoritmodiscoring' "system";
assEnty -> coding.code = 'ClinicalDocument/body/TerapiaFarmacologicaRicovero/performer' "code";
} "coding";
} "meta";
assEnty.id as id -> practitioner.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;
id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;
id.root as r then {
id.extension as ext -> practitioner.id = (r + '-' + ext) as uuid2, e1.fullUrl = append('https://example/Practitioner/', uuid2), request.url = 'Practitioner', medicationAdm.performer as perf, perf.actor = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "aut";
} "r";
} "identifier";
assEnty.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {
id.extension as ext -> request.url = append('Practitioner?identifier=', ext) "UUID";
} "2";
assEnty.id as id where (root != '2.16.840.1.113883.2.9.4.3.2') then {
id.extension as ext -> request.url = append('Practitioner?identifier=', ext) "UUID";
} "diverso";
assEnty.assignedPerson as assi then {
assi.name -> practitioner.name;
} "assi";
} "assEntity";
} "perf";
tx.reference as ref -> note.text = (ref.value);
} "tx";
sa.statusCode as st -> medicationAdm.status = (st.code);
sa.effectiveTime as eff -> medicationAdm.effective = create('Period') as period then IVLTSPeriod(eff, period) "period";
sa -> medicationAdm.dosage as dos then {
sa.routeCode -> dos.route;
} "dos";
sa -> medicationAdm.dosage as dos then {
sa.approachSiteCode -> dos.site;
} "dos";
sa.doseQuantity as doseQuant -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('MedicationRequest') as medicationRq, medicationRq.id = uuid() as uuid1, e1.fullUrl = append('https://example/MedicationRequest/', uuid1), request.url = 'MedicationRequest', medicationAdm.request = create('Reference') as reference, reference.reference = ('https://example/MedicationRequest/' + %medicationRq.id) then {
doseQuant -> medicationRq.dosageInstruction = create('Dosage') as dosageInstruction then {
doseQuant.originalText as ot then {
ot.reference -> dosageInstruction.text;
} "ot";
doseQuant -> dosageInstruction.doseAndRate as dosageRate then {
doseQuant -> dosageRate.dose = create('Range') as d then {
doseQuant -> d.low = create('SimpleQuantity') as l then {
doseQuant.low as lo -> l.value = (lo.value);
doseQuant.low as lo -> l.unit = (lo.unit);
} "low";
doseQuant -> d.high = create('SimpleQuantity') as h then {
doseQuant.high as hi -> h.value = (hi.value);
doseQuant.high as hi -> h.unit = (hi.unit);
} "low";
} "d";
} "dosageRate";
} "Dosage";
sa -> medicationRq.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
sa -> medicationRq.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";
sa -> medicationRq.status = 'active' "status";
sa -> medicationRq.intent = 'order' "intent";
sa.rateQuantity as rateQuantity -> medicationRq.dosageInstruction = create('Dosage') as dosageInstruction1 then {
rateQuantity.originalText as ot then {
ot.reference -> dosageInstruction1.text;
} "ot";
rateQuantity -> dosageInstruction1.doseAndRate as dosageRate then {
rateQuantity -> dosageRate.rate = create('Range') as d then {
rateQuantity -> d.low = create('SimpleQuantity') as l then {
rateQuantity.low as lo -> l.value = (lo.value);
rateQuantity.low as lo -> l.unit = (lo.unit);
} "low";
rateQuantity -> d.high = create('SimpleQuantity') as h then {
rateQuantity.high as hi -> h.value = (hi.value);
rateQuantity.high as hi -> h.unit = (hi.unit);
} "low";
} "d";
} "dosageRate";
} "Dosage";
sa -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Medication') as medication, medication.id = uuid() as uuid1, e1.fullUrl = append('https://example/Medication/', uuid1), request.url = 'Medication', medicationAdm.medication = create('Reference') as reference, reference.reference = ('https://example/Medication/' + %medication.id) then {
sa -> medicationRq.medication = create('Reference') as reference, reference.reference = ('https://example/Medication/' + %medication.id) "reference";
sa.administrationUnitCode -> medication.form;
sa.consumable as consumable then {
consumable.manufacturedProduct as manufac then {
manufac.manufacturedMaterial as manuprod then {
manuprod.code -> medication.code;
} "manufactproduct";
} "manufac";
};
sa.entryRelationship as entryRR then {
entryRR.observation as observation then {
observation.code where displayName = 'Grammatura' -> medication.ingredient as ingredient then {
sa.consumable as consumable then {
consumable.manufacturedProduct as manufacturedProduct then {
manufacturedProduct.manufacturedMaterial as manufacturedMaterial then {
manufacturedMaterial.code as code -> ingredient.item = create('CodeableConcept') as value then CECodeableConcept(code, value) "CE";
} "material";
} "product";
};
observation.value as value -> ingredient.strength as strength then {
value -> strength.numerator as numerator then {
value -> numerator.value = (value.value) "valueN";
} "numerator";
value -> strength.denominator as denominator then {
value -> denominator.value = 1 "valueD";
} "denominator";
} "strenght";
} "ingredient";
observation.code where displayName = 'Quantità nella Confezione' then {
observation.value as value -> medication.amount as amount then {
value -> amount.numerator as numerator then {
value -> numerator.value = (value.value) "valueN";
} "numerator";
value -> amount.denominator as denominator then {
value -> denominator.value = 1 "valueD";
} "denominator";
} "amount";
} "quantita";
} "obs";
} "entryRr";
} "medication";
sa.entryRelationship as entryRelationship then {
entryRelationship.supply as sup -> medicationRq.dispenseRequest as dispreq then {
sup -> dispreq.quantity = create('SimpleQuantity') as quantity then {
sup.quantity as q -> quantity.value = (q.value);
} "quantity";
} "sub";
} "entryR";
sa.participant as participant then {
participant.time as t -> medicationRq.authoredOn = (t.value);
participant.participantRole as participantR -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as practitioner then {
participantR -> practitioner.meta as meta then {
participantR -> meta.tag = create('Coding') as coding then {
participantR -> coding.system = 'http://algoritmodiscoring' "system";
participantR -> coding.code = 'ClinicalDocument/body/TerapiaFarmacologicaRicovero/participant' "code";
} "coding";
} "meta";
participantR.id as id -> practitioner.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;
id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;
id.root as r then {
id.extension as ext -> practitioner.id = (r + '-' + ext) as uuid2, e1.fullUrl = append('https://example/Practitioner/', uuid2), request.url = append('Practitioner/', uuid1), medicationRq.requester = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "aut";
} "r";
} "identifier";
participantR.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {
id.extension as ext -> request.url = append('Practitioner?identifier=', ext) "UUID";
} "2";
participantR.playingEntity as assi then {
assi.name -> practitioner.name;
} "assi";
} "perf";
sa.effectiveTime : EIVL as eff -> medicationRq.dosageInstruction = create('Dosage') as dosage then {
eff -> dosage.timing = create('Timing') as timing then {
eff -> timing.repeat as rep then {
eff.event as ev -> rep.where = (ev.code);
} "rep";
} "timing";
} "period";
sa.effectiveTime : TS as eff -> medicationRq.dosageInstruction = create('Dosage') as dosage, dosage.timing = create('Timing') as timing, timing.event = (eff.value) "tim";
sa.effectiveTime : PIVL_TS as eff -> medicationAdm.dosage = create('BackboneElement') as dosage then {
eff -> dosage.rate = create('Ratio') as ratio then {
eff -> ratio.numerator = create('Quantity') as quan then {
eff.period as per -> quan.value = (per.value);
eff.period as per -> quan.unit = (per.unit);
} "quanti";
eff -> ratio.denominator = create('Quantity') as quan then {
eff.period -> quan.value = '1';
eff.period as per -> quan.unit = (per.unit);
} "quanti";
} "ratio";
} "eff";
} "Medicationrequest";
} "sa";
} "entry";
} "sa";
}
group ClinicalDocumentSottoSectionOBS(source src : Section, target tgt, target bundle : Bundle, target enc : Encounter, target patient : Patient) {
src.title as t -> tgt.title = (t.dataString);
src.code -> tgt.code;
src.text as cdaText -> 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', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id), tgt.text as fhirText then {
cdaText -> fhirText.status = 'generated' "narrativeStatus";
cdaText as t -> fhirText.div = t "narrativeText";
src.code -> observation.code;
src -> observation.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
src -> observation.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";
src where observation.statusCode.exists().not() then {
src -> observation.status = 'final' "status";
} "statuscode";
cdaText -> observation.note as note then {
cdaText as t -> note.text = t "reference";
} "reference";
} "cdaText";
}
group ClinicalDocumentSottoSectionMS(source src : Section, target tgt, target bundle : Bundle, target patient : Patient, target enc : Encounter) {
src.title as t -> tgt.title = (t.dataString);
src.code -> tgt.code;
src.text as cdaText -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('MedicationStatement') as Medicationstatement, Medicationstatement.id = uuid() as uuid1, e1.fullUrl = append('https://example/MedicationStatement/', uuid1), request.url = 'MedicationStatement', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/MedicationStatement/' + %Medicationstatement.id), tgt.text as fhirText then {
cdaText -> Medicationstatement.note as note then {
cdaText as t -> note.text = t "reference";
cdaText as t -> Medicationstatement.medication = create('CodeableConcept') as medication, medication.text = t "text";
} "reference";
src -> Medicationstatement.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
src -> Medicationstatement.status = 'unknown' "status";
} "cdaText";
}
group Observation(source obs : Observation, target patient : Patient, target encounter : Encounter, target ob : Observation, target bundle : Bundle) {
obs -> ob.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
obs -> ob.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";
obs.code -> ob.code;
obs.statusCode as statusc where (code = 'completed') -> ob.status = 'final';
obs.statusCode as statusc where (code = 'active') -> ob.status = 'registered';
obs.statusCode as statusc where (code = 'aborted') -> ob.status = 'cancelled';
obs.statusCode as statusc where (code = 'suspended') -> ob.status = 'partial';
obs where obs.statusCode.exists().not() then {
obs -> ob.status = 'final' "status";
} "statuscode";
obs.effectiveTime as effectiveTime -> ob.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) "value2";
obs where effectiveTime.low.exists() or effectiveTime.high.exists() then {
obs.effectiveTime as eff -> ob.effective = create('Period') as period then IVLTSPeriod(eff, period) "value3";
} "where";
obs.value : INT as int -> ob.value = (int.value);
obs.value : BL as boolean -> ob.value = (boolean.value) "boolean";
obs.value : CD as val then {
val -> ob.value = create('CodeableConcept') as ce then {
val.originalText -> ce.text;
val -> ce.coding as coding then {
val.code as code -> coding.code = cast(code, 'string');
val.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
val.displayName as display -> coding.display = cast(display, 'string');
} "code";
val.translation as translation -> ce.coding as coding then {
translation.code as code -> coding.code = cast(code, 'string');
translation.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
translation.displayName as display -> coding.display = cast(display, 'string');
translation.qualifier as qualifier then {
qualifier.value as value -> ce.coding as coding then {
value.code as code -> coding.code = cast(code, 'string');
value.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
value.displayName as display -> coding.display = cast(display, 'string');
};
};
};
} "coding";
} "val";
obs.value : CE as val then {
val -> ob.value = create('CodeableConcept') as ce then {
val.originalText -> ce.text;
val -> ce.coding as coding then {
val.code as code -> coding.code = cast(code, 'string');
val.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
val.displayName as display -> coding.display = cast(display, 'string');
} "code";
val.translation as translation -> ce.coding as coding then {
translation.code as code -> coding.code = cast(code, 'string');
translation.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
translation.displayName as display -> coding.display = cast(display, 'string');
translation.qualifier as qualifier then {
qualifier.value as value -> ce.coding as coding then {
value.code as code -> coding.code = cast(code, 'string');
value.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
value.displayName as display -> coding.display = cast(display, 'string');
};
};
};
} "coding";
} "val";
obs.value : PQ as val then {
val -> ob.value = create('Quantity') as quantity then {
val.value as value -> quantity.value = value;
val.unit as unit -> quantity.unit = unit;
} "quantity";
} "valueQuantity";
obs.value : ST as value -> ob.value = create('string'), ob.value = (value.dataString);
obs.interpretationCode -> ob.interpretation;
obs.methodCode -> ob.method;
obs.referenceRange as refRange -> ob.referenceRange = create('BackboneElement') as ref then {
refRange.observationRange as obsRange -> ref.low = create('SimpleQuantity') as Low then {
obsRange.value : IVL_PQ as v then {
v.low as l1 then {
l1.value as decValue -> Low.value = decValue;
l1.unit as Unit -> Low.unit = Unit;
} "decValue";
} "IVLPQ";
} "obsRange";
} "refRange";
}
group ObservationConsulenza(source obs : Observation, target patient : Patient, target encounter : Encounter, target ob : Observation, target bundle : Bundle) {
obs -> ob.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
obs -> ob.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";
obs.code -> ob.code;
obs.statusCode as statusc where (code = 'completed') -> ob.status = 'final';
obs.statusCode as statusc where (code = 'active') -> ob.status = 'registered';
obs.statusCode as statusc where (code = 'aborted') -> ob.status = 'cancelled';
obs.statusCode as statusc where (code = 'suspended') -> ob.status = 'partial';
obs where obs.statusCode.exists().not() then {
obs -> ob.status = 'final' "status";
} "statuscode";
obs.effectiveTime as effectiveTime -> ob.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) "value2c";
obs where effectiveTime.low.exists() or effectiveTime.high.exists() then {
obs.effectiveTime as eff -> ob.effective = create('Period') as period then IVLTSPeriod(eff, period) "value3c";
} "where";
obs.value : INT as int -> ob.value = (int.value);
obs.value : BL as boolean -> ob.value = (boolean.value) "boolean";
obs.value : CE as val then {
val -> ob.value = create('CodeableConcept') as ce then {
val.originalText as originalText then {
originalText.reference as reference -> ce.text = reference;
} "originltext";
val -> ce.coding as coding then {
val.code as code -> coding.code = cast(code, 'string');
val.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
val.displayName as display -> coding.display = cast(display, 'string');
val.codeSystemVersion as version -> coding.version = cast(version, 'string');
} "code";
val.translation as translation -> ce.coding as coding then {
translation.code as code -> coding.code = cast(code, 'string');
translation.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
translation.displayName as display -> coding.display = cast(display, 'string');
translation.codeSystemVersion as version -> coding.version = cast(version, 'string');
translation.qualifier as qualifier then {
qualifier.value as value -> ce.coding as coding then {
value.code as code -> coding.code = cast(code, 'string');
value.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
value.displayName as display -> coding.display = cast(display, 'string');
value.codeSystemVersion as version -> coding.version = cast(version, 'string');
};
};
};
} "coding";
} "val";
obs.value : CD as val then {
val -> ob.value = create('CodeableConcept') as ce then {
val.originalText -> ce.text;
val -> ce.coding as coding then {
val.code as code -> coding.code = cast(code, 'string');
val.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
val.displayName as display -> coding.display = cast(display, 'string');
} "code";
val.translation as translation -> ce.coding as coding then {
translation.code as code -> coding.code = cast(code, 'string');
translation.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
translation.displayName as display -> coding.display = cast(display, 'string');
translation.qualifier as qualifier then {
qualifier.value as value -> ce.coding as coding then {
value.code as code -> coding.code = cast(code, 'string');
value.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
value.displayName as display -> coding.display = cast(display, 'string');
};
};
};
} "coding";
} "val";
obs.value : PQ as val then {
val -> ob.value = create('Quantity') as quantity then {
val.value as value -> quantity.value = value;
val.unit as unit -> quantity.unit = unit;
} "quantity";
} "valueQuantity";
obs.value : ST as value -> ob.value = create('string'), ob.value = (value.dataString);
obs -> ob.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
obs -> ob.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";
obs.interpretationCode -> ob.interpretation;
obs.methodCode -> ob.method;
obs.referenceRange as refRange -> ob.referenceRange = create('BackboneElement') as ref then {
refRange.observationRange as obsRange -> ref.low = create('SimpleQuantity') as Low then {
obsRange.value : IVL_PQ as v then {
v.low as l1 then {
l1.value as decValue -> Low.value = decValue;
l1.unit as Unit -> Low.unit = Unit;
} "decValue";
} "IVLPQ";
} "obsRange";
} "refRange";
obs.performer as performer -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid1 then {
performer.assignedEntity as assEntity then {
assEntity -> practitioner.meta as meta then {
assEntity -> meta.tag = create('Coding') as coding then {
assEntity -> coding.system = 'http://algoritmodiscoring' "system";
assEntity -> coding.code = 'ClinicalDocument/body/Consulenza/performer' "code";
} "coding";
} "meta";
assEntity.id as id -> practitioner.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;
id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;
id.root as r then {
id.extension as ext -> practitioner.id = (r + '-' + ext) as uuid2, e1.fullUrl = append('https://example/Practitioner/', uuid2), ob.performer = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "aut";
} "r";
} "identifier";
assEntity.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {
id.extension as ext -> request.url = append('Practitioner?identifier=', ext) "UUID";
} "2";
assEntity.assignedPerson as assi then {
assi.name -> practitioner.name;
} "assi";
} "assEntity";
} "perf";
obs.participant as participant -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('ServiceRequest') as serviceRequest, serviceRequest.id = uuid() as uuid1, e1.fullUrl = append('https://example/ServiceRequest/', uuid1), request.url = 'ServiceRequest', ob.basedOn = create('Reference') as reference, reference.reference = ('https://example/ServiceRequest/' + %serviceRequest.id) then {
participant.time as t -> serviceRequest.authoredOn = (t.value);
obs -> serviceRequest.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
obs -> serviceRequest.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";
obs -> serviceRequest.status = 'active' "status";
obs -> serviceRequest.intent = 'order' "intent";
participant.participantRole as participantRole -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as practitioner then {
participantRole -> practitioner.meta as meta then {
participantRole -> meta.tag = create('Coding') as coding then {
participantRole -> coding.system = 'http://algoritmodiscoring' "system";
participantRole -> coding.code = 'ClinicalDocument/body/Consulenza/participant' "code";
} "coding";
} "meta";
participantRole.id as id -> practitioner.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;
id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;
id.root as r then {
id.extension as ext -> practitioner.id = (r + '-' + ext) as uuid3, e1.fullUrl = append('https://example/Practitioner/', uuid3), serviceRequest.performer = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "aut";
} "r";
} "identifier";
participantRole.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {
id.extension as ext -> request.url = append('Practitioner?identifier=', ext) "UUID";
} "2";
participantRole.playingEntity as pe then {
pe.name -> practitioner.name;
} "pe";
};
};
}
group ObservationEsamiDuranteRicovero(source obs : Observation, target patient : Patient, target encounter : Encounter, target ob : Observation, target bundle : Bundle) {
obs -> ob.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
obs -> ob.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";
obs.code -> ob.code;
obs.statusCode as statusc where (code = 'completed') -> ob.status = 'final';
obs.statusCode as statusc where (code = 'active') -> ob.status = 'registered';
obs.statusCode as statusc where (code = 'aborted') -> ob.status = 'cancelled';
obs.statusCode as statusc where (code = 'suspended') -> ob.status = 'partial';
obs where obs.statusCode.exists().not() then {
obs -> ob.status = 'final' "status";
} "statuscode";
obs.effectiveTime as effectiveTime -> ob.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) "value2r";
obs where effectiveTime.low.exists() or effectiveTime.high.exists() then {
obs.effectiveTime as eff -> ob.effective = create('Period') as period then IVLTSPeriod(eff, period) "value3r";
} "where";
obs.value : INT as int -> ob.value = (int.value);
obs.value : BL as boolean -> ob.value = (boolean.value) "boolean";
obs.value : CE as val then {
val -> ob.value = create('CodeableConcept') as ce then {
val.originalText as originalText then {
originalText.reference as reference -> ce.text = reference;
} "originltext";
val -> ce.coding as coding then {
val.code as code -> coding.code = cast(code, 'string');
val.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
val.displayName as display -> coding.display = cast(display, 'string');
val.codeSystemVersion as version -> coding.version = cast(version, 'string');
} "code";
val.translation as translation -> ce.coding as coding then {
translation.code as code -> coding.code = cast(code, 'string');
translation.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
translation.displayName as display -> coding.display = cast(display, 'string');
translation.codeSystemVersion as version -> coding.version = cast(version, 'string');
translation.qualifier as qualifier then {
qualifier.value as value -> ce.coding as coding then {
value.code as code -> coding.code = cast(code, 'string');
value.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
value.displayName as display -> coding.display = cast(display, 'string');
value.codeSystemVersion as version -> coding.version = cast(version, 'string');
};
};
};
} "coding";
} "val";
obs.value : CD as val then {
val -> ob.value = create('CodeableConcept') as ce then {
val.originalText -> ce.text;
val -> ce.coding as coding then {
val.code as code -> coding.code = cast(code, 'string');
val.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
val.displayName as display -> coding.display = cast(display, 'string');
} "code";
val.translation as translation -> ce.coding as coding then {
translation.code as code -> coding.code = cast(code, 'string');
translation.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
translation.displayName as display -> coding.display = cast(display, 'string');
translation.qualifier as qualifier then {
qualifier.value as value -> ce.coding as coding then {
value.code as code -> coding.code = cast(code, 'string');
value.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
value.displayName as display -> coding.display = cast(display, 'string');
};
};
};
} "coding";
} "val";
obs.value : PQ as val then {
val -> ob.value = create('Quantity') as quantity then {
val.value as value -> quantity.value = value;
val.unit as unit -> quantity.unit = unit;
} "quantity";
} "valueQuantity";
obs.value : ST as value -> ob.value = create('string'), ob.value = (value.dataString);
obs -> ob.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
obs -> ob.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";
obs.interpretationCode -> ob.interpretation;
obs.methodCode -> ob.method;
obs.effectiveTime as eff -> ob.effective = create('Period') as per then IVLTSPeriod(eff, per);
obs.referenceRange as refRange -> ob.referenceRange = create('BackboneElement') as ref then {
refRange.observationRange as obsRange -> ref.low = create('SimpleQuantity') as Low then {
obsRange.value : IVL_PQ as v then {
v.low as l1 then {
l1.value as decValue -> Low.value = decValue;
l1.unit as Unit -> Low.unit = Unit;
} "decValue";
} "IVLPQ";
} "obsRange";
} "refRange";
obs.performer as performer -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid1 then {
performer.assignedEntity as assEntity then {
assEntity -> practitioner.meta as meta then {
assEntity -> meta.tag = create('Coding') as coding then {
assEntity -> coding.system = 'http://algoritmodiscoring' "system";
assEntity -> coding.code = 'ClinicalDocument/body/EsamiDuranteRicovero/performer' "code";
} "coding";
} "meta";
assEntity.id as id -> practitioner.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;
id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;
id.root as r then {
id.extension as ext -> practitioner.id = (r + '-' + ext) as uuid2, e1.fullUrl = append('https://example/Practitioner/', uuid2), ob.performer = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "aut";
} "r";
} "identifier";
assEntity.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {
id.extension as ext -> request.url = append('Practitioner?identifier=', ext) "UUID";
} "2";
assEntity.assignedPerson as assi then {
assi.name -> practitioner.name;
} "assi";
} "assEntity";
} "perf";
obs.participant as participant -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('ServiceRequest') as serviceRequest, serviceRequest.id = uuid() as uuid1, e1.fullUrl = append('https://example/ServiceRequest/', uuid1), request.url = 'ServiceRequest', ob.basedOn = create('Reference') as reference, reference.reference = ('https://example/ServiceRequest/' + %serviceRequest.id) then {
participant.time as t -> serviceRequest.authoredOn = (t.value);
obs -> serviceRequest.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
obs -> serviceRequest.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";
obs -> serviceRequest.status = 'active' "status";
obs -> serviceRequest.intent = 'order' "intent";
participant.participantRole as participantRole -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as practitioner then {
participantRole -> practitioner.meta as meta then {
participantRole -> meta.tag = create('Coding') as coding then {
participantRole -> coding.system = 'http://algoritmodiscoring' "system";
participantRole -> coding.code = 'ClinicalDocument/body/EsamiDuranteRicovero/participant' "code";
} "coding";
} "meta";
participantRole.id as id -> practitioner.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;
id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;
id.root as r then {
id.extension as ext -> practitioner.id = (r + '-' + ext) as uuid3, e1.fullUrl = append('https://example/Practitioner/', uuid3), serviceRequest.performer = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "aut";
} "r";
} "identifier";
participantRole.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {
id.extension as ext -> request.url = append('Practitioner?identifier=', ext) "UUID";
} "2";
participantRole.playingEntity as pe then {
pe.name -> practitioner.name;
} "pe";
};
};
}
group periodTiming(source effectiveTime : PIVL_TS, target timing : Timing) {
effectiveTime -> timing.repeat as r then {
effectiveTime.period as p -> r.period = (p.value);
effectiveTime.period as p -> r.periodUnit = (p.unit);
} "repeat";
}
// ---------------------------------------------------------------------------------------
group Act(source cda : Act, target pat : Patient, target ac : DiagnosticReport, target enc : Encounter, target bundle : Bundle) {
cda.code -> ac.code;
cda.statusCode as statusc where (code = 'completed') -> ob.status = 'final';
cda.statusCode as statusc where (code = 'active') -> ob.status = 'registered';
cda.statusCode as statusc where (code = 'aborted') -> ob.status = 'cancelled';
cda.statusCode as statusc where (code = 'suspended') -> ob.status = 'partial';
cda.effectiveTime as effectiveTime -> ac.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) "value2a";
obs where effectiveTime.low.exists() or effectiveTime.high.exists() then {
cda.effectiveTime as eff -> ac.effective = create('Period') as period then IVLTSPeriod(eff, period) "value3a";
} "where";
cda -> ac.subject = create('Reference') as reference, reference.reference = ('https://example/' + %pat.id) "reference";
cda -> ac.encounter = create('Reference') as reference, reference.reference = ('https://example/' + %enc.id) "reference";
cda.participant as part -> enc.participant as participant then {
part -> participant.type as type then {
part -> type.coding as coding then {
part -> coding.code = (part.typeCode) "codice";
part -> coding.system = 'http://terminology.hl7.org/CodeSystem/v3-ParticipationType' "system";
} "codeType";
} "type";
part.participantRole as participantRole -> participant.individual = create('Reference') as reference then {
participantRole -> bundle.entry as e, e.request = create('BackboneElement') as request, request.method = 'PUT', e.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid1, e.fullUrl = append('https://example/Practitioner/', uuid1), reference.reference = ('https://example/Practitioner/' + %practitioner.id) then {
participantRole -> practitioner.meta as meta then {
participantRole -> meta.tag = create('Coding') as coding then {
participantRole -> coding.system = 'http://algoritmodiscoring' "system";
participantRole -> coding.code = 'ClinicalDocument/body/Act/participant' "code";
} "coding";
} "meta";
participantRole.id as id -> practitioner.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 {
participantRole -> request.url = append('Practitioner?identifier=', ext) "UUID";
} "ext";
id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;
} "identifier";
participantRole.playingEntity as playingEntity then {
playingEntity.name -> practitioner.name;
};
} "participanRoleBund";
};
};
cda.entryRelationship as entryRelationship then {
entryRelationship.observation as observation -> bundle.entry as e, e.request = create('BackboneElement') as request, request.method = 'POST', e.resource = create('Observation') as obs, obs.id = uuid() as uuid2, e.fullUrl = append('https://example/Observation/', uuid2), request.url = append('Observation/', uuid2), ac.result = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %obs.id) then Observation(observation, pat, enc, obs, bundle) "OBS";
};
}
group ClinicalDocumentSectionTerapiaDimissione(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 where src.entry.exists() then {
src.text as cdaText -> tgt.text as fhirText then {
cdaText -> fhirText.status = 'generated' "narrativeStatus";
cdaText as t -> fhirText.div = t "narrativeText";
} "cdaText";
} "exist";
src where src.entry.exists().not() then {
src.text as cdaText -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('MedicationRequest') as medicationRq, medicationRq.id = uuid() as uuid1, e1.fullUrl = append('https://example/MedicationRequest/', uuid1), request.url = 'MedicationRequest', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/MedicationRequest/' + %medicationRq.id) then {
src -> medicationRq.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
src -> medicationRq.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";
src -> medicationRq.status = 'active' "status";
src -> medicationRq.intent = 'order' "intent";
cdaText -> medicationRq.medication = create('CodeableConcept') as codecon then {
cdaText -> codecon.text = 'string' "text";
} "code";
cdaText -> medicationRq.note as note then {
cdaText as t -> note.text = t "reference";
} "reference";
} "cdaText";
} "where";
src.entry as entry1 -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('MedicationRequest') as medicationRq, medicationRq.id = uuid() as uuid1, e1.fullUrl = append('https://example/MedicationRequest/', uuid1), request.url = 'MedicationRequest', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/MedicationRequest/' + %medicationRq.id) then {
src -> medicationRq.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
src -> medicationRq.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";
src -> medicationRq.status = 'active' "status";
src -> medicationRq.intent = 'order' "intent";
entry1.substanceAdministration as substract then {
substract.consumable as cons then {
cons.manufacturedProduct as man1 -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Medication') as medication, medication.id = uuid() as uuid1, e1.fullUrl = append('https://example/Medication/', uuid1), request.url = 'Medication', medicationRq.medication = create('Reference') as medref, medref.reference = ('https://example/Medication/' + %medication.id) then {
man1.manufacturedMaterial as mm then {
mm.code -> medication.code;
} "mm";
substract.administrationUnitCode -> medication.form;
substract.entryRelationship as entryR then {
entryR.observation as observation then {
observation.code where displayName = 'Grammatura' -> medication.ingredient as ingredient then {
substract.consumable as consumable then {
consumable.manufacturedProduct as manufacturedProduct then {
manufacturedProduct.manufacturedMaterial as manufacturedMaterial then {
manufacturedMaterial.code as code -> ingredient.item = create('CodeableConcept') as value then CECodeableConcept(code, value) "CE";
} "material";
} "product";
};
observation.value as value -> ingredient.strength as strength then {
value -> strength.numerator as numerator then {
value -> numerator.value = (value.value) "valueN";
} "numerator";
value -> strength.denominator as denominator then {
value -> denominator.value = 1 "valueD";
} "denominator";
} "strenght";
} "ingredient";
observation.code where displayName = 'Quantità nella Confezione' then {
observation.value as value -> medication.amount as amount then {
value -> amount.numerator as numerator then {
value -> numerator.value = (value.value) "valueN";
} "numerator";
value -> amount.denominator as denominator then {
value -> denominator.value = 1 "valueD";
} "denominator";
} "amount";
} "quantita";
} "obs";
} "entryR";
substract.entryRelationship as entryRelationship then {
entryRelationship.supply as sup -> medicationRq.dispenseRequest as dispreq then {
sup -> dispreq.quantity = create('SimpleQuantity') as quantity then {
sup.quantity as q -> quantity.value = (q.value);
} "quantity";
} "sub";
} "entry";
} "man1";
} "cons";
substract.text as tx -> medicationRq.note as note then {
tx.reference as ref -> note.text = (ref.value);
} "tx";
substract.statusCode as st -> medicationRq.status = (st.code);
substract.effectiveTime : IVL_TS as eff -> medicationRq.dosageInstruction = create('Dosage') as dosage then {
eff -> dosage.timing = create('Timing') as timing then {
eff -> timing.repeat as rep then {
eff -> rep.bounds = create('Period') as period then IVLTSPeriod(eff, period) "period";
} "rep";
} "timing";
} "period";
substract.effectiveTime : EIVL_TS as eff -> medicationRq.dosageInstruction = create('Dosage') as dosage then {
eff -> dosage.timing = create('Timing') as timing then {
eff -> timing.repeat as rep then {
eff.event as ev -> rep.when = (ev.code);
} "rep";
} "timing";
} "period";
substract.effectiveTime : IVL_TS as eff -> medicationRq.dosageInstruction = create('Dosage') as dosage, dosage.timing = create('Timing') as timing, timing.event = (eff.value) "tim";
substract.effectiveTime : PIVL_TS as eff -> medicationRq.dosageInstruction = create('Dosage') as dosage then {
eff -> dosage.timing = create('Timing') as timing then periodTiming(eff, timing) "cod";
} "eff";
substract -> medicationRq.dosageInstruction = create('Dosage') as dosage then {
substract.routeCode -> dosage.route;
} "dosage";
substract -> medicationRq.dosageInstruction = create('Dosage') as dosage then {
substract.approachSiteCode -> dosage.site;
} "dosage";
substract.doseQuantity as doseQuant -> medicationRq.dosageInstruction = create('Dosage') as dosageInstruction then {
doseQuant.originalText as ot then {
ot.reference -> dosageInstruction.text;
} "ot";
doseQuant -> dosageInstruction.doseAndRate as dosageRate then {
doseQuant -> dosageRate.dose = create('Range') as d then {
doseQuant -> d.low = create('SimpleQuantity') as l then {
doseQuant.low as lo -> l.value = (lo.value);
doseQuant.low as lo -> l.unit = (lo.unit);
} "low";
doseQuant -> d.high = create('SimpleQuantity') as h then {
doseQuant.high as hi -> h.value = (hi.value);
doseQuant.high as hi -> h.unit = (hi.unit);
} "low";
} "d";
} "dosageRate";
} "Dosage";
substract.rateQuantity as rateQuantity -> medicationRq.dosageInstruction = create('Dosage') as dosageInstruction1 then {
rateQuantity.originalText as ot then {
ot.reference -> dosageInstruction1.text;
} "ot";
rateQuantity -> dosageInstruction1.doseAndRate as dosageRate then {
rateQuantity -> dosageRate.rate = create('Range') as d then {
rateQuantity -> d.low = create('SimpleQuantity') as l then {
rateQuantity.low as lo -> l.value = (lo.value);
rateQuantity.low as lo -> l.unit = (lo.unit);
} "low";
rateQuantity -> d.high = create('SimpleQuantity') as h then {
rateQuantity.high as hi -> h.value = (hi.value);
rateQuantity.high as hi -> h.unit = (hi.unit);
} "low";
} "d";
} "dosageRate";
} "rateq";
substract.participant as part -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as practitioner then {
part.time as time -> medicationRq.authoredOn = (time.value);
part.participantRole as partRole then {
partRole -> practitioner.meta as meta then {
partRole -> meta.tag = create('Coding') as coding then {
partRole -> coding.system = 'http://algoritmodiscoring' "system";
partRole -> coding.code = 'ClinicalDocument/body/TerapiaFarmacologicaRicovero/participant' "code";
} "coding";
} "meta";
partRole.id as id -> practitioner.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;
id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;
id.root as r then {
id.extension as ext -> practitioner.id = (r + '-' + ext) as uuid2, e1.fullUrl = append('https://example/Practitioner/', uuid2), request.url = append('Practitioner/', uuid1), medicationRq.performer = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "aut";
} "r";
} "identifier";
partRole.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {
id.extension as ext -> request.url = append('Practitioner?identifier=', ext) "UUID";
} "2";
partRole.playingEntity as assi then {
assi.name -> practitioner.name;
} "assi";
} "perf";
} "partRole";
} "participant";
} "substract";
}
</pre>
</div>
</text>
<url value="http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirLdo"/>
<version value="0.1.0"/>
<name value="cda2fhirLdo"/>
<status value="draft"/>
<date value="2024-09-15T08:16:12+00: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>
<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="patient"/>
<source>
<context value="cda"/>
<element value="recordTarget"/>
<variable value="recordTarget"/>
</source>
<rule>
<name value="recPat"/>
<source>
<context value="recordTarget"/>
<element value="patientRole"/>
<variable value="patient"/>
</source>
<rule>
<name value="record"/>
<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="extension"/>
<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>
<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="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="motivoRicovero"/>
<source>
<context value="srcSection"/>
<element value="code"/>
<condition value="(code = '46241-6')"/>
</source>
<target>
<context value="composition"/>
<contextType value="variable"/>
<element value="section"/>
<variable value="tgtSection"/>
</target>
<dependent>
<name value="ClinicalDocumentSectionMotivoRicovero"/>
<variable value="cda"/>
<variable value="srcSection"/>
<variable value="patient"/>
<variable value="tgtSection"/>
<variable value="bundle"/>
<variable value="encounter"/>
</dependent>
</rule>
<rule>
<name value="inquadramentoClinico"/>
<source>
<context value="srcSection"/>
<element value="code"/>
<condition value="(code = '47039-3')"/>
</source>
<target>
<context value="composition"/>
<contextType value="variable"/>
<element value="section"/>
<variable value="tgtSection"/>
</target>
<dependent>
<name value="ClinicalDocumentSectionInquadramentoClinico"/>
<variable value="cda"/>
<variable value="srcSection"/>
<variable value="patient"/>
<variable value="tgtSection"/>
<variable value="bundle"/>
<variable value="encounter"/>
</dependent>
</rule>
<rule>
<name value="DecorsoOspedaliero"/>
<source>
<context value="srcSection"/>
<element value="code"/>
<condition value="(code = '8648-8')"/>
</source>
<target>
<context value="composition"/>
<contextType value="variable"/>
<element value="section"/>
<variable value="tgtSection"/>
</target>
<dependent>
<name value="ClinicalDocumentSectionDecorsoOspedaliero"/>
<variable value="cda"/>
<variable value="srcSection"/>
<variable value="patient"/>
<variable value="tgtSection"/>
<variable value="bundle"/>
<variable value="encounter"/>
</dependent>
</rule>
<rule>
<name value="Complicazioni"/>
<source>
<context value="srcSection"/>
<element value="code"/>
<condition value="(code = '55109-3')"/>
</source>
<target>
<context value="composition"/>
<contextType value="variable"/>
<element value="section"/>
<variable value="tgtSection"/>
</target>
<dependent>
<name value="ClinicalDocumentSectionComplicanze"/>
<variable value="cda"/>
<variable value="srcSection"/>
<variable value="patient"/>
<variable value="tgtSection"/>
<variable value="bundle"/>
<variable value="encounter"/>
</dependent>
</rule>
<rule>
<name value="HospitalDischargeStudiesSummary"/>
<source>
<context value="srcSection"/>
<element value="code"/>
<condition value="(code = '11493-4')"/>
</source>
<target>
<context value="composition"/>
<contextType value="variable"/>
<element value="section"/>
<variable value="tgtSection"/>
</target>
<dependent>
<name value="ClinicalDocumentSectionRiscontri"/>
<variable value="cda"/>
<variable value="srcSection"/>
<variable value="patient"/>
<variable value="tgtSection"/>
<variable value="bundle"/>
<variable value="encounter"/>
</dependent>
</rule>
<rule>
<name value="HospitalDischargeStudiesSummary"/>
<source>
<context value="srcSection"/>
<element value="code"/>
<condition value="(code = '34104-0')"/>
</source>
<target>
<context value="composition"/>
<contextType value="variable"/>
<element value="section"/>
<variable value="tgtSection"/>
</target>
<dependent>
<name value="ClinicalDocumentSectionConsulenza"/>
<variable value="cda"/>
<variable value="srcSection"/>
<variable value="patient"/>
<variable value="tgtSection"/>
<variable value="bundle"/>
<variable value="encounter"/>
</dependent>
</rule>
<rule>
<name value="EsamiEseguitiDuranteilRicovero"/>
<source>
<context value="srcSection"/>
<element value="code"/>
<condition value="(code = '30954-2')"/>
</source>
<target>
<context value="composition"/>
<contextType value="variable"/>
<element value="section"/>
<variable value="tgtSection"/>
</target>
<dependent>
<name value="ClinicalDocumentSectionEsamiEseguitiRicovero"/>
<variable value="cda"/>
<variable value="srcSection"/>
<variable value="patient"/>
<variable value="tgtSection"/>
<variable value="bundle"/>
<variable value="encounter"/>
</dependent>
</rule>
<rule>
<name value="HistoryOfProceduresDocument"/>
<source>
<context value="srcSection"/>
<element value="code"/>
<condition value="(code = '47519-4')"/>
</source>
<target>
<context value="composition"/>
<contextType value="variable"/>
<element value="section"/>
<variable value="tgtSection"/>
</target>
<dependent>
<name
value="ClinicalDocumentSectionProcedureEseguiteRicovero"/>
<variable value="cda"/>
<variable value="srcSection"/>
<variable value="patient"/>
<variable value="tgtSection"/>
<variable value="bundle"/>
<variable value="encounter"/>
</dependent>
</rule>
<rule>
<name value="EsamiEseguitiDuranteIlRicovero"/>
<source>
<context value="srcSection"/>
<element value="code"/>
<condition value="(code = '48765-2')"/>
</source>
<target>
<context value="composition"/>
<contextType value="variable"/>
<element value="section"/>
<variable value="tgtSection"/>
</target>
<dependent>
<name value="ClinicalDocumentSectionAllergie"/>
<variable value="cda"/>
<variable value="srcSection"/>
<variable value="patient"/>
<variable value="tgtSection"/>
<variable value="bundle"/>
<variable value="encounter"/>
</dependent>
</rule>
<rule>
<name value="TerapiaFarmacologicaAllaDimissione"/>
<source>
<context value="srcSection"/>
<element value="code"/>
<condition value="(code = '10160-0')"/>
</source>
<target>
<context value="composition"/>
<contextType value="variable"/>
<element value="section"/>
<variable value="tgtSection"/>
</target>
<dependent>
<name
value="ClinicalDocumentSectionTerapiaFarmacologicaDuranteRicovero"/>
<variable value="cda"/>
<variable value="srcSection"/>
<variable value="patient"/>
<variable value="tgtSection"/>
<variable value="bundle"/>
<variable value="encounter"/>
</dependent>
</rule>
<rule>
<name value="DiagnosiDiDimissione"/>
<source>
<context value="srcSection"/>
<element value="code"/>
<condition value="(code = '11535-2')"/>
</source>
<target>
<context value="composition"/>
<contextType value="variable"/>
<element value="section"/>
<variable value="tgtSection"/>
</target>
<dependent>
<name value="ClinicalDocumentSectionDiagnosiDimissione"/>
<variable value="cda"/>
<variable value="srcSection"/>
<variable value="patient"/>
<variable value="tgtSection"/>
<variable value="bundle"/>
<variable value="encounter"/>
</dependent>
</rule>
<rule>
<name value="DiagnosiDiDimissione"/>
<source>
<context value="srcSection"/>
<element value="code"/>
<condition value="(code = '18776-5')"/>
</source>
<target>
<context value="composition"/>
<contextType value="variable"/>
<element value="section"/>
<variable value="tgtSection"/>
</target>
<dependent>
<name value="ClinicalDocumentSectionIstruzioniFollowUp"/>
<variable value="cda"/>
<variable value="srcSection"/>
<variable value="patient"/>
<variable value="tgtSection"/>
<variable value="bundle"/>
<variable value="encounter"/>
</dependent>
</rule>
<rule>
<name value="TerapiaFarmacologicaAllaDimissione"/>
<source>
<context value="srcSection"/>
<element value="code"/>
<condition value="(code = '10183-2')"/>
</source>
<target>
<context value="composition"/>
<contextType value="variable"/>
<element value="section"/>
<variable value="tgtSection"/>
</target>
<dependent>
<name value="ClinicalDocumentSectionTerapiaDimissione"/>
<variable value="cda"/>
<variable value="srcSection"/>
<variable value="patient"/>
<variable value="tgtSection"/>
<variable value="bundle"/>
<variable value="encounter"/>
</dependent>
</rule>
<documentation value="discretizzi il primo livello di component"/>
</rule>
</rule>
</rule>
</rule>
</group>
<group>
<name value="ClinicalDocumentSectionMotivoRicovero"/>
<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="cText"/>
<source>
<context value="src"/>
<condition value="src.entry.exists()"/>
</source>
<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>
<rule>
<name value="entry"/>
<source>
<context value="src"/>
<element value="entry"/>
<variable value="entry1"/>
</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="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/Observation/' + %observation.id"/>
</parameter>
</target>
<rule>
<name value="act"/>
<source>
<context value="entry1"/>
<element value="observation"/>
<variable value="obs"/>
</source>
<dependent>
<name value="Observation"/>
<variable value="obs"/>
<variable value="patient"/>
<variable value="enc"/>
<variable value="observation"/>
<variable value="bundle"/>
</dependent>
</rule>
</rule>
<rule>
<name value="where"/>
<source>
<context value="src"/>
<condition value="src.entry.exists().not()"/>
</source>
<rule>
<name value="cdaText"/>
<source>
<context value="src"/>
<element value="text"/>
<variable value="cdaText"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e8"/>
</target>
<target>
<context value="e8"/>
<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="e8"/>
<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="uuid8"/>
<transform value="uuid"/>
</target>
<target>
<context value="e8"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="https://example/Observation/"/>
</parameter>
<parameter>
<valueId value="uuid8"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="Observation"/>
</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/Observation/' + %Observation.id"/>
</parameter>
</target>
<rule>
<name value="reference"/>
<source>
<context value="src"/>
</source>
<target>
<context value="Observation"/>
<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="src"/>
</source>
<target>
<context value="Observation"/>
<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="code"/>
<source>
<context value="src"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="Observation"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="statuscode"/>
<source>
<context value="src"/>
<condition value="observation.statusCode.exists().not()"/>
</source>
<rule>
<name value="status"/>
<source>
<context value="src"/>
</source>
<target>
<context value="Observation"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
</source>
<target>
<context value="Observation"/>
<contextType value="variable"/>
<element value="note"/>
<variable value="note"/>
</target>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
<variable value="t"/>
</source>
<target>
<context value="note"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="t"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</group>
<group>
<name value="ClinicalDocumentSectionInquadramentoClinico"/>
<typeMode value="none"/>
<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="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="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/Observation/' + %observation.id"/>
</parameter>
</target>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="text"/>
<variable value="fhirText"/>
</target>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
</source>
<target>
<context value="observation"/>
<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="cdaText"/>
</source>
<target>
<context value="observation"/>
<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="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>
<name value="code"/>
<source>
<context value="src"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="statuscode"/>
<source>
<context value="src"/>
<condition value="observation.statusCode.exists().not()"/>
</source>
<rule>
<name value="status"/>
<source>
<context value="src"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="note"/>
<variable value="note"/>
</target>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
<variable value="t"/>
</source>
<target>
<context value="note"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="t"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="component"/>
<source>
<context value="src"/>
<element value="component"/>
<variable value="component"/>
</source>
<rule>
<name value="componentSec"/>
<source>
<context value="component"/>
<element value="section"/>
<variable value="section2"/>
</source>
<rule>
<name value="sec2fhir"/>
<source>
<context value="section2"/>
</source>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="section"/>
<variable value="sec2"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="section2"/>
<element value="code"/>
<variable value="vvv"/>
<condition value="(code = '11329-0')"/>
</source>
<target>
<context value="sec2"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="title"/>
<source>
<context value="section2"/>
<element value="title"/>
<variable value="t"/>
</source>
<target>
<context value="sec2"/>
<contextType value="variable"/>
<element value="title"/>
<transform value="evaluate"/>
<parameter>
<valueString value="t.dataString"/>
</parameter>
</target>
</rule>
<rule>
<name value="exist"/>
<source>
<context value="src"/>
<condition value="src.entry.exists()"/>
</source>
<rule>
<name value="cdaText"/>
<source>
<context value="section2"/>
<element value="text"/>
<variable value="cdaText"/>
</source>
<target>
<context value="sec2"/>
<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>
<documentation value="section2.code -> sec2.code;"/>
</rule>
<rule>
<name value="where"/>
<source>
<context value="src"/>
<condition value="src.entry.exists().not()"/>
</source>
<rule>
<name value="cdaText"/>
<source>
<context value="section2"/>
<element value="text"/>
<variable value="cdaText"/>
</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="condition"/>
<transform value="create"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
<target>
<context value="condition"/>
<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="sec2"/>
<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/Observation/' + %condition.id"/>
</parameter>
</target>
<rule>
<name value="code"/>
<source>
<context value="section2"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="statuscode"/>
<source>
<context value="src"/>
<condition value="condition.statusCode.exists().not()"/>
</source>
<rule>
<name value="status"/>
<source>
<context value="src"/>
</source>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
</source>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="note"/>
<variable value="note"/>
</target>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
</source>
<target>
<context value="condition"/>
<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="cdaText"/>
</source>
<target>
<context value="condition"/>
<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="reference"/>
<source>
<context value="cdaText"/>
<variable value="t"/>
</source>
<target>
<context value="note"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="t"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="subsection1"/>
<source>
<context value="section2"/>
<element value="entry"/>
<variable value="entry1"/>
</source>
<rule>
<name value="entry"/>
<source>
<context value="entry1"/>
<element value="observation"/>
<variable value="obs"/>
</source>
<rule>
<name value="observationcondition"/>
<source>
<context value="obs"/>
<element value="code"/>
<condition value="(code = '75326-9')"/>
</source>
<rule>
<name value="whereEntryPatologicaProssima"/>
<source>
<context value="obs"/>
</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="condition"/>
<transform value="create"/>
<parameter>
<valueString value="Condition"/>
</parameter>
</target>
<target>
<context value="condition"/>
<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/Condition/"/>
</parameter>
<parameter>
<valueId value="uuid1"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="Condition"/>
</parameter>
</target>
<target>
<context value="sec2"/>
<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/Condition/' + %condition.id"/>
</parameter>
</target>
<rule>
<name value="code"/>
<source>
<context value="obs"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="category"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="obs"/>
</source>
<target>
<context value="condition"/>
<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="obs"/>
</source>
<target>
<context value="condition"/>
<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="status"/>
<source>
<context value="obs"/>
<element value="statusCode"/>
<variable value="status"/>
<condition value="(code = 'completed')"/>
</source>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="verificationStatus"/>
<variable value="status2"/>
</target>
<rule>
<name value="st3"/>
<source>
<context value="status"/>
</source>
<target>
<context value="status2"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="status3"/>
</target>
<rule>
<name value="finald"/>
<source>
<context value="status"/>
</source>
<target>
<context value="status3"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="confirmed"/>
</parameter>
</target>
</rule>
<rule>
<name value="system"/>
<source>
<context value="status"/>
</source>
<target>
<context value="status3"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/condition-ver-status"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="effectivetime1"/>
<source>
<context value="obs"/>
<element value="effectiveTime"/>
<variable value="effective1"/>
</source>
<rule>
<name value="ef"/>
<source>
<context value="effective1"/>
<condition
value="effective1.low.exists() or effective1.high.exists()"/>
</source>
<rule>
<name value="onsetperiod"/>
<source>
<context value="effective1"/>
</source>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="onset"/>
<variable value="periodonset"/>
<transform value="create"/>
<parameter>
<valueString value="Period"/>
</parameter>
</target>
<dependent>
<name value="IVLTSPeriod"/>
<variable value="effective1"/>
<variable value="periodonset"/>
</dependent>
</rule>
</rule>
</rule>
<rule>
<name value="Value"/>
<source>
<context value="obs"/>
<type value="CD"/>
<element value="value"/>
<variable value="val"/>
</source>
<rule>
<name value="Ce"/>
<source>
<context value="val"/>
</source>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="ce"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<rule>
<name value="originalText"/>
<source>
<context value="val"/>
<element value="originalText"/>
<variable value="vvv"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="text"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="coding"/>
<source>
<context value="val"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="val"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="cast"/>
<parameter>
<valueId value="code"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystem"/>
<source>
<context value="val"/>
<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>
<name value="displayName"/>
<source>
<context value="val"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="EntryRelationship1"/>
<source>
<context value="obs"/>
<element value="entryRelationship"/>
<variable value="entriRel"/>
</source>
<rule>
<name value="evidence"/>
<source>
<context value="entriRel"/>
</source>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="evidence"/>
<variable value="evidence"/>
<transform value="create"/>
<parameter>
<valueString value="BackboneElement"/>
</parameter>
</target>
<rule>
<name value="Observation2"/>
<source>
<context value="entriRel"/>
<element value="observation"/>
<variable value="observation2"/>
</source>
<rule>
<name value="code"/>
<source>
<context value="observation2"/>
<element value="code"/>
<variable value="code"/>
</source>
<rule>
<name value="whereDecorsoClinico"/>
<source>
<context value="code"/>
<element value="code"/>
<condition value="(code.code = '89261-2')"/>
</source>
<rule>
<name value="obser"/>
<source>
<context value="obs"/>
</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>
<rule>
<name value="ref"/>
<source>
<context value="entriRel"/>
</source>
<target>
<context value="evidence"/>
<contextType value="variable"/>
<element value="detail"/>
<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>
<rule>
<name value="code"/>
<source>
<context value="observation2"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="statuscode"/>
<source>
<context value="observation2"/>
<condition
value="observation.statusCode.exists().not()"/>
</source>
<rule>
<name value="status"/>
<source>
<context value="observation2"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="Annontation"/>
<source>
<context value="observation2"/>
<element value="text"/>
<variable value="text"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="note"/>
<variable value="note"/>
<transform value="create"/>
<parameter>
<valueString value="Annotation"/>
</parameter>
</target>
<rule>
<name value="val"/>
<source>
<context value="text"/>
<element value="reference"/>
<variable value="ref"/>
</source>
<target>
<context value="note"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="evaluate"/>
<parameter>
<valueString value="ref.value"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="obs"/>
</source>
<target>
<context value="observation"/>
<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="obs"/>
</source>
<target>
<context value="observation"/>
<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="statusCode"/>
<source>
<context value="observation2"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'completed')"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="observation2"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'active')"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="registered"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="observation2"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'aborted')"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="cancelled"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="observation2"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'suspended')"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="partial"/>
</parameter>
</target>
</rule>
<rule>
<name value="value"/>
<source>
<context value="observation2"/>
<type value="INT"/>
<element value="value"/>
<variable value="int"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="int.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="boolean"/>
<source>
<context value="observation2"/>
<type value="BL"/>
<element value="value"/>
<variable value="boolean"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="boolean.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="val"/>
<source>
<context value="observation2"/>
<type value="CD"/>
<element value="value"/>
<variable value="val"/>
</source>
<rule>
<name value="coding"/>
<source>
<context value="val"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="ce"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<rule>
<name value="originltext"/>
<source>
<context value="val"/>
<element value="originalText"/>
<variable value="originalText"/>
</source>
<rule>
<name value="reference"/>
<source>
<context value="originalText"/>
<element value="reference"/>
<variable value="reference"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="reference"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="code"/>
<source>
<context value="val"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="val"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="cast"/>
<parameter>
<valueId value="code"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystem"/>
<source>
<context value="val"/>
<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>
<name value="displayName"/>
<source>
<context value="val"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystemVersion"/>
<source>
<context value="val"/>
<element value="codeSystemVersion"/>
<variable value="version"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="version"/>
<transform value="cast"/>
<parameter>
<valueId value="version"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="translation"/>
<source>
<context value="val"/>
<element value="translation"/>
<variable value="translation"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="translation"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="cast"/>
<parameter>
<valueId value="code"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystem"/>
<source>
<context value="translation"/>
<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>
<name value="displayName"/>
<source>
<context value="translation"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystemVersion"/>
<source>
<context value="translation"/>
<element value="codeSystemVersion"/>
<variable value="version"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="version"/>
<transform value="cast"/>
<parameter>
<valueId value="version"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="qualifier"/>
<source>
<context value="translation"/>
<element value="qualifier"/>
<variable value="qualifier"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="qualifier"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="value"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="cast"/>
<parameter>
<valueId value="code"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystem"/>
<source>
<context value="value"/>
<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>
<name value="displayName"/>
<source>
<context value="value"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystemVersion"/>
<source>
<context value="value"/>
<element
value="codeSystemVersion"/>
<variable value="version"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="version"/>
<transform value="cast"/>
<parameter>
<valueId value="version"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="valueQuantity"/>
<source>
<context value="observation2"/>
<type value="PQ"/>
<element value="value"/>
<variable value="val"/>
</source>
<rule>
<name value="quantity"/>
<source>
<context value="val"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="quantity"/>
<transform value="create"/>
<parameter>
<valueString value="Quantity"/>
</parameter>
</target>
<rule>
<name value="value"/>
<source>
<context value="val"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="quantity"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
</rule>
<rule>
<name value="unit"/>
<source>
<context value="val"/>
<element value="unit"/>
<variable value="unit"/>
</source>
<target>
<context value="quantity"/>
<contextType value="variable"/>
<element value="unit"/>
<transform value="copy"/>
<parameter>
<valueId value="unit"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="observation2"/>
<type value="ST"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="create"/>
<parameter>
<valueString value="string"/>
</parameter>
</target>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="value.dataString"/>
</parameter>
</target>
</rule>
<rule>
<name value="Value"/>
<source>
<context value="observation2"/>
<type value="CE"/>
<element value="value"/>
<variable value="val"/>
</source>
<rule>
<name value="Ce"/>
<source>
<context value="val"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="ce"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<rule>
<name value="originalText"/>
<source>
<context value="val"/>
<element value="originalText"/>
<variable value="vvv"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="text"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="coding"/>
<source>
<context value="val"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="val"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="cast"/>
<parameter>
<valueId value="code"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystem"/>
<source>
<context value="val"/>
<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>
<name value="displayName"/>
<source>
<context value="val"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="entryrelationshipstatus"/>
<source>
<context value="obs"/>
<element value="entryRelationship"/>
<variable value="entriRel"/>
</source>
<rule>
<name value="observationstatus"/>
<source>
<context value="entriRel"/>
<element value="observation"/>
<variable value="observation2"/>
</source>
<rule>
<name value="codestatus"/>
<source>
<context value="observation2"/>
<element value="code"/>
<variable value="code"/>
</source>
<rule>
<name value="whereDecorsoClinico"/>
<source>
<context value="code"/>
<element value="code"/>
<condition value="(code.code = '33999-4')"/>
</source>
<rule>
<name value="code"/>
<source>
<context value="observation2"/>
</source>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="clinicalStatus"/>
<variable value="status"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<rule>
<name value="textstat"/>
<source>
<context value="observation2"/>
<element value="text"/>
<variable value="text"/>
</source>
<rule>
<name value="statref"/>
<source>
<context value="text"/>
<element value="reference"/>
<variable value="refstat"/>
</source>
<target>
<context value="status"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="evaluate"/>
<parameter>
<valueString value="refstat.value"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="coding"/>
<source>
<context value="observation2"/>
</source>
<target>
<context value="status"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<rule>
<name value="value1"/>
<source>
<context value="observation2"/>
<element value="value"/>
<variable value="value"/>
</source>
<rule>
<name value="active"/>
<source>
<context value="value"/>
<element value="code"/>
<condition
value="(value.code = 'LA16666-2')"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="active"/>
</parameter>
</target>
</rule>
<rule>
<name value="inactive"/>
<source>
<context value="value"/>
<element value="code"/>
<condition
value="(value.code = 'LA18632-2')"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="inactive"/>
</parameter>
</target>
</rule>
<rule>
<name value="system"/>
<source>
<context value="value"/>
<element value="codeSystem"/>
<variable value="system"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/condition-clinical"/>
</parameter>
</target>
</rule>
<rule>
<name value="displayName"/>
<source>
<context value="value"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
<documentation value="EntryRelationship per il Problem"/>
</rule>
</rule>
</rule>
<rule>
<name value="esameObiettivo"/>
<source>
<context value="section2"/>
<element value="code"/>
<condition value="(code = '29545-1')"/>
</source>
<dependent>
<name value="ClinicalDocumentSottoSectionOBS"/>
<variable value="section2"/>
<variable value="sec2"/>
<variable value="bundle"/>
<variable value="enc"/>
<variable value="patient"/>
</dependent>
<documentation value="ESAME PBIETTIVO"/>
</rule>
<rule>
<name value="TerapiaFarmacologicaAllIngresso"/>
<source>
<context value="section2"/>
<element value="code"/>
<condition value="(code = '42346-7')"/>
</source>
<dependent>
<name value="ClinicalDocumentSottoSectionMS"/>
<variable value="section2"/>
<variable value="sec2"/>
<variable value="bundle"/>
<variable value="patient"/>
<variable value="enc"/>
</dependent>
<documentation value="TETAPIA FARMACOLOGICA"/>
</rule>
<documentation value="ANAMNESI"/>
</rule>
</rule>
</rule>
</group>
<group>
<name value="ClinicalDocumentSectionDecorsoOspedaliero"/>
<typeMode value="none"/>
<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="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="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/Observation/' + %observation.id"/>
</parameter>
</target>
<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>
<name value="code"/>
<source>
<context value="src"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="statuscode"/>
<source>
<context value="src"/>
<condition value="observation.statusCode.exists().not()"/>
</source>
<rule>
<name value="status"/>
<source>
<context value="src"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="src"/>
</source>
<target>
<context value="observation"/>
<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="src"/>
</source>
<target>
<context value="observation"/>
<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="reference"/>
<source>
<context value="cdaText"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="note"/>
<variable value="note"/>
</target>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
<variable value="t"/>
</source>
<target>
<context value="note"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="t"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="2"/>
<source>
<context value="src"/>
<element value="component"/>
<variable value="component"/>
</source>
<rule>
<name value="1"/>
<source>
<context value="component"/>
<element value="section"/>
<variable value="section2"/>
</source>
<rule>
<name value="Decorso"/>
<source>
<context value="src"/>
</source>
<dependent>
<name value="ClinicalDocumentSottoSectionOBS"/>
<variable value="section2"/>
<variable value="tgt"/>
<variable value="bundle"/>
<variable value="enc"/>
<variable value="patient"/>
</dependent>
</rule>
</rule>
</rule>
</group>
<group>
<name value="ClinicalDocumentSectionComplicanze"/>
<typeMode value="none"/>
<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="exist"/>
<source>
<context value="src"/>
<condition value="src.entry.exists()"/>
</source>
<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>
<rule>
<name value="where"/>
<source>
<context value="src"/>
<condition value="src.entry.exists().not()"/>
</source>
<rule>
<name value="cdaText"/>
<source>
<context value="src"/>
<element value="text"/>
<variable value="cdaText"/>
</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="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/Observation/' + %observation.id"/>
</parameter>
</target>
<rule>
<name value="reference"/>
<source>
<context value="src"/>
</source>
<target>
<context value="observation"/>
<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="src"/>
</source>
<target>
<context value="observation"/>
<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="code"/>
<source>
<context value="src"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="statuscode"/>
<source>
<context value="src"/>
<condition value="observation.statusCode.exists().not()"/>
</source>
<rule>
<name value="status"/>
<source>
<context value="src"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="note"/>
<variable value="note"/>
</target>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
<variable value="t"/>
</source>
<target>
<context value="note"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="t"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="entry"/>
<source>
<context value="src"/>
<element value="entry"/>
<variable value="entry1"/>
</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="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/Observation/' + %observation.id"/>
</parameter>
</target>
<rule>
<name value="act"/>
<source>
<context value="entry1"/>
<element value="observation"/>
<variable value="obs"/>
</source>
<dependent>
<name value="Observation"/>
<variable value="obs"/>
<variable value="patient"/>
<variable value="enc"/>
<variable value="observation"/>
<variable value="bundle"/>
</dependent>
</rule>
</rule>
</group>
<group>
<name value="ClinicalDocumentSectionRiscontri"/>
<typeMode value="none"/>
<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="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="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/Observation/' + %observation.id"/>
</parameter>
</target>
<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>
<name value="code"/>
<source>
<context value="src"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="statuscode"/>
<source>
<context value="src"/>
<condition value="observation.statusCode.exists().not()"/>
</source>
<rule>
<name value="status"/>
<source>
<context value="src"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="src"/>
</source>
<target>
<context value="observation"/>
<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="src"/>
</source>
<target>
<context value="observation"/>
<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="reference"/>
<source>
<context value="cdaText"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="note"/>
<variable value="note"/>
</target>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
<variable value="t"/>
</source>
<target>
<context value="note"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="t"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="2"/>
<source>
<context value="src"/>
<element value="component"/>
<variable value="component"/>
</source>
<rule>
<name value="1"/>
<source>
<context value="component"/>
<element value="section"/>
<variable value="section2"/>
</source>
<rule>
<name value="Decorso"/>
<source>
<context value="src"/>
</source>
<dependent>
<name value="ClinicalDocumentSottoSectionOBS"/>
<variable value="section2"/>
<variable value="tgt"/>
<variable value="bundle"/>
<variable value="enc"/>
<variable value="patient"/>
</dependent>
</rule>
</rule>
</rule>
</group>
<group>
<name value="ClinicalDocumentSectionConsulenza"/>
<typeMode value="none"/>
<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="exist"/>
<source>
<context value="src"/>
<condition value="src.entry.exists()"/>
</source>
<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>
<rule>
<name value="where"/>
<source>
<context value="src"/>
<condition value="src.entry.exists().not()"/>
</source>
<rule>
<name value="cdaText"/>
<source>
<context value="src"/>
<element value="text"/>
<variable value="cdaText"/>
</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="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/Observation/' + %observation.id"/>
</parameter>
</target>
<rule>
<name value="reference"/>
<source>
<context value="src"/>
</source>
<target>
<context value="observation"/>
<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="src"/>
</source>
<target>
<context value="observation"/>
<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="code"/>
<source>
<context value="src"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="statuscode"/>
<source>
<context value="src"/>
<condition value="observation.statusCode.exists().not()"/>
</source>
<rule>
<name value="status"/>
<source>
<context value="src"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="note"/>
<variable value="note"/>
</target>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
<variable value="t"/>
</source>
<target>
<context value="note"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="t"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="entry"/>
<source>
<context value="src"/>
<element value="entry"/>
<variable value="entry1"/>
</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="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/Observation/' + %observation.id"/>
</parameter>
</target>
<rule>
<name value="act"/>
<source>
<context value="entry1"/>
<element value="observation"/>
<variable value="obs"/>
</source>
<dependent>
<name value="ObservationConsulenza"/>
<variable value="obs"/>
<variable value="patient"/>
<variable value="enc"/>
<variable value="observation"/>
<variable value="bundle"/>
</dependent>
</rule>
</rule>
</group>
<group>
<name value="ClinicalDocumentSectionEsamiEseguitiRicovero"/>
<typeMode value="none"/>
<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="exists"/>
<source>
<context value="src"/>
<condition value="src.entry.exists()"/>
</source>
<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>
<rule>
<name value="where"/>
<source>
<context value="src"/>
<condition value="src.entry.exists().not()"/>
</source>
<rule>
<name value="cdaText"/>
<source>
<context value="src"/>
<element value="text"/>
<variable value="cdaText"/>
</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="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/Observation/' + %observation.id"/>
</parameter>
</target>
<rule>
<name value="reference"/>
<source>
<context value="src"/>
</source>
<target>
<context value="observation"/>
<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="src"/>
</source>
<target>
<context value="observation"/>
<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="code"/>
<source>
<context value="src"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="statuscode"/>
<source>
<context value="src"/>
<condition value="observation.statusCode.exists().not()"/>
</source>
<rule>
<name value="status"/>
<source>
<context value="src"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="note"/>
<variable value="note"/>
</target>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
<variable value="t"/>
</source>
<target>
<context value="note"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="t"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="entry"/>
<source>
<context value="src"/>
<element value="entry"/>
<variable value="entry1"/>
</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="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/Observation/' + %observation.id"/>
</parameter>
</target>
<rule>
<name value="act"/>
<source>
<context value="entry1"/>
<element value="observation"/>
<variable value="obs"/>
</source>
<dependent>
<name value="ObservationEsamiDuranteRicovero"/>
<variable value="obs"/>
<variable value="patient"/>
<variable value="enc"/>
<variable value="observation"/>
<variable value="bundle"/>
</dependent>
</rule>
</rule>
</group>
<group>
<name value="ClinicalDocumentSectionProcedureEseguiteRicovero"/>
<typeMode value="none"/>
<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="exists"/>
<source>
<context value="src"/>
<condition value="src.entry.exists()"/>
</source>
<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>
<rule>
<name value="where"/>
<source>
<context value="src"/>
<condition value="src.entry.exists().not()"/>
</source>
<rule>
<name value="cdaText"/>
<source>
<context value="src"/>
<element value="text"/>
<variable value="cdaText"/>
</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="procedure"/>
<transform value="create"/>
<parameter>
<valueString value="Procedure"/>
</parameter>
</target>
<target>
<context value="procedure"/>
<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/Procedure/"/>
</parameter>
<parameter>
<valueId value="uuid1"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="Procedure"/>
</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/Procedure/' + %procedure.id"/>
</parameter>
</target>
<rule>
<name value="reference"/>
<source>
<context value="src"/>
</source>
<target>
<context value="procedure"/>
<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="src"/>
</source>
<target>
<context value="procedure"/>
<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="statuscode"/>
<source>
<context value="src"/>
</source>
<target>
<context value="procedure"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="unknown"/>
</parameter>
</target>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
</source>
<target>
<context value="procedure"/>
<contextType value="variable"/>
<element value="note"/>
<variable value="note"/>
</target>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
<variable value="t"/>
</source>
<target>
<context value="note"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="t"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="Entry"/>
<source>
<context value="src"/>
<element value="entry"/>
<variable value="entry1"/>
</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="procedure"/>
<transform value="create"/>
<parameter>
<valueString value="Procedure"/>
</parameter>
</target>
<target>
<context value="procedure"/>
<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/Procedure/"/>
</parameter>
<parameter>
<valueId value="uuid1"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="Procedure"/>
</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/Procedure/' + %procedure.id"/>
</parameter>
</target>
<rule>
<name value="reference"/>
<source>
<context value="src"/>
</source>
<target>
<context value="procedure"/>
<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="src"/>
</source>
<target>
<context value="procedure"/>
<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="Procedure"/>
<source>
<context value="entry1"/>
<element value="procedure"/>
<variable value="proceduresrc"/>
</source>
<rule>
<name value="code"/>
<source>
<context value="proceduresrc"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="procedure"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="text"/>
<source>
<context value="proceduresrc"/>
<element value="text"/>
<variable value="txt"/>
</source>
<target>
<context value="procedure"/>
<contextType value="variable"/>
<element value="note"/>
<variable value="note"/>
</target>
<rule>
<name value="reference"/>
<source>
<context value="txt"/>
<element value="reference"/>
<variable value="ref"/>
</source>
<target>
<context value="note"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="evaluate"/>
<parameter>
<valueString value="ref.value"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="status"/>
<source>
<context value="proceduresrc"/>
<condition value="proc.statusCode.exists().not()"/>
</source>
<rule>
<name value="statuscode"/>
<source>
<context value="proceduresrc"/>
</source>
<target>
<context value="procedure"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="unknown"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="proceduresrc"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'completed')"/>
</source>
<target>
<context value="procedure"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="completed"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="proceduresrc"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'active')"/>
</source>
<target>
<context value="procedure"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="in-progress"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="proceduresrc"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'aborted')"/>
</source>
<target>
<context value="procedure"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="stopped"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="proceduresrc"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'suspended')"/>
</source>
<target>
<context value="procedure"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="on-hold"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="proceduresrc"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'cancelled')"/>
</source>
<target>
<context value="procedure"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="not-done"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="proceduresrc"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'held')"/>
</source>
<target>
<context value="procedure"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="on-hold"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="proceduresrc"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'new')"/>
</source>
<target>
<context value="procedure"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="preparation"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="proceduresrc"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'obsolete')"/>
</source>
<target>
<context value="procedure"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="entered-in-error"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="proceduresrc"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'nullified')"/>
</source>
<target>
<context value="procedure"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="unknown"/>
</parameter>
</target>
</rule>
<rule>
<name value="effectiveTime"/>
<source>
<context value="proceduresrc"/>
<element value="effectiveTime"/>
<variable value="efft"/>
</source>
<target>
<context value="procedure"/>
<contextType value="variable"/>
<element value="performed"/>
<variable value="period"/>
<transform value="create"/>
<parameter>
<valueString value="Period"/>
</parameter>
</target>
<dependent>
<name value="IVLTSPeriod"/>
<variable value="efft"/>
<variable value="period"/>
</dependent>
</rule>
<rule>
<name value="Observation"/>
<source>
<context value="proceduresrc"/>
<element value="entryRelationship"/>
<variable value="entriRel"/>
</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="procedure"/>
<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="reference"/>
<source>
<context value="entriRel"/>
</source>
<target>
<context value="observation"/>
<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="entriRel"/>
</source>
<target>
<context value="observation"/>
<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="ObservationValue"/>
<source>
<context value="entriRel"/>
<element value="observation"/>
<variable value="obs"/>
</source>
<rule>
<name value="code"/>
<source>
<context value="obs"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="statuscode"/>
<source>
<context value="obs"/>
<condition value="observation.statusCode.exists().not()"/>
</source>
<rule>
<name value="status"/>
<source>
<context value="obs"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
</group>
<group>
<name value="ClinicalDocumentSectionAllergie"/>
<typeMode value="none"/>
<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="exists"/>
<source>
<context value="src"/>
<condition value="src.entry.exists()"/>
</source>
<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>
<rule>
<name value="where"/>
<source>
<context value="src"/>
<condition value="src.entry.exists().not()"/>
</source>
<rule>
<name value="cdaText"/>
<source>
<context value="src"/>
<element value="text"/>
<variable value="cdaText"/>
</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="allergy"/>
<transform value="create"/>
<parameter>
<valueString value="AllergyIntolerance"/>
</parameter>
</target>
<target>
<context value="allergy"/>
<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/AllergyIntolerance/"/>
</parameter>
<parameter>
<valueId value="uuid1"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="AllergyIntolerance"/>
</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/AllergyIntolerance/' + %allergy.id"/>
</parameter>
</target>
<rule>
<name value="reference"/>
<source>
<context value="src"/>
</source>
<target>
<context value="allergy"/>
<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="reference"/>
<source>
<context value="src"/>
</source>
<target>
<context value="allergy"/>
<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="allergy"/>
<source>
<context value="src"/>
</source>
<target>
<context value="allergy"/>
<contextType value="variable"/>
<element value="clinicalStatus"/>
<variable value="status"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<rule>
<name value="text"/>
<source>
<context value="src"/>
</source>
<target>
<context value="status"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="coding"/>
<source>
<context value="src"/>
</source>
<target>
<context value="status"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<rule>
<name value="active"/>
<source>
<context value="src"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="active"/>
</parameter>
</target>
</rule>
<rule>
<name value="system"/>
<source>
<context value="src"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="code"/>
<source>
<context value="src"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="allergy"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
</source>
<target>
<context value="allergy"/>
<contextType value="variable"/>
<element value="note"/>
<variable value="note"/>
</target>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
<variable value="t"/>
</source>
<target>
<context value="note"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="t"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="allergy"/>
<source>
<context value="src"/>
<element value="entry"/>
<variable value="entry1"/>
</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="allergy"/>
<transform value="create"/>
<parameter>
<valueString value="AllergyIntolerance"/>
</parameter>
</target>
<target>
<context value="allergy"/>
<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/AllergyIntolerance/"/>
</parameter>
<parameter>
<valueId value="uuid1"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="AllergyIntolerance"/>
</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/AllergyIntolerance/' + %allergy.id"/>
</parameter>
</target>
<rule>
<name value="reference"/>
<source>
<context value="src"/>
</source>
<target>
<context value="allergy"/>
<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="reference"/>
<source>
<context value="src"/>
</source>
<target>
<context value="allergy"/>
<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="act"/>
<source>
<context value="entry1"/>
<element value="act"/>
<variable value="actallint"/>
</source>
<rule>
<name value="effectiveTime"/>
<source>
<context value="actallint"/>
<element value="effectiveTime"/>
<variable value="eff"/>
</source>
<target>
<context value="allergy"/>
<contextType value="variable"/>
<element value="onset"/>
<variable value="per"/>
<transform value="create"/>
<parameter>
<valueString value="Period"/>
</parameter>
</target>
<dependent>
<name value="IVLTSPeriod"/>
<variable value="eff"/>
<variable value="per"/>
</dependent>
</rule>
<rule>
<name value="entryRelationship"/>
<source>
<context value="actallint"/>
<element value="entryRelationship"/>
<variable value="entryact"/>
</source>
<rule>
<name value="partic"/>
<source>
<context value="entryact"/>
<element value="observation"/>
<variable value="entryobs"/>
</source>
<rule>
<name value="code"/>
<source>
<context value="entryobs"/>
<element value="value"/>
<variable value="code"/>
</source>
<rule>
<name value="type"/>
<source>
<context value="code"/>
<element value="code"/>
<variable value="code1"/>
</source>
<target>
<context value="allergy"/>
<contextType value="variable"/>
<element value="type"/>
<transform value="translate"/>
<parameter>
<valueId value="code1"/>
</parameter>
<parameter>
<valueString value="#AllergyTypeMap"/>
</parameter>
<parameter>
<valueString value="code"/>
</parameter>
</target>
</rule>
<rule>
<name value="category"/>
<source>
<context value="code"/>
<element value="code"/>
<variable value="code2"/>
</source>
<target>
<context value="allergy"/>
<contextType value="variable"/>
<element value="category"/>
<transform value="translate"/>
<parameter>
<valueId value="code2"/>
</parameter>
<parameter>
<valueString value="#AllergyCategoryMap"/>
</parameter>
<parameter>
<valueString value="code"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="PratRole"/>
<source>
<context value="entryobs"/>
<element value="participant"/>
<variable value="partic"/>
</source>
<rule>
<name value="pratentit"/>
<source>
<context value="partic"/>
<element value="participantRole"/>
<variable value="pratRole"/>
</source>
<rule>
<name value="react"/>
<source>
<context value="pratRole"/>
<element value="playingEntity"/>
<variable value="pratent"/>
</source>
<rule>
<name value="cod"/>
<source>
<context value="pratent"/>
</source>
<target>
<context value="allergy"/>
<contextType value="variable"/>
<element value="reaction"/>
<variable value="reaction"/>
<transform value="create"/>
<parameter>
<valueString value="BackboneElement"/>
</parameter>
</target>
<rule>
<name value="subs"/>
<source>
<context value="pratent"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="reaction"/>
<contextType value="variable"/>
<element value="substance"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="entry"/>
<source>
<context value="entryobs"/>
<element value="entryRelationship"/>
<variable value="entryobs1"/>
<condition value="(typeCode = 'MFST')"/>
</source>
<rule>
<name value="observ"/>
<source>
<context value="entryobs1"/>
<element value="observation"/>
<variable value="entobs"/>
</source>
<rule>
<name value="eff"/>
<source>
<context value="entobs"/>
<element value="effectiveTime"/>
<variable value="eff"/>
</source>
<rule>
<name value="val"/>
<source>
<context value="eff"/>
<element value="low"/>
<variable value="l"/>
</source>
<target>
<context value="reaction"/>
<contextType value="variable"/>
<element value="onset"/>
<variable value="start"/>
<transform value="create"/>
<parameter>
<valueString value="dateTime"/>
</parameter>
</target>
<dependent>
<name value="TSDateTime"/>
<variable value="l"/>
<variable value="start"/>
</dependent>
</rule>
</rule>
<rule>
<name value="manifest"/>
<source>
<context value="entobs"/>
<element value="value"/>
<variable value="vvv"/>
</source>
<target>
<context value="reaction"/>
<contextType value="variable"/>
<element value="manifestation"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="observ"/>
<source>
<context value="entryobs"/>
<element value="entryRelationship"/>
<variable value="entryobs2"/>
</source>
<rule>
<name value="severity"/>
<source>
<context value="entryobs2"/>
<element value="observation"/>
<variable value="entobs"/>
</source>
<rule>
<name value="sev"/>
<source>
<context value="entobs"/>
<element value="code"/>
<variable value="code"/>
<condition value="(code = 'SEV')"/>
</source>
<rule>
<name value="entobs"/>
<source>
<context value="entobs"/>
<element value="value"/>
<variable value="value"/>
</source>
<rule>
<name value="active"/>
<source>
<context value="value"/>
<element value="code"/>
<condition value="(value.code = 'M')"/>
</source>
<target>
<context value="allergy"/>
<contextType value="variable"/>
<element value="criticality"/>
<transform value="copy"/>
<parameter>
<valueString value="unable-to-assess"/>
</parameter>
</target>
</rule>
<rule>
<name value="active"/>
<source>
<context value="value"/>
<element value="code"/>
<condition value="(value.code = 'L')"/>
</source>
<target>
<context value="allergy"/>
<contextType value="variable"/>
<element value="criticality"/>
<transform value="copy"/>
<parameter>
<valueString value="low"/>
</parameter>
</target>
</rule>
<rule>
<name value="active"/>
<source>
<context value="value"/>
<element value="code"/>
<condition value="(value.code = 'H')"/>
</source>
<target>
<context value="allergy"/>
<contextType value="variable"/>
<element value="criticality"/>
<transform value="copy"/>
<parameter>
<valueString value="high"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="entry3"/>
<source>
<context value="entryobs"/>
<element value="entryRelationship"/>
<variable value="entryobs3"/>
</source>
<rule>
<name value="obobs3serv"/>
<source>
<context value="entryobs3"/>
<element value="observation"/>
<variable value="entobs"/>
</source>
<rule>
<name value="stat"/>
<source>
<context value="entobs"/>
<element value="code"/>
<variable value="code"/>
<condition value="(code = '33999-4')"/>
</source>
<rule>
<name value="clinicalStatus"/>
<source>
<context value="entobs"/>
</source>
<target>
<context value="allergy"/>
<contextType value="variable"/>
<element value="clinicalStatus"/>
<variable value="status"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<rule>
<name value="coding"/>
<source>
<context value="entobs"/>
</source>
<target>
<context value="status"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<rule>
<name value="value1"/>
<source>
<context value="entobs"/>
<element value="value"/>
<variable value="value"/>
</source>
<rule>
<name value="active"/>
<source>
<context value="value"/>
<element value="code"/>
<condition value="(value.code = 'LA16666-2')"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="active"/>
</parameter>
</target>
</rule>
<rule>
<name value="active"/>
<source>
<context value="value"/>
<element value="code"/>
<condition value="(value.code = 'LA18632-2')"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="inactive"/>
</parameter>
</target>
</rule>
<rule>
<name value="system"/>
<source>
<context value="value"/>
<element value="codeSystem"/>
<variable value="system"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical"/>
</parameter>
</target>
</rule>
<rule>
<name value="displayName"/>
<source>
<context value="value"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="entry4"/>
<source>
<context value="entryobs"/>
<element value="entryRelationship"/>
<variable value="entryobs4"/>
</source>
<rule>
<name value="obobs4serv"/>
<source>
<context value="entryobs4"/>
<element value="act"/>
<variable value="entact"/>
</source>
<rule>
<name value="txtact"/>
<source>
<context value="entact"/>
<element value="text"/>
<variable value="actext"/>
</source>
<rule>
<name value="notetxt"/>
<source>
<context value="actext"/>
<element value="reference"/>
<variable value="reftxt"/>
</source>
<target>
<context value="allergy"/>
<contextType value="variable"/>
<element value="note"/>
<variable value="note"/>
<transform value="create"/>
<parameter>
<valueString value="BackboneElement"/>
</parameter>
</target>
<rule>
<name value="notxt"/>
<source>
<context value="reftxt"/>
<variable value="ref"/>
</source>
<target>
<context value="note"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="evaluate"/>
<parameter>
<valueString value="ref.value"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
</group>
<group>
<name value="ClinicalDocumentSectionDiagnosiDimissione"/>
<typeMode value="none"/>
<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="exists"/>
<source>
<context value="src"/>
<condition value="src.entry.exists()"/>
</source>
<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>
<rule>
<name value="where"/>
<source>
<context value="src"/>
<condition value="src.entry.exists().not()"/>
</source>
<rule>
<name value="cdaText"/>
<source>
<context value="src"/>
<element value="text"/>
<variable value="cdaText"/>
</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="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/Observation/' + %observation.id"/>
</parameter>
</target>
<rule>
<name value="reference"/>
<source>
<context value="src"/>
</source>
<target>
<context value="observation"/>
<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="src"/>
</source>
<target>
<context value="observation"/>
<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="code"/>
<source>
<context value="src"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="statuscode"/>
<source>
<context value="src"/>
<condition value="observation.statusCode.exists().not()"/>
</source>
<rule>
<name value="status"/>
<source>
<context value="src"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="note"/>
<variable value="note"/>
</target>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
<variable value="t"/>
</source>
<target>
<context value="note"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="t"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="entry"/>
<source>
<context value="src"/>
<element value="entry"/>
<variable value="entry1"/>
</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="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/Observation/' + %observation.id"/>
</parameter>
</target>
<rule>
<name value="act"/>
<source>
<context value="entry1"/>
<element value="observation"/>
<variable value="obs"/>
</source>
<dependent>
<name value="Observation"/>
<variable value="obs"/>
<variable value="patient"/>
<variable value="enc"/>
<variable value="observation"/>
<variable value="bundle"/>
</dependent>
</rule>
</rule>
</group>
<group>
<name value="ClinicalDocumentSectionIstruzioniFollowUp"/>
<typeMode value="none"/>
<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="text"/>
<variable value="cdaText"/>
</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="carePlan"/>
<transform value="create"/>
<parameter>
<valueString value="CarePlan"/>
</parameter>
</target>
<target>
<context value="carePlan"/>
<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/CarePlan/"/>
</parameter>
<parameter>
<valueId value="uuid1"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="CarePlan"/>
</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/CarePlan/' + %carePlan.id"/>
</parameter>
</target>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
</source>
<target>
<context value="carePlan"/>
<contextType value="variable"/>
<element value="note"/>
<variable value="note"/>
</target>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
<variable value="t"/>
</source>
<target>
<context value="note"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="t"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="src"/>
</source>
<target>
<context value="carePlan"/>
<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="src"/>
</source>
<target>
<context value="carePlan"/>
<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="status"/>
<source>
<context value="src"/>
</source>
<target>
<context value="carePlan"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="active"/>
</parameter>
</target>
</rule>
<rule>
<name value="intent"/>
<source>
<context value="src"/>
</source>
<target>
<context value="carePlan"/>
<contextType value="variable"/>
<element value="intent"/>
<transform value="copy"/>
<parameter>
<valueString value="order"/>
</parameter>
</target>
</rule>
</rule>
</group>
<group>
<name value="ClinicalDocumentSectionTerapiaFarmacologicaDuranteRicovero"/>
<typeMode value="none"/>
<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="exists"/>
<source>
<context value="src"/>
<condition value="src.entry.exists()"/>
</source>
<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>
<rule>
<name value="where"/>
<source>
<context value="src"/>
<condition value="src.entry.exists().not()"/>
</source>
<rule>
<name value="cdaText"/>
<source>
<context value="src"/>
<element value="text"/>
<variable value="cdaText"/>
</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="medicationAdm"/>
<transform value="create"/>
<parameter>
<valueString value="MedicationAdministration"/>
</parameter>
</target>
<target>
<context value="medicationAdm"/>
<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/MedicationAdministration/"/>
</parameter>
<parameter>
<valueId value="uuid1"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="MedicationAdministration"/>
</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/MedicationAdministration/' + %medicationAdm.id"/>
</parameter>
</target>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
</source>
<target>
<context value="medicationAdm"/>
<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="cdaText"/>
</source>
<target>
<context value="medicationAdm"/>
<contextType value="variable"/>
<element value="context"/>
<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="code"/>
<source>
<context value="cdaText"/>
</source>
<target>
<context value="medicationAdm"/>
<contextType value="variable"/>
<element value="medication"/>
<variable value="codecon"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<rule>
<name value="text"/>
<source>
<context value="cdaText"/>
</source>
<target>
<context value="codecon"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="Period"/>
<source>
<context value="src"/>
</source>
<target>
<context value="medicationAdm"/>
<contextType value="variable"/>
<element value="effective"/>
<variable value="period"/>
<transform value="create"/>
<parameter>
<valueString value="Period"/>
</parameter>
</target>
<rule>
<name value="low"/>
<source>
<context value="src"/>
</source>
<target>
<context value="period"/>
<contextType value="variable"/>
<element value="start"/>
<transform value="evaluate"/>
<parameter>
<valueString value="start.now()"/>
</parameter>
</target>
</rule>
<rule>
<name value="high"/>
<source>
<context value="src"/>
</source>
<target>
<context value="period"/>
<contextType value="variable"/>
<element value="end"/>
<transform value="evaluate"/>
<parameter>
<valueString value="end.now()"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="statuscode"/>
<source>
<context value="src"/>
<condition value="sub.statusCode.exists().not()"/>
</source>
<rule>
<name value="status"/>
<source>
<context value="src"/>
</source>
<target>
<context value="medicationAdm"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="completed"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
</source>
<target>
<context value="medicationAdm"/>
<contextType value="variable"/>
<element value="note"/>
<variable value="note"/>
</target>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
<variable value="t"/>
</source>
<target>
<context value="note"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="t"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="sa"/>
<source>
<context value="src"/>
<element value="entry"/>
<variable value="entry1"/>
</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="medicationAdm"/>
<transform value="create"/>
<parameter>
<valueString value="MedicationAdministration"/>
</parameter>
</target>
<target>
<context value="medicationAdm"/>
<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/MedicationAdministration/"/>
</parameter>
<parameter>
<valueId value="uuid1"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="MedicationAdministration"/>
</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/MedicationAdministration/' + %medicationAdm.id"/>
</parameter>
</target>
<rule>
<name value="reference"/>
<source>
<context value="entry1"/>
</source>
<target>
<context value="medicationAdm"/>
<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="entry1"/>
</source>
<target>
<context value="medicationAdm"/>
<contextType value="variable"/>
<element value="context"/>
<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="entry"/>
<source>
<context value="entry1"/>
<element value="substanceAdministration"/>
<variable value="sa"/>
</source>
<rule>
<name value="tx"/>
<source>
<context value="sa"/>
<element value="text"/>
<variable value="tx"/>
</source>
<target>
<context value="medicationAdm"/>
<contextType value="variable"/>
<element value="note"/>
<variable value="note"/>
</target>
<rule>
<name value="perf"/>
<source>
<context value="sa"/>
<element value="performer"/>
<variable value="performer"/>
</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="practitioner"/>
<transform value="create"/>
<parameter>
<valueString value="Practitioner"/>
</parameter>
</target>
<rule>
<name value="time"/>
<source>
<context value="performer"/>
<element value="time"/>
<variable value="ti"/>
</source>
<target>
<context value="note"/>
<contextType value="variable"/>
<element value="time"/>
<transform value="evaluate"/>
<parameter>
<valueString value="ti.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="assEntity"/>
<source>
<context value="performer"/>
<element value="assignedEntity"/>
<variable value="assEnty"/>
</source>
<rule>
<name value="meta"/>
<source>
<context value="assEnty"/>
</source>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="meta"/>
<variable value="meta"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="assEnty"/>
</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="assEnty"/>
</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="assEnty"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString
value="ClinicalDocument/body/TerapiaFarmacologicaRicovero/performer"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="identifier"/>
<source>
<context value="assEnty"/>
<element value="id"/>
<variable value="id"/>
</source>
<target>
<context value="practitioner"/>
<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="extension"/>
<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>
<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="aut"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext"/>
</source>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid2"/>
<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/Practitioner/"/>
</parameter>
<parameter>
<valueId value="uuid2"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="Practitioner"/>
</parameter>
</target>
<target>
<context value="medicationAdm"/>
<contextType value="variable"/>
<element value="performer"/>
<variable value="perf"/>
</target>
<target>
<context value="perf"/>
<contextType value="variable"/>
<element value="actor"/>
<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/Practitioner/' + %practitioner.id"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="2.16.840.1.113883.2.9.4.3.2"/>
<source>
<context value="assEnty"/>
<element value="id"/>
<variable value="id"/>
<condition value="(root = '2.16.840.1.113883.2.9.4.3.2')"/>
</source>
<rule>
<name value="UUID"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext"/>
</source>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="append"/>
<parameter>
<valueString value="Practitioner?identifier="/>
</parameter>
<parameter>
<valueId value="ext"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="diverso"/>
<source>
<context value="assEnty"/>
<element value="id"/>
<variable value="id"/>
<condition value="(root != '2.16.840.1.113883.2.9.4.3.2')"/>
</source>
<rule>
<name value="UUID"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext"/>
</source>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="append"/>
<parameter>
<valueString value="Practitioner?identifier="/>
</parameter>
<parameter>
<valueId value="ext"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="assi"/>
<source>
<context value="assEnty"/>
<element value="assignedPerson"/>
<variable value="assi"/>
</source>
<rule>
<name value="name"/>
<source>
<context value="assi"/>
<element value="name"/>
<variable value="vvv"/>
</source>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="name"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="tx"/>
<element value="reference"/>
<variable value="ref"/>
</source>
<target>
<context value="note"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="evaluate"/>
<parameter>
<valueString value="ref.value"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="sa"/>
<element value="statusCode"/>
<variable value="st"/>
</source>
<target>
<context value="medicationAdm"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="evaluate"/>
<parameter>
<valueString value="st.code"/>
</parameter>
</target>
</rule>
<rule>
<name value="period"/>
<source>
<context value="sa"/>
<element value="effectiveTime"/>
<variable value="eff"/>
</source>
<target>
<context value="medicationAdm"/>
<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="dos"/>
<source>
<context value="sa"/>
</source>
<target>
<context value="medicationAdm"/>
<contextType value="variable"/>
<element value="dosage"/>
<variable value="dos"/>
</target>
<rule>
<name value="routeCode"/>
<source>
<context value="sa"/>
<element value="routeCode"/>
<variable value="vvv"/>
</source>
<target>
<context value="dos"/>
<contextType value="variable"/>
<element value="route"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</rule>
<rule>
<name value="dos"/>
<source>
<context value="sa"/>
</source>
<target>
<context value="medicationAdm"/>
<contextType value="variable"/>
<element value="dosage"/>
<variable value="dos"/>
</target>
<rule>
<name value="approachSiteCode"/>
<source>
<context value="sa"/>
<element value="approachSiteCode"/>
<variable value="vvv"/>
</source>
<target>
<context value="dos"/>
<contextType value="variable"/>
<element value="site"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</rule>
<rule>
<name value="sa"/>
<source>
<context value="sa"/>
<element value="doseQuantity"/>
<variable value="doseQuant"/>
</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="medicationRq"/>
<transform value="create"/>
<parameter>
<valueString value="MedicationRequest"/>
</parameter>
</target>
<target>
<context value="medicationRq"/>
<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/MedicationRequest/"/>
</parameter>
<parameter>
<valueId value="uuid1"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="MedicationRequest"/>
</parameter>
</target>
<target>
<context value="medicationAdm"/>
<contextType value="variable"/>
<element value="request"/>
<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/MedicationRequest/' + %medicationRq.id"/>
</parameter>
</target>
<rule>
<name value="Dosage"/>
<source>
<context value="doseQuant"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="dosageInstruction"/>
<variable value="dosageInstruction"/>
<transform value="create"/>
<parameter>
<valueString value="Dosage"/>
</parameter>
</target>
<rule>
<name value="ot"/>
<source>
<context value="doseQuant"/>
<element value="originalText"/>
<variable value="ot"/>
</source>
<rule>
<name value="reference"/>
<source>
<context value="ot"/>
<element value="reference"/>
<variable value="vvv"/>
</source>
<target>
<context value="dosageInstruction"/>
<contextType value="variable"/>
<element value="text"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</rule>
<rule>
<name value="dosageRate"/>
<source>
<context value="doseQuant"/>
</source>
<target>
<context value="dosageInstruction"/>
<contextType value="variable"/>
<element value="doseAndRate"/>
<variable value="dosageRate"/>
</target>
<rule>
<name value="d"/>
<source>
<context value="doseQuant"/>
</source>
<target>
<context value="dosageRate"/>
<contextType value="variable"/>
<element value="dose"/>
<variable value="d"/>
<transform value="create"/>
<parameter>
<valueString value="Range"/>
</parameter>
</target>
<rule>
<name value="low"/>
<source>
<context value="doseQuant"/>
</source>
<target>
<context value="d"/>
<contextType value="variable"/>
<element value="low"/>
<variable value="l"/>
<transform value="create"/>
<parameter>
<valueString value="SimpleQuantity"/>
</parameter>
</target>
<rule>
<name value="low"/>
<source>
<context value="doseQuant"/>
<element value="low"/>
<variable value="lo"/>
</source>
<target>
<context value="l"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="lo.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="low"/>
<source>
<context value="doseQuant"/>
<element value="low"/>
<variable value="lo"/>
</source>
<target>
<context value="l"/>
<contextType value="variable"/>
<element value="unit"/>
<transform value="evaluate"/>
<parameter>
<valueString value="lo.unit"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="low"/>
<source>
<context value="doseQuant"/>
</source>
<target>
<context value="d"/>
<contextType value="variable"/>
<element value="high"/>
<variable value="h"/>
<transform value="create"/>
<parameter>
<valueString value="SimpleQuantity"/>
</parameter>
</target>
<rule>
<name value="high"/>
<source>
<context value="doseQuant"/>
<element value="high"/>
<variable value="hi"/>
</source>
<target>
<context value="h"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="hi.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="high"/>
<source>
<context value="doseQuant"/>
<element value="high"/>
<variable value="hi"/>
</source>
<target>
<context value="h"/>
<contextType value="variable"/>
<element value="unit"/>
<transform value="evaluate"/>
<parameter>
<valueString value="hi.unit"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="sa"/>
</source>
<target>
<context value="medicationRq"/>
<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="sa"/>
</source>
<target>
<context value="medicationRq"/>
<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="status"/>
<source>
<context value="sa"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="active"/>
</parameter>
</target>
</rule>
<rule>
<name value="intent"/>
<source>
<context value="sa"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="intent"/>
<transform value="copy"/>
<parameter>
<valueString value="order"/>
</parameter>
</target>
</rule>
<rule>
<name value="Dosage"/>
<source>
<context value="sa"/>
<element value="rateQuantity"/>
<variable value="rateQuantity"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="dosageInstruction"/>
<variable value="dosageInstruction1"/>
<transform value="create"/>
<parameter>
<valueString value="Dosage"/>
</parameter>
</target>
<rule>
<name value="ot"/>
<source>
<context value="rateQuantity"/>
<element value="originalText"/>
<variable value="ot"/>
</source>
<rule>
<name value="reference"/>
<source>
<context value="ot"/>
<element value="reference"/>
<variable value="vvv"/>
</source>
<target>
<context value="dosageInstruction1"/>
<contextType value="variable"/>
<element value="text"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</rule>
<rule>
<name value="dosageRate"/>
<source>
<context value="rateQuantity"/>
</source>
<target>
<context value="dosageInstruction1"/>
<contextType value="variable"/>
<element value="doseAndRate"/>
<variable value="dosageRate"/>
</target>
<rule>
<name value="d"/>
<source>
<context value="rateQuantity"/>
</source>
<target>
<context value="dosageRate"/>
<contextType value="variable"/>
<element value="rate"/>
<variable value="d"/>
<transform value="create"/>
<parameter>
<valueString value="Range"/>
</parameter>
</target>
<rule>
<name value="low"/>
<source>
<context value="rateQuantity"/>
</source>
<target>
<context value="d"/>
<contextType value="variable"/>
<element value="low"/>
<variable value="l"/>
<transform value="create"/>
<parameter>
<valueString value="SimpleQuantity"/>
</parameter>
</target>
<rule>
<name value="low"/>
<source>
<context value="rateQuantity"/>
<element value="low"/>
<variable value="lo"/>
</source>
<target>
<context value="l"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="lo.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="low"/>
<source>
<context value="rateQuantity"/>
<element value="low"/>
<variable value="lo"/>
</source>
<target>
<context value="l"/>
<contextType value="variable"/>
<element value="unit"/>
<transform value="evaluate"/>
<parameter>
<valueString value="lo.unit"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="low"/>
<source>
<context value="rateQuantity"/>
</source>
<target>
<context value="d"/>
<contextType value="variable"/>
<element value="high"/>
<variable value="h"/>
<transform value="create"/>
<parameter>
<valueString value="SimpleQuantity"/>
</parameter>
</target>
<rule>
<name value="high"/>
<source>
<context value="rateQuantity"/>
<element value="high"/>
<variable value="hi"/>
</source>
<target>
<context value="h"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="hi.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="high"/>
<source>
<context value="rateQuantity"/>
<element value="high"/>
<variable value="hi"/>
</source>
<target>
<context value="h"/>
<contextType value="variable"/>
<element value="unit"/>
<transform value="evaluate"/>
<parameter>
<valueString value="hi.unit"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="medication"/>
<source>
<context value="sa"/>
</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="medication"/>
<transform value="create"/>
<parameter>
<valueString value="Medication"/>
</parameter>
</target>
<target>
<context value="medication"/>
<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/Medication/"/>
</parameter>
<parameter>
<valueId value="uuid1"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="Medication"/>
</parameter>
</target>
<target>
<context value="medicationAdm"/>
<contextType value="variable"/>
<element value="medication"/>
<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/Medication/' + %medication.id"/>
</parameter>
</target>
<rule>
<name value="reference"/>
<source>
<context value="sa"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="medication"/>
<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/Medication/' + %medication.id"/>
</parameter>
</target>
</rule>
<rule>
<name value="administrationUnitCode"/>
<source>
<context value="sa"/>
<element value="administrationUnitCode"/>
<variable value="vvv"/>
</source>
<target>
<context value="medication"/>
<contextType value="variable"/>
<element value="form"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="consumable"/>
<source>
<context value="sa"/>
<element value="consumable"/>
<variable value="consumable"/>
</source>
<rule>
<name value="manufac"/>
<source>
<context value="consumable"/>
<element value="manufacturedProduct"/>
<variable value="manufac"/>
</source>
<rule>
<name value="manufactproduct"/>
<source>
<context value="manufac"/>
<element value="manufacturedMaterial"/>
<variable value="manuprod"/>
</source>
<rule>
<name value="code"/>
<source>
<context value="manuprod"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="medication"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="entryRr"/>
<source>
<context value="sa"/>
<element value="entryRelationship"/>
<variable value="entryRR"/>
</source>
<rule>
<name value="obs"/>
<source>
<context value="entryRR"/>
<element value="observation"/>
<variable value="observation"/>
</source>
<rule>
<name value="ingredient"/>
<source>
<context value="observation"/>
<element value="code"/>
<condition value="displayName = 'Grammatura'"/>
</source>
<target>
<context value="medication"/>
<contextType value="variable"/>
<element value="ingredient"/>
<variable value="ingredient"/>
</target>
<rule>
<name value="consumable"/>
<source>
<context value="sa"/>
<element value="consumable"/>
<variable value="consumable"/>
</source>
<rule>
<name value="product"/>
<source>
<context value="consumable"/>
<element value="manufacturedProduct"/>
<variable value="manufacturedProduct"/>
</source>
<rule>
<name value="material"/>
<source>
<context value="manufacturedProduct"/>
<element value="manufacturedMaterial"/>
<variable value="manufacturedMaterial"/>
</source>
<rule>
<name value="CE"/>
<source>
<context value="manufacturedMaterial"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="ingredient"/>
<contextType value="variable"/>
<element value="item"/>
<variable value="value"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<dependent>
<name value="CECodeableConcept"/>
<variable value="code"/>
<variable value="value"/>
</dependent>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="strenght"/>
<source>
<context value="observation"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="ingredient"/>
<contextType value="variable"/>
<element value="strength"/>
<variable value="strength"/>
</target>
<rule>
<name value="numerator"/>
<source>
<context value="value"/>
</source>
<target>
<context value="strength"/>
<contextType value="variable"/>
<element value="numerator"/>
<variable value="numerator"/>
</target>
<rule>
<name value="valueN"/>
<source>
<context value="value"/>
</source>
<target>
<context value="numerator"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="value.value"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="denominator"/>
<source>
<context value="value"/>
</source>
<target>
<context value="strength"/>
<contextType value="variable"/>
<element value="denominator"/>
<variable value="denominator"/>
</target>
<rule>
<name value="valueD"/>
<source>
<context value="value"/>
</source>
<target>
<context value="denominator"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueInteger value="1"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="quantita"/>
<source>
<context value="observation"/>
<element value="code"/>
<condition
value="displayName = 'Quantità nella Confezione'"/>
</source>
<rule>
<name value="amount"/>
<source>
<context value="observation"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="medication"/>
<contextType value="variable"/>
<element value="amount"/>
<variable value="amount"/>
</target>
<rule>
<name value="numerator"/>
<source>
<context value="value"/>
</source>
<target>
<context value="amount"/>
<contextType value="variable"/>
<element value="numerator"/>
<variable value="numerator"/>
</target>
<rule>
<name value="valueN"/>
<source>
<context value="value"/>
</source>
<target>
<context value="numerator"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="value.value"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="denominator"/>
<source>
<context value="value"/>
</source>
<target>
<context value="amount"/>
<contextType value="variable"/>
<element value="denominator"/>
<variable value="denominator"/>
</target>
<rule>
<name value="valueD"/>
<source>
<context value="value"/>
</source>
<target>
<context value="denominator"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueInteger value="1"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="entryR"/>
<source>
<context value="sa"/>
<element value="entryRelationship"/>
<variable value="entryRelationship"/>
</source>
<rule>
<name value="sub"/>
<source>
<context value="entryRelationship"/>
<element value="supply"/>
<variable value="sup"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="dispenseRequest"/>
<variable value="dispreq"/>
</target>
<rule>
<name value="quantity"/>
<source>
<context value="sup"/>
</source>
<target>
<context value="dispreq"/>
<contextType value="variable"/>
<element value="quantity"/>
<variable value="quantity"/>
<transform value="create"/>
<parameter>
<valueString value="SimpleQuantity"/>
</parameter>
</target>
<rule>
<name value="quantity"/>
<source>
<context value="sup"/>
<element value="quantity"/>
<variable 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>
</rule>
</rule>
<rule>
<name value="Medicationrequest"/>
<source>
<context value="sa"/>
<element value="participant"/>
<variable value="participant"/>
</source>
<rule>
<name value="time"/>
<source>
<context value="participant"/>
<element value="time"/>
<variable value="t"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="authoredOn"/>
<transform value="evaluate"/>
<parameter>
<valueString value="t.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="perf"/>
<source>
<context value="participant"/>
<element value="participantRole"/>
<variable value="participantR"/>
</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="practitioner"/>
<transform value="create"/>
<parameter>
<valueString value="Practitioner"/>
</parameter>
</target>
<rule>
<name value="meta"/>
<source>
<context value="participantR"/>
</source>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="meta"/>
<variable value="meta"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="participantR"/>
</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="participantR"/>
</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="participantR"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString
value="ClinicalDocument/body/TerapiaFarmacologicaRicovero/participant"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="identifier"/>
<source>
<context value="participantR"/>
<element value="id"/>
<variable value="id"/>
</source>
<target>
<context value="practitioner"/>
<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="extension"/>
<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>
<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="aut"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext"/>
</source>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid2"/>
<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/Practitioner/"/>
</parameter>
<parameter>
<valueId value="uuid2"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="append"/>
<parameter>
<valueString value="Practitioner/"/>
</parameter>
<parameter>
<valueId value="uuid1"/>
</parameter>
</target>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="requester"/>
<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/Practitioner/' + %practitioner.id"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="2.16.840.1.113883.2.9.4.3.2"/>
<source>
<context value="participantR"/>
<element value="id"/>
<variable value="id"/>
<condition value="(root = '2.16.840.1.113883.2.9.4.3.2')"/>
</source>
<rule>
<name value="UUID"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext"/>
</source>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="append"/>
<parameter>
<valueString value="Practitioner?identifier="/>
</parameter>
<parameter>
<valueId value="ext"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="assi"/>
<source>
<context value="participantR"/>
<element value="playingEntity"/>
<variable value="assi"/>
</source>
<rule>
<name value="name"/>
<source>
<context value="assi"/>
<element value="name"/>
<variable value="vvv"/>
</source>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="name"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="period"/>
<source>
<context value="sa"/>
<type value="EIVL"/>
<element value="effectiveTime"/>
<variable value="eff"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="dosageInstruction"/>
<variable value="dosage"/>
<transform value="create"/>
<parameter>
<valueString value="Dosage"/>
</parameter>
</target>
<rule>
<name value="timing"/>
<source>
<context value="eff"/>
</source>
<target>
<context value="dosage"/>
<contextType value="variable"/>
<element value="timing"/>
<variable value="timing"/>
<transform value="create"/>
<parameter>
<valueString value="Timing"/>
</parameter>
</target>
<rule>
<name value="rep"/>
<source>
<context value="eff"/>
</source>
<target>
<context value="timing"/>
<contextType value="variable"/>
<element value="repeat"/>
<variable value="rep"/>
</target>
<rule>
<name value="event"/>
<source>
<context value="eff"/>
<element value="event"/>
<variable value="ev"/>
</source>
<target>
<context value="rep"/>
<contextType value="variable"/>
<element value="where"/>
<transform value="evaluate"/>
<parameter>
<valueString value="ev.code"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="tim"/>
<source>
<context value="sa"/>
<type value="TS"/>
<element value="effectiveTime"/>
<variable value="eff"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="dosageInstruction"/>
<variable value="dosage"/>
<transform value="create"/>
<parameter>
<valueString value="Dosage"/>
</parameter>
</target>
<target>
<context value="dosage"/>
<contextType value="variable"/>
<element value="timing"/>
<variable value="timing"/>
<transform value="create"/>
<parameter>
<valueString value="Timing"/>
</parameter>
</target>
<target>
<context value="timing"/>
<contextType value="variable"/>
<element value="event"/>
<transform value="evaluate"/>
<parameter>
<valueString value="eff.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="eff"/>
<source>
<context value="sa"/>
<type value="PIVL_TS"/>
<element value="effectiveTime"/>
<variable value="eff"/>
</source>
<target>
<context value="medicationAdm"/>
<contextType value="variable"/>
<element value="dosage"/>
<variable value="dosage"/>
<transform value="create"/>
<parameter>
<valueString value="BackboneElement"/>
</parameter>
</target>
<rule>
<name value="ratio"/>
<source>
<context value="eff"/>
</source>
<target>
<context value="dosage"/>
<contextType value="variable"/>
<element value="rate"/>
<variable value="ratio"/>
<transform value="create"/>
<parameter>
<valueString value="Ratio"/>
</parameter>
</target>
<rule>
<name value="quanti"/>
<source>
<context value="eff"/>
</source>
<target>
<context value="ratio"/>
<contextType value="variable"/>
<element value="numerator"/>
<variable value="quan"/>
<transform value="create"/>
<parameter>
<valueString value="Quantity"/>
</parameter>
</target>
<rule>
<name value="period"/>
<source>
<context value="eff"/>
<element value="period"/>
<variable value="per"/>
</source>
<target>
<context value="quan"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="per.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="period"/>
<source>
<context value="eff"/>
<element value="period"/>
<variable value="per"/>
</source>
<target>
<context value="quan"/>
<contextType value="variable"/>
<element value="unit"/>
<transform value="evaluate"/>
<parameter>
<valueString value="per.unit"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="quanti"/>
<source>
<context value="eff"/>
</source>
<target>
<context value="ratio"/>
<contextType value="variable"/>
<element value="denominator"/>
<variable value="quan"/>
<transform value="create"/>
<parameter>
<valueString value="Quantity"/>
</parameter>
</target>
<rule>
<name value="period"/>
<source>
<context value="eff"/>
<element value="period"/>
</source>
<target>
<context value="quan"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueString value="1"/>
</parameter>
</target>
</rule>
<rule>
<name value="period"/>
<source>
<context value="eff"/>
<element value="period"/>
<variable value="per"/>
</source>
<target>
<context value="quan"/>
<contextType value="variable"/>
<element value="unit"/>
<transform value="evaluate"/>
<parameter>
<valueString value="per.unit"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
</group>
<group>
<name value="ClinicalDocumentSottoSectionOBS"/>
<typeMode value="none"/>
<input>
<name value="src"/>
<type value="Section"/>
<mode value="source"/>
</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="patient"/>
<type value="Patient"/>
<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="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="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/Observation/' + %observation.id"/>
</parameter>
</target>
<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>
<name value="code"/>
<source>
<context value="src"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="src"/>
</source>
<target>
<context value="observation"/>
<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="src"/>
</source>
<target>
<context value="observation"/>
<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="statuscode"/>
<source>
<context value="src"/>
<condition value="observation.statusCode.exists().not()"/>
</source>
<rule>
<name value="status"/>
<source>
<context value="src"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
</source>
<target>
<context value="observation"/>
<contextType value="variable"/>
<element value="note"/>
<variable value="note"/>
</target>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
<variable value="t"/>
</source>
<target>
<context value="note"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="t"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</group>
<group>
<name value="ClinicalDocumentSottoSectionMS"/>
<typeMode value="none"/>
<input>
<name value="src"/>
<type value="Section"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<mode value="target"/>
</input>
<input>
<name value="bundle"/>
<type value="Bundle"/>
<mode value="target"/>
</input>
<input>
<name value="patient"/>
<type value="Patient"/>
<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="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="Medicationstatement"/>
<transform value="create"/>
<parameter>
<valueString value="MedicationStatement"/>
</parameter>
</target>
<target>
<context value="Medicationstatement"/>
<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/MedicationStatement/"/>
</parameter>
<parameter>
<valueId value="uuid1"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="MedicationStatement"/>
</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/MedicationStatement/' + %Medicationstatement.id"/>
</parameter>
</target>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="text"/>
<variable value="fhirText"/>
</target>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
</source>
<target>
<context value="Medicationstatement"/>
<contextType value="variable"/>
<element value="note"/>
<variable value="note"/>
</target>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
<variable value="t"/>
</source>
<target>
<context value="note"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="t"/>
</parameter>
</target>
</rule>
<rule>
<name value="text"/>
<source>
<context value="cdaText"/>
<variable value="t"/>
</source>
<target>
<context value="Medicationstatement"/>
<contextType value="variable"/>
<element value="medication"/>
<variable value="medication"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<target>
<context value="medication"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="t"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="src"/>
</source>
<target>
<context value="Medicationstatement"/>
<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="status"/>
<source>
<context value="src"/>
</source>
<target>
<context value="Medicationstatement"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="unknown"/>
</parameter>
</target>
</rule>
</rule>
</group>
<group>
<name value="Observation"/>
<typeMode value="none"/>
<input>
<name value="obs"/>
<type value="Observation"/>
<mode value="source"/>
</input>
<input>
<name value="patient"/>
<type value="Patient"/>
<mode value="target"/>
</input>
<input>
<name value="encounter"/>
<type value="Encounter"/>
<mode value="target"/>
</input>
<input>
<name value="ob"/>
<type value="Observation"/>
<mode value="target"/>
</input>
<input>
<name value="bundle"/>
<type value="Bundle"/>
<mode value="target"/>
</input>
<rule>
<name value="reference"/>
<source>
<context value="obs"/>
</source>
<target>
<context value="ob"/>
<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="obs"/>
</source>
<target>
<context value="ob"/>
<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/' + %encounter.id"/>
</parameter>
</target>
</rule>
<rule>
<name value="code"/>
<source>
<context value="obs"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="obs"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'completed')"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="obs"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'active')"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="registered"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="obs"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'aborted')"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="cancelled"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="obs"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'suspended')"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="partial"/>
</parameter>
</target>
</rule>
<rule>
<name value="statuscode"/>
<source>
<context value="obs"/>
<condition value="obs.statusCode.exists().not()"/>
</source>
<rule>
<name value="status"/>
<source>
<context value="obs"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="value2"/>
<source>
<context value="obs"/>
<element value="effectiveTime"/>
<variable value="effectiveTime"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="effective"/>
<variable value="value"/>
<transform value="create"/>
<parameter>
<valueString value="dateTime"/>
</parameter>
</target>
<dependent>
<name value="TSDateTime"/>
<variable value="effectiveTime"/>
<variable value="value"/>
</dependent>
</rule>
<rule>
<name value="where"/>
<source>
<context value="obs"/>
<condition
value="effectiveTime.low.exists() or effectiveTime.high.exists()"/>
</source>
<rule>
<name value="value3"/>
<source>
<context value="obs"/>
<element value="effectiveTime"/>
<variable value="eff"/>
</source>
<target>
<context value="ob"/>
<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>
<rule>
<name value="value"/>
<source>
<context value="obs"/>
<type value="INT"/>
<element value="value"/>
<variable value="int"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="int.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="boolean"/>
<source>
<context value="obs"/>
<type value="BL"/>
<element value="value"/>
<variable value="boolean"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="boolean.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="val"/>
<source>
<context value="obs"/>
<type value="CD"/>
<element value="value"/>
<variable value="val"/>
</source>
<rule>
<name value="coding"/>
<source>
<context value="val"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="ce"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<rule>
<name value="originalText"/>
<source>
<context value="val"/>
<element value="originalText"/>
<variable value="vvv"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="text"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="code"/>
<source>
<context value="val"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="val"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="cast"/>
<parameter>
<valueId value="code"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystem"/>
<source>
<context value="val"/>
<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>
<name value="displayName"/>
<source>
<context value="val"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="translation"/>
<source>
<context value="val"/>
<element value="translation"/>
<variable value="translation"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="translation"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="cast"/>
<parameter>
<valueId value="code"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystem"/>
<source>
<context value="translation"/>
<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>
<name value="displayName"/>
<source>
<context value="translation"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="qualifier"/>
<source>
<context value="translation"/>
<element value="qualifier"/>
<variable value="qualifier"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="qualifier"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="value"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="cast"/>
<parameter>
<valueId value="code"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystem"/>
<source>
<context value="value"/>
<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>
<name value="displayName"/>
<source>
<context value="value"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="val"/>
<source>
<context value="obs"/>
<type value="CE"/>
<element value="value"/>
<variable value="val"/>
</source>
<rule>
<name value="coding"/>
<source>
<context value="val"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="ce"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<rule>
<name value="originalText"/>
<source>
<context value="val"/>
<element value="originalText"/>
<variable value="vvv"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="text"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="code"/>
<source>
<context value="val"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="val"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="cast"/>
<parameter>
<valueId value="code"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystem"/>
<source>
<context value="val"/>
<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>
<name value="displayName"/>
<source>
<context value="val"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="translation"/>
<source>
<context value="val"/>
<element value="translation"/>
<variable value="translation"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="translation"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="cast"/>
<parameter>
<valueId value="code"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystem"/>
<source>
<context value="translation"/>
<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>
<name value="displayName"/>
<source>
<context value="translation"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="qualifier"/>
<source>
<context value="translation"/>
<element value="qualifier"/>
<variable value="qualifier"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="qualifier"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="value"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="cast"/>
<parameter>
<valueId value="code"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystem"/>
<source>
<context value="value"/>
<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>
<name value="displayName"/>
<source>
<context value="value"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="valueQuantity"/>
<source>
<context value="obs"/>
<type value="PQ"/>
<element value="value"/>
<variable value="val"/>
</source>
<rule>
<name value="quantity"/>
<source>
<context value="val"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="quantity"/>
<transform value="create"/>
<parameter>
<valueString value="Quantity"/>
</parameter>
</target>
<rule>
<name value="value"/>
<source>
<context value="val"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="quantity"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
</rule>
<rule>
<name value="unit"/>
<source>
<context value="val"/>
<element value="unit"/>
<variable value="unit"/>
</source>
<target>
<context value="quantity"/>
<contextType value="variable"/>
<element value="unit"/>
<transform value="copy"/>
<parameter>
<valueId value="unit"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="obs"/>
<type value="ST"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="create"/>
<parameter>
<valueString value="string"/>
</parameter>
</target>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="value.dataString"/>
</parameter>
</target>
</rule>
<rule>
<name value="interpretationCode"/>
<source>
<context value="obs"/>
<element value="interpretationCode"/>
<variable value="vvv"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="interpretation"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="methodCode"/>
<source>
<context value="obs"/>
<element value="methodCode"/>
<variable value="vvv"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="method"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="refRange"/>
<source>
<context value="obs"/>
<element value="referenceRange"/>
<variable value="refRange"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="referenceRange"/>
<variable value="ref"/>
<transform value="create"/>
<parameter>
<valueString value="BackboneElement"/>
</parameter>
</target>
<rule>
<name value="obsRange"/>
<source>
<context value="refRange"/>
<element value="observationRange"/>
<variable value="obsRange"/>
</source>
<target>
<context value="ref"/>
<contextType value="variable"/>
<element value="low"/>
<variable value="Low"/>
<transform value="create"/>
<parameter>
<valueString value="SimpleQuantity"/>
</parameter>
</target>
<rule>
<name value="IVLPQ"/>
<source>
<context value="obsRange"/>
<type value="IVL_PQ"/>
<element value="value"/>
<variable value="v"/>
</source>
<rule>
<name value="decValue"/>
<source>
<context value="v"/>
<element value="low"/>
<variable value="l1"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="l1"/>
<element value="value"/>
<variable value="decValue"/>
</source>
<target>
<context value="Low"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="decValue"/>
</parameter>
</target>
</rule>
<rule>
<name value="unit"/>
<source>
<context value="l1"/>
<element value="unit"/>
<variable value="Unit"/>
</source>
<target>
<context value="Low"/>
<contextType value="variable"/>
<element value="unit"/>
<transform value="copy"/>
<parameter>
<valueId value="Unit"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</group>
<group>
<name value="ObservationConsulenza"/>
<typeMode value="none"/>
<input>
<name value="obs"/>
<type value="Observation"/>
<mode value="source"/>
</input>
<input>
<name value="patient"/>
<type value="Patient"/>
<mode value="target"/>
</input>
<input>
<name value="encounter"/>
<type value="Encounter"/>
<mode value="target"/>
</input>
<input>
<name value="ob"/>
<type value="Observation"/>
<mode value="target"/>
</input>
<input>
<name value="bundle"/>
<type value="Bundle"/>
<mode value="target"/>
</input>
<rule>
<name value="reference"/>
<source>
<context value="obs"/>
</source>
<target>
<context value="ob"/>
<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="obs"/>
</source>
<target>
<context value="ob"/>
<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/' + %encounter.id"/>
</parameter>
</target>
</rule>
<rule>
<name value="code"/>
<source>
<context value="obs"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="obs"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'completed')"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="obs"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'active')"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="registered"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="obs"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'aborted')"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="cancelled"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="obs"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'suspended')"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="partial"/>
</parameter>
</target>
</rule>
<rule>
<name value="statuscode"/>
<source>
<context value="obs"/>
<condition value="obs.statusCode.exists().not()"/>
</source>
<rule>
<name value="status"/>
<source>
<context value="obs"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="value2c"/>
<source>
<context value="obs"/>
<element value="effectiveTime"/>
<variable value="effectiveTime"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="effective"/>
<variable value="value"/>
<transform value="create"/>
<parameter>
<valueString value="dateTime"/>
</parameter>
</target>
<dependent>
<name value="TSDateTime"/>
<variable value="effectiveTime"/>
<variable value="value"/>
</dependent>
</rule>
<rule>
<name value="where"/>
<source>
<context value="obs"/>
<condition
value="effectiveTime.low.exists() or effectiveTime.high.exists()"/>
</source>
<rule>
<name value="value3c"/>
<source>
<context value="obs"/>
<element value="effectiveTime"/>
<variable value="eff"/>
</source>
<target>
<context value="ob"/>
<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>
<rule>
<name value="value"/>
<source>
<context value="obs"/>
<type value="INT"/>
<element value="value"/>
<variable value="int"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="int.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="boolean"/>
<source>
<context value="obs"/>
<type value="BL"/>
<element value="value"/>
<variable value="boolean"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="boolean.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="val"/>
<source>
<context value="obs"/>
<type value="CE"/>
<element value="value"/>
<variable value="val"/>
</source>
<rule>
<name value="coding"/>
<source>
<context value="val"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="ce"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<rule>
<name value="originltext"/>
<source>
<context value="val"/>
<element value="originalText"/>
<variable value="originalText"/>
</source>
<rule>
<name value="reference"/>
<source>
<context value="originalText"/>
<element value="reference"/>
<variable value="reference"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="reference"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="code"/>
<source>
<context value="val"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="val"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="cast"/>
<parameter>
<valueId value="code"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystem"/>
<source>
<context value="val"/>
<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>
<name value="displayName"/>
<source>
<context value="val"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystemVersion"/>
<source>
<context value="val"/>
<element value="codeSystemVersion"/>
<variable value="version"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="version"/>
<transform value="cast"/>
<parameter>
<valueId value="version"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="translation"/>
<source>
<context value="val"/>
<element value="translation"/>
<variable value="translation"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="translation"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="cast"/>
<parameter>
<valueId value="code"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystem"/>
<source>
<context value="translation"/>
<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>
<name value="displayName"/>
<source>
<context value="translation"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystemVersion"/>
<source>
<context value="translation"/>
<element value="codeSystemVersion"/>
<variable value="version"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="version"/>
<transform value="cast"/>
<parameter>
<valueId value="version"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="qualifier"/>
<source>
<context value="translation"/>
<element value="qualifier"/>
<variable value="qualifier"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="qualifier"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="value"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="cast"/>
<parameter>
<valueId value="code"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystem"/>
<source>
<context value="value"/>
<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>
<name value="displayName"/>
<source>
<context value="value"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystemVersion"/>
<source>
<context value="value"/>
<element value="codeSystemVersion"/>
<variable value="version"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="version"/>
<transform value="cast"/>
<parameter>
<valueId value="version"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="val"/>
<source>
<context value="obs"/>
<type value="CD"/>
<element value="value"/>
<variable value="val"/>
</source>
<rule>
<name value="coding"/>
<source>
<context value="val"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="ce"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<rule>
<name value="originalText"/>
<source>
<context value="val"/>
<element value="originalText"/>
<variable value="vvv"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="text"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="code"/>
<source>
<context value="val"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="val"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="cast"/>
<parameter>
<valueId value="code"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystem"/>
<source>
<context value="val"/>
<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>
<name value="displayName"/>
<source>
<context value="val"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="translation"/>
<source>
<context value="val"/>
<element value="translation"/>
<variable value="translation"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="translation"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="cast"/>
<parameter>
<valueId value="code"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystem"/>
<source>
<context value="translation"/>
<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>
<name value="displayName"/>
<source>
<context value="translation"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="qualifier"/>
<source>
<context value="translation"/>
<element value="qualifier"/>
<variable value="qualifier"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="qualifier"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="value"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="cast"/>
<parameter>
<valueId value="code"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystem"/>
<source>
<context value="value"/>
<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>
<name value="displayName"/>
<source>
<context value="value"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="valueQuantity"/>
<source>
<context value="obs"/>
<type value="PQ"/>
<element value="value"/>
<variable value="val"/>
</source>
<rule>
<name value="quantity"/>
<source>
<context value="val"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="quantity"/>
<transform value="create"/>
<parameter>
<valueString value="Quantity"/>
</parameter>
</target>
<rule>
<name value="value"/>
<source>
<context value="val"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="quantity"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
</rule>
<rule>
<name value="unit"/>
<source>
<context value="val"/>
<element value="unit"/>
<variable value="unit"/>
</source>
<target>
<context value="quantity"/>
<contextType value="variable"/>
<element value="unit"/>
<transform value="copy"/>
<parameter>
<valueId value="unit"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="obs"/>
<type value="ST"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="create"/>
<parameter>
<valueString value="string"/>
</parameter>
</target>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="value.dataString"/>
</parameter>
</target>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="obs"/>
</source>
<target>
<context value="ob"/>
<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="obs"/>
</source>
<target>
<context value="ob"/>
<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/' + %encounter.id"/>
</parameter>
</target>
</rule>
<rule>
<name value="interpretationCode"/>
<source>
<context value="obs"/>
<element value="interpretationCode"/>
<variable value="vvv"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="interpretation"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="methodCode"/>
<source>
<context value="obs"/>
<element value="methodCode"/>
<variable value="vvv"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="method"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="refRange"/>
<source>
<context value="obs"/>
<element value="referenceRange"/>
<variable value="refRange"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="referenceRange"/>
<variable value="ref"/>
<transform value="create"/>
<parameter>
<valueString value="BackboneElement"/>
</parameter>
</target>
<rule>
<name value="obsRange"/>
<source>
<context value="refRange"/>
<element value="observationRange"/>
<variable value="obsRange"/>
</source>
<target>
<context value="ref"/>
<contextType value="variable"/>
<element value="low"/>
<variable value="Low"/>
<transform value="create"/>
<parameter>
<valueString value="SimpleQuantity"/>
</parameter>
</target>
<rule>
<name value="IVLPQ"/>
<source>
<context value="obsRange"/>
<type value="IVL_PQ"/>
<element value="value"/>
<variable value="v"/>
</source>
<rule>
<name value="decValue"/>
<source>
<context value="v"/>
<element value="low"/>
<variable value="l1"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="l1"/>
<element value="value"/>
<variable value="decValue"/>
</source>
<target>
<context value="Low"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="decValue"/>
</parameter>
</target>
</rule>
<rule>
<name value="unit"/>
<source>
<context value="l1"/>
<element value="unit"/>
<variable value="Unit"/>
</source>
<target>
<context value="Low"/>
<contextType value="variable"/>
<element value="unit"/>
<transform value="copy"/>
<parameter>
<valueId value="Unit"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="perf"/>
<source>
<context value="obs"/>
<element value="performer"/>
<variable value="performer"/>
</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="practitioner"/>
<transform value="create"/>
<parameter>
<valueString value="Practitioner"/>
</parameter>
</target>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid1"/>
<transform value="uuid"/>
</target>
<rule>
<name value="assEntity"/>
<source>
<context value="performer"/>
<element value="assignedEntity"/>
<variable value="assEntity"/>
</source>
<rule>
<name value="meta"/>
<source>
<context value="assEntity"/>
</source>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="meta"/>
<variable value="meta"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="assEntity"/>
</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="assEntity"/>
</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="assEntity"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString
value="ClinicalDocument/body/Consulenza/performer"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="identifier"/>
<source>
<context value="assEntity"/>
<element value="id"/>
<variable value="id"/>
</source>
<target>
<context value="practitioner"/>
<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="extension"/>
<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>
<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="aut"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext"/>
</source>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid2"/>
<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/Practitioner/"/>
</parameter>
<parameter>
<valueId value="uuid2"/>
</parameter>
</target>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="performer"/>
<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/Practitioner/' + %practitioner.id"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="2.16.840.1.113883.2.9.4.3.2"/>
<source>
<context value="assEntity"/>
<element value="id"/>
<variable value="id"/>
<condition value="(root = '2.16.840.1.113883.2.9.4.3.2')"/>
</source>
<rule>
<name value="UUID"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext"/>
</source>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="append"/>
<parameter>
<valueString value="Practitioner?identifier="/>
</parameter>
<parameter>
<valueId value="ext"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="assi"/>
<source>
<context value="assEntity"/>
<element value="assignedPerson"/>
<variable value="assi"/>
</source>
<rule>
<name value="name"/>
<source>
<context value="assi"/>
<element value="name"/>
<variable value="vvv"/>
</source>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="name"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="participant"/>
<source>
<context value="obs"/>
<element value="participant"/>
<variable value="participant"/>
</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="serviceRequest"/>
<transform value="create"/>
<parameter>
<valueString value="ServiceRequest"/>
</parameter>
</target>
<target>
<context value="serviceRequest"/>
<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/ServiceRequest/"/>
</parameter>
<parameter>
<valueId value="uuid1"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="ServiceRequest"/>
</parameter>
</target>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="basedOn"/>
<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/ServiceRequest/' + %serviceRequest.id"/>
</parameter>
</target>
<rule>
<name value="time"/>
<source>
<context value="participant"/>
<element value="time"/>
<variable value="t"/>
</source>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="authoredOn"/>
<transform value="evaluate"/>
<parameter>
<valueString value="t.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="obs"/>
</source>
<target>
<context value="serviceRequest"/>
<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="obs"/>
</source>
<target>
<context value="serviceRequest"/>
<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/' + %encounter.id"/>
</parameter>
</target>
</rule>
<rule>
<name value="status"/>
<source>
<context value="obs"/>
</source>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="active"/>
</parameter>
</target>
</rule>
<rule>
<name value="intent"/>
<source>
<context value="obs"/>
</source>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="intent"/>
<transform value="copy"/>
<parameter>
<valueString value="order"/>
</parameter>
</target>
</rule>
<rule>
<name value="participantRole"/>
<source>
<context value="participant"/>
<element value="participantRole"/>
<variable value="participantRole"/>
</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="practitioner"/>
<transform value="create"/>
<parameter>
<valueString value="Practitioner"/>
</parameter>
</target>
<rule>
<name value="meta"/>
<source>
<context value="participantRole"/>
</source>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="meta"/>
<variable value="meta"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="participantRole"/>
</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="participantRole"/>
</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="participantRole"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString
value="ClinicalDocument/body/Consulenza/participant"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="identifier"/>
<source>
<context value="participantRole"/>
<element value="id"/>
<variable value="id"/>
</source>
<target>
<context value="practitioner"/>
<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="extension"/>
<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>
<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="aut"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext"/>
</source>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid3"/>
<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/Practitioner/"/>
</parameter>
<parameter>
<valueId value="uuid3"/>
</parameter>
</target>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="performer"/>
<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/Practitioner/' + %practitioner.id"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="2.16.840.1.113883.2.9.4.3.2"/>
<source>
<context value="participantRole"/>
<element value="id"/>
<variable value="id"/>
<condition value="(root = '2.16.840.1.113883.2.9.4.3.2')"/>
</source>
<rule>
<name value="UUID"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext"/>
</source>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="append"/>
<parameter>
<valueString value="Practitioner?identifier="/>
</parameter>
<parameter>
<valueId value="ext"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="pe"/>
<source>
<context value="participantRole"/>
<element value="playingEntity"/>
<variable value="pe"/>
</source>
<rule>
<name value="name"/>
<source>
<context value="pe"/>
<element value="name"/>
<variable value="vvv"/>
</source>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="name"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</rule>
</rule>
</rule>
</group>
<group>
<name value="ObservationEsamiDuranteRicovero"/>
<typeMode value="none"/>
<input>
<name value="obs"/>
<type value="Observation"/>
<mode value="source"/>
</input>
<input>
<name value="patient"/>
<type value="Patient"/>
<mode value="target"/>
</input>
<input>
<name value="encounter"/>
<type value="Encounter"/>
<mode value="target"/>
</input>
<input>
<name value="ob"/>
<type value="Observation"/>
<mode value="target"/>
</input>
<input>
<name value="bundle"/>
<type value="Bundle"/>
<mode value="target"/>
</input>
<rule>
<name value="reference"/>
<source>
<context value="obs"/>
</source>
<target>
<context value="ob"/>
<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="obs"/>
</source>
<target>
<context value="ob"/>
<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/' + %encounter.id"/>
</parameter>
</target>
</rule>
<rule>
<name value="code"/>
<source>
<context value="obs"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="obs"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'completed')"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="obs"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'active')"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="registered"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="obs"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'aborted')"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="cancelled"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="obs"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'suspended')"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="partial"/>
</parameter>
</target>
</rule>
<rule>
<name value="statuscode"/>
<source>
<context value="obs"/>
<condition value="obs.statusCode.exists().not()"/>
</source>
<rule>
<name value="status"/>
<source>
<context value="obs"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="value2r"/>
<source>
<context value="obs"/>
<element value="effectiveTime"/>
<variable value="effectiveTime"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="effective"/>
<variable value="value"/>
<transform value="create"/>
<parameter>
<valueString value="dateTime"/>
</parameter>
</target>
<dependent>
<name value="TSDateTime"/>
<variable value="effectiveTime"/>
<variable value="value"/>
</dependent>
</rule>
<rule>
<name value="where"/>
<source>
<context value="obs"/>
<condition
value="effectiveTime.low.exists() or effectiveTime.high.exists()"/>
</source>
<rule>
<name value="value3r"/>
<source>
<context value="obs"/>
<element value="effectiveTime"/>
<variable value="eff"/>
</source>
<target>
<context value="ob"/>
<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>
<rule>
<name value="value"/>
<source>
<context value="obs"/>
<type value="INT"/>
<element value="value"/>
<variable value="int"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="int.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="boolean"/>
<source>
<context value="obs"/>
<type value="BL"/>
<element value="value"/>
<variable value="boolean"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="boolean.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="val"/>
<source>
<context value="obs"/>
<type value="CE"/>
<element value="value"/>
<variable value="val"/>
</source>
<rule>
<name value="coding"/>
<source>
<context value="val"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="ce"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<rule>
<name value="originltext"/>
<source>
<context value="val"/>
<element value="originalText"/>
<variable value="originalText"/>
</source>
<rule>
<name value="reference"/>
<source>
<context value="originalText"/>
<element value="reference"/>
<variable value="reference"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="reference"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="code"/>
<source>
<context value="val"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="val"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="cast"/>
<parameter>
<valueId value="code"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystem"/>
<source>
<context value="val"/>
<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>
<name value="displayName"/>
<source>
<context value="val"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystemVersion"/>
<source>
<context value="val"/>
<element value="codeSystemVersion"/>
<variable value="version"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="version"/>
<transform value="cast"/>
<parameter>
<valueId value="version"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="translation"/>
<source>
<context value="val"/>
<element value="translation"/>
<variable value="translation"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="translation"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="cast"/>
<parameter>
<valueId value="code"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystem"/>
<source>
<context value="translation"/>
<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>
<name value="displayName"/>
<source>
<context value="translation"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystemVersion"/>
<source>
<context value="translation"/>
<element value="codeSystemVersion"/>
<variable value="version"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="version"/>
<transform value="cast"/>
<parameter>
<valueId value="version"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="qualifier"/>
<source>
<context value="translation"/>
<element value="qualifier"/>
<variable value="qualifier"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="qualifier"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="value"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="cast"/>
<parameter>
<valueId value="code"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystem"/>
<source>
<context value="value"/>
<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>
<name value="displayName"/>
<source>
<context value="value"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystemVersion"/>
<source>
<context value="value"/>
<element value="codeSystemVersion"/>
<variable value="version"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="version"/>
<transform value="cast"/>
<parameter>
<valueId value="version"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="val"/>
<source>
<context value="obs"/>
<type value="CD"/>
<element value="value"/>
<variable value="val"/>
</source>
<rule>
<name value="coding"/>
<source>
<context value="val"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="ce"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<rule>
<name value="originalText"/>
<source>
<context value="val"/>
<element value="originalText"/>
<variable value="vvv"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="text"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="code"/>
<source>
<context value="val"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="val"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="cast"/>
<parameter>
<valueId value="code"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystem"/>
<source>
<context value="val"/>
<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>
<name value="displayName"/>
<source>
<context value="val"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="translation"/>
<source>
<context value="val"/>
<element value="translation"/>
<variable value="translation"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="translation"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="cast"/>
<parameter>
<valueId value="code"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystem"/>
<source>
<context value="translation"/>
<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>
<name value="displayName"/>
<source>
<context value="translation"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="qualifier"/>
<source>
<context value="translation"/>
<element value="qualifier"/>
<variable value="qualifier"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="qualifier"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="ce"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="code"/>
<source>
<context value="value"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="cast"/>
<parameter>
<valueId value="code"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
<rule>
<name value="codeSystem"/>
<source>
<context value="value"/>
<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>
<name value="displayName"/>
<source>
<context value="value"/>
<element value="displayName"/>
<variable value="display"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="cast"/>
<parameter>
<valueId value="display"/>
</parameter>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="valueQuantity"/>
<source>
<context value="obs"/>
<type value="PQ"/>
<element value="value"/>
<variable value="val"/>
</source>
<rule>
<name value="quantity"/>
<source>
<context value="val"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="quantity"/>
<transform value="create"/>
<parameter>
<valueString value="Quantity"/>
</parameter>
</target>
<rule>
<name value="value"/>
<source>
<context value="val"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="quantity"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
</rule>
<rule>
<name value="unit"/>
<source>
<context value="val"/>
<element value="unit"/>
<variable value="unit"/>
</source>
<target>
<context value="quantity"/>
<contextType value="variable"/>
<element value="unit"/>
<transform value="copy"/>
<parameter>
<valueId value="unit"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="value"/>
<source>
<context value="obs"/>
<type value="ST"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="create"/>
<parameter>
<valueString value="string"/>
</parameter>
</target>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="value.dataString"/>
</parameter>
</target>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="obs"/>
</source>
<target>
<context value="ob"/>
<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="obs"/>
</source>
<target>
<context value="ob"/>
<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/' + %encounter.id"/>
</parameter>
</target>
</rule>
<rule>
<name value="interpretationCode"/>
<source>
<context value="obs"/>
<element value="interpretationCode"/>
<variable value="vvv"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="interpretation"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="methodCode"/>
<source>
<context value="obs"/>
<element value="methodCode"/>
<variable value="vvv"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="method"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="effectiveTime"/>
<source>
<context value="obs"/>
<element value="effectiveTime"/>
<variable value="eff"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="effective"/>
<variable value="per"/>
<transform value="create"/>
<parameter>
<valueString value="Period"/>
</parameter>
</target>
<dependent>
<name value="IVLTSPeriod"/>
<variable value="eff"/>
<variable value="per"/>
</dependent>
</rule>
<rule>
<name value="refRange"/>
<source>
<context value="obs"/>
<element value="referenceRange"/>
<variable value="refRange"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="referenceRange"/>
<variable value="ref"/>
<transform value="create"/>
<parameter>
<valueString value="BackboneElement"/>
</parameter>
</target>
<rule>
<name value="obsRange"/>
<source>
<context value="refRange"/>
<element value="observationRange"/>
<variable value="obsRange"/>
</source>
<target>
<context value="ref"/>
<contextType value="variable"/>
<element value="low"/>
<variable value="Low"/>
<transform value="create"/>
<parameter>
<valueString value="SimpleQuantity"/>
</parameter>
</target>
<rule>
<name value="IVLPQ"/>
<source>
<context value="obsRange"/>
<type value="IVL_PQ"/>
<element value="value"/>
<variable value="v"/>
</source>
<rule>
<name value="decValue"/>
<source>
<context value="v"/>
<element value="low"/>
<variable value="l1"/>
</source>
<rule>
<name value="value"/>
<source>
<context value="l1"/>
<element value="value"/>
<variable value="decValue"/>
</source>
<target>
<context value="Low"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="decValue"/>
</parameter>
</target>
</rule>
<rule>
<name value="unit"/>
<source>
<context value="l1"/>
<element value="unit"/>
<variable value="Unit"/>
</source>
<target>
<context value="Low"/>
<contextType value="variable"/>
<element value="unit"/>
<transform value="copy"/>
<parameter>
<valueId value="Unit"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="perf"/>
<source>
<context value="obs"/>
<element value="performer"/>
<variable value="performer"/>
</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="practitioner"/>
<transform value="create"/>
<parameter>
<valueString value="Practitioner"/>
</parameter>
</target>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid1"/>
<transform value="uuid"/>
</target>
<rule>
<name value="assEntity"/>
<source>
<context value="performer"/>
<element value="assignedEntity"/>
<variable value="assEntity"/>
</source>
<rule>
<name value="meta"/>
<source>
<context value="assEntity"/>
</source>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="meta"/>
<variable value="meta"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="assEntity"/>
</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="assEntity"/>
</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="assEntity"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString
value="ClinicalDocument/body/EsamiDuranteRicovero/performer"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="identifier"/>
<source>
<context value="assEntity"/>
<element value="id"/>
<variable value="id"/>
</source>
<target>
<context value="practitioner"/>
<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="extension"/>
<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>
<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="aut"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext"/>
</source>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid2"/>
<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/Practitioner/"/>
</parameter>
<parameter>
<valueId value="uuid2"/>
</parameter>
</target>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="performer"/>
<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/Practitioner/' + %practitioner.id"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="2.16.840.1.113883.2.9.4.3.2"/>
<source>
<context value="assEntity"/>
<element value="id"/>
<variable value="id"/>
<condition value="(root = '2.16.840.1.113883.2.9.4.3.2')"/>
</source>
<rule>
<name value="UUID"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext"/>
</source>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="append"/>
<parameter>
<valueString value="Practitioner?identifier="/>
</parameter>
<parameter>
<valueId value="ext"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="assi"/>
<source>
<context value="assEntity"/>
<element value="assignedPerson"/>
<variable value="assi"/>
</source>
<rule>
<name value="name"/>
<source>
<context value="assi"/>
<element value="name"/>
<variable value="vvv"/>
</source>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="name"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="participant"/>
<source>
<context value="obs"/>
<element value="participant"/>
<variable value="participant"/>
</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="serviceRequest"/>
<transform value="create"/>
<parameter>
<valueString value="ServiceRequest"/>
</parameter>
</target>
<target>
<context value="serviceRequest"/>
<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/ServiceRequest/"/>
</parameter>
<parameter>
<valueId value="uuid1"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="ServiceRequest"/>
</parameter>
</target>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="basedOn"/>
<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/ServiceRequest/' + %serviceRequest.id"/>
</parameter>
</target>
<rule>
<name value="time"/>
<source>
<context value="participant"/>
<element value="time"/>
<variable value="t"/>
</source>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="authoredOn"/>
<transform value="evaluate"/>
<parameter>
<valueString value="t.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="obs"/>
</source>
<target>
<context value="serviceRequest"/>
<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="obs"/>
</source>
<target>
<context value="serviceRequest"/>
<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/' + %encounter.id"/>
</parameter>
</target>
</rule>
<rule>
<name value="status"/>
<source>
<context value="obs"/>
</source>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="active"/>
</parameter>
</target>
</rule>
<rule>
<name value="intent"/>
<source>
<context value="obs"/>
</source>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="intent"/>
<transform value="copy"/>
<parameter>
<valueString value="order"/>
</parameter>
</target>
</rule>
<rule>
<name value="participantRole"/>
<source>
<context value="participant"/>
<element value="participantRole"/>
<variable value="participantRole"/>
</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="practitioner"/>
<transform value="create"/>
<parameter>
<valueString value="Practitioner"/>
</parameter>
</target>
<rule>
<name value="meta"/>
<source>
<context value="participantRole"/>
</source>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="meta"/>
<variable value="meta"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="participantRole"/>
</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="participantRole"/>
</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="participantRole"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString
value="ClinicalDocument/body/EsamiDuranteRicovero/participant"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="identifier"/>
<source>
<context value="participantRole"/>
<element value="id"/>
<variable value="id"/>
</source>
<target>
<context value="practitioner"/>
<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="extension"/>
<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>
<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="aut"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext"/>
</source>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid3"/>
<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/Practitioner/"/>
</parameter>
<parameter>
<valueId value="uuid3"/>
</parameter>
</target>
<target>
<context value="serviceRequest"/>
<contextType value="variable"/>
<element value="performer"/>
<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/Practitioner/' + %practitioner.id"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="2.16.840.1.113883.2.9.4.3.2"/>
<source>
<context value="participantRole"/>
<element value="id"/>
<variable value="id"/>
<condition value="(root = '2.16.840.1.113883.2.9.4.3.2')"/>
</source>
<rule>
<name value="UUID"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext"/>
</source>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="append"/>
<parameter>
<valueString value="Practitioner?identifier="/>
</parameter>
<parameter>
<valueId value="ext"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="pe"/>
<source>
<context value="participantRole"/>
<element value="playingEntity"/>
<variable value="pe"/>
</source>
<rule>
<name value="name"/>
<source>
<context value="pe"/>
<element value="name"/>
<variable value="vvv"/>
</source>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="name"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</rule>
</rule>
</rule>
</group>
<group>
<name value="periodTiming"/>
<typeMode value="none"/>
<input>
<name value="effectiveTime"/>
<type value="PIVL_TS"/>
<mode value="source"/>
</input>
<input>
<name value="timing"/>
<type value="Timing"/>
<mode value="target"/>
</input>
<rule>
<name value="repeat"/>
<source>
<context value="effectiveTime"/>
</source>
<target>
<context value="timing"/>
<contextType value="variable"/>
<element value="repeat"/>
<variable value="r"/>
</target>
<rule>
<name value="period"/>
<source>
<context value="effectiveTime"/>
<element value="period"/>
<variable value="p"/>
</source>
<target>
<context value="r"/>
<contextType value="variable"/>
<element value="period"/>
<transform value="evaluate"/>
<parameter>
<valueString value="p.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="period"/>
<source>
<context value="effectiveTime"/>
<element value="period"/>
<variable value="p"/>
</source>
<target>
<context value="r"/>
<contextType value="variable"/>
<element value="periodUnit"/>
<transform value="evaluate"/>
<parameter>
<valueString value="p.unit"/>
</parameter>
</target>
</rule>
</rule>
</group>
<group>
<name value="Act"/>
<typeMode value="none"/>
<documentation
value="---------------------------------------------------------------------------------------"/>
<input>
<name value="cda"/>
<type value="Act"/>
<mode value="source"/>
</input>
<input>
<name value="pat"/>
<type value="Patient"/>
<mode value="target"/>
</input>
<input>
<name value="ac"/>
<type value="DiagnosticReport"/>
<mode value="target"/>
</input>
<input>
<name value="enc"/>
<type value="Encounter"/>
<mode value="target"/>
</input>
<input>
<name value="bundle"/>
<type value="Bundle"/>
<mode value="target"/>
</input>
<rule>
<name value="code"/>
<source>
<context value="cda"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="ac"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="cda"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'completed')"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="final"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="cda"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'active')"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="registered"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="cda"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'aborted')"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="cancelled"/>
</parameter>
</target>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="cda"/>
<element value="statusCode"/>
<variable value="statusc"/>
<condition value="(code = 'suspended')"/>
</source>
<target>
<context value="ob"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="partial"/>
</parameter>
</target>
</rule>
<rule>
<name value="value2a"/>
<source>
<context value="cda"/>
<element value="effectiveTime"/>
<variable value="effectiveTime"/>
</source>
<target>
<context value="ac"/>
<contextType value="variable"/>
<element value="effective"/>
<variable value="value"/>
<transform value="create"/>
<parameter>
<valueString value="dateTime"/>
</parameter>
</target>
<dependent>
<name value="TSDateTime"/>
<variable value="effectiveTime"/>
<variable value="value"/>
</dependent>
</rule>
<rule>
<name value="where"/>
<source>
<context value="obs"/>
<condition
value="effectiveTime.low.exists() or effectiveTime.high.exists()"/>
</source>
<rule>
<name value="value3a"/>
<source>
<context value="cda"/>
<element value="effectiveTime"/>
<variable value="eff"/>
</source>
<target>
<context value="ac"/>
<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>
<rule>
<name value="reference"/>
<source>
<context value="cda"/>
</source>
<target>
<context value="ac"/>
<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/' + %pat.id"/>
</parameter>
</target>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="cda"/>
</source>
<target>
<context value="ac"/>
<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/' + %enc.id"/>
</parameter>
</target>
</rule>
<rule>
<name value="participant"/>
<source>
<context value="cda"/>
<element value="participant"/>
<variable value="part"/>
</source>
<target>
<context value="enc"/>
<contextType value="variable"/>
<element value="participant"/>
<variable value="participant"/>
</target>
<rule>
<name value="type"/>
<source>
<context value="part"/>
</source>
<target>
<context value="participant"/>
<contextType value="variable"/>
<element value="type"/>
<variable value="type"/>
</target>
<rule>
<name value="codeType"/>
<source>
<context value="part"/>
</source>
<target>
<context value="type"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<rule>
<name value="codice"/>
<source>
<context value="part"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="evaluate"/>
<parameter>
<valueString value="part.typeCode"/>
</parameter>
</target>
</rule>
<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://terminology.hl7.org/CodeSystem/v3-ParticipationType"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="participantRole"/>
<source>
<context value="part"/>
<element value="participantRole"/>
<variable value="participantRole"/>
</source>
<target>
<context value="participant"/>
<contextType value="variable"/>
<element value="individual"/>
<variable value="reference"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<rule>
<name value="participanRoleBund"/>
<source>
<context value="participantRole"/>
</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="PUT"/>
</parameter>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="practitioner"/>
<transform value="create"/>
<parameter>
<valueString value="Practitioner"/>
</parameter>
</target>
<target>
<context value="practitioner"/>
<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/Practitioner/"/>
</parameter>
<parameter>
<valueId value="uuid1"/>
</parameter>
</target>
<target>
<context value="reference"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString
value="'https://example/Practitioner/' + %practitioner.id"/>
</parameter>
</target>
<rule>
<name value="meta"/>
<source>
<context value="participantRole"/>
</source>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="meta"/>
<variable value="meta"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="participantRole"/>
</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="participantRole"/>
</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="participantRole"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString
value="ClinicalDocument/body/Act/participant"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="identifier"/>
<source>
<context value="participantRole"/>
<element value="id"/>
<variable value="id"/>
</source>
<target>
<context value="practitioner"/>
<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="participantRole"/>
</source>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="append"/>
<parameter>
<valueString value="Practitioner?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>
<rule>
<name value="playingEntity"/>
<source>
<context value="participantRole"/>
<element value="playingEntity"/>
<variable value="playingEntity"/>
</source>
<rule>
<name value="name"/>
<source>
<context value="playingEntity"/>
<element value="name"/>
<variable value="vvv"/>
</source>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="name"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="entryRelationship"/>
<source>
<context value="cda"/>
<element value="entryRelationship"/>
<variable value="entryRelationship"/>
</source>
<rule>
<name value="OBS"/>
<source>
<context value="entryRelationship"/>
<element value="observation"/>
<variable value="observation"/>
</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="obs"/>
<transform value="create"/>
<parameter>
<valueString value="Observation"/>
</parameter>
</target>
<target>
<context value="obs"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid2"/>
<transform value="uuid"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="https://example/Observation/"/>
</parameter>
<parameter>
<valueId value="uuid2"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="append"/>
<parameter>
<valueString value="Observation/"/>
</parameter>
<parameter>
<valueId value="uuid2"/>
</parameter>
</target>
<target>
<context value="ac"/>
<contextType value="variable"/>
<element value="result"/>
<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/' + %obs.id"/>
</parameter>
</target>
<dependent>
<name value="Observation"/>
<variable value="observation"/>
<variable value="pat"/>
<variable value="enc"/>
<variable value="obs"/>
<variable value="bundle"/>
</dependent>
</rule>
</rule>
</group>
<group>
<name value="ClinicalDocumentSectionTerapiaDimissione"/>
<typeMode value="none"/>
<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="exist"/>
<source>
<context value="src"/>
<condition value="src.entry.exists()"/>
</source>
<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>
<rule>
<name value="where"/>
<source>
<context value="src"/>
<condition value="src.entry.exists().not()"/>
</source>
<rule>
<name value="cdaText"/>
<source>
<context value="src"/>
<element value="text"/>
<variable value="cdaText"/>
</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="medicationRq"/>
<transform value="create"/>
<parameter>
<valueString value="MedicationRequest"/>
</parameter>
</target>
<target>
<context value="medicationRq"/>
<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/MedicationRequest/"/>
</parameter>
<parameter>
<valueId value="uuid1"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="MedicationRequest"/>
</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/MedicationRequest/' + %medicationRq.id"/>
</parameter>
</target>
<rule>
<name value="reference"/>
<source>
<context value="src"/>
</source>
<target>
<context value="medicationRq"/>
<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="src"/>
</source>
<target>
<context value="medicationRq"/>
<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="status"/>
<source>
<context value="src"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="active"/>
</parameter>
</target>
</rule>
<rule>
<name value="intent"/>
<source>
<context value="src"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="intent"/>
<transform value="copy"/>
<parameter>
<valueString value="order"/>
</parameter>
</target>
</rule>
<rule>
<name value="code"/>
<source>
<context value="cdaText"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="medication"/>
<variable value="codecon"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<rule>
<name value="text"/>
<source>
<context value="cdaText"/>
</source>
<target>
<context value="codecon"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueString value="string"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="note"/>
<variable value="note"/>
</target>
<rule>
<name value="reference"/>
<source>
<context value="cdaText"/>
<variable value="t"/>
</source>
<target>
<context value="note"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="t"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="substract"/>
<source>
<context value="src"/>
<element value="entry"/>
<variable value="entry1"/>
</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="medicationRq"/>
<transform value="create"/>
<parameter>
<valueString value="MedicationRequest"/>
</parameter>
</target>
<target>
<context value="medicationRq"/>
<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/MedicationRequest/"/>
</parameter>
<parameter>
<valueId value="uuid1"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="MedicationRequest"/>
</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/MedicationRequest/' + %medicationRq.id"/>
</parameter>
</target>
<rule>
<name value="reference"/>
<source>
<context value="src"/>
</source>
<target>
<context value="medicationRq"/>
<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="src"/>
</source>
<target>
<context value="medicationRq"/>
<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="status"/>
<source>
<context value="src"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="active"/>
</parameter>
</target>
</rule>
<rule>
<name value="intent"/>
<source>
<context value="src"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="intent"/>
<transform value="copy"/>
<parameter>
<valueString value="order"/>
</parameter>
</target>
</rule>
<rule>
<name value="participant"/>
<source>
<context value="entry1"/>
<element value="substanceAdministration"/>
<variable value="substract"/>
</source>
<rule>
<name value="cons"/>
<source>
<context value="substract"/>
<element value="consumable"/>
<variable value="cons"/>
</source>
<rule>
<name value="man1"/>
<source>
<context value="cons"/>
<element value="manufacturedProduct"/>
<variable value="man1"/>
</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="medication"/>
<transform value="create"/>
<parameter>
<valueString value="Medication"/>
</parameter>
</target>
<target>
<context value="medication"/>
<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/Medication/"/>
</parameter>
<parameter>
<valueId value="uuid1"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="Medication"/>
</parameter>
</target>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="medication"/>
<variable value="medref"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="medref"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString
value="'https://example/Medication/' + %medication.id"/>
</parameter>
</target>
<rule>
<name value="mm"/>
<source>
<context value="man1"/>
<element value="manufacturedMaterial"/>
<variable value="mm"/>
</source>
<rule>
<name value="code"/>
<source>
<context value="mm"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="medication"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</rule>
<rule>
<name value="administrationUnitCode"/>
<source>
<context value="substract"/>
<element value="administrationUnitCode"/>
<variable value="vvv"/>
</source>
<target>
<context value="medication"/>
<contextType value="variable"/>
<element value="form"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="entryR"/>
<source>
<context value="substract"/>
<element value="entryRelationship"/>
<variable value="entryR"/>
</source>
<rule>
<name value="obs"/>
<source>
<context value="entryR"/>
<element value="observation"/>
<variable value="observation"/>
</source>
<rule>
<name value="ingredient"/>
<source>
<context value="observation"/>
<element value="code"/>
<condition value="displayName = 'Grammatura'"/>
</source>
<target>
<context value="medication"/>
<contextType value="variable"/>
<element value="ingredient"/>
<variable value="ingredient"/>
</target>
<rule>
<name value="consumable"/>
<source>
<context value="substract"/>
<element value="consumable"/>
<variable value="consumable"/>
</source>
<rule>
<name value="product"/>
<source>
<context value="consumable"/>
<element value="manufacturedProduct"/>
<variable value="manufacturedProduct"/>
</source>
<rule>
<name value="material"/>
<source>
<context value="manufacturedProduct"/>
<element value="manufacturedMaterial"/>
<variable value="manufacturedMaterial"/>
</source>
<rule>
<name value="CE"/>
<source>
<context value="manufacturedMaterial"/>
<element value="code"/>
<variable value="code"/>
</source>
<target>
<context value="ingredient"/>
<contextType value="variable"/>
<element value="item"/>
<variable value="value"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<dependent>
<name value="CECodeableConcept"/>
<variable value="code"/>
<variable value="value"/>
</dependent>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="strenght"/>
<source>
<context value="observation"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="ingredient"/>
<contextType value="variable"/>
<element value="strength"/>
<variable value="strength"/>
</target>
<rule>
<name value="numerator"/>
<source>
<context value="value"/>
</source>
<target>
<context value="strength"/>
<contextType value="variable"/>
<element value="numerator"/>
<variable value="numerator"/>
</target>
<rule>
<name value="valueN"/>
<source>
<context value="value"/>
</source>
<target>
<context value="numerator"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="value.value"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="denominator"/>
<source>
<context value="value"/>
</source>
<target>
<context value="strength"/>
<contextType value="variable"/>
<element value="denominator"/>
<variable value="denominator"/>
</target>
<rule>
<name value="valueD"/>
<source>
<context value="value"/>
</source>
<target>
<context value="denominator"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueInteger value="1"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="quantita"/>
<source>
<context value="observation"/>
<element value="code"/>
<condition
value="displayName = 'Quantità nella Confezione'"/>
</source>
<rule>
<name value="amount"/>
<source>
<context value="observation"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="medication"/>
<contextType value="variable"/>
<element value="amount"/>
<variable value="amount"/>
</target>
<rule>
<name value="numerator"/>
<source>
<context value="value"/>
</source>
<target>
<context value="amount"/>
<contextType value="variable"/>
<element value="numerator"/>
<variable value="numerator"/>
</target>
<rule>
<name value="valueN"/>
<source>
<context value="value"/>
</source>
<target>
<context value="numerator"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="value.value"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="denominator"/>
<source>
<context value="value"/>
</source>
<target>
<context value="amount"/>
<contextType value="variable"/>
<element value="denominator"/>
<variable value="denominator"/>
</target>
<rule>
<name value="valueD"/>
<source>
<context value="value"/>
</source>
<target>
<context value="denominator"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueInteger value="1"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="entry"/>
<source>
<context value="substract"/>
<element value="entryRelationship"/>
<variable value="entryRelationship"/>
</source>
<rule>
<name value="sub"/>
<source>
<context value="entryRelationship"/>
<element value="supply"/>
<variable value="sup"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="dispenseRequest"/>
<variable value="dispreq"/>
</target>
<rule>
<name value="quantity"/>
<source>
<context value="sup"/>
</source>
<target>
<context value="dispreq"/>
<contextType value="variable"/>
<element value="quantity"/>
<variable value="quantity"/>
<transform value="create"/>
<parameter>
<valueString value="SimpleQuantity"/>
</parameter>
</target>
<rule>
<name value="quantity"/>
<source>
<context value="sup"/>
<element value="quantity"/>
<variable 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>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="tx"/>
<source>
<context value="substract"/>
<element value="text"/>
<variable value="tx"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="note"/>
<variable value="note"/>
</target>
<rule>
<name value="reference"/>
<source>
<context value="tx"/>
<element value="reference"/>
<variable value="ref"/>
</source>
<target>
<context value="note"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="evaluate"/>
<parameter>
<valueString value="ref.value"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="statusCode"/>
<source>
<context value="substract"/>
<element value="statusCode"/>
<variable value="st"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="evaluate"/>
<parameter>
<valueString value="st.code"/>
</parameter>
</target>
</rule>
<rule>
<name value="period"/>
<source>
<context value="substract"/>
<type value="IVL_TS"/>
<element value="effectiveTime"/>
<variable value="eff"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="dosageInstruction"/>
<variable value="dosage"/>
<transform value="create"/>
<parameter>
<valueString value="Dosage"/>
</parameter>
</target>
<rule>
<name value="timing"/>
<source>
<context value="eff"/>
</source>
<target>
<context value="dosage"/>
<contextType value="variable"/>
<element value="timing"/>
<variable value="timing"/>
<transform value="create"/>
<parameter>
<valueString value="Timing"/>
</parameter>
</target>
<rule>
<name value="rep"/>
<source>
<context value="eff"/>
</source>
<target>
<context value="timing"/>
<contextType value="variable"/>
<element value="repeat"/>
<variable value="rep"/>
</target>
<rule>
<name value="period"/>
<source>
<context value="eff"/>
</source>
<target>
<context value="rep"/>
<contextType value="variable"/>
<element value="bounds"/>
<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>
</rule>
</rule>
<rule>
<name value="period"/>
<source>
<context value="substract"/>
<type value="EIVL_TS"/>
<element value="effectiveTime"/>
<variable value="eff"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="dosageInstruction"/>
<variable value="dosage"/>
<transform value="create"/>
<parameter>
<valueString value="Dosage"/>
</parameter>
</target>
<rule>
<name value="timing"/>
<source>
<context value="eff"/>
</source>
<target>
<context value="dosage"/>
<contextType value="variable"/>
<element value="timing"/>
<variable value="timing"/>
<transform value="create"/>
<parameter>
<valueString value="Timing"/>
</parameter>
</target>
<rule>
<name value="rep"/>
<source>
<context value="eff"/>
</source>
<target>
<context value="timing"/>
<contextType value="variable"/>
<element value="repeat"/>
<variable value="rep"/>
</target>
<rule>
<name value="event"/>
<source>
<context value="eff"/>
<element value="event"/>
<variable value="ev"/>
</source>
<target>
<context value="rep"/>
<contextType value="variable"/>
<element value="when"/>
<transform value="evaluate"/>
<parameter>
<valueString value="ev.code"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="tim"/>
<source>
<context value="substract"/>
<type value="IVL_TS"/>
<element value="effectiveTime"/>
<variable value="eff"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="dosageInstruction"/>
<variable value="dosage"/>
<transform value="create"/>
<parameter>
<valueString value="Dosage"/>
</parameter>
</target>
<target>
<context value="dosage"/>
<contextType value="variable"/>
<element value="timing"/>
<variable value="timing"/>
<transform value="create"/>
<parameter>
<valueString value="Timing"/>
</parameter>
</target>
<target>
<context value="timing"/>
<contextType value="variable"/>
<element value="event"/>
<transform value="evaluate"/>
<parameter>
<valueString value="eff.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="eff"/>
<source>
<context value="substract"/>
<type value="PIVL_TS"/>
<element value="effectiveTime"/>
<variable value="eff"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="dosageInstruction"/>
<variable value="dosage"/>
<transform value="create"/>
<parameter>
<valueString value="Dosage"/>
</parameter>
</target>
<rule>
<name value="cod"/>
<source>
<context value="eff"/>
</source>
<target>
<context value="dosage"/>
<contextType value="variable"/>
<element value="timing"/>
<variable value="timing"/>
<transform value="create"/>
<parameter>
<valueString value="Timing"/>
</parameter>
</target>
<dependent>
<name value="periodTiming"/>
<variable value="eff"/>
<variable value="timing"/>
</dependent>
</rule>
</rule>
<rule>
<name value="dosage"/>
<source>
<context value="substract"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="dosageInstruction"/>
<variable value="dosage"/>
<transform value="create"/>
<parameter>
<valueString value="Dosage"/>
</parameter>
</target>
<rule>
<name value="routeCode"/>
<source>
<context value="substract"/>
<element value="routeCode"/>
<variable value="vvv"/>
</source>
<target>
<context value="dosage"/>
<contextType value="variable"/>
<element value="route"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</rule>
<rule>
<name value="dosage"/>
<source>
<context value="substract"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="dosageInstruction"/>
<variable value="dosage"/>
<transform value="create"/>
<parameter>
<valueString value="Dosage"/>
</parameter>
</target>
<rule>
<name value="approachSiteCode"/>
<source>
<context value="substract"/>
<element value="approachSiteCode"/>
<variable value="vvv"/>
</source>
<target>
<context value="dosage"/>
<contextType value="variable"/>
<element value="site"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</rule>
<rule>
<name value="Dosage"/>
<source>
<context value="substract"/>
<element value="doseQuantity"/>
<variable value="doseQuant"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="dosageInstruction"/>
<variable value="dosageInstruction"/>
<transform value="create"/>
<parameter>
<valueString value="Dosage"/>
</parameter>
</target>
<rule>
<name value="ot"/>
<source>
<context value="doseQuant"/>
<element value="originalText"/>
<variable value="ot"/>
</source>
<rule>
<name value="reference"/>
<source>
<context value="ot"/>
<element value="reference"/>
<variable value="vvv"/>
</source>
<target>
<context value="dosageInstruction"/>
<contextType value="variable"/>
<element value="text"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</rule>
<rule>
<name value="dosageRate"/>
<source>
<context value="doseQuant"/>
</source>
<target>
<context value="dosageInstruction"/>
<contextType value="variable"/>
<element value="doseAndRate"/>
<variable value="dosageRate"/>
</target>
<rule>
<name value="d"/>
<source>
<context value="doseQuant"/>
</source>
<target>
<context value="dosageRate"/>
<contextType value="variable"/>
<element value="dose"/>
<variable value="d"/>
<transform value="create"/>
<parameter>
<valueString value="Range"/>
</parameter>
</target>
<rule>
<name value="low"/>
<source>
<context value="doseQuant"/>
</source>
<target>
<context value="d"/>
<contextType value="variable"/>
<element value="low"/>
<variable value="l"/>
<transform value="create"/>
<parameter>
<valueString value="SimpleQuantity"/>
</parameter>
</target>
<rule>
<name value="low"/>
<source>
<context value="doseQuant"/>
<element value="low"/>
<variable value="lo"/>
</source>
<target>
<context value="l"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="lo.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="low"/>
<source>
<context value="doseQuant"/>
<element value="low"/>
<variable value="lo"/>
</source>
<target>
<context value="l"/>
<contextType value="variable"/>
<element value="unit"/>
<transform value="evaluate"/>
<parameter>
<valueString value="lo.unit"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="low"/>
<source>
<context value="doseQuant"/>
</source>
<target>
<context value="d"/>
<contextType value="variable"/>
<element value="high"/>
<variable value="h"/>
<transform value="create"/>
<parameter>
<valueString value="SimpleQuantity"/>
</parameter>
</target>
<rule>
<name value="high"/>
<source>
<context value="doseQuant"/>
<element value="high"/>
<variable value="hi"/>
</source>
<target>
<context value="h"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="hi.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="high"/>
<source>
<context value="doseQuant"/>
<element value="high"/>
<variable value="hi"/>
</source>
<target>
<context value="h"/>
<contextType value="variable"/>
<element value="unit"/>
<transform value="evaluate"/>
<parameter>
<valueString value="hi.unit"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="rateq"/>
<source>
<context value="substract"/>
<element value="rateQuantity"/>
<variable value="rateQuantity"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="dosageInstruction"/>
<variable value="dosageInstruction1"/>
<transform value="create"/>
<parameter>
<valueString value="Dosage"/>
</parameter>
</target>
<rule>
<name value="ot"/>
<source>
<context value="rateQuantity"/>
<element value="originalText"/>
<variable value="ot"/>
</source>
<rule>
<name value="reference"/>
<source>
<context value="ot"/>
<element value="reference"/>
<variable value="vvv"/>
</source>
<target>
<context value="dosageInstruction1"/>
<contextType value="variable"/>
<element value="text"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</rule>
<rule>
<name value="dosageRate"/>
<source>
<context value="rateQuantity"/>
</source>
<target>
<context value="dosageInstruction1"/>
<contextType value="variable"/>
<element value="doseAndRate"/>
<variable value="dosageRate"/>
</target>
<rule>
<name value="d"/>
<source>
<context value="rateQuantity"/>
</source>
<target>
<context value="dosageRate"/>
<contextType value="variable"/>
<element value="rate"/>
<variable value="d"/>
<transform value="create"/>
<parameter>
<valueString value="Range"/>
</parameter>
</target>
<rule>
<name value="low"/>
<source>
<context value="rateQuantity"/>
</source>
<target>
<context value="d"/>
<contextType value="variable"/>
<element value="low"/>
<variable value="l"/>
<transform value="create"/>
<parameter>
<valueString value="SimpleQuantity"/>
</parameter>
</target>
<rule>
<name value="low"/>
<source>
<context value="rateQuantity"/>
<element value="low"/>
<variable value="lo"/>
</source>
<target>
<context value="l"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="lo.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="low"/>
<source>
<context value="rateQuantity"/>
<element value="low"/>
<variable value="lo"/>
</source>
<target>
<context value="l"/>
<contextType value="variable"/>
<element value="unit"/>
<transform value="evaluate"/>
<parameter>
<valueString value="lo.unit"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="low"/>
<source>
<context value="rateQuantity"/>
</source>
<target>
<context value="d"/>
<contextType value="variable"/>
<element value="high"/>
<variable value="h"/>
<transform value="create"/>
<parameter>
<valueString value="SimpleQuantity"/>
</parameter>
</target>
<rule>
<name value="high"/>
<source>
<context value="rateQuantity"/>
<element value="high"/>
<variable value="hi"/>
</source>
<target>
<context value="h"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="hi.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="high"/>
<source>
<context value="rateQuantity"/>
<element value="high"/>
<variable value="hi"/>
</source>
<target>
<context value="h"/>
<contextType value="variable"/>
<element value="unit"/>
<transform value="evaluate"/>
<parameter>
<valueString value="hi.unit"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="partRole"/>
<source>
<context value="substract"/>
<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="practitioner"/>
<transform value="create"/>
<parameter>
<valueString value="Practitioner"/>
</parameter>
</target>
<rule>
<name value="time"/>
<source>
<context value="part"/>
<element value="time"/>
<variable value="time"/>
</source>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="authoredOn"/>
<transform value="evaluate"/>
<parameter>
<valueString value="time.value"/>
</parameter>
</target>
</rule>
<rule>
<name value="perf"/>
<source>
<context value="part"/>
<element value="participantRole"/>
<variable value="partRole"/>
</source>
<rule>
<name value="meta"/>
<source>
<context value="partRole"/>
</source>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="meta"/>
<variable value="meta"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="partRole"/>
</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="partRole"/>
</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="partRole"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString
value="ClinicalDocument/body/TerapiaFarmacologicaRicovero/participant"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="identifier"/>
<source>
<context value="partRole"/>
<element value="id"/>
<variable value="id"/>
</source>
<target>
<context value="practitioner"/>
<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="extension"/>
<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>
<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="aut"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext"/>
</source>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid2"/>
<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/Practitioner/"/>
</parameter>
<parameter>
<valueId value="uuid2"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="append"/>
<parameter>
<valueString value="Practitioner/"/>
</parameter>
<parameter>
<valueId value="uuid1"/>
</parameter>
</target>
<target>
<context value="medicationRq"/>
<contextType value="variable"/>
<element value="performer"/>
<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/Practitioner/' + %practitioner.id"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="2.16.840.1.113883.2.9.4.3.2"/>
<source>
<context value="partRole"/>
<element value="id"/>
<variable value="id"/>
<condition value="(root = '2.16.840.1.113883.2.9.4.3.2')"/>
</source>
<rule>
<name value="UUID"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext"/>
</source>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="append"/>
<parameter>
<valueString value="Practitioner?identifier="/>
</parameter>
<parameter>
<valueId value="ext"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="assi"/>
<source>
<context value="partRole"/>
<element value="playingEntity"/>
<variable value="assi"/>
</source>
<rule>
<name value="name"/>
<source>
<context value="assi"/>
<element value="name"/>
<variable value="vvv"/>
</source>
<target>
<context value="practitioner"/>
<contextType value="variable"/>
<element value="name"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
</group>
</StructureMap>