---
schema_version: "1"
id: 6f38ce31826f9273a510fed13ad2f79913874909f233a8fba921bd281f2da670
title: MedicationRequest
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/life_sciences_dev_guide/hc_r4_api_objects_MedicationRequest.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.life_sciences_dev_guide.meta/life_sciences_dev_guide/hc_r4_api_objects_MedicationRequest.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 2287ba9a29d4639cd6737f3d2e53f7b1d8736f60ac7ceeda931df31136c46e1c
description: Represents a request or order for the supply of medication, along with information about how it should be administered. This object is available in API version 51.0 and later.
---
# MedicationRequest

Represents a request or order for the supply of medication, along with information about how it should be administered. This object is available in API version 51.0 and later.

## Supported Calls

create(), delete(), describeLayout(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), search(), undelete(), update(), upsert()

## Additional Information for MedicationRequest in Other Objects

In addition to creating a record using these fields, you can add more details to your MedicationRequest record by creating records in certain other objects, and referencing your MedicationRequest record as the parent record. Here’s the list of objects you can associate to MedicationRequest in this way, the type of information they add, and the field they use to reference MedicationRequest.

| Object | Type of Information | Reference Field |
| --- | --- | --- |
| Identifier | Associates an identifier value to the medication request. | ParentRecordId |
| PatientMedicationDosage | Associates dosage-related information for the medication in the medication request record. | ParentRecordId |

## Fields

### AllowedSubstitutionTypeCodeId

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: The system-defined code that represents the type of substitution that's allowed. This field can’t be used if the CanSubstitute field is set to true.
- **Referenced Objects**:
    - CodeSetBundle

### CanSubstitute

- **Type**: boolean
- **Properties**: Create, Defaulted on create, Filter, Group, Sort, Update
- **Description**: Indicates whether substitution is acceptable. If the value for this field is set to true, then the AllowedSubstitutionTypeCodeId field can’t be selected.

### CarePlanId

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: The care plan related to this medication request. This field is a relationship field.
- **Relationship Name**: CarePlan
- **Relationship Type**: Lookup
- **Referenced Objects**:
    - CarePlan

### CaseId

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: The case associated with the medication request.
    
    This field is a relationship field.
- **Relationship Name**: Case
- **Refers To**: Case

### ClinicalEncounterId

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: The clinical encounter related to the medication request.
- **Referenced Objects**:
    - ClinicalEncounter

### ClinicalServiceRequestId

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: References the service request related to the medication request.
- **Referenced Objects**:
    - ClinicalServiceRequest

### DispenseInterval

- **Type**: double
- **Properties**: Create, Filter, Nillable, Sort, Update
- **Description**: The minimum interval required between refills.

### DispenseIntervalUnitId

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: The unit for that interval.
- **Referenced Objects**:
    - UnitOfMeasure

### DispenserId

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: The person who provides the medication.
- **Referenced Objects**:
    - Account

### FillDurationUnitId

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: The unit for the fill duration.
- **Referenced Objects**:
    - UnitOfMeasure

### FillQuantityUnitId

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: The unit of the fill quantity.
- **Referenced Objects**:
    - UnitOfMeasure

### InitialFillDuration

- **Type**: double
- **Properties**: Create, Filter, Nillable, Sort, Update
- **Description**: The length of time the first fill is expected to last.

### InitialFillQuantity

- **Type**: double
- **Properties**: Create, Filter, Nillable, Sort, Update
- **Description**: The quantity to be filled in the first dispense.

### IsIgnored

- **Type**: boolean
- **Properties**: Create, Defaulted on create, Filter, Group, Sort, Update
- **Description**: Indicates whether the request should be ignored.

### IsSecondaryInformation

- **Type**: boolean
- **Properties**: Create, Defaulted on create, Filter, Group, Sort, Update
- **Description**: Indicates whether the request is based on information from a secondary source instead of a primary one. If this field is set to true, then the SecondarySourceId field can’t be selected.

### LastReferencedDate

- **Type**: dateTime
- **Properties**: Filter, Nillable, Sort
- **Description**: The most recent date on which a user referenced this record.

### LastViewedDate

- **Type**: dateTime
- **Properties**: Filter, Nillable, Sort
- **Description**: The most recent date on which a user viewed this record.

### MedicationAdministrationContextId

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: The system-defined code that represents the setting in which the medication is administered.
- **Referenced Objects**:
    - CodeSetBundle

### MedicationCodeId

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: The system-defined code that specifies the medication requested. A record can select either a MedicationId or a MedicationCodeId, but not both.
- **Referenced Objects**:
    - CodeSetBundle

### MedicationId

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: Lookup to the medication record for the medicine requested. A record can select either a MedicationId or a MedicationCodeId, but not both.
- **Referenced Objects**:
    - Medication

### MedicationRequestGroupId

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: A shared identifier common to all medication requests that were authorized more or less simultaneously by a single author.
- **Referenced Objects**:
    - Identifier

### Name

- **Type**: string
- **Properties**: Autonumber, Defaulted on create, Filter, idLookup, Sort
- **Description**: The system-generated name of the medication request record.

### OwnerId

- **Type**: reference
- **Properties**: Create, Defaulted on create, Filter, Group, Sort, Update
- **Description**: The owner of the medication request record. Available in API version 56.0 and later. This is a polymorphic relationship field.
- **Relationship Name**: Owner
- **Relationship Type**: Lookup
- **Referenced Objects**:
    - Group
    - User

### PatientId

- **Type**: Master-detail reference
- **Properties**: Create, Filter, Group, Sort
- **Description**: The person who needs the medicine.
- **Referenced Objects**:
    - Account

### PerformerId

- **Type**: Polymorphic reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: The person who administers the medicine.
- **Referenced Objects**:
    - Account
    - HealthcareProvider
    - CareRegisteredDevice

### PerformerTypeId

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: The system-defined code that represents the performer's role. For instance, the cardiologist, neurosurgeon, and so on.
- **Referenced Objects**:
    - CodeSetBundle

### PrescribedDate

- **Type**: dateTime
- **Properties**: Create, Filter, Nillable, Sort, Update
- **Description**: The date and optionally the time when the prescription was initially written or authored on.

### PrescriptionPeriodEnd

- **Type**: dateTime
- **Properties**: Create, Filter, Nillable, Sort, Update
- **Description**: The end date for the prescription's validity.

### PrescriptionPeriodStart

- **Type**: dateTime
- **Properties**: Create, Filter, Nillable, Sort, Update
- **Description**: The start date for the prescription's validity.

### PreviousPrescriptionId

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: Reference to previous prescriptions.
- **Referenced Objects**:
    - MedicationRequest

### Priority

- **Type**: picklist
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: Specifies the priority of the request.
- **Possible values**:
    - ASAP
    - Routine
    - Stat
    - Urgent

### ReasonCodeId

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: The code for why the medicine was requested.
- **Referenced Objects**:
    - CodeSetBundle

### ReasonReferenceId

- **Type**: Polymorphic reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: Reference to the condition or observation that warranted this medicine.
- **Referenced Objects**:
    - HealthCondition
    - CareObservation

### RefillDuration

- **Type**: double
- **Properties**: Create, Filter, Nillable, Sort, Update
- **Description**: How long the refill is expected to last.

### RefillQuantity

- **Type**: double
- **Properties**: Create, Filter, Nillable, Sort, Update
- **Description**: The quantity in each refill.

### RefillsAllowed

- **Type**: int
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: The number of refills that are allowed.

### RelatedRequestId

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: A plan or request that is fulfilled in whole or in part by this medication request.
- **Referenced Objects**:
    - MedicationRequest

### RequesterId

- **Type**: Polymorphic reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: The person who raised the request.
- **Referenced Objects**:
    - Account
    - HealthcareProvider
    - CareRegisteredDevice

### SecondarySourceId

- **Type**: Polymorphic reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: References the person who gave the information for the request. This field can’t be selected if the IsSecondarySource field is set to true.
- **Referenced Objects**:
    - Account
    - HealthcareProvider

### SourceSystem

- **Type**: string
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: The name of the system this record came from.

### SourceSystemIdentifier

- **Type**: string
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: The ID of this record in its source system.

### SourceSystemModified

- **Type**: dateTime
- **Properties**: Create, Filter, Nillable, Sort, Update
- **Description**: The date on which this item was last changed in the source system.

### Status

- **Type**: picklist
- **Properties**: Create, Filter, Group, Sort, Update
- **Description**: The status of the medication request.
- **Possible values**:
    - Active
    - Cancelled
    - Completed
    - Draft
    - Entered-in-Error
    - On-Hold
    - Stopped
    - Unknown

### StatusReasonCodeId

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: The system-defined code that specifies the reason for the status.
- **Referenced Objects**:
    - CodeSetBundle

### SubstitutionReasonCodeId

- **Type**: reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: Specifies why a substitution is required.
- **Referenced Objects**:
    - CodeSetBundle

### TherapyDuration

- **Type**: picklist
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: The description of the overall pattern of the administration of the medication to the patient. For instance, Continuous, Acute, Seasonal.
- **Possible values**:
    - Continuous
    - Seasonal
    - Short Term

### Type

- **Type**: picklist
- **Properties**: Create, Filter, Group, Sort, Update
- **Description**: The type of the request.
- **Possible values**:
    - Filler Order
    - Instance Order
    - Option
    - Order
    - Original Order
    - Plan
    - Proposal
    - Reflex Order

## Associated Objects

This object has the following associated objects. If the API version isn’t specified, they’re available in the same API versions as this object. Otherwise, they’re available in the specified API version and later.

[MedicationRequestChangeEvent](https://developer.salesforce.com/docs/atlas.en-us.life_sciences_dev_guide.meta/life_sciences_dev_guide/sforce_api_associated_objects_change_event.htm "A StandardObjectNameChangeEvent object is available for each object that supports Change Data Capture. You can subscribe to a stream of change events using Change Data Capture to receive data tied to record changes in Salesforce. Changes include record creation, updates to an existing record, deletion of a record, and undeletion of a record. A change event isn’t a Salesforce object—it doesn’t support CRUD operations or queries. It’s included in the object reference so you can discover which Salesforce objects support change events.") (API version 59.0)

Change events are available for the object.

[MedicationRequestFeed](https://developer.salesforce.com/docs/atlas.en-us.life_sciences_dev_guide.meta/life_sciences_dev_guide/sforce_api_associated_objects_feed.htm "StandardObjectNameFeed is the model for all feed objects associated with standard objects. These objects represent the posts and feed-tracked changes of a standard object.")

Feed tracking is available for the object.

[MedicationRequestHistory](https://developer.salesforce.com/docs/atlas.en-us.life_sciences_dev_guide.meta/life_sciences_dev_guide/sforce_api_associated_objects_history.htm "StandardObjectNameHistory is the model for all history objects associated with standard objects. These objects represent the history of changes to the values in the fields of a standard object.")

History is available for tracked fields of the object.

[MedicationRequestOwnerSharingRule](https://developer.salesforce.com/docs/atlas.en-us.life_sciences_dev_guide.meta/life_sciences_dev_guide/sforce_api_associated_objects_ownersharingrule.htm "StandardObjectNameOwnerSharingRule is the model for all owner sharing rule objects associated with standard objects. These objects represent a rule for sharing a standard object with users other than the owner.") (API version 56.0)

Sharing rules are available for the object.

[MedicationRequestShare](https://developer.salesforce.com/docs/atlas.en-us.life_sciences_dev_guide.meta/life_sciences_dev_guide/sforce_api_associated_objects_share.htm "StandardObjectNameShare is the model for all share objects associated with standard objects. These objects represent a sharing entry on the standard object.") (API version 56.0)

Sharing is available for the object.