994. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 10/3/2017 11:16:07 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.

994.1 Files compared

# Location File Last Modified
1 ehmp.zip\ehmp\ehmp\product\tests\data_load_scripts medication_lookup.rb Tue Jan 10 16:20:50 2017 UTC
2 ehmp.zip\ehmp\ehmp\product\tests\data_load_scripts medication_lookup.rb Tue Oct 3 14:31:58 2017 UTC

994.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 4 658
Changed 3 6
Inserted 0 0
Removed 0 0

994.3 Comparison options

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

994.4 Active regular expressions

No regular expressions were active.

994.5 Comparison detail

  1   require 'v istarpc4r'
  2  
  3   @broker =  VistaRPC4r ::RPCBroke rConnectio n.new(" IP          ",  PORT , "
R EDACTED ", "
R EDACTED ", false)
  4   @broker.co nnect
  5   @broker.se tContext(' OR CPRS GU I CHART')
  6  
  7  
  8   def user_s earch()
  9           pr int "Searc h for User : "
  10           us er = gets. chomp
  11           vr pc = Vista RPC4r::Vis taRPC.new( "ORWPT LIS T ALL", Vi staRPC4r:: RPCRespons e::ARRAY)
  12  
  13           vr pc.params  = [
  14                    user .upcase,
  15                    "1"
  16           ]
  17  
  18           re sp = @brok er.execute (vrpc)
  19  
  20           re sp.value.e ach_with_i ndex do |d , index|
  21                    if i ndex < 10
  22                             array  = d.split( '^')
  23                             puts " \t#{array[ 0]}\t #{ar ray[1]}"
  24                    end
  25           en d
  26  
  27           pr int "Selec t Patient  ID or pres s enter to  re-search : "
  28           pa tient_id =  gets.chom p
  29  
  30           if  patient_i d == ""
  31                    retu rn patient _id = user _search()
  32           el se
  33                    retu rn patient _id
  34           en d
  35   end
  36  
  37   def user_m eds(patien t_id)
  38           pu ts "Here a re the Use rs meds... "
  39           vr pc = Vista RPC4r::Vis taRPC.new( "ORWPS ACT IVE", Vist aRPC4r::RP CResponse: :ARRAY)
  40  
  41           vr pc.params  = [patient _id, "991" , "0", "1" ]
  42  
  43           re sp = @brok er.execute (vrpc)
  44  
  45           re sp.value.e ach do |d|
  46                    if d .start_wit h?('~')
  47                             array  = d.split( '^')
  48  
  49                             med_ty pe = "Inpa tient"
  50                             case a rray.first
  51                             when " ~OP"
  52                                      med_type  = "Outpat ient"
  53                             when " ~NV"
  54                                      med_type  = "Non-VA \t"
  55                             end
  56  
  57                             puts " \t#{med_ty pe}\t #{ar ray[9]} \t  #{array[2 ]}"
  58                    end
  59           en d
  60   end
  61  
  62   def med_lo okup()
  63           pr int "Searc h for Medi cation: "
  64           me d = gets.c homp
  65  
  66           vr pc = Vista RPC4r::Vis taRPC.new( "ORWUL FV4 DG", Vista RPC4r::RPC Response:: SINGLE_VAL UE)
  67  
  68           vr pc.params  = [
  69                    "UD  RX",
  70           ]
  71  
  72           re sp = @brok er.execute (vrpc)
  73  
  74           dr ug_table =  resp.valu e.split('^ ').first
  75  
  76           vr pc = Vista RPC4r::Vis taRPC.new( "ORWUL FVI DX", Vista RPC4r::RPC Response:: SINGLE_VAL UE)
  77  
  78           vr pc.params  = [
  79                    drug _table,
  80                    med. upcase
  81           ]
  82  
  83           re sp = @brok er.execute (vrpc)
  84  
  85           me d_index =  resp.value .split('^' ).first
  86  
  87           vr pc = Vista RPC4r::Vis taRPC.new( "ORWUL FVS UB", Vista RPC4r::RPC Response:: ARRAY)
  88  
  89           vr pc.params  = [
  90                    drug _table,
  91                    "#{m ed_index}" ,
  92                    "#{m ed_index.t o_i + 10}"
  93           ]
  94  
  95           re sp = @brok er.execute (vrpc)
  96  
  97           re sp.value.e ach do |d|
  98               array = d .split('^' )
  99               puts "\t# {array[0]} \t #{array [1]}"
  100           en d
  101           pr int "Selec t Drug ID:  "
  102  
  103           se lect_med =  gets.chom p
  104   end
  105  
  106   def get_do se(select_ med, patie nt_id)
  107           vr pc = Vista RPC4r::Vis taRPC.new( "ORWDPS2 O ISLCT", Vi staRPC4r:: RPCRespons e::ARRAY)
  108  
  109           vr pc.params  = [
  110                    sele ct_med,
  111                    "U",
  112                    pati ent_id,
  113                    "Y",
  114                    "Y"
  115           ]
  116  
  117           do ses = []
  118  
  119           re sp = @brok er.execute (vrpc)
  120  
  121           is _dose = fa lse
  122           re sp.value.e ach_with_i ndex do |d , index|
  123                    is_d ose = fals e if d ==  "~Dispense "
  124  
  125                    if i s_dose
  126                             array  = d.split( '^')
  127  
  128                             detail s_array =  array[3].s plit('&')
  129  
  130                             puts " \t#{detail s_array[5] }\t#{array [4]}" # th is is the  amount
  131  
  132                             dose =  {id: deta ils_array[ 5], amount : array[4] , all: arr ay[3]}
  133  
  134                             doses. push(dose)
  135  
  136                    end
  137                    is_d ose = true  if d == " ~Dosage"
  138           en d
  139  
  140           pr int "Selec t Dose ID:  "
  141  
  142           se lect_dose  = gets.cho mp
  143  
  144  
  145           do ses.each d o |dose|
  146                    if s elect_dose  == dose[: id]
  147                             return  dose
  148                    end
  149           en d
  150  
  151           pu ts "incorr ect dose i d entered. .."
  152           re turn get_d ose(select _med, pati ent_id)
  153   end
  154  
  155   def save_m ed(patient _id, med,  dose)
  156           vr pc = Vista RPC4r::Vis taRPC.new( "ORWDX SAV E", VistaR PC4r::RPCR esponse::A RRAY)
  157  
  158           vr pc.params  = [
  159                    pati ent_id,
  160                    "991 ",
  161                    "195 ",
  162                    "PSO  OERR",
  163                    "4",
  164                    "147 ",
  165                    "",
  166                    [
  167                             ["4,1" , med],
  168                             ["136, 1",dose[:a mount]],
  169                             ["138, 1",dose[:i d]],
  170                             ["386, 1",dose[:a ll]],
  171                             ["384, 1",dose[:a mount]],
  172                             ["137, 1","1"],                                                                                  #route
  173                             ["170, 1","BID"],                                                                                #schedul e
  174                             ["7,1" ,"9"],                                                                                    #urgency
  175                             ["15,1 ","ORDIALO G(\"WP\",1 5,1)"],
  176                             ["387, 1","90"],                                                                                 #supply
  177                             ["149, 1","180"],                                                                                #quantit y
  178                             ["150, 1","0"],                                                                                  #refills
  179                             ["151, 1",""],
  180                             ["148, 1","W"],                                                                                  #pickup  location
  181                             ["1358 ,1","ORDIA LOG(\"WP\" ,1358,1)"] ,
  182                             ["\"WP \",1358,1, 1,0",""],
  183                             ["385, 1","ORDIAL OG(\"WP\", 385,1)"],
  184                             ["\"WP \",385,1,1 ,0","TAKE  ONE TABLET  BY MOUTH  TWICE A DA Y"],             #sig ?
  185                             ["\"OR CHECK\""," 2"],
  186                             ["\"OR CHECK\",\" NEW\",\"2\ ",\"1\""," 99^2^Remot e Order Ch ecking not  available  - checks  done on lo cal data o nly"],
  187                             ["\"OR CHECK\",\" NEW\",\"2\ ",\"2\""," 25^2^||636 59,53872,N EW&These c hecks coul d not be c ompleted f or this pa tient: "],
  188                             ["\"OR TS\"","0"]
  189                    ],
  190                    "",
  191                    "",
  192                    "",
  193                    "0"
  194           ]
  195  
  196           re sp = @brok er.execute (vrpc)
  197           or der_id = r esp.value. first.spli t('^').fir st.split(' ~').last
  198  
  199           vr pc = Vista RPC4r::Vis taRPC.new( "ORWDX SEN D", VistaR PC4r::RPCR esponse::A RRAY)
  200  
  201           vr pc.params  = [
  202                    "100 841",
  203                    "991 ",
  204                    "195 ",
  205                    "",
  206                    [
  207                             ["1"," #{order_id }^1^1^E"]
  208                    ],
  209           ]
  210  
  211           re sp = @brok er.execute (vrpc)
  212  
  213           pu ts "Medica tion saved  and signe d."
  214   end
  215  
  216   patient_id  = user_se arch()
  217   user_meds( patient_id )
  218   med = med_ lookup()
  219   dose = get _dose(med,  patient_i d)
  220   save_med(p atient_id,  med, dose )
  221  
  222   # require  'greenlett ers'
  223  
  224   # console  = Greenlet ters::Proc ess.new("s sh vagrant @ IP          ", :timeou t => 10)
  225  
  226   # console. start!
  227  
  228   # console. wait_for(: output, /v agrant@ IP          's passwor d: /i)
  229   # console  << "vagran t\r"
  230  
  231   # console. wait_for(: output, /[ vagrant@lo calhost ~] $/i)
  232   # console  << "sudo c session ca che -U VIS TA\r"
  233  
  234   # console. wait_for(: output, /V ISTA>/i)
  235   # console  << "D ^XUP \r"
  236  
  237   # console. wait_for(: output, /A ccess Code : /i)
  238   # console  << "pha123 4\r"
  239  
  240   # console. wait_for(: output, /S elect OPTI ON NAME:/i )
  241   # console  << "rx\r"
  242  
  243   # console. wait_for(: output, /C HOOSE 1-4: /i)
  244   # console  << "2\r"
  245  
  246   # console. wait_for(: output, /D ivision: / i)
  247   # console  << "500\r"
  248   # console  << "\r"
  249   # console  << "\r"
  250   # console  << "\r"
  251   # console  << "\r"
  252   # console  << "\r"
  253   # console  << "\r"
  254   # console  << "\r"
  255  
  256   # console. wait_for(: output, /P atient Pre scription  Processing /i)
  257   # console  << "Patien t Prescrip tion Proce ssing\r"
  258  
  259   # console. wait_for(: output, /S elect PATI ENT NAME:/ i)
  260  
  261   # puts "-- ---------- ---\n"
  262   # puts con sole.outpu t_buffer.s tring()
  263  
  264  
  265   # output =  gets.chom p
  266  
  267   # while ou tput != "h alt"
  268  
  269   #       co nsole << " #{output}\ r"
  270   #       pu ts console .output_bu ffer.strin g()
  271   #       #  puts conso le.output_ buffer.str ing()
  272   #       co nsole.wait _for(:outp ut)
  273   #       ou tput = get s.chomp
  274  
  275  
  276   # end
  277  
  278   # console. wait_for(: output)
  279   # console. wait_for(: exit)
  280  
  281  
  282   # console  << "DIABET IC\r"
  283   # console  << "\r"
  284   # console  << "\r"
  285   # console  << "\r"
  286   # console  << "\r"
  287  
  288   # console. wait_for(: output, /S elect Acti on: Next S creen/i)
  289   # console  << "so\r"
  290  
  291   # console. wait_for(: output, /S elect Orde rs by numb er:/i)
  292   # console  << "1\r"
  293  
  294   # console. wait_for(: output, /F INISH/i)
  295   # console  << "fn\r"
  296   # console  << "\r"
  297  
  298   # console. wait_for(: output, /C opy Provid er Comment s into the  Patient I nstruction s?/i)
  299   # console  << "\r"
  300  
  301   # console. wait_for(: output, /D o you want  to Contin ue?/i)
  302   # console  << "yes\r"
  303  
  304   # console. wait_for(: output, /P ROVIDER:/i )
  305   # console  << "PROVID ER,EIGHT\r "
  306  
  307   # console. wait_for(: output, /C HOOSE 1-5: /i)
  308   # console  << "1\r"
  309  
  310   # console. wait_for(: output, /R ECOMMENDAT ION:/i)
  311   # console  << "8\r"
  312  
  313   # console. wait_for(: output, /W ould you l ike to edi t this int ervention/ i)
  314   # console  << "\r"
  315  
  316   # console. wait_for(: output, /W as treatme nt for Ser vice Conne cted condi tion?/i)
  317   # console  << "no\r"
  318  
  319   # console. wait_for(: output, /A re you sur e you want  to Accept  this Orde r?/i)
  320   # console  << "yes\r"
  321  
  322   # console. wait_for(: output, /M ETHOD OF P ICK-UP:/i)
  323   # console  << "\r"
  324  
  325   # console. wait_for(: output, /W AS THE PAT IENT COUNS ELED/i)
  326   # console  << "\r"
  327   # console  << "\r"
  328   # console  << "\r"
  329  
  330  
  331  
  332   @broker.cl ose