{
  "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" : "MedicationDispense",
              "id" : "medicationdispense-warfarin-nsaid-warfarin-prefetch",
              "status" : "completed",
              "category" : {
                "coding" : [
                  {
                    "code" : "outpatient"
                  }
                ]
              },
              "medicationCodeableConcept" : {
                "coding" : [
                  {
                    "system" : "http://www.nlm.nih.gov/research/umls/rxnorm",
                    "code" : "855332",
                    "display" : "Warfarin Sodium 5 MG Oral Tablet"
                  }
                ]
              },
              "subject" : {
                "reference" : "Patient/warfarin-nsaid-over65-prefetch"
              },
              "context" : {
                "reference" : "Encounter/warfarin-nsaid-prefetch"
              },
              "quantity" : {
                "value" : 90,
                "system" : "http://unitsofmeasure.org",
                "code" : "TAB"
              },
              "daysSupply" : {
                "value" : 90,
                "unit" : "Day",
                "system" : "http://unitsofmeasure.org",
                "code" : "d"
              },
              "dosageInstruction" : [
                {
                  "timing" : {
                    "repeat" : {
                      "frequency" : 1,
                      "period" : 1.0,
                      "periodUnit" : "d"
                    }
                  },
                  "asNeededBoolean" : false
                }
              ]
            }
          ]
        }
      }
    },
    "item2": {
      "response": {
        "status": "200 OK"
      },
      "resource": {
        "resourceType": "Bundle",
        "entry": [
          {
            "resourceType" : "Patient",
            "id" : "patient-warfarin-nsaid-over65-prefetch",
            "gender" : "male",
            "birthDate" : "1948-05-10"
          }
        ]
      }
    },
    "item3" : {
      "response" : {
        "status" : "200 OK"
      },
      "resource" : {
        "resourceType" : "Bundle",
        "entry" : [
          {
            "resourceType" : "MedicationRequest",
            "id" : "medicationrequest-warfarin-nsaid-corticosteroid-prefetch",
            "status" : "active",
            "intent" : "order",
            "category" : [
              {
                "coding" : [
                  {
                    "code" : "outpatient"
                  }
                ]
              }
            ],
            "medicationCodeableConcept" : {
              "coding" : [
                {
                  "system" : "http://www.nlm.nih.gov/research/umls/rxnorm",
                  "code" : "197579",
                  "display" : "Dexamethasone 1 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"
              }
            }
          }
        ]
      }
    }
  }
}