MeaslesCaseReportMap
type: StructureMap
node role: treeRoot
id:
  v: MeaslesCaseReportMap
text:
  status:
    v: generated
  div:
    v: Generated Narrative: StructureMap MeaslesCaseReportMap #xD; map "http://example.org/StructureMap/MeaslesCaseReportMap" = "MeaslesCaseReportMap"#xD; #xD; // Measles Case Report QuestionnaireResponse to FHIR resources#xD; // Maps to: Patient, Encounter, Condition (Measles), Immunization (MR/Measles), Specimen#xD; #xD; uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QuestionnaireResponse as source#xD; uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as target#xD; uses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as target#xD; uses "http://hl7.org/fhir/StructureDefinition/Encounter" alias Encounter as target#xD; uses "http://hl7.org/fhir/StructureDefinition/Condition" alias Condition as target#xD; uses "http://hl7.org/fhir/StructureDefinition/Immunization" alias Immunization as target#xD; uses "http://hl7.org/fhir/StructureDefinition/Specimen" alias Specimen as target#xD; #xD; group MeaslesCaseReportMap(source src : QuestionnaireResponse, target bundle : Bundle) {#xD; src -> bundle.id = uuid() "bundleId";#xD; src -> bundle.type = 'transaction' "bundleType";#xD; src -> bundle.entry as e then {#xD; src -> e.resource = create('Patient') as patient then MapMeaslesPatient(src, patient) "execPatient";#xD; src -> e.request as req, req.method = 'PUT', req.url = ('Patient/' + %src.subject.reference) "patientReq";#xD; } "patientEntry";#xD; src -> bundle.entry as e then {#xD; src -> e.resource = create('Encounter') as encounter then MapMeaslesEncounter(src, encounter) "execEncounter";#xD; src -> e.request as req, req.method = 'POST', req.url = 'Encounter' "encounterReq";#xD; } "encounterEntry";#xD; src -> bundle.entry as e then {#xD; src -> e.resource = create('Condition') as condition then MapMeaslesCondition(src, condition) "execCondition";#xD; src -> e.request as req, req.method = 'POST', req.url = 'Condition' "conditionReq";#xD; } "conditionEntry";#xD; src -> bundle.entry as e then {#xD; src -> e.resource = create…
url:
  v: http://example.org/StructureMap/MeaslesCaseReportMap
  l: MeaslesCaseReportMap
version:
  v: 0.1.0
name:
  v: MeaslesCaseReportMap
status:
  v: draft
date:
  v: 2026-05-04T06:19:40+00:00
publisher:
  v: Kenya National Public Health Institute
contact:
  name:
    v: Kenya National Public Health Institute
  telecom:
    system:
      v: url
    value:
      v: https://www.nphi.go.ke/
contact:
  name:
    v: Kenya National Public Health Institute
  telecom:
    system:
      v: url
    value:
      v: https://www.nphi.go.ke/
    use:
      v: work
description:
  v: Measles Case Report QuestionnaireResponse to FHIR resources Maps to: Patient, Encounter, Condition (Measles), Immunization (MR/Measles), Specimen
jurisdiction:
  coding:
    system:
      v: urn:iso:std:iso:3166
      l: 3166
    code:
      v: KE
    display:
      v: Kenya
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse
    l: QuestionnaireResponse
  mode:
    v: source
  alias:
    v: QuestionnaireResponse
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/Bundle
    l: Bundle
  mode:
    v: target
  alias:
    v: Bundle
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/Patient
    l: Patient
  mode:
    v: target
  alias:
    v: Patient
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/Encounter
    l: Encounter
  mode:
    v: target
  alias:
    v: Encounter
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/Condition
    l: Condition
  mode:
    v: target
  alias:
    v: Condition
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/Immunization
    l: Immunization
  mode:
    v: target
  alias:
    v: Immunization
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/Specimen
    l: Specimen
  mode:
    v: target
  alias:
    v: Specimen
group:
  name:
    v: MeaslesCaseReportMap
  type mode:
    v: none
  input:
    name:
      v: src
    type:
      v: QuestionnaireResponse
    mode:
      v: source
  input:
    name:
      v: bundle
    type:
      v: Bundle
    mode:
      v: target
  rule:
    name:
      v: bundleId
    source:
      context:
        v: src
    target:
      context:
        v: bundle
      context type:
        v: variable
      element:
        v: id
      transform:
        v: uuid
  rule:
    name:
      v: bundleType
    source:
      context:
        v: src
    target:
      context:
        v: bundle
      context type:
        v: variable
      element:
        v: type
      transform:
        v: copy
      parameter:
        value: String
  rule:
    name:
      v: patientEntry
    source:
      context:
        v: src
    target:
      context:
        v: bundle
      context type:
        v: variable
      element:
        v: entry
      variable:
        v: e
    rule:
      name:
        v: execPatient
    rule:
      name:
        v: patientReq
  rule:
    name:
      v: encounterEntry
    source:
      context:
        v: src
    target:
      context:
        v: bundle
      context type:
        v: variable
      element:
        v: entry
      variable:
        v: e
    rule:
      name:
        v: execEncounter
    rule:
      name:
        v: encounterReq
  rule:
    name:
      v: conditionEntry

String
v: transaction

v: src

v: e

v: variable

v: resource

v: patient

v: create

value: String
  v: Patient

v: MapMeaslesPatient

v: src

v: patient

v: src

v: e

v: variable

v: request

v: req

v: req

v: variable

v: method

v: copy

value: String
  v: PUT

v: req

v: variable

v: url

v: evaluate

value: String
  v: 'Patient/' + %src.subject.reference

v: src

v: e

v: variable

v: resource

v: encounter

v: create

value: String
  v: Encounter

v: MapMeaslesEncounter

v: src

v: encounter

v: src

v: e

v: variable

v: request

v: req

v: req

v: variable

v: method

v: copy

value: String
  v: POST

v: req

v: variable

v: url

v: copy

value: String
  v: Encounter

context:
  v: src

context:
  v: bundle
context type:
  v: variable
element:
  v: entry
variable:
  v: e

name:
  v: execCondition
source:
  context:
    v: src
target:
  context:
    v: e
  context type:
    v: variable
  element:
    v: resource
  variable:
    v: condition
  transform:
    v: create
  parameter:
    value: String
      v: Condition
dependent:
  name:
    v: MapMeaslesCondition
  variable:
    v: src
  variable:
    v: condition

name:
  v: conditionReq
source:
  context:
    v: src
target:
  context:
    v: e
  context type:
    v: variable
  element:
    v: request
  variable:
    v: req
target:
  context:
    v: req
  context type:
    v: variable
  element:
    v: method
  transform:
    v: copy
  parameter:
    value: String
      v: POST
target:
  context:
    v: req
  context type:
    v: variable
  element:
    v: url
  transform:
    v: copy
  parameter:
    value: String
      v: Condition

name:
  v: immunizationEntry
source:
  context:
    v: src
target:
  context:
    v: bundle
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: e
rule:
  name:
    v: execImmunization
  source:
    context:
      v: src
  target:
    context:
      v: e
    context type:
      v: variable
    element:
      v: resource
    variable:
      v: immunization
    transform:
      v: create
    parameter:
      value: String
        v: Immunization
  dependent:
    name:
      v: MapMeaslesImmunization
    variable:
      v: src
    variable:
      v: immunization
rule:
  name:
    v: immunizationReq
  source:
    context:
      v: src
  target:
    context:
      v: e
    context type:
      v: variable
    element:
      v: request
    variable:
      v: req
  target:
    context:
      v: req
    context type:
      v: variable
    element:
      v: method
    transform:
      v: copy
    parameter:
      value: String
        v: POST
  target:
    context:
      v: req
    context type:
      v: variable
    element:
      v: url
    transform:
      v: copy
    parameter:
      value: String
        v: Immunization

name:
  v: specimenEntry
source:
  context:
    v: src
target:
  context:
    v: bundle
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: e
rule:
  name:
    v: execSpecimen
  source:
    context:
      v: src
  target:
    context:
      v: e
    context type:
      v: variable
    element:
      v: resource
    variable:
      v: specimen
    transform:
      v: create
    parameter:
      value: String
        v: Specimen
  dependent:
    name:
      v: MapMeaslesSpecimen
    variable:
      v: src
    variable:
      v: specimen
rule:
  name:
    v: specimenReq
  source:
    context:
      v: src
  target:
    context:
      v: e
    context type:
      v: variable
    element:
      v: request
    variable:
      v: req
  target:
    context:
      v: req
    context type:
      v: variable
    element:
      v: method
    transform:
      v: copy
    parameter:
      value: String
        v: POST
  target:
    context:
      v: req
    context type:
      v: variable
    element:
      v: url
    transform:
      v: copy
    parameter:
      value: String
        v: Specimen

name:
  v: MapMeaslesPatient
type mode:
  v: none
input:
  name:
    v: src
  type:
    v: QuestionnaireResponse
  mode:
    v: source
input:
  name:
    v: patient
  type:
    v: Patient
  mode:
    v: target
rule:
  name:
    v: patientId
  source:
    context:
      v: src
  target:
    context:
      v: patient
    context type:
      v: variable
    element:
      v: id
    transform:
      v: uuid
rule:
  name:
    v: demographics
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: demographics
    condition:
      v: linkId = '670954892057'
  rule:
    name:
      v: firstName
    source:
      context:
        v: demographics
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '873240407472'
    rule:
      name:
        v: givenName
  rule:
    name:
      v: middleName
    source:
      context:
        v: demographics
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '246751846436'
    rule:
      name:
        v: middleName
  rule:
    name:
      v: familyName
    source:
      context:
        v: demographics
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '486402457213'
    rule:
      name:
        v: familyName
  rule:
    name:
      v: gender
    source:
      context:
        v: demographics
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '929966324957'
    rule:
      name:
        v: gender
  rule:
    name:
      v: birthDate
    source:
      context:
        v: demographics
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '257830485990'
    rule:
      name:
        v: birthDate
  rule:
    name:
      v: residence
    source:
      context:
        v: demographics
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = 'residence'
    rule:
      name:
        v: residenceType
  rule:
    name:
      v: parent
    source:
      context:
        v: demographics
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = 'parent'
    rule:
      name:
        v: parentContact
  rule:
    name:
      v: phone
    source:
      context:
        v: demographics
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '754217593839'
    rule:
      name:
        v: phone
  rule:
    name:
      v: village
    source:
      context:
        v: demographics
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '242811643559'
    rule:
      name:
        v: village
  rule:
    name:
      v: landmark
    source:
      context:
        v: demographics
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '946232932304'
    rule:
      name:
        v: landmark
  rule:
    name:
      v: street
    source:
      context:
        v: demographics
      element:
        v: item

v: item

v: answer

v: first

v: ans

v: patient

v: variable

v: name

v: name

v: name

v: variable

v: given

v: copy

value: Id
  v: ans.valueString

v: item

v: answer

v: first

v: ans

v: patient

v: variable

v: name

v: name

v: name

v: variable

v: given

v: copy

value: Id
  v: ans.valueString

v: item

v: answer

v: first

v: ans

v: patient

v: variable

v: name

v: name

v: name

v: variable

v: family

v: copy

value: Id
  v: ans.valueString

v: item

v: answer

v: first

v: ans

v: patient

v: variable

v: gender

v: evaluate

value: String
  v: ans.valueCoding.code

v: item

v: answer

v: first

v: ans

v: patient

v: variable

v: birthDate

v: copy

value: Id
  v: ans.valueDate

v: item

v: answer

v: first

v: ans

v: patient

v: variable

v: address

v: addr

v: urbanAddr

context:
  v: ans
element:
  v: valueCoding
variable:
  v: val
condition:
  v: code = 'Urban'

context:
  v: addr
context type:
  v: variable
element:
  v: use
transform:
  v: copy
parameter:
  value: String
    v: home

context:
  v: addr
context type:
  v: variable
element:
  v: type
transform:
  v: copy
parameter:
  value: String
    v: physical

v: ruralAddr

context:
  v: ans
element:
  v: valueCoding
variable:
  v: val
condition:
  v: code = 'Rural'

context:
  v: addr
context type:
  v: variable
element:
  v: use
transform:
  v: copy
parameter:
  value: String
    v: home

context:
  v: addr
context type:
  v: variable
element:
  v: type
transform:
  v: copy
parameter:
  value: String
    v: physical

context:
  v: addr
context type:
  v: variable
element:
  v: district
transform:
  v: copy
parameter:
  value: String
    v: Rural

v: item

v: answer

v: first

v: ans

v: patient

v: variable

v: contact

v: contact

v: contactName

context:
  v: ans

context:
  v: contact
context type:
  v: variable
element:
  v: name
variable:
  v: cname

context:
  v: cname
context type:
  v: variable
element:
  v: text
transform:
  v: copy
parameter:
  value: Id
    v: ans.valueString

v: item

v: answer

v: first

v: ans

v: patient

v: variable

v: telecom

v: tel

v: tel

v: variable

v: system

v: copy

value: String
  v: phone

v: tel

v: variable

v: value

v: copy

value: Id
  v: ans.valueString

v: item

v: answer

v: first

v: ans

v: patient

v: variable

v: address

v: addr

v: addr

v: variable

v: line

v: copy

value: Id
  v: ans.valueString

v: item

v: answer

v: first

v: ans

v: patient

v: variable

v: address

v: addr

v: addr

v: variable

v: district

v: copy

value: Id
  v: ans.valueString

v: item

v: linkId = '424111786438'

name:
  v: street
source:
  context:
    v: item
  element:
    v: answer
  list mode:
    v: first
  variable:
    v: ans
target:
  context:
    v: patient
  context type:
    v: variable
  element:
    v: address
  variable:
    v: addr
target:
  context:
    v: addr
  context type:
    v: variable
  element:
    v: line
  transform:
    v: copy
  parameter:
    value: Id
      v: ans.valueString

name:
  v: MapMeaslesEncounter
type mode:
  v: none
input:
  name:
    v: src
  type:
    v: QuestionnaireResponse
  mode:
    v: source
input:
  name:
    v: encounter
  type:
    v: Encounter
  mode:
    v: target
rule:
  name:
    v: encounterId
  source:
    context:
      v: src
  target:
    context:
      v: encounter
    context type:
      v: variable
    element:
      v: id
    transform:
      v: uuid
rule:
  name:
    v: status
  source:
    context:
      v: src
  target:
    context:
      v: encounter
    context type:
      v: variable
    element:
      v: status
    transform:
      v: copy
    parameter:
      value: String
        v: finished
rule:
  name:
    v: class
  source:
    context:
      v: src
  target:
    context:
      v: encounter
    context type:
      v: variable
    element:
      v: class
    variable:
      v: cls
  rule:
    name:
      v: clsSys
    source:
      context:
        v: src
    target:
      context:
        v: cls
      context type:
        v: variable
      element:
        v: system
      transform:
        v: copy
      parameter:
        value: String
  rule:
    name:
      v: clsCode
    source:
      context:
        v: src
    target:
      context:
        v: cls
      context type:
        v: variable
      element:
        v: code
      transform:
        v: copy
      parameter:
        value: String
rule:
  name:
    v: subject
  source:
    context:
      v: src
    element:
      v: subject
    variable:
      v: subj
  target:
    context:
      v: encounter
    context type:
      v: variable
    element:
      v: subject
    variable:
      v: ref
  target:
    context:
      v: ref
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: evaluate
    parameter:
      value: String
        v: 'Patient/' + subj.reference
rule:
  name:
    v: reportSite
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: reportSite
    condition:
      v: linkId = '151479012557'
  rule:
    name:
      v: epidNo
    source:
      context:
        v: reportSite
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '992818778559'
    rule:
      name:
        v: epidId
rule:
  name:
    v: caseInfo
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: caseInfo
    condition:
      v: linkId = '216343227137'
  rule:
    name:
      v: firstSeen
    source:
      context:
        v: caseInfo
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '554231819382'
    rule:
      name:
        v: periodStart
  rule:
    name:
      v: ipopNo
    source:
      context:
        v: caseInfo
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '755731625544'
    rule:
      name:
        v: ipopId
  rule:
    name:
      v: hospitalized

String
v: AMB

v: item

v: answer

v: first

v: ans

v: encounter

v: variable

v: identifier

v: id

v: epidSys

context:
  v: ans

context:
  v: id
context type:
  v: variable
element:
  v: system
transform:
  v: copy
parameter:
  value: String
    v: http://example.org/identifier/epid

v: epidValue

context:
  v: ans

context:
  v: id
context type:
  v: variable
element:
  v: value
transform:
  v: copy
parameter:
  value: Id
    v: ans.valueString

v: item

v: answer

v: first

v: ans

v: encounter

v: variable

v: period

v: period

v: period

v: variable

v: start

v: copy

value: Id
  v: ans.valueDate

v: item

v: answer

v: first

v: ans

v: encounter

v: variable

v: identifier

v: id

v: ipopSys

context:
  v: ans

context:
  v: id
context type:
  v: variable
element:
  v: system
transform:
  v: copy
parameter:
  value: String
    v: http://example.org/identifier/ip-op

v: ipopValue

context:
  v: ans

context:
  v: id
context type:
  v: variable
element:
  v: value
transform:
  v: copy
parameter:
  value: Id
    v: ans.valueString

context:
  v: caseInfo
element:
  v: item
variable:
  v: item
condition:
  v: linkId = '483042281962'

name:
  v: hospitalization
source:
  context:
    v: item
  element:
    v: answer
  list mode:
    v: first
  variable:
    v: ans
  condition:
    v: valueCoding.code = 'yes'
target:
  context:
    v: encounter
  context type:
    v: variable
  element:
    v: hospitalization
  variable:
    v: hosp
rule:
  name:
    v: admitSource
  source:
    context:
      v: ans
  target:
    context:
      v: hosp
    context type:
      v: variable
    element:
      v: admitSource
    variable:
      v: src
  target:
    context:
      v: src
    context type:
      v: variable
    element:
      v: coding
    variable:
      v: cod
  target:
    context:
      v: cod
    context type:
      v: variable
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: String
        v: http://terminology.hl7.org/CodeSystem/admit-source
  target:
    context:
      v: cod
    context type:
      v: variable
    element:
      v: code
    transform:
      v: copy
    parameter:
      value: String
        v: hosp-trans

name:
  v: admitDate
source:
  context:
    v: caseInfo
  element:
    v: item
  variable:
    v: item
  condition:
    v: linkId = '340908984116'
rule:
  name:
    v: admitDate
  source:
    context:
      v: item
    element:
      v: answer
    list mode:
      v: first
    variable:
      v: ans
  target:
    context:
      v: encounter
    context type:
      v: variable
    element:
      v: period
    variable:
      v: period
  target:
    context:
      v: period
    context type:
      v: variable
    element:
      v: start
    transform:
      v: copy
    parameter:
      value: Id
        v: ans.valueDate

name:
  v: outcome
source:
  context:
    v: caseInfo
  element:
    v: item
  variable:
    v: item
  condition:
    v: linkId = '508745697175'
rule:
  name:
    v: outcomeDisp
  source:
    context:
      v: item
    element:
      v: answer
    list mode:
      v: first
    variable:
      v: ans
  target:
    context:
      v: encounter
    context type:
      v: variable
    element:
      v: hospitalization
    variable:
      v: hosp
  rule:
    name:
      v: alive
    source:
      context:
        v: ans
      element:
        v: valueCoding
      variable:
        v: val
      condition:
        v: code = 'Alive'
    target:
      context:
        v: hosp
      context type:
        v: variable
      element:
        v: dischargeDisposition
      variable:
        v: disp
    target:
      context:
        v: disp
      context type:
        v: variable
      element:
        v: coding
      variable:
        v: cod
    target:
      context:
        v: cod
      context type:
        v: variable
      element:
        v: system
      transform:
        v: copy
      parameter:
        value: String
    target:
      context:
        v: cod
      context type:
        v: variable
      element:
        v: code
      transform:
        v: copy
      parameter:
        value: String
  rule:
    name:
      v: dead
    source:
      context:
        v: ans
      element:
        v: valueCoding
      variable:
        v: val
      condition:
        v: code = 'Dead'
    target:
      context:
        v: hosp
      context type:
        v: variable
      element:
        v: dischargeDisposition
      variable:
        v: disp
    target:
      context:
        v: disp
      context type:
        v: variable
      element:
        v: coding
      variable:
        v: cod
    target:
      context:
        v: cod
      context type:
        v: variable
      element:
        v: system
      transform:
        v: copy
      parameter:
        value: String
    target:
      context:
        v: cod
      context type:
        v: variable
      element:
        v: code
      transform:
        v: copy
      parameter:
        value: String

String
v: home

String
v: exp

name:
  v: clinicalHistory
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: clinicalHistory
  condition:
    v: linkId = '477144604557'
rule:
  name:
    v: caseOrLineList
  source:
    context:
      v: clinicalHistory
    element:
      v: item
    variable:
      v: item
    condition:
      v: linkId = '865158268604'
  rule:
    name:
      v: encounterType
    source:
      context:
        v: item
      element:
        v: answer
      list mode:
        v: first
      variable:
        v: ans
    target:
      context:
        v: encounter
      context type:
        v: variable
      element:
        v: type
      variable:
        v: type
    rule:
      name:
        v: caseType

v: ans

v: type

v: variable

v: coding

v: cod

v: cod

v: variable

v: system

v: copy

v: cod

v: variable

v: code

v: evaluate

value: String
  v: ans.valueCoding.code

v: cod

v: variable

v: display

v: evaluate

value: String
  v: ans.valueCoding.display

name:
  v: MapMeaslesCondition
type mode:
  v: none
input:
  name:
    v: src
  type:
    v: QuestionnaireResponse
  mode:
    v: source
input:
  name:
    v: condition
  type:
    v: Condition
  mode:
    v: target
rule:
  name:
    v: conditionId
  source:
    context:
      v: src
  target:
    context:
      v: condition
    context type:
      v: variable
    element:
      v: id
    transform:
      v: uuid
rule:
  name:
    v: codeBlock
  source:
    context:
      v: src
  target:
    context:
      v: condition
    context type:
      v: variable
    element:
      v: code
    variable:
      v: code
  rule:
    name:
      v: measlesCoding
    source:
      context:
        v: src
    target:
      context:
        v: code
      context type:
        v: variable
      element:
        v: coding
      variable:
        v: coding
    rule:
      name:
        v: snomedSys
    rule:
      name:
        v: measlesCode
    rule:
      name:
        v: measlesDisplay
  rule:
    name:
      v: measlesText
    source:
      context:
        v: src
    target:
      context:
        v: code
      context type:
        v: variable
      element:
        v: text
      transform:
        v: copy
      parameter:
        value: String
rule:
  name:
    v: subject
  source:
    context:
      v: src
    element:
      v: subject
    variable:
      v: subj
  target:
    context:
      v: condition
    context type:
      v: variable
    element:
      v: subject
    variable:
      v: ref
  target:
    context:
      v: ref
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: evaluate
    parameter:
      value: String
        v: 'Patient/' + subj.reference
rule:
  name:
    v: clinicalHistory
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: clinicalHistory
    condition:
      v: linkId = '477144604557'
  rule:
    name:
      v: onsetDate
    source:
      context:
        v: clinicalHistory
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '728034137219'
    rule:
      name:
        v: onsetDate
  rule:
    name:
      v: symptoms
    source:
      context:
        v: clinicalHistory
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '745196148424'
    rule:
      name:
        v: symptomNote
  rule:
    name:
      v: rashDate
    source:
      context:
        v: clinicalHistory
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '576528567552'
    rule:
      name:
        v: rashOnset
  rule:
    name:
      v: rashType
    source:
      context:
        v: clinicalHistory
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '704922081985'
    rule:
      name:
        v: rashTypeNote
  rule:
    name:
      v: homeVisited
    source:
      context:
        v: clinicalHistory
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '207408507040'

v: src

v: coding

v: variable

v: system

v: copy

v: src

v: coding

v: variable

v: code

v: copy

value: String
  v: 14189004

v: src

v: coding

v: variable

v: display

v: copy

value: String
  v: Measles

String
v: Measles

v: item

v: answer

v: first

v: ans

v: condition

v: variable

v: onset

v: copy

value: Id
  v: ans.valueDate

v: item

v: answer

v: ans

v: condition

v: variable

v: note

v: note

v: note

v: variable

v: text

v: evaluate

value: String
  v: ans.valueCoding.display

v: item

v: answer

v: first

v: ans

v: condition

v: variable

v: extension

v: ext

v: extUrl

context:
  v: ans

context:
  v: ext
context type:
  v: variable
element:
  v: url
transform:
  v: copy
parameter:
  value: String
    v: http://example.org/StructureDefinition/rashOnsetDate

v: extValue

context:
  v: ans

context:
  v: ext
context type:
  v: variable
element:
  v: valueDate
transform:
  v: copy
parameter:
  value: Id
    v: ans.valueDate

v: item

v: answer

v: first

v: ans

v: condition

v: variable

v: note

v: note

v: note

v: variable

v: text

v: evaluate

value: String
  v: 'Rash type: ' + ans.valueCoding.display

name:
  v: contactInvestNote
source:
  context:
    v: item
  element:
    v: answer
  list mode:
    v: first
  variable:
    v: ans
target:
  context:
    v: condition
  context type:
    v: variable
  element:
    v: note
  variable:
    v: note
target:
  context:
    v: note
  context type:
    v: variable
  element:
    v: text
  transform:
    v: evaluate
  parameter:
    value: String
      v: iif(ans.valueCoding.code = 'yes', 'Home visited for contact investigation: Yes', 'Home visited for contact investigation: No')

name:
  v: homeVisitDate
source:
  context:
    v: clinicalHistory
  element:
    v: item
  variable:
    v: item
  condition:
    v: linkId = '566661890668'
rule:
  name:
    v: homeVisitExt
  source:
    context:
      v: item
    element:
      v: answer
    list mode:
      v: first
    variable:
      v: ans
  target:
    context:
      v: condition
    context type:
      v: variable
    element:
      v: extension
    variable:
      v: ext
  rule:
    name:
      v: extUrl
    source:
      context:
        v: ans
    target:
      context:
        v: ext
      context type:
        v: variable
      element:
        v: url
      transform:
        v: copy
      parameter:
        value: String
  rule:
    name:
      v: extValue
    source:
      context:
        v: ans
    target:
      context:
        v: ext
      context type:
        v: variable
      element:
        v: valueDate
      transform:
        v: copy
      parameter:
        value: Id

Id
v: ans.valueDate

name:
  v: caseInfoStatus
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: caseInfo
  condition:
    v: linkId = '216343227137'
rule:
  name:
    v: outcome
  source:
    context:
      v: caseInfo
    element:
      v: item
    variable:
      v: item
    condition:
      v: linkId = '508745697175'
  rule:
    name:
      v: clinicalStatus
    source:
      context:
        v: item
      element:
        v: answer
      list mode:
        v: first
      variable:
        v: ans
    target:
      context:
        v: condition
      context type:
        v: variable
      element:
        v: clinicalStatus
      variable:
        v: status
    rule:
      name:
        v: deadStatus
    rule:
      name:
        v: aliveStatus

v: ans

v: valueCoding

v: val

v: code = 'Dead'

v: status

v: variable

v: coding

v: cod

v: cod

v: variable

v: system

v: copy

v: cod

v: variable

v: code

v: copy

value: String
  v: inactive

v: ans

v: valueCoding

v: val

v: code = 'Alive'

v: status

v: variable

v: coding

v: cod

v: cod

v: variable

v: system

v: copy

v: cod

v: variable

v: code

v: copy

value: String
  v: active

name:
  v: MapMeaslesImmunization
type mode:
  v: none
input:
  name:
    v: src
  type:
    v: QuestionnaireResponse
  mode:
    v: source
input:
  name:
    v: immunization
  type:
    v: Immunization
  mode:
    v: target
rule:
  name:
    v: immunizationId
  source:
    context:
      v: src
  target:
    context:
      v: immunization
    context type:
      v: variable
    element:
      v: id
    transform:
      v: uuid
rule:
  name:
    v: status
  source:
    context:
      v: src
  target:
    context:
      v: immunization
    context type:
      v: variable
    element:
      v: status
    transform:
      v: copy
    parameter:
      value: String
        v: completed
rule:
  name:
    v: vaccineCode
  source:
    context:
      v: src
  target:
    context:
      v: immunization
    context type:
      v: variable
    element:
      v: vaccineCode
    variable:
      v: code
  rule:
    name:
      v: mrCoding
    source:
      context:
        v: src
    target:
      context:
        v: code
      context type:
        v: variable
      element:
        v: coding
      variable:
        v: coding
    rule:
      name:
        v: cvxSys
    rule:
      name:
        v: measlesCode
    rule:
      name:
        v: mrDisplay
rule:
  name:
    v: patient
  source:
    context:
      v: src
    element:
      v: subject
    variable:
      v: subj
  target:
    context:
      v: immunization
    context type:
      v: variable
    element:
      v: patient
    variable:
      v: ref
  target:
    context:
      v: ref
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: evaluate
    parameter:
      value: String
        v: 'Patient/' + subj.reference
rule:
  name:
    v: vaccination
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: vaccination
    condition:
      v: linkId = '736291402384'
  rule:
    name:
      v: vaccinationStatus
    source:
      context:
        v: vaccination
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '517772812375'
    rule:
      name:
        v: notVaccinated
    rule:
      name:
        v: unknownStatus
  rule:
    name:
      v: doses
    source:
      context:
        v: vaccination
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '886125589225'
    rule:
      name:
        v: protocol
  rule:
    name:
      v: last30Days
    source:
      context:
        v: vaccination
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '308128177300'
    rule:
      name:
        v: last30DaysExt
  rule:
    name:
      v: lastVaccDate
    source:
      context:
        v: vaccination
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '544290619304'
    rule:
      name:
        v: lastVaccDate

v: src

v: coding

v: variable

v: system

v: copy

v: src

v: coding

v: variable

v: code

v: copy

value: String
  v: 05

v: src

v: coding

v: variable

v: display

v: copy

value: String
  v: Measles-Rubella (MR) Vaccine

v: item

v: answer

v: first

v: ans

v: valueCoding.code = 'no'

v: immunization

v: variable

v: status

v: copy

value: String
  v: not-done

v: item

v: answer

v: first

v: ans

v: valueCoding.code = 'unknown'

v: immunization

v: variable

v: statusReason

v: reason

v: reason

v: variable

v: text

v: copy

value: String
  v: Unknown vaccination status

v: item

v: answer

v: first

v: ans

v: immunization

v: variable

v: protocolApplied

v: protocol

v: doseNumber

context:
  v: ans

context:
  v: protocol
context type:
  v: variable
element:
  v: doseNumber
transform:
  v: copy
parameter:
  value: Id
    v: ans.valueInteger

v: item

v: answer

v: first

v: ans

v: immunization

v: variable

v: extension

v: ext

v: extUrl

context:
  v: ans

context:
  v: ext
context type:
  v: variable
element:
  v: url
transform:
  v: copy
parameter:
  value: String
    v: http://example.org/StructureDefinition/vaccineLast30Days

v: extValue

context:
  v: ans

context:
  v: ext
context type:
  v: variable
element:
  v: valueCoding
transform:
  v: copy
parameter:
  value: Id
    v: ans.valueCoding

v: item

v: answer

v: first

v: ans

v: immunization

v: variable

v: occurrenceDateTime

v: copy

value: Id
  v: ans.valueDate

name:
  v: MapMeaslesSpecimen
type mode:
  v: none
input:
  name:
    v: src
  type:
    v: QuestionnaireResponse
  mode:
    v: source
input:
  name:
    v: specimen
  type:
    v: Specimen
  mode:
    v: target
rule:
  name:
    v: specimenId
  source:
    context:
      v: src
  target:
    context:
      v: specimen
    context type:
      v: variable
    element:
      v: id
    transform:
      v: uuid
rule:
  name:
    v: specimenType
  source:
    context:
      v: src
  target:
    context:
      v: specimen
    context type:
      v: variable
    element:
      v: type
    variable:
      v: type
  rule:
    name:
      v: serumCoding
    source:
      context:
        v: src
    target:
      context:
        v: type
      context type:
        v: variable
      element:
        v: coding
      variable:
        v: coding
    rule:
      name:
        v: snomedSys
    rule:
      name:
        v: serumCode
    rule:
      name:
        v: serumDisplay
rule:
  name:
    v: subject
  source:
    context:
      v: src
    element:
      v: subject
    variable:
      v: subj
  target:
    context:
      v: specimen
    context type:
      v: variable
    element:
      v: subject
    variable:
      v: ref
  target:
    context:
      v: ref
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: evaluate
    parameter:
      value: String
        v: 'Patient/' + subj.reference
rule:
  name:
    v: specimenCollection
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: specimenCollection
    condition:
      v: linkId = '271053545237'
  rule:
    name:
      v: specimenTypes
    source:
      context:
        v: specimenCollection
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '412689284625'
    rule:
      name:
        v: specimenNote
  rule:
    name:
      v: collectionDate
    source:
      context:
        v: specimenCollection
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '8962468583341'
    rule:
      name:
        v: collectionDate
  rule:
    name:
      v: sentToLabDate
    source:
      context:
        v: specimenCollection
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '718251724172'
    rule:
      name:
        v: sentToLab
  rule:
    name:
      v: otherSpecimen
    source:
      context:
        v: specimenCollection
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '340507649387'
    rule:
      name:
        v: otherSpecimenNote

v: src

v: coding

v: variable

v: system

v: copy

v: src

v: coding

v: variable

v: code

v: copy

value: String
  v: 119364003

v: src

v: coding

v: variable

v: display

v: copy

value: String
  v: Serum specimen

v: item

v: answer

v: ans

v: specimen

v: variable

v: note

v: note

v: note

v: variable

v: text

v: evaluate

value: String
  v: 'Specimen collected: ' + ans.valueCoding.display

v: item

v: answer

v: first

v: ans

v: specimen

v: variable

v: collection

v: coll

v: coll

v: variable

v: collectedDateTime

v: copy

value: Id
  v: ans.valueDate

v: item

v: answer

v: first

v: ans

v: specimen

v: variable

v: processing

v: proc

v: procDesc

context:
  v: ans

context:
  v: proc
context type:
  v: variable
element:
  v: description
transform:
  v: copy
parameter:
  value: String
    v: Specimen sent to lab

v: procTime

context:
  v: ans

context:
  v: proc
context type:
  v: variable
element:
  v: timeDateTime
transform:
  v: copy
parameter:
  value: Id
    v: ans.valueDate

v: item

v: answer

v: first

v: ans

v: specimen

v: variable

v: note

v: note

v: note

v: variable

v: text

v: evaluate

value: String
  v: 'Other specimen type: ' + ans.valueString