dbo.SXAMMBillChargeHeader 
Default Table Name  SXAMMBillChargeHeader 
Definition  The Bill Charge Header and Bill Charge Detail tables are where the Pharmacy system writes data that will trigger the creation of a Financial Transaction segment.
An external process will poll these tables and look for new transactions to send to the Financial System (Charge Control = 'NP').
When the external process has sent the data to to the Financial System, it sets the status to processed (Charge Control = 'PD').
The data in these tables is formatted in HL7 format.
A Financial Transaction is made up of 1 row in Bill Charge Header, and 1 or more rows in Bill Charge Detail.
The Bill Charge Header row contains the information that will go in the PID segment of the Financial Transaction.
Each Bill Charge Detail row contains the information that will go in the FT1 segments of the Financial Transaction.
After storing the data for the new Financial Transaction into these tables, Pharmacy's job is done and as far as Pharmacy is concerned, it has no more work to do. It is the responsibility of the external process to make sure that the transactions are sent to the Financial System. 

dbo.SXAMMBillChargeHeader 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. 
BillChargeHeaderID(PK)    bigint  NO  Auto generated unique primary key value. 
BilledTransactionID(FK)    bigint  NO  A foreign key to the BilledTransactionID column in the SXAMMBilledTransaction table. 
ChargeStatusID    varchar(2)  NO  Identifies the processing status of the Financial Transaction.
Valid Values are: 'NP' Not Processed 'PD' Processed
Pharmacy sets this to 'NP' (Not Processed) for each new Transaction created.The external process that creates the Financial Transaction sets this to 'PD' (Processed) when the Financial Transaction has been sent. 
ChargeControlID    varchar(2)  NO  Identifies whether this is a Charge or Credit Transaction.
'NW' Charge 'CA' Credit 
MRN    varchar(120)  NO  PHI: Identifies the Medical Record Number sent to Financial System.
Only Component 1 is sent.
Components:
authority^identifier type code^assigning facility> 
PatientLName    varchar(50)  NO  PHI: Identifies the Patient Last Name. 
PatientFName    varchar(50)  YES  PHI: Identifies the Patient First Name. 
PatientMInitial    char(1)  YES  PHI: Identifies the Patient Middle Initial. 
BirthDate    datetime  YES  Enterprise TimeZone - Identifies the Patient Birth Date.
 
PatientGenderID    char(1)  YES  Identifies the Patient Gender. Valid values. 'F' Female 'M' Male 'O' Other 'U' Unknown 
AcctNumber    varchar(20)  NO  PHI: Identifies the Patient Account Number.
This is the patient account number assigned by accounting to which all charges, payments, etc., are recorded. 
MSrepl_tran_version    uniqueidentifier  NO  Optimistic lock identifier. 
VisitTypeCode    varchar(30)  YES  The Client Visit Type 
MSReplrowguid    uniqueidentifier  NO  Unique GUID used to support merge replication. 

dbo.SXAMMBillChargeHeader Primary and Unique Keys 
Key Name  Key Type  Keys 
SXAMMBillChargeHeaderPK  PrimaryKey  BillChargeHeaderID