{
  "resourceType": "StructureDefinition",
  "id": "MedicationRequestMERT",
  "url": "https://intrahealth.com/fhir/mert/StructureDefinition/MedicationRequestMERT",
  "version": "0.1.0",
  "name": "MedicationRequestMERT",
  "title": "MedicationRequest (MERT)",
  "status": "draft",
  "description": "This profile describes the MedicationRequest constraints for MERT.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "MedicationRequest",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/MedicationRequest",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "MedicationRequest.extension",
        "path": "MedicationRequest.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "ordered": false,
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "MedicationRequest.extension:MedicationStrengthMERT",
        "path": "MedicationRequest.extension",
        "sliceName": "MedicationStrengthMERT",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://example.org/fhir/StructureDefinition/medication-strength"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "MedicationRequest.status",
        "path": "MedicationRequest.status",
        "mustSupport": true
      },
      {
        "id": "MedicationRequest.intent",
        "path": "MedicationRequest.intent",
        "short": "'order' only",
        "definition": "For MERT, MedicationRequest.intent only processes those that are 'order'. Others such as [proposal | plan | original-order | reflex-order | filler-order | instance-order | option] will not be processed.",
        "patternCode": "order",
        "mustSupport": true
      },
      {
        "id": "MedicationRequest.medication[x]",
        "path": "MedicationRequest.medication[x]",
        "mustSupport": true
      },
      {
        "id": "MedicationRequest.subject",
        "path": "MedicationRequest.subject",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://intrahealth.com/fhir/mert/StructureDefinition/PatientMERT"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "MedicationRequest.encounter",
        "path": "MedicationRequest.encounter",
        "mustSupport": true
      },
      {
        "id": "MedicationRequest.authoredOn",
        "path": "MedicationRequest.authoredOn",
        "mustSupport": true
      },
      {
        "id": "MedicationRequest.requester",
        "path": "MedicationRequest.requester",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://intrahealth.com/fhir/mert/StructureDefinition/PractitionerMERT"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "MedicationRequest.note",
        "path": "MedicationRequest.note",
        "mustSupport": true
      },
      {
        "id": "MedicationRequest.dosageInstruction",
        "path": "MedicationRequest.dosageInstruction",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "MedicationRequest.dispenseRequest",
        "path": "MedicationRequest.dispenseRequest",
        "mustSupport": true
      },
      {
        "id": "MedicationRequest.dispenseRequest.numberOfRepeatsAllowed",
        "path": "MedicationRequest.dispenseRequest.numberOfRepeatsAllowed",
        "mustSupport": true
      },
      {
        "id": "MedicationRequest.dispenseRequest.quantity",
        "path": "MedicationRequest.dispenseRequest.quantity",
        "mustSupport": true
      },
      {
        "id": "MedicationRequest.dispenseRequest.expectedSupplyDuration",
        "path": "MedicationRequest.dispenseRequest.expectedSupplyDuration",
        "mustSupport": true
      },
      {
        "id": "MedicationRequest.substitution",
        "path": "MedicationRequest.substitution",
        "mustSupport": true
      },
      {
        "id": "MedicationRequest.substitution.allowed[x]",
        "path": "MedicationRequest.substitution.allowed[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "ordered": false,
          "rules": "open"
        },
        "mustSupport": true
      },
      {
        "id": "MedicationRequest.substitution.allowed[x]:allowedBoolean",
        "path": "MedicationRequest.substitution.allowed[x]",
        "sliceName": "allowedBoolean",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "boolean"
          }
        ],
        "mustSupport": true
      }
    ]
  }
}