· 7 years ago · Feb 20, 2019, 02:52 AM
1diff --git a/sql/5_0_1-to-5_0_2_upgrade.sql b/sql/5_0_1-to-5_0_2_upgrade.sql
2index f7828c9bf..7d796cbd7 100644
3--- a/sql/5_0_1-to-5_0_2_upgrade.sql
4+++ b/sql/5_0_1-to-5_0_2_upgrade.sql
5@@ -714,3 +714,73 @@ CREATE TABLE `keys` (
6 UNIQUE KEY (`name`)
7 ) ENGINE=InnoDB;
8 #EndIf
9+
10+#IfNotColumnType amendments pid bigint(20)
11+ALTER TABLE `amendments`
12+ MODIFY `pid` bigint(20) NOT NULL COMMENT 'Patient ID from patient_data';
13+#EndIf
14+
15+#IfNotColumnType billing pid bigint(20)
16+ALTER TABLE `billing`
17+ MODIFY `pid` bigint(20) default NULL;
18+#EndIf
19+
20+#IfNotColumnType dated_reminders pid bigint(20)
21+ALTER TABLE `dated_reminders`
22+ MODIFY `pid` bigint(20) NOT NULL;
23+#EndIf
24+
25+#IfNotColumnType drug_sales pid bigint(20)
26+ALTER TABLE `drug_sales`
27+ MODIFY `pid` bigint(20) NOT NULL default '0';
28+#EndIf
29+
30+#IfNotColumnType form_ros pid bigint(20)
31+ALTER TABLE `form_ros`
32+ MODIFY `pid` bigint(20) NOT NULL;
33+#EndIf
34+
35+#IfNotColumnType issue_encounter pid bigint(20)
36+ALTER TABLE `issue_encounter`
37+ MODIFY `pid` bigint(20) NOT NULL;
38+#EndIf
39+
40+#IfNotColumnType onsite_documents pid bigint(20)
41+ALTER TABLE `onsite_documents`
42+ MODIFY `pid` bigint(20) UNSIGNED DEFAULT NULL;
43+#EndIf
44+
45+#IfNotColumnType patient_access_onsite pid bigint(20)
46+ALTER TABLE `patient_access_onsite`
47+ MODIFY `pid` bigint(20);
48+#EndIf
49+
50+#IfNotColumnType patient_access_offsite pid bigint(20)
51+ALTER TABLE `patient_access_offsite`
52+ MODIFY `pid` bigint(20) NOT NULL;
53+#EndIf
54+
55+#IfNotColumnType form_eye_mag_wearing PID bigint(20)
56+ALTER TABLE `form_eye_mag_wearing`
57+ MODIFY `PID` bigint(20) NOT NULL;
58+#EndIf
59+
60+#IfNotColumnType therapy_groups_participants pid bigint(20)
61+ALTER TABLE `therapy_groups_participants`
62+ MODIFY `pid` bigint(20) NOT NULL;
63+#EndIf
64+
65+#IfNotColumnType therapy_groups_participant_attendance pid bigint(20)
66+ALTER TABLE `therapy_groups_participant_attendance`
67+ MODIFY `pid` bigint(20) NOT NULL;
68+#EndIf
69+
70+#IfNotColumnType notification_log pid bigint(20)
71+ALTER TABLE `notification_log`
72+ MODIFY `pid` bigint(20) NOT NULL;
73+#EndIf
74+
75+#IfNotColumnType documents foreign_id bigint(20)
76+ALTER TABLE `documents`
77+ MODIFY `foreign_id` bigint(20) default NULL;
78+#EndIf
79diff --git a/sql/database.sql b/sql/database.sql
80index dfdb6f960..4a24969f0 100644
81--- a/sql/database.sql
82+++ b/sql/database.sql
83@@ -53,7 +53,7 @@ CREATE TABLE `amendments` (
84 `amendment_date` date NOT NULL COMMENT 'Amendement request date',
85 `amendment_by` varchar(50) NOT NULL COMMENT 'Amendment requested from',
86 `amendment_status` varchar(50) NULL COMMENT 'Amendment status accepted/rejected/null',
87- `pid` int(11) NOT NULL COMMENT 'Patient ID from patient_data',
88+ `pid` bigint(20) NOT NULL COMMENT 'Patient ID from patient_data',
89 `amendment_desc` text COMMENT 'Amendment Details',
90 `created_by` int(11) NOT NULL COMMENT 'references users.id for session owner',
91 `modified_by` int(11) NULL COMMENT 'references users.id for session owner',
92@@ -189,7 +189,7 @@ CREATE TABLE `billing` (
93 `date` datetime default NULL,
94 `code_type` varchar(15) default NULL,
95 `code` varchar(20) default NULL,
96- `pid` int(11) default NULL,
97+ `pid` bigint(20) default NULL,
98 `provider_id` int(11) default NULL,
99 `user` int(11) default NULL,
100 `groupname` varchar(255) default NULL,
101@@ -1141,7 +1141,7 @@ CREATE TABLE `dated_reminders` (
102 `dr_message_text` varchar(160) NOT NULL,
103 `dr_message_sent_date` datetime NOT NULL,
104 `dr_message_due_date` date NOT NULL,
105- `pid` int(11) NOT NULL,
106+ `pid` bigint(20) NOT NULL,
107 `message_priority` tinyint(1) NOT NULL,
108 `message_processed` tinyint(1) NOT NULL DEFAULT '0',
109 `processed_date` timestamp NULL DEFAULT NULL,
110@@ -1208,7 +1208,7 @@ CREATE TABLE `documents` (
111 `pages` int(11) default NULL,
112 `owner` int(11) default NULL,
113 `revision` timestamp NOT NULL,
114- `foreign_id` int(11) default NULL,
115+ `foreign_id` bigint(20) default NULL,
116 `docdate` date default NULL,
117 `hash` varchar(40) DEFAULT NULL COMMENT '40-character SHA-1 hash of document',
118 `list_id` bigint(20) NOT NULL default '0',
119@@ -1342,7 +1342,7 @@ CREATE TABLE `drug_sales` (
120 `drug_id` int(11) NOT NULL,
121 `inventory_id` int(11) NOT NULL,
122 `prescription_id` int(11) NOT NULL default '0',
123- `pid` int(11) NOT NULL default '0',
124+ `pid` bigint(20) NOT NULL default '0',
125 `encounter` int(11) NOT NULL default '0',
126 `user` varchar(255) default NULL,
127 `sale_date` date NOT NULL,
128@@ -1940,7 +1940,7 @@ CREATE TABLE `form_reviewofs` (
129 DROP TABLE IF EXISTS `form_ros`;
130 CREATE TABLE `form_ros` (
131 `id` int(11) NOT NULL auto_increment,
132- `pid` int(11) NOT NULL,
133+ `pid` bigint(20) NOT NULL,
134 `activity` int(11) NOT NULL default '1',
135 `date` datetime default NULL,
136 `weight_change` varchar(3) default NULL,
137@@ -2987,7 +2987,7 @@ CREATE TABLE `insurance_numbers` (
138
139 DROP TABLE IF EXISTS `issue_encounter`;
140 CREATE TABLE `issue_encounter` (
141- `pid` int(11) NOT NULL,
142+ `pid` bigint(20) NOT NULL,
143 `list_id` int(11) NOT NULL,
144 `encounter` int(11) NOT NULL,
145 `resolved` tinyint(1) NOT NULL,
146@@ -5390,7 +5390,7 @@ CREATE TABLE `onotes` (
147 DROP TABLE IF EXISTS `onsite_documents`;
148 CREATE TABLE `onsite_documents` (
149 `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
150- `pid` int(10) UNSIGNED DEFAULT NULL,
151+ `pid` bigint(20) UNSIGNED DEFAULT NULL,
152 `facility` int(10) UNSIGNED DEFAULT NULL,
153 `provider` int(10) UNSIGNED DEFAULT NULL,
154 `encounter` int(10) UNSIGNED DEFAULT NULL,
155@@ -5764,7 +5764,7 @@ CREATE TABLE `openemr_session_info` (
156 DROP TABLE IF EXISTS `patient_access_onsite`;
157 CREATE TABLE `patient_access_onsite`(
158 `id` INT NOT NULL AUTO_INCREMENT ,
159- `pid` INT(11),
160+ `pid` bigint(20),
161 `portal_username` VARCHAR(100) ,
162 `portal_pwd` VARCHAR(100) ,
163 `portal_pwd_status` TINYINT DEFAULT '1' COMMENT '0=>Password Created Through Demographics by The provider or staff. Patient Should Change it at first time it.1=>Pwd updated or created by patient itself',
164@@ -5955,7 +5955,7 @@ CREATE TABLE `patient_reminders` (
165 DROP TABLE IF EXISTS `patient_access_offsite`;
166 CREATE TABLE `patient_access_offsite` (
167 `id` int(11) NOT NULL AUTO_INCREMENT,
168- `pid` int(11) NOT NULL,
169+ `pid` bigint(20) NOT NULL,
170 `portal_username` varchar(100) NOT NULL,
171 `portal_pwd` varchar(100) NOT NULL,
172 `portal_pwd_status` tinyint(4) DEFAULT '1' COMMENT '0=>Password Created Through Demographics by The provider or staff. Patient Should Change it at first time it.1=>Pwd updated or created by patient itself',
173@@ -7295,7 +7295,7 @@ INSERT INTO `automatic_notification` (`notification_id`, `sms_gateway_type`, `ne
174 DROP TABLE IF EXISTS `notification_log`;
175 CREATE TABLE `notification_log` (
176 `iLogId` int(11) NOT NULL auto_increment,
177- `pid` int(7) NOT NULL,
178+ `pid` bigint(20) NOT NULL,
179 `pc_eid` int(11) unsigned NULL,
180 `sms_gateway_type` varchar(50) NOT NULL,
181 `smsgateway_info` varchar(255) NOT NULL,
182@@ -10035,7 +10035,7 @@ CREATE TABLE `form_eye_mag_wearing` (
183 `id` int(11) NOT NULL AUTO_INCREMENT,
184 `ENCOUNTER` int(11) NOT NULL,
185 `FORM_ID` smallint(6) NOT NULL,
186- `PID` int(11) NOT NULL,
187+ `PID` bigint(20) NOT NULL,
188 `RX_NUMBER` int(11) NOT NULL,
189 `ODSPH` varchar(10) DEFAULT NULL,
190 `ODCYL` varchar(10) DEFAULT NULL,
191@@ -10199,7 +10199,7 @@ CREATE TABLE `therapy_groups` (
192 DROP TABLE IF EXISTS `therapy_groups_participants`;
193 CREATE TABLE `therapy_groups_participants` (
194 `group_id` int(11) NOT NULL,
195- `pid` int(11) NOT NULL ,
196+ `pid` bigint(20) NOT NULL,
197 `group_patient_status` int(11) NOT NULL,
198 `group_patient_start` date NOT NULL ,
199 `group_patient_end` date,
200@@ -10216,7 +10216,7 @@ CREATE TABLE `therapy_groups_participants` (
201 DROP TABLE IF EXISTS `therapy_groups_participant_attendance`;
202 CREATE TABLE `therapy_groups_participant_attendance` (
203 `form_id` int(11) NOT NULL ,
204- `pid` int(11) NOT NULL ,
205+ `pid` bigint(20) NOT NULL,
206 `meeting_patient_comment` text ,
207 `meeting_patient_status` varchar(15),
208 PRIMARY KEY (`form_id`,`pid`)
209diff --git a/version.php b/version.php
210index 99ad544e7..e6deed062 100644
211--- a/version.php
212+++ b/version.php
213@@ -25,7 +25,7 @@ $v_realpatch = '0';
214 // is a database change in the course of development. It is used
215 // internally to determine when a database upgrade is needed.
216 //
217-$v_database = 280;
218+$v_database = 281;
219
220 // Access control version identifier, this is to be incremented whenever there
221 // is a access control change in the course of development. It is used