Structured Data Capture, published by HL7 International / FHIR Infrastructure. This guide is not an authorized publication; it is the continuous build for version 4.0.0-ballot built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/sdc/ and changes regularly. See the Directory of published versions
Page standards status: Trial-use | Maturity Level: 4 |
{
"resourceType" : "StructureMap",
"id" : "ExtractComplexSmap",
"text" : {
"status" : "additional",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n <pre>/// url = "http://hl7.org/fhir/uv/sdc/StructureMap/ExtractComplexSmap"\n/// name = "ExtractComplexSmap"\n/// status = "active"\n/// title = "Complex extraction structure map example"\n/// description = "An example of a StructureMap used to support extraction from a QuestionnaireResponse"\n/// experimental = "true"\n\nmap "http://hl7.org/fhir/uv/sdc/StructureMap/ExtractComplexSmap" = "ExtractComplexSmap"\n\nuses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" as source\nuses "http://hl7.org/fhir/StructureDefinition/Bundle" as target\nuses "http://hl7.org/fhir/StructureDefinition/Patient" as target\nuses "http://hl7.org/fhir/StructureDefinition/RelatedPerson" as target\nuses "http://hl7.org/fhir/StructureDefinition/Observation" as target\nuses "http://hl7.org/fhir/StructureDefinition/Coding" as target\n\ngroup ExtractBundle(source src : QuestionnaireResponse, target tgt : Bundle) {\n\n // Patient\n src.item as patientItem where (linkId = 'patient') -> tgt.entry as patientEntry, uuid() as patientFullUrl then {\n src -> patientEntry.resource = create('Patient') as pat //, pat.id = (%patientFullUrl)\n then PopulatePatient(src, patientItem, pat), PopulateBundleEntry(src, patientEntry, patientFullUrl) "popPatient";\n \n // Related Person(s)\n src.item as rpItem where (linkId = 'contacts') -> tgt.entry as entry, uuid() as fullUrl then {\n src -> entry.resource = create('RelatedPerson') as rp //, rp.id = (%fullUrl)\n then PopulateRelatedPerson(src, rpItem, rp, patientFullUrl), PopulateBundleEntry(src, entry, fullUrl) "popRelatedPerson";\n } "CreateRelatedPersonEntry";\n \n src.item as obsItems where (linkId = 'obs') -> tgt then {\n // Height Observation\n obsItems.item as heightItem where (linkId = 'height') -> tgt.entry as entry, uuid() as fullUrl then {\n src -> entry.resource = create('Observation') as obs,\n cc('http://loinc.org', '8302-2', 'Body height') as coding,\n obs.value = create('Quantity') as q, q.value = (%heightItem.answer.value.first()), q.unit = 'm'\n then PopulateObservation(src, heightItem, obs, coding, patientFullUrl), \n PopulateBundleEntry(src, entry, fullUrl) "popObs";\n } "CreateHeightObsEntry";\n \n // Weight Observation\n obsItems.item as weightItem where (linkId = 'weight') -> tgt.entry as entry, uuid() as fullUrl then {\n src -> entry.resource = create('Observation') as obs,\n cc('http://loinc.org', '29463-7', 'Weight') as coding,\n obs.value = create('Quantity') as q, q.value = (%weightItem.answer.value.first()), q.unit = 'kg'\n then PopulateObservation(src, weightItem, obs, coding, patientFullUrl), \n PopulateBundleEntry(src, entry, fullUrl) "popObs";\n } "CreateWeightObsEntry";\n\n // Prepare the bundle entry\n obsItems.item as complicationItem where (linkId = 'complication') -> tgt.entry as entry, uuid() as fullUrl then {\n src -> entry.resource = create('Observation') as obs,\n cc('http://example.org/sdh/demo/CodeSystem/cc-screening-codes', 'sigmoidoscopy-complication') as coding,\n obs.value = (%complicationItem.answer.value.first())\n then PopulateObservation(src, complicationItem, obs, coding, patientFullUrl), \n PopulateBundleEntry(src, entry, fullUrl) "popObs";\n } "CreateComplicationObsEntry";\n };\n } "CreatePatientEntry";\n}\n\ngroup PopulateBundleEntry(source src : QuestionnaireResponse, target entry, target fullUrl) {\n src -> entry.fullUrl = ('urn:uuid:' & %fullUrl) "SetFullUrl";\n src -> entry.request as req then {\n src -> req.method = 'POST' "setMethod";\n } "SetRequest";\n}\n\ngroup PopulatePatient(source src: QuestionnaireResponse, source patientItem, target pat : Patient) {\n patientItem.item as gender where (linkId = 'gender') -> pat.gender = (%gender.answer.value.first().code) "SetGender";\n patientItem.item as dob where (linkId = 'dob') -> pat.birthDate = (%dob.answer.value) "SetBirthDate";\n \n // name\n patientItem.item as name where (linkId = 'name') -> pat.name as tgtName then {\n name -> tgtName.text = (%name.item.where(linkId='given' or linkId='family').answer.value.join(' ')) "SetNameText";\n name.item as family where (linkId = 'family') -> tgtName.family = (%family.answer.value) "SetFamily";\n name.item as given where (linkId = 'given') then { \n given.answer as answer -> tgtName.given = (%answer.value) "AnswerValue";\n } "SetGiven";\n } "SetName";\n \n // identifier\n patientItem.item as itemIdentifier where (linkId = 'ihi') -> pat.identifier as tgtIdentifier then {\n itemIdentifier -> tgtIdentifier.type as t, t.text = 'National Identifier (IHI)' "SetIdentifierType";\n itemIdentifier -> tgtIdentifier.system = 'http://example.org/nhio' "SetIdentifierSystem";\n itemIdentifier -> tgtIdentifier.value = (%itemIdentifier.answer.value) "SetIdentifierValue";\n } "SetIdentifier";\n \n // telecom\n patientItem.item as itemMobile where (linkId = 'mobile-phone') -> pat.telecom as t, t.system='phone', t.value = (%itemMobile.answer.value), t.use = 'mobile' "SetTelecom";\n}\n\ngroup PopulateRelatedPerson(source src: QuestionnaireResponse, source rpItem, target rp : RelatedPerson, target patientFullUrl) {\n rpItem -> rp.patient as p, p.reference = (%patientFullUrl) "SetPatientRef";\n rpItem.item as name where (linkId = 'contact-name') -> rp.name as n, n.text = (%name.answer.value) "SetName";\n rpItem.item as rel where (linkId = 'relationship') -> rp.relationship as r, r.coding = (%rel.answer.value) "SetRelationship";\n rpItem.item as phone where (linkId = 'phone') -> rp.telecom as t, t.system = 'phone', t.value = (%phone.answer.value), t.use = 'mobile' "SetPhone";\n}\n\ngroup PopulateObservation(source src : QuestionnaireResponse, source complicationItem, target tgt : Observation, target coding : Coding, target patientFullUrl) {\n src -> tgt.code = (%coding) "SetObservationCode";\n src -> tgt.status = 'final' "SetStatus";\n // src.subject as s -> tgt.subject = s; // not using the the subject, as this is intended to be created from the data instead (as is outgoing referral)\n src.subject as s -> tgt.subject as p, p.reference = (%patientFullUrl) "SetSubjectRef";\n src.authored as s -> tgt.issued = s "SetAuthored";\n src.authored as s -> tgt.effective = s "SetEffective";\n src.author as s -> tgt.performer = s;\n src.id -> tgt.derivedFrom as df, df.reference = ('QuestionnaireResponse/' & %src.id) "SetDerivedFrom";\n}</pre>\n </div>"
},
"extension" : [
{
"url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
"valueCode" : "fhir"
}
],
"url" : "http://hl7.org/fhir/uv/sdc/StructureMap/ExtractComplexSmap",
"identifier" : [
{
"system" : "urn:ietf:rfc:3986",
"value" : "urn:oid:2.16.840.1.113883.4.642.40.17.43.3"
}
],
"version" : "4.0.0-ballot",
"name" : "ExtractComplexSmap",
"status" : "draft",
"date" : "2024-12-16T09:47:19+00:00",
"publisher" : "HL7 International / FHIR Infrastructure",
"contact" : [
{
"name" : "HL7 International / FHIR Infrastructure",
"telecom" : [
{
"system" : "url",
"value" : "http://www.hl7.org/Special/committees/fiwg"
}
]
},
{
"telecom" : [
{
"system" : "url",
"value" : "http://www.hl7.org/Special/committees/fiwg"
}
]
}
],
"jurisdiction" : [
{
"coding" : [
{
"system" : "http://unstats.un.org/unsd/methods/m49/m49.htm",
"code" : "001",
"display" : "World"
}
]
}
],
"structure" : [
{
"url" : "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse",
"mode" : "source"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Bundle",
"mode" : "target"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Patient",
"mode" : "target"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/RelatedPerson",
"mode" : "target"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Observation",
"mode" : "target"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Coding",
"mode" : "target"
}
],
"group" : [
{
"name" : "ExtractBundle",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "QuestionnaireResponse",
"mode" : "source"
},
{
"name" : "tgt",
"type" : "Bundle",
"mode" : "target"
}
],
"rule" : [
{
"name" : "CreatePatientEntry",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "patientItem",
"condition" : "(linkId = 'patient')"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "patientEntry"
},
{
"contextType" : "variable",
"variable" : "patientFullUrl",
"transform" : "uuid"
}
],
"rule" : [
{
"name" : "popPatient",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "patientEntry",
"contextType" : "variable",
"element" : "resource",
"variable" : "pat",
"transform" : "create",
"parameter" : [
{
"valueString" : "Patient"
}
]
}
],
"dependent" : [
{
"name" : "PopulatePatient",
"variable" : [
"src",
"patientItem",
"pat"
]
},
{
"name" : "PopulateBundleEntry",
"variable" : [
"src",
"patientEntry",
"patientFullUrl"
]
}
]
},
{
"name" : "CreateRelatedPersonEntry",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "rpItem",
"condition" : "(linkId = 'contacts')"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "entry"
},
{
"contextType" : "variable",
"variable" : "fullUrl",
"transform" : "uuid"
}
],
"rule" : [
{
"name" : "popRelatedPerson",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "entry",
"contextType" : "variable",
"element" : "resource",
"variable" : "rp",
"transform" : "create",
"parameter" : [
{
"valueString" : "RelatedPerson"
}
]
}
],
"dependent" : [
{
"name" : "PopulateRelatedPerson",
"variable" : [
"src",
"rpItem",
"rp",
"patientFullUrl"
]
},
{
"name" : "PopulateBundleEntry",
"variable" : [
"src",
"entry",
"fullUrl"
]
}
]
}
]
},
{
"name" : "item",
"source" : [
{
"context" : "src",
"element" : "item",
"variable" : "obsItems",
"condition" : "(linkId = 'obs')"
}
],
"target" : [
{
"contextType" : "variable",
"transform" : "copy",
"parameter" : [
{
"valueId" : "tgt"
}
]
}
],
"rule" : [
{
"name" : "CreateHeightObsEntry",
"source" : [
{
"context" : "obsItems",
"element" : "item",
"variable" : "heightItem",
"condition" : "(linkId = 'height')"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "entry"
},
{
"contextType" : "variable",
"variable" : "fullUrl",
"transform" : "uuid"
}
],
"rule" : [
{
"name" : "popObs",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "entry",
"contextType" : "variable",
"element" : "resource",
"variable" : "obs",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"contextType" : "variable",
"variable" : "coding",
"transform" : "cc",
"parameter" : [
{
"valueString" : "http://loinc.org"
},
{
"valueString" : "8302-2"
},
{
"valueString" : "Body height"
}
]
},
{
"context" : "obs",
"contextType" : "variable",
"element" : "value",
"variable" : "q",
"transform" : "create",
"parameter" : [
{
"valueString" : "Quantity"
}
]
},
{
"context" : "q",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "%heightItem.answer.value.first()"
}
]
},
{
"context" : "q",
"contextType" : "variable",
"element" : "unit",
"transform" : "copy",
"parameter" : [
{
"valueString" : "m"
}
]
}
],
"dependent" : [
{
"name" : "PopulateObservation",
"variable" : [
"src",
"heightItem",
"obs",
"coding",
"patientFullUrl"
]
},
{
"name" : "PopulateBundleEntry",
"variable" : [
"src",
"entry",
"fullUrl"
]
}
]
}
]
},
{
"name" : "CreateWeightObsEntry",
"source" : [
{
"context" : "obsItems",
"element" : "item",
"variable" : "weightItem",
"condition" : "(linkId = 'weight')"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "entry"
},
{
"contextType" : "variable",
"variable" : "fullUrl",
"transform" : "uuid"
}
],
"rule" : [
{
"name" : "popObs",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "entry",
"contextType" : "variable",
"element" : "resource",
"variable" : "obs",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"contextType" : "variable",
"variable" : "coding",
"transform" : "cc",
"parameter" : [
{
"valueString" : "http://loinc.org"
},
{
"valueString" : "29463-7"
},
{
"valueString" : "Weight"
}
]
},
{
"context" : "obs",
"contextType" : "variable",
"element" : "value",
"variable" : "q",
"transform" : "create",
"parameter" : [
{
"valueString" : "Quantity"
}
]
},
{
"context" : "q",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "%weightItem.answer.value.first()"
}
]
},
{
"context" : "q",
"contextType" : "variable",
"element" : "unit",
"transform" : "copy",
"parameter" : [
{
"valueString" : "kg"
}
]
}
],
"dependent" : [
{
"name" : "PopulateObservation",
"variable" : [
"src",
"weightItem",
"obs",
"coding",
"patientFullUrl"
]
},
{
"name" : "PopulateBundleEntry",
"variable" : [
"src",
"entry",
"fullUrl"
]
}
]
}
]
},
{
"name" : "CreateComplicationObsEntry",
"source" : [
{
"context" : "obsItems",
"element" : "item",
"variable" : "complicationItem",
"condition" : "(linkId = 'complication')"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "entry"
},
{
"contextType" : "variable",
"variable" : "fullUrl",
"transform" : "uuid"
}
],
"rule" : [
{
"name" : "popObs",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "entry",
"contextType" : "variable",
"element" : "resource",
"variable" : "obs",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"contextType" : "variable",
"variable" : "coding",
"transform" : "cc",
"parameter" : [
{
"valueString" : "http://example.org/sdh/demo/CodeSystem/cc-screening-codes"
},
{
"valueString" : "sigmoidoscopy-complication"
}
]
},
{
"context" : "obs",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "%complicationItem.answer.value.first()"
}
]
}
],
"dependent" : [
{
"name" : "PopulateObservation",
"variable" : [
"src",
"complicationItem",
"obs",
"coding",
"patientFullUrl"
]
},
{
"name" : "PopulateBundleEntry",
"variable" : [
"src",
"entry",
"fullUrl"
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "PopulateBundleEntry",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "QuestionnaireResponse",
"mode" : "source"
},
{
"name" : "entry",
"mode" : "target"
},
{
"name" : "fullUrl",
"mode" : "target"
}
],
"rule" : [
{
"name" : "SetFullUrl",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "entry",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' & %fullUrl"
}
]
}
]
},
{
"name" : "SetRequest",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "entry",
"contextType" : "variable",
"element" : "request",
"variable" : "req"
}
],
"rule" : [
{
"name" : "setMethod",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "req",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
}
]
}
]
}
]
},
{
"name" : "PopulatePatient",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "QuestionnaireResponse",
"mode" : "source"
},
{
"name" : "patientItem",
"mode" : "source"
},
{
"name" : "pat",
"type" : "Patient",
"mode" : "target"
}
],
"rule" : [
{
"name" : "SetGender",
"source" : [
{
"context" : "patientItem",
"element" : "item",
"variable" : "gender",
"condition" : "(linkId = 'gender')"
}
],
"target" : [
{
"context" : "pat",
"contextType" : "variable",
"element" : "gender",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "%gender.answer.value.first().code"
}
]
}
]
},
{
"name" : "SetBirthDate",
"source" : [
{
"context" : "patientItem",
"element" : "item",
"variable" : "dob",
"condition" : "(linkId = 'dob')"
}
],
"target" : [
{
"context" : "pat",
"contextType" : "variable",
"element" : "birthDate",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "%dob.answer.value"
}
]
}
]
},
{
"name" : "SetName",
"source" : [
{
"context" : "patientItem",
"element" : "item",
"variable" : "name",
"condition" : "(linkId = 'name')"
}
],
"target" : [
{
"context" : "pat",
"contextType" : "variable",
"element" : "name",
"variable" : "tgtName"
}
],
"rule" : [
{
"name" : "SetNameText",
"source" : [
{
"context" : "name"
}
],
"target" : [
{
"context" : "tgtName",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "%name.item.where((linkId = 'given') or (linkId = 'family')).answer.value.join(' ')"
}
]
}
]
},
{
"name" : "SetFamily",
"source" : [
{
"context" : "name",
"element" : "item",
"variable" : "family",
"condition" : "(linkId = 'family')"
}
],
"target" : [
{
"context" : "tgtName",
"contextType" : "variable",
"element" : "family",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "%family.answer.value"
}
]
}
]
},
{
"name" : "SetGiven",
"source" : [
{
"context" : "name",
"element" : "item",
"variable" : "given",
"condition" : "(linkId = 'given')"
}
],
"rule" : [
{
"name" : "AnswerValue",
"source" : [
{
"context" : "given",
"element" : "answer",
"variable" : "answer"
}
],
"target" : [
{
"context" : "tgtName",
"contextType" : "variable",
"element" : "given",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "%answer.value"
}
]
}
]
}
]
}
]
},
{
"name" : "SetIdentifier",
"source" : [
{
"context" : "patientItem",
"element" : "item",
"variable" : "itemIdentifier",
"condition" : "(linkId = 'ihi')"
}
],
"target" : [
{
"context" : "pat",
"contextType" : "variable",
"element" : "identifier",
"variable" : "tgtIdentifier"
}
],
"rule" : [
{
"name" : "SetIdentifierType",
"source" : [
{
"context" : "itemIdentifier"
}
],
"target" : [
{
"context" : "tgtIdentifier",
"contextType" : "variable",
"element" : "type",
"variable" : "t"
},
{
"context" : "t",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueString" : "National Identifier (IHI)"
}
]
}
]
},
{
"name" : "SetIdentifierSystem",
"source" : [
{
"context" : "itemIdentifier"
}
],
"target" : [
{
"context" : "tgtIdentifier",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://example.org/nhio"
}
]
}
]
},
{
"name" : "SetIdentifierValue",
"source" : [
{
"context" : "itemIdentifier"
}
],
"target" : [
{
"context" : "tgtIdentifier",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "%itemIdentifier.answer.value"
}
]
}
]
}
]
},
{
"name" : "SetTelecom",
"source" : [
{
"context" : "patientItem",
"element" : "item",
"variable" : "itemMobile",
"condition" : "(linkId = 'mobile-phone')"
}
],
"target" : [
{
"context" : "pat",
"contextType" : "variable",
"element" : "telecom",
"variable" : "t"
},
{
"context" : "t",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "phone"
}
]
},
{
"context" : "t",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "%itemMobile.answer.value"
}
]
},
{
"context" : "t",
"contextType" : "variable",
"element" : "use",
"transform" : "copy",
"parameter" : [
{
"valueString" : "mobile"
}
]
}
]
}
]
},
{
"name" : "PopulateRelatedPerson",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "QuestionnaireResponse",
"mode" : "source"
},
{
"name" : "rpItem",
"mode" : "source"
},
{
"name" : "rp",
"type" : "RelatedPerson",
"mode" : "target"
},
{
"name" : "patientFullUrl",
"mode" : "target"
}
],
"rule" : [
{
"name" : "SetPatientRef",
"source" : [
{
"context" : "rpItem"
}
],
"target" : [
{
"context" : "rp",
"contextType" : "variable",
"element" : "patient",
"variable" : "p"
},
{
"context" : "p",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "%patientFullUrl"
}
]
}
]
},
{
"name" : "SetName",
"source" : [
{
"context" : "rpItem",
"element" : "item",
"variable" : "name",
"condition" : "(linkId = 'contact-name')"
}
],
"target" : [
{
"context" : "rp",
"contextType" : "variable",
"element" : "name",
"variable" : "n"
},
{
"context" : "n",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "%name.answer.value"
}
]
}
]
},
{
"name" : "SetRelationship",
"source" : [
{
"context" : "rpItem",
"element" : "item",
"variable" : "rel",
"condition" : "(linkId = 'relationship')"
}
],
"target" : [
{
"context" : "rp",
"contextType" : "variable",
"element" : "relationship",
"variable" : "r"
},
{
"context" : "r",
"contextType" : "variable",
"element" : "coding",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "%rel.answer.value"
}
]
}
]
},
{
"name" : "SetPhone",
"source" : [
{
"context" : "rpItem",
"element" : "item",
"variable" : "phone",
"condition" : "(linkId = 'phone')"
}
],
"target" : [
{
"context" : "rp",
"contextType" : "variable",
"element" : "telecom",
"variable" : "t"
},
{
"context" : "t",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "phone"
}
]
},
{
"context" : "t",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "%phone.answer.value"
}
]
},
{
"context" : "t",
"contextType" : "variable",
"element" : "use",
"transform" : "copy",
"parameter" : [
{
"valueString" : "mobile"
}
]
}
]
}
]
},
{
"name" : "PopulateObservation",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "QuestionnaireResponse",
"mode" : "source"
},
{
"name" : "complicationItem",
"mode" : "source"
},
{
"name" : "tgt",
"type" : "Observation",
"mode" : "target"
},
{
"name" : "coding",
"type" : "Coding",
"mode" : "target"
},
{
"name" : "patientFullUrl",
"mode" : "target"
}
],
"rule" : [
{
"name" : "SetObservationCode",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "%coding"
}
]
}
]
},
{
"name" : "SetStatus",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
},
{
"name" : "SetSubjectRef",
"source" : [
{
"context" : "src",
"element" : "subject",
"variable" : "s"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "subject",
"variable" : "p"
},
{
"context" : "p",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "%patientFullUrl"
}
]
}
]
},
{
"name" : "SetAuthored",
"source" : [
{
"context" : "src",
"element" : "authored",
"variable" : "s"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "issued",
"transform" : "copy",
"parameter" : [
{
"valueId" : "s"
}
]
}
]
},
{
"name" : "SetEffective",
"source" : [
{
"context" : "src",
"element" : "authored",
"variable" : "s"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "effective",
"transform" : "copy",
"parameter" : [
{
"valueId" : "s"
}
]
}
]
},
{
"name" : "author",
"source" : [
{
"context" : "src",
"element" : "author",
"variable" : "s"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "performer",
"transform" : "copy",
"parameter" : [
{
"valueId" : "s"
}
]
}
]
},
{
"name" : "SetDerivedFrom",
"source" : [
{
"context" : "src",
"element" : "id"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "derivedFrom",
"variable" : "df"
},
{
"context" : "df",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'QuestionnaireResponse/' & %src.id"
}
]
}
]
}
]
}
]
}