{
  "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" : "MedicationRequest",
              "id" : "medicationrequest-warfarin-nsaid-warfarin-prefetch",
              "status" : "active",
              "intent" : "order",
              "category" : [
                {
                  "coding" : [
                    {
                      "code" : "outpatient"
                    }
                  ]
                }
              ],
              "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"
              },
              "_authoredOn" : {
                "extension" : [
                  {
                    "url" : "http://hl7.org/fhir/StructureDefinition/cqif-cqlExpression",
                    "valueString" : "Today() - 90 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() - 90 days }, end: FHIR.dateTime { value: Today() } }"
                    }
                  ]
                },
                "numberOfRepeatsAllowed" : 1,
                "expectedSupplyDuration" : {
                  "value" : 90,
                  "unit" : "d"
                }
              }
            }
          ]
        }
      }
    },
      "item2": {
        "response": {
          "status": "200 OK"
        },
        "resource": {
          "resourceType": "Bundle",
          "entry": [
            {
              "resourceType" : "MedicationRequest",
              "id" : "medicationrequest-warfarin-nsaid-ppi-prefetch",
              "status" : "active",
              "intent" : "order",
              "category" : [
                {
                  "coding" : [
                    {
                      "code" : "outpatient"
                    }
                  ]
                }
              ],
              "medicationCodeableConcept" : {
                "coding" : [
                  {
                    "system" : "http://www.nlm.nih.gov/research/umls/rxnorm",
                    "code" : "854868",
                    "display" : "Rabeprazole sodium 20 MG Delayed Release 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"
                }
              }
            }
          ]
        }
      }
    }
  }