{
  "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-topicaldiclofenac-context",
          "status": "active",
          "intent": "order",
          "category": [
            {
              "coding": [
                {
                  "code": "outpatient"
                }
              ]
            }
          ],
          "medicationCodeableConcept": {
            "coding": [
              {
                "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
                "code": "855635",
                "display": "Diclofenac Sodium 0.01 MG/MG Topical Gel [Voltaren]"
              }
            ]
          },
          "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"
                }
              }
            }
          ]
        }
      }
    }
  }
}