From 92d137e1b23b116adf914ee14779be385fc4c7ca Mon Sep 17 00:00:00 2001 From: GAlemsky Date: Thu, 19 Nov 2026 12:24:29 +0600 Subject: [PATCH 01/14] eRx: document DEA schedules and compound classification Add an EPCS page on where the EHR stores a DEA schedule, how the module classifies a compound by its ingredient schedules, the ingredient NDC rule, the NCPDP DEASchedule codes, and the schedule errors. Co-Authored-By: Claude Opus 5.5 --- SUMMARY.md | 1 + docs/modules/eprescription/epcs/README.md | 1 + .../eprescription/epcs/dea-schedules.md | 164 ++++++++++++++++++ 3 files changed, 166 insertions(+) create mode 100644 docs/modules/eprescription/epcs/dea-schedules.md diff --git a/SUMMARY.md b/SUMMARY.md index e602a94f3..dd58a515f 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -446,6 +446,7 @@ * [List Permissions](modules/eprescription/epcs/access-management/list-permissions.md) * [Access-Change Requests](modules/eprescription/epcs/access-management/access-change-requests.md) * [Location Compliance Status](modules/eprescription/epcs/access-management/location-compliance-status.md) + * [DEA Schedules](modules/eprescription/epcs/dea-schedules.md) * [Practitioner Log](modules/eprescription/epcs/practitioner-log.md) * [Directory](modules/eprescription/directory/README.md) * [DirectoryDownload Message](modules/eprescription/directory/directorydownload-message.md) diff --git a/docs/modules/eprescription/epcs/README.md b/docs/modules/eprescription/epcs/README.md index a44bf4ffc..c7ee1b073 100644 --- a/docs/modules/eprescription/epcs/README.md +++ b/docs/modules/eprescription/epcs/README.md @@ -10,4 +10,5 @@ The module does not support prescribing controlled substances yet, but we are wo * [Enable EPCS](enable-epcs.md): configure the module and your EHR so that prescribers can sign controlled prescriptions. * [EPCS Access Management](access-management/README.md): appoint the people who manage EPCS access at each location. +* [DEA Schedules](dea-schedules.md): store DEA schedules on medications and compound ingredients. * [Practitioner Log](practitioner-log.md): retrieve the controlled prescriptions a practitioner signed in a period. diff --git a/docs/modules/eprescription/epcs/dea-schedules.md b/docs/modules/eprescription/epcs/dea-schedules.md new file mode 100644 index 000000000..19704b6d4 --- /dev/null +++ b/docs/modules/eprescription/epcs/dea-schedules.md @@ -0,0 +1,164 @@ +--- +description: Store DEA schedules on medications and compound ingredients, and see how the Aidbox ePrescription module classifies a controlled prescription from them. +--- + +# DEA Schedules + +The module treats a prescription as a **controlled prescription** when its medication has a DEA schedule. +The EHR stores the schedule the practitioner reviewed, and the module reads it from the prescription's medication. + +## Store a DEA Schedule + +Store the schedule in the `http://aidbox.app/ePrescription/FHIRSchema/medication-dea-schedule` extension of the medication code: + +* `MedicationRequest.medicationCodeableConcept` for a prescription without a `Medication` resource +* `Medication.code` for a `Medication` that is not a compound +* `Medication.ingredient.itemCodeableConcept` for each scheduled ingredient of a compound + +The extension's `valueCodeableConcept` holds one coding under `http://terminology.hl7.org/CodeSystem/v2-0477` with one of the codes `I`, `II`, `III`, `IV`, or `V`. +Give each code at most one schedule extension, with one coding under that system. +An extension that holds only `text` stores no schedule. + +
+ +Schedule extension + +```json +{ + "url": "http://aidbox.app/ePrescription/FHIRSchema/medication-dea-schedule", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v2-0477", + "code": "II", + "display": "Schedule II" + } + ] + } +} +``` + +
+ +## Compound Medications + +The module treats a `Medication` as a compound when either is true: + +* its `http://aidbox.app/ePrescription/FHIRSchema/medication-is-compound` extension has `valueBoolean: true` +* it has `ingredient` entries and `Medication.code` has no NDC coding + +The ingredients decide the schedule of a compound. +A compound with at least one scheduled ingredient is a **controlled prescription**, and the strictest ingredient schedule is its schedule. +`I` is the strictest and `V` the least strict, so a compound with a Schedule II and a Schedule IV ingredient follows the rules of Schedule II. + +A schedule on `Medication.code` of a compound is optional. +When you store one, it must equal the strictest ingredient schedule. +The module never classifies a compound by that schedule. + +Only an active ingredient can have a schedule, so leave the extension out of an ingredient with `isActive: false`. + +
+ +Compound with a scheduled ingredient + +```json +{ + "resourceType": "Medication", + "id": "compound-example", + "code": { + "text": "Hydrocodone 1 mg/mL in oral suspension base" + }, + "extension": [ + { + "url": "http://aidbox.app/ePrescription/FHIRSchema/medication-is-compound", + "valueBoolean": true + } + ], + "ingredient": [ + { + "itemCodeableConcept": { + "text": "Hydrocodone bitartrate powder", + "coding": [ + { + "system": "http://hl7.org/fhir/sid/ndc", + "code": "38779052405" + } + ], + "extension": [ + { + "url": "http://aidbox.app/ePrescription/FHIRSchema/medication-dea-schedule", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v2-0477", + "code": "II" + } + ] + } + } + ] + }, + "isActive": true + }, + { + "itemCodeableConcept": { + "text": "Oral suspension base" + }, + "isActive": false + } + ] +} +``` + +
+ +### Ingredient NDCs + +When EPCS is enabled (`EPCS_MODE=full`), each scheduled ingredient of a controlled compound needs an 11-digit NDC. +Store it as a coding under `http://hl7.org/fhir/sid/ndc` in the ingredient's `itemCodeableConcept`. + +The module sends every 11-digit ingredient NDC to the pharmacy in `CompoundIngredient/ItemNumber`, whether or not the ingredient has a schedule. + +## Schedules in NCPDP Messages + +The module sends each schedule in `DEASchedule/Code` as the NCPDP DEASchedule code: + +* `I`: `C48672` +* `II`: `C48675` +* `III`: `C48676` +* `IV`: `C48677` +* `V`: `C48679` + +`DrugCoded/DEASchedule` carries the schedule that classifies the prescription, and `CompoundIngredient/DEASchedule` carries the schedule of each ingredient. + +## Schedule Checks + +The module checks the schedules when you send a [NewRx](../prescribing/newrx-message.md) or respond to a [renewal](../prescribing/pharmacy-initiated-messages/rx-renewal.md) or [change](../prescribing/pharmacy-initiated-messages/rx-change.md) request. +It skips the compound checks for a denied or pending response and for an approved prior-authorization change response. + +When EPCS is disabled (`EPCS_MODE=disabled`), the module rejects a controlled prescription with `epcs-disabled`, including a compound with a scheduled ingredient. + +A request for one prescription that fails a check returns `422` with an `OperationOutcome`. +For a group submission that still sends other prescriptions, `failures[].reason` holds the error code of each prescription the module did not send. +For an error about a compound, `in` in the issue's `diagnostics` points to the root medication (`["Medication"]`) or to the ingredient (`["Medication", "ingredient", ]`). + +
+ +Error Responses + +* The root medication code, `Medication.code` or `MedicationRequest.medicationCodeableConcept`: + * `medication-has-multiple-dea-schedules`: the code has more than one schedule extension, or more than one coding under `http://terminology.hl7.org/CodeSystem/v2-0477` in one extension. + * `dea-schedule-coding-system-is-not-supported`: a schedule extension has codings, and none of them holds a code under `http://terminology.hl7.org/CodeSystem/v2-0477`. + * `controlled-substance-invalid-dea-schedule`: the schedule is not one of `I` to `V`. + * `compound-root-dea-schedule-without-ingredient-schedules`: the code of a compound has a schedule, and no ingredient has one. + * `compound-root-dea-schedule-mismatch`: the code of a compound has a schedule other than the strictest ingredient schedule. +* A compound ingredient: + * `compound-ingredient-has-multiple-dea-schedules`: the ingredient has more than one schedule extension, or more than one coding under `http://terminology.hl7.org/CodeSystem/v2-0477` in one extension. + * `compound-ingredient-dea-schedule-coding-system-is-not-supported`: a schedule extension has codings, and none of them is under `http://terminology.hl7.org/CodeSystem/v2-0477`. + * `compound-ingredient-invalid-dea-schedule`: the schedule is not one of `I` to `V`, or its coding has no code. + * `compound-inactive-ingredient-has-dea-schedule`: an ingredient with `isActive: false` has a schedule. +* A scheduled ingredient of a controlled compound, when EPCS is enabled: + * `controlled-compound-ingredient-missing-ndc`: the ingredient has no NDC. + * `controlled-compound-ingredient-invalid-ndc`: the ingredient's NDC does not have 11 digits. + +
From bb94180fb43981a8ff76e162bac74ce3ebf988a2 Mon Sep 17 00:00:00 2001 From: GAlemsky Date: Thu, 19 Nov 2026 14:11:01 +0600 Subject: [PATCH 02/14] eRx: state how a codeless ingredient NDC coding is reported --- docs/modules/eprescription/epcs/dea-schedules.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/modules/eprescription/epcs/dea-schedules.md b/docs/modules/eprescription/epcs/dea-schedules.md index 19704b6d4..8d710cb57 100644 --- a/docs/modules/eprescription/epcs/dea-schedules.md +++ b/docs/modules/eprescription/epcs/dea-schedules.md @@ -158,7 +158,7 @@ For an error about a compound, `in` in the issue's `diagnostics` points to the r * `compound-ingredient-invalid-dea-schedule`: the schedule is not one of `I` to `V`, or its coding has no code. * `compound-inactive-ingredient-has-dea-schedule`: an ingredient with `isActive: false` has a schedule. * A scheduled ingredient of a controlled compound, when EPCS is enabled: - * `controlled-compound-ingredient-missing-ndc`: the ingredient has no NDC. - * `controlled-compound-ingredient-invalid-ndc`: the ingredient's NDC does not have 11 digits. + * `controlled-compound-ingredient-missing-ndc`: the ingredient has no coding under `http://hl7.org/fhir/sid/ndc`. + * `controlled-compound-ingredient-invalid-ndc`: the ingredient's NDC coding has no code, or its code does not have 11 digits. From bbfe9701ac0385340bc771330188a343fbd84399 Mon Sep 17 00:00:00 2001 From: GAlemsky Date: Thu, 19 Nov 2026 18:33:17 +0600 Subject: [PATCH 03/14] eRx: clarify the DEA schedules page wording and error reporting Name the controlled prescription and the NCIt code correctly, list the schedule checks that non-fillable responses run, and state when a group submission reports schedule errors in failures[].reason instead of a 422. Co-Authored-By: Claude Opus 5.5 --- .../eprescription/epcs/dea-schedules.md | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/docs/modules/eprescription/epcs/dea-schedules.md b/docs/modules/eprescription/epcs/dea-schedules.md index 8d710cb57..f0afe2c48 100644 --- a/docs/modules/eprescription/epcs/dea-schedules.md +++ b/docs/modules/eprescription/epcs/dea-schedules.md @@ -12,7 +12,7 @@ The EHR stores the schedule the practitioner reviewed, and the module reads it f Store the schedule in the `http://aidbox.app/ePrescription/FHIRSchema/medication-dea-schedule` extension of the medication code: * `MedicationRequest.medicationCodeableConcept` for a prescription without a `Medication` resource -* `Medication.code` for a `Medication` that is not a compound +* `Medication.code` for a `Medication` that is not a [compound](#compound-medications) * `Medication.ingredient.itemCodeableConcept` for each scheduled ingredient of a compound The extension's `valueCodeableConcept` holds one coding under `http://terminology.hl7.org/CodeSystem/v2-0477` with one of the codes `I`, `II`, `III`, `IV`, or `V`. @@ -48,7 +48,7 @@ The module treats a `Medication` as a compound when either is true: * it has `ingredient` entries and `Medication.code` has no NDC coding The ingredients decide the schedule of a compound. -A compound with at least one scheduled ingredient is a **controlled prescription**, and the strictest ingredient schedule is its schedule. +A prescription whose compound has at least one scheduled ingredient is a **controlled prescription**, and the strictest ingredient schedule is its schedule. `I` is the strictest and `V` the least strict, so a compound with a Schedule II and a Schedule IV ingredient follows the rules of Schedule II. A schedule on `Medication.code` of a compound is optional. @@ -114,14 +114,14 @@ Only an active ingredient can have a schedule, so leave the extension out of an ### Ingredient NDCs -When EPCS is enabled (`EPCS_MODE=full`), each scheduled ingredient of a controlled compound needs an 11-digit NDC. +When EPCS is enabled (`EPCS_MODE=full`), each scheduled ingredient of a compound needs an 11-digit NDC. Store it as a coding under `http://hl7.org/fhir/sid/ndc` in the ingredient's `itemCodeableConcept`. The module sends every 11-digit ingredient NDC to the pharmacy in `CompoundIngredient/ItemNumber`, whether or not the ingredient has a schedule. ## Schedules in NCPDP Messages -The module sends each schedule in `DEASchedule/Code` as the NCPDP DEASchedule code: +The module sends each schedule in `DEASchedule/Code` as its NCI Thesaurus (NCIt) code: * `I`: `C48672` * `II`: `C48675` @@ -129,18 +129,29 @@ The module sends each schedule in `DEASchedule/Code` as the NCPDP DEASchedule co * `IV`: `C48677` * `V`: `C48679` -`DrugCoded/DEASchedule` carries the schedule that classifies the prescription, and `CompoundIngredient/DEASchedule` carries the schedule of each ingredient. +`DrugCoded/DEASchedule` carries the schedule of the prescription: + +* for a compound, the strictest ingredient schedule +* for any other medication, the schedule stored on its code + +`CompoundIngredient/DEASchedule` carries the schedule of each ingredient. ## Schedule Checks The module checks the schedules when you send a [NewRx](../prescribing/newrx-message.md) or respond to a [renewal](../prescribing/pharmacy-initiated-messages/rx-renewal.md) or [change](../prescribing/pharmacy-initiated-messages/rx-change.md) request. -It skips the compound checks for a denied or pending response and for an approved prior-authorization change response. +It runs every check below for a NewRx and for a response that lets the pharmacy fill the prescription. +For these responses, the module runs only `medication-has-multiple-dea-schedules` and `dea-schedule-coding-system-is-not-supported`: + +* a denied response +* a pending response +* an approved prior-authorization change response When EPCS is disabled (`EPCS_MODE=disabled`), the module rejects a controlled prescription with `epcs-disabled`, including a compound with a scheduled ingredient. -A request for one prescription that fails a check returns `422` with an `OperationOutcome`. -For a group submission that still sends other prescriptions, `failures[].reason` holds the error code of each prescription the module did not send. -For an error about a compound, `in` in the issue's `diagnostics` points to the root medication (`["Medication"]`) or to the ingredient (`["Medication", "ingredient", ]`). +A request that fails a check returns `422` with an `OperationOutcome`. +For an error about a compound, the issue's `diagnostics` holds a JSON object whose `in` field points to the root medication (`["Medication"]`) or to the ingredient (`["Medication", "ingredient", ]`). + +When the module sent other prescriptions of a group earlier, a group submission that fails a check returns `202` instead, and `failures[].reason` holds the error code of each prescription it did not send.
@@ -155,9 +166,9 @@ For an error about a compound, `in` in the issue's `diagnostics` points to the r * A compound ingredient: * `compound-ingredient-has-multiple-dea-schedules`: the ingredient has more than one schedule extension, or more than one coding under `http://terminology.hl7.org/CodeSystem/v2-0477` in one extension. * `compound-ingredient-dea-schedule-coding-system-is-not-supported`: a schedule extension has codings, and none of them is under `http://terminology.hl7.org/CodeSystem/v2-0477`. - * `compound-ingredient-invalid-dea-schedule`: the schedule is not one of `I` to `V`, or its coding has no code. + * `compound-ingredient-invalid-dea-schedule`: the schedule is not one of `I` to `V`, or a schedule extension's codings under `http://terminology.hl7.org/CodeSystem/v2-0477` have no code. * `compound-inactive-ingredient-has-dea-schedule`: an ingredient with `isActive: false` has a schedule. -* A scheduled ingredient of a controlled compound, when EPCS is enabled: +* A scheduled ingredient of a compound, when EPCS is enabled: * `controlled-compound-ingredient-missing-ndc`: the ingredient has no coding under `http://hl7.org/fhir/sid/ndc`. * `controlled-compound-ingredient-invalid-ndc`: the ingredient's NDC coding has no code, or its code does not have 11 digits. From 34b1646bbf47939b3b59589227e59a9de5815e11 Mon Sep 17 00:00:00 2001 From: GAlemsky Date: Thu, 19 Nov 2026 19:05:13 +0600 Subject: [PATCH 04/14] eRx: simplify the DEA schedules page checks and error wording Co-Authored-By: Claude Opus 5.5 --- .../eprescription/epcs/dea-schedules.md | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/docs/modules/eprescription/epcs/dea-schedules.md b/docs/modules/eprescription/epcs/dea-schedules.md index f0afe2c48..392eebf12 100644 --- a/docs/modules/eprescription/epcs/dea-schedules.md +++ b/docs/modules/eprescription/epcs/dea-schedules.md @@ -16,7 +16,7 @@ Store the schedule in the `http://aidbox.app/ePrescription/FHIRSchema/medication * `Medication.ingredient.itemCodeableConcept` for each scheduled ingredient of a compound The extension's `valueCodeableConcept` holds one coding under `http://terminology.hl7.org/CodeSystem/v2-0477` with one of the codes `I`, `II`, `III`, `IV`, or `V`. -Give each code at most one schedule extension, with one coding under that system. +Give each medication code at most one schedule extension. An extension that holds only `text` stores no schedule.
@@ -42,13 +42,14 @@ An extension that holds only `text` stores no schedule. ## Compound Medications -The module treats a `Medication` as a compound when either is true: +The module treats a `Medication` as a compound when either of these is true: * its `http://aidbox.app/ePrescription/FHIRSchema/medication-is-compound` extension has `valueBoolean: true` * it has `ingredient` entries and `Medication.code` has no NDC coding The ingredients decide the schedule of a compound. -A prescription whose compound has at least one scheduled ingredient is a **controlled prescription**, and the strictest ingredient schedule is its schedule. +A prescription whose compound has at least one scheduled ingredient is a **controlled prescription**. +Its schedule is the strictest ingredient schedule. `I` is the strictest and `V` the least strict, so a compound with a Schedule II and a Schedule IV ingredient follows the rules of Schedule II. A schedule on `Medication.code` of a compound is optional. @@ -114,7 +115,7 @@ Only an active ingredient can have a schedule, so leave the extension out of an ### Ingredient NDCs -When EPCS is enabled (`EPCS_MODE=full`), each scheduled ingredient of a compound needs an 11-digit NDC. +Each scheduled ingredient of a compound needs an 11-digit NDC. Store it as a coding under `http://hl7.org/fhir/sid/ndc` in the ingredient's `itemCodeableConcept`. The module sends every 11-digit ingredient NDC to the pharmacy in `CompoundIngredient/ItemNumber`, whether or not the ingredient has a schedule. @@ -139,27 +140,27 @@ The module sends each schedule in `DEASchedule/Code` as its NCI Thesaurus (NCIt) ## Schedule Checks The module checks the schedules when you send a [NewRx](../prescribing/newrx-message.md) or respond to a [renewal](../prescribing/pharmacy-initiated-messages/rx-renewal.md) or [change](../prescribing/pharmacy-initiated-messages/rx-change.md) request. -It runs every check below for a NewRx and for a response that lets the pharmacy fill the prescription. -For these responses, the module runs only `medication-has-multiple-dea-schedules` and `dea-schedule-coding-system-is-not-supported`: +The checks it runs depend on the request: -* a denied response -* a pending response -* an approved prior-authorization change response +* a NewRx, or a response that lets the pharmacy fill the prescription: every check in the Error Responses list below +* a denied response, a pending response, or an approved prior-authorization change response: only `medication-has-multiple-dea-schedules` and `dea-schedule-coding-system-is-not-supported` When EPCS is disabled (`EPCS_MODE=disabled`), the module rejects a controlled prescription with `epcs-disabled`, including a compound with a scheduled ingredient. +It does not reject a denied response this way. A request that fails a check returns `422` with an `OperationOutcome`. -For an error about a compound, the issue's `diagnostics` holds a JSON object whose `in` field points to the root medication (`["Medication"]`) or to the ingredient (`["Medication", "ingredient", ]`). +For an error about a compound, the issue's `diagnostics` holds a JSON object whose `in` field points to the `Medication` (`["Medication"]`) or to the ingredient (`["Medication", "ingredient", ]`). -When the module sent other prescriptions of a group earlier, a group submission that fails a check returns `202` instead, and `failures[].reason` holds the error code of each prescription it did not send. +A group submission returns `202` instead when the module sent some prescriptions of the group in an earlier submission. +Its `failures[].reason` holds the error code of each prescription that the module did not send.
Error Responses -* The root medication code, `Medication.code` or `MedicationRequest.medicationCodeableConcept`: +* The medication code (`Medication.code` or `MedicationRequest.medicationCodeableConcept`): * `medication-has-multiple-dea-schedules`: the code has more than one schedule extension, or more than one coding under `http://terminology.hl7.org/CodeSystem/v2-0477` in one extension. - * `dea-schedule-coding-system-is-not-supported`: a schedule extension has codings, and none of them holds a code under `http://terminology.hl7.org/CodeSystem/v2-0477`. + * `dea-schedule-coding-system-is-not-supported`: a schedule extension has codings, and none of them is a coding under `http://terminology.hl7.org/CodeSystem/v2-0477` that has a code. * `controlled-substance-invalid-dea-schedule`: the schedule is not one of `I` to `V`. * `compound-root-dea-schedule-without-ingredient-schedules`: the code of a compound has a schedule, and no ingredient has one. * `compound-root-dea-schedule-mismatch`: the code of a compound has a schedule other than the strictest ingredient schedule. @@ -168,7 +169,7 @@ When the module sent other prescriptions of a group earlier, a group submission * `compound-ingredient-dea-schedule-coding-system-is-not-supported`: a schedule extension has codings, and none of them is under `http://terminology.hl7.org/CodeSystem/v2-0477`. * `compound-ingredient-invalid-dea-schedule`: the schedule is not one of `I` to `V`, or a schedule extension's codings under `http://terminology.hl7.org/CodeSystem/v2-0477` have no code. * `compound-inactive-ingredient-has-dea-schedule`: an ingredient with `isActive: false` has a schedule. -* A scheduled ingredient of a compound, when EPCS is enabled: +* A scheduled ingredient of a compound: * `controlled-compound-ingredient-missing-ndc`: the ingredient has no coding under `http://hl7.org/fhir/sid/ndc`. * `controlled-compound-ingredient-invalid-ndc`: the ingredient's NDC coding has no code, or its code does not have 11 digits. From 71adccbf971d16117e7da7e508ef407574558f08 Mon Sep 17 00:00:00 2001 From: GAlemsky Date: Fri, 20 Nov 2026 12:47:52 +0600 Subject: [PATCH 05/14] eRx: move compound medications to the prescribing guide --- SUMMARY.md | 1 + docs/modules/eprescription/epcs/README.md | 2 +- .../eprescription/epcs/dea-schedules.md | 109 ++--------------- .../prescribing/compound-medications.md | 114 ++++++++++++++++++ 4 files changed, 123 insertions(+), 103 deletions(-) create mode 100644 docs/modules/eprescription/prescribing/compound-medications.md diff --git a/SUMMARY.md b/SUMMARY.md index dd58a515f..db56eaf6c 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -431,6 +431,7 @@ * [Pharmacies Synchronization](modules/eprescription/pharmacies-synchronization.md) * [Prescribing](modules/eprescription/prescribing/README.md) * [NewRx Message](modules/eprescription/prescribing/newrx-message.md) + * [Compound Medications](modules/eprescription/prescribing/compound-medications.md) * [CancelRx Message](modules/eprescription/prescribing/cancelrx-message.md) * [RxFillIndicatorChange Message](modules/eprescription/prescribing/rx-fill-indicator-change.md) * [Pharmacy-initiated messages](modules/eprescription/prescribing/pharmacy-initiated-messages/README.md) diff --git a/docs/modules/eprescription/epcs/README.md b/docs/modules/eprescription/epcs/README.md index c7ee1b073..80198f759 100644 --- a/docs/modules/eprescription/epcs/README.md +++ b/docs/modules/eprescription/epcs/README.md @@ -10,5 +10,5 @@ The module does not support prescribing controlled substances yet, but we are wo * [Enable EPCS](enable-epcs.md): configure the module and your EHR so that prescribers can sign controlled prescriptions. * [EPCS Access Management](access-management/README.md): appoint the people who manage EPCS access at each location. -* [DEA Schedules](dea-schedules.md): store DEA schedules on medications and compound ingredients. +* [DEA Schedules](dea-schedules.md): store and validate medication schedules. * [Practitioner Log](practitioner-log.md): retrieve the controlled prescriptions a practitioner signed in a period. diff --git a/docs/modules/eprescription/epcs/dea-schedules.md b/docs/modules/eprescription/epcs/dea-schedules.md index 392eebf12..f18a2db0c 100644 --- a/docs/modules/eprescription/epcs/dea-schedules.md +++ b/docs/modules/eprescription/epcs/dea-schedules.md @@ -1,5 +1,5 @@ --- -description: Store DEA schedules on medications and compound ingredients, and see how the Aidbox ePrescription module classifies a controlled prescription from them. +description: Store a DEA schedule on a medication and check how the ePrescription module validates and sends it to the pharmacy. --- # DEA Schedules @@ -12,8 +12,9 @@ The EHR stores the schedule the practitioner reviewed, and the module reads it f Store the schedule in the `http://aidbox.app/ePrescription/FHIRSchema/medication-dea-schedule` extension of the medication code: * `MedicationRequest.medicationCodeableConcept` for a prescription without a `Medication` resource -* `Medication.code` for a `Medication` that is not a [compound](#compound-medications) -* `Medication.ingredient.itemCodeableConcept` for each scheduled ingredient of a compound +* `Medication.code` for a `Medication` that is not a compound + +For a compound, store the schedule on each scheduled ingredient as described in [Compound Medications](../prescribing/compound-medications.md#ingredient-schedules). The extension's `valueCodeableConcept` holds one coding under `http://terminology.hl7.org/CodeSystem/v2-0477` with one of the codes `I`, `II`, `III`, `IV`, or `V`. Give each medication code at most one schedule extension. @@ -40,86 +41,6 @@ An extension that holds only `text` stores no schedule.
-## Compound Medications - -The module treats a `Medication` as a compound when either of these is true: - -* its `http://aidbox.app/ePrescription/FHIRSchema/medication-is-compound` extension has `valueBoolean: true` -* it has `ingredient` entries and `Medication.code` has no NDC coding - -The ingredients decide the schedule of a compound. -A prescription whose compound has at least one scheduled ingredient is a **controlled prescription**. -Its schedule is the strictest ingredient schedule. -`I` is the strictest and `V` the least strict, so a compound with a Schedule II and a Schedule IV ingredient follows the rules of Schedule II. - -A schedule on `Medication.code` of a compound is optional. -When you store one, it must equal the strictest ingredient schedule. -The module never classifies a compound by that schedule. - -Only an active ingredient can have a schedule, so leave the extension out of an ingredient with `isActive: false`. - -
- -Compound with a scheduled ingredient - -```json -{ - "resourceType": "Medication", - "id": "compound-example", - "code": { - "text": "Hydrocodone 1 mg/mL in oral suspension base" - }, - "extension": [ - { - "url": "http://aidbox.app/ePrescription/FHIRSchema/medication-is-compound", - "valueBoolean": true - } - ], - "ingredient": [ - { - "itemCodeableConcept": { - "text": "Hydrocodone bitartrate powder", - "coding": [ - { - "system": "http://hl7.org/fhir/sid/ndc", - "code": "38779052405" - } - ], - "extension": [ - { - "url": "http://aidbox.app/ePrescription/FHIRSchema/medication-dea-schedule", - "valueCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/v2-0477", - "code": "II" - } - ] - } - } - ] - }, - "isActive": true - }, - { - "itemCodeableConcept": { - "text": "Oral suspension base" - }, - "isActive": false - } - ] -} -``` - -
- -### Ingredient NDCs - -Each scheduled ingredient of a compound needs an 11-digit NDC. -Store it as a coding under `http://hl7.org/fhir/sid/ndc` in the ingredient's `itemCodeableConcept`. - -The module sends every 11-digit ingredient NDC to the pharmacy in `CompoundIngredient/ItemNumber`, whether or not the ingredient has a schedule. - ## Schedules in NCPDP Messages The module sends each schedule in `DEASchedule/Code` as its NCI Thesaurus (NCIt) code: @@ -130,26 +51,20 @@ The module sends each schedule in `DEASchedule/Code` as its NCI Thesaurus (NCIt) * `IV`: `C48677` * `V`: `C48679` -`DrugCoded/DEASchedule` carries the schedule of the prescription: - -* for a compound, the strictest ingredient schedule -* for any other medication, the schedule stored on its code - -`CompoundIngredient/DEASchedule` carries the schedule of each ingredient. +`DrugCoded/DEASchedule` carries the prescription's schedule. ## Schedule Checks The module checks the schedules when you send a [NewRx](../prescribing/newrx-message.md) or respond to a [renewal](../prescribing/pharmacy-initiated-messages/rx-renewal.md) or [change](../prescribing/pharmacy-initiated-messages/rx-change.md) request. The checks it runs depend on the request: -* a NewRx, or a response that lets the pharmacy fill the prescription: every check in the Error Responses list below +* a NewRx, or a response that lets the pharmacy fill the prescription: the medication code checks below and, for compounds, the [compound schedule checks](../prescribing/compound-medications.md#schedule-checks) * a denied response, a pending response, or an approved prior-authorization change response: only `medication-has-multiple-dea-schedules` and `dea-schedule-coding-system-is-not-supported` -When EPCS is disabled (`EPCS_MODE=disabled`), the module rejects a controlled prescription with `epcs-disabled`, including a compound with a scheduled ingredient. +When EPCS is disabled (`EPCS_MODE=disabled`), the module rejects a controlled prescription with `epcs-disabled`. It does not reject a denied response this way. A request that fails a check returns `422` with an `OperationOutcome`. -For an error about a compound, the issue's `diagnostics` holds a JSON object whose `in` field points to the `Medication` (`["Medication"]`) or to the ingredient (`["Medication", "ingredient", ]`). A group submission returns `202` instead when the module sent some prescriptions of the group in an earlier submission. Its `failures[].reason` holds the error code of each prescription that the module did not send. @@ -162,15 +77,5 @@ Its `failures[].reason` holds the error code of each prescription that the modul * `medication-has-multiple-dea-schedules`: the code has more than one schedule extension, or more than one coding under `http://terminology.hl7.org/CodeSystem/v2-0477` in one extension. * `dea-schedule-coding-system-is-not-supported`: a schedule extension has codings, and none of them is a coding under `http://terminology.hl7.org/CodeSystem/v2-0477` that has a code. * `controlled-substance-invalid-dea-schedule`: the schedule is not one of `I` to `V`. - * `compound-root-dea-schedule-without-ingredient-schedules`: the code of a compound has a schedule, and no ingredient has one. - * `compound-root-dea-schedule-mismatch`: the code of a compound has a schedule other than the strictest ingredient schedule. -* A compound ingredient: - * `compound-ingredient-has-multiple-dea-schedules`: the ingredient has more than one schedule extension, or more than one coding under `http://terminology.hl7.org/CodeSystem/v2-0477` in one extension. - * `compound-ingredient-dea-schedule-coding-system-is-not-supported`: a schedule extension has codings, and none of them is under `http://terminology.hl7.org/CodeSystem/v2-0477`. - * `compound-ingredient-invalid-dea-schedule`: the schedule is not one of `I` to `V`, or a schedule extension's codings under `http://terminology.hl7.org/CodeSystem/v2-0477` have no code. - * `compound-inactive-ingredient-has-dea-schedule`: an ingredient with `isActive: false` has a schedule. -* A scheduled ingredient of a compound: - * `controlled-compound-ingredient-missing-ndc`: the ingredient has no coding under `http://hl7.org/fhir/sid/ndc`. - * `controlled-compound-ingredient-invalid-ndc`: the ingredient's NDC coding has no code, or its code does not have 11 digits.
diff --git a/docs/modules/eprescription/prescribing/compound-medications.md b/docs/modules/eprescription/prescribing/compound-medications.md new file mode 100644 index 000000000..3b2ea6983 --- /dev/null +++ b/docs/modules/eprescription/prescribing/compound-medications.md @@ -0,0 +1,114 @@ +--- +description: Represent compound medications in FHIR and send ingredient schedules and National Drug Codes to the pharmacy. +--- + +# Compound Medications + +The ePrescription module treats a FHIR `Medication` as a compound if either condition holds. + +* Its `http://aidbox.app/ePrescription/FHIRSchema/medication-is-compound` extension has `valueBoolean: true`. +* It has `ingredient` entries and no National Drug Code (NDC) in `Medication.code`. + +## Ingredient Schedules + +Store the [DEA schedule extension](../epcs/dea-schedules.md#store-a-dea-schedule) on `Medication.ingredient.itemCodeableConcept` for each scheduled ingredient. +Omit it for ingredients with `isActive: false`. + +If a compound has at least one scheduled ingredient, the module treats its prescription as a **controlled prescription**. +The strictest ingredient schedule determines the prescription's schedule, with I the strictest and V the least strict. +For example, a compound with a Schedule II ingredient and a Schedule IV ingredient has Schedule II. +If you also store a schedule on `Medication.code`, it must match the strictest ingredient schedule. + +In the NCPDP message, the module sends the compound's schedule in `DrugCoded/DEASchedule` and each scheduled ingredient's schedule in `CompoundIngredient/DEASchedule`. +Both fields use the [NCI Thesaurus codes for DEA schedules](../epcs/dea-schedules.md#schedules-in-ncpdp-messages). + +
+ +Compound with a scheduled ingredient + +```json +{ + "resourceType": "Medication", + "id": "compound-example", + "code": { + "text": "Hydrocodone 1 mg/mL in oral suspension base" + }, + "extension": [ + { + "url": "http://aidbox.app/ePrescription/FHIRSchema/medication-is-compound", + "valueBoolean": true + } + ], + "ingredient": [ + { + "itemCodeableConcept": { + "text": "Hydrocodone bitartrate powder", + "coding": [ + { + "system": "http://hl7.org/fhir/sid/ndc", + "code": "38779052405" + } + ], + "extension": [ + { + "url": "http://aidbox.app/ePrescription/FHIRSchema/medication-dea-schedule", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v2-0477", + "code": "II" + } + ] + } + } + ] + }, + "isActive": true + }, + { + "itemCodeableConcept": { + "text": "Oral suspension base" + }, + "isActive": false + } + ] +} +``` + +
+ +## Ingredient NDCs + +Each scheduled ingredient of a compound needs an 11-digit NDC. +Store it as a coding under `http://hl7.org/fhir/sid/ndc` in the ingredient's `itemCodeableConcept`. + +The module sends every 11-digit ingredient NDC to the pharmacy in `CompoundIngredient/ItemNumber`, whether or not the ingredient has a schedule. + +## Schedule Checks + +The module checks compound ingredients for a NewRx or a response that lets the pharmacy fill the prescription. +See [Schedule Checks](../epcs/dea-schedules.md#schedule-checks) for the checks on the medication code, other response types, and group submissions. + +For a compound error, the `OperationOutcome.issue.diagnostics` field contains a JSON object. +Its `in` field identifies where to look. + +* `["Medication"]` points to the compound. +* `["Medication", "ingredient", ]` points to the ingredient at that index. + +
+ +Error Responses + +* The compound's `Medication.code`: + * `compound-root-dea-schedule-without-ingredient-schedules`: the code of a compound has a schedule, and no ingredient has one. + * `compound-root-dea-schedule-mismatch`: the code of a compound has a schedule other than the strictest ingredient schedule. +* A compound ingredient: + * `compound-ingredient-has-multiple-dea-schedules`: the ingredient has more than one schedule extension, or more than one coding under `http://terminology.hl7.org/CodeSystem/v2-0477` in one extension. + * `compound-ingredient-dea-schedule-coding-system-is-not-supported`: a schedule extension has codings, and none of them is under `http://terminology.hl7.org/CodeSystem/v2-0477`. + * `compound-ingredient-invalid-dea-schedule`: the schedule is not one of `I` to `V`, or a schedule extension's codings under `http://terminology.hl7.org/CodeSystem/v2-0477` have no code. + * `compound-inactive-ingredient-has-dea-schedule`: an ingredient with `isActive: false` has a schedule. +* A scheduled ingredient of a compound: + * `controlled-compound-ingredient-missing-ndc`: the ingredient has no coding under `http://hl7.org/fhir/sid/ndc`. + * `controlled-compound-ingredient-invalid-ndc`: the ingredient's NDC coding has no code, or its code does not have 11 digits. + +
From 70d3bc42b57b32a0f43e562eb7851816952e96a5 Mon Sep 17 00:00:00 2001 From: GAlemsky Date: Fri, 20 Nov 2026 12:53:50 +0600 Subject: [PATCH 06/14] eRx: list medication and ingredient schedules together --- .../eprescription/epcs/dea-schedules.md | 65 +++++++++---------- 1 file changed, 30 insertions(+), 35 deletions(-) diff --git a/docs/modules/eprescription/epcs/dea-schedules.md b/docs/modules/eprescription/epcs/dea-schedules.md index f18a2db0c..d70ddaee0 100644 --- a/docs/modules/eprescription/epcs/dea-schedules.md +++ b/docs/modules/eprescription/epcs/dea-schedules.md @@ -1,28 +1,27 @@ --- -description: Store a DEA schedule on a medication and check how the ePrescription module validates and sends it to the pharmacy. +description: Store DEA schedules on FHIR medication and ingredient codes and read the corresponding schedules in NCPDP messages. --- # DEA Schedules -The module treats a prescription as a **controlled prescription** when its medication has a DEA schedule. -The EHR stores the schedule the practitioner reviewed, and the module reads it from the prescription's medication. +The EHR records the DEA schedule the practitioner reviewed. The ePrescription module treats a prescription for a scheduled medication as a **controlled prescription**. +For a compound, any scheduled ingredient makes the prescription controlled. The strictest ingredient schedule determines the prescription's schedule. ## Store a DEA Schedule -Store the schedule in the `http://aidbox.app/ePrescription/FHIRSchema/medication-dea-schedule` extension of the medication code: +Store the schedule in the `http://aidbox.app/ePrescription/FHIRSchema/medication-dea-schedule` extension on the appropriate FHIR field. -* `MedicationRequest.medicationCodeableConcept` for a prescription without a `Medication` resource -* `Medication.code` for a `Medication` that is not a compound +* If the prescription specifies the drug by code, use `MedicationRequest.medicationCodeableConcept`. +* If the prescription references or contains a `Medication` resource, use `Medication.code` for the medication's schedule. For a compound, omit the schedule here or repeat the strictest ingredient schedule. +* For each scheduled ingredient of a [compound medication](../prescribing/compound-medications.md#ingredient-schedules), use `Medication.ingredient.itemCodeableConcept`. -For a compound, store the schedule on each scheduled ingredient as described in [Compound Medications](../prescribing/compound-medications.md#ingredient-schedules). - -The extension's `valueCodeableConcept` holds one coding under `http://terminology.hl7.org/CodeSystem/v2-0477` with one of the codes `I`, `II`, `III`, `IV`, or `V`. -Give each medication code at most one schedule extension. -An extension that holds only `text` stores no schedule. +Use at most one schedule extension on each medication or ingredient code. +In its `valueCodeableConcept.coding`, use the system `http://terminology.hl7.org/CodeSystem/v2-0477` and one code from `I` through `V`. +A `valueCodeableConcept` with only `text` supplies no schedule.
-Schedule extension +Schedule II extension ```json { @@ -43,39 +42,35 @@ An extension that holds only `text` stores no schedule. ## Schedules in NCPDP Messages -The module sends each schedule in `DEASchedule/Code` as its NCI Thesaurus (NCIt) code: - -* `I`: `C48672` -* `II`: `C48675` -* `III`: `C48676` -* `IV`: `C48677` -* `V`: `C48679` +The module sends the prescription's schedule in `DrugCoded/DEASchedule/Code` and each scheduled compound ingredient's schedule in `CompoundIngredient/DEASchedule/Code`. +Both fields use NCI Thesaurus codes. -`DrugCoded/DEASchedule` carries the prescription's schedule. +* Schedule I maps to `C48672`. +* Schedule II maps to `C48675`. +* Schedule III maps to `C48676`. +* Schedule IV maps to `C48677`. +* Schedule V maps to `C48679`. ## Schedule Checks -The module checks the schedules when you send a [NewRx](../prescribing/newrx-message.md) or respond to a [renewal](../prescribing/pharmacy-initiated-messages/rx-renewal.md) or [change](../prescribing/pharmacy-initiated-messages/rx-change.md) request. -The checks it runs depend on the request: - -* a NewRx, or a response that lets the pharmacy fill the prescription: the medication code checks below and, for compounds, the [compound schedule checks](../prescribing/compound-medications.md#schedule-checks) -* a denied response, a pending response, or an approved prior-authorization change response: only `medication-has-multiple-dea-schedules` and `dea-schedule-coding-system-is-not-supported` +When `EPCS_MODE=disabled`, the module rejects a controlled [NewRx](../prescribing/newrx-message.md) with `epcs-disabled`. +It also rejects a [renewal](../prescribing/pharmacy-initiated-messages/rx-renewal.md) or [change](../prescribing/pharmacy-initiated-messages/rx-change.md) response for a controlled prescription unless the prescriber denies the request. -When EPCS is disabled (`EPCS_MODE=disabled`), the module rejects a controlled prescription with `epcs-disabled`. -It does not reject a denied response this way. +The schedule checks depend on what the prescriber sends. -A request that fails a check returns `422` with an `OperationOutcome`. +* For a NewRx or a response that lets the pharmacy fill a prescription, the module validates the medication's schedule. For a compound, it also [checks the ingredient schedules](../prescribing/compound-medications.md#schedule-checks). +* For a denial, a pending response, or approval of a prior-authorization change request, it checks the medication code for duplicate schedules and unsupported schedule codings. -A group submission returns `202` instead when the module sent some prescriptions of the group in an earlier submission. -Its `failures[].reason` holds the error code of each prescription that the module did not send. +If a schedule check fails, the module returns `422` with the error message in `OperationOutcome.issue[].details.text`. +If a NewRx group includes a prescription the module already sent, it returns `202` and gives the reason for each failure in `failures[].reason`.
-Error Responses +Medication schedule errors -* The medication code (`Medication.code` or `MedicationRequest.medicationCodeableConcept`): - * `medication-has-multiple-dea-schedules`: the code has more than one schedule extension, or more than one coding under `http://terminology.hl7.org/CodeSystem/v2-0477` in one extension. - * `dea-schedule-coding-system-is-not-supported`: a schedule extension has codings, and none of them is a coding under `http://terminology.hl7.org/CodeSystem/v2-0477` that has a code. - * `controlled-substance-invalid-dea-schedule`: the schedule is not one of `I` to `V`. +* `medication-has-multiple-dea-schedules` means the medication code has multiple schedule extensions, or one extension has multiple codings under the DEA schedule system. +* `dea-schedule-coding-system-is-not-supported` means the extension contains codings but none supplies a `code` under the DEA schedule system. +* `controlled-substance-missing-dea-schedule` means the schedule code for a controlled prescription is blank. +* `controlled-substance-invalid-dea-schedule` means the schedule code falls outside `I` through `V`.
From 5aa0aba4c8b36d2f96c85a902a6ee3035d65de13 Mon Sep 17 00:00:00 2001 From: GAlemsky Date: Fri, 20 Nov 2026 13:00:54 +0600 Subject: [PATCH 07/14] Revert "eRx: list medication and ingredient schedules together" This reverts commit 425747b0fd2d6978dc9b9976ba0eac66b6fd7d24. --- .../eprescription/epcs/dea-schedules.md | 65 ++++++++++--------- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/docs/modules/eprescription/epcs/dea-schedules.md b/docs/modules/eprescription/epcs/dea-schedules.md index d70ddaee0..f18a2db0c 100644 --- a/docs/modules/eprescription/epcs/dea-schedules.md +++ b/docs/modules/eprescription/epcs/dea-schedules.md @@ -1,27 +1,28 @@ --- -description: Store DEA schedules on FHIR medication and ingredient codes and read the corresponding schedules in NCPDP messages. +description: Store a DEA schedule on a medication and check how the ePrescription module validates and sends it to the pharmacy. --- # DEA Schedules -The EHR records the DEA schedule the practitioner reviewed. The ePrescription module treats a prescription for a scheduled medication as a **controlled prescription**. -For a compound, any scheduled ingredient makes the prescription controlled. The strictest ingredient schedule determines the prescription's schedule. +The module treats a prescription as a **controlled prescription** when its medication has a DEA schedule. +The EHR stores the schedule the practitioner reviewed, and the module reads it from the prescription's medication. ## Store a DEA Schedule -Store the schedule in the `http://aidbox.app/ePrescription/FHIRSchema/medication-dea-schedule` extension on the appropriate FHIR field. +Store the schedule in the `http://aidbox.app/ePrescription/FHIRSchema/medication-dea-schedule` extension of the medication code: -* If the prescription specifies the drug by code, use `MedicationRequest.medicationCodeableConcept`. -* If the prescription references or contains a `Medication` resource, use `Medication.code` for the medication's schedule. For a compound, omit the schedule here or repeat the strictest ingredient schedule. -* For each scheduled ingredient of a [compound medication](../prescribing/compound-medications.md#ingredient-schedules), use `Medication.ingredient.itemCodeableConcept`. +* `MedicationRequest.medicationCodeableConcept` for a prescription without a `Medication` resource +* `Medication.code` for a `Medication` that is not a compound -Use at most one schedule extension on each medication or ingredient code. -In its `valueCodeableConcept.coding`, use the system `http://terminology.hl7.org/CodeSystem/v2-0477` and one code from `I` through `V`. -A `valueCodeableConcept` with only `text` supplies no schedule. +For a compound, store the schedule on each scheduled ingredient as described in [Compound Medications](../prescribing/compound-medications.md#ingredient-schedules). + +The extension's `valueCodeableConcept` holds one coding under `http://terminology.hl7.org/CodeSystem/v2-0477` with one of the codes `I`, `II`, `III`, `IV`, or `V`. +Give each medication code at most one schedule extension. +An extension that holds only `text` stores no schedule.
-Schedule II extension +Schedule extension ```json { @@ -42,35 +43,39 @@ A `valueCodeableConcept` with only `text` supplies no schedule. ## Schedules in NCPDP Messages -The module sends the prescription's schedule in `DrugCoded/DEASchedule/Code` and each scheduled compound ingredient's schedule in `CompoundIngredient/DEASchedule/Code`. -Both fields use NCI Thesaurus codes. +The module sends each schedule in `DEASchedule/Code` as its NCI Thesaurus (NCIt) code: + +* `I`: `C48672` +* `II`: `C48675` +* `III`: `C48676` +* `IV`: `C48677` +* `V`: `C48679` -* Schedule I maps to `C48672`. -* Schedule II maps to `C48675`. -* Schedule III maps to `C48676`. -* Schedule IV maps to `C48677`. -* Schedule V maps to `C48679`. +`DrugCoded/DEASchedule` carries the prescription's schedule. ## Schedule Checks -When `EPCS_MODE=disabled`, the module rejects a controlled [NewRx](../prescribing/newrx-message.md) with `epcs-disabled`. -It also rejects a [renewal](../prescribing/pharmacy-initiated-messages/rx-renewal.md) or [change](../prescribing/pharmacy-initiated-messages/rx-change.md) response for a controlled prescription unless the prescriber denies the request. +The module checks the schedules when you send a [NewRx](../prescribing/newrx-message.md) or respond to a [renewal](../prescribing/pharmacy-initiated-messages/rx-renewal.md) or [change](../prescribing/pharmacy-initiated-messages/rx-change.md) request. +The checks it runs depend on the request: + +* a NewRx, or a response that lets the pharmacy fill the prescription: the medication code checks below and, for compounds, the [compound schedule checks](../prescribing/compound-medications.md#schedule-checks) +* a denied response, a pending response, or an approved prior-authorization change response: only `medication-has-multiple-dea-schedules` and `dea-schedule-coding-system-is-not-supported` -The schedule checks depend on what the prescriber sends. +When EPCS is disabled (`EPCS_MODE=disabled`), the module rejects a controlled prescription with `epcs-disabled`. +It does not reject a denied response this way. -* For a NewRx or a response that lets the pharmacy fill a prescription, the module validates the medication's schedule. For a compound, it also [checks the ingredient schedules](../prescribing/compound-medications.md#schedule-checks). -* For a denial, a pending response, or approval of a prior-authorization change request, it checks the medication code for duplicate schedules and unsupported schedule codings. +A request that fails a check returns `422` with an `OperationOutcome`. -If a schedule check fails, the module returns `422` with the error message in `OperationOutcome.issue[].details.text`. -If a NewRx group includes a prescription the module already sent, it returns `202` and gives the reason for each failure in `failures[].reason`. +A group submission returns `202` instead when the module sent some prescriptions of the group in an earlier submission. +Its `failures[].reason` holds the error code of each prescription that the module did not send.
-Medication schedule errors +Error Responses -* `medication-has-multiple-dea-schedules` means the medication code has multiple schedule extensions, or one extension has multiple codings under the DEA schedule system. -* `dea-schedule-coding-system-is-not-supported` means the extension contains codings but none supplies a `code` under the DEA schedule system. -* `controlled-substance-missing-dea-schedule` means the schedule code for a controlled prescription is blank. -* `controlled-substance-invalid-dea-schedule` means the schedule code falls outside `I` through `V`. +* The medication code (`Medication.code` or `MedicationRequest.medicationCodeableConcept`): + * `medication-has-multiple-dea-schedules`: the code has more than one schedule extension, or more than one coding under `http://terminology.hl7.org/CodeSystem/v2-0477` in one extension. + * `dea-schedule-coding-system-is-not-supported`: a schedule extension has codings, and none of them is a coding under `http://terminology.hl7.org/CodeSystem/v2-0477` that has a code. + * `controlled-substance-invalid-dea-schedule`: the schedule is not one of `I` to `V`.
From 91d8fa970583d29fce2c7f77f2d0500faf9acb09 Mon Sep 17 00:00:00 2001 From: GAlemsky Date: Fri, 20 Nov 2026 13:00:54 +0600 Subject: [PATCH 08/14] Revert "eRx: move compound medications to the prescribing guide" This reverts commit 0fdb395c0db1503dc6155f7cb77493d1645d4e7b. --- SUMMARY.md | 1 - docs/modules/eprescription/epcs/README.md | 2 +- .../eprescription/epcs/dea-schedules.md | 109 +++++++++++++++-- .../prescribing/compound-medications.md | 114 ------------------ 4 files changed, 103 insertions(+), 123 deletions(-) delete mode 100644 docs/modules/eprescription/prescribing/compound-medications.md diff --git a/SUMMARY.md b/SUMMARY.md index db56eaf6c..dd58a515f 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -431,7 +431,6 @@ * [Pharmacies Synchronization](modules/eprescription/pharmacies-synchronization.md) * [Prescribing](modules/eprescription/prescribing/README.md) * [NewRx Message](modules/eprescription/prescribing/newrx-message.md) - * [Compound Medications](modules/eprescription/prescribing/compound-medications.md) * [CancelRx Message](modules/eprescription/prescribing/cancelrx-message.md) * [RxFillIndicatorChange Message](modules/eprescription/prescribing/rx-fill-indicator-change.md) * [Pharmacy-initiated messages](modules/eprescription/prescribing/pharmacy-initiated-messages/README.md) diff --git a/docs/modules/eprescription/epcs/README.md b/docs/modules/eprescription/epcs/README.md index 80198f759..c7ee1b073 100644 --- a/docs/modules/eprescription/epcs/README.md +++ b/docs/modules/eprescription/epcs/README.md @@ -10,5 +10,5 @@ The module does not support prescribing controlled substances yet, but we are wo * [Enable EPCS](enable-epcs.md): configure the module and your EHR so that prescribers can sign controlled prescriptions. * [EPCS Access Management](access-management/README.md): appoint the people who manage EPCS access at each location. -* [DEA Schedules](dea-schedules.md): store and validate medication schedules. +* [DEA Schedules](dea-schedules.md): store DEA schedules on medications and compound ingredients. * [Practitioner Log](practitioner-log.md): retrieve the controlled prescriptions a practitioner signed in a period. diff --git a/docs/modules/eprescription/epcs/dea-schedules.md b/docs/modules/eprescription/epcs/dea-schedules.md index f18a2db0c..392eebf12 100644 --- a/docs/modules/eprescription/epcs/dea-schedules.md +++ b/docs/modules/eprescription/epcs/dea-schedules.md @@ -1,5 +1,5 @@ --- -description: Store a DEA schedule on a medication and check how the ePrescription module validates and sends it to the pharmacy. +description: Store DEA schedules on medications and compound ingredients, and see how the Aidbox ePrescription module classifies a controlled prescription from them. --- # DEA Schedules @@ -12,9 +12,8 @@ The EHR stores the schedule the practitioner reviewed, and the module reads it f Store the schedule in the `http://aidbox.app/ePrescription/FHIRSchema/medication-dea-schedule` extension of the medication code: * `MedicationRequest.medicationCodeableConcept` for a prescription without a `Medication` resource -* `Medication.code` for a `Medication` that is not a compound - -For a compound, store the schedule on each scheduled ingredient as described in [Compound Medications](../prescribing/compound-medications.md#ingredient-schedules). +* `Medication.code` for a `Medication` that is not a [compound](#compound-medications) +* `Medication.ingredient.itemCodeableConcept` for each scheduled ingredient of a compound The extension's `valueCodeableConcept` holds one coding under `http://terminology.hl7.org/CodeSystem/v2-0477` with one of the codes `I`, `II`, `III`, `IV`, or `V`. Give each medication code at most one schedule extension. @@ -41,6 +40,86 @@ An extension that holds only `text` stores no schedule.
+## Compound Medications + +The module treats a `Medication` as a compound when either of these is true: + +* its `http://aidbox.app/ePrescription/FHIRSchema/medication-is-compound` extension has `valueBoolean: true` +* it has `ingredient` entries and `Medication.code` has no NDC coding + +The ingredients decide the schedule of a compound. +A prescription whose compound has at least one scheduled ingredient is a **controlled prescription**. +Its schedule is the strictest ingredient schedule. +`I` is the strictest and `V` the least strict, so a compound with a Schedule II and a Schedule IV ingredient follows the rules of Schedule II. + +A schedule on `Medication.code` of a compound is optional. +When you store one, it must equal the strictest ingredient schedule. +The module never classifies a compound by that schedule. + +Only an active ingredient can have a schedule, so leave the extension out of an ingredient with `isActive: false`. + +
+ +Compound with a scheduled ingredient + +```json +{ + "resourceType": "Medication", + "id": "compound-example", + "code": { + "text": "Hydrocodone 1 mg/mL in oral suspension base" + }, + "extension": [ + { + "url": "http://aidbox.app/ePrescription/FHIRSchema/medication-is-compound", + "valueBoolean": true + } + ], + "ingredient": [ + { + "itemCodeableConcept": { + "text": "Hydrocodone bitartrate powder", + "coding": [ + { + "system": "http://hl7.org/fhir/sid/ndc", + "code": "38779052405" + } + ], + "extension": [ + { + "url": "http://aidbox.app/ePrescription/FHIRSchema/medication-dea-schedule", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v2-0477", + "code": "II" + } + ] + } + } + ] + }, + "isActive": true + }, + { + "itemCodeableConcept": { + "text": "Oral suspension base" + }, + "isActive": false + } + ] +} +``` + +
+ +### Ingredient NDCs + +Each scheduled ingredient of a compound needs an 11-digit NDC. +Store it as a coding under `http://hl7.org/fhir/sid/ndc` in the ingredient's `itemCodeableConcept`. + +The module sends every 11-digit ingredient NDC to the pharmacy in `CompoundIngredient/ItemNumber`, whether or not the ingredient has a schedule. + ## Schedules in NCPDP Messages The module sends each schedule in `DEASchedule/Code` as its NCI Thesaurus (NCIt) code: @@ -51,20 +130,26 @@ The module sends each schedule in `DEASchedule/Code` as its NCI Thesaurus (NCIt) * `IV`: `C48677` * `V`: `C48679` -`DrugCoded/DEASchedule` carries the prescription's schedule. +`DrugCoded/DEASchedule` carries the schedule of the prescription: + +* for a compound, the strictest ingredient schedule +* for any other medication, the schedule stored on its code + +`CompoundIngredient/DEASchedule` carries the schedule of each ingredient. ## Schedule Checks The module checks the schedules when you send a [NewRx](../prescribing/newrx-message.md) or respond to a [renewal](../prescribing/pharmacy-initiated-messages/rx-renewal.md) or [change](../prescribing/pharmacy-initiated-messages/rx-change.md) request. The checks it runs depend on the request: -* a NewRx, or a response that lets the pharmacy fill the prescription: the medication code checks below and, for compounds, the [compound schedule checks](../prescribing/compound-medications.md#schedule-checks) +* a NewRx, or a response that lets the pharmacy fill the prescription: every check in the Error Responses list below * a denied response, a pending response, or an approved prior-authorization change response: only `medication-has-multiple-dea-schedules` and `dea-schedule-coding-system-is-not-supported` -When EPCS is disabled (`EPCS_MODE=disabled`), the module rejects a controlled prescription with `epcs-disabled`. +When EPCS is disabled (`EPCS_MODE=disabled`), the module rejects a controlled prescription with `epcs-disabled`, including a compound with a scheduled ingredient. It does not reject a denied response this way. A request that fails a check returns `422` with an `OperationOutcome`. +For an error about a compound, the issue's `diagnostics` holds a JSON object whose `in` field points to the `Medication` (`["Medication"]`) or to the ingredient (`["Medication", "ingredient", ]`). A group submission returns `202` instead when the module sent some prescriptions of the group in an earlier submission. Its `failures[].reason` holds the error code of each prescription that the module did not send. @@ -77,5 +162,15 @@ Its `failures[].reason` holds the error code of each prescription that the modul * `medication-has-multiple-dea-schedules`: the code has more than one schedule extension, or more than one coding under `http://terminology.hl7.org/CodeSystem/v2-0477` in one extension. * `dea-schedule-coding-system-is-not-supported`: a schedule extension has codings, and none of them is a coding under `http://terminology.hl7.org/CodeSystem/v2-0477` that has a code. * `controlled-substance-invalid-dea-schedule`: the schedule is not one of `I` to `V`. + * `compound-root-dea-schedule-without-ingredient-schedules`: the code of a compound has a schedule, and no ingredient has one. + * `compound-root-dea-schedule-mismatch`: the code of a compound has a schedule other than the strictest ingredient schedule. +* A compound ingredient: + * `compound-ingredient-has-multiple-dea-schedules`: the ingredient has more than one schedule extension, or more than one coding under `http://terminology.hl7.org/CodeSystem/v2-0477` in one extension. + * `compound-ingredient-dea-schedule-coding-system-is-not-supported`: a schedule extension has codings, and none of them is under `http://terminology.hl7.org/CodeSystem/v2-0477`. + * `compound-ingredient-invalid-dea-schedule`: the schedule is not one of `I` to `V`, or a schedule extension's codings under `http://terminology.hl7.org/CodeSystem/v2-0477` have no code. + * `compound-inactive-ingredient-has-dea-schedule`: an ingredient with `isActive: false` has a schedule. +* A scheduled ingredient of a compound: + * `controlled-compound-ingredient-missing-ndc`: the ingredient has no coding under `http://hl7.org/fhir/sid/ndc`. + * `controlled-compound-ingredient-invalid-ndc`: the ingredient's NDC coding has no code, or its code does not have 11 digits.
diff --git a/docs/modules/eprescription/prescribing/compound-medications.md b/docs/modules/eprescription/prescribing/compound-medications.md deleted file mode 100644 index 3b2ea6983..000000000 --- a/docs/modules/eprescription/prescribing/compound-medications.md +++ /dev/null @@ -1,114 +0,0 @@ ---- -description: Represent compound medications in FHIR and send ingredient schedules and National Drug Codes to the pharmacy. ---- - -# Compound Medications - -The ePrescription module treats a FHIR `Medication` as a compound if either condition holds. - -* Its `http://aidbox.app/ePrescription/FHIRSchema/medication-is-compound` extension has `valueBoolean: true`. -* It has `ingredient` entries and no National Drug Code (NDC) in `Medication.code`. - -## Ingredient Schedules - -Store the [DEA schedule extension](../epcs/dea-schedules.md#store-a-dea-schedule) on `Medication.ingredient.itemCodeableConcept` for each scheduled ingredient. -Omit it for ingredients with `isActive: false`. - -If a compound has at least one scheduled ingredient, the module treats its prescription as a **controlled prescription**. -The strictest ingredient schedule determines the prescription's schedule, with I the strictest and V the least strict. -For example, a compound with a Schedule II ingredient and a Schedule IV ingredient has Schedule II. -If you also store a schedule on `Medication.code`, it must match the strictest ingredient schedule. - -In the NCPDP message, the module sends the compound's schedule in `DrugCoded/DEASchedule` and each scheduled ingredient's schedule in `CompoundIngredient/DEASchedule`. -Both fields use the [NCI Thesaurus codes for DEA schedules](../epcs/dea-schedules.md#schedules-in-ncpdp-messages). - -
- -Compound with a scheduled ingredient - -```json -{ - "resourceType": "Medication", - "id": "compound-example", - "code": { - "text": "Hydrocodone 1 mg/mL in oral suspension base" - }, - "extension": [ - { - "url": "http://aidbox.app/ePrescription/FHIRSchema/medication-is-compound", - "valueBoolean": true - } - ], - "ingredient": [ - { - "itemCodeableConcept": { - "text": "Hydrocodone bitartrate powder", - "coding": [ - { - "system": "http://hl7.org/fhir/sid/ndc", - "code": "38779052405" - } - ], - "extension": [ - { - "url": "http://aidbox.app/ePrescription/FHIRSchema/medication-dea-schedule", - "valueCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/v2-0477", - "code": "II" - } - ] - } - } - ] - }, - "isActive": true - }, - { - "itemCodeableConcept": { - "text": "Oral suspension base" - }, - "isActive": false - } - ] -} -``` - -
- -## Ingredient NDCs - -Each scheduled ingredient of a compound needs an 11-digit NDC. -Store it as a coding under `http://hl7.org/fhir/sid/ndc` in the ingredient's `itemCodeableConcept`. - -The module sends every 11-digit ingredient NDC to the pharmacy in `CompoundIngredient/ItemNumber`, whether or not the ingredient has a schedule. - -## Schedule Checks - -The module checks compound ingredients for a NewRx or a response that lets the pharmacy fill the prescription. -See [Schedule Checks](../epcs/dea-schedules.md#schedule-checks) for the checks on the medication code, other response types, and group submissions. - -For a compound error, the `OperationOutcome.issue.diagnostics` field contains a JSON object. -Its `in` field identifies where to look. - -* `["Medication"]` points to the compound. -* `["Medication", "ingredient", ]` points to the ingredient at that index. - -
- -Error Responses - -* The compound's `Medication.code`: - * `compound-root-dea-schedule-without-ingredient-schedules`: the code of a compound has a schedule, and no ingredient has one. - * `compound-root-dea-schedule-mismatch`: the code of a compound has a schedule other than the strictest ingredient schedule. -* A compound ingredient: - * `compound-ingredient-has-multiple-dea-schedules`: the ingredient has more than one schedule extension, or more than one coding under `http://terminology.hl7.org/CodeSystem/v2-0477` in one extension. - * `compound-ingredient-dea-schedule-coding-system-is-not-supported`: a schedule extension has codings, and none of them is under `http://terminology.hl7.org/CodeSystem/v2-0477`. - * `compound-ingredient-invalid-dea-schedule`: the schedule is not one of `I` to `V`, or a schedule extension's codings under `http://terminology.hl7.org/CodeSystem/v2-0477` have no code. - * `compound-inactive-ingredient-has-dea-schedule`: an ingredient with `isActive: false` has a schedule. -* A scheduled ingredient of a compound: - * `controlled-compound-ingredient-missing-ndc`: the ingredient has no coding under `http://hl7.org/fhir/sid/ndc`. - * `controlled-compound-ingredient-invalid-ndc`: the ingredient's NDC coding has no code, or its code does not have 11 digits. - -
From 88f7a8587fbffb8bc61354a4effca20ad83ffc0a Mon Sep 17 00:00:00 2001 From: GAlemsky Date: Fri, 20 Nov 2026 13:01:48 +0600 Subject: [PATCH 09/14] eRx: move compound medications to their own page Move the compound definition, ingredient schedules, example, ingredient NDCs and compound errors from the DEA Schedules page to a Compound Medications page under Prescribing, keeping the original wording. Co-Authored-By: Claude Opus 5.5 --- SUMMARY.md | 1 + .../eprescription/epcs/dea-schedules.md | 98 +--------------- .../prescribing/compound-medications.md | 111 ++++++++++++++++++ .../prescribing/newrx-message.md | 2 +- 4 files changed, 117 insertions(+), 95 deletions(-) create mode 100644 docs/modules/eprescription/prescribing/compound-medications.md diff --git a/SUMMARY.md b/SUMMARY.md index dd58a515f..db56eaf6c 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -431,6 +431,7 @@ * [Pharmacies Synchronization](modules/eprescription/pharmacies-synchronization.md) * [Prescribing](modules/eprescription/prescribing/README.md) * [NewRx Message](modules/eprescription/prescribing/newrx-message.md) + * [Compound Medications](modules/eprescription/prescribing/compound-medications.md) * [CancelRx Message](modules/eprescription/prescribing/cancelrx-message.md) * [RxFillIndicatorChange Message](modules/eprescription/prescribing/rx-fill-indicator-change.md) * [Pharmacy-initiated messages](modules/eprescription/prescribing/pharmacy-initiated-messages/README.md) diff --git a/docs/modules/eprescription/epcs/dea-schedules.md b/docs/modules/eprescription/epcs/dea-schedules.md index 392eebf12..16a26d885 100644 --- a/docs/modules/eprescription/epcs/dea-schedules.md +++ b/docs/modules/eprescription/epcs/dea-schedules.md @@ -6,14 +6,15 @@ description: Store DEA schedules on medications and compound ingredients, and se The module treats a prescription as a **controlled prescription** when its medication has a DEA schedule. The EHR stores the schedule the practitioner reviewed, and the module reads it from the prescription's medication. +For a [compound medication](../prescribing/compound-medications.md), the module reads the schedules of its ingredients instead. ## Store a DEA Schedule Store the schedule in the `http://aidbox.app/ePrescription/FHIRSchema/medication-dea-schedule` extension of the medication code: * `MedicationRequest.medicationCodeableConcept` for a prescription without a `Medication` resource -* `Medication.code` for a `Medication` that is not a [compound](#compound-medications) -* `Medication.ingredient.itemCodeableConcept` for each scheduled ingredient of a compound +* `Medication.code` for a `Medication` that is not a [compound](../prescribing/compound-medications.md) +* `Medication.ingredient.itemCodeableConcept` for each scheduled ingredient of a compound (see [Ingredient Schedules](../prescribing/compound-medications.md#ingredient-schedules)) The extension's `valueCodeableConcept` holds one coding under `http://terminology.hl7.org/CodeSystem/v2-0477` with one of the codes `I`, `II`, `III`, `IV`, or `V`. Give each medication code at most one schedule extension. @@ -40,86 +41,6 @@ An extension that holds only `text` stores no schedule.
-## Compound Medications - -The module treats a `Medication` as a compound when either of these is true: - -* its `http://aidbox.app/ePrescription/FHIRSchema/medication-is-compound` extension has `valueBoolean: true` -* it has `ingredient` entries and `Medication.code` has no NDC coding - -The ingredients decide the schedule of a compound. -A prescription whose compound has at least one scheduled ingredient is a **controlled prescription**. -Its schedule is the strictest ingredient schedule. -`I` is the strictest and `V` the least strict, so a compound with a Schedule II and a Schedule IV ingredient follows the rules of Schedule II. - -A schedule on `Medication.code` of a compound is optional. -When you store one, it must equal the strictest ingredient schedule. -The module never classifies a compound by that schedule. - -Only an active ingredient can have a schedule, so leave the extension out of an ingredient with `isActive: false`. - -
- -Compound with a scheduled ingredient - -```json -{ - "resourceType": "Medication", - "id": "compound-example", - "code": { - "text": "Hydrocodone 1 mg/mL in oral suspension base" - }, - "extension": [ - { - "url": "http://aidbox.app/ePrescription/FHIRSchema/medication-is-compound", - "valueBoolean": true - } - ], - "ingredient": [ - { - "itemCodeableConcept": { - "text": "Hydrocodone bitartrate powder", - "coding": [ - { - "system": "http://hl7.org/fhir/sid/ndc", - "code": "38779052405" - } - ], - "extension": [ - { - "url": "http://aidbox.app/ePrescription/FHIRSchema/medication-dea-schedule", - "valueCodeableConcept": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/v2-0477", - "code": "II" - } - ] - } - } - ] - }, - "isActive": true - }, - { - "itemCodeableConcept": { - "text": "Oral suspension base" - }, - "isActive": false - } - ] -} -``` - -
- -### Ingredient NDCs - -Each scheduled ingredient of a compound needs an 11-digit NDC. -Store it as a coding under `http://hl7.org/fhir/sid/ndc` in the ingredient's `itemCodeableConcept`. - -The module sends every 11-digit ingredient NDC to the pharmacy in `CompoundIngredient/ItemNumber`, whether or not the ingredient has a schedule. - ## Schedules in NCPDP Messages The module sends each schedule in `DEASchedule/Code` as its NCI Thesaurus (NCIt) code: @@ -142,14 +63,13 @@ The module sends each schedule in `DEASchedule/Code` as its NCI Thesaurus (NCIt) The module checks the schedules when you send a [NewRx](../prescribing/newrx-message.md) or respond to a [renewal](../prescribing/pharmacy-initiated-messages/rx-renewal.md) or [change](../prescribing/pharmacy-initiated-messages/rx-change.md) request. The checks it runs depend on the request: -* a NewRx, or a response that lets the pharmacy fill the prescription: every check in the Error Responses list below +* a NewRx, or a response that lets the pharmacy fill the prescription: every check in the Error Responses list below, plus the [compound checks](../prescribing/compound-medications.md#compound-checks) * a denied response, a pending response, or an approved prior-authorization change response: only `medication-has-multiple-dea-schedules` and `dea-schedule-coding-system-is-not-supported` When EPCS is disabled (`EPCS_MODE=disabled`), the module rejects a controlled prescription with `epcs-disabled`, including a compound with a scheduled ingredient. It does not reject a denied response this way. A request that fails a check returns `422` with an `OperationOutcome`. -For an error about a compound, the issue's `diagnostics` holds a JSON object whose `in` field points to the `Medication` (`["Medication"]`) or to the ingredient (`["Medication", "ingredient", ]`). A group submission returns `202` instead when the module sent some prescriptions of the group in an earlier submission. Its `failures[].reason` holds the error code of each prescription that the module did not send. @@ -162,15 +82,5 @@ Its `failures[].reason` holds the error code of each prescription that the modul * `medication-has-multiple-dea-schedules`: the code has more than one schedule extension, or more than one coding under `http://terminology.hl7.org/CodeSystem/v2-0477` in one extension. * `dea-schedule-coding-system-is-not-supported`: a schedule extension has codings, and none of them is a coding under `http://terminology.hl7.org/CodeSystem/v2-0477` that has a code. * `controlled-substance-invalid-dea-schedule`: the schedule is not one of `I` to `V`. - * `compound-root-dea-schedule-without-ingredient-schedules`: the code of a compound has a schedule, and no ingredient has one. - * `compound-root-dea-schedule-mismatch`: the code of a compound has a schedule other than the strictest ingredient schedule. -* A compound ingredient: - * `compound-ingredient-has-multiple-dea-schedules`: the ingredient has more than one schedule extension, or more than one coding under `http://terminology.hl7.org/CodeSystem/v2-0477` in one extension. - * `compound-ingredient-dea-schedule-coding-system-is-not-supported`: a schedule extension has codings, and none of them is under `http://terminology.hl7.org/CodeSystem/v2-0477`. - * `compound-ingredient-invalid-dea-schedule`: the schedule is not one of `I` to `V`, or a schedule extension's codings under `http://terminology.hl7.org/CodeSystem/v2-0477` have no code. - * `compound-inactive-ingredient-has-dea-schedule`: an ingredient with `isActive: false` has a schedule. -* A scheduled ingredient of a compound: - * `controlled-compound-ingredient-missing-ndc`: the ingredient has no coding under `http://hl7.org/fhir/sid/ndc`. - * `controlled-compound-ingredient-invalid-ndc`: the ingredient's NDC coding has no code, or its code does not have 11 digits. diff --git a/docs/modules/eprescription/prescribing/compound-medications.md b/docs/modules/eprescription/prescribing/compound-medications.md new file mode 100644 index 000000000..75302822f --- /dev/null +++ b/docs/modules/eprescription/prescribing/compound-medications.md @@ -0,0 +1,111 @@ +--- +description: Represent a compound medication in FHIR, store the DEA schedules and NDCs of its ingredients, and see the checks the Aidbox ePrescription module runs on it. +--- + +# Compound Medications + +The module treats a `Medication` as a compound when either of these is true: + +* its `http://aidbox.app/ePrescription/FHIRSchema/medication-is-compound` extension has `valueBoolean: true` +* it has `ingredient` entries and `Medication.code` has no National Drug Code (NDC) coding + +## Ingredient Schedules + +Store the schedule of each scheduled ingredient in the [DEA schedule extension](../epcs/dea-schedules.md#store-a-dea-schedule) of its `Medication.ingredient.itemCodeableConcept`. + +The ingredients decide the schedule of a compound. +A prescription whose compound has at least one scheduled ingredient is a [controlled prescription](../epcs/dea-schedules.md). +Its schedule is the strictest ingredient schedule. +`I` is the strictest and `V` the least strict, so a compound with a Schedule II and a Schedule IV ingredient follows the rules of Schedule II. + +A schedule on `Medication.code` of a compound is optional. +When you store one, it must equal the strictest ingredient schedule. +The module never classifies a compound by that schedule. + +Only an active ingredient can have a schedule, so leave the extension out of an ingredient with `isActive: false`. + +
+ +Compound with a scheduled ingredient + +```json +{ + "resourceType": "Medication", + "id": "compound-example", + "code": { + "text": "Hydrocodone 1 mg/mL in oral suspension base" + }, + "extension": [ + { + "url": "http://aidbox.app/ePrescription/FHIRSchema/medication-is-compound", + "valueBoolean": true + } + ], + "ingredient": [ + { + "itemCodeableConcept": { + "text": "Hydrocodone bitartrate powder", + "coding": [ + { + "system": "http://hl7.org/fhir/sid/ndc", + "code": "38779052405" + } + ], + "extension": [ + { + "url": "http://aidbox.app/ePrescription/FHIRSchema/medication-dea-schedule", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v2-0477", + "code": "II" + } + ] + } + } + ] + }, + "isActive": true + }, + { + "itemCodeableConcept": { + "text": "Oral suspension base" + }, + "isActive": false + } + ] +} +``` + +
+ +## Ingredient NDCs + +Each scheduled ingredient of a compound needs an 11-digit NDC. +Store it as a coding under `http://hl7.org/fhir/sid/ndc` in the ingredient's `itemCodeableConcept`. + +The module sends every 11-digit ingredient NDC to the pharmacy in `CompoundIngredient/ItemNumber`, whether or not the ingredient has a schedule. + +## Compound Checks + +The module runs these checks together with the [schedule checks](../epcs/dea-schedules.md#schedule-checks) when you send a [NewRx](newrx-message.md) or a response that lets the pharmacy fill the prescription. +A request that fails a check returns `422` with an `OperationOutcome`. +The issue's `diagnostics` holds a JSON object whose `in` field points to the `Medication` (`["Medication"]`) or to the ingredient (`["Medication", "ingredient", ]`). + +
+ +Error Responses + +* The compound's `Medication.code`: + * `compound-root-dea-schedule-without-ingredient-schedules`: the code of a compound has a schedule, and no ingredient has one. + * `compound-root-dea-schedule-mismatch`: the code of a compound has a schedule other than the strictest ingredient schedule. +* A compound ingredient: + * `compound-ingredient-has-multiple-dea-schedules`: the ingredient has more than one schedule extension, or more than one coding under `http://terminology.hl7.org/CodeSystem/v2-0477` in one extension. + * `compound-ingredient-dea-schedule-coding-system-is-not-supported`: a schedule extension has codings, and none of them is under `http://terminology.hl7.org/CodeSystem/v2-0477`. + * `compound-ingredient-invalid-dea-schedule`: the schedule is not one of `I` to `V`, or a schedule extension's codings under `http://terminology.hl7.org/CodeSystem/v2-0477` have no code. + * `compound-inactive-ingredient-has-dea-schedule`: an ingredient with `isActive: false` has a schedule. +* A scheduled ingredient of a compound: + * `controlled-compound-ingredient-missing-ndc`: the ingredient has no coding under `http://hl7.org/fhir/sid/ndc`. + * `controlled-compound-ingredient-invalid-ndc`: the ingredient's NDC coding has no code, or its code does not have 11 digits. + +
diff --git a/docs/modules/eprescription/prescribing/newrx-message.md b/docs/modules/eprescription/prescribing/newrx-message.md index 1aced2e5b..3d7b4c9d0 100644 --- a/docs/modules/eprescription/prescribing/newrx-message.md +++ b/docs/modules/eprescription/prescribing/newrx-message.md @@ -28,7 +28,7 @@ The following FHIR resources are needed to create a NewRx message: * Must be in "draft" status initially * Must include requester medication details and dispense details * Must have `dosageInstruction.text` non-empty - * Must include **Medication** + * Must include **Medication** (for a compound, see [Compound Medications](compound-medications.md)) * as a reference to resource _(since 2.0)_ * as a reference to `contained` resource * as a codeable concept _(since 2.0)_ From bda9efb476f504abb2939482ce8836593ac4c35a Mon Sep 17 00:00:00 2001 From: GAlemsky Date: Fri, 20 Nov 2026 13:07:09 +0600 Subject: [PATCH 10/14] eRx: trim the DEA schedules page Co-Authored-By: Claude Opus 5.5 --- .../modules/eprescription/epcs/dea-schedules.md | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/docs/modules/eprescription/epcs/dea-schedules.md b/docs/modules/eprescription/epcs/dea-schedules.md index 16a26d885..1deb4f3af 100644 --- a/docs/modules/eprescription/epcs/dea-schedules.md +++ b/docs/modules/eprescription/epcs/dea-schedules.md @@ -13,16 +13,12 @@ For a [compound medication](../prescribing/compound-medications.md), the module Store the schedule in the `http://aidbox.app/ePrescription/FHIRSchema/medication-dea-schedule` extension of the medication code: * `MedicationRequest.medicationCodeableConcept` for a prescription without a `Medication` resource -* `Medication.code` for a `Medication` that is not a [compound](../prescribing/compound-medications.md) +* `Medication.code` * `Medication.ingredient.itemCodeableConcept` for each scheduled ingredient of a compound (see [Ingredient Schedules](../prescribing/compound-medications.md#ingredient-schedules)) -The extension's `valueCodeableConcept` holds one coding under `http://terminology.hl7.org/CodeSystem/v2-0477` with one of the codes `I`, `II`, `III`, `IV`, or `V`. -Give each medication code at most one schedule extension. -An extension that holds only `text` stores no schedule. -
-Schedule extension +Schedule extension example ```json { @@ -60,20 +56,15 @@ The module sends each schedule in `DEASchedule/Code` as its NCI Thesaurus (NCIt) ## Schedule Checks -The module checks the schedules when you send a [NewRx](../prescribing/newrx-message.md) or respond to a [renewal](../prescribing/pharmacy-initiated-messages/rx-renewal.md) or [change](../prescribing/pharmacy-initiated-messages/rx-change.md) request. -The checks it runs depend on the request: +The module checks the schedules when you send these requests: -* a NewRx, or a response that lets the pharmacy fill the prescription: every check in the Error Responses list below, plus the [compound checks](../prescribing/compound-medications.md#compound-checks) +* a [NewRx](../prescribing/newrx-message.md), or a [renewal](../prescribing/pharmacy-initiated-messages/rx-renewal.md) or [change](../prescribing/pharmacy-initiated-messages/rx-change.md) response that lets the pharmacy fill the prescription: every check in the Error Responses list below * a denied response, a pending response, or an approved prior-authorization change response: only `medication-has-multiple-dea-schedules` and `dea-schedule-coding-system-is-not-supported` When EPCS is disabled (`EPCS_MODE=disabled`), the module rejects a controlled prescription with `epcs-disabled`, including a compound with a scheduled ingredient. -It does not reject a denied response this way. A request that fails a check returns `422` with an `OperationOutcome`. -A group submission returns `202` instead when the module sent some prescriptions of the group in an earlier submission. -Its `failures[].reason` holds the error code of each prescription that the module did not send. -
Error Responses From 9c63365b539121cd77a3eaff069bc05eb657ad3f Mon Sep 17 00:00:00 2001 From: GAlemsky Date: Fri, 20 Nov 2026 13:09:20 +0600 Subject: [PATCH 11/14] eRx: tighten the compound medications page Co-Authored-By: Claude Opus 5.5 --- .../prescribing/compound-medications.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/docs/modules/eprescription/prescribing/compound-medications.md b/docs/modules/eprescription/prescribing/compound-medications.md index 75302822f..532a11139 100644 --- a/docs/modules/eprescription/prescribing/compound-medications.md +++ b/docs/modules/eprescription/prescribing/compound-medications.md @@ -9,11 +9,14 @@ The module treats a `Medication` as a compound when either of these is true: * its `http://aidbox.app/ePrescription/FHIRSchema/medication-is-compound` extension has `valueBoolean: true` * it has `ingredient` entries and `Medication.code` has no National Drug Code (NDC) coding +## Ingredient NDCs + +Store an 11-digit NDC for each scheduled ingredient as a coding under `http://hl7.org/fhir/sid/ndc` in its `itemCodeableConcept`. + ## Ingredient Schedules Store the schedule of each scheduled ingredient in the [DEA schedule extension](../epcs/dea-schedules.md#store-a-dea-schedule) of its `Medication.ingredient.itemCodeableConcept`. -The ingredients decide the schedule of a compound. A prescription whose compound has at least one scheduled ingredient is a [controlled prescription](../epcs/dea-schedules.md). Its schedule is the strictest ingredient schedule. `I` is the strictest and `V` the least strict, so a compound with a Schedule II and a Schedule IV ingredient follows the rules of Schedule II. @@ -79,13 +82,6 @@ Only an active ingredient can have a schedule, so leave the extension out of an
-## Ingredient NDCs - -Each scheduled ingredient of a compound needs an 11-digit NDC. -Store it as a coding under `http://hl7.org/fhir/sid/ndc` in the ingredient's `itemCodeableConcept`. - -The module sends every 11-digit ingredient NDC to the pharmacy in `CompoundIngredient/ItemNumber`, whether or not the ingredient has a schedule. - ## Compound Checks The module runs these checks together with the [schedule checks](../epcs/dea-schedules.md#schedule-checks) when you send a [NewRx](newrx-message.md) or a response that lets the pharmacy fill the prescription. From 5d1103faf2e9f5c40ae0cee64878f9e5cce88250 Mon Sep 17 00:00:00 2001 From: GAlemsky Date: Fri, 20 Nov 2026 13:11:21 +0600 Subject: [PATCH 12/14] eRx: drop redundant DEA schedules page text Co-Authored-By: Claude Opus 5.5 --- docs/modules/eprescription/epcs/dea-schedules.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/docs/modules/eprescription/epcs/dea-schedules.md b/docs/modules/eprescription/epcs/dea-schedules.md index 1deb4f3af..04639456a 100644 --- a/docs/modules/eprescription/epcs/dea-schedules.md +++ b/docs/modules/eprescription/epcs/dea-schedules.md @@ -5,8 +5,6 @@ description: Store DEA schedules on medications and compound ingredients, and se # DEA Schedules The module treats a prescription as a **controlled prescription** when its medication has a DEA schedule. -The EHR stores the schedule the practitioner reviewed, and the module reads it from the prescription's medication. -For a [compound medication](../prescribing/compound-medications.md), the module reads the schedules of its ingredients instead. ## Store a DEA Schedule @@ -56,11 +54,6 @@ The module sends each schedule in `DEASchedule/Code` as its NCI Thesaurus (NCIt) ## Schedule Checks -The module checks the schedules when you send these requests: - -* a [NewRx](../prescribing/newrx-message.md), or a [renewal](../prescribing/pharmacy-initiated-messages/rx-renewal.md) or [change](../prescribing/pharmacy-initiated-messages/rx-change.md) response that lets the pharmacy fill the prescription: every check in the Error Responses list below -* a denied response, a pending response, or an approved prior-authorization change response: only `medication-has-multiple-dea-schedules` and `dea-schedule-coding-system-is-not-supported` - When EPCS is disabled (`EPCS_MODE=disabled`), the module rejects a controlled prescription with `epcs-disabled`, including a compound with a scheduled ingredient. A request that fails a check returns `422` with an `OperationOutcome`. From 813556a974639dea75f8968cc4821a612885f898 Mon Sep 17 00:00:00 2001 From: GAlemsky Date: Fri, 20 Nov 2026 13:20:22 +0600 Subject: [PATCH 13/14] eRx: add example error responses for schedule and compound checks Co-Authored-By: Claude Opus 5.5 --- .../eprescription/epcs/dea-schedules.md | 18 +++++++++++++++ .../prescribing/compound-medications.md | 22 +++++++++++++++---- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/docs/modules/eprescription/epcs/dea-schedules.md b/docs/modules/eprescription/epcs/dea-schedules.md index 04639456a..9ae585235 100644 --- a/docs/modules/eprescription/epcs/dea-schedules.md +++ b/docs/modules/eprescription/epcs/dea-schedules.md @@ -67,4 +67,22 @@ A request that fails a check returns `422` with an `OperationOutcome`. * `dea-schedule-coding-system-is-not-supported`: a schedule extension has codings, and none of them is a coding under `http://terminology.hl7.org/CodeSystem/v2-0477` that has a code. * `controlled-substance-invalid-dea-schedule`: the schedule is not one of `I` to `V`. +Example response for `controlled-substance-invalid-dea-schedule`: + +```json +{ + "resourceType": "OperationOutcome", + "issue": [ + { + "severity": "error", + "code": "invalid", + "details": { + "text": "Controlled substance DEASchedule must be one of I, II, III, IV, V" + }, + "diagnostics": "null" + } + ] +} +``` +
diff --git a/docs/modules/eprescription/prescribing/compound-medications.md b/docs/modules/eprescription/prescribing/compound-medications.md index 532a11139..317509f47 100644 --- a/docs/modules/eprescription/prescribing/compound-medications.md +++ b/docs/modules/eprescription/prescribing/compound-medications.md @@ -84,10 +84,6 @@ Only an active ingredient can have a schedule, so leave the extension out of an ## Compound Checks -The module runs these checks together with the [schedule checks](../epcs/dea-schedules.md#schedule-checks) when you send a [NewRx](newrx-message.md) or a response that lets the pharmacy fill the prescription. -A request that fails a check returns `422` with an `OperationOutcome`. -The issue's `diagnostics` holds a JSON object whose `in` field points to the `Medication` (`["Medication"]`) or to the ingredient (`["Medication", "ingredient", ]`). -
Error Responses @@ -104,4 +100,22 @@ The issue's `diagnostics` holds a JSON object whose `in` field points to the `Me * `controlled-compound-ingredient-missing-ndc`: the ingredient has no coding under `http://hl7.org/fhir/sid/ndc`. * `controlled-compound-ingredient-invalid-ndc`: the ingredient's NDC coding has no code, or its code does not have 11 digits. +Example response for `controlled-compound-ingredient-missing-ndc` on the first ingredient of the compound above: + +```json +{ + "resourceType": "OperationOutcome", + "issue": [ + { + "severity": "error", + "code": "invalid", + "details": { + "text": "Compound ingredient with a DEASchedule must include an NDC" + }, + "diagnostics": "{\"in\":[\"Medication\",\"ingredient\",0],\"resourceType\":\"Medication\",\"id\":\"compound-example\"}" + } + ] +} +``` +
From 25cad2901260e86c444bf78d0cd0cbf1079839aa Mon Sep 17 00:00:00 2001 From: GAlemsky Date: Fri, 20 Nov 2026 13:29:33 +0600 Subject: [PATCH 14/14] Remove redundant clause --- docs/modules/eprescription/prescribing/newrx-message.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/eprescription/prescribing/newrx-message.md b/docs/modules/eprescription/prescribing/newrx-message.md index 3d7b4c9d0..1aced2e5b 100644 --- a/docs/modules/eprescription/prescribing/newrx-message.md +++ b/docs/modules/eprescription/prescribing/newrx-message.md @@ -28,7 +28,7 @@ The following FHIR resources are needed to create a NewRx message: * Must be in "draft" status initially * Must include requester medication details and dispense details * Must have `dosageInstruction.text` non-empty - * Must include **Medication** (for a compound, see [Compound Medications](compound-medications.md)) + * Must include **Medication** * as a reference to resource _(since 2.0)_ * as a reference to `contained` resource * as a codeable concept _(since 2.0)_