---
schema_version: "1"
id: 446b38d6e423062ba500808a5d8133f354e133b47fd9613edbd9973f50d32e72
title: MedicationStatementDetail
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/health_cloud_object_reference/hc_r4_api_objects_medicationstatementdetail.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.health_cloud_object_reference.meta/health_cloud_object_reference/hc_r4_api_objects_medicationstatementdetail.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 996a106ecb9afd0a443649543819e4d765db0f67c798caf69d5035a985bb8dc4
description: Represents additional information associated with MedicationStatement records. This object is available in API version 54.0 and later.
---
# MedicationStatementDetail

Represents additional information associated with MedicationStatement records. This object is available in API version 54.0 and later.

## Supported Calls

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

## Fields

### DetailCodeId

- **Type**: Polymorphic Master-Detail reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: References a code set or code set bundle that adds information to a MedicationStatement record.
- **Referenced Objects**:
    - CodeSet
    - CodeSetBundle

### DetailRecordId

- **Type**: Polymorphic reference
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: References a record that adds information to a MedicationStatement record
- **Refers To**:
    - CareObservation
    - ClinicalServiceRequest
    - DiagnosticSummary
    - HealthCondition
    - MedicationDispense
    - MedicationRequest
    - MedicationStatement
    - PatientMedicalProcedure

### DetailType

- **Type**: picklist
- **Properties**: Create, Filter, Group, Nillable, Sort, Update
- **Description**: Specifies the type of information added to the MedicationStatement record.
- **Possible values**:
    - Based On
    - Part Of
    - Status Reason
    - Reason Code
    - Reason Reference
    - Derived From

### LastReferencedDate

- **Type**: dateTime
- **Properties**: Filter, Nillable, Sort
- **Description**: The date and time when the record was last referenced.

### LastViewedDate

- **Type**: dateTime
- **Properties**: Filter, Nillable, Sort
- **Description**: The date and time when the record was last viewed.

### MedicationStatementId

- **Type**: Master-detail reference
- **Properties**: Create, Filter, Group, Sort
- **Description**: The parent MedicationStatement record to which additional information is being added.
    
    This is a relationship field.
- **Refers To**:
    - MedicationStatement

### Name

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

## Usage

- Use the MedicationStatementId field to reference the parent MedicationStatement record that the additional information is being associated to.
- Use the DetailType picklist to specify the type of detail that’s being associated to the MedicationStatement record. Here's how the associated record types are mapped to values in the DetailType field.
    - Based On - MedicationRequest, ServiceRequest
    - Part Of - MedicationDispense, MedicationStatement, PatientMedicalProcedure, CareObservation
    - Status Reason - CodeSet, CodeSetBundle
    - Reason Code - CodeSet, CodeSetBundle
    - Reason Reference - HealthCondition, CareObservation, DiagnosticSummary
    - Derived From - CareObservation, ClinicalServiceRequest, DiagnosticSummary, HealthCondition, MedicationDispense, MedicationRequest, MedicationStatement, PatientMedicalProcedure
- Use the DetailCodeId and DetailRecordId fields to reference the records with the associated information.

## 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.

[MedicationStatementDetailChangeEvent](https://developer.salesforce.com/docs/atlas.en-us.health_cloud_object_reference.meta/health_cloud_object_reference/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 62.0)

Change events are available for the object.