Moh505SectionABMap
type: StructureMap
node role: treeRoot
id:
  v: Moh505SectionABMap
text:
  status:
    v: generated
  div:
    v: Generated Narrative: StructureMap Moh505SectionABMap #xD; map "http://example.org/StructureMap/Moh505SectionABMap" = "Moh505SectionABMap"#xD; #xD; // MOH 505 Section A and B QuestionnaireResponse to FHIR resources#xD; // Maps disease tally counts to Observation resources (one per disease per reporting period)#xD; // Observation.component encodes: under-5 cases, under-5 deaths, over-5 cases, over-5 deaths#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/Observation" alias Observation as target#xD; uses "http://hl7.org/fhir/StructureDefinition/BackboneElement" alias BackboneElement as source#xD; #xD; group Moh505SectionABMap(source src : QuestionnaireResponse, target bundle : Bundle) {#xD; src -> bundle.id = uuid() "bundleId";#xD; src -> bundle.type = 'transaction' "bundleType";#xD; src.item as page where linkId = '306799299' then {#xD; // ── AEFI ──────────────────────────────────────────────────────────────────#xD; page.item as cb where linkId = '745196148424' then {#xD; page.item as u5c where linkId = 'under5-cases' then {#xD; page.item as u5d where linkId = 'under5-deaths' then {#xD; page.item as o5c where linkId = 'over5-cases' then {#xD; page.item as o5d where linkId = 'over5-deaths' then {#xD; cb where answer.exists() -> bundle.entry as e, e.resource = create('Observation') as obs then CreateSectionABObs(cb, u5c, u5d, o5c, o5d, obs) "aefiObs";#xD; } "o5d";#xD; } "o5c";#xD; } "u5d";#xD; } "u5c";#xD; } "aefi";#xD; // ── Acute Jaundice ────────────────────────────────────────────────────────#xD; page.item as cb where linkId = 'acute-jaundice' then {#xD; page.item as u5c where linkId = 'acute-jaundice-under5-cases' then {#xD; page.item as u5d where linkId = 'acute-jaundice-under5-deaths' then {#xD; page.item as o5c where linkId = 'acute-jaundice-over5-cases' then {#xD; p…
url:
  v: http://example.org/StructureMap/Moh505SectionABMap
  l: Moh505SectionABMap
version:
  v: 0.1.0
name:
  v: Moh505SectionABMap
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: MOH 505 Section A and B QuestionnaireResponse to FHIR resources Maps disease tally counts to Observation resources (one per disease per reporting period) Observation.component encodes: under-5 cases, under-5 deaths, over-5 cases, over-5 deaths
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/Observation
    l: Observation
  mode:
    v: target
  alias:
    v: Observation
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/BackboneElement
    l: BackboneElement
  mode:
    v: source
  alias:
    v: BackboneElement
group:
  name:
    v: Moh505SectionABMap
  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: diseasesPage
    source:
      context:
        v: src
      element:
        v: item
      variable:
        v: page
      condition:
        v: linkId = '306799299'
    rule:
      name:
        v: aefi
    rule:
      name:
        v: acuteJaundice
    rule:
      name:
        v: acuteMalnutrition
    rule:
      name:
        v: afp
    rule:
      name:
        v: anthrax
    rule:
      name:
        v: cholera
    rule:
      name:
        v: chikungunya
    rule:
      name:
        v: covid19
    rule:
      name:
        v: dengue
    rule:
      name:
        v: dysenteryBacillary
    rule:
      name:
        v: guineaWorm
    rule:
      name:
        v: measlesSectionAB
    rule:
      name:
        v: suspectedMalaria
    rule:
      name:
        v: bacterialMeningitis
    rule:
      name:
        v: neonatalTetanus
    rule:
      name:
        v: onchocerciasis
group:
  name:
    v: CreateSectionABObs
  type mode:
    v: none
  documentation:
    v: Helper: create a disease Observation with 4 components (under-5 cases/deaths, over-5 cases/deaths)

String
v: transaction

v: page

v: item

v: cb

v: linkId = '745196148424'

v: u5c

context:
  v: page
element:
  v: item
variable:
  v: u5c
condition:
  v: linkId = 'under5-cases'

name:
  v: u5d
source:
  context:
    v: page
  element:
    v: item
  variable:
    v: u5d
  condition:
    v: linkId = 'under5-deaths'
rule:
  name:
    v: o5c
  source:
    context:
      v: page
    element:
      v: item
    variable:
      v: o5c
    condition:
      v: linkId = 'over5-cases'
  rule:
    name:
      v: o5d
    source:
      context:
        v: page
      element:
        v: item
      variable:
        v: o5d
      condition:
        v: linkId = 'over5-deaths'
    rule:
      name:
        v: aefiObs

v: cb

v: answer.exists()

v: bundle

v: variable

v: entry

v: e

v: e

v: variable

v: resource

v: obs

v: create

value: String
  v: Observation

v: CreateSectionABObs

v: cb

v: u5c

v: u5d

v: o5c

v: o5d

v: obs

v: page

v: item

v: cb

v: linkId = 'acute-jaundice'

v: u5c

context:
  v: page
element:
  v: item
variable:
  v: u5c
condition:
  v: linkId = 'acute-jaundice-under5-cases'

name:
  v: u5d
source:
  context:
    v: page
  element:
    v: item
  variable:
    v: u5d
  condition:
    v: linkId = 'acute-jaundice-under5-deaths'
rule:
  name:
    v: o5c
  source:
    context:
      v: page
    element:
      v: item
    variable:
      v: o5c
    condition:
      v: linkId = 'acute-jaundice-over5-cases'
  rule:
    name:
      v: o5d
    source:
      context:
        v: page
      element:
        v: item
      variable:
        v: o5d
      condition:
        v: linkId = 'acute-jaundice-over5-deaths'
    rule:
      name:
        v: ajObs

v: cb

v: answer.exists()

v: bundle

v: variable

v: entry

v: e

v: e

v: variable

v: resource

v: obs

v: create

value: String
  v: Observation

v: CreateSectionABObs

v: cb

v: u5c

v: u5d

v: o5c

v: o5d

v: obs

v: page

v: item

v: cb

v: linkId = 'acute-malnutrition'

v: u5c

context:
  v: page
element:
  v: item
variable:
  v: u5c
condition:
  v: linkId = 'acute-malnutrition-under5-cases'

name:
  v: u5d
source:
  context:
    v: page
  element:
    v: item
  variable:
    v: u5d
  condition:
    v: linkId = 'acute-malnutrition-under5-deaths'
rule:
  name:
    v: o5c
  source:
    context:
      v: page
    element:
      v: item
    variable:
      v: o5c
    condition:
      v: linkId = 'acute-malnutrition-over5-cases'
  rule:
    name:
      v: o5d
    source:
      context:
        v: page
      element:
        v: item
      variable:
        v: o5d
      condition:
        v: linkId = 'acute-malnutrition-over5-deaths'
    rule:
      name:
        v: amObs

v: cb

v: answer.exists()

v: bundle

v: variable

v: entry

v: e

v: e

v: variable

v: resource

v: obs

v: create

value: String
  v: Observation

v: CreateSectionABObs

v: cb

v: u5c

v: u5d

v: o5c

v: o5d

v: obs

v: page

v: item

v: cb

v: linkId = 'afp-poliomyelitis'

v: u5c

context:
  v: page
element:
  v: item
variable:
  v: u5c
condition:
  v: linkId = 'afp-poliomyelitis-under5-cases'

name:
  v: u5d
source:
  context:
    v: page
  element:
    v: item
  variable:
    v: u5d
  condition:
    v: linkId = 'afp-poliomyelitis-under5-deaths'
rule:
  name:
    v: o5c
  source:
    context:
      v: page
    element:
      v: item
    variable:
      v: o5c
    condition:
      v: linkId = 'afp-poliomyelitis-over5-cases'
  rule:
    name:
      v: o5d
    source:
      context:
        v: page
      element:
        v: item
      variable:
        v: o5d
      condition:
        v: linkId = 'afp-poliomyelitis-over5-deaths'
    rule:
      name:
        v: afpObs

v: cb

v: answer.exists()

v: bundle

v: variable

v: entry

v: e

v: e

v: variable

v: resource

v: obs

v: create

value: String
  v: Observation

v: CreateSectionABObs

v: cb

v: u5c

v: u5d

v: o5c

v: o5d

v: obs

v: page

v: item

v: cb

v: linkId = 'anthrax'

v: u5c

context:
  v: page
element:
  v: item
variable:
  v: u5c
condition:
  v: linkId = 'anthrax-under5-cases'

name:
  v: u5d
source:
  context:
    v: page
  element:
    v: item
  variable:
    v: u5d
  condition:
    v: linkId = 'anthrax-under5-deaths'
rule:
  name:
    v: o5c
  source:
    context:
      v: page
    element:
      v: item
    variable:
      v: o5c
    condition:
      v: linkId = 'anthrax-over5-cases'
  rule:
    name:
      v: o5d
    source:
      context:
        v: page
      element:
        v: item
      variable:
        v: o5d
      condition:
        v: linkId = 'anthrax-over5-deaths'
    rule:
      name:
        v: anthraxObs

v: cb

v: answer.exists()

v: bundle

v: variable

v: entry

v: e

v: e

v: variable

v: resource

v: obs

v: create

value: String
  v: Observation

v: CreateSectionABObs

v: cb

v: u5c

v: u5d

v: o5c

v: o5d

v: obs

v: page

v: item

v: cb

v: linkId = 'cholera'

v: u5c

context:
  v: page
element:
  v: item
variable:
  v: u5c
condition:
  v: linkId = 'cholera-under5-cases'

name:
  v: u5d
source:
  context:
    v: page
  element:
    v: item
  variable:
    v: u5d
  condition:
    v: linkId = 'cholera-under5-deaths'
rule:
  name:
    v: o5c
  source:
    context:
      v: page
    element:
      v: item
    variable:
      v: o5c
    condition:
      v: linkId = 'cholera-over5-cases'
  rule:
    name:
      v: o5d
    source:
      context:
        v: page
      element:
        v: item
      variable:
        v: o5d
      condition:
        v: linkId = 'cholera-over5-deaths'
    rule:
      name:
        v: choleraObs

v: cb

v: answer.exists()

v: bundle

v: variable

v: entry

v: e

v: e

v: variable

v: resource

v: obs

v: create

value: String
  v: Observation

v: CreateSectionABObs

v: cb

v: u5c

v: u5d

v: o5c

v: o5d

v: obs

v: page

v: item

v: cb

v: linkId = 'chikungunya'

v: u5c

context:
  v: page
element:
  v: item
variable:
  v: u5c
condition:
  v: linkId = 'chikungunya-under5-cases'

name:
  v: u5d
source:
  context:
    v: page
  element:
    v: item
  variable:
    v: u5d
  condition:
    v: linkId = 'chikungunya-under5-deaths'
rule:
  name:
    v: o5c
  source:
    context:
      v: page
    element:
      v: item
    variable:
      v: o5c
    condition:
      v: linkId = 'chikungunya-over5-cases'
  rule:
    name:
      v: o5d
    source:
      context:
        v: page
      element:
        v: item
      variable:
        v: o5d
      condition:
        v: linkId = 'chikungunya-over5-deaths'
    rule:
      name:
        v: chikungunyaObs

v: cb

v: answer.exists()

v: bundle

v: variable

v: entry

v: e

v: e

v: variable

v: resource

v: obs

v: create

value: String
  v: Observation

v: CreateSectionABObs

v: cb

v: u5c

v: u5d

v: o5c

v: o5d

v: obs

v: page

v: item

v: cb

v: linkId = 'covid-19'

v: u5c

context:
  v: page
element:
  v: item
variable:
  v: u5c
condition:
  v: linkId = 'covid-19-under5-cases'

name:
  v: u5d
source:
  context:
    v: page
  element:
    v: item
  variable:
    v: u5d
  condition:
    v: linkId = 'covid-19-under5-deaths'
rule:
  name:
    v: o5c
  source:
    context:
      v: page
    element:
      v: item
    variable:
      v: o5c
    condition:
      v: linkId = 'covid-19-over5-cases'
  rule:
    name:
      v: o5d
    source:
      context:
        v: page
      element:
        v: item
      variable:
        v: o5d
      condition:
        v: linkId = 'covid-19-over5-deaths'
    rule:
      name:
        v: covidObs

v: cb

v: answer.exists()

v: bundle

v: variable

v: entry

v: e

v: e

v: variable

v: resource

v: obs

v: create

value: String
  v: Observation

v: CreateSectionABObs

v: cb

v: u5c

v: u5d

v: o5c

v: o5d

v: obs

v: page

v: item

v: cb

v: linkId = 'dengue'

v: u5c

context:
  v: page
element:
  v: item
variable:
  v: u5c
condition:
  v: linkId = 'dengue-under5-cases'

name:
  v: u5d
source:
  context:
    v: page
  element:
    v: item
  variable:
    v: u5d
  condition:
    v: linkId = 'dengue-under5-deaths'
rule:
  name:
    v: o5c
  source:
    context:
      v: page
    element:
      v: item
    variable:
      v: o5c
    condition:
      v: linkId = 'dengue-over5-cases'
  rule:
    name:
      v: o5d
    source:
      context:
        v: page
      element:
        v: item
      variable:
        v: o5d
      condition:
        v: linkId = 'dengue-over5-deaths'
    rule:
      name:
        v: dengueObs

v: cb

v: answer.exists()

v: bundle

v: variable

v: entry

v: e

v: e

v: variable

v: resource

v: obs

v: create

value: String
  v: Observation

v: CreateSectionABObs

v: cb

v: u5c

v: u5d

v: o5c

v: o5d

v: obs

v: page

v: item

v: cb

v: linkId = 'dysentery-bacillary'

v: u5c

context:
  v: page
element:
  v: item
variable:
  v: u5c
condition:
  v: linkId = 'dysentery-bacillary-under5-cases'

name:
  v: u5d
source:
  context:
    v: page
  element:
    v: item
  variable:
    v: u5d
  condition:
    v: linkId = 'dysentery-bacillary-under5-deaths'
rule:
  name:
    v: o5c
  source:
    context:
      v: page
    element:
      v: item
    variable:
      v: o5c
    condition:
      v: linkId = 'dysentery-bacillary-over5-cases'
  rule:
    name:
      v: o5d
    source:
      context:
        v: page
      element:
        v: item
      variable:
        v: o5d
      condition:
        v: linkId = 'dysentery-bacillary-over5-deaths'
    rule:
      name:
        v: dysenteryObs

v: cb

v: answer.exists()

v: bundle

v: variable

v: entry

v: e

v: e

v: variable

v: resource

v: obs

v: create

value: String
  v: Observation

v: CreateSectionABObs

v: cb

v: u5c

v: u5d

v: o5c

v: o5d

v: obs

v: page

v: item

v: cb

v: linkId = 'guinea-worm-disease'

v: u5c

context:
  v: page
element:
  v: item
variable:
  v: u5c
condition:
  v: linkId = 'guinea-worm-disease-under5-cases'

name:
  v: u5d
source:
  context:
    v: page
  element:
    v: item
  variable:
    v: u5d
  condition:
    v: linkId = 'guinea-worm-disease-under5-deaths'
rule:
  name:
    v: o5c
  source:
    context:
      v: page
    element:
      v: item
    variable:
      v: o5c
    condition:
      v: linkId = 'guinea-worm-disease-over5-cases'
  rule:
    name:
      v: o5d
    source:
      context:
        v: page
      element:
        v: item
      variable:
        v: o5d
      condition:
        v: linkId = 'guinea-worm-disease-over5-deaths'
    rule:
      name:
        v: guineaWormObs

v: cb

v: answer.exists()

v: bundle

v: variable

v: entry

v: e

v: e

v: variable

v: resource

v: obs

v: create

value: String
  v: Observation

v: CreateSectionABObs

v: cb

v: u5c

v: u5d

v: o5c

v: o5d

v: obs

v: page

v: item

v: cb

v: linkId = 'measles'

v: u5c

context:
  v: page
element:
  v: item
variable:
  v: u5c
condition:
  v: linkId = 'measles-under5-cases'

name:
  v: u5d
source:
  context:
    v: page
  element:
    v: item
  variable:
    v: u5d
  condition:
    v: linkId = 'measles-under5-deaths'
rule:
  name:
    v: o5c
  source:
    context:
      v: page
    element:
      v: item
    variable:
      v: o5c
    condition:
      v: linkId = 'measles-over5-cases'
  rule:
    name:
      v: o5d
    source:
      context:
        v: page
      element:
        v: item
      variable:
        v: o5d
      condition:
        v: linkId = 'measles-over5-deaths'
    rule:
      name:
        v: measlesObs

v: cb

v: answer.exists()

v: bundle

v: variable

v: entry

v: e

v: e

v: variable

v: resource

v: obs

v: create

value: String
  v: Observation

v: CreateSectionABObs

v: cb

v: u5c

v: u5d

v: o5c

v: o5d

v: obs

v: page

v: item

v: cb

v: linkId = 'suspected-malaria'

v: u5c

context:
  v: page
element:
  v: item
variable:
  v: u5c
condition:
  v: linkId = 'suspected-malaria-under5-cases'

name:
  v: u5d
source:
  context:
    v: page
  element:
    v: item
  variable:
    v: u5d
  condition:
    v: linkId = 'suspected-malaria-under5-deaths'
rule:
  name:
    v: o5c
  source:
    context:
      v: page
    element:
      v: item
    variable:
      v: o5c
    condition:
      v: linkId = 'suspected-malaria-over5-cases'
  rule:
    name:
      v: o5d
    source:
      context:
        v: page
      element:
        v: item
      variable:
        v: o5d
      condition:
        v: linkId = 'suspected-malaria-over5-deaths'
    rule:
      name:
        v: malariaObs

v: cb

v: answer.exists()

v: bundle

v: variable

v: entry

v: e

v: e

v: variable

v: resource

v: obs

v: create

value: String
  v: Observation

v: CreateSectionABObs

v: cb

v: u5c

v: u5d

v: o5c

v: o5d

v: obs

v: page

v: item

v: cb

v: linkId = '912271576972'

v: u5c

context:
  v: page
element:
  v: item
variable:
  v: u5c
condition:
  v: linkId = '871055915491'

name:
  v: u5d
source:
  context:
    v: page
  element:
    v: item
  variable:
    v: u5d
  condition:
    v: linkId = '388760057096'
rule:
  name:
    v: o5c
  source:
    context:
      v: page
    element:
      v: item
    variable:
      v: o5c
    condition:
      v: linkId = '483347883552'
  rule:
    name:
      v: o5d
    source:
      context:
        v: page
      element:
        v: item
      variable:
        v: o5d
      condition:
        v: linkId = '983942974596'
    rule:
      name:
        v: bactMenObs

v: cb

v: answer.exists()

v: bundle

v: variable

v: entry

v: e

v: e

v: variable

v: resource

v: obs

v: create

value: String
  v: Observation

v: CreateSectionABObs

v: cb

v: u5c

v: u5d

v: o5c

v: o5d

v: obs

v: page

v: item

v: cb

v: linkId = '328118347844'

v: u5c

context:
  v: page
element:
  v: item
variable:
  v: u5c
condition:
  v: linkId = '535840524666'

name:
  v: u5d
source:
  context:
    v: page
  element:
    v: item
  variable:
    v: u5d
  condition:
    v: linkId = '703609548617'
rule:
  name:
    v: neonatalTetObs
  source:
    context:
      v: cb
    condition:
      v: answer.exists()
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: e
  target:
    context:
      v: e
    context type:
      v: variable
    element:
      v: resource
    variable:
      v: obs
    transform:
      v: create
    parameter:
      value: String
        v: Observation
  dependent:
    name:
      v: CreateSectionABObsPartial
    variable:
      v: cb
    variable:
      v: u5c
    variable:
      v: u5d
    variable:
      v: obs

v: page

v: item

v: cb

v: linkId = '579664664652'

v: u5c

context:
  v: page
element:
  v: item
variable:
  v: u5c
condition:
  v: linkId = '327509292099'

name:
  v: u5d
source:
  context:
    v: page
  element:
    v: item
  variable:
    v: u5d
  condition:
    v: linkId = '928912977066'
rule:
  name:
    v: o5c
  source:
    context:
      v: page
    element:
      v: item
    variable:
      v: o5c
    condition:
      v: linkId = '456099214566'
  rule:
    name:
      v: o5d
    source:
      context:
        v: page
      element:
        v: item
      variable:
        v: o5d
      condition:
        v: linkId = '749207004486'
    rule:
      name:
        v: onchocerciasisObs

v: cb

v: answer.exists()

v: bundle

v: variable

v: entry

v: e

v: e

v: variable

v: resource

v: obs

v: create

value: String
  v: Observation

v: CreateSectionABObs

v: cb

v: u5c

v: u5d

v: o5c

v: o5d

v: obs

name:
  v: cb
type:
  v: BackboneElement
mode:
  v: source

name:
  v: u5CasesItem
type:
  v: BackboneElement
mode:
  v: source

name:
  v: u5DeathsItem
type:
  v: BackboneElement
mode:
  v: source

name:
  v: o5CasesItem
type:
  v: BackboneElement
mode:
  v: source

name:
  v: o5DeathsItem
type:
  v: BackboneElement
mode:
  v: source

name:
  v: obs
type:
  v: Observation
mode:
  v: target

name:
  v: obsId
source:
  context:
    v: cb
target:
  context:
    v: obs
  context type:
    v: variable
  element:
    v: id
  transform:
    v: uuid

name:
  v: status
source:
  context:
    v: cb
target:
  context:
    v: obs
  context type:
    v: variable
  element:
    v: status
  transform:
    v: copy
  parameter:
    value: String
      v: final

name:
  v: category
source:
  context:
    v: cb
target:
  context:
    v: obs
  context type:
    v: variable
  element:
    v: category
  variable:
    v: cat
rule:
  name:
    v: cat
  source:
    context:
      v: cb
  target:
    context:
      v: cat
    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/observation-category
  target:
    context:
      v: cod
    context type:
      v: variable
    element:
      v: code
    transform:
      v: copy
    parameter:
      value: String
        v: survey
  target:
    context:
      v: cod
    context type:
      v: variable
    element:
      v: display
    transform:
      v: copy
    parameter:
      value: String
        v: Survey

name:
  v: diseaseCode
source:
  context:
    v: cb
  element:
    v: answer
  list mode:
    v: first
  variable:
    v: ans
target:
  context:
    v: obs
  context type:
    v: variable
  element:
    v: code
  variable:
    v: code
rule:
  name:
    v: codeCoding
  source:
    context:
      v: ans
  target:
    context:
      v: code
    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/moh505-disease
  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
rule:
  name:
    v: codeText
  source:
    context:
      v: ans
  target:
    context:
      v: code
    context type:
      v: variable
    element:
      v: text
    transform:
      v: evaluate
    parameter:
      value: String
        v: ans.valueCoding.display

name:
  v: u5CasesComp
source:
  context:
    v: u5CasesItem
  element:
    v: answer
  list mode:
    v: first
  variable:
    v: ans
target:
  context:
    v: obs
  context type:
    v: variable
  element:
    v: component
  variable:
    v: comp
rule:
  name:
    v: compCode
  source:
    context:
      v: ans
  target:
    context:
      v: comp
    context type:
      v: variable
    element:
      v: code
    variable:
      v: code
  target:
    context:
      v: code
    context type:
      v: variable
    element:
      v: text
    transform:
      v: copy
    parameter:
      value: String
        v: Under 5 Cases
rule:
  name:
    v: compValue
  source:
    context:
      v: ans
  target:
    context:
      v: comp
    context type:
      v: variable
    element:
      v: valueInteger
    transform:
      v: copy
    parameter:
      value: Id
        v: ans.valueInteger

name:
  v: u5DeathsComp
source:
  context:
    v: u5DeathsItem
  element:
    v: answer
  list mode:
    v: first
  variable:
    v: ans
target:
  context:
    v: obs
  context type:
    v: variable
  element:
    v: component
  variable:
    v: comp
rule:
  name:
    v: compCode
  source:
    context:
      v: ans
  target:
    context:
      v: comp
    context type:
      v: variable
    element:
      v: code
    variable:
      v: code
  target:
    context:
      v: code
    context type:
      v: variable
    element:
      v: text
    transform:
      v: copy
    parameter:
      value: String
        v: Under 5 Deaths
rule:
  name:
    v: compValue
  source:
    context:
      v: ans
  target:
    context:
      v: comp
    context type:
      v: variable
    element:
      v: valueInteger
    transform:
      v: copy
    parameter:
      value: Id
        v: ans.valueInteger

name:
  v: o5CasesComp
source:
  context:
    v: o5CasesItem
  element:
    v: answer
  list mode:
    v: first
  variable:
    v: ans
target:
  context:
    v: obs
  context type:
    v: variable
  element:
    v: component
  variable:
    v: comp
rule:
  name:
    v: compCode
  source:
    context:
      v: ans
  target:
    context:
      v: comp
    context type:
      v: variable
    element:
      v: code
    variable:
      v: code
  target:
    context:
      v: code
    context type:
      v: variable
    element:
      v: text
    transform:
      v: copy
    parameter:
      value: String
        v: Over 5 Cases
rule:
  name:
    v: compValue
  source:
    context:
      v: ans
  target:
    context:
      v: comp
    context type:
      v: variable
    element:
      v: valueInteger
    transform:
      v: copy
    parameter:
      value: Id
        v: ans.valueInteger

name:
  v: o5DeathsComp
source:
  context:
    v: o5DeathsItem
  element:
    v: answer
  list mode:
    v: first
  variable:
    v: ans
target:
  context:
    v: obs
  context type:
    v: variable
  element:
    v: component
  variable:
    v: comp
rule:
  name:
    v: compCode
  source:
    context:
      v: ans
  target:
    context:
      v: comp
    context type:
      v: variable
    element:
      v: code
    variable:
      v: code
  target:
    context:
      v: code
    context type:
      v: variable
    element:
      v: text
    transform:
      v: copy
    parameter:
      value: String
        v: Over 5 Deaths
rule:
  name:
    v: compValue
  source:
    context:
      v: ans
  target:
    context:
      v: comp
    context type:
      v: variable
    element:
      v: valueInteger
    transform:
      v: copy
    parameter:
      value: Id
        v: ans.valueInteger

name:
  v: CreateSectionABObsPartial
type mode:
  v: none
documentation:
  v: Helper: create an Observation with only under-5 components (for diseases like Neonatal Tetanus)
input:
  name:
    v: cb
  type:
    v: BackboneElement
  mode:
    v: source
input:
  name:
    v: u5CasesItem
  type:
    v: BackboneElement
  mode:
    v: source
input:
  name:
    v: u5DeathsItem
  type:
    v: BackboneElement
  mode:
    v: source
input:
  name:
    v: obs
  type:
    v: Observation
  mode:
    v: target
rule:
  name:
    v: obsId
  source:
    context:
      v: cb
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: id
    transform:
      v: uuid
rule:
  name:
    v: status
  source:
    context:
      v: cb
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: status
    transform:
      v: copy
    parameter:
      value: String
        v: final
rule:
  name:
    v: category
  source:
    context:
      v: cb
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: category
    variable:
      v: cat
  rule:
    name:
      v: cat
    source:
      context:
        v: cb
    target:
      context:
        v: cat
      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
    target:
      context:
        v: cod
      context type:
        v: variable
      element:
        v: display
      transform:
        v: copy
      parameter:
        value: String
rule:
  name:
    v: diseaseCode
  source:
    context:
      v: cb
    element:
      v: answer
    list mode:
      v: first
    variable:
      v: ans
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: code
    variable:
      v: code
  rule:
    name:
      v: codeCoding
    source:
      context:
        v: ans
    target:
      context:
        v: code
      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: evaluate
      parameter:
        value: String
    target:
      context:
        v: cod
      context type:
        v: variable
      element:
        v: display
      transform:
        v: evaluate
      parameter:
        value: String
  rule:
    name:
      v: codeText

String
v: survey

String
v: Survey

String
v: ans.valueCoding.code

String
v: ans.valueCoding.display

context:
  v: ans

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

name:
  v: u5CasesComp
source:
  context:
    v: u5CasesItem
  element:
    v: answer
  list mode:
    v: first
  variable:
    v: ans
target:
  context:
    v: obs
  context type:
    v: variable
  element:
    v: component
  variable:
    v: comp
rule:
  name:
    v: compCode
  source:
    context:
      v: ans
  target:
    context:
      v: comp
    context type:
      v: variable
    element:
      v: code
    variable:
      v: code
  target:
    context:
      v: code
    context type:
      v: variable
    element:
      v: text
    transform:
      v: copy
    parameter:
      value: String
        v: Under 5 Cases
rule:
  name:
    v: compValue
  source:
    context:
      v: ans
  target:
    context:
      v: comp
    context type:
      v: variable
    element:
      v: valueInteger
    transform:
      v: copy
    parameter:
      value: Id
        v: ans.valueInteger

name:
  v: u5DeathsComp
source:
  context:
    v: u5DeathsItem
  element:
    v: answer
  list mode:
    v: first
  variable:
    v: ans
target:
  context:
    v: obs
  context type:
    v: variable
  element:
    v: component
  variable:
    v: comp
rule:
  name:
    v: compCode
  source:
    context:
      v: ans
  target:
    context:
      v: comp
    context type:
      v: variable
    element:
      v: code
    variable:
      v: code
  target:
    context:
      v: code
    context type:
      v: variable
    element:
      v: text
    transform:
      v: copy
    parameter:
      value: String
        v: Under 5 Deaths
rule:
  name:
    v: compValue
  source:
    context:
      v: ans
  target:
    context:
      v: comp
    context type:
      v: variable
    element:
      v: valueInteger
    transform:
      v: copy
    parameter:
      value: Id
        v: ans.valueInteger