AfpCaseReportMap
type: StructureMap
node role: treeRoot
id:
  v: AfpCaseReportMap
text:
  status:
    v: generated
  div:
    v: Generated Narrative: StructureMap AfpCaseReportMap #xD; map "http://example.org/StructureMap/AfpCaseReportMap" = "AfpCaseReportMap"#xD; #xD; // AFP Case Report QuestionnaireResponse to FHIR resources#xD; // Maps to: Patient, Encounter, Condition (AFP), Immunization (OPV), Specimen (stool)#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 AfpCaseReportMap(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 MapAfpPatient(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 MapAfpEncounter(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 MapAfpCondition(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('Immunization') as immunization th…
url:
  v: http://example.org/StructureMap/AfpCaseReportMap
  l: AfpCaseReportMap
version:
  v: 0.1.0
name:
  v: AfpCaseReportMap
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: AFP Case Report QuestionnaireResponse to FHIR resources Maps to: Patient, Encounter, Condition (AFP), Immunization (OPV), Specimen (stool)
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: AfpCaseReportMap
  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: MapAfpPatient

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: MapAfpEncounter

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: MapAfpCondition
  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: MapAfpImmunization
    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: MapAfpSpecimen
    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: MapAfpPatient
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 = '359809652429'
  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: parentName
    source:
      context:
        v: demographics
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '856448027666'
    rule:
      name:
        v: parentContact
  rule:
    name:
      v: phone
    source:
      context:
        v: demographics
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '576318206363'
    rule:
      name:
        v: phone
  rule:
    name:
      v: address
    source:
      context:
        v: demographics
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = 'residence-details'
    rule:
      name:
        v: address
  rule:
    name:
      v: landmark
    source:
      context:
        v: demographics
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '946232932304'
    rule:
      name:
        v: landmark

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: 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: text

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

name:
  v: MapAfpEncounter
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 = '451840456960'
  rule:
    name:
      v: investigationDate
    source:
      context:
        v: caseInfo
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '502488184403'
    rule:
      name:
        v: periodStart
  rule:
    name:
      v: notificationDate
    source:
      context:
        v: caseInfo
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '426321975477'
    rule:
      name:
        v: notificationExt
  rule:
    name:
      v: notifiedBy

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: 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/notificationDate

v: extValue

context:
  v: ans

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

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

name:
  v: notifiedByExt
source:
  context:
    v: item
  element:
    v: answer
  list mode:
    v: first
  variable:
    v: ans
target:
  context:
    v: encounter
  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
        v: http://example.org/StructureDefinition/notifiedBy
rule:
  name:
    v: extValue
  source:
    context:
      v: ans
  target:
    context:
      v: ext
    context type:
      v: variable
    element:
      v: valueString
    transform:
      v: evaluate
    parameter:
      value: String
        v: ans.valueCoding.display

name:
  v: admissionDate
source:
  context:
    v: caseInfo
  element:
    v: item
  variable:
    v: item
  condition:
    v: linkId = '507199621281'
rule:
  name:
    v: hospitalization
  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: 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
    rule:
      name:
        v: admitSys
    rule:
      name:
        v: admitCode
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

v: ans

v: cod

v: variable

v: system

v: copy

v: ans

v: cod

v: variable

v: code

v: copy

value: String
  v: hosp-trans

name:
  v: ipopNo
source:
  context:
    v: caseInfo
  element:
    v: item
  variable:
    v: item
  condition:
    v: linkId = '525996604810'
rule:
  name:
    v: ipopId
  source:
    context:
      v: item
    element:
      v: answer
    list mode:
      v: first
    variable:
      v: ans
  target:
    context:
      v: encounter
    context type:
      v: variable
    element:
      v: identifier
    variable:
      v: id
  rule:
    name:
      v: ipopSys
    source:
      context:
        v: ans
    target:
      context:
        v: id
      context type:
        v: variable
      element:
        v: system
      transform:
        v: copy
      parameter:
        value: String
  rule:
    name:
      v: ipopValue
    source:
      context:
        v: ans
    target:
      context:
        v: id
      context type:
        v: variable
      element:
        v: value
      transform:
        v: copy
      parameter:
        value: Id

Id
v: ans.valueString

name:
  v: MapAfpCondition
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: afpCodeBlock
  source:
    context:
      v: src
  target:
    context:
      v: condition
    context type:
      v: variable
    element:
      v: code
    variable:
      v: code
  rule:
    name:
      v: afpCoding
    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: afpCode
    rule:
      name:
        v: afpDisplay
  rule:
    name:
      v: afpText
    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: clinicalInfo
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: clinicalInfo
    condition:
      v: linkId = '735342695013'
  rule:
    name:
      v: onsetDate
    source:
      context:
        v: clinicalInfo
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '728034137219'
    rule:
      name:
        v: onsetDate
  rule:
    name:
      v: outcome
    source:
      context:
        v: clinicalInfo
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '212304573462'
    rule:
      name:
        v: clinicalStatus
  rule:
    name:
      v: fever
    source:
      context:
        v: clinicalInfo
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '932108244312'
    rule:
      name:
        v: feverNote
  rule:
    name:
      v: paralysisBodySites
    source:
      context:
        v: clinicalInfo
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '828001350323'
    rule:
      name:
        v: paralysisBodySite
  rule:
    name:
      v: trueAfp
    source:
      context:
        v: clinicalInfo
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '564450145870'

v: src

v: coding

v: variable

v: system

v: copy

v: src

v: coding

v: variable

v: code

v: copy

value: String
  v: 398102009

v: src

v: coding

v: variable

v: display

v: copy

value: String
  v: Acute flaccid paralysis

String
v: Acute Flaccid Paralysis (AFP)

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: first

v: ans

v: condition

v: variable

v: clinicalStatus

v: status

v: deadStatus

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

context:
  v: status
context type:
  v: variable
element:
  v: coding
variable:
  v: cod

context:
  v: cod
context type:
  v: variable
element:
  v: system
transform:
  v: copy
parameter:
  value: String
    v: http://terminology.hl7.org/CodeSystem/condition-clinical

context:
  v: cod
context type:
  v: variable
element:
  v: code
transform:
  v: copy
parameter:
  value: String
    v: inactive

v: aliveStatus

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

context:
  v: status
context type:
  v: variable
element:
  v: coding
variable:
  v: cod

context:
  v: cod
context type:
  v: variable
element:
  v: system
transform:
  v: copy
parameter:
  value: String
    v: http://terminology.hl7.org/CodeSystem/condition-clinical

context:
  v: cod
context type:
  v: variable
element:
  v: code
transform:
  v: copy
parameter:
  value: String
    v: active

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: iif(ans.valueCoding.code = 'yes', 'Fever at onset: Yes', 'Fever at onset: No')

v: item

v: answer

v: ans

v: condition

v: variable

v: bodySite

v: bodySite

v: bodySiteCoding

context:
  v: ans

context:
  v: bodySite
context type:
  v: variable
element:
  v: coding
variable:
  v: cod

context:
  v: cod
context type:
  v: variable
element:
  v: system
transform:
  v: copy
parameter:
  value: String
    v: http://snomed.info/sct

context:
  v: cod
context type:
  v: variable
element:
  v: display
transform:
  v: evaluate
parameter:
  value: String
    v: ans.valueCoding.display

name:
  v: verificationStatus
source:
  context:
    v: item
  element:
    v: answer
  list mode:
    v: first
  variable:
    v: ans
target:
  context:
    v: condition
  context type:
    v: variable
  element:
    v: verificationStatus
  variable:
    v: vs
rule:
  name:
    v: confirmed
  source:
    context:
      v: ans
    element:
      v: valueCoding
    variable:
      v: val
    condition:
      v: code = 'yes'
  target:
    context:
      v: vs
    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/condition-ver-status
  target:
    context:
      v: cod
    context type:
      v: variable
    element:
      v: code
    transform:
      v: copy
    parameter:
      value: String
        v: confirmed
rule:
  name:
    v: refuted
  source:
    context:
      v: ans
    element:
      v: valueCoding
    variable:
      v: val
    condition:
      v: code = 'no'
  target:
    context:
      v: vs
    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/condition-ver-status
  target:
    context:
      v: cod
    context type:
      v: variable
    element:
      v: code
    transform:
      v: copy
    parameter:
      value: String
        v: refuted

name:
  v: MapAfpImmunization
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: opvCoding
    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: opvCode
    rule:
      name:
        v: opvDisplay
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 = '446305443608'
  rule:
    name:
      v: vaccinationStatus
    source:
      context:
        v: vaccination
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '970455623029'
    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: opvBirth
    source:
      context:
        v: vaccination
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '413372430071'
    rule:
      name:
        v: opvBirthDate
  rule:
    name:
      v: siaDate
    source:
      context:
        v: vaccination
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '910678978959'
    rule:
      name:
        v: lastSIADate
  rule:
    name:
      v: infoSource
    source:
      context:
        v: vaccination
      element:
        v: item

v: src

v: coding

v: variable

v: system

v: copy

v: src

v: coding

v: variable

v: code

v: copy

value: String
  v: 02

v: src

v: coding

v: variable

v: display

v: copy

value: String
  v: Oral Poliovirus Vaccine (OPV)

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: occurrenceDateTime

v: copy

value: Id
  v: ans.valueDate

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/lastSIADate

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: linkId = '650080600932'

name:
  v: reportOrigin
source:
  context:
    v: item
  element:
    v: answer
  list mode:
    v: first
  variable:
    v: ans
target:
  context:
    v: immunization
  context type:
    v: variable
  element:
    v: reportOrigin
  variable:
    v: origin
rule:
  name:
    v: origin
  source:
    context:
      v: ans
  target:
    context:
      v: origin
    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://example.org/CodeSystem/vaccination-info-source
  target:
    context:
      v: cod
    context type:
      v: variable
    element:
      v: code
    transform:
      v: evaluate
    parameter:
      value: String
        v: ans.valueCoding.code
  target:
    context:
      v: cod
    context type:
      v: variable
    element:
      v: display
    transform:
      v: evaluate
    parameter:
      value: String
        v: ans.valueCoding.display

name:
  v: MapAfpSpecimen
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: stoolCoding
    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: stoolCode
    rule:
      name:
        v: stoolDisplay
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: stoolCollection
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: stoolCollection
    condition:
      v: linkId = '350784256533'
  rule:
    name:
      v: firstSpecimenDate
    source:
      context:
        v: stoolCollection
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '737703942433'
    rule:
      name:
        v: firstSpecimen
  rule:
    name:
      v: secondSpecimenDate
    source:
      context:
        v: stoolCollection
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '711388438654'
    rule:
      name:
        v: secondSpecimen
  rule:
    name:
      v: sentToNationalDate
    source:
      context:
        v: stoolCollection
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '808177332790'
    rule:
      name:
        v: sentToNational

v: src

v: coding

v: variable

v: system

v: copy

v: src

v: coding

v: variable

v: code

v: copy

value: String
  v: 119339001

v: src

v: coding

v: variable

v: display

v: copy

value: String
  v: Stool specimen

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: 2nd specimen collected

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: 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 national level

v: procTime

context:
  v: ans

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