{
  "resourceType" : "MedicationOrder",
  // from Resource: id, meta, implicitRules, and language
  // from DomainResource: text, contained, extension, and modifierExtension
  "identifier" : [{ Identifier }], // External identifier
  "dateWritten" : "<dateTime>", // When prescription was authorized
  "status" : "<code>", // active | on-hold | completed | entered-in-error | stopped | draft
  "dateEnded" : "<dateTime>", // When prescription was stopped
  "reasonEnded" : { CodeableConcept }, // Why prescription was stopped
  "patient" : { Reference(Patient) }, // Who prescription is for
  "prescriber" : { Reference(Practitioner) }, // Who ordered the medication(s)
  "encounter" : { Reference(Encounter) }, // Created during encounter/admission/stay
  // reason[x]: Reason or indication for writing the prescription. One of these 2:
  "reasonCodeableConcept" : { CodeableConcept },
  "reasonReference" : { Reference(Condition) },
  "note" : "<string>", // Information about the prescription
  // medication[x]: Medication to be taken. One of these 2:
  "medicationCodeableConcept" : { CodeableConcept },
  "medicationReference" : { Reference(Medication) },
  "dosageInstruction" : [{ // How medication should be taken
    "text" : "<string>", // Dosage instructions expressed as text
    "additionalInstructions" : { CodeableConcept }, // Supplemental instructions - e.g. "with meals"
    "timing" : { Timing }, // When medication should be administered
    // asNeeded[x]: Take "as needed" (for x). One of these 2:
    "asNeededBoolean" : <boolean>,
    "asNeededCodeableConcept" : { CodeableConcept },
    // site[x]: Body site to administer to. One of these 2:
    "siteCodeableConcept" : { CodeableConcept },
    "siteReference" : { Reference(BodySite) },
    "route" : { CodeableConcept }, // How drug should enter body
    "method" : { CodeableConcept }, // Technique for administering medication
    // dose[x]: Amount of medication per dose. One of these 2:
    "doseRange" : { Range },
    "doseQuantity" : { Quantity(SimpleQuantity) },
    // rate[x]: Amount of medication per unit of time. One of these 2:
    "rateRatio" : { Ratio },
    "rateRange" : { Range },
    "maxDosePerPeriod" : { Ratio } // Upper limit on medication per unit of time
  }],
  "dispenseRequest" : { // Medication supply authorization
    // medication[x]: Product to be supplied. One of these 2:
    "medicationCodeableConcept" : { CodeableConcept },
    "medicationReference" : { Reference(Medication) },
    "validityPeriod" : { Period }, // Time period supply is authorized for
    "numberOfRepeatsAllowed" : "<positiveInt>", // Number of refills authorized
    "quantity" : { Quantity(SimpleQuantity) }, // Amount of medication to supply per dispense
    "expectedSupplyDuration" : { Quantity(Duration) } // Number of days supply per dispense
  },
  "substitution" : { // Any restrictions on medication substitution
    "type" : { CodeableConcept }, // R!  generic | formulary +
    "reason" : { CodeableConcept } // Why should (not) substitution be made
  },
  "priorPrescription" : { Reference(MedicationOrder) } // An order/prescription that this supersedes
}