dbo.SXAAMBeRXDispensedDetail 
Default Table Name  SXAAMBeRXDispensedDetail 
Definition  Dispense Medication History Details Table (Contains specific medications and associated pharmacies/prescribers)
Table holds medications coming from SureScripts, Community Meds. Acts as a staging table for dBMotion and Surescripts data 

dbo.SXAAMBeRXDispensedDetail Columns 
ColumnName  Domain  Datatype  NULL  Definition 
SiteId    smallint  NO  Identifies the unique distributed database ID where the row was inserted. Distributed databases are no longer supported so this column is deprecated. 
Build    int  NO  Identifies the build number and patch level of the software that inserted/updated this row. The format is the Build number followed by 3 digits for the patch level which is typically 000. The build number is tied to specific versions of the software, e.g. Sunrise 15.3 is Build 5021, Sunrise 16.3 is Build 5503. 
CreatedBy    varchar(50)  NO  Information about the user that created the row. This will typically be the UserID (IDCode from CV3User table) and may be prefixed with an environment identifier followed by an underscore, e.g. b96d2bf5_jongmore. 
CreatedWhen    datetime  NO  The date and time that the row was created and will be based on the Enterprise time zone. 
DispensedDetailID(PK)    bigint  NO  Auto generated unique primary key value. 
DispensedHeaderID(FK)    bigint  NO  A foreign key to the DispensedHeaderID column in the SXAAMBeRXDispensedHeader table. 
DrugName    varchar(140)  NO  Drug Name information for the relevant Drug listed in the DRU segment 
DrugNumber    varchar(35)  YES  Drug Number for the relevant Drug listed in the DRU segment (NDC11 code if it exists) 
LastFillDate    datetime  YES  visit TimeZone - Last Fill Date for the relevant Drug listed in the DRU segment 
DrugDispensedXml    xml  YES  XML Representation of Dispense History DRU Segment 
Msrepl_tran_version    uniqueidentifier  NO  Optimistic lock identifier. 
MedicationStartDtmUTC    datetimeoffset(3)  YES  Visit TimeZone -
Stores Start Date of medicaton 
MedicationEndDtmUTC    datetimeoffset(3)  YES  Visit TimeZone -
Stores End Date of medicaton 
Instruction    varchar(1000)  YES 
Medication instructions 
Duration    int  YES 
Medication Duration 
Quantity    numeric(11, 4)  YES 
holds amount of dose needs to be given 
Refills    int  YES 
Medication Refills 
OriginatingSource    varchar(50)  YES 
Medication Originating source from where it has come 
OriginatingProvider    varchar(50)  YES 
Medication Originating Provider who has given medication 
CommunityMedStatus    varchar(50)  YES 
Medication status as active, inactive, etc coming from the med source 
Dose    numeric(11, 4)  YES 
Dose of medication 
DosageUnit    int  YES 
unit of measure for drug 
Route    varchar(255)  YES 
medication route 
Frequency    int  YES 
frequency of the drug 
IsPRN    bit  NO 
indicates if the drug is PRN 
IsStartDateApprox    bit  NO 
indicates if the startdate is approximate 
IsEndDateApprox    bit  NO 
indicates if the enddate is approximate 
StartDateApproxType    int  YES  An enumerated type with the following list of possible values: 0 = [CompleteDate],1 = [MonthYear],2 = [Year], 
EndDateApproxType    int  YES  An enumerated type with the following list of possible values: 0 = [CompleteDate],1 = [MonthYear],2 = [Year], 
RxNormCode    varchar(20)  YES 
Rxnorm code of drug 
StatusType    int  NO  An enumerated type with the following list of possible values: 0 = [Pending],1 = [Accepted],2 = [EditedAndAccepted],3 = [Rejected],4 = [Deleted], 
TouchedBy    varchar(50)  NO  Information about the user that last updated the row. This will typically be the UserID (IDCode from CV3User table) and may be prefixed with an environment identifier followed by an underscore, e.g. b96d2bf5_jongmore. 
TouchedWhenUTC    datetimeoffset(3)  NO  The date and time that the row was last updated including the time zone offset from UTC, for example 2015-01-30 04:55:04.372 -05:00. The date and time is based on the Enterprise Time Zone. 
GenericItemID(FK)    int  YES  A foreign key to the GenericItemID column in the SXARxGenericItem table. 
GenericNameID(FK)    int  YES  A foreign key to the GenericNameID column in the SXARxGenericName table. 
Comments    varchar(1000)  YES  Comments entered by the provider 
FormularyDrugKey    varchar(30)  YES  MMDC(Main Multum Drug Code) 
FormularyBrandKey    varchar(30)  YES  DrugSynonymID from the table SXAMTmultum_drug_nameSYN 
ProductRouteID    int  YES 
This column stores the Multum Product Route ID, corrospends to ProductRouteID in SXAAMBClientPrescription 
CommunityMedID    varchar(500)  YES  This column is to uniquely identify a Community Mediaction 
RejectReason    varchar(255)  YES  Reason provided while rejecting the med 
CDSUniqueIDGUID    HVCIDdt  YES  Stores CDS unique Id for imported medication 
MSReplrowguid    uniqueidentifier  NO  Unique GUID used to support merge replication. 
RxNormQual    char(2)  YES  The Sure Scripts provided drug database source. 
IsDAW    bit  NO  PHI: Flag to indicate whether the community med is DAW 
AutoReconciliationStatusType    int  NO  An enumerated type with the following list of possible values: 0 = [NotAutoReconciled],1 = [NeedAutoReconcile],2 = [ReconcileDone], 

dbo.SXAAMBeRXDispensedDetail Primary and Unique Keys 
Key Name  Key Type  Keys 
SXAAMBeRXDispensedDetailPK  PrimaryKey  DispensedDetailID