{
  "resourceType": "MedicationRequest",
  "id": "a8ca980c-72aa-11e7-8cf7-a6006ad3dba0",
  "contained": [
    {
      "resourceType": "Medication",
      "id": "med1",
      "code": {
        "coding": [
          {
            "system": "http://snomed.info/sct",
            "code": "322307006",
            "display": "Co-codamol 8mg/500mg tablets"
          }
        ]
      }
    }
  ],
  "status": "active",
  "intent": "order",
  "medicationReference": {
    "reference": "#med1"
  },
  "subject": {
    "identifier": {
      "system": "https://fhir.nhs.uk/Id/nhs-number",
      "value": "9999999999"
    }
  },
  "dosageInstruction": [
    {
      "patientInstruction": "Additional doses only to be taken after migraine recurrence",
      "timing": {
        "repeat": {
          "frequency": 1,
          "period": 4,
          "periodUnit": "h"
        }
      },
      "asNeededCodeableConcept": {
        "coding": [
          {
            "system": "http://snomed.info/sct",
            "code": "37796009",
            "display": "Migraine"
          }
        ]
      },
      "doseQuantity": {
        "value": 2,
        "unit": "tablet",
        "system": "http://snomed.info/sct",
        "code": "428673006"
      },
      "maxDosePerPeriod": {
        "numerator": {
          "value": 6,
          "unit": "dose",
          "system": "http://snomed.info/sct",
          "code": "3317411000001100"
        },
        "denominator": {
          "value": 24,
          "unit": "hour",
          "system": "http://unitsofmeasure.org/",
          "code": "h"
        }
      }
    }
  ]
}