CDA to FHIR Maps - Local Development build (v0.1.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions
Draft as of 2024-04-11 |
<StructureMap xmlns="http://hl7.org/fhir">
<id value="cda2fhirSpecPrescription"/>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>map "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirSpecPrescription" = "cda2fhirSpecPrescription"
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/List" alias List 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 e4, e4.request = create('BackboneElement') as request, request.method = 'POST', e4.resource = create('DocumentReference') as DocumentReference, DocumentReference.id = uuid() as uuid4, e4.fullUrl = append('https://example/DocumentReference/', uuid4), request.url = 'DocumentReference' then {
cda then ClinicalDocumentToBundle(cda, patient, composition, encounter, bundle, DocumentReference) "cdatobundle";
cda.recordTarget as recordTarget then {
recordTarget.patientRole as patient then {
patient.id as id -> patient.identifier as identifier then {
id.root as r -> identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') "root1";
id.extension as ext1 -> identifier.value = ext1 "value";
id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;
} "idfr";
patient.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') or (root = '2.16.840.1.113883.2.9.4.3.7') or (root = '2.16.840.1.113883.2.9.4.3.3') or (root = '2.16.840.1.113883.2.9.4.3.17') or (root = '2.16.840.1.113883.2.9.4.3.18') or (root = '2.16.840.1.113883.2.9.2.10.4.1.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1.1') or (root = '2.16.840.1.113883.2.9.2.10.4.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1') or (root = '2.16.840.1.113883.2.9.4.3.15') then {
id.extension as ext -> requestPAT.url = append('Patient?identifier=', ext) "UUID";
} "ext";
} "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 -> bundle.entry as e, e.request = create('BackboneElement') as request, request.method = 'POST', e.resource = create('ServiceRequest') as ServiceRequest, ServiceRequest.id = uuid() as uuid1, e.fullUrl = append('https://example/ServiceRequest/', uuid1), request.url = 'ServiceRequest' then {
cda -> ServiceRequest.intent = 'order' "intent";
cda -> ServiceRequest.status = 'unknown' "stats";
cda -> ServiceRequest.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
cda.component as component then {
component.structuredBody as body then {
body.component as component then {
component.section as srcSection then {
srcSection.code -> composition.section as tgtSection then ClinicalDocumentSection(cda, srcSection, patient, tgtSection, bundle, encounter, ServiceRequest);
};
};
} "body";
};
} "ServiceRequest";
}
group ClinicalDocumentSection(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter, target ServiceRequest : ServiceRequest) {
src.title as t -> tgt.title = (t.dataString);
src.code -> tgt.code;
src.code as code where (code = '48767-8') or (code = '51851-4') or (code = '57827-8') or (code = '57828-6') then {
src -> tgt.entry = create('Reference') as reference, reference.reference = ('https://example/ServiceRequest/' + %ServiceRequest.id) "reference";
} "Note";
// src.entry as entry then{
src.text as cdaText -> tgt.text as fhirText then {
cdaText -> fhirText.status = 'generated' "narrativeStatus";
cdaText as t -> fhirText.div = t "narrativeText";
} "cdaText";
// --------------Sezione Esenzioni------------------------------------------------------------------------------------------------------------------------------------
src.code as code where (code = '57827-8') then {
src.id -> ServiceRequest.identifier;
src.entry as entry -> bundle.entry as e11, e11.request = create('BackboneElement') as request, request.method = 'POST', e11.resource = create('Coverage') as Coverage, Coverage.id = uuid() as uuid11, e11.fullUrl = append('https://example/Coverage/', uuid11), request.url = 'Coverage', ServiceRequest.insurance = create('Reference') as reference, reference.reference = ('https://example/Coverage/' + %Coverage.id) then {
src -> Coverage.beneficiary = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
src -> Coverage.payor = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
src where statusCode.exists().not() -> Coverage.status = 'active' "statusAbsent";
entry.act as act then {
act.code -> Coverage.type;
};
};
} "Esenzioni";
// -------------Sezione Prescrizioni-------------------------------------------------------------------------------------------------------------------------------------
src.code as code where (code = '57828-6') then {
src.entry as entry then {
entry.observation as observation then {
observation.code -> ServiceRequest.code;
// observation.priorityCode->ServiceRequest.priority"priority";
observation.priorityCode as priorityCode then {
priorityCode.code as v -> ServiceRequest.priority = translate(v, '#priority', 'code') "priority";
};
observation.repeatNumber as repeatNumber -> ServiceRequest.quantity = create('Quantity') as Ratio then {
repeatNumber.value as value -> Ratio.value = value;
} "value";
observation.participant as participant then {
participant.participantRole as partRol then {
partRol.scopingEntity as scopingEntity then {
scopingEntity.code -> ServiceRequest.locationCode;
} "ScopingEntity";
} "PartROle";
} "Location";
// ----------------codice Patologia------------------------------------------------------------------------------------------------------------------------------------
observation.entryRelationship as entryRelationship then {
entryRelationship.act as act then {
act.templateId as temid where (root = '2.16.840.1.113883.3.1937.777.63.10.275') -> bundle.entry as e11, e11.request = create('BackboneElement') as request, request.method = 'POST', e11.resource = create('Condition') as Condition, Condition.id = uuid() as uuid11, e11.fullUrl = append('https://example/Condition/', uuid11), request.url = 'Condition', ServiceRequest.reasonReference = create('Reference') as reference, reference.reference = ('https://example/Condition/' + %Condition.id) then {
act -> Condition.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
act -> Condition.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";
act -> Condition.clinicalStatus as status2 then {
act -> status2.coding as status3 then {
act -> status3.code = 'unknown' "finald";
act -> status3.system = 'http://terminology.hl7.org/CodeSystem/condition-clinical' "system";
} "st3";
} "status";
act.code -> Condition.code;
} "Condition";
};
} "entryrelationshipCondition";
// ---------Tipo di Visita---------------------------------------------------------------------------------------------------------------------------------
observation.entryRelationship as entryRelationship then {
entryRelationship.encounter as encounter then {
encounter.templateId as temid where (root = '2.16.840.1.113883.3.1937.777.63.10.276') then {
encounter -> ServiceRequest.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) then {
observation.entryRelationship as entryRelationship then {
entryRelationship.encounter as encounter1 then {
encounter1.templateId as temid where (root = '2.16.840.1.113883.3.1937.777.63.10.281') then {
// encounter1.code -> enc.class;
encounter1.code as code1 -> enc.class = create('Coding') as coding then {
code1.code as code -> coding.code = cast(code, 'string');
code1.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
code1.displayName as display -> coding.display = cast(display, 'string');
} "class";
} "reference";
} "templateId";
} "Act";
} "encounter";
};
} "Act";
};
// ------------Nota esplicita--------------------------------------------------------------------------------------------------------------------------------------------
observation.entryRelationship as entryRelationship then {
entryRelationship.act as act then {
act.templateId as temid where (root = '2.16.840.1.113883.3.1937.777.63.10.274') then {
act.text as text -> ServiceRequest.note as note then {
text.reference as t then {
t.value as l -> note.text = l "reference";
} "tcx";
} "reference";
};
} "Act";
};
observation.entryRelationship as entryRelationship then {
entryRelationship.act as act then {
act.templateId as temid where (root = '2.16.840.1.113883.3.1937.777.63.10.278') then {
act.code -> ServiceRequest.reasonCode;
} "reference";
} "templateId";
} "Act";
// -----Sedute-----------------------------------------------------------------------------------------------------------------------------------------------
observation.entryRelationship as entryRelationship then {
entryRelationship.observation as observation then {
observation.templateId as temid where (root = '2.16.840.1.113883.3.1937.777.63.10.277') then {
observation.repeatNumber as repeatNumber -> ServiceRequest.occurrence = create('Timing') as Timing then {
repeatNumber -> Timing.repeat as repeat then {
repeatNumber.value as value -> repeat.count = value "count";
} "event";
} "Count";
} "Timing";
} "templateId";
} "Act";
} "Observation";
};
} "Esenzioni";
// ------------Sezione Annotazioni-----------------------------------------------------------------------------------------------------------------------------------------
src.code as code where (code = '48767-8') then {
src.entry as entry then {
entry.act as act then {
act.text as text -> ServiceRequest.note as note then {
text.reference as t then {
t.value as l -> note.text = l "reference";
} "tcx";
} "reference";
};
};
} "Annotazioni";
// ----------Sezione Messaggio Regionale-----------------------------------------------------------------------------------------------------------------------------------
src.code as code where (code = '51851-4') then {
src.text as cdaText -> ServiceRequest.note as note then {
cdaText as text then {
text as l -> note.text = l "reference";
} "tcx";
} "reference";
} "MessaggioRegionale";
// -------Sezione Parametri Vitali---------------------------------------------------------------------------------------------------------------------------------------
src.code as code where (code = '8716-3') -> bundle.entry as e11, e11.request = create('BackboneElement') as request, request.method = 'POST', e11.resource = create('Observation') as Observation, Observation.id = uuid() as uuid11, e11.fullUrl = append('https://example/Observation/', uuid11), 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";
src.text as cdaText -> Observation.note as note then {
cdaText as t -> note.text = t "reference";
} "reference";
} "ParametriVitali";
// -------Sezione Allergie------------------------------------------------------------------------------------------------------------------------------------------------
src.code as code where (code = '48765-2') -> bundle.entry as e11, e11.request = create('BackboneElement') as request, request.method = 'POST', e11.resource = create('AllergyIntolerance') as AllergyIntolerance, AllergyIntolerance.id = uuid() as uuid11, e11.fullUrl = append('https://example/AllergyIntolerance/', uuid11), request.url = 'AllergyIntolerance', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/AllergyIntolerance/' + %AllergyIntolerance.id) then {
src -> AllergyIntolerance.patient = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";
src -> AllergyIntolerance.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.text as cdaText -> AllergyIntolerance.note as note then {
cdaText as t -> note.text = t "reference";
} "reference";
} "Allergie";
// ------Sezione Stato Funzionale------------------------------------------------------------------------------------------------------------------------------------------
src.code as code where (code = '47420-5') -> bundle.entry as e11, e11.request = create('BackboneElement') as request, request.method = 'POST', e11.resource = create('Observation') as Observation, Observation.id = uuid() as uuid11, e11.fullUrl = append('https://example/Observation/', uuid11), 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";
src.text as cdaText -> Observation.note as note then {
cdaText as t -> note.text = t "reference";
} "reference";
} "StatoFunzionale";
}
</pre>
</div>
</text>
<url
value="http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirSpecPrescription"/>
<version value="0.1.0"/>
<name value="cda2fhirSpecPrescription"/>
<status value="draft"/>
<date value="2024-04-11T15:38:19+02:00"/>
<publisher value="HL7 Italy"/>
<contact>
<name value="HL7 Italy"/>
<telecom>
<system value="url"/>
<value value="http://hl7.it"/>
</telecom>
</contact>
<jurisdiction>
<coding>
<system value="urn:iso:std:iso:3166"/>
<code value="IT"/>
<display value="Italy"/>
</coding>
</jurisdiction>
<structure>
<url
value="http://hl7.org/fhir/cda/StructureDefinition/ClinicalDocument"/>
<mode value="source"/>
<alias value="ClinicalDocument"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/cda/StructureDefinition/AssignedAuthor"/>
<mode value="queried"/>
<alias value="AssignedAuthor"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/cda/StructureDefinition/AssignedEntity"/>
<mode value="queried"/>
<alias value="AssignedEntity"/>
</structure>
<structure>
<url
value="http://hl7.org/fhir/cda/StructureDefinition/AssociatedEntity"/>
<mode value="queried"/>
<alias value="AssociatedEntity"/>
</structure>
<structure>
<url
value="http://hl7.org/fhir/cda/StructureDefinition/CustodianOrganization"/>
<mode value="queried"/>
<alias value="CustodianOrganization"/>
</structure>
<structure>
<url
value="http://hl7.org/fhir/cda/StructureDefinition/OrganizationPartOf"/>
<mode value="queried"/>
<alias value="OrganizationPartOf"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/cda/StructureDefinition/Organization"/>
<mode value="queried"/>
<alias value="rapresentedOrganization"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/cda/StructureDefinition/Section"/>
<mode value="queried"/>
<alias value="Section"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/cda/StructureDefinition/PatientRole"/>
<mode value="queried"/>
<alias value="PatientRole"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/cda/StructureDefinition/AD"/>
<mode value="source"/>
<alias value="AD"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Bundle"/>
<mode value="target"/>
<alias value="Bundle"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Composition"/>
<mode value="produced"/>
<alias value="Composition"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Patient"/>
<mode value="produced"/>
<alias value="Patient"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
<mode value="produced"/>
<alias value="Encounter"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Person"/>
<mode value="produced"/>
<alias value="Patient"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/List"/>
<mode value="produced"/>
<alias value="List"/>
</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="e4"/>
</target>
<target>
<context value="e4"/>
<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="e4"/>
<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="uuid4"/>
<transform value="uuid"/>
</target>
<target>
<context value="e4"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="https://example/DocumentReference/"/>
</parameter>
<parameter>
<valueId value="uuid4"/>
</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="idfr"/>
<source>
<context value="patient"/>
<element value="id"/>
<variable value="id"/>
</source>
<target>
<context value="patient"/>
<contextType value="variable"/>
<element value="identifier"/>
<variable value="identifier"/>
</target>
<rule>
<name value="root1"/>
<source>
<context value="id"/>
<element value="root"/>
<variable value="r"/>
</source>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="translate"/>
<parameter>
<valueId value="r"/>
</parameter>
<parameter>
<valueString
value="http://hl7.org/fhir/ConceptMap/special-oid2uri"/>
</parameter>
<parameter>
<valueString value="uri"/>
</parameter>
</target>
</rule>
<rule>
<name value="value"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext1"/>
</source>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="ext1"/>
</parameter>
</target>
</rule>
<rule>
<name value="assigningAuthorityName"/>
<source>
<context value="id"/>
<element value="assigningAuthorityName"/>
<variable value="s"/>
</source>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="assigner"/>
<variable value="a"/>
</target>
<target>
<context value="a"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueId value="s"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="ext"/>
<source>
<context value="patient"/>
<element value="id"/>
<variable value="id"/>
<condition
value="(root = '2.16.840.1.113883.2.9.4.3.2') or (root = '2.16.840.1.113883.2.9.4.3.7') or (root = '2.16.840.1.113883.2.9.4.3.3') or (root = '2.16.840.1.113883.2.9.4.3.17') or (root = '2.16.840.1.113883.2.9.4.3.18') or (root = '2.16.840.1.113883.2.9.2.10.4.1.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1.1') or (root = '2.16.840.1.113883.2.9.2.10.4.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1') or (root = '2.16.840.1.113883.2.9.4.3.15')"/>
</source>
<rule>
<name value="UUID"/>
<source>
<context value="id"/>
<element value="extension"/>
<variable value="ext"/>
</source>
<target>
<context value="requestPAT"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="append"/>
<parameter>
<valueString value="Patient?identifier="/>
</parameter>
<parameter>
<valueId value="ext"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
</group>
<group>
<name value="ClinicalDocumentToBundle"/>
<typeMode value="none"/>
<input>
<name value="cda"/>
<type value="ClinicalDocument"/>
<mode value="source"/>
</input>
<input>
<name value="patient"/>
<type value="Patient"/>
<mode value="target"/>
</input>
<input>
<name value="composition"/>
<type value="Composition"/>
<mode value="target"/>
</input>
<input>
<name value="encounter"/>
<type value="Encounter"/>
<mode value="target"/>
</input>
<input>
<name value="bundle"/>
<type value="Bundle"/>
<mode value="target"/>
</input>
<input>
<name value="DocumentReference"/>
<type value="DocumentReference"/>
<mode value="target"/>
</input>
<rule>
<name value="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="ServiceRequest"/>
<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="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="e"/>
<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>
<rule>
<name value="intent"/>
<source>
<context value="cda"/>
</source>
<target>
<context value="ServiceRequest"/>
<contextType value="variable"/>
<element value="intent"/>
<transform value="copy"/>
<parameter>
<valueString value="order"/>
</parameter>
</target>
</rule>
<rule>
<name value="stats"/>
<source>
<context value="cda"/>
</source>
<target>
<context value="ServiceRequest"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="unknown"/>
</parameter>
</target>
</rule>
<rule>
<name value="reference"/>
<source>
<context value="cda"/>
</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="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="code"/>
<source>
<context value="srcSection"/>
<element value="code"/>
</source>
<target>
<context value="composition"/>
<contextType value="variable"/>
<element value="section"/>
<variable value="tgtSection"/>
</target>
<dependent>
<name value="ClinicalDocumentSection"/>
<variable value="cda"/>
<variable value="srcSection"/>
<variable value="patient"/>
<variable value="tgtSection"/>
<variable value="bundle"/>
<variable value="encounter"/>
<variable value="ServiceRequest"/>
</dependent>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
</group>
<group>
<name value="ClinicalDocumentSection"/>
<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>
<input>
<name value="ServiceRequest"/>
<type value="ServiceRequest"/>
<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="Note"/>
<source>
<context value="src"/>
<element value="code"/>
<variable value="code"/>
<condition
value="(code = '48767-8') or (code = '51851-4') or (code = '57827-8') or (code = '57828-6')"/>
</source>
<rule>
<name value="reference"/>
<source>
<context value="src"/>
</source>
<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/ServiceRequest/' + %ServiceRequest.id"/>
</parameter>
</target>
</rule>
</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>
<documentation value="src.entry as entry then{"/>
</rule>
<rule>
<name value="Esenzioni"/>
<source>
<context value="src"/>
<element value="code"/>
<variable value="code"/>
<condition value="(code = '57827-8')"/>
</source>
<rule>
<name value="id"/>
<source>
<context value="src"/>
<element value="id"/>
<variable value="vvv"/>
</source>
<target>
<context value="ServiceRequest"/>
<contextType value="variable"/>
<element value="identifier"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="entry"/>
<source>
<context value="src"/>
<element value="entry"/>
<variable value="entry"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e11"/>
</target>
<target>
<context value="e11"/>
<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="e11"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="Coverage"/>
<transform value="create"/>
<parameter>
<valueString value="Coverage"/>
</parameter>
</target>
<target>
<context value="Coverage"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid11"/>
<transform value="uuid"/>
</target>
<target>
<context value="e11"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="https://example/Coverage/"/>
</parameter>
<parameter>
<valueId value="uuid11"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="Coverage"/>
</parameter>
</target>
<target>
<context value="ServiceRequest"/>
<contextType value="variable"/>
<element value="insurance"/>
<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/Coverage/' + %Coverage.id"/>
</parameter>
</target>
<rule>
<name value="reference"/>
<source>
<context value="src"/>
</source>
<target>
<context value="Coverage"/>
<contextType value="variable"/>
<element value="beneficiary"/>
<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="Coverage"/>
<contextType value="variable"/>
<element value="payor"/>
<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="statusAbsent"/>
<source>
<context value="src"/>
<condition value="statusCode.exists().not()"/>
</source>
<target>
<context value="Coverage"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="active"/>
</parameter>
</target>
</rule>
<rule>
<name value="act"/>
<source>
<context value="entry"/>
<element value="act"/>
<variable value="act"/>
</source>
<rule>
<name value="code"/>
<source>
<context value="act"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="Coverage"/>
<contextType value="variable"/>
<element value="type"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</rule>
</rule>
<documentation
value="--------------Sezione Esenzioni------------------------------------------------------------------------------------------------------------------------------------"/>
</rule>
<rule>
<name value="Esenzioni"/>
<source>
<context value="src"/>
<element value="code"/>
<variable value="code"/>
<condition value="(code = '57828-6')"/>
</source>
<rule>
<name value="entry"/>
<source>
<context value="src"/>
<element value="entry"/>
<variable value="entry"/>
</source>
<rule>
<name value="Observation"/>
<source>
<context value="entry"/>
<element value="observation"/>
<variable value="observation"/>
</source>
<rule>
<name value="code"/>
<source>
<context value="observation"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="ServiceRequest"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="priorityCode"/>
<source>
<context value="observation"/>
<element value="priorityCode"/>
<variable value="priorityCode"/>
</source>
<rule>
<name value="priority"/>
<source>
<context value="priorityCode"/>
<element value="code"/>
<variable value="v"/>
</source>
<target>
<context value="ServiceRequest"/>
<contextType value="variable"/>
<element value="priority"/>
<transform value="translate"/>
<parameter>
<valueId value="v"/>
</parameter>
<parameter>
<valueString value="#priority"/>
</parameter>
<parameter>
<valueString value="code"/>
</parameter>
</target>
</rule>
<documentation
value="observation.priorityCode->ServiceRequest.priority"priority";"/>
</rule>
<rule>
<name value="value"/>
<source>
<context value="observation"/>
<element value="repeatNumber"/>
<variable value="repeatNumber"/>
</source>
<target>
<context value="ServiceRequest"/>
<contextType value="variable"/>
<element value="quantity"/>
<variable value="Ratio"/>
<transform value="create"/>
<parameter>
<valueString value="Quantity"/>
</parameter>
</target>
<rule>
<name value="value"/>
<source>
<context value="repeatNumber"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="Ratio"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="Location"/>
<source>
<context value="observation"/>
<element value="participant"/>
<variable value="participant"/>
</source>
<rule>
<name value="PartROle"/>
<source>
<context value="participant"/>
<element value="participantRole"/>
<variable value="partRol"/>
</source>
<rule>
<name value="ScopingEntity"/>
<source>
<context value="partRol"/>
<element value="scopingEntity"/>
<variable value="scopingEntity"/>
</source>
<rule>
<name value="code"/>
<source>
<context value="scopingEntity"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="ServiceRequest"/>
<contextType value="variable"/>
<element value="locationCode"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="entryrelationshipCondition"/>
<source>
<context value="observation"/>
<element value="entryRelationship"/>
<variable value="entryRelationship"/>
</source>
<rule>
<name value="act"/>
<source>
<context value="entryRelationship"/>
<element value="act"/>
<variable value="act"/>
</source>
<rule>
<name value="Condition"/>
<source>
<context value="act"/>
<element value="templateId"/>
<variable value="temid"/>
<condition
value="(root = '2.16.840.1.113883.3.1937.777.63.10.275')"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e11"/>
</target>
<target>
<context value="e11"/>
<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="e11"/>
<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="uuid11"/>
<transform value="uuid"/>
</target>
<target>
<context value="e11"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="https://example/Condition/"/>
</parameter>
<parameter>
<valueId value="uuid11"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="Condition"/>
</parameter>
</target>
<target>
<context value="ServiceRequest"/>
<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/Condition/' + %Condition.id"/>
</parameter>
</target>
<rule>
<name value="reference"/>
<source>
<context value="act"/>
</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="act"/>
</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="act"/>
</source>
<target>
<context value="Condition"/>
<contextType value="variable"/>
<element value="clinicalStatus"/>
<variable value="status2"/>
</target>
<rule>
<name value="st3"/>
<source>
<context value="act"/>
</source>
<target>
<context value="status2"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="status3"/>
</target>
<rule>
<name value="finald"/>
<source>
<context value="act"/>
</source>
<target>
<context value="status3"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="unknown"/>
</parameter>
</target>
</rule>
<rule>
<name value="system"/>
<source>
<context value="act"/>
</source>
<target>
<context value="status3"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/condition-clinical"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="code"/>
<source>
<context value="act"/>
<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>
</rule>
<documentation
value="----------------codice Patologia------------------------------------------------------------------------------------------------------------------------------------"/>
</rule>
<rule>
<name value="entryRelationship"/>
<source>
<context value="observation"/>
<element value="entryRelationship"/>
<variable value="entryRelationship"/>
</source>
<rule>
<name value="Act"/>
<source>
<context value="entryRelationship"/>
<element value="encounter"/>
<variable value="encounter"/>
</source>
<rule>
<name value="templateId"/>
<source>
<context value="encounter"/>
<element value="templateId"/>
<variable value="temid"/>
<condition
value="(root = '2.16.840.1.113883.3.1937.777.63.10.276')"/>
</source>
<rule>
<name value="encounter"/>
<source>
<context value="encounter"/>
</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/' + %enc.id"/>
</parameter>
</target>
<rule>
<name value="Act"/>
<source>
<context value="observation"/>
<element value="entryRelationship"/>
<variable value="entryRelationship"/>
</source>
<rule>
<name value="templateId"/>
<source>
<context value="entryRelationship"/>
<element value="encounter"/>
<variable value="encounter1"/>
</source>
<rule>
<name value="reference"/>
<source>
<context value="encounter1"/>
<element value="templateId"/>
<variable value="temid"/>
<condition
value="(root = '2.16.840.1.113883.3.1937.777.63.10.281')"/>
</source>
<rule>
<name value="class"/>
<source>
<context value="encounter1"/>
<element value="code"/>
<variable value="code1"/>
</source>
<target>
<context value="enc"/>
<contextType value="variable"/>
<element value="class"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<rule>
<name value="code"/>
<source>
<context value="code1"/>
<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="code1"/>
<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="code1"/>
<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>
<documentation
value="encounter1.code -> enc.class;"/>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
</rule>
<documentation
value="---------Tipo di Visita---------------------------------------------------------------------------------------------------------------------------------"/>
</rule>
<rule>
<name value="entryRelationship"/>
<source>
<context value="observation"/>
<element value="entryRelationship"/>
<variable value="entryRelationship"/>
</source>
<rule>
<name value="Act"/>
<source>
<context value="entryRelationship"/>
<element value="act"/>
<variable value="act"/>
</source>
<rule>
<name value="templateId"/>
<source>
<context value="act"/>
<element value="templateId"/>
<variable value="temid"/>
<condition
value="(root = '2.16.840.1.113883.3.1937.777.63.10.274')"/>
</source>
<rule>
<name value="reference"/>
<source>
<context value="act"/>
<element value="text"/>
<variable value="text"/>
</source>
<target>
<context value="ServiceRequest"/>
<contextType value="variable"/>
<element value="note"/>
<variable value="note"/>
</target>
<rule>
<name value="tcx"/>
<source>
<context value="text"/>
<element value="reference"/>
<variable value="t"/>
</source>
<rule>
<name value="reference"/>
<source>
<context value="t"/>
<element value="value"/>
<variable value="l"/>
</source>
<target>
<context value="note"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="l"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
<documentation
value="------------Nota esplicita--------------------------------------------------------------------------------------------------------------------------------------------"/>
</rule>
<rule>
<name value="Act"/>
<source>
<context value="observation"/>
<element value="entryRelationship"/>
<variable value="entryRelationship"/>
</source>
<rule>
<name value="templateId"/>
<source>
<context value="entryRelationship"/>
<element value="act"/>
<variable value="act"/>
</source>
<rule>
<name value="reference"/>
<source>
<context value="act"/>
<element value="templateId"/>
<variable value="temid"/>
<condition
value="(root = '2.16.840.1.113883.3.1937.777.63.10.278')"/>
</source>
<rule>
<name value="code"/>
<source>
<context value="act"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="ServiceRequest"/>
<contextType value="variable"/>
<element value="reasonCode"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="Act"/>
<source>
<context value="observation"/>
<element value="entryRelationship"/>
<variable value="entryRelationship"/>
</source>
<rule>
<name value="templateId"/>
<source>
<context value="entryRelationship"/>
<element value="observation"/>
<variable value="observation"/>
</source>
<rule>
<name value="Timing"/>
<source>
<context value="observation"/>
<element value="templateId"/>
<variable value="temid"/>
<condition
value="(root = '2.16.840.1.113883.3.1937.777.63.10.277')"/>
</source>
<rule>
<name value="Count"/>
<source>
<context value="observation"/>
<element value="repeatNumber"/>
<variable value="repeatNumber"/>
</source>
<target>
<context value="ServiceRequest"/>
<contextType value="variable"/>
<element value="occurrence"/>
<variable value="Timing"/>
<transform value="create"/>
<parameter>
<valueString value="Timing"/>
</parameter>
</target>
<rule>
<name value="event"/>
<source>
<context value="repeatNumber"/>
</source>
<target>
<context value="Timing"/>
<contextType value="variable"/>
<element value="repeat"/>
<variable value="repeat"/>
</target>
<rule>
<name value="count"/>
<source>
<context value="repeatNumber"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="repeat"/>
<contextType value="variable"/>
<element value="count"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
<documentation
value="-----Sedute-----------------------------------------------------------------------------------------------------------------------------------------------"/>
</rule>
</rule>
</rule>
<documentation
value="-------------Sezione Prescrizioni-------------------------------------------------------------------------------------------------------------------------------------"/>
</rule>
<rule>
<name value="Annotazioni"/>
<source>
<context value="src"/>
<element value="code"/>
<variable value="code"/>
<condition value="(code = '48767-8')"/>
</source>
<rule>
<name value="entry"/>
<source>
<context value="src"/>
<element value="entry"/>
<variable value="entry"/>
</source>
<rule>
<name value="act"/>
<source>
<context value="entry"/>
<element value="act"/>
<variable value="act"/>
</source>
<rule>
<name value="reference"/>
<source>
<context value="act"/>
<element value="text"/>
<variable value="text"/>
</source>
<target>
<context value="ServiceRequest"/>
<contextType value="variable"/>
<element value="note"/>
<variable value="note"/>
</target>
<rule>
<name value="tcx"/>
<source>
<context value="text"/>
<element value="reference"/>
<variable value="t"/>
</source>
<rule>
<name value="reference"/>
<source>
<context value="t"/>
<element value="value"/>
<variable value="l"/>
</source>
<target>
<context value="note"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="l"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
</rule>
<documentation
value="------------Sezione Annotazioni-----------------------------------------------------------------------------------------------------------------------------------------"/>
</rule>
<rule>
<name value="MessaggioRegionale"/>
<source>
<context value="src"/>
<element value="code"/>
<variable value="code"/>
<condition value="(code = '51851-4')"/>
</source>
<rule>
<name value="reference"/>
<source>
<context value="src"/>
<element value="text"/>
<variable value="cdaText"/>
</source>
<target>
<context value="ServiceRequest"/>
<contextType value="variable"/>
<element value="note"/>
<variable value="note"/>
</target>
<rule>
<name value="tcx"/>
<source>
<context value="cdaText"/>
<variable value="text"/>
</source>
<rule>
<name value="reference"/>
<source>
<context value="text"/>
<variable value="l"/>
</source>
<target>
<context value="note"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="l"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<documentation
value="----------Sezione Messaggio Regionale-----------------------------------------------------------------------------------------------------------------------------------"/>
</rule>
<rule>
<name value="ParametriVitali"/>
<source>
<context value="src"/>
<element value="code"/>
<variable value="code"/>
<condition value="(code = '8716-3')"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e11"/>
</target>
<target>
<context value="e11"/>
<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="e11"/>
<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="uuid11"/>
<transform value="uuid"/>
</target>
<target>
<context value="e11"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="https://example/Observation/"/>
</parameter>
<parameter>
<valueId value="uuid11"/>
</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="src"/>
<element value="text"/>
<variable 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>
<documentation
value="-------Sezione Parametri Vitali---------------------------------------------------------------------------------------------------------------------------------------"/>
</rule>
<rule>
<name value="Allergie"/>
<source>
<context value="src"/>
<element value="code"/>
<variable value="code"/>
<condition value="(code = '48765-2')"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e11"/>
</target>
<target>
<context value="e11"/>
<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="e11"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="AllergyIntolerance"/>
<transform value="create"/>
<parameter>
<valueString value="AllergyIntolerance"/>
</parameter>
</target>
<target>
<context value="AllergyIntolerance"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid11"/>
<transform value="uuid"/>
</target>
<target>
<context value="e11"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="https://example/AllergyIntolerance/"/>
</parameter>
<parameter>
<valueId value="uuid11"/>
</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/' + %AllergyIntolerance.id"/>
</parameter>
</target>
<rule>
<name value="reference"/>
<source>
<context value="src"/>
</source>
<target>
<context value="AllergyIntolerance"/>
<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="allergy"/>
<source>
<context value="src"/>
</source>
<target>
<context value="AllergyIntolerance"/>
<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="reference"/>
<source>
<context value="src"/>
<element value="text"/>
<variable value="cdaText"/>
</source>
<target>
<context value="AllergyIntolerance"/>
<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>
<documentation
value="-------Sezione Allergie------------------------------------------------------------------------------------------------------------------------------------------------"/>
</rule>
<rule>
<name value="StatoFunzionale"/>
<source>
<context value="src"/>
<element value="code"/>
<variable value="code"/>
<condition value="(code = '47420-5')"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e11"/>
</target>
<target>
<context value="e11"/>
<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="e11"/>
<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="uuid11"/>
<transform value="uuid"/>
</target>
<target>
<context value="e11"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="https://example/Observation/"/>
</parameter>
<parameter>
<valueId value="uuid11"/>
</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="src"/>
<element value="text"/>
<variable 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>
<documentation
value="------Sezione Stato Funzionale------------------------------------------------------------------------------------------------------------------------------------------"/>
</rule>
</group>
</StructureMap>