Profiles & Interactions Index > Submit Medication Document Bundle

Interactions: Submit Medication Document Bundle

The Submit Medication operation is used to transfer medication dispense and medication administration records to the DHDR. This encompasses both Create and Update.

Scope

This transaction involves a request by a Point of Service system to transfer a Medication Dispense or Medication Administration Bundle, including a Composition and other linked resources to the DHDR Solution. The request is received by the DHDR which stores the received Bundel and returns an HTTP response code and an OperationOutcome resource if applicable.

For example, a user at a HIC site records a medication dispense in a Point of Care System. The Point of Care System will extract and assemble the medication dispense record as per the Ontario Digital Health Drug Repository HL7 FHIR Implementation Guide specification and submit it to the DHDR, where it is available for viewing by other DHDR Consumers.

Interaction Diagram

diagramSubmitMedication

Actor: Client Application

Role: Submits a medication document bundle containing a Composition and linked resources that may be populated with data to the DHDR Solution.

Actor: DHDR Solution

Role: Receives and stores Medication document Bundles from the Client Application.

Specification

The FHIR DHDR specification is based on the HL7 FHIR R4 Create operation.

Medication Create Request

The Create Request will create a new medication administration or medication dispense based upon information available from the medication dispense or medication administration source,if one does not already exist in the repository. If there is already an existing record, the newly submitted version will replace the existing version in the repository.

The Medication Document Bundle Create Request creates a new resource in a server-assigned location. The create interaction is performed by an HTTP POST command as shown:

POST [base-submit]/Bundle/

Medication Create Response

  • OperationOutcome

Medication Conditional Update Request

The Conditional Update Request will update an existing medication dispense or medication administration record based upon information available from the medication dispense or medication administration record source.

PUT [base-submit]/Bundle?[search parameters]

For Medication Dispense scenario Current Rx Number (MedicationDispense.identifier) and When Prepared Date(MedicationDispense.whenprepared) fields shall be used for conditional update

PUT [base-submit]/Bundle?composition.medicationdispense.whenprepared=2019-02-24&composition.medicationdispense.identifier=[id-system-local-base]/ca-on-pharmacy-[Pharmacy ID]-rx-number|1233445

For Medication Administration scenario eMAR Id (MedicationAdministration.identifier) and Administration Date (MedicationAdministration.effectivePeriod.start) fields shall be used for conditional update

PUT [base-submit]/Bundle?composition.medicationadministration.effective-time=2019-02-24&composition.medicationadministration.identifier=http://ehealthontario.ca/fhir/NamingSystem/id-[name]-[vendor]-emar-order|1233445

Medication Conditional Updated Response

  • OperationOutcome

Example Create Bundle Message

HTTP Method:

POST

Headers:

Content-Type: application/fhir+json

Address:

[base-submit]/Bundle/

Message Body:

Supported Profiles

Profile MedicationDispense Scenario MedicationAdministration Scenario
Bundle (Document)
Composition (MedicationDispense)
Composition (MedicationAdministration)
Medication Dispense (Submission)
Medication (Submission)
MedicationRequest (Submission)
Patient (Submission)
Practitioner (Submission)
PractitionerRole (Submission)
Organization (Submission)
Medication Administration (Submission)
Encounter
Location
OperationOutcome

Extensions

Extentsion MedicationDispense Scenario MedicationAdministration Scenario
ca-on-medications-ext-quantity-remaining (Dispense Remaining Quantity Extension)
ca-on-medications-ext-refills-remaining (Dispense Remaining Refills Extension)
ca-on-medications-ext-drug-service-coverage (Drug/Service Coverage Extension)
ext-medication-strength-description (Medication Strength Extension)

Expected Behavior

See Response Handling page for a complete listig of response codes

Legend
code = OperationOutcome.issue.code
severity = OperationOutcome.issue.severity
details.coding.code=OperationOutcome.issue.details.coding.code
details.coding.display=OperationOutcome.issue.details.coding.display
details.text = OperationOutcome.issue.details.coding.text
diagnostics = OperationOutcome.issue.diagnostics


HTTP Status Scenario Description severity code details.coding.code details.coding.display details.text/diagnostics
200 OK Resource successfully updated
201 Created Resource successfully created (there might be informational or warning findings)
400 Bad Request Missing security token error required Missing required security token: PIN
401 Unauthorized Failed authentication error security Authorization is required for the interaction that was attempted
409 Conflict Conflict with the current state of a resource error processing Can not create resource of type [X] as it would create a duplicate unique index matching query [X]
412 Precondition Failed Access to the target resource has been denied error processing Failed to UPDATE resource with match URL [X] because this search matched [X] resources
422 Content validation Ontario HCN format validation error business-rule FHIR_PTNT_2001 Invalid Ontario HCN
422 Content validation Ontario HCN existence in provincial registry warning business-rule FHIR_PTNT_2002 HCN does not exist in PCR
422 Content validation Ontario HCN validity warning business-rule FHIR_PTNT_2003 Multiple patients for provided HCN
422 Content validation PCR DOB existence in provincial registry error business-rule FHIR_PTNT_2004 PCR DOB does not exist
422 Content validation Contributed patient DOB validity error business-rule FHIR_PTNT_2005 Patient DOB does not match PCR DOB
422 Content validation Hospital MRN format validity error business-rule FHIR_PTNT_2006 Hospital MRN format invalid
422 Content validation Hospital MRN existence in provincial registry warning business-rule FHIR_PTNT_2007 Hospital MRN does not exist in PCR
422 Content validation Hospital MRN validity warning business-rule FHIR_PTNT_2008 Multiple patients found for hospital MRN
422 Content validation Pharmacy MRN format validity error business-rule FHIR_PTNT_2009 Pharmacy MRN format invalid
422 Content validation Anonymous records not accepted error business-rule FHIR_PTNT_2010 Anonymous records for Harm Reduction are not accepted by DHDR. No action required.
422 Content validation DOB existence in provincial registry error business-rule FHIR_PTNT_2011 DOB does not exist in PCR for provided MRN
422 Content validation Contributed patient DOB for the MRN validity error business-rule FHIR_PTNT_2012 Patient DOB provided does not match DOB in PCR for this MRN
422 Content validation Patient DOB present in contributed record error business-rule FHIR_PTNT_1001 Medication administration patient does not have DOB
422 Content validation Patient in medication dispense has up to three phone numbers error business-rule FHIR_PTNT_1002 Patient cannot have more than three phone numbers
422 Content validation Patient in medication dispense has one to three addresses error business-rule FHIR_PTNT_1003 Patient must have at least one address and a maximum of three
422 Content validation Provider existence in provincial registry error business-rule FHIR_PROV_2001 Provider does not exist in PPR
422 Content validation Provider status in provincial registry warning business-rule FHIR_PROV_2002 Provider is not active in PPR
422 Content validation Organization status in provincial registry warning business-rule FHIR_PROV_2003 Organization.identifier: <> Pharmacy is inactive in PPR
422 Content validation Contributed provider name validity error business-rule FHIR_PROV_2004 %s does not match provider name in PPR
422 Content validation Contributed provider last name validity error business-rule FHIR_PROV_2005 submitted provider last name, %s, does not match the provider last name in the provincial provider registry, %s
422 Content validation Contributed provider first or middle name validity error business-rule FHIR_PROV_2006 submitted provider first or middle name %s does not match the provider first or middle name in provincial provider registry %s
422 Content validation Organization submitted not allowed for contributor warning business-rule FHIR_ORG_2001 Organization submitted not allowed for contributor
422 Content validation Organization contact for medication dispenses error business-rule FHIR_ORG_1001 Organization phone and fax mandatory for medication dispenses
422 Content validation Organization address for medication dispenses error business-rule FHIR_ORG_1002 Organization address mandatory for medication dispenses
422 Content validation Medication coding or text present in contributed Drug or Device record error business-rule FHIR_MED_1001 Medication code coding or text mandatory when category is Drug or Device
422 Content validation Medication text present in contributed Pharmacy Service record error business-rule FHIR_MED_1002 Medication text mandatory when category is Service
422 Content validation Medication text present in contributed Compounded Medication record error business-rule FHIR_MED_1003 Medication text mandatory for compounds
422 Content validation Medication coding empty in contributed Compounded Medication record error business-rule FHIR_MED_1004 Medication coding must be empty for compounds
422 Content validation Medication text empty in contributed record when coding present error business-rule FHIR_MED_1005 Medication text must be empty for non-compounded medications if a coding is provided
422 Content validation Medication dispense category is valid error business-rule FHIR_MD_1001 Medication dispense category must be drug, device or service
422 Content validation Medication dispense quantity present in contributed Drug or Device record error business-rule FHIR_MD_1002 Medication dispense quantity mandatory when category is Drug or Device
422 Content validation Medication administration category is valid error business-rule FHIR_MA_1001 Medication administration category must be drug
422 Content validation Medication dispense prescription present in contributed Drug or Device record error business-rule FHIR_MD_1003 Medication dispense prescription mandatory when category is Drug
422 Content validation Medication dispense days supply present in contributed Drug or Device record error business-rule FHIR_MD_1004 Medication dispense days supply mandatory when category is Drug
422 Content validation Medication dispense Current Rx Number mandatory error business-rule FHIR_MD_1005 Medication dispense Current Rx Number mandatory
422 Content validation Medication dispense when prepared and when handed over have same format error business-rule FHIR_MD_1006 Medication dispense when prepared and when handed over have different date formats
422 Content validation Medication request identifier present in contributed medication administration record error business-rule FHIR_MRQT_1001 Medication request identifier mandatory for medication administrations
422 Content validation MP code existence in CCDD error business-rule FHIR_MED_2001 CCDD MP code does not exist
422 Content validation NPN code existence in NHPD error business-rule FHIR_MED_2002 NPN code does not exist
422 Content validation NTP device code existent in CCDD error business-rule FHIR_MED_2003 CCDD NTP device code does not exist
422 Content validation Missing required attribute error business-rule FHIR_IG_1000 Determined by IG $validate operation
422 Content validation Missing required attribute error business-rule IN_0048 When $validate does not return 200 ok in cdf_datain_fhir_ig_validation_processor
429 Too Many Requests Rate Limit error throttled Too Many Requests
500 Internal Server Error Unhandled Exception fatal exception Internal Error