Produced by Araxis Merge on 5/10/2018 8:40:52 AM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
# | Location | File | Last Modified |
---|---|---|---|
1 | MHED_APPS_CIF.zip\VAR v4.2.7\var-web-4.2.7@0810ae549c1.zip\veteran-appointment-requests\test\watir-ruby\module\database | OracleUtility.rb | Mon Apr 9 06:06:53 2018 UTC |
2 | MHED_APPS_CIF.zip\VAR v4.2.7\var-web-4.2.7@0810ae549c1.zip\veteran-appointment-requests\test\watir-ruby\module\database | OracleUtility.rb | Tue May 8 12:41:37 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 418 |
Changed | 1 | 6 |
Inserted | 0 | 0 |
Removed | 0 | 0 |
Whitespace | |
---|---|
Character case | Differences in character case are significant |
Line endings | Differences in line endings (CR and LF characters) are ignored |
CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
1 | require 'r ubygems' | |
2 | require 'o ci8' | |
3 | require 'b igdecimal' | |
4 | require 'b igdecimal/ util' | |
5 | require_re lative '.. /../module /DateUtili ty' | |
6 | ||
7 | module Ora cleUtility | |
8 | include DateUtilit y | |
9 | USER = " REDACTED " | |
10 | PASSWORD = " PW " | |
11 | VAMF_HOST_ PORT= "// IP " | |
12 | SERVICE_ NAME = "va mfdb.local host.local domain" | |
13 | ||
14 | def exec uteQuery(s ql) | |
15 | begin | |
16 | # put s "execute Query() Be gin" | |
17 | #put s "sql = " + sql | |
18 | conn = OCI8.ne w(USER, PA SSWORD, VA MF_HOST_PO RT + '/' + SERVICE_N AME, :SYSD BA) | |
19 | conn .exec(sql) | |
20 | conn .commit | |
21 | conn .logoff | |
22 | #put s ("execut eQuery() E nd") | |
23 | rescue Exception => e | |
24 | puts "[ExcuteQ uery() Exc eption ]" + e.messag e | |
25 | end | |
26 | end | |
27 | ||
28 | ||
29 | def exec uteAndGetD ataAndNumR ow(sql) | |
30 | puts " executeAnd getNumRowA ndData() B egin" | |
31 | conn = OCI8.new( OracleUtil ity::USER, OracleUti lity::PASS WORD, Orac leUtility: :VAMF_HOST _PORT + '/ ' + Oracle Utility::S ERVICE_NAM E, :SYSDBA ) | |
32 | return edData = ' ' | |
33 | ||
34 | num_ro ws = conn. exec(sql) do |r| | |
35 | ||
36 | retu rnedData = r.join(', ') | |
37 | end | |
38 | ||
39 | puts ( "num row i s " + num_ rows.to_s) | |
40 | ||
41 | puts " [returned value] " + returnedD ata.to_s | |
42 | conn.c ommit | |
43 | conn.l ogoff | |
44 | ||
45 | puts " executeAnd getNumRowA ndData() E nd" | |
46 | return returnedD ata + "||" + num_row s.to_s | |
47 | end | |
48 | ||
49 | def dele teUserFrom RightOfAcc ess(patien tId) | |
50 | execut eQuery("DE LETE FROM HADB.USER_ RIGHTOFACC ESS WHERE USER_ID='" + patient Id + "'") | |
51 | puts " Deleted RO A for User ID=" + pat ientId | |
52 | end | |
53 | ||
54 | def setD efaultROAF orPatient( patientId) | |
55 | ||
56 | begin | |
57 | ||
58 | conn = OCI8.new(U SER, PASSW ORD, VAMF_ HOST_PORT + "/" + SE RVICE_NAME , :SYSDBA) | |
59 | ||
60 | num_ro ws = conn. exec("SELE CT * FROM HADB.USER_ RIGHTOFACC ESS WHERE USER_ID='" + patient Id + "'") do |r| | |
61 | pu ts r.join( ',') | |
62 | end | |
63 | ||
64 | puts ( "num row i s " + num_ rows.to_s) | |
65 | ||
66 | if num _rows == n il || num _rows == 0 then | |
67 | conn .exec("INS ERT INTO H ADB.USER_R IGHTOFACCE SS (USER_I D, ROA_STA TE, ROA_DA TE, ROA_FO RM) VALUES ('" + pat ientId + " ', TO_NUMB ER(1), TO_ DATE('2015 /05/31', ' YYYY/MM/DD '), utl_ra w.cast_to_ raw('empty '))") | |
68 | ||
69 | end | |
70 | ||
71 | conn.c ommit | |
72 | conn.l ogoff | |
73 | ||
74 | puts " [setDefaul tROAForPat ient]" | |
75 | ||
76 | rescue Exception => e | |
77 | puts " [ExcuteQue ry() Excep tion ]" + e.message | |
78 | end | |
79 | ||
80 | end | |
81 | ||
82 | def upda teStatus(a ppmt_reque st_id, pat ient_id, s tatus, app ointment_t ype) | |
83 | sql = "update VA RDB.appoin tment_requ est set st atus ='" + status + "' where P ATIENT_ID= '" + patie nt_id + "' and appoi ntment_req uest_id =' " + appmt_ request_id + "' and appointmen t_type='" + appointm ent_type + "'" | |
84 | execut eQuery(sql ) | |
85 | end | |
86 | ||
87 | def upda teAppointm entRequest edFields(d ate, optio n_date_tim e1, option _date_time 2, option_ date_time3 , patient_ id, appmt_ request_id , status) | |
88 | sql = "update VA RDB.appoin tment_requ est set La st_Updated _Date=to_d ate('" + d ate + "', 'MM/DD/YYY Y'), Creat ed_Date=to _date('" + date + "' , 'MM/DD/Y YYY'), Opt ion_date_1 ='" +optio n_date_tim e1[0] + "' , option_t ime_1='" + option_da te_time1[1 ] +"', opt ion_date_2 ='" + opti on_date_ti me2[0] + " ', option_ time_2='" + option_d ate_time2[ 1] +"', op tion_date_ 3='" + opt ion_date_t ime3[0]+ " ', option_ time_3='" + option_d ate_time3[ 1] + "', p hone_numbe r='(123) 4 56-7890', status='" + status + "' where PATIENT_ID ='" + pati ent_id + " ' and appo intment_re quest_id = '" + appmt _request_i d + "'" | |
89 | execut eQuery(sql ) | |
90 | end | |
91 | ||
92 | def upda teAppointm entRequest edPreferen ce(provide r_option, purpose_of _visit, ot her_purpos e_of_visit , patient_ id, appmt_ request_id ) | |
93 | sql = "update VA RDB.appoin tment_requ est set pr ovider_opt ion='" + p rovider_op tion + "', purpose_o f_visit='" + purpose _of_visit+ "', other _purpose_o f_visit='" + other_p urpose_of_ visit +"' where PATI ENT_ID='" + patient_ id + "' an d appointm ent_reques t_id ='" + appmt_req uest_id + "'" | |
94 | execut eQuery(sql ) | |
95 | end | |
96 | ||
97 | def dele teMessage( patientId, apmt_rqt_ id) | |
98 | sql = "delete fr om vardb.a ppointment _request_m essage whe re sender_ id='" + pa tientId + "' and ap pointment_ request_id ='" + apmt _rqt_id +" '" | |
99 | execut eQuery(sql ) | |
100 | ||
101 | sql2 = "delete from vardb .appointme nt_request _message where send er_id='sta ffscv' and appointme nt_request _id='" + a pmt_rqt_id +"'" | |
102 | execut eQuery(sql ) | |
103 | end | |
104 | ||
105 | ||
106 | def getL astUpdated FromDB(pat ient_id, a ppmt_reque st_id) | |
107 | sql = "select la st_updated _date from vardb.app ointment_r equest whe re patient _id='" + p atient_id + "' and a ppointment _request_i d='" + app mt_request _id + "'" | |
108 | return edData = e xecuteAndG etDataAndN umRow(sql) | |
109 | ||
110 | dateAr r = return edData.spl it("||") | |
111 | dateHH MM = dateA rr[0].spli t(" -") | |
112 | ||
113 | return getFormat edDateStr( dateHHMM[0 ], "%Y-%m- %d %H:%M", "%m/%d/%Y %H:%M") | |
114 | end | |
115 | ||
116 | def rese tDataForPa tientOne() | |
117 | execut eQuery( "d elete from vardb.bes t_time_to_ call where appointme nt_request _id in (se lect appoi ntment_req uest_id fr om vardb.a ppointment _request w here patie nt_id ='P0 01' and ap pointment_ request_id not in('0 0000000000 0000000000 0000000001 3', '00000 0000000000 0000000000 0000014',' 0000000000 0000000000 0000000000 15', '0000 0000000000 0000000000 00000016', '00000000 0000000000 0000000000 0017'))") | |
118 | execut eQuery("de lete from vardb.noti fication_p reference where pati ent_id ='P 001'") | |
119 | execut eQuery("de lete from vardb.ar_d etail_code where use r_id='P001 '") | |
120 | #execu teQuery("d elete from vardb.app ointment_r equest_mes sage where appointme nt_request _id not in ('00000000 0000000000 0000000000 0013', '00 0000000000 0000000000 0000000014 ','0000000 0000000000 0000000000 00015', '0 0000000000 0000000000 0000000001 6', '00000 0000000000 0000000000 0000017')" ) | |
121 | ||
122 | execut eQuery("de lete from vardb.appo intment_re quest_mess age where sender_id= 'P001'") | |
123 | execut eQuery("de lete from vardb.appo intment_re quest wher e patient_ id ='P001' and appoi ntment_req uest_id no t in('0000 0000000000 0000000000 00000013', '00000000 0000000000 0000000000 0014','000 0000000000 0000000000 000000015' , '0000000 0000000000 0000000000 00016', '0 0000000000 0000000000 0000000001 7')") | |
124 | end | |
125 | ||
126 | def dele tePatientD ata(patien tId) | |
127 | execut eQuery("de lete from vardb.best _time_to_c all where appointmen t_request_ id in (sel ect appoin tment_requ est_id fro m vardb.ap pointment_ request wh ere patien t_id ='" + patientId + "')") | |
128 | execut eQuery("de lete from vardb.noti fication_p reference where pati ent_id ='" + patient Id + "'") | |
129 | execut eQuery("de lete from vardb.ar_d etail_code where app ointment_r equest_id in (select appointme nt_request _id from v ardb.appoi ntment_req uest where patient_i d ='" + pa tientId + "')") | |
130 | execut eQuery("de lete from vardb.appo intment_re quest_mess age where sender_id= '" + patie ntId + "' ") | |
131 | execut eQuery("de lete from vardb.appo intment_re quest wher e patient_ id ='" + p atientId + "'") | |
132 | end | |
133 | ||
134 | def dele teAllReque stData() | |
135 | execut eQuery("de lete from vardb.best _time_to_c all") | |
136 | execut eQuery("de lete from vardb.noti fication_p reference" ) | |
137 | execut eQuery("de lete from vardb.ar_d etail_code ") | |
138 | execut eQuery("de lete from vardb.appo intment_re quest_mess age") | |
139 | execut eQuery("de lete from vardb.appo intment_re quest") | |
140 | execut eQuery("de lete from vardb.APPT _REQ_INPRO CESS") | |
141 | end | |
142 | ||
143 | def dele teAllCCReq uestData() | |
144 | execut eQuery("de lete from vardb.best _time_to_c all") | |
145 | execut eQuery("de lete from vardb.ar_d etail_code ") | |
146 | execut eQuery("de lete from vardb.appo intment_re quest_mess age") | |
147 | execut eQuery("de lete from vardb.appo intment_re quest") | |
148 | execut eQuery("de lete from vardb.APPT _REQ_INPRO CESS") | |
149 | execut eQuery("de lete from vardb.cc_a ppointment _request") | |
150 | end | |
151 | ||
152 | def dele teNotifica tionPrefer ence(patie ntId) | |
153 | execut eQuery("de lete from vardb.noti fication_p reference where pati ent_id ='" + patient Id + "'") | |
154 | end | |
155 | ||
156 | def inse rtRequests Data(statu s, typeOfC are, facil ity_id, ty peOfCareID , friendly _name, det code) | |
157 | $today = getDate NthDaysFro mNow(0, "% m/%d/%Y") | |
158 | $two_d ays_later = getDateN thDaysFrom Now(2, "%m /%d/%Y") | |
159 | $futur eDate = ge tDateNthDa ysFromNow( 4, "%m/%d/ %Y") | |
160 | $detco deID; | |
161 | $detco de; | |
162 | puts " Inserting requests.. ..." | |
163 | case d etcode | |
164 | when "DETCODE2 4" | |
165 | $d etcodeID = "8a828284 622a3cf301 6230216b64 0046" | |
166 | $d etcode = " DETCODE24" | |
167 | pu ts "DETCOD E24" | |
168 | when "DETCODE2 3" | |
169 | $d etcodeID = "8a828284 622a3cf301 623020fa5c 0041" | |
170 | $d etcode = " DETCODE23" | |
171 | pu ts "DETCOD E23" | |
172 | when "DETCODE2 2" | |
173 | $d etcodeID = "8a828284 622a3cf301 623020a84c 003a" | |
174 | $d etcode = " DETCODE22" | |
175 | pu ts "DETCOD E22" | |
176 | when "DETCODE2 1" | |
177 | $d etcodeID = "8a828284 622a3cf301 623020124a 0032" | |
178 | $d etcode = " DETCODE21" | |
179 | pu ts "DETCOD E21" | |
180 | when "DETCODE2 0" | |
181 | $d etcodeID = "8a828284 622a3cf301 622a6bd84e 001f" | |
182 | $d etcode = " DETCODE20" | |
183 | pu ts "DETCOD E20" | |
184 | else | |
185 | pu ts "DETCOD E is undef ined" | |
186 | end | |
187 | sql =< <EOF | |
188 | INSE RT INTO "V ARDB"."APP OINTMENT_R EQUEST" (A PPOINTMENT _REQUEST_I D,PATIENT_ ID,LAST_UP DATED_DATE ,CREATED_D ATE,DELETE D_DATE,ACT IVE,SECOND _REQUEST,A PPOINTMENT _DATE,APPO INTMENT_TI ME,OPTION_ DATE_1,OPT ION_TIME_1 ,OPTION_DA TE_2,OPTIO N_TIME_2,O PTION_DATE _3,OPTION_ TIME_3,STA TUS,APPOIN TMENT_TYPE ,FACILITY_ CODE,EMAIL ,PHONE_NUM BER,TEXT_M ESSAGING_A LLOWED,TEX T_MESSAGIN G_PHONE_NU MBER,PURPO SE_OF_VISI T,OTHER_PU RPOSE_OF_V ISIT,VISIT _TYPE,PROV IDER_ID,PR OVIDER_NAM E,PROVIDER _PERSON_CL ASS,PROVID ER_OPTION, SECOND_REQ UEST_SUBMI TTED,PAREN T_REQUEST_ ID,HAS_VET ERAN_NEW_M ESSAGE,HAS _PROVIDER_ NEW_MESSAG E,PROVIDER _SEEN_APPT _REQ,REQUE STED_PHONE _CALL,TYPE _OF_CARE_I D,REASON_F OR_VISIT,O THER_REASO N_FOR_VISI T,ADDITION AL_INFORMA TION,BOOKE D_APPT_DAT ETIME,FRIE NDLY_NAME) values (' 8a8282845e e822ad015e e839f71300 05','11131 38327',to_ timestamp( '#{getDate NthDaysFro mNow(0, "% d-%b-%y")} 12.31.06. 481000000 PM','DD-MO N-RR HH.MI .SSXFF AM' ),to_times tamp('#{ge tDateNthDa ysFromNow( 0, "%d-%b- %y")} 12.3 1.06.48100 0000 PM',' DD-MON-RR HH.MI.SSXF F AM'),nul l,1,0,null ,null,'#{g etDateNthD aysFromNow (2, "%m/%d /%Y")}','A M','No Dat e Selected ','No Time Selected' ,'No Date Selected', 'No Time S elected',' #{status}' ,'#{typeOf Care}','#{ facility_i d}','test@ test.com', '(234) 567 -8900',0,n ull,'New I ssue',null ,'Office V isit','0', null,null, null,0,nul l,0,0,0,1, '#{typeOfC areID}',nu ll,null,'t est reques t',null,'# {friendly_ name}'); | |
189 | INSE RT INTO "V ARDB"."BES T_TIME_TO_ CALL" (APP OINTMENT_R EQUEST_ID, BEST_TIME) values (' 8a8282845e e822ad015e e839f71300 05', 'Morn ing'); | |
190 | INSE RT INTO "V ARDB"."AR_ DETAIL_COD E" (AR_DET AIL_CODE_I D,DETAIL_C ODE_ID,APP OINTMENT_R EQUEST_ID, CREATED_DA TE,USER_ID ) values ( '#{$detcod eID}','#{$ detcode}', '8a8282845 ee822ad015 ee839f7130 005',to_ti mestamp('# {getDateNt hDaysFromN ow(0, "%d- %b-%y")} 1 1.29.13.80 1000000 AM ','DD-MON- RR HH.MI.S SXFF AM'), '990'); | |
191 | COMMIT; | |
192 | EOF | |
193 | insert Request(sq l) | |
194 | puts " requests i nserted" | |
195 | datex = "#{getDa teNthDaysF romNow(0, "%d-%b-%y" )} 11.29.1 3.80100000 0 AM" | |
196 | puts $ detcodeID | |
197 | puts $ detcode | |
198 | puts d atex | |
199 | end | |
200 | ||
201 | ||
202 | def inse rtRequest( sql) | |
203 | sql = sql.split( ';') | |
204 | sql.ea ch do |que ry| | |
205 | quer y.strip! | |
206 | exec uteQuery(q uery) unle ss query.e mpty? | |
207 | end | |
208 | ||
209 | end | |
210 | ||
211 | ||
212 | end |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.