made CO-PAY translateable
[openemr.git] / sql / 2_9_0-to-2_9_1_upgrade.sql
blobdc6df1c8f95e0b132cbfd115aed9b68ad13874d5
1 #IfMissingColumn form_misc_billing_options replacement_claim
2 ALTER TABLE form_misc_billing_options
3   ADD replacement_claim tinyint(1) DEFAULT 0;
4 #EndIf
6 #IfMissingColumn insurance_data accept_assignment
7 ALTER TABLE insurance_data
8   ADD accept_assignment varchar(5) NOT NULL DEFAULT 'TRUE';
9 #EndIf
11 #IfMissingColumn forms deleted
12 ALTER TABLE forms 
13     ADD deleted TINYINT DEFAULT '0' NOT NULL COMMENT 'flag indicates form has been deleted';
14 #EndIf
16 #IfMissingColumn immunizations vis_date
17 ALTER TABLE immunizations
18   ADD `vis_date` date default NULL COMMENT 'Date of VIS Statement';
19 #EndIf
21 #IfNotTable chart_tracker
22 CREATE TABLE chart_tracker (
23   ct_pid            int(11)       NOT NULL,
24   ct_when           datetime      NOT NULL,
25   ct_userid         bigint(20)    NOT NULL DEFAULT 0,
26   ct_location       varchar(31)   NOT NULL DEFAULT '',
27   PRIMARY KEY (ct_pid, ct_when)
28 ) ENGINE=MyISAM;
29 #EndIf
31 #IfNotRow list_options list_id chartloc
32 INSERT INTO list_options VALUES ('lists'   ,'chartloc','Chart Storage Locations',1,0,0);
33 INSERT INTO list_options VALUES ('chartloc','fileroom','File Room'              ,1,0,0);
34 #EndIf
36 #IfMissingColumn form_encounter last_level_billed
37 ALTER TABLE form_encounter
38   ADD last_level_billed int           NOT NULL DEFAULT 0 COMMENT '0=none, 1=ins1, 2=ins2, etc',
39   ADD last_level_closed int           NOT NULL DEFAULT 0 COMMENT '0=none, 1=ins1, 2=ins2, etc',
40   ADD last_stmt_date    date          DEFAULT NULL,
41   ADD stmt_count        int           NOT NULL DEFAULT 0;
42 #EndIf
44 #IfNotTable ar_session
45 CREATE TABLE ar_session (
46   session_id     int unsigned  NOT NULL AUTO_INCREMENT,
47   payer_id       int(11)       NOT NULL            COMMENT '0=pt else references insurance_companies.id',
48   user_id        int(11)       NOT NULL            COMMENT 'references users.id for session owner',
49   closed         tinyint(1)    NOT NULL DEFAULT 0  COMMENT '0=no, 1=yes',
50   reference      varchar(255)  NOT NULL DEFAULT '' COMMENT 'check or EOB number',
51   check_date     date          DEFAULT NULL,
52   deposit_date   date          DEFAULT NULL,
53   pay_total      decimal(12,2) NOT NULL DEFAULT 0,
54   PRIMARY KEY (session_id),
55   KEY user_closed (user_id, closed),
56   KEY deposit_date (deposit_date)
57 ) ENGINE=MyISAM;
58 #EndIf
60 #IfNotTable ar_activity
61 CREATE TABLE ar_activity (
62   pid            int(11)       NOT NULL,
63   encounter      int(11)       NOT NULL,
64   sequence_no    int unsigned  NOT NULL AUTO_INCREMENT,
65   code           varchar(9)    NOT NULL            COMMENT 'empty means claim level',
66   modifier       varchar(5)    NOT NULL DEFAULT '',
67   payer_type     int           NOT NULL            COMMENT '0=pt, 1=ins1, 2=ins2, etc',
68   post_time      datetime      NOT NULL,
69   post_user      int(11)       NOT NULL            COMMENT 'references users.id',
70   session_id     int unsigned  NOT NULL            COMMENT 'references ar_session.session_id',
71   memo           varchar(255)  NOT NULL DEFAULT '' COMMENT 'adjustment reasons go here',
72   pay_amount     decimal(12,2) NOT NULL DEFAULT 0  COMMENT 'either pay or adj will always be 0',
73   adj_amount     decimal(12,2) NOT NULL DEFAULT 0,
74   PRIMARY KEY (pid, encounter, sequence_no),
75   KEY session_id (session_id)
76 ) ENGINE=MyISAM;
77 #EndIf
79 #IfMissingColumn users ssi_relayhealth
80 ALTER TABLE users
81   ADD ssi_relayhealth varchar(64) NULL;
82 #EndIf