# ExtractVitalSigns - SGHI FHIR Profile Implementation Guide v0.1.0

* [**Table of Contents**](toc.md)
* [**Artifacts Summary**](artifacts.md)
* **ExtractVitalSigns**

## StructureMap: ExtractVitalSigns 

| | |
| :--- | :--- |
| *Official URL*:https://fhir.slade360.co.ke/fhir/StructureMap/ExtractVitalSigns | *Version*:0.1.0 |
| Draft as of 2026-05-21 | *Computable Name*:ExtractVitalSigns |



## Resource Content

```json
{
  "resourceType" : "StructureMap",
  "id" : "ExtractVitalSigns",
  "url" : "https://fhir.slade360.co.ke/fhir/StructureMap/ExtractVitalSigns",
  "version" : "0.1.0",
  "name" : "ExtractVitalSigns",
  "status" : "draft",
  "date" : "2026-05-21T09:38:13+00:00",
  "publisher" : "Kathurima Kimathi",
  "contact" : [{
    "name" : "Kathurima Kimathi",
    "telecom" : [{
      "system" : "url",
      "value" : "https://www.linkedin.com/in/kathurima-kimathi/"
    },
    {
      "system" : "email",
      "value" : "kathurimakimathi415@gmail.com"
    }]
  },
  {
    "name" : "Oscar John",
    "telecom" : [{
      "system" : "email",
      "value" : "oscarjohnotieno@gmail.com",
      "use" : "work"
    }]
  },
  {
    "name" : "Kennedy Omondi",
    "telecom" : [{
      "system" : "email",
      "value" : "kennankole@gmail.com",
      "use" : "work"
    }]
  }],
  "structure" : [{
    "url" : "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse",
    "mode" : "source",
    "alias" : "QR"
  },
  {
    "url" : "http://hl7.org/fhir/StructureDefinition/Bundle",
    "mode" : "target",
    "alias" : "Bundle"
  },
  {
    "url" : "http://hl7.org/fhir/StructureDefinition/Observation",
    "mode" : "target",
    "alias" : "Observation"
  }],
  "group" : [{
    "name" : "ExtractVitalSigns",
    "input" : [{
      "name" : "qr",
      "type" : "QR",
      "mode" : "source"
    },
    {
      "name" : "bundle",
      "type" : "Bundle",
      "mode" : "target"
    }],
    "rule" : [{
      "name" : "setBundleType",
      "source" : [{
        "context" : "qr"
      }],
      "target" : [{
        "context" : "bundle",
        "element" : "type",
        "transform" : "copy",
        "parameter" : [{
          "valueString" : "transaction"
        }]
      }]
    },
    {
      "name" : "heightRule",
      "source" : [{
        "context" : "qr",
        "element" : "item",
        "variable" : "itH",
        "condition" : "(linkId = '8302-2')"
      }],
      "rule" : [{
        "name" : "heightAns",
        "source" : [{
          "context" : "itH",
          "element" : "answer",
          "listMode" : "first",
          "variable" : "aH"
        }],
        "rule" : [{
          "name" : "heightObs",
          "source" : [{
            "context" : "aH"
          }],
          "target" : [{
            "context" : "bundle",
            "element" : "entry",
            "variable" : "eH"
          },
          {
            "context" : "eH",
            "element" : "resource",
            "variable" : "oH",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "Observation"
            }]
          }],
          "rule" : [{
            "name" : "heightBase",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "oH"
              }]
            },
            {
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "eH"
              }]
            }],
            "dependent" : [{
              "name" : "BuildBaseObs",
              "parameter" : [{
                "valueId" : "qr"
              },
              {
                "valueId" : "oH"
              },
              {
                "valueId" : "eH"
              }]
            }]
          },
          {
            "name" : "categoryH",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oH",
              "element" : "category",
              "variable" : "catH"
            }],
            "rule" : [{
              "name" : "catHCodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "catH",
                "element" : "coding",
                "variable" : "catHCoding"
              }],
              "rule" : [{
                "name" : "catHSys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catHCoding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                  }]
                }]
              },
              {
                "name" : "catHCode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catHCoding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "vital-signs"
                  }]
                }]
              },
              {
                "name" : "catHDisplay",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catHCoding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "Vital Signs"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "codeH",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oH",
              "element" : "code",
              "variable" : "codeH"
            }],
            "rule" : [{
              "name" : "codeHCodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "codeH",
                "element" : "coding",
                "variable" : "codeHCoding"
              }],
              "rule" : [{
                "name" : "codeHSys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeHCoding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://loinc.org"
                  }]
                }]
              },
              {
                "name" : "codeHCode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeHCoding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "8302-2"
                  }]
                }]
              },
              {
                "name" : "codeHDisplay",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeHCoding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "Body Height"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "valH",
            "source" : [{
              "context" : "aH",
              "element" : "value",
              "variable" : "hv"
            }],
            "target" : [{
              "context" : "oH",
              "element" : "valueQuantity",
              "variable" : "vH"
            }],
            "rule" : [{
              "name" : "setVal",
              "source" : [{
                "context" : "hv"
              }],
              "target" : [{
                "context" : "vH",
                "element" : "value",
                "transform" : "copy",
                "parameter" : [{
                  "valueId" : "hv"
                }]
              }]
            },
            {
              "name" : "setSys",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "vH",
                "element" : "system",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "http://unitsofmeasure.org"
                }]
              }]
            },
            {
              "name" : "setCode",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "vH",
                "element" : "code",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "cm"
                }]
              }]
            },
            {
              "name" : "setUnit",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "vH",
                "element" : "unit",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "centimeter"
                }]
              }]
            }]
          }]
        }]
      }],
      "documentation" : "Height"
    },
    {
      "name" : "weightRule",
      "source" : [{
        "context" : "qr",
        "element" : "item",
        "variable" : "itW",
        "condition" : "(linkId = '29463-7')"
      }],
      "rule" : [{
        "name" : "weightAns",
        "source" : [{
          "context" : "itW",
          "element" : "answer",
          "listMode" : "first",
          "variable" : "aW"
        }],
        "rule" : [{
          "name" : "weightObs",
          "source" : [{
            "context" : "aW"
          }],
          "target" : [{
            "context" : "bundle",
            "element" : "entry",
            "variable" : "eW"
          },
          {
            "context" : "eW",
            "element" : "resource",
            "variable" : "oW",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "Observation"
            }]
          }],
          "rule" : [{
            "name" : "weightBase",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "oW"
              }]
            },
            {
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "eW"
              }]
            }],
            "dependent" : [{
              "name" : "BuildBaseObs",
              "parameter" : [{
                "valueId" : "qr"
              },
              {
                "valueId" : "oW"
              },
              {
                "valueId" : "eW"
              }]
            }]
          },
          {
            "name" : "categoryW",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oW",
              "element" : "category",
              "variable" : "catW"
            }],
            "rule" : [{
              "name" : "catWCodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "catW",
                "element" : "coding",
                "variable" : "catWCoding"
              }],
              "rule" : [{
                "name" : "catWSys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catWCoding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                  }]
                }]
              },
              {
                "name" : "catWCode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catWCoding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "vital-signs"
                  }]
                }]
              },
              {
                "name" : "catWDisplay",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catWCoding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "Vital Signs"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "codeW",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oW",
              "element" : "code",
              "variable" : "codeW"
            }],
            "rule" : [{
              "name" : "codeWCodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "codeW",
                "element" : "coding",
                "variable" : "codeWCoding"
              }],
              "rule" : [{
                "name" : "codeWSys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeWCoding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://loinc.org"
                  }]
                }]
              },
              {
                "name" : "codeWCode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeWCoding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "29463-7"
                  }]
                }]
              },
              {
                "name" : "codeWDisplay",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeWCoding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "Body Weight"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "valW",
            "source" : [{
              "context" : "aW",
              "element" : "value",
              "variable" : "hv"
            }],
            "target" : [{
              "context" : "oW",
              "element" : "valueQuantity",
              "variable" : "vW"
            }],
            "rule" : [{
              "name" : "setVal",
              "source" : [{
                "context" : "hv"
              }],
              "target" : [{
                "context" : "vW",
                "element" : "value",
                "transform" : "copy",
                "parameter" : [{
                  "valueId" : "hv"
                }]
              }]
            },
            {
              "name" : "setSys",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "vW",
                "element" : "system",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "http://unitsofmeasure.org"
                }]
              }]
            },
            {
              "name" : "setCode",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "vW",
                "element" : "code",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "kg"
                }]
              }]
            },
            {
              "name" : "setUnit",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "vW",
                "element" : "unit",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "kilogram"
                }]
              }]
            }]
          }]
        }]
      }],
      "documentation" : "Weight"
    },
    {
      "name" : "bmiRule",
      "source" : [{
        "context" : "qr",
        "element" : "item",
        "variable" : "itBmi",
        "condition" : "(linkId = '39156-5')"
      }],
      "rule" : [{
        "name" : "bmiAns",
        "source" : [{
          "context" : "itBmi",
          "element" : "answer",
          "listMode" : "first",
          "variable" : "aBmi"
        }],
        "rule" : [{
          "name" : "bmiObs",
          "source" : [{
            "context" : "aBmi"
          }],
          "target" : [{
            "context" : "bundle",
            "element" : "entry",
            "variable" : "eBmi"
          },
          {
            "context" : "eBmi",
            "element" : "resource",
            "variable" : "oBmi",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "Observation"
            }]
          }],
          "rule" : [{
            "name" : "bmiBase",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "oBmi"
              }]
            },
            {
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "eBmi"
              }]
            }],
            "dependent" : [{
              "name" : "BuildBaseObs",
              "parameter" : [{
                "valueId" : "qr"
              },
              {
                "valueId" : "oBmi"
              },
              {
                "valueId" : "eBmi"
              }]
            }]
          },
          {
            "name" : "categoryBmi",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oBmi",
              "element" : "category",
              "variable" : "catBmi"
            }],
            "rule" : [{
              "name" : "catBmiCodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "catBmi",
                "element" : "coding",
                "variable" : "catBmiCoding"
              }],
              "rule" : [{
                "name" : "catBmiSys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catBmiCoding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                  }]
                }]
              },
              {
                "name" : "catBmiCode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catBmiCoding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "vital-signs"
                  }]
                }]
              },
              {
                "name" : "catBmiDisplay",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catBmiCoding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "Vital Signs"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "codeBmi",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oBmi",
              "element" : "code",
              "variable" : "codeBmi"
            }],
            "rule" : [{
              "name" : "codeBmiCodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "codeBmi",
                "element" : "coding",
                "variable" : "codeBmiCoding"
              }],
              "rule" : [{
                "name" : "codeBmiSys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeBmiCoding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://loinc.org"
                  }]
                }]
              },
              {
                "name" : "codeBmiCode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeBmiCoding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "39156-5"
                  }]
                }]
              },
              {
                "name" : "codeBmiDisplay",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeBmiCoding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "Body mass index (BMI) [Ratio]"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "valBmi",
            "source" : [{
              "context" : "aBmi",
              "element" : "value",
              "variable" : "hv"
            }],
            "target" : [{
              "context" : "oBmi",
              "element" : "valueQuantity",
              "variable" : "vBmi"
            }],
            "rule" : [{
              "name" : "setVal",
              "source" : [{
                "context" : "hv"
              }],
              "target" : [{
                "context" : "vBmi",
                "element" : "value",
                "transform" : "copy",
                "parameter" : [{
                  "valueId" : "hv"
                }]
              }]
            },
            {
              "name" : "setSys",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "vBmi",
                "element" : "system",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "http://unitsofmeasure.org"
                }]
              }]
            },
            {
              "name" : "setCode",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "vBmi",
                "element" : "code",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "kg/m2"
                }]
              }]
            },
            {
              "name" : "setUnit",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "vBmi",
                "element" : "unit",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "kilogram per square meter"
                }]
              }]
            }]
          },
          {
            "name" : "findBmiStatus",
            "source" : [{
              "context" : "itBmi",
              "element" : "item",
              "variable" : "bmiStatusItem",
              "condition" : "(linkId = '39156-5_status')"
            }],
            "rule" : [{
              "name" : "setInterpBmi",
              "source" : [{
                "context" : "bmiStatusItem",
                "element" : "answer",
                "listMode" : "first",
                "variable" : "bmiStatusAns"
              }],
              "target" : [{
                "context" : "oBmi",
                "element" : "interpretation",
                "variable" : "iBmi"
              }],
              "rule" : [{
                "name" : "interpBmi",
                "source" : [{
                  "context" : "bmiStatusAns",
                  "element" : "value",
                  "variable" : "statusText"
                }],
                "target" : [{
                  "context" : "iBmi",
                  "element" : "text",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueId" : "statusText"
                  }]
                }]
              }]
            }],
            "documentation" : "Interpretation 39156-5_status"
          }]
        }]
      }],
      "documentation" : "BMI"
    },
    {
      "name" : "pulseRule",
      "source" : [{
        "context" : "qr",
        "element" : "item",
        "variable" : "itP",
        "condition" : "(linkId = '8889-8')"
      }],
      "rule" : [{
        "name" : "pulseAns",
        "source" : [{
          "context" : "itP",
          "element" : "answer",
          "listMode" : "first",
          "variable" : "aP"
        }],
        "rule" : [{
          "name" : "pulseObs",
          "source" : [{
            "context" : "aP"
          }],
          "target" : [{
            "context" : "bundle",
            "element" : "entry",
            "variable" : "eP"
          },
          {
            "context" : "eP",
            "element" : "resource",
            "variable" : "oP",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "Observation"
            }]
          }],
          "rule" : [{
            "name" : "pulseBase",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "oP"
              }]
            },
            {
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "eP"
              }]
            }],
            "dependent" : [{
              "name" : "BuildBaseObs",
              "parameter" : [{
                "valueId" : "qr"
              },
              {
                "valueId" : "oP"
              },
              {
                "valueId" : "eP"
              }]
            }]
          },
          {
            "name" : "categoryP",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oP",
              "element" : "category",
              "variable" : "catP"
            }],
            "rule" : [{
              "name" : "catPCodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "catP",
                "element" : "coding",
                "variable" : "catPCoding"
              }],
              "rule" : [{
                "name" : "catPSys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catPCoding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                  }]
                }]
              },
              {
                "name" : "catPCode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catPCoding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "vital-signs"
                  }]
                }]
              },
              {
                "name" : "catPDisplay",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catPCoding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "Vital Signs"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "codeP",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oP",
              "element" : "code",
              "variable" : "codeP"
            }],
            "rule" : [{
              "name" : "codePCodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "codeP",
                "element" : "coding",
                "variable" : "codePCoding"
              }],
              "rule" : [{
                "name" : "codePSys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codePCoding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://loinc.org"
                  }]
                }]
              },
              {
                "name" : "codePCode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codePCoding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "8889-8"
                  }]
                }]
              },
              {
                "name" : "codePDisplay",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codePCoding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "Heart rate by Pulse oximetry"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "valP",
            "source" : [{
              "context" : "aP",
              "element" : "value",
              "variable" : "hv"
            }],
            "target" : [{
              "context" : "oP",
              "element" : "valueQuantity",
              "variable" : "vP"
            }],
            "rule" : [{
              "name" : "setVal",
              "source" : [{
                "context" : "hv"
              }],
              "target" : [{
                "context" : "vP",
                "element" : "value",
                "transform" : "copy",
                "parameter" : [{
                  "valueId" : "hv"
                }]
              }]
            },
            {
              "name" : "setSys",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "vP",
                "element" : "system",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "http://unitsofmeasure.org"
                }]
              }]
            },
            {
              "name" : "setCode",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "vP",
                "element" : "code",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "/min"
                }]
              }]
            },
            {
              "name" : "setUnit",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "vP",
                "element" : "unit",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "per minute"
                }]
              }]
            }]
          }]
        }]
      }],
      "documentation" : "Pulse"
    },
    {
      "name" : "bpRule",
      "source" : [{
        "context" : "qr",
        "element" : "item",
        "variable" : "itBP",
        "condition" : "(linkId = '55284-4')"
      }],
      "rule" : [{
        "name" : "bpObs",
        "source" : [{
          "context" : "qr"
        }],
        "target" : [{
          "context" : "bundle",
          "element" : "entry",
          "variable" : "eBP"
        },
        {
          "context" : "eBP",
          "element" : "resource",
          "variable" : "oBP",
          "transform" : "create",
          "parameter" : [{
            "valueString" : "Observation"
          }]
        }],
        "rule" : [{
          "name" : "bpBase",
          "source" : [{
            "context" : "qr"
          }],
          "target" : [{
            "transform" : "copy",
            "parameter" : [{
              "valueId" : "oBP"
            }]
          },
          {
            "transform" : "copy",
            "parameter" : [{
              "valueId" : "eBP"
            }]
          }],
          "dependent" : [{
            "name" : "BuildBaseObs",
            "parameter" : [{
              "valueId" : "qr"
            },
            {
              "valueId" : "oBP"
            },
            {
              "valueId" : "eBP"
            }]
          }]
        },
        {
          "name" : "categoryBP",
          "source" : [{
            "context" : "qr"
          }],
          "target" : [{
            "context" : "oBP",
            "element" : "category",
            "variable" : "catBP"
          }],
          "rule" : [{
            "name" : "catBPCodingRule",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "catBP",
              "element" : "coding",
              "variable" : "catBPCoding"
            }],
            "rule" : [{
              "name" : "catBPSys",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "catBPCoding",
                "element" : "system",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                }]
              }]
            },
            {
              "name" : "catBPCode",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "catBPCoding",
                "element" : "code",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "vital-signs"
                }]
              }]
            },
            {
              "name" : "catBPDisplay",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "catBPCoding",
                "element" : "display",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "Vital Signs"
                }]
              }]
            }]
          }]
        },
        {
          "name" : "codeBP",
          "source" : [{
            "context" : "qr"
          }],
          "target" : [{
            "context" : "oBP",
            "element" : "code",
            "variable" : "codeBP"
          }],
          "rule" : [{
            "name" : "codeBPCodingRule",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "codeBP",
              "element" : "coding",
              "variable" : "codeBPCoding"
            }],
            "rule" : [{
              "name" : "codeBPSys",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "codeBPCoding",
                "element" : "system",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "http://loinc.org"
                }]
              }]
            },
            {
              "name" : "codeBPCode",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "codeBPCoding",
                "element" : "code",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "55284-4"
                }]
              }]
            },
            {
              "name" : "codeBPDisplay",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "codeBPCoding",
                "element" : "display",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "Blood pressure systolic and diastolic"
                }]
              }]
            }]
          }]
        },
        {
          "name" : "bpSysRule",
          "source" : [{
            "context" : "itBP",
            "element" : "item",
            "variable" : "itSys",
            "condition" : "(linkId = '8480-6')"
          }],
          "rule" : [{
            "name" : "bpSysComponent",
            "source" : [{
              "context" : "itSys",
              "element" : "answer",
              "listMode" : "first",
              "variable" : "aSys"
            }],
            "target" : [{
              "context" : "oBP",
              "element" : "component",
              "variable" : "cSys"
            }],
            "rule" : [{
              "name" : "bpSysCode",
              "source" : [{
                "context" : "aSys"
              }],
              "target" : [{
                "context" : "cSys",
                "element" : "code",
                "variable" : "bpSysCC"
              }],
              "rule" : [{
                "name" : "bpSysCodingRule",
                "source" : [{
                  "context" : "aSys"
                }],
                "target" : [{
                  "context" : "bpSysCC",
                  "element" : "coding",
                  "variable" : "bpSysCoding"
                }],
                "rule" : [{
                  "name" : "bpSysCodingSystem",
                  "source" : [{
                    "context" : "aSys"
                  }],
                  "target" : [{
                    "context" : "bpSysCoding",
                    "element" : "system",
                    "transform" : "copy",
                    "parameter" : [{
                      "valueString" : "http://loinc.org"
                    }]
                  }]
                },
                {
                  "name" : "bpSysCodingCode",
                  "source" : [{
                    "context" : "aSys"
                  }],
                  "target" : [{
                    "context" : "bpSysCoding",
                    "element" : "code",
                    "transform" : "copy",
                    "parameter" : [{
                      "valueString" : "8480-6"
                    }]
                  }]
                },
                {
                  "name" : "bpSysCodingDisplay",
                  "source" : [{
                    "context" : "aSys"
                  }],
                  "target" : [{
                    "context" : "bpSysCoding",
                    "element" : "display",
                    "transform" : "copy",
                    "parameter" : [{
                      "valueString" : "Systolic blood pressure"
                    }]
                  }]
                }]
              }]
            },
            {
              "name" : "bpSysVal",
              "source" : [{
                "context" : "aSys",
                "element" : "value",
                "variable" : "hv"
              }],
              "target" : [{
                "context" : "cSys",
                "element" : "valueQuantity",
                "variable" : "vSys"
              }],
              "rule" : [{
                "name" : "setVal",
                "source" : [{
                  "context" : "hv"
                }],
                "target" : [{
                  "context" : "vSys",
                  "element" : "value",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueId" : "hv"
                  }]
                }]
              },
              {
                "name" : "setSys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "vSys",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://unitsofmeasure.org"
                  }]
                }]
              },
              {
                "name" : "setCode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "vSys",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "mm[Hg]"
                  }]
                }]
              },
              {
                "name" : "setUnit",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "vSys",
                  "element" : "unit",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "millimeter of mercury"
                  }]
                }]
              }]
            }]
          }],
          "documentation" : "Systolic 8480-6"
        },
        {
          "name" : "bpDiaRule",
          "source" : [{
            "context" : "itBP",
            "element" : "item",
            "variable" : "itDia",
            "condition" : "(linkId = '8462-4')"
          }],
          "rule" : [{
            "name" : "bpDiaComponent",
            "source" : [{
              "context" : "itDia",
              "element" : "answer",
              "listMode" : "first",
              "variable" : "aDia"
            }],
            "target" : [{
              "context" : "oBP",
              "element" : "component",
              "variable" : "cDia"
            }],
            "rule" : [{
              "name" : "bpDiaCode",
              "source" : [{
                "context" : "aDia"
              }],
              "target" : [{
                "context" : "cDia",
                "element" : "code",
                "variable" : "bpDiaCC"
              }],
              "rule" : [{
                "name" : "bpDiaCodingRule",
                "source" : [{
                  "context" : "aDia"
                }],
                "target" : [{
                  "context" : "bpDiaCC",
                  "element" : "coding",
                  "variable" : "bpDiaCoding"
                }],
                "rule" : [{
                  "name" : "bpDiaCodingSystem",
                  "source" : [{
                    "context" : "aDia"
                  }],
                  "target" : [{
                    "context" : "bpDiaCoding",
                    "element" : "system",
                    "transform" : "copy",
                    "parameter" : [{
                      "valueString" : "http://loinc.org"
                    }]
                  }]
                },
                {
                  "name" : "bpDiaCodingCode",
                  "source" : [{
                    "context" : "aDia"
                  }],
                  "target" : [{
                    "context" : "bpDiaCoding",
                    "element" : "code",
                    "transform" : "copy",
                    "parameter" : [{
                      "valueString" : "8462-4"
                    }]
                  }]
                },
                {
                  "name" : "bpDiaCodingDisplay",
                  "source" : [{
                    "context" : "aDia"
                  }],
                  "target" : [{
                    "context" : "bpDiaCoding",
                    "element" : "display",
                    "transform" : "copy",
                    "parameter" : [{
                      "valueString" : "Diastolic blood pressure"
                    }]
                  }]
                }]
              }]
            },
            {
              "name" : "bpDiaVal",
              "source" : [{
                "context" : "aDia",
                "element" : "value",
                "variable" : "hv"
              }],
              "target" : [{
                "context" : "cDia",
                "element" : "valueQuantity",
                "variable" : "vDia"
              }],
              "rule" : [{
                "name" : "setVal",
                "source" : [{
                  "context" : "hv"
                }],
                "target" : [{
                  "context" : "vDia",
                  "element" : "value",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueId" : "hv"
                  }]
                }]
              },
              {
                "name" : "setSys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "vDia",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://unitsofmeasure.org"
                  }]
                }]
              },
              {
                "name" : "setCode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "vDia",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "mm[Hg]"
                  }]
                }]
              },
              {
                "name" : "setUnit",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "vDia",
                  "element" : "unit",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "millimeter of mercury"
                  }]
                }]
              }]
            }]
          }],
          "documentation" : "Diastolic 8462-4"
        }]
      }],
      "documentation" : "Blood Pressure"
    },
    {
      "name" : "tempRule",
      "source" : [{
        "context" : "qr",
        "element" : "item",
        "variable" : "itT",
        "condition" : "(linkId = '8310-5')"
      }],
      "rule" : [{
        "name" : "tempAns",
        "source" : [{
          "context" : "itT",
          "element" : "answer",
          "listMode" : "first",
          "variable" : "aT"
        }],
        "rule" : [{
          "name" : "tempObs",
          "source" : [{
            "context" : "aT"
          }],
          "target" : [{
            "context" : "bundle",
            "element" : "entry",
            "variable" : "eT"
          },
          {
            "context" : "eT",
            "element" : "resource",
            "variable" : "oT",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "Observation"
            }]
          }],
          "rule" : [{
            "name" : "tempBase",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "oT"
              }]
            },
            {
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "eT"
              }]
            }],
            "dependent" : [{
              "name" : "BuildBaseObs",
              "parameter" : [{
                "valueId" : "qr"
              },
              {
                "valueId" : "oT"
              },
              {
                "valueId" : "eT"
              }]
            }]
          },
          {
            "name" : "categoryT",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oT",
              "element" : "category",
              "variable" : "catT"
            }],
            "rule" : [{
              "name" : "catTCodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "catT",
                "element" : "coding",
                "variable" : "catTCoding"
              }],
              "rule" : [{
                "name" : "catTSys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catTCoding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                  }]
                }]
              },
              {
                "name" : "catTCode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catTCoding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "vital-signs"
                  }]
                }]
              },
              {
                "name" : "catTDisplay",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catTCoding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "Vital Signs"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "codeT",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oT",
              "element" : "code",
              "variable" : "codeT"
            }],
            "rule" : [{
              "name" : "codeTCodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "codeT",
                "element" : "coding",
                "variable" : "codeTCoding"
              }],
              "rule" : [{
                "name" : "codeTSys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeTCoding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://loinc.org"
                  }]
                }]
              },
              {
                "name" : "codeTCode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeTCoding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "8310-5"
                  }]
                }]
              },
              {
                "name" : "codeTDisplay",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeTCoding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "Body Temperature"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "valT",
            "source" : [{
              "context" : "aT",
              "element" : "value",
              "variable" : "hv"
            }],
            "target" : [{
              "context" : "oT",
              "element" : "valueQuantity",
              "variable" : "vT"
            }],
            "rule" : [{
              "name" : "setVal",
              "source" : [{
                "context" : "hv"
              }],
              "target" : [{
                "context" : "vT",
                "element" : "value",
                "transform" : "copy",
                "parameter" : [{
                  "valueId" : "hv"
                }]
              }]
            },
            {
              "name" : "setSys",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "vT",
                "element" : "system",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "http://unitsofmeasure.org"
                }]
              }]
            },
            {
              "name" : "setCode",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "vT",
                "element" : "code",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "Cel"
                }]
              }]
            },
            {
              "name" : "setUnit",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "vT",
                "element" : "unit",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "degree Celsius"
                }]
              }]
            }]
          },
          {
            "name" : "findTStatus",
            "source" : [{
              "context" : "itT",
              "element" : "item",
              "variable" : "tStatusItem",
              "condition" : "(linkId = '8310-5_status')"
            }],
            "rule" : [{
              "name" : "setInterpT",
              "source" : [{
                "context" : "tStatusItem",
                "element" : "answer",
                "listMode" : "first",
                "variable" : "tStatusAns"
              }],
              "target" : [{
                "context" : "oT",
                "element" : "interpretation",
                "variable" : "iT"
              }],
              "rule" : [{
                "name" : "interpT",
                "source" : [{
                  "context" : "tStatusAns",
                  "element" : "value",
                  "variable" : "statusText"
                }],
                "target" : [{
                  "context" : "iT",
                  "element" : "text",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueId" : "statusText"
                  }]
                }]
              }]
            }],
            "documentation" : "Interpretation 8310-5_status"
          }]
        }]
      }],
      "documentation" : "Temperature"
    },
    {
      "name" : "spo2Rule",
      "source" : [{
        "context" : "qr",
        "element" : "item",
        "variable" : "itO2",
        "condition" : "(linkId = '20564-1')"
      }],
      "rule" : [{
        "name" : "spo2Ans",
        "source" : [{
          "context" : "itO2",
          "element" : "answer",
          "listMode" : "first",
          "variable" : "aO2"
        }],
        "rule" : [{
          "name" : "spo2Obs",
          "source" : [{
            "context" : "aO2"
          }],
          "target" : [{
            "context" : "bundle",
            "element" : "entry",
            "variable" : "eO2"
          },
          {
            "context" : "eO2",
            "element" : "resource",
            "variable" : "oO2",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "Observation"
            }]
          }],
          "rule" : [{
            "name" : "spo2Base",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "oO2"
              }]
            },
            {
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "eO2"
              }]
            }],
            "dependent" : [{
              "name" : "BuildBaseObs",
              "parameter" : [{
                "valueId" : "qr"
              },
              {
                "valueId" : "oO2"
              },
              {
                "valueId" : "eO2"
              }]
            }]
          },
          {
            "name" : "categoryO2",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oO2",
              "element" : "category",
              "variable" : "catO2"
            }],
            "rule" : [{
              "name" : "catO2CodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "catO2",
                "element" : "coding",
                "variable" : "catO2Coding"
              }],
              "rule" : [{
                "name" : "catO2Sys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catO2Coding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                  }]
                }]
              },
              {
                "name" : "catO2Code",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catO2Coding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "vital-signs"
                  }]
                }]
              },
              {
                "name" : "catO2Display",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catO2Coding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "Vital Signs"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "codeO2",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oO2",
              "element" : "code",
              "variable" : "codeO2"
            }],
            "rule" : [{
              "name" : "codeO2CodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "codeO2",
                "element" : "coding",
                "variable" : "codeO2Coding"
              }],
              "rule" : [{
                "name" : "codeO2Sys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeO2Coding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://loinc.org"
                  }]
                }]
              },
              {
                "name" : "codeO2Code",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeO2Coding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "20564-1"
                  }]
                }]
              },
              {
                "name" : "codeO2Display",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeO2Coding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "Oxygen saturation in Blood"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "valO2",
            "source" : [{
              "context" : "aO2",
              "element" : "value",
              "variable" : "hv"
            }],
            "target" : [{
              "context" : "oO2",
              "element" : "valueQuantity",
              "variable" : "vO2"
            }],
            "rule" : [{
              "name" : "setVal",
              "source" : [{
                "context" : "hv"
              }],
              "target" : [{
                "context" : "vO2",
                "element" : "value",
                "transform" : "copy",
                "parameter" : [{
                  "valueId" : "hv"
                }]
              }]
            },
            {
              "name" : "setSys",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "vO2",
                "element" : "system",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "http://unitsofmeasure.org"
                }]
              }]
            },
            {
              "name" : "setCode",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "vO2",
                "element" : "code",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "%"
                }]
              }]
            },
            {
              "name" : "setUnit",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "vO2",
                "element" : "unit",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "%"
                }]
              }]
            }]
          },
          {
            "name" : "findO2Status",
            "source" : [{
              "context" : "itO2",
              "element" : "item",
              "variable" : "o2StatusItem",
              "condition" : "(linkId = '20564-1_status')"
            }],
            "rule" : [{
              "name" : "setInterpO2",
              "source" : [{
                "context" : "o2StatusItem",
                "element" : "answer",
                "listMode" : "first",
                "variable" : "o2StatusAns"
              }],
              "target" : [{
                "context" : "oO2",
                "element" : "interpretation",
                "variable" : "iO2"
              }],
              "rule" : [{
                "name" : "interpO2",
                "source" : [{
                  "context" : "o2StatusAns",
                  "element" : "value",
                  "variable" : "statusText"
                }],
                "target" : [{
                  "context" : "iO2",
                  "element" : "text",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueId" : "statusText"
                  }]
                }]
              }]
            }],
            "documentation" : "Interpretation of SpO2 20564-1_status"
          }]
        }]
      }],
      "documentation" : "SpO2"
    },
    {
      "name" : "rrRule",
      "source" : [{
        "context" : "qr",
        "element" : "item",
        "variable" : "itRR",
        "condition" : "(linkId = '9279-1')"
      }],
      "rule" : [{
        "name" : "rrAns",
        "source" : [{
          "context" : "itRR",
          "element" : "answer",
          "listMode" : "first",
          "variable" : "aRR"
        }],
        "rule" : [{
          "name" : "rrObs",
          "source" : [{
            "context" : "aRR"
          }],
          "target" : [{
            "context" : "bundle",
            "element" : "entry",
            "variable" : "eRR"
          },
          {
            "context" : "eRR",
            "element" : "resource",
            "variable" : "oRR",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "Observation"
            }]
          }],
          "rule" : [{
            "name" : "rrBase",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "oRR"
              }]
            },
            {
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "eRR"
              }]
            }],
            "dependent" : [{
              "name" : "BuildBaseObs",
              "parameter" : [{
                "valueId" : "qr"
              },
              {
                "valueId" : "oRR"
              },
              {
                "valueId" : "eRR"
              }]
            }]
          },
          {
            "name" : "categoryRR",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oRR",
              "element" : "category",
              "variable" : "catRR"
            }],
            "rule" : [{
              "name" : "catRRCodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "catRR",
                "element" : "coding",
                "variable" : "catRRCoding"
              }],
              "rule" : [{
                "name" : "catRRSys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catRRCoding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                  }]
                }]
              },
              {
                "name" : "catRRCode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catRRCoding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "vital-signs"
                  }]
                }]
              },
              {
                "name" : "catRRDisplay",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catRRCoding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "Vital Signs"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "codeRR",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oRR",
              "element" : "code",
              "variable" : "codeRR"
            }],
            "rule" : [{
              "name" : "codeRRCodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "codeRR",
                "element" : "coding",
                "variable" : "codeRRCoding"
              }],
              "rule" : [{
                "name" : "codeRRSys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeRRCoding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://loinc.org"
                  }]
                }]
              },
              {
                "name" : "codeRRCode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeRRCoding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "9279-1"
                  }]
                }]
              },
              {
                "name" : "codeRRDisplay",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeRRCoding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "Respiratory rate"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "valRR",
            "source" : [{
              "context" : "aRR",
              "element" : "value",
              "variable" : "hv"
            }],
            "target" : [{
              "context" : "oRR",
              "element" : "valueQuantity",
              "variable" : "vRR"
            }],
            "rule" : [{
              "name" : "setVal",
              "source" : [{
                "context" : "hv"
              }],
              "target" : [{
                "context" : "vRR",
                "element" : "value",
                "transform" : "copy",
                "parameter" : [{
                  "valueId" : "hv"
                }]
              }]
            },
            {
              "name" : "setSys",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "vRR",
                "element" : "system",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "http://unitsofmeasure.org"
                }]
              }]
            },
            {
              "name" : "setCode",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "vRR",
                "element" : "code",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "/min"
                }]
              }]
            },
            {
              "name" : "setUnit",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "vRR",
                "element" : "unit",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "per minute"
                }]
              }]
            }]
          }]
        }]
      }],
      "documentation" : "Respiratory rate"
    },
    {
      "name" : "muacRule",
      "source" : [{
        "context" : "qr",
        "element" : "item",
        "variable" : "itMuac",
        "condition" : "(linkId = '9847-5')"
      }],
      "rule" : [{
        "name" : "muacAns",
        "source" : [{
          "context" : "itMuac",
          "element" : "answer",
          "listMode" : "first",
          "variable" : "aMuac"
        }],
        "rule" : [{
          "name" : "muacObs",
          "source" : [{
            "context" : "aMuac"
          }],
          "target" : [{
            "context" : "bundle",
            "element" : "entry",
            "variable" : "eMuac"
          },
          {
            "context" : "eMuac",
            "element" : "resource",
            "variable" : "oMuac",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "Observation"
            }]
          }],
          "rule" : [{
            "name" : "muacBase",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "oMuac"
              }]
            },
            {
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "eMuac"
              }]
            }],
            "dependent" : [{
              "name" : "BuildBaseObs",
              "parameter" : [{
                "valueId" : "qr"
              },
              {
                "valueId" : "oMuac"
              },
              {
                "valueId" : "eMuac"
              }]
            }]
          },
          {
            "name" : "categoryMuac",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oMuac",
              "element" : "category",
              "variable" : "catMuac"
            }],
            "rule" : [{
              "name" : "catMuacCodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "catMuac",
                "element" : "coding",
                "variable" : "catMuacCoding"
              }],
              "rule" : [{
                "name" : "catMuacSys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catMuacCoding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                  }]
                }]
              },
              {
                "name" : "catMuacCode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catMuacCoding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "vital-signs"
                  }]
                }]
              },
              {
                "name" : "catMuacDisplay",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catMuacCoding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "Vital Signs"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "codeMuac",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oMuac",
              "element" : "code",
              "variable" : "codeMuac"
            }],
            "rule" : [{
              "name" : "codeMuacCodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "codeMuac",
                "element" : "coding",
                "variable" : "codeMuacCoding"
              }],
              "rule" : [{
                "name" : "codeMuacSys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeMuacCoding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://loinc.org"
                  }]
                }]
              },
              {
                "name" : "codeMuacCode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeMuacCoding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "9847-5"
                  }]
                }]
              },
              {
                "name" : "codeMuacDisplay",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeMuacCoding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "Circumference"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "valMuac",
            "source" : [{
              "context" : "aMuac",
              "element" : "value",
              "variable" : "hv"
            }],
            "target" : [{
              "context" : "oMuac",
              "element" : "valueQuantity",
              "variable" : "vMuac"
            }],
            "rule" : [{
              "name" : "setVal",
              "source" : [{
                "context" : "hv"
              }],
              "target" : [{
                "context" : "vMuac",
                "element" : "value",
                "transform" : "copy",
                "parameter" : [{
                  "valueId" : "hv"
                }]
              }]
            },
            {
              "name" : "setSys",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "vMuac",
                "element" : "system",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "http://unitsofmeasure.org"
                }]
              }]
            },
            {
              "name" : "setCode",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "vMuac",
                "element" : "code",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "mm"
                }]
              }]
            },
            {
              "name" : "setUnit",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "vMuac",
                "element" : "unit",
                "transform" : "copy",
                "parameter" : [{
                  "valueString" : "millimeter"
                }]
              }]
            }]
          }]
        }]
      }],
      "documentation" : "MUAC"
    },
    {
      "name" : "chiefComplaintRule",
      "source" : [{
        "context" : "qr",
        "element" : "item",
        "variable" : "itCC",
        "condition" : "(linkId = '10154-3')"
      }],
      "rule" : [{
        "name" : "chiefComplaintAns",
        "source" : [{
          "context" : "itCC",
          "element" : "answer",
          "listMode" : "first",
          "variable" : "aCC"
        }],
        "rule" : [{
          "name" : "chiefComplaintObs",
          "source" : [{
            "context" : "aCC"
          }],
          "target" : [{
            "context" : "bundle",
            "element" : "entry",
            "variable" : "eCC"
          },
          {
            "context" : "eCC",
            "element" : "resource",
            "variable" : "oCC",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "Observation"
            }]
          }],
          "rule" : [{
            "name" : "chiefComplaintBase",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "oCC"
              }]
            },
            {
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "eCC"
              }]
            }],
            "dependent" : [{
              "name" : "BuildBaseObs",
              "parameter" : [{
                "valueId" : "qr"
              },
              {
                "valueId" : "oCC"
              },
              {
                "valueId" : "eCC"
              }]
            }]
          },
          {
            "name" : "chiefComplaintCategory",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oCC",
              "element" : "category",
              "variable" : "catCC"
            }],
            "rule" : [{
              "name" : "catCCCodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "catCC",
                "element" : "coding",
                "variable" : "catCCCoding"
              }],
              "rule" : [{
                "name" : "catCCSys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catCCCoding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                  }]
                }]
              },
              {
                "name" : "catCCCode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catCCCoding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "social-history"
                  }]
                }]
              },
              {
                "name" : "catCCDisplay",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catCCCoding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "Social History"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "chiefComplaintCode",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oCC",
              "element" : "code",
              "variable" : "codeCC"
            }],
            "rule" : [{
              "name" : "codeCCCodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "codeCC",
                "element" : "coding",
                "variable" : "codeCCCoding"
              }],
              "rule" : [{
                "name" : "codeCCSys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeCCCoding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://loinc.org"
                  }]
                }]
              },
              {
                "name" : "codeCCCode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeCCCoding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "10154-3"
                  }]
                }]
              },
              {
                "name" : "codeCCDisplay",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeCCCoding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "Chief complaint Narrative - Reported"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "chiefComplaintValue",
            "source" : [{
              "context" : "aCC",
              "element" : "value",
              "variable" : "textVal"
            }],
            "target" : [{
              "context" : "oCC",
              "element" : "valueString",
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "textVal"
              }]
            }]
          }]
        }]
      }],
      "documentation" : "Chief Complaint"
    },
    {
      "name" : "historyOfPIRule",
      "source" : [{
        "context" : "qr",
        "element" : "item",
        "variable" : "hpiCC",
        "condition" : "(linkId = '8684-3')"
      }],
      "rule" : [{
        "name" : "historyOfPIAns",
        "source" : [{
          "context" : "hpiCC",
          "element" : "answer",
          "listMode" : "first",
          "variable" : "aCC"
        }],
        "rule" : [{
          "name" : "historyOfPIObs",
          "source" : [{
            "context" : "aCC"
          }],
          "target" : [{
            "context" : "bundle",
            "element" : "entry",
            "variable" : "eCC"
          },
          {
            "context" : "eCC",
            "element" : "resource",
            "variable" : "oCC",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "Observation"
            }]
          }],
          "rule" : [{
            "name" : "historyOfPIBase",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "oCC"
              }]
            },
            {
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "eCC"
              }]
            }],
            "dependent" : [{
              "name" : "BuildBaseObs",
              "parameter" : [{
                "valueId" : "qr"
              },
              {
                "valueId" : "oCC"
              },
              {
                "valueId" : "eCC"
              }]
            }]
          },
          {
            "name" : "historyOfPICategory",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oCC",
              "element" : "category",
              "variable" : "catHPI"
            }],
            "rule" : [{
              "name" : "catHPICodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "catHPI",
                "element" : "coding",
                "variable" : "catHPICoding"
              }],
              "rule" : [{
                "name" : "catHPISys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catHPICoding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                  }]
                }]
              },
              {
                "name" : "catHPICode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catHPICoding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "social-history"
                  }]
                }]
              },
              {
                "name" : "catHPIDisplay",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catHPICoding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "Social History"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "historyOfPICode",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oCC",
              "element" : "code",
              "variable" : "codeHPI"
            }],
            "rule" : [{
              "name" : "codeHPICodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "codeHPI",
                "element" : "coding",
                "variable" : "codeHPICoding"
              }],
              "rule" : [{
                "name" : "codeHPISys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeHPICoding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://loinc.org"
                  }]
                }]
              },
              {
                "name" : "codeHPICode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeHPICoding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "8684-3"
                  }]
                }]
              },
              {
                "name" : "codeHPIDisplay",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeHPICoding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "History of Present illness"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "historyOfPIValue",
            "source" : [{
              "context" : "aCC",
              "element" : "value",
              "variable" : "textVal"
            }],
            "target" : [{
              "context" : "oCC",
              "element" : "valueString",
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "textVal"
              }]
            }]
          }]
        }]
      }],
      "documentation" : "History of Presenting Illness"
    },
    {
      "name" : "historyOfPastIRule",
      "source" : [{
        "context" : "qr",
        "element" : "item",
        "variable" : "hPastCC",
        "condition" : "(linkId = '11349-8')"
      }],
      "rule" : [{
        "name" : "historyOfPastIAns",
        "source" : [{
          "context" : "hPastCC",
          "element" : "answer",
          "listMode" : "first",
          "variable" : "aCC"
        }],
        "rule" : [{
          "name" : "historyOfPastIObs",
          "source" : [{
            "context" : "aCC"
          }],
          "target" : [{
            "context" : "bundle",
            "element" : "entry",
            "variable" : "eCC"
          },
          {
            "context" : "eCC",
            "element" : "resource",
            "variable" : "oCC",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "Observation"
            }]
          }],
          "rule" : [{
            "name" : "historyOfPastIBase",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "oCC"
              }]
            },
            {
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "eCC"
              }]
            }],
            "dependent" : [{
              "name" : "BuildBaseObs",
              "parameter" : [{
                "valueId" : "qr"
              },
              {
                "valueId" : "oCC"
              },
              {
                "valueId" : "eCC"
              }]
            }]
          },
          {
            "name" : "historyOfPastICategory",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oCC",
              "element" : "category",
              "variable" : "catPastI"
            }],
            "rule" : [{
              "name" : "catPastICodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "catPastI",
                "element" : "coding",
                "variable" : "catPastICoding"
              }],
              "rule" : [{
                "name" : "catPastISys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catPastICoding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                  }]
                }]
              },
              {
                "name" : "catPastICode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catPastICoding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "social-history"
                  }]
                }]
              },
              {
                "name" : "catPastIDisplay",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catPastICoding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "Social History"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "historyOfPastICode",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oCC",
              "element" : "code",
              "variable" : "codePastI"
            }],
            "rule" : [{
              "name" : "codePastICodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "codePastI",
                "element" : "coding",
                "variable" : "codePastICoding"
              }],
              "rule" : [{
                "name" : "codePastISys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codePastICoding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://loinc.org"
                  }]
                }]
              },
              {
                "name" : "codePastICode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codePastICoding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "11349-8"
                  }]
                }]
              },
              {
                "name" : "codePastIDisplay",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codePastICoding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "History of Past illness"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "historyOfPastIValue",
            "source" : [{
              "context" : "aCC",
              "element" : "value",
              "variable" : "textVal"
            }],
            "target" : [{
              "context" : "oCC",
              "element" : "valueString",
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "textVal"
              }]
            }]
          }]
        }]
      }],
      "documentation" : "History of Past Illness / Past Medical History"
    },
    {
      "name" : "familyHIRule",
      "source" : [{
        "context" : "qr",
        "element" : "item",
        "variable" : "hFH",
        "condition" : "(linkId = '8670-2')"
      }],
      "rule" : [{
        "name" : "familyHIAns",
        "source" : [{
          "context" : "hFH",
          "element" : "answer",
          "listMode" : "first",
          "variable" : "aCC"
        }],
        "rule" : [{
          "name" : "familyHIObs",
          "source" : [{
            "context" : "aCC"
          }],
          "target" : [{
            "context" : "bundle",
            "element" : "entry",
            "variable" : "eCC"
          },
          {
            "context" : "eCC",
            "element" : "resource",
            "variable" : "oCC",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "Observation"
            }]
          }],
          "rule" : [{
            "name" : "familyFHIBase",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "oCC"
              }]
            },
            {
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "eCC"
              }]
            }],
            "dependent" : [{
              "name" : "BuildBaseObs",
              "parameter" : [{
                "valueId" : "qr"
              },
              {
                "valueId" : "oCC"
              },
              {
                "valueId" : "eCC"
              }]
            }]
          },
          {
            "name" : "familyHICategory",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oCC",
              "element" : "category",
              "variable" : "catFH"
            }],
            "rule" : [{
              "name" : "catFHCodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "catFH",
                "element" : "coding",
                "variable" : "catFHCoding"
              }],
              "rule" : [{
                "name" : "catFHSys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catFHCoding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                  }]
                }]
              },
              {
                "name" : "catFHCode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catFHCoding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "social-history"
                  }]
                }]
              },
              {
                "name" : "catFHDisplay",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catFHCoding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "Social History"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "familyHICode",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oCC",
              "element" : "code",
              "variable" : "codeFH"
            }],
            "rule" : [{
              "name" : "codeFHCodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "codeFH",
                "element" : "coding",
                "variable" : "codeFHCoding"
              }],
              "rule" : [{
                "name" : "codeFHSys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeFHCoding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://loinc.org"
                  }]
                }]
              },
              {
                "name" : "codeFHCode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeFHCoding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "8670-2"
                  }]
                }]
              },
              {
                "name" : "codeFHDisplay",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeFHCoding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "History of family member diseases"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "familyHIValue",
            "source" : [{
              "context" : "aCC",
              "element" : "value",
              "variable" : "textVal"
            }],
            "target" : [{
              "context" : "oCC",
              "element" : "valueString",
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "textVal"
              }]
            }]
          }]
        }]
      }],
      "documentation" : "Family History"
    },
    {
      "name" : "socialHistoryIRule",
      "source" : [{
        "context" : "qr",
        "element" : "item",
        "variable" : "hSH",
        "condition" : "(linkId = '29762-2')"
      }],
      "rule" : [{
        "name" : "socialHistoryIAns",
        "source" : [{
          "context" : "hSH",
          "element" : "answer",
          "listMode" : "first",
          "variable" : "aCC"
        }],
        "rule" : [{
          "name" : "socialHistoryIObs",
          "source" : [{
            "context" : "aCC"
          }],
          "target" : [{
            "context" : "bundle",
            "element" : "entry",
            "variable" : "eCC"
          },
          {
            "context" : "eCC",
            "element" : "resource",
            "variable" : "oCC",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "Observation"
            }]
          }],
          "rule" : [{
            "name" : "socialHistoryIBase",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "oCC"
              }]
            },
            {
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "eCC"
              }]
            }],
            "dependent" : [{
              "name" : "BuildBaseObs",
              "parameter" : [{
                "valueId" : "qr"
              },
              {
                "valueId" : "oCC"
              },
              {
                "valueId" : "eCC"
              }]
            }]
          },
          {
            "name" : "socialHistoryCategory",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oCC",
              "element" : "category",
              "variable" : "catSH"
            }],
            "rule" : [{
              "name" : "catSHCodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "catSH",
                "element" : "coding",
                "variable" : "catSHCoding"
              }],
              "rule" : [{
                "name" : "catSHSys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catSHCoding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                  }]
                }]
              },
              {
                "name" : "catSHCode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catSHCoding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "social-history"
                  }]
                }]
              },
              {
                "name" : "catSHDisplay",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catSHCoding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "Social History"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "socialHistoryCode",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oCC",
              "element" : "code",
              "variable" : "codeSH"
            }],
            "rule" : [{
              "name" : "codeSHCodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "codeSH",
                "element" : "coding",
                "variable" : "codeSHCoding"
              }],
              "rule" : [{
                "name" : "codeSHSys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeSHCoding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://loinc.org"
                  }]
                }]
              },
              {
                "name" : "codeSHCode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeSHCoding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "29762-2"
                  }]
                }]
              },
              {
                "name" : "codeSHDisplay",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeSHCoding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "Social history note"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "socialHistoryIValue",
            "source" : [{
              "context" : "aCC",
              "element" : "value",
              "variable" : "textVal"
            }],
            "target" : [{
              "context" : "oCC",
              "element" : "valueString",
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "textVal"
              }]
            }]
          }]
        }]
      }],
      "documentation" : "Social History"
    },
    {
      "name" : "medicationHistoryIRule",
      "source" : [{
        "context" : "qr",
        "element" : "item",
        "variable" : "medicationH",
        "condition" : "(linkId = '10160-0')"
      }],
      "rule" : [{
        "name" : "medicationHistoryIAns",
        "source" : [{
          "context" : "medicationH",
          "element" : "answer",
          "listMode" : "first",
          "variable" : "aCC"
        }],
        "rule" : [{
          "name" : "medicationHistoryIObs",
          "source" : [{
            "context" : "aCC"
          }],
          "target" : [{
            "context" : "bundle",
            "element" : "entry",
            "variable" : "eCC"
          },
          {
            "context" : "eCC",
            "element" : "resource",
            "variable" : "oCC",
            "transform" : "create",
            "parameter" : [{
              "valueString" : "Observation"
            }]
          }],
          "rule" : [{
            "name" : "medicationHIBase",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "oCC"
              }]
            },
            {
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "eCC"
              }]
            }],
            "dependent" : [{
              "name" : "BuildBaseObs",
              "parameter" : [{
                "valueId" : "qr"
              },
              {
                "valueId" : "oCC"
              },
              {
                "valueId" : "eCC"
              }]
            }]
          },
          {
            "name" : "medicationHCategory",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oCC",
              "element" : "category",
              "variable" : "catMedH"
            }],
            "rule" : [{
              "name" : "catMedHCodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "catMedH",
                "element" : "coding",
                "variable" : "catMedHCoding"
              }],
              "rule" : [{
                "name" : "catMedHSys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catMedHCoding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                  }]
                }]
              },
              {
                "name" : "catMedHCode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catMedHCoding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "therapy"
                  }]
                }]
              },
              {
                "name" : "catMedHDisplay",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "catMedHCoding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "Therapy"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "medicationHistoryCode",
            "source" : [{
              "context" : "qr"
            }],
            "target" : [{
              "context" : "oCC",
              "element" : "code",
              "variable" : "codeMedH"
            }],
            "rule" : [{
              "name" : "codeMedHCodingRule",
              "source" : [{
                "context" : "qr"
              }],
              "target" : [{
                "context" : "codeMedH",
                "element" : "coding",
                "variable" : "codeMedHCoding"
              }],
              "rule" : [{
                "name" : "codeMedHSys",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeMedHCoding",
                  "element" : "system",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "http://loinc.org"
                  }]
                }]
              },
              {
                "name" : "codeMedHCode",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeMedHCoding",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "10160-0"
                  }]
                }]
              },
              {
                "name" : "codeMedHDisplay",
                "source" : [{
                  "context" : "qr"
                }],
                "target" : [{
                  "context" : "codeMedHCoding",
                  "element" : "display",
                  "transform" : "copy",
                  "parameter" : [{
                    "valueString" : "History of Medication use Narrative"
                  }]
                }]
              }]
            }]
          },
          {
            "name" : "medicationHistoryIValue",
            "source" : [{
              "context" : "aCC",
              "element" : "value",
              "variable" : "textVal"
            }],
            "target" : [{
              "context" : "oCC",
              "element" : "valueString",
              "transform" : "copy",
              "parameter" : [{
                "valueId" : "textVal"
              }]
            }]
          }]
        }]
      }],
      "documentation" : "Medication History"
    }]
  },
  {
    "name" : "BuildBaseObs",
    "input" : [{
      "name" : "qr",
      "type" : "QR",
      "mode" : "source"
    },
    {
      "name" : "obs",
      "type" : "Observation",
      "mode" : "target"
    },
    {
      "name" : "entry",
      "mode" : "target"
    }],
    "rule" : [{
      "name" : "status",
      "source" : [{
        "context" : "qr"
      }],
      "target" : [{
        "context" : "obs",
        "element" : "status",
        "transform" : "copy",
        "parameter" : [{
          "valueString" : "final"
        }]
      }]
    },
    {
      "name" : "subject",
      "source" : [{
        "context" : "qr",
        "element" : "subject",
        "variable" : "s"
      }],
      "target" : [{
        "context" : "obs",
        "element" : "subject",
        "transform" : "copy",
        "parameter" : [{
          "valueId" : "s"
        }]
      }]
    },
    {
      "name" : "encounter",
      "source" : [{
        "context" : "qr",
        "element" : "encounter",
        "variable" : "e"
      }],
      "target" : [{
        "context" : "obs",
        "element" : "encounter",
        "transform" : "copy",
        "parameter" : [{
          "valueId" : "e"
        }]
      }]
    },
    {
      "name" : "effective",
      "source" : [{
        "context" : "qr",
        "element" : "authored",
        "variable" : "t"
      }],
      "target" : [{
        "context" : "obs",
        "element" : "effectiveDateTime",
        "transform" : "copy",
        "parameter" : [{
          "valueId" : "t"
        }]
      }]
    },
    {
      "name" : "performer",
      "source" : [{
        "context" : "qr",
        "element" : "source",
        "variable" : "src"
      }],
      "target" : [{
        "context" : "obs",
        "element" : "performer",
        "variable" : "perf",
        "transform" : "create",
        "parameter" : [{
          "valueString" : "Reference"
        }]
      }],
      "rule" : [{
        "name" : "perfRef",
        "source" : [{
          "context" : "src",
          "element" : "reference",
          "variable" : "ref"
        }],
        "target" : [{
          "context" : "perf",
          "element" : "reference",
          "transform" : "copy",
          "parameter" : [{
            "valueId" : "ref"
          }]
        }]
      },
      {
        "name" : "perfDisplay",
        "source" : [{
          "context" : "src",
          "element" : "display",
          "variable" : "disp"
        }],
        "target" : [{
          "context" : "perf",
          "element" : "display",
          "transform" : "copy",
          "parameter" : [{
            "valueId" : "disp"
          }]
        }]
      }],
      "documentation" : "Performer from QuestionnaireResponse.source"
    },
    {
      "name" : "setObsIdAndFullUrl",
      "source" : [{
        "context" : "qr"
      }],
      "target" : [{
        "context" : "obs",
        "element" : "id",
        "transform" : "uuid"
      }],
      "dependent" : [{
        "name" : "SetObservationFullUrl",
        "parameter" : [{
          "valueId" : "obs"
        },
        {
          "valueId" : "entry"
        }]
      }],
      "documentation" : "Observation id and fullUrl"
    },
    {
      "name" : "entryRequest",
      "source" : [{
        "context" : "qr"
      }],
      "target" : [{
        "context" : "entry",
        "element" : "request",
        "variable" : "request"
      }],
      "rule" : [{
        "name" : "reqMethod",
        "source" : [{
          "context" : "qr"
        }],
        "target" : [{
          "context" : "request",
          "element" : "method",
          "transform" : "copy",
          "parameter" : [{
            "valueString" : "POST"
          }]
        }]
      },
      {
        "name" : "reqUrl",
        "source" : [{
          "context" : "qr"
        }],
        "target" : [{
          "context" : "request",
          "element" : "url",
          "transform" : "copy",
          "parameter" : [{
            "valueString" : "Observation"
          }]
        }]
      }],
      "documentation" : "Bundle.entry.request (transaction POST Observation)"
    },
    {
      "name" : "linkQR",
      "source" : [{
        "context" : "qr"
      }],
      "target" : [{
        "context" : "obs",
        "element" : "derivedFrom",
        "variable" : "newRef",
        "transform" : "create",
        "parameter" : [{
          "valueString" : "Reference"
        }]
      }],
      "rule" : [{
        "name" : "setQRRef",
        "source" : [{
          "context" : "qr",
          "element" : "id",
          "variable" : "qid"
        }],
        "target" : [{
          "context" : "newRef",
          "element" : "reference",
          "transform" : "append",
          "parameter" : [{
            "valueString" : "QuestionnaireResponse/"
          },
          {
            "valueId" : "qid"
          }]
        }]
      }],
      "documentation" : "Link Observation -> QuestionnaireResponse"
    }]
  },
  {
    "name" : "SetObservationFullUrl",
    "input" : [{
      "name" : "obs",
      "type" : "Observation",
      "mode" : "source"
    },
    {
      "name" : "entry",
      "mode" : "target"
    }],
    "rule" : [{
      "name" : "assignFullUrl",
      "source" : [{
        "context" : "obs",
        "element" : "id",
        "variable" : "id"
      }],
      "target" : [{
        "context" : "entry",
        "element" : "fullUrl",
        "transform" : "append",
        "parameter" : [{
          "valueString" : "https://fhir.slade360.co.ke/fhir/Observation/"
        },
        {
          "valueId" : "id"
        }]
      }]
    }]
  }]
}

```
