CH ALIS (R4)
0.3.0 - CI build
CH ALIS (R4), published by ALIS-Connect. This guide is not an authorized publication; it is the continuous build for version 0.3.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/ahdis/ch-alis/ and changes regularly. See the Directory of published versions
Draft as of 2024-12-20 |
<StructureMap xmlns="http://hl7.org/fhir">
<id value="Alis43ToBundle"/>
<meta>
<lastUpdated value="2024-05-01T13:40:44.080+00:00"/>
</meta>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>/// url = "http://fhir.ch/ig/ch-alis/StructureMap/Alis43ToBundle"
/// name = "Alis43ToBundle"
/// title = "null"
/// status = "draft"
// Convert ALIS43 XML to a Bundle according to the CH ALIS implmementation guide,
// 2020-12-03 by Oliver Egger, copyright ahdis ag, Apache License,
// FHIR: http://hl7.org/fhir/r4/.
// ISSUE7: what are the URL's oid's we have to define.
conceptmap "serviceMap" {
prefix s = "http://fhir.ch/ig/ch-alis"
prefix t = "http://hl7.org/fhir"
s:TARMED == t:"urn:oid:2.16.756.5.30.1.129.1.4"
s:ICD10 == t:"urn:oid:2.16.756.5.30.1.126.3.2"
}
conceptmap "gender" {
prefix s = "http://fhir.ch/ig/ch-alis"
prefix t = "http://hl7.org/fhir/ValueSet/administrative-gender"
s:M == t:male
s:F == t:female
}
conceptmap "laterality" {
prefix s = "http://fhir.ch/ig/ch-alis"
prefix t = "http://snomed.info/sct"
s:l == t:"7771000"
s:r == t:"24028007"
s:b == t:"51440002"
}
uses "http://fhir.ch/ig/ch-alis/StructureDefinition/Header" alias Header as source
uses "http://fhir.ch/ig/ch-alis/StructureDefinition/Visit" alias Visit as source
uses "http://fhir.ch/ig/ch-alis/StructureDefinition/Service" alias Service as source
uses "http://fhir.ch/ig/ch-alis/StructureDefinition/PersonV40" alias PersonV40 as source
uses "http://fhir.ch/ig/ch-alis/StructureDefinition/ParameterV40" alias ParameterV40 as source
uses "http://fhir.ch/ig/ch-alis/StructureDefinition/DiagGroup" alias DiagGroup as source
uses "http://fhir.ch/ig/ch-alis/StructureDefinition/LeistungsschnittstelleProcedure" alias Proc as source
uses "http://fhir.ch/ig/ch-alis/StructureDefinition/Diagnosis" alias Diagnosis as source
uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as target
uses "http://hl7.org/fhir/StructureDefinition/ChargeItem" alias ChargeItem as target
uses "http://hl7.org/fhir/StructureDefinition/Extension" alias Extension as target
uses "http://hl7.org/fhir/StructureDefinition/MessageHeader" alias MessageHeader as target
uses "http://hl7.org/fhir/StructureDefinition/BackboneElement" alias BackboneElement as target
uses "http://hl7.org/fhir/StructureDefinition/HumanName" alias HumanName as target
uses "http://hl7.org/fhir/StructureDefinition/Condition" alias Condition as target
uses "http://hl7.org/fhir/StructureDefinition/Encounter" alias Encounter as target
uses "http://hl7.org/fhir/StructureDefinition/Procedure" alias Procedure as target
group Alis43ToBundle(source header : Header, target bundle : Bundle) {
header -> bundle.meta as meta, meta.profile as profile, profile.value = 'http://fhir.ch/ig/ch-alis/StructureDefinition/ch-alis-message', bundle.entry as e, e.resource = create('MessageHeader') as messageHeader, messageHeader.id = uuid() as uuid, e.fullUrl = append('urn:uuid:', uuid), bundle.entry as e2, e2.resource = create('Bundle') as transactionBundle, transactionBundle.id = uuid() as uuid2, e2.fullUrl = append('urn:uuid:', uuid2), messageHeader.focus = create('Reference') as reference, reference.type = 'Bundle', reference.reference = append('urn:uuid:', uuid2) then {
header then Alis43ToMessageHeader(header, messageHeader) "messageHeader";
header then Alis43ToBundleTransaction(header, transactionBundle) "bundleTransaction";
} "bundle";
header -> bundle.type = 'message' "type";
header.FileCreationDate as fileCreationDate then {
fileCreationDate.data as date -> bundle.timestamp = date "date";
};
}
group Alis43ToMessageHeader(source header : Header, target messageHeader : MessageHeader) {
// ISSUE1: should be link to a MessageDefinition or a code?
header -> messageHeader.event = create('uri') as value, value.value = 'http://fhir.ch/ig/ch-alis-43' "eventUri";
// ISSUE2: MessageControlID cannot be id of entry, needs to be either fullUrl oder uuid, need to map this to an identifier
header -> messageHeader.source as source then {
header.SoftwareReleaseNumber as version -> source.version = (%version.data) "version";
// ISSUE3: " : "urn:SendingApplication:SendingFacility:SendingServiceCode" -> add urn: in example/docu
header -> source.endpoint = ('urn:' + %header.SendingApplication.data + ':' + %header.SendingFacility.data + ':' + %header.SendingServiceCode.data) "endpoint";
} "source";
header -> messageHeader.destination as destination then {
// ISSUE4: " : "urn:ReceivingApplication, ReceivingFacility, ReceivingServiceCode" -> add urn: in example/docu
header -> destination.endpoint = ('urn:' + %header.ReceivingApplication.data + ':' + %header.ReceivingFacility.data + ':' + %header.ReceivingServiceCode.data) "endpoint";
} "destination";
}
group Alis43ToBundleTransaction(source header : Header, target transactionBundle : Bundle) {
header -> transactionBundle.type = 'transaction' "transaction";
header.Visit as visit then {
visit.Service as service -> transactionBundle.entry as e, e.resource = create('ChargeItem') as chargeItem then ServiceToChargeItem(service, visit, chargeItem, e) "ServiceToChargeItem";
};
}
group ServiceToChargeItem(source service : Service, source visit : Visit, target chargeItem : ChargeItem, target entry) {
service.ItemNumber as itemNumber -> chargeItem.id = (%itemNumber.data.lower()) as uuid, entry.fullUrl = append('urn:uuid:', uuid) "R311LaufnummerItemNumber";
service -> chargeItem.contained = create('Patient') as patient, patient.id = 'pat' as containedid, chargeItem.subject = create('Reference') as ref, ref.reference = ('#' + %containedid) then ServiceToPatient(service, visit, patient) "patient";
visit -> chargeItem.contained = create('Encounter') as encounter, encounter.id = 'enc' as containedid, chargeItem.context = create('Reference') as ref, ref.reference = ('#' + %containedid) then {
visit then VisitToEncounter(visit, encounter) "VisitToEncounter";
service.Diagnosis as diag -> chargeItem.contained = create('Condition') as condition, condition.id = uuid() as containedid, encounter.diagnosis as diag, diag.condition = create('Reference') as ref, ref.reference = ('#' + %containedid) then DiagnosisToCondition(diag, condition) "DiagnosisToCondition";
} "encounter";
visit.DiagGroup as diaggroup -> chargeItem.contained = create('Condition') as cond, cond.id = 'cond' as containedid then DiagGroupToCondition(diaggroup, cond) "DiagGroupToCondition";
service where (service.Transaction.exists() = false) -> entry.request as request, request.method = 'POST', request.url = 'ChargeItem' "POSTDEFAULT";
service.Transaction where (service.Transaction = 'insert') -> entry.request as request, request.method = 'POST', request.url = 'ChargeItem' "POST";
service.Transaction where (service.Transaction = 'update') -> entry.request as request, request.method = 'PUT', request.url = 'ChargeItem' "UPDATE";
service.Transaction where (service.Transaction = 'delete') -> entry.request as request, request.method = 'DELETE', request.url = 'ChargeItem' "DELETE";
service.SessionID as sessionID -> chargeItem.extension as extension, extension.url = 'http://fhir.ch/ig/ch-alis/StructureDefinition/ch-alis-ext-sessionid', extension.value = create('string') as value, value.value = (%sessionID.data) "R32SitzungSessionID";
service.OrderID as orderID -> chargeItem.extension as extension, extension.url = 'http://fhir.ch/ig/ch-alis/StructureDefinition/ch-alis-ext-orderid', extension.value = create('string') as value, value.value = (%orderID.data) "R33AuftragsnummerOrderID";
service.OrderDate as orderDate -> chargeItem.extension as extension, extension.url = 'http://fhir.ch/ig/ch-alis/StructureDefinition/ch-alis-ext-orderdate', extension.value = create('dateTime') as value, value.value = (%orderDate.data) "R33AuftragsnummerOrderID";
service.Form as form -> chargeItem.extension as extension, extension.url = 'http://fhir.ch/ig/ch-alis/StructureDefinition/ch-alis-ext-form', extension.value = create('string') as value, value.value = (%form.data) "R37FormularbezeichnungForm";
service.ParameterV40 as parameterV40 -> chargeItem.extension as extension, extension.url = 'http://fhir.ch/ig/ch-alis/StructureDefinition/ch-alis-ext-parameterv40' then ParameterV40ToExtension(parameterV40, extension) "R4ParamterV40ParameterV40";
service -> chargeItem.status = 'billable' "billable";
service.RefItemNumber as refItemNumber then {
refItemNumber.data as data -> chargeItem.partOf = create('Reference') as ref, ref.reference = ('urn:uuid:' + %data.lower()), ref.type = 'ChargeItem' "R312ReferenzzuHauptleistungRefItemNumber";
};
service.ServiceItem as serviceItem then {
serviceItem.data as data -> chargeItem.code = create('CodeableConcept') as cc, cc.coding = create('Coding') as coding, coding.code = data then {
service.ServiceType as serviceType then {
serviceType.data as data -> coding.system = translate(data, '#serviceMap', 'code') "R35KatalogServiceType";
} "servicType";
} "R36TarifpositionServiceItem";
} "R36Tarifposition";
service.ServiceDate as serviceData -> chargeItem.occurrence = create('dateTime') as occurrence, occurrence.value = (%serviceData.data) "R31LeistungsdatumServiceDate";
service.PersonV40 as personV40 -> chargeItem.performer = create('BackboneElement') as performer then PersonV40ToPerformer(personV40, performer) "R315PersonV40PersonV40";
service.ProviderID as providerID -> chargeItem.performingOrganization = create('Reference') as reference, reference.display = (%providerID.data) "R39ErbringendeOrganizationProviderID";
service.ReferrerID as referrerID -> chargeItem.costCenter = create('Reference') as reference, reference.display = (%referrerID.data) "R34AuftraggebendeKostenstelleReferrerID";
service.Quantity as quantity -> chargeItem.quantity = create('Quantity') as q, q.value as value, value.value = (%quantity.data) "R313AnzahlQuantity";
service.EnteredBy as enteredBy -> chargeItem.enterer = create('Reference') as reference, reference.display = (%enteredBy.data) "R310ErfasserEnteredBy";
service.EnteredDateTime as enteredDateTime -> chargeItem.enteredDate = create('dateTime') as enteredDate, enteredDate.value = (%enteredDateTime.data) "R38ErfassungsdatumEnteredDateTime";
service.PatientContactID as patientContactID then {
patientContactID.data as data -> chargeItem.identifier = create('Identifier') as identifier, identifier.value = data "PatientContactID";
} "patientContactID";
service.Costweight as costweight then {
costweight.data as data -> chargeItem.factorOverride = data "Costweight";
} "costweight";
service.Procedure as proc -> chargeItem.contained = create('Procedure') as procedure, procedure.id = uuid() as containedid, chargeItem.service = create('Reference') as service, service.reference = ('#' + %containedid) then ServiceProcedureToFhirProcedure(proc, procedure) "ServiceProcedureToFhirProcedure";
}
group ServiceProcedureToFhirProcedure(source proc : Proc, target procedure : Procedure) {
proc.Identifier as identifier -> procedure.identifier = create('Identifier') as identifier, identifier.value = (%identifier.data) "R314ProzedurIDIdentifier";
proc.Code as chopcode where (%proc.Category.data = 'CHOP_2023') -> procedure.code = create('CodeableConcept') as cc, cc.coding = create('Coding') as coding, coding.code = (%chopcode.data), coding.system = 'https://www.bfs.admin.ch/bfs/statistiche/catalog/chop2023', coding.display = (%proc.Display.data) "R316ProzedurcodeCode";
proc.PerformedDateTime as performedDateTime -> procedure.performed = (%performedDateTime.data) "R317DatumZeitPerformedDateTime";
proc.Laterality as laterality then {
laterality.data as v -> procedure.bodySite = create('CodeableConcept') as cc, cc.coding = create('Coding') as coding, coding.code = translate(v, '#laterality', 'code'), coding.system = 'http://snomed.info/sct', coding.display = (%proc.LateralityDisplay.data) "R318SeiteLaterality";
} "laterality";
proc.Performer as performer then {
// TODO Perfomer.function
performer.Identifier as identifier then {
identifier.data as data -> procedure.performer as performer, performer.actor as actor, actor.identifier as identifier, identifier.value = data "identifier";
};
} "performer";
proc -> procedure.subject = create('Reference') as ref, ref.reference = '#pat' "containedpatient";
proc -> procedure.status = 'completed' "status";
}
group PersonV40ToPerformer(source personV40 : PersonV40, target performer) {
personV40.PersonTyp as personTyp -> performer.function as cc, cc.coding as coding, coding.system as system, system.value = 'http://fhir.ch/ig/ch-alis/CodeSystem/ch-alis-persontyp', coding.code as code, code.value = personTyp "R3152PersonIDPersonID";
personV40.PersonID as personId -> performer.actor = create('Reference') as reference, reference.display = (%personId.data) "R3152PersonIDPersonID";
}
group ParameterV40ToExtension(source parameterV40 : ParameterV40, target extension : Extension) {
parameterV40.ParamTyp as paramTyp -> extension.extension as extInner then InnerExtensionParamTyp(paramTyp, extInner);
parameterV40.ParamValue as paramValue then {
paramValue.data as data -> extension.extension as extInner then InnerExtensionParamValue(data, extInner);
};
}
group InnerExtensionParamTyp(source src, target ext : Extension) {
src -> ext.url = 'ParamTyp' "url";
src -> ext.value = create('CodeableConcept') as cc, cc.text as text, text.value = src "string";
}
group InnerExtensionParamValue(source src, target ext : Extension) {
src -> ext.url = 'ParamValue' "url";
src -> ext.value = create('string') as string, string.value = src "string";
}
group ServiceToPatientName(source visit : Visit, target name : HumanName) {
visit.PatientName as patientName then {
patientName.data as data -> name.family = data "R23PatientNamePatientName";
} "patientName";
visit.PatientGivenName as patientGivenName then {
patientGivenName.data as data -> name.given = data "R24PatientVornamePatientGivenName";
} "patientGivenName";
}
group ServiceToPatient(source service : Service, source visit : Visit, target patient : Patient) {
visit.PatientID as patientID then {
patientID.data as patId -> patient.identifier as identifier, identifier.value as value, value.value = patId, identifier.system as idsystem, idsystem.value = 'http://www.example.ch/patienteniddomain', identifier.type as type, type.coding as coding, coding.system as system, system.value = 'http://terminology.hl7.org/CodeSystem/v2-0203', coding.code as code, code.value = 'MR' "R22PatientPIDPatientID";
} "patientID";
// <!-- 2.2 Patient.PID (PatientID) -->
// <identifier>
// <type>
// <coding>
// <system value="http://terminology.hl7.org/CodeSystem/v2-0203" />
// <code value="MR" />
// <display value="Medical record number"/>
// </coding>
// </type>
// ISSUE8: what do with system value
// <system value="http://www.example.ch/patienteniddomain"/>
// <value value="Patienten-ID"/>
// </identifier>//
visit where (visit.PatientName or visit.PatientGivenName) -> patient.name as name then ServiceToPatientName(visit, name) "ServiceToPatient";
visit.PatientGender as gender then {
gender.data as v -> patient.gender = translate(v, '#gender', 'code') "gender";
} "R26PatientGeschlechtPatientGender";
visit.PatientBirthDate as birthDate then {
birthDate.data as v -> patient.birthDate = v "birthDate";
} "R25PatientGebDatumPatientBirthDate";
}
group DiagnosisToCondition(source diagnosis : Diagnosis, target cond : Condition) {
diagnosis -> cond.subject = create('Reference') as ref, ref.reference = '#pat' "containedpatient";
// * Identifier 0..1 http://fhir.ch/ig/ch-alis/StructureDefinition/Text "TODO"
diagnosis.Identifier as identifier then {
identifier.data as data -> cond.identifier as identifier, identifier.value = data "identifier";
};
diagnosis.Code as code -> cond.code = create('CodeableConcept') as cc, cc.coding = create('Coding') as coding, coding.code = (%code.data), coding.display = (%diagnosis.Display.data) then {
diagnosis.Category as category then {
category.data as data where (startsWith('ICD')) -> coding.system = 'http://hl7.org/fhir/sid/icd-10';
} "serviceType";
} "R316ProzedurcodeCode";
// TODO system is not yet correct
diagnosis.OnsetDateTime as onsetDateTime -> cond.onset = (%onsetDateTime.data) "onsetDateTime";
diagnosis.Laterality as laterality then {
laterality.data as v -> cond.bodySite = create('CodeableConcept') as cc, cc.coding = create('Coding') as coding, coding.code = translate(v, '#laterality', 'code'), coding.system = 'http://snomed.info/sct', coding.display = (%diagnosis.LateralityDisplay.data) "R318SeiteLaterality";
} "laterality";
}
group DiagGroupToCondition(source diagGroup : DiagGroup, target cond : Condition) {
diagGroup -> cond.subject = create('Reference') as ref, ref.reference = '#pat' "containedpatient";
diagGroup.DiagCode as data -> cond.code = create('CodeableConcept') as cc, cc.coding = create('Coding') as coding, coding.code = data then {
diagGroup.DiagCatType as diagCatType then {
diagCatType.data as data -> coding.system = translate(data, '#serviceMap', 'code') "R293KatalogtypDiagCatType";
} "serviceType";
} "R291DiagnosecodeDiagCode";
}
group TerminationToExtension(source visit : Visit, target ext : Extension) {
visit.TerminationVisit as visit then {
visit.data as data -> ext.extension as ext1, ext1.url = 'TerminationVisit', ext1.value = create('date') as date, date.value = data "R27FallAbschlussTerminationVisit";
};
visit.TerminationReason as visit then {
visit.data as data -> ext.extension as ext1, ext1.url = 'TerminationReason', ext1.value = create('string') as string, string.value = data "R28FallAbschlussgrundTerminationReason";
} "TerminationVisit";
}
group VisitToEncounter(source visit : Visit, target encounter : Encounter) {
visit where (visit.TerminationVisit or visit.TerminationReason) -> encounter.extension as ext, ext.url = 'http://fhir.ch/ig/ch-alis/StructureDefinition/ch-alis-ext-termination' then TerminationToExtension(visit, ext) "TerminationToExtension";
visit.VisitNumber as visitNumber then {
// ISSUE8: what to do with falldomain? <system value="http://www.example.ch/fallnummerdomain"/>
visitNumber.data as data -> encounter.identifier = create('Identifier') as identifier, identifier.value as value, value.value = data, identifier.system as idsystem, idsystem.value = 'http://www.example.ch/fallnummerdomain', identifier.type as type, type.coding as coding, coding.system as system, system.value = 'http://terminology.hl7.org/CodeSystem/v2-0203', coding.code as code, code.value = 'VN' "R21FallVisitNumber";
} "encounterID";
visit -> encounter.status = 'finished' "Finished";
visit -> encounter.class as coding, coding.system as system, system.value = 'http://terminology.hl7.org/CodeSystem/v3-ActCode', coding.code as code, code.value = 'IMP', coding.display as display, display.value = 'inpatient encounter' "R21FallVisitNumber";
visit -> encounter.subject = create('Reference') as ref, ref.reference = '#pat' "subject";
visit.DiagGroup as diaggroup -> encounter.diagnosis as diag, diag.condition = create('Reference') as ref, ref.reference = '#cond' then {
diaggroup.DiagType as diagType -> diag.use as use, use.text = (%diagType.data) "R292DiagnosetypDiagType";
} "R29DiagnoseGruppeDiagGroup";
}
</pre>
</div>
</text>
<contained>
<ConceptMap>
<id value="serviceMap"/>
<status value="draft"/>
<group>
<source value="http://fhir.ch/ig/ch-alis"/>
<target value="http://hl7.org/fhir"/>
<element>
<code value="TARMED"/>
<target>
<code value="urn:oid:2.16.756.5.30.1.129.1.4"/>
<equivalence value="equivalent"/>
</target>
</element>
<element>
<code value="ICD10"/>
<target>
<code value="urn:oid:2.16.756.5.30.1.126.3.2"/>
<equivalence value="equivalent"/>
</target>
</element>
</group>
</ConceptMap>
</contained>
<contained>
<ConceptMap>
<id value="gender"/>
<status value="draft"/>
<group>
<source value="http://fhir.ch/ig/ch-alis"/>
<target value="http://hl7.org/fhir/ValueSet/administrative-gender"/>
<element>
<code value="M"/>
<target>
<code value="male"/>
<equivalence value="equivalent"/>
</target>
</element>
<element>
<code value="F"/>
<target>
<code value="female"/>
<equivalence value="equivalent"/>
</target>
</element>
</group>
</ConceptMap>
</contained>
<contained>
<ConceptMap>
<id value="laterality"/>
<status value="draft"/>
<group>
<source value="http://fhir.ch/ig/ch-alis"/>
<target value="http://snomed.info/sct"/>
<element>
<code value="l"/>
<target>
<code value="7771000"/>
<equivalence value="equivalent"/>
</target>
</element>
<element>
<code value="r"/>
<target>
<code value="24028007"/>
<equivalence value="equivalent"/>
</target>
</element>
<element>
<code value="b"/>
<target>
<code value="51440002"/>
<equivalence value="equivalent"/>
</target>
</element>
</group>
</ConceptMap>
</contained>
<url value="http://fhir.ch/ig/ch-alis/StructureMap/Alis43ToBundle"/>
<version value="0.3.0"/>
<name value="Alis43ToBundle"/>
<status value="draft"/>
<date value="2024-12-20T12:42:46+00:00"/>
<publisher value="ALIS-Connect"/>
<contact>
<name value="ALIS-Connect"/>
<telecom>
<system value="url"/>
<value value="https://www.alis-connect.ch/"/>
</telecom>
</contact>
<description
value="Convert ALIS43 XML to a Bundle according to the CH ALIS implmementation guide,
2020-12-03 by Oliver Egger, copyright ahdis ag, Apache License,
FHIR: http://hl7.org/fhir/r4/.
ISSUE7: what are the URL's oid's we have to define."/>
<jurisdiction>
<coding>
<system value="urn:iso:std:iso:3166"/>
<code value="CH"/>
</coding>
</jurisdiction>
<copyright value="not-open-source"/>
<structure>
<url value="http://fhir.ch/ig/ch-alis/StructureDefinition/Header"/>
<mode value="source"/>
<alias value="Header"/>
</structure>
<structure>
<url value="http://fhir.ch/ig/ch-alis/StructureDefinition/Visit"/>
<mode value="source"/>
<alias value="Visit"/>
</structure>
<structure>
<url value="http://fhir.ch/ig/ch-alis/StructureDefinition/Service"/>
<mode value="source"/>
<alias value="Service"/>
</structure>
<structure>
<url value="http://fhir.ch/ig/ch-alis/StructureDefinition/PersonV40"/>
<mode value="source"/>
<alias value="PersonV40"/>
</structure>
<structure>
<url value="http://fhir.ch/ig/ch-alis/StructureDefinition/ParameterV40"/>
<mode value="source"/>
<alias value="ParameterV40"/>
</structure>
<structure>
<url value="http://fhir.ch/ig/ch-alis/StructureDefinition/DiagGroup"/>
<mode value="source"/>
<alias value="DiagGroup"/>
</structure>
<structure>
<url
value="http://fhir.ch/ig/ch-alis/StructureDefinition/LeistungsschnittstelleProcedure"/>
<mode value="source"/>
<alias value="Proc"/>
</structure>
<structure>
<url value="http://fhir.ch/ig/ch-alis/StructureDefinition/Diagnosis"/>
<mode value="source"/>
<alias value="Diagnosis"/>
</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/ChargeItem"/>
<mode value="target"/>
<alias value="ChargeItem"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Extension"/>
<mode value="target"/>
<alias value="Extension"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/MessageHeader"/>
<mode value="target"/>
<alias value="MessageHeader"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/BackboneElement"/>
<mode value="target"/>
<alias value="BackboneElement"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/HumanName"/>
<mode value="target"/>
<alias value="HumanName"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Condition"/>
<mode value="target"/>
<alias value="Condition"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
<mode value="target"/>
<alias value="Encounter"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Procedure"/>
<mode value="target"/>
<alias value="Procedure"/>
</structure>
<group>
<name value="Alis43ToBundle"/>
<typeMode value="none"/>
<input>
<name value="header"/>
<type value="Header"/>
<mode value="source"/>
</input>
<input>
<name value="bundle"/>
<type value="Bundle"/>
<mode value="target"/>
</input>
<rule>
<name value="bundle"/>
<source>
<context value="header"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="meta"/>
<variable value="meta"/>
</target>
<target>
<context value="meta"/>
<contextType value="variable"/>
<element value="profile"/>
<variable value="profile"/>
</target>
<target>
<context value="profile"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-alis/StructureDefinition/ch-alis-message"/>
</parameter>
</target>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="messageHeader"/>
<transform value="create"/>
<parameter>
<valueString value="MessageHeader"/>
</parameter>
</target>
<target>
<context value="messageHeader"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid"/>
<transform value="uuid"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="urn:uuid:"/>
</parameter>
<parameter>
<valueId value="uuid"/>
</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="resource"/>
<variable value="transactionBundle"/>
<transform value="create"/>
<parameter>
<valueString value="Bundle"/>
</parameter>
</target>
<target>
<context value="transactionBundle"/>
<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="urn:uuid:"/>
</parameter>
<parameter>
<valueId value="uuid2"/>
</parameter>
</target>
<target>
<context value="messageHeader"/>
<contextType value="variable"/>
<element value="focus"/>
<variable value="reference"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="reference"/>
<contextType value="variable"/>
<element value="type"/>
<transform value="copy"/>
<parameter>
<valueString value="Bundle"/>
</parameter>
</target>
<target>
<context value="reference"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="append"/>
<parameter>
<valueString value="urn:uuid:"/>
</parameter>
<parameter>
<valueId value="uuid2"/>
</parameter>
</target>
<rule>
<name value="messageHeader"/>
<source>
<context value="header"/>
</source>
<dependent>
<name value="Alis43ToMessageHeader"/>
<variable value="header"/>
<variable value="messageHeader"/>
</dependent>
</rule>
<rule>
<name value="bundleTransaction"/>
<source>
<context value="header"/>
</source>
<dependent>
<name value="Alis43ToBundleTransaction"/>
<variable value="header"/>
<variable value="transactionBundle"/>
</dependent>
</rule>
</rule>
<rule>
<name value="type"/>
<source>
<context value="header"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="type"/>
<transform value="copy"/>
<parameter>
<valueString value="message"/>
</parameter>
</target>
</rule>
<rule>
<name value="FileCreationDate"/>
<source>
<context value="header"/>
<element value="FileCreationDate"/>
<variable value="fileCreationDate"/>
</source>
<rule>
<name value="date"/>
<source>
<context value="fileCreationDate"/>
<element value="data"/>
<variable value="date"/>
</source>
<target>
<context value="bundle"/>
<contextType value="variable"/>
<element value="timestamp"/>
<transform value="copy"/>
<parameter>
<valueId value="date"/>
</parameter>
</target>
</rule>
</rule>
</group>
<group>
<name value="Alis43ToMessageHeader"/>
<typeMode value="none"/>
<input>
<name value="header"/>
<type value="Header"/>
<mode value="source"/>
</input>
<input>
<name value="messageHeader"/>
<type value="MessageHeader"/>
<mode value="target"/>
</input>
<rule>
<name value="eventUri"/>
<source>
<context value="header"/>
</source>
<target>
<context value="messageHeader"/>
<contextType value="variable"/>
<element value="event"/>
<variable value="value"/>
<transform value="create"/>
<parameter>
<valueString value="uri"/>
</parameter>
</target>
<target>
<context value="value"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueString value="http://fhir.ch/ig/ch-alis-43"/>
</parameter>
</target>
</rule>
<rule>
<name value="source"/>
<source>
<context value="header"/>
</source>
<target>
<context value="messageHeader"/>
<contextType value="variable"/>
<element value="source"/>
<variable value="source"/>
</target>
<rule>
<name value="version"/>
<source>
<context value="header"/>
<element value="SoftwareReleaseNumber"/>
<variable value="version"/>
</source>
<target>
<context value="source"/>
<contextType value="variable"/>
<element value="version"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%version.data"/>
</parameter>
</target>
</rule>
<rule>
<name value="endpoint"/>
<source>
<context value="header"/>
</source>
<target>
<context value="source"/>
<contextType value="variable"/>
<element value="endpoint"/>
<transform value="evaluate"/>
<parameter>
<valueString
value="'urn:' + %header.SendingApplication.data + ':' + %header.SendingFacility.data + ':' + %header.SendingServiceCode.data"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="destination"/>
<source>
<context value="header"/>
</source>
<target>
<context value="messageHeader"/>
<contextType value="variable"/>
<element value="destination"/>
<variable value="destination"/>
</target>
<rule>
<name value="endpoint"/>
<source>
<context value="header"/>
</source>
<target>
<context value="destination"/>
<contextType value="variable"/>
<element value="endpoint"/>
<transform value="evaluate"/>
<parameter>
<valueString
value="'urn:' + %header.ReceivingApplication.data + ':' + %header.ReceivingFacility.data + ':' + %header.ReceivingServiceCode.data"/>
</parameter>
</target>
</rule>
</rule>
</group>
<group>
<name value="Alis43ToBundleTransaction"/>
<typeMode value="none"/>
<input>
<name value="header"/>
<type value="Header"/>
<mode value="source"/>
</input>
<input>
<name value="transactionBundle"/>
<type value="Bundle"/>
<mode value="target"/>
</input>
<rule>
<name value="transaction"/>
<source>
<context value="header"/>
</source>
<target>
<context value="transactionBundle"/>
<contextType value="variable"/>
<element value="type"/>
<transform value="copy"/>
<parameter>
<valueString value="transaction"/>
</parameter>
</target>
</rule>
<rule>
<name value="Visit"/>
<source>
<context value="header"/>
<element value="Visit"/>
<variable value="visit"/>
</source>
<rule>
<name value="ServiceToChargeItem"/>
<source>
<context value="visit"/>
<element value="Service"/>
<variable value="service"/>
</source>
<target>
<context value="transactionBundle"/>
<contextType value="variable"/>
<element value="entry"/>
<variable value="e"/>
</target>
<target>
<context value="e"/>
<contextType value="variable"/>
<element value="resource"/>
<variable value="chargeItem"/>
<transform value="create"/>
<parameter>
<valueString value="ChargeItem"/>
</parameter>
</target>
<dependent>
<name value="ServiceToChargeItem"/>
<variable value="service"/>
<variable value="visit"/>
<variable value="chargeItem"/>
<variable value="e"/>
</dependent>
</rule>
</rule>
</group>
<group>
<name value="ServiceToChargeItem"/>
<typeMode value="none"/>
<input>
<name value="service"/>
<type value="Service"/>
<mode value="source"/>
</input>
<input>
<name value="visit"/>
<type value="Visit"/>
<mode value="source"/>
</input>
<input>
<name value="chargeItem"/>
<type value="ChargeItem"/>
<mode value="target"/>
</input>
<input>
<name value="entry"/>
<mode value="target"/>
</input>
<rule>
<name value="R311LaufnummerItemNumber"/>
<source>
<context value="service"/>
<element value="ItemNumber"/>
<variable value="itemNumber"/>
</source>
<target>
<context value="chargeItem"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="uuid"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%itemNumber.data.lower()"/>
</parameter>
</target>
<target>
<context value="entry"/>
<contextType value="variable"/>
<element value="fullUrl"/>
<transform value="append"/>
<parameter>
<valueString value="urn:uuid:"/>
</parameter>
<parameter>
<valueId value="uuid"/>
</parameter>
</target>
</rule>
<rule>
<name value="patient"/>
<source>
<context value="service"/>
</source>
<target>
<context value="chargeItem"/>
<contextType value="variable"/>
<element value="contained"/>
<variable value="patient"/>
<transform value="create"/>
<parameter>
<valueString value="Patient"/>
</parameter>
</target>
<target>
<context value="patient"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="containedid"/>
<transform value="copy"/>
<parameter>
<valueString value="pat"/>
</parameter>
</target>
<target>
<context value="chargeItem"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="ref"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="ref"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'#' + %containedid"/>
</parameter>
</target>
<dependent>
<name value="ServiceToPatient"/>
<variable value="service"/>
<variable value="visit"/>
<variable value="patient"/>
</dependent>
</rule>
<rule>
<name value="encounter"/>
<source>
<context value="visit"/>
</source>
<target>
<context value="chargeItem"/>
<contextType value="variable"/>
<element value="contained"/>
<variable value="encounter"/>
<transform value="create"/>
<parameter>
<valueString value="Encounter"/>
</parameter>
</target>
<target>
<context value="encounter"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="containedid"/>
<transform value="copy"/>
<parameter>
<valueString value="enc"/>
</parameter>
</target>
<target>
<context value="chargeItem"/>
<contextType value="variable"/>
<element value="context"/>
<variable value="ref"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="ref"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'#' + %containedid"/>
</parameter>
</target>
<rule>
<name value="VisitToEncounter"/>
<source>
<context value="visit"/>
</source>
<dependent>
<name value="VisitToEncounter"/>
<variable value="visit"/>
<variable value="encounter"/>
</dependent>
</rule>
<rule>
<name value="DiagnosisToCondition"/>
<source>
<context value="service"/>
<element value="Diagnosis"/>
<variable value="diag"/>
</source>
<target>
<context value="chargeItem"/>
<contextType value="variable"/>
<element value="contained"/>
<variable value="condition"/>
<transform value="create"/>
<parameter>
<valueString value="Condition"/>
</parameter>
</target>
<target>
<context value="condition"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="containedid"/>
<transform value="uuid"/>
</target>
<target>
<context value="encounter"/>
<contextType value="variable"/>
<element value="diagnosis"/>
<variable value="diag"/>
</target>
<target>
<context value="diag"/>
<contextType value="variable"/>
<element value="condition"/>
<variable value="ref"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="ref"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'#' + %containedid"/>
</parameter>
</target>
<dependent>
<name value="DiagnosisToCondition"/>
<variable value="diag"/>
<variable value="condition"/>
</dependent>
</rule>
</rule>
<rule>
<name value="DiagGroupToCondition"/>
<source>
<context value="visit"/>
<element value="DiagGroup"/>
<variable value="diaggroup"/>
</source>
<target>
<context value="chargeItem"/>
<contextType value="variable"/>
<element value="contained"/>
<variable value="cond"/>
<transform value="create"/>
<parameter>
<valueString value="Condition"/>
</parameter>
</target>
<target>
<context value="cond"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="containedid"/>
<transform value="copy"/>
<parameter>
<valueString value="cond"/>
</parameter>
</target>
<dependent>
<name value="DiagGroupToCondition"/>
<variable value="diaggroup"/>
<variable value="cond"/>
</dependent>
</rule>
<rule>
<name value="POSTDEFAULT"/>
<source>
<context value="service"/>
<condition value="(service.Transaction.exists() = false)"/>
</source>
<target>
<context value="entry"/>
<contextType value="variable"/>
<element value="request"/>
<variable value="request"/>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="method"/>
<transform value="copy"/>
<parameter>
<valueString value="POST"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="ChargeItem"/>
</parameter>
</target>
</rule>
<rule>
<name value="POST"/>
<source>
<context value="service"/>
<element value="Transaction"/>
<condition value="(service.Transaction = 'insert')"/>
</source>
<target>
<context value="entry"/>
<contextType value="variable"/>
<element value="request"/>
<variable value="request"/>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="method"/>
<transform value="copy"/>
<parameter>
<valueString value="POST"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="ChargeItem"/>
</parameter>
</target>
</rule>
<rule>
<name value="UPDATE"/>
<source>
<context value="service"/>
<element value="Transaction"/>
<condition value="(service.Transaction = 'update')"/>
</source>
<target>
<context value="entry"/>
<contextType value="variable"/>
<element value="request"/>
<variable value="request"/>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="method"/>
<transform value="copy"/>
<parameter>
<valueString value="PUT"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="ChargeItem"/>
</parameter>
</target>
</rule>
<rule>
<name value="DELETE"/>
<source>
<context value="service"/>
<element value="Transaction"/>
<condition value="(service.Transaction = 'delete')"/>
</source>
<target>
<context value="entry"/>
<contextType value="variable"/>
<element value="request"/>
<variable value="request"/>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="method"/>
<transform value="copy"/>
<parameter>
<valueString value="DELETE"/>
</parameter>
</target>
<target>
<context value="request"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="ChargeItem"/>
</parameter>
</target>
</rule>
<rule>
<name value="R32SitzungSessionID"/>
<source>
<context value="service"/>
<element value="SessionID"/>
<variable value="sessionID"/>
</source>
<target>
<context value="chargeItem"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="extension"/>
</target>
<target>
<context value="extension"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-alis/StructureDefinition/ch-alis-ext-sessionid"/>
</parameter>
</target>
<target>
<context value="extension"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="value"/>
<transform value="create"/>
<parameter>
<valueString value="string"/>
</parameter>
</target>
<target>
<context value="value"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%sessionID.data"/>
</parameter>
</target>
</rule>
<rule>
<name value="R33AuftragsnummerOrderID"/>
<source>
<context value="service"/>
<element value="OrderID"/>
<variable value="orderID"/>
</source>
<target>
<context value="chargeItem"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="extension"/>
</target>
<target>
<context value="extension"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-alis/StructureDefinition/ch-alis-ext-orderid"/>
</parameter>
</target>
<target>
<context value="extension"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="value"/>
<transform value="create"/>
<parameter>
<valueString value="string"/>
</parameter>
</target>
<target>
<context value="value"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%orderID.data"/>
</parameter>
</target>
</rule>
<rule>
<name value="R33AuftragsnummerOrderID"/>
<source>
<context value="service"/>
<element value="OrderDate"/>
<variable value="orderDate"/>
</source>
<target>
<context value="chargeItem"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="extension"/>
</target>
<target>
<context value="extension"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-alis/StructureDefinition/ch-alis-ext-orderdate"/>
</parameter>
</target>
<target>
<context value="extension"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="value"/>
<transform value="create"/>
<parameter>
<valueString value="dateTime"/>
</parameter>
</target>
<target>
<context value="value"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%orderDate.data"/>
</parameter>
</target>
</rule>
<rule>
<name value="R37FormularbezeichnungForm"/>
<source>
<context value="service"/>
<element value="Form"/>
<variable value="form"/>
</source>
<target>
<context value="chargeItem"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="extension"/>
</target>
<target>
<context value="extension"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-alis/StructureDefinition/ch-alis-ext-form"/>
</parameter>
</target>
<target>
<context value="extension"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="value"/>
<transform value="create"/>
<parameter>
<valueString value="string"/>
</parameter>
</target>
<target>
<context value="value"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%form.data"/>
</parameter>
</target>
</rule>
<rule>
<name value="R4ParamterV40ParameterV40"/>
<source>
<context value="service"/>
<element value="ParameterV40"/>
<variable value="parameterV40"/>
</source>
<target>
<context value="chargeItem"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="extension"/>
</target>
<target>
<context value="extension"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-alis/StructureDefinition/ch-alis-ext-parameterv40"/>
</parameter>
</target>
<dependent>
<name value="ParameterV40ToExtension"/>
<variable value="parameterV40"/>
<variable value="extension"/>
</dependent>
</rule>
<rule>
<name value="billable"/>
<source>
<context value="service"/>
</source>
<target>
<context value="chargeItem"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="billable"/>
</parameter>
</target>
</rule>
<rule>
<name value="RefItemNumber"/>
<source>
<context value="service"/>
<element value="RefItemNumber"/>
<variable value="refItemNumber"/>
</source>
<rule>
<name value="R312ReferenzzuHauptleistungRefItemNumber"/>
<source>
<context value="refItemNumber"/>
<element value="data"/>
<variable value="data"/>
</source>
<target>
<context value="chargeItem"/>
<contextType value="variable"/>
<element value="partOf"/>
<variable value="ref"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="ref"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'urn:uuid:' + %data.lower()"/>
</parameter>
</target>
<target>
<context value="ref"/>
<contextType value="variable"/>
<element value="type"/>
<transform value="copy"/>
<parameter>
<valueString value="ChargeItem"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="R36Tarifposition"/>
<source>
<context value="service"/>
<element value="ServiceItem"/>
<variable value="serviceItem"/>
</source>
<rule>
<name value="R36TarifpositionServiceItem"/>
<source>
<context value="serviceItem"/>
<element value="data"/>
<variable value="data"/>
</source>
<target>
<context value="chargeItem"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="cc"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<target>
<context value="cc"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueId value="data"/>
</parameter>
</target>
<rule>
<name value="servicType"/>
<source>
<context value="service"/>
<element value="ServiceType"/>
<variable value="serviceType"/>
</source>
<rule>
<name value="R35KatalogServiceType"/>
<source>
<context value="serviceType"/>
<element value="data"/>
<variable value="data"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="translate"/>
<parameter>
<valueId value="data"/>
</parameter>
<parameter>
<valueString value="#serviceMap"/>
</parameter>
<parameter>
<valueString value="code"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</rule>
<rule>
<name value="R31LeistungsdatumServiceDate"/>
<source>
<context value="service"/>
<element value="ServiceDate"/>
<variable value="serviceData"/>
</source>
<target>
<context value="chargeItem"/>
<contextType value="variable"/>
<element value="occurrence"/>
<variable value="occurrence"/>
<transform value="create"/>
<parameter>
<valueString value="dateTime"/>
</parameter>
</target>
<target>
<context value="occurrence"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%serviceData.data"/>
</parameter>
</target>
</rule>
<rule>
<name value="R315PersonV40PersonV40"/>
<source>
<context value="service"/>
<element value="PersonV40"/>
<variable value="personV40"/>
</source>
<target>
<context value="chargeItem"/>
<contextType value="variable"/>
<element value="performer"/>
<variable value="performer"/>
<transform value="create"/>
<parameter>
<valueString value="BackboneElement"/>
</parameter>
</target>
<dependent>
<name value="PersonV40ToPerformer"/>
<variable value="personV40"/>
<variable value="performer"/>
</dependent>
</rule>
<rule>
<name value="R39ErbringendeOrganizationProviderID"/>
<source>
<context value="service"/>
<element value="ProviderID"/>
<variable value="providerID"/>
</source>
<target>
<context value="chargeItem"/>
<contextType value="variable"/>
<element value="performingOrganization"/>
<variable value="reference"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="reference"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%providerID.data"/>
</parameter>
</target>
</rule>
<rule>
<name value="R34AuftraggebendeKostenstelleReferrerID"/>
<source>
<context value="service"/>
<element value="ReferrerID"/>
<variable value="referrerID"/>
</source>
<target>
<context value="chargeItem"/>
<contextType value="variable"/>
<element value="costCenter"/>
<variable value="reference"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="reference"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%referrerID.data"/>
</parameter>
</target>
</rule>
<rule>
<name value="R313AnzahlQuantity"/>
<source>
<context value="service"/>
<element value="Quantity"/>
<variable value="quantity"/>
</source>
<target>
<context value="chargeItem"/>
<contextType value="variable"/>
<element value="quantity"/>
<variable value="q"/>
<transform value="create"/>
<parameter>
<valueString value="Quantity"/>
</parameter>
</target>
<target>
<context value="q"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="value"/>
</target>
<target>
<context value="value"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%quantity.data"/>
</parameter>
</target>
</rule>
<rule>
<name value="R310ErfasserEnteredBy"/>
<source>
<context value="service"/>
<element value="EnteredBy"/>
<variable value="enteredBy"/>
</source>
<target>
<context value="chargeItem"/>
<contextType value="variable"/>
<element value="enterer"/>
<variable value="reference"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="reference"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%enteredBy.data"/>
</parameter>
</target>
</rule>
<rule>
<name value="R38ErfassungsdatumEnteredDateTime"/>
<source>
<context value="service"/>
<element value="EnteredDateTime"/>
<variable value="enteredDateTime"/>
</source>
<target>
<context value="chargeItem"/>
<contextType value="variable"/>
<element value="enteredDate"/>
<variable value="enteredDate"/>
<transform value="create"/>
<parameter>
<valueString value="dateTime"/>
</parameter>
</target>
<target>
<context value="enteredDate"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%enteredDateTime.data"/>
</parameter>
</target>
</rule>
<rule>
<name value="patientContactID"/>
<source>
<context value="service"/>
<element value="PatientContactID"/>
<variable value="patientContactID"/>
</source>
<rule>
<name value="PatientContactID"/>
<source>
<context value="patientContactID"/>
<element value="data"/>
<variable value="data"/>
</source>
<target>
<context value="chargeItem"/>
<contextType value="variable"/>
<element value="identifier"/>
<variable value="identifier"/>
<transform value="create"/>
<parameter>
<valueString value="Identifier"/>
</parameter>
</target>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="data"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="costweight"/>
<source>
<context value="service"/>
<element value="Costweight"/>
<variable value="costweight"/>
</source>
<rule>
<name value="Costweight"/>
<source>
<context value="costweight"/>
<element value="data"/>
<variable value="data"/>
</source>
<target>
<context value="chargeItem"/>
<contextType value="variable"/>
<element value="factorOverride"/>
<transform value="copy"/>
<parameter>
<valueId value="data"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="ServiceProcedureToFhirProcedure"/>
<source>
<context value="service"/>
<element value="Procedure"/>
<variable value="proc"/>
</source>
<target>
<context value="chargeItem"/>
<contextType value="variable"/>
<element value="contained"/>
<variable value="procedure"/>
<transform value="create"/>
<parameter>
<valueString value="Procedure"/>
</parameter>
</target>
<target>
<context value="procedure"/>
<contextType value="variable"/>
<element value="id"/>
<variable value="containedid"/>
<transform value="uuid"/>
</target>
<target>
<context value="chargeItem"/>
<contextType value="variable"/>
<element value="service"/>
<variable value="service"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="service"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="evaluate"/>
<parameter>
<valueString value="'#' + %containedid"/>
</parameter>
</target>
<dependent>
<name value="ServiceProcedureToFhirProcedure"/>
<variable value="proc"/>
<variable value="procedure"/>
</dependent>
</rule>
</group>
<group>
<name value="ServiceProcedureToFhirProcedure"/>
<typeMode value="none"/>
<input>
<name value="proc"/>
<type value="Proc"/>
<mode value="source"/>
</input>
<input>
<name value="procedure"/>
<type value="Procedure"/>
<mode value="target"/>
</input>
<rule>
<name value="R314ProzedurIDIdentifier"/>
<source>
<context value="proc"/>
<element value="Identifier"/>
<variable value="identifier"/>
</source>
<target>
<context value="procedure"/>
<contextType value="variable"/>
<element value="identifier"/>
<variable value="identifier"/>
<transform value="create"/>
<parameter>
<valueString value="Identifier"/>
</parameter>
</target>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%identifier.data"/>
</parameter>
</target>
</rule>
<rule>
<name value="R316ProzedurcodeCode"/>
<source>
<context value="proc"/>
<element value="Code"/>
<variable value="chopcode"/>
<condition value="(%proc.Category.data = 'CHOP_2023')"/>
</source>
<target>
<context value="procedure"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="cc"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<target>
<context value="cc"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%chopcode.data"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="https://www.bfs.admin.ch/bfs/statistiche/catalog/chop2023"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%proc.Display.data"/>
</parameter>
</target>
</rule>
<rule>
<name value="R317DatumZeitPerformedDateTime"/>
<source>
<context value="proc"/>
<element value="PerformedDateTime"/>
<variable value="performedDateTime"/>
</source>
<target>
<context value="procedure"/>
<contextType value="variable"/>
<element value="performed"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%performedDateTime.data"/>
</parameter>
</target>
</rule>
<rule>
<name value="laterality"/>
<source>
<context value="proc"/>
<element value="Laterality"/>
<variable value="laterality"/>
</source>
<rule>
<name value="R318SeiteLaterality"/>
<source>
<context value="laterality"/>
<element value="data"/>
<variable value="v"/>
</source>
<target>
<context value="procedure"/>
<contextType value="variable"/>
<element value="bodySite"/>
<variable value="cc"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<target>
<context value="cc"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="translate"/>
<parameter>
<valueId value="v"/>
</parameter>
<parameter>
<valueString value="#laterality"/>
</parameter>
<parameter>
<valueString value="code"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://snomed.info/sct"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%proc.LateralityDisplay.data"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="performer"/>
<source>
<context value="proc"/>
<element value="Performer"/>
<variable value="performer"/>
</source>
<rule>
<name value="Identifier"/>
<source>
<context value="performer"/>
<element value="Identifier"/>
<variable value="identifier"/>
</source>
<rule>
<name value="identifier"/>
<source>
<context value="identifier"/>
<element value="data"/>
<variable value="data"/>
</source>
<target>
<context value="procedure"/>
<contextType value="variable"/>
<element value="performer"/>
<variable value="performer"/>
</target>
<target>
<context value="performer"/>
<contextType value="variable"/>
<element value="actor"/>
<variable value="actor"/>
</target>
<target>
<context value="actor"/>
<contextType value="variable"/>
<element value="identifier"/>
<variable value="identifier"/>
</target>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="data"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="containedpatient"/>
<source>
<context value="proc"/>
</source>
<target>
<context value="procedure"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="ref"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="ref"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="copy"/>
<parameter>
<valueString value="#pat"/>
</parameter>
</target>
</rule>
<rule>
<name value="status"/>
<source>
<context value="proc"/>
</source>
<target>
<context value="procedure"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="completed"/>
</parameter>
</target>
</rule>
</group>
<group>
<name value="PersonV40ToPerformer"/>
<typeMode value="none"/>
<input>
<name value="personV40"/>
<type value="PersonV40"/>
<mode value="source"/>
</input>
<input>
<name value="performer"/>
<mode value="target"/>
</input>
<rule>
<name value="R3152PersonIDPersonID"/>
<source>
<context value="personV40"/>
<element value="PersonTyp"/>
<variable value="personTyp"/>
</source>
<target>
<context value="performer"/>
<contextType value="variable"/>
<element value="function"/>
<variable value="cc"/>
</target>
<target>
<context value="cc"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<variable value="system"/>
</target>
<target>
<context value="system"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-alis/CodeSystem/ch-alis-persontyp"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="code"/>
</target>
<target>
<context value="code"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="personTyp"/>
</parameter>
</target>
</rule>
<rule>
<name value="R3152PersonIDPersonID"/>
<source>
<context value="personV40"/>
<element value="PersonID"/>
<variable value="personId"/>
</source>
<target>
<context value="performer"/>
<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="display"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%personId.data"/>
</parameter>
</target>
</rule>
</group>
<group>
<name value="ParameterV40ToExtension"/>
<typeMode value="none"/>
<input>
<name value="parameterV40"/>
<type value="ParameterV40"/>
<mode value="source"/>
</input>
<input>
<name value="extension"/>
<type value="Extension"/>
<mode value="target"/>
</input>
<rule>
<name value="ParamTyp"/>
<source>
<context value="parameterV40"/>
<element value="ParamTyp"/>
<variable value="paramTyp"/>
</source>
<target>
<context value="extension"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="extInner"/>
</target>
<dependent>
<name value="InnerExtensionParamTyp"/>
<variable value="paramTyp"/>
<variable value="extInner"/>
</dependent>
</rule>
<rule>
<name value="ParamValue"/>
<source>
<context value="parameterV40"/>
<element value="ParamValue"/>
<variable value="paramValue"/>
</source>
<rule>
<name value="data"/>
<source>
<context value="paramValue"/>
<element value="data"/>
<variable value="data"/>
</source>
<target>
<context value="extension"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="extInner"/>
</target>
<dependent>
<name value="InnerExtensionParamValue"/>
<variable value="data"/>
<variable value="extInner"/>
</dependent>
</rule>
</rule>
</group>
<group>
<name value="InnerExtensionParamTyp"/>
<typeMode value="none"/>
<input>
<name value="src"/>
<mode value="source"/>
</input>
<input>
<name value="ext"/>
<type value="Extension"/>
<mode value="target"/>
</input>
<rule>
<name value="url"/>
<source>
<context value="src"/>
</source>
<target>
<context value="ext"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="ParamTyp"/>
</parameter>
</target>
</rule>
<rule>
<name value="string"/>
<source>
<context value="src"/>
</source>
<target>
<context value="ext"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="cc"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<target>
<context value="cc"/>
<contextType value="variable"/>
<element value="text"/>
<variable value="text"/>
</target>
<target>
<context value="text"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="src"/>
</parameter>
</target>
</rule>
</group>
<group>
<name value="InnerExtensionParamValue"/>
<typeMode value="none"/>
<input>
<name value="src"/>
<mode value="source"/>
</input>
<input>
<name value="ext"/>
<type value="Extension"/>
<mode value="target"/>
</input>
<rule>
<name value="url"/>
<source>
<context value="src"/>
</source>
<target>
<context value="ext"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="ParamValue"/>
</parameter>
</target>
</rule>
<rule>
<name value="string"/>
<source>
<context value="src"/>
</source>
<target>
<context value="ext"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="string"/>
<transform value="create"/>
<parameter>
<valueString value="string"/>
</parameter>
</target>
<target>
<context value="string"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="src"/>
</parameter>
</target>
</rule>
</group>
<group>
<name value="ServiceToPatientName"/>
<typeMode value="none"/>
<input>
<name value="visit"/>
<type value="Visit"/>
<mode value="source"/>
</input>
<input>
<name value="name"/>
<type value="HumanName"/>
<mode value="target"/>
</input>
<rule>
<name value="patientName"/>
<source>
<context value="visit"/>
<element value="PatientName"/>
<variable value="patientName"/>
</source>
<rule>
<name value="R23PatientNamePatientName"/>
<source>
<context value="patientName"/>
<element value="data"/>
<variable value="data"/>
</source>
<target>
<context value="name"/>
<contextType value="variable"/>
<element value="family"/>
<transform value="copy"/>
<parameter>
<valueId value="data"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="patientGivenName"/>
<source>
<context value="visit"/>
<element value="PatientGivenName"/>
<variable value="patientGivenName"/>
</source>
<rule>
<name value="R24PatientVornamePatientGivenName"/>
<source>
<context value="patientGivenName"/>
<element value="data"/>
<variable value="data"/>
</source>
<target>
<context value="name"/>
<contextType value="variable"/>
<element value="given"/>
<transform value="copy"/>
<parameter>
<valueId value="data"/>
</parameter>
</target>
</rule>
</rule>
</group>
<group>
<name value="ServiceToPatient"/>
<typeMode value="none"/>
<input>
<name value="service"/>
<type value="Service"/>
<mode value="source"/>
</input>
<input>
<name value="visit"/>
<type value="Visit"/>
<mode value="source"/>
</input>
<input>
<name value="patient"/>
<type value="Patient"/>
<mode value="target"/>
</input>
<rule>
<name value="patientID"/>
<source>
<context value="visit"/>
<element value="PatientID"/>
<variable value="patientID"/>
</source>
<rule>
<name value="R22PatientPIDPatientID"/>
<source>
<context value="patientID"/>
<element value="data"/>
<variable value="patId"/>
</source>
<target>
<context value="patient"/>
<contextType value="variable"/>
<element value="identifier"/>
<variable value="identifier"/>
</target>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="value"/>
</target>
<target>
<context value="value"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="patId"/>
</parameter>
</target>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="system"/>
<variable value="idsystem"/>
</target>
<target>
<context value="idsystem"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueString value="http://www.example.ch/patienteniddomain"/>
</parameter>
</target>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="type"/>
<variable value="type"/>
</target>
<target>
<context value="type"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<variable value="system"/>
</target>
<target>
<context value="system"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/v2-0203"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="code"/>
</target>
<target>
<context value="code"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueString value="MR"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="ServiceToPatient"/>
<source>
<context value="visit"/>
<condition value="(visit.PatientName or visit.PatientGivenName)"/>
</source>
<target>
<context value="patient"/>
<contextType value="variable"/>
<element value="name"/>
<variable value="name"/>
</target>
<dependent>
<name value="ServiceToPatientName"/>
<variable value="visit"/>
<variable value="name"/>
</dependent>
</rule>
<rule>
<name value="R26PatientGeschlechtPatientGender"/>
<source>
<context value="visit"/>
<element value="PatientGender"/>
<variable value="gender"/>
</source>
<rule>
<name value="gender"/>
<source>
<context value="gender"/>
<element value="data"/>
<variable value="v"/>
</source>
<target>
<context value="patient"/>
<contextType value="variable"/>
<element value="gender"/>
<transform value="translate"/>
<parameter>
<valueId value="v"/>
</parameter>
<parameter>
<valueString value="#gender"/>
</parameter>
<parameter>
<valueString value="code"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="R25PatientGebDatumPatientBirthDate"/>
<source>
<context value="visit"/>
<element value="PatientBirthDate"/>
<variable value="birthDate"/>
</source>
<rule>
<name value="birthDate"/>
<source>
<context value="birthDate"/>
<element value="data"/>
<variable value="v"/>
</source>
<target>
<context value="patient"/>
<contextType value="variable"/>
<element value="birthDate"/>
<transform value="copy"/>
<parameter>
<valueId value="v"/>
</parameter>
</target>
</rule>
</rule>
</group>
<group>
<name value="DiagnosisToCondition"/>
<typeMode value="none"/>
<input>
<name value="diagnosis"/>
<type value="Diagnosis"/>
<mode value="source"/>
</input>
<input>
<name value="cond"/>
<type value="Condition"/>
<mode value="target"/>
</input>
<rule>
<name value="containedpatient"/>
<source>
<context value="diagnosis"/>
</source>
<target>
<context value="cond"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="ref"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="ref"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="copy"/>
<parameter>
<valueString value="#pat"/>
</parameter>
</target>
</rule>
<rule>
<name value="Identifier"/>
<source>
<context value="diagnosis"/>
<element value="Identifier"/>
<variable value="identifier"/>
</source>
<rule>
<name value="identifier"/>
<source>
<context value="identifier"/>
<element value="data"/>
<variable value="data"/>
</source>
<target>
<context value="cond"/>
<contextType value="variable"/>
<element value="identifier"/>
<variable value="identifier"/>
</target>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="data"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="R316ProzedurcodeCode"/>
<source>
<context value="diagnosis"/>
<element value="Code"/>
<variable value="code"/>
</source>
<target>
<context value="cond"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="cc"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<target>
<context value="cc"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%code.data"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%diagnosis.Display.data"/>
</parameter>
</target>
<rule>
<name value="serviceType"/>
<source>
<context value="diagnosis"/>
<element value="Category"/>
<variable value="category"/>
</source>
<rule>
<name value="data"/>
<source>
<context value="category"/>
<element value="data"/>
<variable value="data"/>
<condition value="(startsWith('ICD'))"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://hl7.org/fhir/sid/icd-10"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="onsetDateTime"/>
<source>
<context value="diagnosis"/>
<element value="OnsetDateTime"/>
<variable value="onsetDateTime"/>
</source>
<target>
<context value="cond"/>
<contextType value="variable"/>
<element value="onset"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%onsetDateTime.data"/>
</parameter>
</target>
</rule>
<rule>
<name value="laterality"/>
<source>
<context value="diagnosis"/>
<element value="Laterality"/>
<variable value="laterality"/>
</source>
<rule>
<name value="R318SeiteLaterality"/>
<source>
<context value="laterality"/>
<element value="data"/>
<variable value="v"/>
</source>
<target>
<context value="cond"/>
<contextType value="variable"/>
<element value="bodySite"/>
<variable value="cc"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<target>
<context value="cc"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="translate"/>
<parameter>
<valueId value="v"/>
</parameter>
<parameter>
<valueString value="#laterality"/>
</parameter>
<parameter>
<valueString value="code"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="http://snomed.info/sct"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%diagnosis.LateralityDisplay.data"/>
</parameter>
</target>
</rule>
</rule>
</group>
<group>
<name value="DiagGroupToCondition"/>
<typeMode value="none"/>
<input>
<name value="diagGroup"/>
<type value="DiagGroup"/>
<mode value="source"/>
</input>
<input>
<name value="cond"/>
<type value="Condition"/>
<mode value="target"/>
</input>
<rule>
<name value="containedpatient"/>
<source>
<context value="diagGroup"/>
</source>
<target>
<context value="cond"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="ref"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="ref"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="copy"/>
<parameter>
<valueString value="#pat"/>
</parameter>
</target>
</rule>
<rule>
<name value="R291DiagnosecodeDiagCode"/>
<source>
<context value="diagGroup"/>
<element value="DiagCode"/>
<variable value="data"/>
</source>
<target>
<context value="cond"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="cc"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<target>
<context value="cc"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
<transform value="create"/>
<parameter>
<valueString value="Coding"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueId value="data"/>
</parameter>
</target>
<rule>
<name value="serviceType"/>
<source>
<context value="diagGroup"/>
<element value="DiagCatType"/>
<variable value="diagCatType"/>
</source>
<rule>
<name value="R293KatalogtypDiagCatType"/>
<source>
<context value="diagCatType"/>
<element value="data"/>
<variable value="data"/>
</source>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="translate"/>
<parameter>
<valueId value="data"/>
</parameter>
<parameter>
<valueString value="#serviceMap"/>
</parameter>
<parameter>
<valueString value="code"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</group>
<group>
<name value="TerminationToExtension"/>
<typeMode value="none"/>
<input>
<name value="visit"/>
<type value="Visit"/>
<mode value="source"/>
</input>
<input>
<name value="ext"/>
<type value="Extension"/>
<mode value="target"/>
</input>
<rule>
<name value="TerminationVisit"/>
<source>
<context value="visit"/>
<element value="TerminationVisit"/>
<variable value="visit"/>
</source>
<rule>
<name value="R27FallAbschlussTerminationVisit"/>
<source>
<context value="visit"/>
<element value="data"/>
<variable value="data"/>
</source>
<target>
<context value="ext"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext1"/>
</target>
<target>
<context value="ext1"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="TerminationVisit"/>
</parameter>
</target>
<target>
<context value="ext1"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="date"/>
<transform value="create"/>
<parameter>
<valueString value="date"/>
</parameter>
</target>
<target>
<context value="date"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="data"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="TerminationVisit"/>
<source>
<context value="visit"/>
<element value="TerminationReason"/>
<variable value="visit"/>
</source>
<rule>
<name value="R28FallAbschlussgrundTerminationReason"/>
<source>
<context value="visit"/>
<element value="data"/>
<variable value="data"/>
</source>
<target>
<context value="ext"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext1"/>
</target>
<target>
<context value="ext1"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString value="TerminationReason"/>
</parameter>
</target>
<target>
<context value="ext1"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="string"/>
<transform value="create"/>
<parameter>
<valueString value="string"/>
</parameter>
</target>
<target>
<context value="string"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="data"/>
</parameter>
</target>
</rule>
</rule>
</group>
<group>
<name value="VisitToEncounter"/>
<typeMode value="none"/>
<input>
<name value="visit"/>
<type value="Visit"/>
<mode value="source"/>
</input>
<input>
<name value="encounter"/>
<type value="Encounter"/>
<mode value="target"/>
</input>
<rule>
<name value="TerminationToExtension"/>
<source>
<context value="visit"/>
<condition
value="(visit.TerminationVisit or visit.TerminationReason)"/>
</source>
<target>
<context value="encounter"/>
<contextType value="variable"/>
<element value="extension"/>
<variable value="ext"/>
</target>
<target>
<context value="ext"/>
<contextType value="variable"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://fhir.ch/ig/ch-alis/StructureDefinition/ch-alis-ext-termination"/>
</parameter>
</target>
<dependent>
<name value="TerminationToExtension"/>
<variable value="visit"/>
<variable value="ext"/>
</dependent>
</rule>
<rule>
<name value="encounterID"/>
<source>
<context value="visit"/>
<element value="VisitNumber"/>
<variable value="visitNumber"/>
</source>
<rule>
<name value="R21FallVisitNumber"/>
<source>
<context value="visitNumber"/>
<element value="data"/>
<variable value="data"/>
</source>
<target>
<context value="encounter"/>
<contextType value="variable"/>
<element value="identifier"/>
<variable value="identifier"/>
<transform value="create"/>
<parameter>
<valueString value="Identifier"/>
</parameter>
</target>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="value"/>
<variable value="value"/>
</target>
<target>
<context value="value"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="data"/>
</parameter>
</target>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="system"/>
<variable value="idsystem"/>
</target>
<target>
<context value="idsystem"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueString value="http://www.example.ch/fallnummerdomain"/>
</parameter>
</target>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="type"/>
<variable value="type"/>
</target>
<target>
<context value="type"/>
<contextType value="variable"/>
<element value="coding"/>
<variable value="coding"/>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<variable value="system"/>
</target>
<target>
<context value="system"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/v2-0203"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="code"/>
</target>
<target>
<context value="code"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueString value="VN"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="Finished"/>
<source>
<context value="visit"/>
</source>
<target>
<context value="encounter"/>
<contextType value="variable"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="finished"/>
</parameter>
</target>
</rule>
<rule>
<name value="R21FallVisitNumber"/>
<source>
<context value="visit"/>
</source>
<target>
<context value="encounter"/>
<contextType value="variable"/>
<element value="class"/>
<variable value="coding"/>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="system"/>
<variable value="system"/>
</target>
<target>
<context value="system"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://terminology.hl7.org/CodeSystem/v3-ActCode"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="code"/>
<variable value="code"/>
</target>
<target>
<context value="code"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueString value="IMP"/>
</parameter>
</target>
<target>
<context value="coding"/>
<contextType value="variable"/>
<element value="display"/>
<variable value="display"/>
</target>
<target>
<context value="display"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueString value="inpatient encounter"/>
</parameter>
</target>
</rule>
<rule>
<name value="subject"/>
<source>
<context value="visit"/>
</source>
<target>
<context value="encounter"/>
<contextType value="variable"/>
<element value="subject"/>
<variable value="ref"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="ref"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="copy"/>
<parameter>
<valueString value="#pat"/>
</parameter>
</target>
</rule>
<rule>
<name value="R29DiagnoseGruppeDiagGroup"/>
<source>
<context value="visit"/>
<element value="DiagGroup"/>
<variable value="diaggroup"/>
</source>
<target>
<context value="encounter"/>
<contextType value="variable"/>
<element value="diagnosis"/>
<variable value="diag"/>
</target>
<target>
<context value="diag"/>
<contextType value="variable"/>
<element value="condition"/>
<variable value="ref"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<target>
<context value="ref"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="copy"/>
<parameter>
<valueString value="#cond"/>
</parameter>
</target>
<rule>
<name value="R292DiagnosetypDiagType"/>
<source>
<context value="diaggroup"/>
<element value="DiagType"/>
<variable value="diagType"/>
</source>
<target>
<context value="diag"/>
<contextType value="variable"/>
<element value="use"/>
<variable value="use"/>
</target>
<target>
<context value="use"/>
<contextType value="variable"/>
<element value="text"/>
<transform value="evaluate"/>
<parameter>
<valueString value="%diagType.data"/>
</parameter>
</target>
</rule>
</rule>
</group>
</StructureMap>