dbo.SXAMMOutpatientOrderDispense 
Default Table Name  SXAMMOutpatientOrderDispense 
Definition  This entity contains a record of what has been dispensed to the outpatient (a history of all refills). 

dbo.SXAMMOutpatientOrderDispense 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. 
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. 
TouchedWhen    datetime  NO  The date and time that the row was last updated and will be based on the Enterprise time zone. 
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. 
Active    bit  NO  Denotes whether the row is active or not, 0 means the row has been soft deleted or deactivated. 
OutpatientOrderDispenseID(PK)    int  NO  Auto generated unique primary key value. 
OutpatientOrderID(FK)    int  NO  A foreign key to the OutpatientOrderID column in the SXAMMOutpatientOrder table. 
StockItemProductID(FK)    int  NO  A foreign key to the StockItemProductID column in the SXAMMStockItemProduct table. 
PharmacyID(FK)    int  NO  A foreign key to the PharmacyID column in the SXAMMPharmacy table. 
RefillNum    numeric(3, 1)  NO  If this is the first time the item is being dispensed (not a refill) the Refill Num will be zero.

,Refills will start at the number 1 and increase by 1 for each subsequent refill. 
DispensedQty    numeric(14, 4)  NO  Identifies the Quantity being dispensed 
DispensedUOMCode    varchar(30)  NO  Identifies the Unit of Measure associated with the Dispensed Qty. Links to CV3UnitOfMeasure table via Code. 
DaysSupplyNum    numeric(3, 0)  YES  Identifies the Days Supply being dispensed 
Note    varchar(2000)  YES  Notes for the Dispense (if required) 
ReasonCode    varchar(30)  YES  Identifies the reason for making the dispense record inactive.

Links to the CV3CodedReason table via the code.
EnteredByUserGUID    HVCIDdt  NO  Identifies the pharmacy user who entered the dispense information. 
OutpatientTypeID(FK)    int  YES  A foreign key to the OutpatientTypeID column in the SXAMMOutpatientType table. 
DebitInventory    bit  NO  Indicates if the dispense should debit the inventory or not (the inventory may already have been decremented if the order is for a cream or puffer that was received as an inpatient) 
CostAmt    numeric(11, 3)  YES  The calculated Cost of the dispensed order/refill 
PriceAmt    numeric(11, 3)  YES  The calculated price of the dispensed order/refill 
CalculationDetails    varchar(max)  YES  Identifies the formatted text associated with the Price Popup window that shows the detailed calculation steps. 
MSrepl_tran_version    uniqueidentifier  NO  Optimistic lock identifier. 
RxNote    varchar(140)  YES  This column stores notes provided by pharmacists during processing an Rx. This is different than the current Note column, which is storing clinicians' notes/instruction to pharmacy. 
BillForRxType    int  YES  This column stores a value indicating what type of billing was applied to a particular dispense. This could be different from the the configured value because pharmacists can manually change the value before processing a prescription. 
ProdPkgID    int  YES  This column stores what package is being dispensed for an ordered item. 
MSReplrowguid    uniqueidentifier  NO  Unique GUID used to support merge replication. 

dbo.SXAMMOutpatientOrderDispense Primary and Unique Keys 
Key Name  Key Type  Keys 
SXAMMOutpatientOrderDispensePK  PrimaryKey  OutpatientOrderDispenseID