Generated Narrative: StructureMap map-upper-arm-injection #xD; map "https://fhir.cognovis.de/praxis/StructureMap/map-upper-arm-injection" = "MapUpperArmInjection"#xD; #xD; // EXAMPLE-ONLY worked StructureMap for the upper-arm injection Job (GOÄ 252). Not a curated production binding discovery artifact. Executed by the bounded R4 StructureMap rule-tree interpreter. Composition/Condition/Observation/Procedure/ChargeItem candidates. QR.subject/.encounter/.author/.authored supply Composition context (never fabricated). ChargeItem.code is Job-fixed GOÄ 252 (http://fhir.de/CodeSystem/bäk/goä#252); definitionCanonical from cid.primary answer.valueUri only. Procedure carries instantiatesCanonical to the Job; basedOn only when a real ServiceRequest exists (separate fixture, not this map). Binding identity: (job-upper-arm-injection|0.90.0, q-upper-arm-injection|0.90.0, map-upper-arm-injection|0.90.0).#xD; #xD; uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias qr as source#xD; uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias bundle as target#xD; #xD; // Bind QuestionnaireResponse.subject/.encounter/.author/.authored (standard QR fields; not duplicated Questionnaire items), then invoke fillCondition / fillDocumentation / fillProcedure / fillChargeItems / fillComposition.#xD; group main(source qr : QuestionnaireResponse, target bundle : Bundle) {#xD; qr -> bundle.type = 'collection' "bundleType";#xD; qr.subject as subjectRef then {#xD; qr.encounter as encRef then {#xD; qr.author as authorRef then {#xD; qr.authored as authoredDt then {#xD; qr.item as diagCodingItem where (linkId = 'diag.icd') then fillCondition(diagCodingItem, bundle, subjectRef) "invokeFillCondition";#xD; qr.item as noteItem where (linkId = 'doc.note') then fillDocumentation(noteItem, bundle, subjectRef) "invokeFillDocumentation";#xD; qr.item as perfItem where (linkId = 'svc.performed' and answer.valueBoolean = true) then fillProcedure(qr, bundle, subjectRef) "invokeFillProcedure";#xD; qr as qrForCharges then fillChargeItems(qrForCharges, bundle, subjectRef, encRef) "invokeFillChargeItems";#xD; qr as qrForComp then fillComposition(qrForComp, bundle, subjectRef, encRef, authorRef, authoredDt) "invokeFillComposition";#xD; } "bindAuthoredFromQr";#xD; } "bindAuthorFromQr";#xD; } "bindEncounterFromQr";#xD; } "bindSubjectFromQr";#xD; }#xD; #xD; // diag.icd answer.valueCoding -> Condition; verificationStatus=unconfirmed; subject from QR.subject.#xD; group fillCondition(source diagItem, target bundle : Bundle, source subjectRef) {#xD; diagItem.answer as ans then {#xD; ans.value : Coding as coding -> bundle.entry = create() as condEntry, condEntry.fullUrl = 'urn:uuid:00000000-0000-4000-8000-000000000001', condEntry.resource = create('Condition') as cond, cond.code = create('CodeableConcept') as condCode, condCode.coding = coding, cond.verificationStatus = create('CodeableConcept') as ver, ver.coding = create('Coding') as verCoding, verCoding.system = 'http://terminology.hl7.org/CodeSystem/condition-ver-status', verCoding.code = 'unconfirmed', cond.clinicalStatus = create('CodeableConcept') as clin, clin.coding = create('Coding') as clinCoding, clinCoding.system = 'http://terminology.hl7.org/CodeSystem/condition-clinical', clinCoding.code = 'active', cond.subject = subjectRef "codingValue";#xD; } "conditionFromValueCoding";#xD; }#xD; #xD; // doc.note answer.valueString -> Observation.value (serialized as valueString) status=preliminary.#xD; group fillDocumentation(source noteItem, target bundle : Bundle, source subjectRef) {#xD; noteItem.answer as ans then {#xD; ans.value : string as text -> bundle.entry = create() as obsEntry, obsEntry.fullUrl = 'urn:uuid:00000000-0000-4000-8000-000000000002', obsEntry.resource = create('Observation') as obs, obs.status = 'preliminary', obs.code = create('CodeableConcept') as obsCode, obsCode.coding = create('Coding') as obsCoding, obsCoding.system = 'http://snomed.info/sct', obsCoding.code = '371524004', obs.value = text, obs.subject = subjectRef "stringValue";#xD; } "obsFromValueString";#xD; }#xD; #xD; // bodySiteFromValueCoding + SNOMED laterality; status=preparation; reasonReference from diag.condition.#xD; group fillProcedure(source qr : QuestionnaireResponse, target bundle : Bundle, source subjectRef) {#xD; qr.item as siteItem where (linkId = 'site.bodySite'), qr.item as latItem where (linkId = 'site.laterality') then {#xD; siteItem.answer as siteAns then {#xD; siteAns.value : Coding as siteCoding then {#xD; latItem.answer as latAns then {#xD; latAns.value : Coding as latCoding -> bundle.entry = create() as procEntry, procEntry.fullUrl = 'urn:uuid:00000000-0000-4000-8000-000000000003', procEntry.resource = create('Procedure') as proc, proc.status = 'preparation', proc.code = create('CodeableConcept') as procCode, procCode.coding = create('Coding') as procCoding, procCoding.system = 'http://snomed.info/sct', procCoding.code = '59108006', proc.subject = subjectRef, proc.instantiatesCanonical = 'https://fhir.cognovis.de/praxis/PlanDefinition/job-upper-arm-injection|0.90.0', proc.bodySite = create('CodeableConcept') as bs, bs.coding = siteCoding, bs.coding = latCoding then {#xD; qr.item as diagRefItem where (linkId = 'diag.condition') then {#xD; diagRefItem.answer as drAns then {#xD; drAns.value : Reference as reasonRef -> proc.reasonReference = reasonRef "diagRefValue";#xD; } "diagRefAnswer";#xD; } "reasonFromConditionRef";#xD; } "latValue";#xD; } "latAnswer";#xD; } "siteValue";#xD; } "siteAnswer";#xD; } "bodySiteFromValueCoding";#xD; }#xD; #xD; // One ChargeItem per runtime contract (cid.primary answer.valueUri). ChargeItem.code is the Job-fixed GOÄ 252 Coding (http://fhir.de/CodeSystem/bäk/goä), never derived from CID identity or service codes. context from QR.encounter; subject from QR.subject; 1:n service lineage when performed; supportingInformation from diag.condition.#xD; group fillChargeItems(source qr : QuestionnaireResponse, target bundle : Bundle, source subjectRef, source encRef) {#xD; qr.item as cidItem where (linkId = 'cid.primary') then {#xD; cidItem.answer as cidAns then {#xD; cidAns.value : uri as primaryCid -> bundle.entry = create() as chg1Entry, chg1Entry.fullUrl = 'urn:uuid:00000000-0000-4000-8000-000000000004', chg1Entry.resource = create('ChargeItem') as chg1, chg1.status = 'planned', chg1.subject = subjectRef, chg1.context = encRef, chg1.code = create('CodeableConcept') as chgCode, chgCode.coding = create('Coding') as fixedCoding, fixedCoding.system = 'http://fhir.de/CodeSystem/bäk/goä', fixedCoding.code = '252', fixedCoding.display = 'Injektion, s.c./s.m./i.c./i.m.', chg1.definitionCanonical = primaryCid, chg1.quantity = create('Quantity') as qty, qty.value = 1 then {#xD; qr.item as amtItem where (linkId = 'fee.amount'), qr.item as curItem where (linkId = 'fee.currency') then {#xD; amtItem.answer as amtAns then {#xD; amtAns.value : decimal as amount then {#xD; curItem.answer as curAns then {#xD; curAns.value : Coding as curCoding then {#xD; curCoding.code as currencyCode -> chg1.priceOverride = create('Money') as money, money.value = amount, money.currency = currencyCode "currencyCode";#xD; } "currencyValue";#xD; } "currencyAnswer";#xD; } "amountValue";#xD; } "amountAnswer";#xD; } "moneyFromParts";#xD; qr.item as perfItem where (linkId = 'svc.performed' and answer.valueBoolean = true) -> chg1.service = create('Reference') as svcProc, svcProc.reference = 'urn:uuid:00000000-0000-4000-8000-000000000003', chg1.service = create('Reference') as svcObs, svcObs.reference = 'urn:uuid:00000000-0000-4000-8000-000000000002' "serviceWhenPerformedPrimary";#xD; qr.item as diagRefItem2 where (linkId = 'diag.condition') then {#xD; diagRefItem2.answer as dr2Ans then {#xD; dr2Ans.value : Reference as reasonRef2 -> chg1.supportingInformation = reasonRef2 "dr2Value";#xD; } "dr2Answer";#xD; } "supportingInfoFromConditionRef";#xD; } "cidValue";#xD; } "cidAnswer";#xD; } "primaryFromValueUri";#xD; }#xD; #xD; // Composition proposal (status=preliminary). subject/encounter/author/date from QR.subject/.encounter/.author/.authored only — never fabricated. Sections Reference generated Observation/ChargeItem UUIDs; optional Procedure/Condition sections when those outputs are produced.#xD; group fillComposition(source qr : QuestionnaireResponse, target bundle : Bundle, source subjectRef, source encRef, source authorRef, source authoredDt) {#xD; qr -> bundle.entry = create() as compEntry, compEntry.fullUrl = 'urn:uuid:00000000-0000-4000-8000-000000000006', compEntry.resource = create('Composition') as comp, comp.status = 'preliminary', comp.type = create('CodeableConcept') as compType, compType.coding = create('Coding') as compTypeCoding, compTypeCoding.system = 'http://loinc.org', compTypeCoding.code = '11506-3', compTypeCoding.display = 'Progress note', comp.title = 'Upper-arm injection visit - pre-approval proposal', comp.subject = subjectRef, comp.encounter = encRef, comp.author = authorRef, comp.date = authoredDt, comp.section = create() as secDoc, secDoc.title = 'Documentation', secDoc.entry = create('Reference') as docEntry, docEntry.reference = 'urn:uuid:00000000-0000-4000-8000-000000000002', comp.section = create() as secBill, secBill.title = 'Billing proposal', secBill.entry = create('Reference') as billEntry, billEntry.reference = 'urn:uuid:00000000-0000-4000-8000-000000000004' then {#xD; qr.item as perfItem where (linkId = 'svc.performed' and answer.valueBoolean = true) -> comp.section = create() as secProc, secProc.title = 'Procedure proposal', secProc.entry = create('Reference') as procEntryRef, procEntryRef.reference = 'urn:uuid:00000000-0000-4000-8000-000000000003' "sectionProcedureWhenPerformed";#xD; qr.item as diagCodingItem where (linkId = 'diag.icd') -> comp.section = create() as secDx, secDx.title = 'Diagnosis proposal', secDx.entry = create('Reference') as dxEntry, dxEntry.reference = 'urn:uuid:00000000-0000-4000-8000-000000000001' "sectionDiagnosisWhenCoding";#xD; } "compositionShell";#xD; }#xD; #xD;
Upper-arm injection Job — QuestionnaireResponse to pre-approval candidate Bundle
EXAMPLE-ONLY worked StructureMap for the upper-arm injection Job (GOÄ 252). Not a curated production binding discovery artifact. Executed by the bounded R4 StructureMap rule-tree interpreter. Composition/Condition/Observation/Procedure/ChargeItem candidates. QR.subject/.encounter/.author/.authored supply Composition context (never fabricated). ChargeItem.code is Job-fixed GOÄ 252 (http://fhir.de/CodeSystem/bäk/goä#252); definitionCanonical from cid.primary answer.valueUri only. Procedure carries instantiatesCanonical to the Job; basedOn only when a real ServiceRequest exists (separate fixture, not this map). Binding identity: (job-upper-arm-injection|0.90.0, q-upper-arm-injection|0.90.0, map-upper-arm-injection|0.90.0).
Bind QuestionnaireResponse.subject/.encounter/.author/.authored (standard QR fields; not duplicated Questionnaire items), then invoke fillCondition / fillDocumentation / fillProcedure / fillChargeItems / fillComposition.
linkId = 'svc.performed' and answer.valueBoolean = true
diag.icd answer.valueCoding -> Condition; verificationStatus=unconfirmed; subject from QR.subject.
doc.note answer.valueString -> Observation.value (serialized as valueString) status=preliminary.
bodySiteFromValueCoding + SNOMED laterality; status=preparation; reasonReference from diag.condition.
One ChargeItem per runtime contract (cid.primary answer.valueUri). ChargeItem.code is the Job-fixed GOÄ 252 Coding (http://fhir.de/CodeSystem/bäk/goä), never derived from CID identity or service codes. context from QR.encounter; subject from QR.subject; 1:n service lineage when performed; supportingInformation from diag.condition.
Composition proposal (status=preliminary). subject/encounter/author/date from QR.subject/.encounter/.author/.authored only — never fabricated. Sections Reference generated Observation/ChargeItem UUIDs; optional Procedure/Condition sections when those outputs are produced.
Upper-arm injection visit - pre-approval proposal