Moh505Map
type: StructureMap
node role: treeRoot
id:
  v: Moh505Map
text:
  status:
    v: generated
  div:
    v: Generated Narrative: StructureMap Moh505Map #xD; map "http://example.org/StructureMap/Moh505Map" = "Moh505Map"#xD; #xD; // MOH 505 Health Facility Weekly Reporting Form QuestionnaireResponse to FHIR resources#xD; // Maps to: Encounter (facility + reporting period) and Observation per disease#xD; // PAGE 1: Reporting Site → Encounter#xD; // PAGE 2: Diseases, Conditions or Events → Observations (cases/deaths per disease)#xD; // PAGE 3: Laboratory Surveillance → Observations (malaria lab tests)#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/Encounter" alias Encounter 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 Moh505Map(source src : QuestionnaireResponse, target bundle : Bundle) {#xD; src -> bundle.id = uuid() "bundleId";#xD; src -> bundle.type = 'transaction' "bundleType";#xD; // Create Encounter for the facility reporting context#xD; src -> bundle.entry as e then {#xD; src -> e.resource = create('Encounter') as encounter then MapMoh505Encounter(src, encounter) "execEncounter";#xD; src -> e.request as req, req.method = 'POST', req.url = 'Encounter' "encounterReq";#xD; } "encounterEntry";#xD; // Create Observations per disease from PAGE 2#xD; src.item as diseasesPage where linkId = '306799299' then {#xD; // ── AEFI ────────────────────────────────────────────────────────────────#xD; diseasesPage.item as summ where linkId = 'aefi-summary' then {#xD; diseasesPage.item as u5c where linkId = 'aefi-cases-under-5' then {#xD; diseasesPage.item as o5c where linkId = 'aefi-cases-over-5' then {#xD; diseasesPage.item as u5d where linkId = 'aefi-deaths-under-5' then {#xD; diseasesPage.item as o5d where linkId = 'aefi…
url:
  v: http://example.org/StructureMap/Moh505Map
  l: Moh505Map
version:
  v: 0.1.0
name:
  v: Moh505Map
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 Health Facility Weekly Reporting Form QuestionnaireResponse to FHIR resources Maps to: Encounter (facility + reporting period) and Observation per disease PAGE 1: Reporting Site → Encounter PAGE 2: Diseases, Conditions or Events → Observations (cases/deaths per disease) PAGE 3: Laboratory Surveillance → Observations (malaria lab tests)
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/Encounter
    l: Encounter
  mode:
    v: target
  alias:
    v: Encounter
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: Moh505Map
  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: 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: diseasesPage
    source:
      context:
        v: src
      element:
        v: item
      variable:
        v: diseasesPage
      condition:
        v: linkId = '306799299'
    rule:
      name:
        v: aefi
    rule:
      name:
        v: bacterialMeningitis
    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

String
v: transaction

v: src

v: e

v: variable

v: resource

v: encounter

v: create

value: String
  v: Encounter

v: MapMoh505Encounter

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

v: diseasesPage

v: item

v: summ

v: linkId = 'aefi-summary'

v: u5c

context:
  v: diseasesPage
element:
  v: item
variable:
  v: u5c
condition:
  v: linkId = 'aefi-cases-under-5'

name:
  v: o5c
source:
  context:
    v: diseasesPage
  element:
    v: item
  variable:
    v: o5c
  condition:
    v: linkId = 'aefi-cases-over-5'
rule:
  name:
    v: u5d
  source:
    context:
      v: diseasesPage
    element:
      v: item
    variable:
      v: u5d
    condition:
      v: linkId = 'aefi-deaths-under-5'
  rule:
    name:
      v: o5d
    source:
      context:
        v: diseasesPage
      element:
        v: item
      variable:
        v: o5d
      condition:
        v: linkId = 'aefi-deaths-over-5'
    rule:
      name:
        v: aefiObs

v: summ

v: answer

v: first

v: ans

v: valueCoding.code = 'yes'

v: bundle

v: variable

v: entry

v: e

v: obsCreate

context:
  v: summ

context:
  v: e
context type:
  v: variable
element:
  v: resource
variable:
  v: obs
transform:
  v: create
parameter:
  value: String
    v: Observation

name:
  v: CreateMoh505DiseaseObs
variable:
  v: summ
variable:
  v: u5c
variable:
  v: o5c
variable:
  v: u5d
variable:
  v: o5d
variable:
  v: obs

v: reqCreate

context:
  v: summ

context:
  v: e
context type:
  v: variable
element:
  v: request
variable:
  v: req

context:
  v: req
context type:
  v: variable
element:
  v: method
transform:
  v: copy
parameter:
  value: String
    v: POST

context:
  v: req
context type:
  v: variable
element:
  v: url
transform:
  v: copy
parameter:
  value: String
    v: Observation

v: diseasesPage

v: item

v: summ

v: linkId = 'bacterial-meningitis-summary'

v: u5c

context:
  v: diseasesPage
element:
  v: item
variable:
  v: u5c
condition:
  v: linkId = 'bacterial-meningitis-cases-under-5'

name:
  v: o5c
source:
  context:
    v: diseasesPage
  element:
    v: item
  variable:
    v: o5c
  condition:
    v: linkId = 'bacterial-meningitis-cases-over-5'
rule:
  name:
    v: u5d
  source:
    context:
      v: diseasesPage
    element:
      v: item
    variable:
      v: u5d
    condition:
      v: linkId = 'bacterial-meningitis-deaths-under-5'
  rule:
    name:
      v: o5d
    source:
      context:
        v: diseasesPage
      element:
        v: item
      variable:
        v: o5d
      condition:
        v: linkId = 'bacterial-meningitis-deaths-over-5'
    rule:
      name:
        v: bactMenObs

v: summ

v: answer

v: first

v: ans

v: valueCoding.code = 'yes'

v: bundle

v: variable

v: entry

v: e

v: obsCreate

context:
  v: summ

context:
  v: e
context type:
  v: variable
element:
  v: resource
variable:
  v: obs
transform:
  v: create
parameter:
  value: String
    v: Observation

name:
  v: CreateMoh505DiseaseObs
variable:
  v: summ
variable:
  v: u5c
variable:
  v: o5c
variable:
  v: u5d
variable:
  v: o5d
variable:
  v: obs

v: reqCreate

context:
  v: summ

context:
  v: e
context type:
  v: variable
element:
  v: request
variable:
  v: req

context:
  v: req
context type:
  v: variable
element:
  v: method
transform:
  v: copy
parameter:
  value: String
    v: POST

context:
  v: req
context type:
  v: variable
element:
  v: url
transform:
  v: copy
parameter:
  value: String
    v: Observation

v: diseasesPage

v: item

v: summ

v: linkId = 'acute-jaundice-summary'

v: u5c

context:
  v: diseasesPage
element:
  v: item
variable:
  v: u5c
condition:
  v: linkId = 'acute-jaundice-cases-under-5'

name:
  v: o5c
source:
  context:
    v: diseasesPage
  element:
    v: item
  variable:
    v: o5c
  condition:
    v: linkId = 'acute-jaundice-cases-over-5'
rule:
  name:
    v: u5d
  source:
    context:
      v: diseasesPage
    element:
      v: item
    variable:
      v: u5d
    condition:
      v: linkId = 'acute-jaundice-deaths-under-5'
  rule:
    name:
      v: o5d
    source:
      context:
        v: diseasesPage
      element:
        v: item
      variable:
        v: o5d
      condition:
        v: linkId = 'acute-jaundice-deaths-over-5'
    rule:
      name:
        v: ajObs

v: summ

v: answer

v: first

v: ans

v: valueCoding.code = 'yes'

v: bundle

v: variable

v: entry

v: e

v: obsCreate

context:
  v: summ

context:
  v: e
context type:
  v: variable
element:
  v: resource
variable:
  v: obs
transform:
  v: create
parameter:
  value: String
    v: Observation

name:
  v: CreateMoh505DiseaseObs
variable:
  v: summ
variable:
  v: u5c
variable:
  v: o5c
variable:
  v: u5d
variable:
  v: o5d
variable:
  v: obs

v: reqCreate

context:
  v: summ

context:
  v: e
context type:
  v: variable
element:
  v: request
variable:
  v: req

context:
  v: req
context type:
  v: variable
element:
  v: method
transform:
  v: copy
parameter:
  value: String
    v: POST

context:
  v: req
context type:
  v: variable
element:
  v: url
transform:
  v: copy
parameter:
  value: String
    v: Observation

v: diseasesPage

v: item

v: summ

v: linkId = 'acute-malnutrition-summary'

v: u5c

context:
  v: diseasesPage
element:
  v: item
variable:
  v: u5c
condition:
  v: linkId = 'acute-malnutrition-cases-under-5'

name:
  v: o5c
source:
  context:
    v: diseasesPage
  element:
    v: item
  variable:
    v: o5c
  condition:
    v: linkId = 'acute-malnutrition-cases-over-5'
rule:
  name:
    v: u5d
  source:
    context:
      v: diseasesPage
    element:
      v: item
    variable:
      v: u5d
    condition:
      v: linkId = 'acute-malnutrition-deaths-under-5'
  rule:
    name:
      v: o5d
    source:
      context:
        v: diseasesPage
      element:
        v: item
      variable:
        v: o5d
      condition:
        v: linkId = 'acute-malnutrition-deaths-over-5'
    rule:
      name:
        v: amObs

v: summ

v: answer

v: first

v: ans

v: valueCoding.code = 'yes'

v: bundle

v: variable

v: entry

v: e

v: obsCreate

context:
  v: summ

context:
  v: e
context type:
  v: variable
element:
  v: resource
variable:
  v: obs
transform:
  v: create
parameter:
  value: String
    v: Observation

name:
  v: CreateMoh505DiseaseObs
variable:
  v: summ
variable:
  v: u5c
variable:
  v: o5c
variable:
  v: u5d
variable:
  v: o5d
variable:
  v: obs

v: reqCreate

context:
  v: summ

context:
  v: e
context type:
  v: variable
element:
  v: request
variable:
  v: req

context:
  v: req
context type:
  v: variable
element:
  v: method
transform:
  v: copy
parameter:
  value: String
    v: POST

context:
  v: req
context type:
  v: variable
element:
  v: url
transform:
  v: copy
parameter:
  value: String
    v: Observation

v: diseasesPage

v: item

v: summ

v: linkId = 'afp-poliomyelitis-summary'

v: u5c

context:
  v: diseasesPage
element:
  v: item
variable:
  v: u5c
condition:
  v: linkId = 'afp-poliomyelitis-cases-under-5'

name:
  v: o5c
source:
  context:
    v: diseasesPage
  element:
    v: item
  variable:
    v: o5c
  condition:
    v: linkId = 'afp-poliomyelitis-cases-over-5'
rule:
  name:
    v: u5d
  source:
    context:
      v: diseasesPage
    element:
      v: item
    variable:
      v: u5d
    condition:
      v: linkId = 'afp-poliomyelitis-deaths-under-5'
  rule:
    name:
      v: o5d
    source:
      context:
        v: diseasesPage
      element:
        v: item
      variable:
        v: o5d
      condition:
        v: linkId = 'afp-poliomyelitis-deaths-over-5'
    rule:
      name:
        v: afpObs

v: summ

v: answer

v: first

v: ans

v: valueCoding.code = 'yes'

v: bundle

v: variable

v: entry

v: e

v: obsCreate

context:
  v: summ

context:
  v: e
context type:
  v: variable
element:
  v: resource
variable:
  v: obs
transform:
  v: create
parameter:
  value: String
    v: Observation

name:
  v: CreateMoh505DiseaseObs
variable:
  v: summ
variable:
  v: u5c
variable:
  v: o5c
variable:
  v: u5d
variable:
  v: o5d
variable:
  v: obs

v: reqCreate

context:
  v: summ

context:
  v: e
context type:
  v: variable
element:
  v: request
variable:
  v: req

context:
  v: req
context type:
  v: variable
element:
  v: method
transform:
  v: copy
parameter:
  value: String
    v: POST

context:
  v: req
context type:
  v: variable
element:
  v: url
transform:
  v: copy
parameter:
  value: String
    v: Observation

v: diseasesPage

v: item

v: summ

v: linkId = 'anthrax-summary'

v: u5c

context:
  v: diseasesPage
element:
  v: item
variable:
  v: u5c
condition:
  v: linkId = 'anthrax-cases-under-5'

name:
  v: o5c
source:
  context:
    v: diseasesPage
  element:
    v: item
  variable:
    v: o5c
  condition:
    v: linkId = 'anthrax-cases-over-5'
rule:
  name:
    v: u5d
  source:
    context:
      v: diseasesPage
    element:
      v: item
    variable:
      v: u5d
    condition:
      v: linkId = 'anthrax-deaths-under-5'
  rule:
    name:
      v: o5d
    source:
      context:
        v: diseasesPage
      element:
        v: item
      variable:
        v: o5d
      condition:
        v: linkId = 'anthrax-deaths-over-5'
    rule:
      name:
        v: anthraxObs

v: summ

v: answer

v: first

v: ans

v: valueCoding.code = 'yes'

v: bundle

v: variable

v: entry

v: e

v: obsCreate

context:
  v: summ

context:
  v: e
context type:
  v: variable
element:
  v: resource
variable:
  v: obs
transform:
  v: create
parameter:
  value: String
    v: Observation

name:
  v: CreateMoh505DiseaseObs
variable:
  v: summ
variable:
  v: u5c
variable:
  v: o5c
variable:
  v: u5d
variable:
  v: o5d
variable:
  v: obs

v: reqCreate

context:
  v: summ

context:
  v: e
context type:
  v: variable
element:
  v: request
variable:
  v: req

context:
  v: req
context type:
  v: variable
element:
  v: method
transform:
  v: copy
parameter:
  value: String
    v: POST

context:
  v: req
context type:
  v: variable
element:
  v: url
transform:
  v: copy
parameter:
  value: String
    v: Observation

v: diseasesPage

v: item

v: summ

v: linkId = 'cholera-summary'

v: u5c

context:
  v: diseasesPage
element:
  v: item
variable:
  v: u5c
condition:
  v: linkId = 'cholera-cases-under-5'

name:
  v: o5c
source:
  context:
    v: diseasesPage
  element:
    v: item
  variable:
    v: o5c
  condition:
    v: linkId = 'cholera-cases-over-5'
rule:
  name:
    v: u5d
  source:
    context:
      v: diseasesPage
    element:
      v: item
    variable:
      v: u5d
    condition:
      v: linkId = 'cholera-deaths-under-5'
  rule:
    name:
      v: o5d
    source:
      context:
        v: diseasesPage
      element:
        v: item
      variable:
        v: o5d
      condition:
        v: linkId = 'cholera-deaths-over-5'
    rule:
      name:
        v: choleraObs

v: summ

v: answer

v: first

v: ans

v: valueCoding.code = 'yes'

v: bundle

v: variable

v: entry

v: e

v: obsCreate

context:
  v: summ

context:
  v: e
context type:
  v: variable
element:
  v: resource
variable:
  v: obs
transform:
  v: create
parameter:
  value: String
    v: Observation

name:
  v: CreateMoh505DiseaseObs
variable:
  v: summ
variable:
  v: u5c
variable:
  v: o5c
variable:
  v: u5d
variable:
  v: o5d
variable:
  v: obs

v: reqCreate

context:
  v: summ

context:
  v: e
context type:
  v: variable
element:
  v: request
variable:
  v: req

context:
  v: req
context type:
  v: variable
element:
  v: method
transform:
  v: copy
parameter:
  value: String
    v: POST

context:
  v: req
context type:
  v: variable
element:
  v: url
transform:
  v: copy
parameter:
  value: String
    v: Observation

v: diseasesPage

v: item

v: summ

v: linkId = 'chikungunya-summary'

v: u5c

context:
  v: diseasesPage
element:
  v: item
variable:
  v: u5c
condition:
  v: linkId = 'chikungunya-cases-under-5'

name:
  v: o5c
source:
  context:
    v: diseasesPage
  element:
    v: item
  variable:
    v: o5c
  condition:
    v: linkId = 'chikungunya-cases-over-5'
rule:
  name:
    v: u5d
  source:
    context:
      v: diseasesPage
    element:
      v: item
    variable:
      v: u5d
    condition:
      v: linkId = 'chikungunya-deaths-under-5'
  rule:
    name:
      v: o5d
    source:
      context:
        v: diseasesPage
      element:
        v: item
      variable:
        v: o5d
      condition:
        v: linkId = 'chikungunya-deaths-over-5'
    rule:
      name:
        v: chikungunyaObs

v: summ

v: answer

v: first

v: ans

v: valueCoding.code = 'yes'

v: bundle

v: variable

v: entry

v: e

v: obsCreate

context:
  v: summ

context:
  v: e
context type:
  v: variable
element:
  v: resource
variable:
  v: obs
transform:
  v: create
parameter:
  value: String
    v: Observation

name:
  v: CreateMoh505DiseaseObs
variable:
  v: summ
variable:
  v: u5c
variable:
  v: o5c
variable:
  v: u5d
variable:
  v: o5d
variable:
  v: obs

v: reqCreate

context:
  v: summ

context:
  v: e
context type:
  v: variable
element:
  v: request
variable:
  v: req

context:
  v: req
context type:
  v: variable
element:
  v: method
transform:
  v: copy
parameter:
  value: String
    v: POST

context:
  v: req
context type:
  v: variable
element:
  v: url
transform:
  v: copy
parameter:
  value: String
    v: Observation

v: diseasesPage

v: item

v: summ

v: linkId = 'covid--19-summary'

v: u5c

context:
  v: diseasesPage
element:
  v: item
variable:
  v: u5c
condition:
  v: linkId = 'covid-19-cases-under-5'

name:
  v: o5c
source:
  context:
    v: diseasesPage
  element:
    v: item
  variable:
    v: o5c
  condition:
    v: linkId = 'covid-19-cases-over-5'
rule:
  name:
    v: u5d
  source:
    context:
      v: diseasesPage
    element:
      v: item
    variable:
      v: u5d
    condition:
      v: linkId = 'covid-19-deaths-under-5'
  rule:
    name:
      v: o5d
    source:
      context:
        v: diseasesPage
      element:
        v: item
      variable:
        v: o5d
      condition:
        v: linkId = 'covid-19-deaths-over-5'
    rule:
      name:
        v: covidObs

v: summ

v: answer

v: first

v: ans

v: valueCoding.code = 'yes'

v: bundle

v: variable

v: entry

v: e

v: obsCreate

context:
  v: summ

context:
  v: e
context type:
  v: variable
element:
  v: resource
variable:
  v: obs
transform:
  v: create
parameter:
  value: String
    v: Observation

name:
  v: CreateMoh505DiseaseObs
variable:
  v: summ
variable:
  v: u5c
variable:
  v: o5c
variable:
  v: u5d
variable:
  v: o5d
variable:
  v: obs

v: reqCreate

context:
  v: summ

context:
  v: e
context type:
  v: variable
element:
  v: request
variable:
  v: req

context:
  v: req
context type:
  v: variable
element:
  v: method
transform:
  v: copy
parameter:
  value: String
    v: POST

context:
  v: req
context type:
  v: variable
element:
  v: url
transform:
  v: copy
parameter:
  value: String
    v: Observation

name:
  v: dengue
source:
  context:
    v: diseasesPage
  element:
    v: item
  variable:
    v: summ
  condition:
    v: linkId = 'dengue-summary'
rule:
  name:
    v: u5c
  source:
    context:
      v: diseasesPage
    element:
      v: item
    variable:
      v: u5c
    condition:
      v: linkId = 'dengue-cases-under-5'
  rule:
    name:
      v: o5c
    source:
      context:
        v: diseasesPage
      element:
        v: item
      variable:
        v: o5c
      condition:
        v: linkId = 'dengue-cases-over-5'
    rule:
      name:
        v: u5d

v: diseasesPage

v: item

v: u5d

v: linkId = 'dengue-deaths-under-5'

v: o5d

context:
  v: diseasesPage
element:
  v: item
variable:
  v: o5d
condition:
  v: linkId = 'dengue-deaths-over-5'

name:
  v: dengueObs
source:
  context:
    v: summ
  element:
    v: answer
  list mode:
    v: first
  variable:
    v: ans
  condition:
    v: valueCoding.code = 'yes'
target:
  context:
    v: bundle
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: e
rule:
  name:
    v: obsCreate
  source:
    context:
      v: summ
  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: CreateMoh505DiseaseObs
    variable:
      v: summ
    variable:
      v: u5c
    variable:
      v: o5c
    variable:
      v: u5d
    variable:
      v: o5d
    variable:
      v: obs
rule:
  name:
    v: reqCreate
  source:
    context:
      v: summ
  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: Observation

name:
  v: dysenteryBacillary
source:
  context:
    v: diseasesPage
  element:
    v: item
  variable:
    v: summ
  condition:
    v: linkId = 'dysentery-bacillary-summary'
rule:
  name:
    v: u5c
  source:
    context:
      v: diseasesPage
    element:
      v: item
    variable:
      v: u5c
    condition:
      v: linkId = 'dysentery-bacillary-cases-under-5'
  rule:
    name:
      v: o5c
    source:
      context:
        v: diseasesPage
      element:
        v: item
      variable:
        v: o5c
      condition:
        v: linkId = 'dysentery-bacillary-cases-over-5'
    rule:
      name:
        v: u5d

v: diseasesPage

v: item

v: u5d

v: linkId = 'dysentery-bacillary-deaths-under-5'

v: o5d

context:
  v: diseasesPage
element:
  v: item
variable:
  v: o5d
condition:
  v: linkId = 'dysentery-bacillary-deaths-over-5'

name:
  v: dysenteryObs
source:
  context:
    v: summ
  element:
    v: answer
  list mode:
    v: first
  variable:
    v: ans
  condition:
    v: valueCoding.code = 'yes'
target:
  context:
    v: bundle
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: e
rule:
  name:
    v: obsCreate
  source:
    context:
      v: summ
  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: CreateMoh505DiseaseObs
    variable:
      v: summ
    variable:
      v: u5c
    variable:
      v: o5c
    variable:
      v: u5d
    variable:
      v: o5d
    variable:
      v: obs
rule:
  name:
    v: reqCreate
  source:
    context:
      v: summ
  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: Observation

name:
  v: guineaWorm
source:
  context:
    v: diseasesPage
  element:
    v: item
  variable:
    v: summ
  condition:
    v: linkId = 'guinea-worm-disease-summary'
rule:
  name:
    v: u5c
  source:
    context:
      v: diseasesPage
    element:
      v: item
    variable:
      v: u5c
    condition:
      v: linkId = 'guinea-worm-disease-cases-under-5'
  rule:
    name:
      v: o5c
    source:
      context:
        v: diseasesPage
      element:
        v: item
      variable:
        v: o5c
      condition:
        v: linkId = 'guinea-worm-disease-cases-over-5'
    rule:
      name:
        v: u5d

v: diseasesPage

v: item

v: u5d

v: linkId = 'guinea-worm-disease-deaths-under-5'

v: o5d

context:
  v: diseasesPage
element:
  v: item
variable:
  v: o5d
condition:
  v: linkId = 'guinea-worm-disease-deaths-over-5'

name:
  v: gwObs
source:
  context:
    v: summ
  element:
    v: answer
  list mode:
    v: first
  variable:
    v: ans
  condition:
    v: valueCoding.code = 'yes'
target:
  context:
    v: bundle
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: e
rule:
  name:
    v: obsCreate
  source:
    context:
      v: summ
  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: CreateMoh505DiseaseObs
    variable:
      v: summ
    variable:
      v: u5c
    variable:
      v: o5c
    variable:
      v: u5d
    variable:
      v: o5d
    variable:
      v: obs
rule:
  name:
    v: reqCreate
  source:
    context:
      v: summ
  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: Observation

name:
  v: measles
source:
  context:
    v: diseasesPage
  element:
    v: item
  variable:
    v: summ
  condition:
    v: linkId = 'measles-summary'
rule:
  name:
    v: u5c
  source:
    context:
      v: diseasesPage
    element:
      v: item
    variable:
      v: u5c
    condition:
      v: linkId = 'measles-cases-under-5'
  rule:
    name:
      v: o5c
    source:
      context:
        v: diseasesPage
      element:
        v: item
      variable:
        v: o5c
      condition:
        v: linkId = 'measles-cases-over-5'
    rule:
      name:
        v: u5d

v: diseasesPage

v: item

v: u5d

v: linkId = 'measles-deaths-under-5'

v: o5d

context:
  v: diseasesPage
element:
  v: item
variable:
  v: o5d
condition:
  v: linkId = 'measles-deaths-over-5'

name:
  v: measlesObs
source:
  context:
    v: summ
  element:
    v: answer
  list mode:
    v: first
  variable:
    v: ans
  condition:
    v: valueCoding.code = 'yes'
target:
  context:
    v: bundle
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: e
rule:
  name:
    v: obsCreate
  source:
    context:
      v: summ
  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: CreateMoh505DiseaseObs
    variable:
      v: summ
    variable:
      v: u5c
    variable:
      v: o5c
    variable:
      v: u5d
    variable:
      v: o5d
    variable:
      v: obs
rule:
  name:
    v: reqCreate
  source:
    context:
      v: summ
  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: Observation

name:
  v: suspectedMalaria
source:
  context:
    v: diseasesPage
  element:
    v: item
  variable:
    v: summ
  condition:
    v: linkId = 'suspected-malaria-summary'
rule:
  name:
    v: u5c
  source:
    context:
      v: diseasesPage
    element:
      v: item
    variable:
      v: u5c
    condition:
      v: linkId = 'suspected-malaria-cases-under-5'
  rule:
    name:
      v: o5c
    source:
      context:
        v: diseasesPage
      element:
        v: item
      variable:
        v: o5c
      condition:
        v: linkId = 'suspected-malaria-cases-over-5'
    rule:
      name:
        v: u5d

v: diseasesPage

v: item

v: u5d

v: linkId = 'suspected-malaria-deaths-under-5'

v: o5d

context:
  v: diseasesPage
element:
  v: item
variable:
  v: o5d
condition:
  v: linkId = 'suspected-malaria-deaths-over-5'

name:
  v: malariaObs
source:
  context:
    v: summ
  element:
    v: answer
  list mode:
    v: first
  variable:
    v: ans
  condition:
    v: valueCoding.code = 'yes'
target:
  context:
    v: bundle
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: e
rule:
  name:
    v: obsCreate
  source:
    context:
      v: summ
  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: CreateMoh505DiseaseObs
    variable:
      v: summ
    variable:
      v: u5c
    variable:
      v: o5c
    variable:
      v: u5d
    variable:
      v: o5d
    variable:
      v: obs
rule:
  name:
    v: reqCreate
  source:
    context:
      v: summ
  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: Observation

name:
  v: vhf
source:
  context:
    v: diseasesPage
  element:
    v: item
  variable:
    v: summ
  condition:
    v: linkId = 'vhf-summary'
rule:
  name:
    v: u5c
  source:
    context:
      v: diseasesPage
    element:
      v: item
    variable:
      v: u5c
    condition:
      v: linkId = 'vhf-cases-under-5'
  rule:
    name:
      v: o5c
    source:
      context:
        v: diseasesPage
      element:
        v: item
      variable:
        v: o5c
      condition:
        v: linkId = 'vhf-cases-over-5'
    rule:
      name:
        v: u5d

v: diseasesPage

v: item

v: u5d

v: linkId = 'vhf-deaths-under-5'

v: o5d

context:
  v: diseasesPage
element:
  v: item
variable:
  v: o5d
condition:
  v: linkId = 'vhf-deaths-over-5'

name:
  v: vhfObs
source:
  context:
    v: summ
  element:
    v: answer
  list mode:
    v: first
  variable:
    v: ans
  condition:
    v: valueCoding.code = 'yes'
target:
  context:
    v: bundle
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: e
rule:
  name:
    v: obsCreate
  source:
    context:
      v: summ
  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: CreateMoh505DiseaseObs
    variable:
      v: summ
    variable:
      v: u5c
    variable:
      v: o5c
    variable:
      v: u5d
    variable:
      v: o5d
    variable:
      v: obs
rule:
  name:
    v: reqCreate
  source:
    context:
      v: summ
  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: Observation

name:
  v: yellowFever
source:
  context:
    v: diseasesPage
  element:
    v: item
  variable:
    v: summ
  condition:
    v: linkId = 'yellow-fever-summary'
rule:
  name:
    v: u5c
  source:
    context:
      v: diseasesPage
    element:
      v: item
    variable:
      v: u5c
    condition:
      v: linkId = 'yellow-fever-cases-under-5'
  rule:
    name:
      v: o5c
    source:
      context:
        v: diseasesPage
      element:
        v: item
      variable:
        v: o5c
      condition:
        v: linkId = 'yellow-fever-cases-over-5'
    rule:
      name:
        v: u5d

v: diseasesPage

v: item

v: u5d

v: linkId = 'yellow-fever-deaths-under-5'

v: o5d

context:
  v: diseasesPage
element:
  v: item
variable:
  v: o5d
condition:
  v: linkId = 'yellow-fever-deaths-over-5'

name:
  v: yfObs
source:
  context:
    v: summ
  element:
    v: answer
  list mode:
    v: first
  variable:
    v: ans
  condition:
    v: valueCoding.code = 'yes'
target:
  context:
    v: bundle
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: e
rule:
  name:
    v: obsCreate
  source:
    context:
      v: summ
  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: CreateMoh505DiseaseObs
    variable:
      v: summ
    variable:
      v: u5c
    variable:
      v: o5c
    variable:
      v: u5d
    variable:
      v: o5d
    variable:
      v: obs
rule:
  name:
    v: reqCreate
  source:
    context:
      v: summ
  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: Observation

name:
  v: typhoid
source:
  context:
    v: diseasesPage
  element:
    v: item
  variable:
    v: summ
  condition:
    v: linkId = 'typhoid-summary'
rule:
  name:
    v: u5c
  source:
    context:
      v: diseasesPage
    element:
      v: item
    variable:
      v: u5c
    condition:
      v: linkId = 'typhoid-cases-under-5'
  rule:
    name:
      v: o5c
    source:
      context:
        v: diseasesPage
      element:
        v: item
      variable:
        v: o5c
      condition:
        v: linkId = 'typhoid-cases-over-5'
    rule:
      name:
        v: u5d

v: diseasesPage

v: item

v: u5d

v: linkId = 'typhoid-deaths-under-5'

v: o5d

context:
  v: diseasesPage
element:
  v: item
variable:
  v: o5d
condition:
  v: linkId = 'typhoid-deaths-over-5'

name:
  v: typhoidObs
source:
  context:
    v: summ
  element:
    v: answer
  list mode:
    v: first
  variable:
    v: ans
  condition:
    v: valueCoding.code = 'yes'
target:
  context:
    v: bundle
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: e
rule:
  name:
    v: obsCreate
  source:
    context:
      v: summ
  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: CreateMoh505DiseaseObs
    variable:
      v: summ
    variable:
      v: u5c
    variable:
      v: o5c
    variable:
      v: u5d
    variable:
      v: o5d
    variable:
      v: obs
rule:
  name:
    v: reqCreate
  source:
    context:
      v: summ
  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: Observation

name:
  v: riftValleyFever
source:
  context:
    v: diseasesPage
  element:
    v: item
  variable:
    v: summ
  condition:
    v: linkId = 'rift-valley-fever-summary'
rule:
  name:
    v: u5c
  source:
    context:
      v: diseasesPage
    element:
      v: item
    variable:
      v: u5c
    condition:
      v: linkId = 'rift-valley-fever-cases-under-5'
  rule:
    name:
      v: o5c
    source:
      context:
        v: diseasesPage
      element:
        v: item
      variable:
        v: o5c
      condition:
        v: linkId = 'rift-valley-fever-cases-over-5'
    rule:
      name:
        v: u5d

v: diseasesPage

v: item

v: u5d

v: linkId = 'rift-valley-fever-deaths-under-5'

v: o5d

context:
  v: diseasesPage
element:
  v: item
variable:
  v: o5d
condition:
  v: linkId = 'rift-valley-fever-deaths-over-5'

name:
  v: rvfObs
source:
  context:
    v: summ
  element:
    v: answer
  list mode:
    v: first
  variable:
    v: ans
  condition:
    v: valueCoding.code = 'yes'
target:
  context:
    v: bundle
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: e
rule:
  name:
    v: obsCreate
  source:
    context:
      v: summ
  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: CreateMoh505DiseaseObs
    variable:
      v: summ
    variable:
      v: u5c
    variable:
      v: o5c
    variable:
      v: u5d
    variable:
      v: o5d
    variable:
      v: obs
rule:
  name:
    v: reqCreate
  source:
    context:
      v: summ
  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: Observation

name:
  v: zikaVirus
source:
  context:
    v: diseasesPage
  element:
    v: item
  variable:
    v: summ
  condition:
    v: linkId = 'zika-virus-summary'
rule:
  name:
    v: u5c
  source:
    context:
      v: diseasesPage
    element:
      v: item
    variable:
      v: u5c
    condition:
      v: linkId = 'zika-virus-cases-under-5'
  rule:
    name:
      v: o5c
    source:
      context:
        v: diseasesPage
      element:
        v: item
      variable:
        v: o5c
      condition:
        v: linkId = 'zika-virus-cases-over-5'
    rule:
      name:
        v: u5d

v: diseasesPage

v: item

v: u5d

v: linkId = 'zika-virus-deaths-under-5'

v: o5d

context:
  v: diseasesPage
element:
  v: item
variable:
  v: o5d
condition:
  v: linkId = 'zika-virus-deaths-over-5'

name:
  v: zikaObs
source:
  context:
    v: summ
  element:
    v: answer
  list mode:
    v: first
  variable:
    v: ans
  condition:
    v: valueCoding.code = 'yes'
target:
  context:
    v: bundle
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: e
rule:
  name:
    v: obsCreate
  source:
    context:
      v: summ
  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: CreateMoh505DiseaseObs
    variable:
      v: summ
    variable:
      v: u5c
    variable:
      v: o5c
    variable:
      v: u5d
    variable:
      v: o5d
    variable:
      v: obs
rule:
  name:
    v: reqCreate
  source:
    context:
      v: summ
  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: Observation

name:
  v: deathsDueToMalaria
source:
  context:
    v: diseasesPage
  element:
    v: item
  variable:
    v: summ
  condition:
    v: linkId = 'deaths-due-to-malaria-summary'
rule:
  name:
    v: u5c
  source:
    context:
      v: diseasesPage
    element:
      v: item
    variable:
      v: u5c
    condition:
      v: linkId = 'deaths-due-to-malaria-cases-under-5'
  rule:
    name:
      v: o5c
    source:
      context:
        v: diseasesPage
      element:
        v: item
      variable:
        v: o5c
      condition:
        v: linkId = 'deaths-due-to-malaria-cases-over-5'
    rule:
      name:
        v: u5d

v: diseasesPage

v: item

v: u5d

v: linkId = 'deaths-due-to-malaria-deaths-under-5'

v: o5d

context:
  v: diseasesPage
element:
  v: item
variable:
  v: o5d
condition:
  v: linkId = 'deaths-due-to-malaria-deaths-over-5'

name:
  v: malDeathObs
source:
  context:
    v: summ
  element:
    v: answer
  list mode:
    v: first
  variable:
    v: ans
  condition:
    v: valueCoding.code = 'yes'
target:
  context:
    v: bundle
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: e
rule:
  name:
    v: obsCreate
  source:
    context:
      v: summ
  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: CreateMoh505DiseaseObs
    variable:
      v: summ
    variable:
      v: u5c
    variable:
      v: o5c
    variable:
      v: u5d
    variable:
      v: o5d
    variable:
      v: obs
rule:
  name:
    v: reqCreate
  source:
    context:
      v: summ
  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: Observation

name:
  v: labPage
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: labPage
  condition:
    v: linkId = '3067992989898'
rule:
  name:
    v: u5Tested
  source:
    context:
      v: labPage
    element:
      v: item
    variable:
      v: u5Tested
    condition:
      v: linkId = 'malaria-tested-under-5'
  rule:
    name:
      v: o5Tested
    source:
      context:
        v: labPage
      element:
        v: item
      variable:
        v: o5Tested
      condition:
        v: linkId = 'malaria-tested-over-5'
    rule:
      name:
        v: u5Pos

v: labPage

v: item

v: u5Pos

v: linkId = 'malaria-positive-under-5'

v: o5Pos

context:
  v: labPage
element:
  v: item
variable:
  v: o5Pos
condition:
  v: linkId = 'malaria-positive-over-5'

name:
  v: malariaLabObs
source:
  context:
    v: src
target:
  context:
    v: bundle
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: e
rule:
  name:
    v: malariaLabCreate
  source:
    context:
      v: src
  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: MapMalariaLabObs
    variable:
      v: u5Tested
    variable:
      v: o5Tested
    variable:
      v: u5Pos
    variable:
      v: o5Pos
    variable:
      v: obs
rule:
  name:
    v: malariaLabReq
  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: Observation

name:
  v: MapMoh505Encounter
type mode:
  v: none
documentation:
  v: Helper group: create Encounter from Moh505 Reporting Site page
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: clsDisplay
    source:
      context:
        v: src
    target:
      context:
        v: cls
      context type:
        v: variable
      element:
        v: display
      transform:
        v: copy
      parameter:
        value: String
rule:
  name:
    v: type
  source:
    context:
      v: src
  target:
    context:
      v: encounter
    context type:
      v: variable
    element:
      v: type
    variable:
      v: type
  rule:
    name:
      v: typeCoding
    source:
      context:
        v: src
    target:
      context:
        v: type
      context type:
        v: variable
      element:
        v: coding
      variable:
        v: cod
    rule:
      name:
        v: typeSys
    rule:
      name:
        v: typeCode
    rule:
      name:
        v: typeDisplay
rule:
  name:
    v: reportSite
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: reportSite
    condition:
      v: linkId = '151479012557'
  rule:
    name:
      v: facilityLevelLocation
    source:
      context:
        v: reportSite
      element:
        v: item
      variable:
        v: item
      condition:
        v: linkId = '819946803677'
    rule:
      name:
        v: facilityLocation

String
v: VR

String
v: virtual

v: src

v: cod

v: variable

v: system

v: copy

v: src

v: cod

v: variable

v: code

v: copy

value: String
  v: weekly-surveillance-report

v: src

v: cod

v: variable

v: display

v: copy

value: String
  v: MOH 505 Weekly Surveillance Report

v: item

v: answer

v: first

v: ans

v: encounter

v: variable

v: location

v: loc

v: loc

v: variable

v: location

v: locRef

v: locRef

v: variable

v: reference

v: evaluate

value: String
  v: 'Location/' + ans.valueReference.reference

name:
  v: CreateMoh505DiseaseObs
type mode:
  v: none
documentation:
  v: Helper group: create a disease weekly count Observation (all 4 age/outcome components)
input:
  name:
    v: summaryItem
  type:
    v: BackboneElement
  mode:
    v: source
input:
  name:
    v: u5CasesItem
  type:
    v: BackboneElement
  mode:
    v: source
input:
  name:
    v: o5CasesItem
  type:
    v: BackboneElement
  mode:
    v: source
input:
  name:
    v: u5DeathsItem
  type:
    v: BackboneElement
  mode:
    v: source
input:
  name:
    v: o5DeathsItem
  type:
    v: BackboneElement
  mode:
    v: source
input:
  name:
    v: obs
  type:
    v: Observation
  mode:
    v: target
rule:
  name:
    v: obsId
  source:
    context:
      v: summaryItem
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: id
    transform:
      v: uuid
rule:
  name:
    v: status
  source:
    context:
      v: summaryItem
  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: summaryItem
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: category
    variable:
      v: cat
  rule:
    name:
      v: catCod
    source:
      context:
        v: summaryItem
    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
rule:
  name:
    v: diseaseCode
  source:
    context:
      v: summaryItem
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: code
    variable:
      v: code
  rule:
    name:
      v: codeCoding
    source:
      context:
        v: summaryItem
    target:
      context:
        v: code
      context type:
        v: variable
      element:
        v: coding
      variable:
        v: cod
    rule:
      name:
        v: codeSys
    rule:
      name:
        v: codeCode
    rule:
      name:
        v: codeDisplay
  rule:
    name:
      v: codeText
    source:
      context:
        v: summaryItem
    target:
      context:
        v: code
      context type:
        v: variable
      element:
        v: text
      transform:
        v: evaluate
      parameter:
        value: String
rule:
  name:
    v: u5CasesComp
  source:
    context:
      v: u5CasesItem
    element:
      v: answer
    list mode:
      v: first
    variable:
      v: ans

String
v: survey

v: summaryItem

v: cod

v: variable

v: system

v: copy

v: summaryItem

v: cod

v: variable

v: code

v: evaluate

value: String
  v: summaryItem.linkId.replace('-summary', '')

v: summaryItem

v: cod

v: variable

v: display

v: evaluate

value: String
  v: summaryItem.text

String
v: summaryItem.text

context:
  v: obs
context type:
  v: variable
element:
  v: component
variable:
  v: comp

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

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: 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: 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: MapMalariaLabObs
type mode:
  v: none
documentation:
  v: Helper group: create Malaria Lab Surveillance Observation
input:
  name:
    v: u5TestedItem
  type:
    v: BackboneElement
  mode:
    v: source
input:
  name:
    v: o5TestedItem
  type:
    v: BackboneElement
  mode:
    v: source
input:
  name:
    v: u5PosItem
  type:
    v: BackboneElement
  mode:
    v: source
input:
  name:
    v: o5PosItem
  type:
    v: BackboneElement
  mode:
    v: source
input:
  name:
    v: obs
  type:
    v: Observation
  mode:
    v: target
rule:
  name:
    v: obsId
  source:
    context:
      v: u5TestedItem
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: id
    transform:
      v: uuid
rule:
  name:
    v: status
  source:
    context:
      v: u5TestedItem
  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: u5TestedItem
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: category
    variable:
      v: cat
  rule:
    name:
      v: catCod
    source:
      context:
        v: u5TestedItem
    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
rule:
  name:
    v: labCode
  source:
    context:
      v: u5TestedItem
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: code
    variable:
      v: code
  rule:
    name:
      v: codeCoding
    source:
      context:
        v: u5TestedItem
    target:
      context:
        v: code
      context type:
        v: variable
      element:
        v: coding
      variable:
        v: cod
    rule:
      name:
        v: loincSys
    rule:
      name:
        v: loincCode
    rule:
      name:
        v: loincDisplay
  rule:
    name:
      v: codeText
    source:
      context:
        v: u5TestedItem
    target:
      context:
        v: code
      context type:
        v: variable
      element:
        v: text
      transform:
        v: copy
      parameter:
        value: String
rule:
  name:
    v: u5TestedComp
  source:
    context:
      v: u5TestedItem
    element:
      v: answer
    list mode:
      v: first
    variable:
      v: ans
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: component
    variable:
      v: comp

String
v: laboratory

v: u5TestedItem

v: cod

v: variable

v: system

v: copy

v: u5TestedItem

v: cod

v: variable

v: code

v: copy

value: String
  v: 32700-7

v: u5TestedItem

v: cod

v: variable

v: display

v: copy

value: String
  v: Microscopy panel - Blood by Malaria smear

String
v: Malaria Microscopy Results

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: Malaria Microscopy Tested Under 5

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: o5TestedComp
source:
  context:
    v: o5TestedItem
  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: Malaria Microscopy Tested Over 5
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: u5PosComp
source:
  context:
    v: u5PosItem
  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: Malaria Microscopy Positive Under 5
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: o5PosComp
source:
  context:
    v: o5PosItem
  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: Malaria Microscopy Positive Over 5
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