{
  "hookInstance": "9d02e4d7-2d5b-492f-8f77-ce36dda0647d",
  "fhirServer": "http://46.101.183.140:8080/baseDstu3",
  "hook": "medication-prescribe",
  "user": "Practitioner/example",
  "applyCql": "true",
  "context": {
    "patientId": "Patient/patient-warfarin-nsaid-over65-prefetch",
    "encounterId": "Encounter/encounter-warfarin-nsaid-context",
    "medications": {
      "resourceType": "Bundle",
      "entry": [
        {
          "resourceType" : "MedicationRequest",
          "id" : "medicationrequest-warfarin-nsaid-nsaid-context",
          "status" : "active",
          "intent" : "order",
          "category" : [
            {
              "coding" : [
                {
                  "code" : "outpatient"
                }
              ]
            }
          ],
          "medicationCodeableConcept" : {
            "coding" : [
              {
                "system" : "http://www.nlm.nih.gov/research/umls/rxnorm",
                "code" : "197805",
                "display" : "Ibuprofen 400 MG Oral Tablet"
              }
            ]
          },
          "subject" : {
            "reference" : "Patient/warfarin-nsaid-over65-prefetch"
          },
          "context" : {
            "reference" : "Encounter/warfarin-nsaid-prefetch"
          },
          "_authoredOn" : {
            "extension" : [
              {
                "url" : "http://hl7.org/fhir/StructureDefinition/cqif-cqlExpression",
                "valueString" : "Today()"
              }
            ]
          },
          "dosageInstruction" : [
            {
              "timing" : {
                "repeat" : {
                  "frequency" : 1,
                  "period" : 1.0,
                  "periodUnit" : "d"
                }
              },
              "asNeededBoolean" : false
            }
          ],
          "dispenseRequest" : {
            "validityPeriod" : {
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/StructureDefinition/cqif-cqlExpression",
                  "valueString" : "FHIR.Period { start: FHIR.dateTime { value: Today() }, end: FHIR.dateTime { value: Today() } }"
                }
              ]
            },
            "numberOfRepeatsAllowed" : 1,
            "expectedSupplyDuration" : {
              "value" : 90.0,
              "unit" : "d"
            }
          }
        }
      ]
    },
    "prefetch": {
      "item1": {
        "response": {
          "status": "200 OK"
        },
        "resource": {
          "resourceType": "Bundle",
          "entry": [
            {
              "resourceType" : "MedicationAdministration",
              "id" : "medicationadministration-warfarin-nsaid-warfarin-prefetch",
              "status" : "completed",
              "category" : {
                "coding" : [
                  {
                    "code" : "inpatient"
                  }
                ]
              },
              "medicationCodeableConcept" : {
                "coding" : [
                  {
                    "system" : "http://www.nlm.nih.gov/research/umls/rxnorm",
                    "code" : "855295",
                    "display" : "Warfarin Sodium 10 MG"
                  }
                ]
              },
              "subject" : {
                "reference" : "Patient/warfarin-nsaid-over65-prefetch"
              },
              "context" : {
                "reference" : "Encounter/warfarin-nsaid-prefetch"
              },
              "effectivePeriod" : {
                "extension" : [
                  {
                    "url" : "http://hl7.org/fhir/StructureDefinition/cqif-cqlExpression",
                    "valueString" : "FHIR.Period { start: FHIR.dateTime { value: Today() }, end: FHIR.dateTime { value: Today() } }"
                  }
                ]
              },
              "dosage" : {
                "text" : "1 tablet",
                "route" : {
                  "coding" : [
                    {
                      "system" : "http://snomed.info/sct",
                      "code" : "26643006",
                      "display" : "Oral Route"
                    }
                  ]
                },
                "method" : {
                  "coding" : [
                    {
                      "system" : "http://snomed.info/sct",
                      "code" : "421521009",
                      "display" : "Swallow"
                    }
                  ]
                },
                "dose" : {
                  "value" : 1,
                  "unit" : "TAB",
                  "system" : "http://hl7.org/fhir/v3/orderableDrugForm",
                  "code" : "TAB"
                }
              }
            }
          ]
        }
      }
    },
    "item2": {
      "response": {
        "status": "200 OK"
      },
      "resource": {
        "resourceType": "Bundle",
        "entry": [
          {
            "resourceType" : "Patient",
            "id" : "patient-warfarin-nsaid-under65-prefetch",
            "gender" : "male",
            "birthDate" : "1982-01-07"
          }
        ]
      }
    },
    "item3" : {
      "response" : {
        "status" : "200 OK"
      },
      "resource" : {
        "resourceType" : "Bundle",
        "entry" : [
          {
            "resourceType" : "MedicationRequest",
            "id" : "medicationrequest-warfarin-nsaid-nsaid-prefetch",
            "status" : "active",
            "intent" : "order",
            "category" : [
              {
                "coding" : [
                  {
                    "code" : "outpatient"
                  }
                ]
              }
            ],
            "medicationCodeableConcept" : {
              "coding" : [
                {
                  "system" : "http://www.nlm.nih.gov/research/umls/rxnorm",
                  "code" : "197805",
                  "display" : "Ibuprofen 400 MG Oral Tablet"
                }
              ]
            },
            "subject" : {
              "reference" : "Patient/warfarin-nsaid-over65-prefetch"
            },
            "context" : {
              "reference" : "Encounter/warfarin-nsaid-prefetch"
            },
            "_authoredOn" : {
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/StructureDefinition/cqif-cqlExpression",
                  "valueString" : "Today() - 10 days"
                }
              ]
            },
            "dosageInstruction" : [
              {
                "timing" : {
                  "repeat" : {
                    "frequency" : 1,
                    "period" : 1.0,
                    "periodUnit" : "d"
                  }
                },
                "asNeededBoolean" : false
              }
            ],
            "dispenseRequest" : {
              "validityPeriod" : {
                "extension" : [
                  {
                    "url" : "http://hl7.org/fhir/StructureDefinition/cqif-cqlExpression",
                    "valueString" : "FHIR.Period { start: FHIR.dateTime { value: Today() - 10 days }, end: FHIR.dateTime { value: Today() } }"
                  }
                ]
              },
              "numberOfRepeatsAllowed" : 1,
              "expectedSupplyDuration" : {
                "value" : 90.0,
                "unit" : "d"
              }
            }
          }
        ]
      }
    },
    "item4" : {
      "response" : {
        "status" : "200 OK"
      },
      "resource" : "Bundle",
      "entry" : [
        {
          "resourceType" : "Condition",
          "id" : "condition-warfarin-nsaid-Hx-UGIB-prefetch",
          "clinicalStatus" : "resolved",
          "verificationStatus" : "confirmed",
          "category" : [
            {
              "coding" : [
                {
                  "system" : "http://snomed.info/sct",
                  "code" : "439401001",
                  "display" : "diagnosis"
                }
              ]
            }
          ],
          "severity" : {
            "coding" : [
              {
                "system" : "http://snomed.info/sct",
                "code" : "6736007",
                "display" : "Moderate (severity modifier)"
              }
            ]
          },
          "code" : {
            "coding" : [
              {
                "system" : "http://snomed.info/sct",
                "code" : "89748001",
                "display" : "Acute gastric ulcer with hemorrhage"
              }
            ]
          },
          "subject" : {
            "reference" : "Patient/warfarin-nsaid-over65-prefetch"
          },
          "context" : {
            "reference" : "Encounter/warfarin-nsaid-prefetch"
          },
          "onsetDateTime" : "2017-08-05",
          "abatementDateTime" : "2017-09-01",
          "evidence" : [
            {
              "code" : [
                {
                  "coding" : [
                    {
                      "system" : "http://snomed.info/sct",
                      "code" : "3368006",
                      "display" : "Dull chest pain"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  }
}