993. 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.

993.1 Files compared

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

993.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 334
Changed 1 2
Inserted 0 0
Removed 0 0

993.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

993.4 Active regular expressions

No regular expressions were active.

993.5 Comparison detail

  1   require 'v istarpc4r'
  2   require 'c sv'
  3  
  4   @broker =  VistaRPC4r ::RPCBroke rConnectio n.new(" IP          ",  PORT , "
R EDACTED ", "
R EDACTED ", false)
  5   @broker.co nnect
  6   @broker.se tContext(' OR CPRS GU I CHART')
  7  
  8   vrpc = Vis taRPC4r::V istaRPC.ne w("ORWUL F V4DG", Vis taRPC4r::R PCResponse ::SINGLE_V ALUE)
  9  
  10   vrpc.param s = [
  11           "U D RX",
  12   ]
  13  
  14   resp = @br oker.execu te(vrpc)
  15  
  16   drug_table  = resp.va lue.split( '^').first
  17  
  18   def get_do se(select_ med, name)
  19           vr pc = Vista RPC4r::Vis taRPC.new( "ORWDPS2 O ISLCT", Vi staRPC4r:: RPCRespons e::ARRAY)
  20  
  21           vr pc.params  = [
  22                    sele ct_med,
  23                    "U",
  24                    "3",
  25                    "Y",
  26                    "Y"
  27           ]
  28  
  29           do ses = []
  30  
  31           re sp = @brok er.execute (vrpc)
  32  
  33           is _dose = fa lse
  34           re sp.value.e ach_with_i ndex do |d , index|
  35                    is_d ose = fals e if d ==  "~Dispense "
  36  
  37                    if i s_dose
  38                             array  = d.split( '^')
  39  
  40                             detail s_array =  array[3].s plit('&')
  41  
  42                             # puts  "#{select _med} - #{ name} - #{ details_ar ray[5]} -  #{array[4] }" # this  is the amo unt
  43  
  44                             dose =  {id: deta ils_array[ 5], amount : array[4] , all: arr ay[3]}
  45  
  46                             doses. push(dose)
  47  
  48                    end
  49                    is_d ose = true  if d == " ~Dosage"
  50           en d
  51           do ses
  52   end
  53  
  54   all_drugs  = {}
  55  
  56   vrpc = Vis taRPC4r::V istaRPC.ne w("ORWUL F VSUB", Vis taRPC4r::R PCResponse ::ARRAY)
  57  
  58   vrpc.param s = [
  59           dr ug_table,
  60           "1 ",
  61           "1 0000"
  62   ]
  63  
  64   resp = @br oker.execu te(vrpc)
  65  
  66   resp.value .each do | d|
  67       array  = d.split( '^')
  68  
  69       unless  array[1]. nil?
  70                unless a rray[1].in clude?('<' )
  71                    all_ drugs[arra y[0]] = ar ray[1]
  72                end
  73           en d
  74   end
  75  
  76   all_dose =  []
  77  
  78   all_drugs. each do |k ey, value|
  79           do se = get_d ose(key, v alue)
  80           do se.each do  |d|
  81                    d[:m ed] = valu e
  82                    d[:m ed_id] = k ey
  83                    all_ dose << d
  84           en d
  85   end
  86  
  87   def save_m ed(patient _id, dose,  schedule,  supply, q uantity, r efills, lo cation, ro ute)
  88           vr pc = Vista RPC4r::Vis taRPC.new( "ORWDX SAV E", VistaR PC4r::RPCR esponse::A RRAY)
  89  
  90           vr pc.params  = [
  91                    pati ent_id,
  92                    "991 ",
  93                    loca tion,
  94                    "PSO  OERR",
  95                    "4",
  96                    "147 ",
  97                    "",
  98                    [
  99                             ["4,1" , dose[:me d_id]],
  100                             ["136, 1",dose[:a mount]],
  101                             ["138, 1",dose[:i d]],
  102                             ["386, 1",dose[:a ll]],
  103                             ["384, 1",dose[:a mount]],
  104                             ["137, 1",route],                                                                                         #route
  105                             ["170, 1",schedul e],                                                                            #schedul e
  106                             ["7,1" ,"9"],                                                                                    #urgency
  107                             ["15,1 ","ORDIALO G(\"WP\",1 5,1)"],
  108                             ["387, 1",supply] ,                                                                                       #supply
  109                             ["149, 1",quantit y],                                                                            #quantit y
  110                             ["150, 1",refills ],                                                                                      #refills
  111                             ["151, 1",""],
  112                             ["148, 1","W"],                                                                                  #pickup  location
  113                             ["1358 ,1","ORDIA LOG(\"WP\" ,1358,1)"] ,
  114                             ["\"WP \",1358,1, 1,0",""],
  115                             ["385, 1","ORDIAL OG(\"WP\", 385,1)"],
  116                             ["\"WP \",385,1,1 ,0",""],                  #sig?
  117                             ["\"OR CHECK\""," 2"],
  118                             ["\"OR CHECK\",\" NEW\",\"2\ ",\"1\""," 99^2^Remot e Order Ch ecking not  available  - checks  done on lo cal data o nly"],
  119                             ["\"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: "],
  120                             ["\"OR TS\"","0"]
  121                    ],
  122                    "",
  123                    "",
  124                    "",
  125                    "0"
  126           ]
  127  
  128           re sp = @brok er.execute (vrpc)
  129           or der_id = r esp.value. first.spli t('^').fir st.split(' ~').last
  130  
  131           vr pc = Vista RPC4r::Vis taRPC.new( "ORWDX SEN D", VistaR PC4r::RPCR esponse::A RRAY)
  132  
  133           vr pc.params  = [
  134                    pati ent_id,
  135                    "991 ",
  136                    loca tion,
  137                    "",
  138                    [
  139                             ["1"," #{order_id }^1^1^E"]
  140                    ],
  141           ]
  142  
  143           re sp = @brok er.execute (vrpc)
  144   end
  145  
  146   CSV.foreac h("./alpha _load.csv" ) do |row|
  147     unless r ow[0] == " Patient Na me"
  148           pa t = row[0] .split(" -  ")[1]
  149  
  150           me d_dose = r ow[1].spli t(" - ")
  151           me d_name = m ed_dose[0]
  152           am ount = med _dose[1]
  153  
  154           sc hedule = r ow[2]
  155  
  156           ma tching_dos es = all_d ose.select {|d| d[:me d] == med_ name && d[ :amount] = = amount}
  157  
  158           su pply = row [3]
  159           qu antity = r ow[4]
  160           re fills = ro w[5]
  161           lo cation = r ow[6].spli t(" - ")[1 ]
  162           ro ute = row[ 7].split("  - ")[1]
  163  
  164           sa ve_med(pat , matching _doses.fir st, schedu le, supply , quantity , refills,  location,  route)
  165     end
  166   end
  167  
  168   @broker.cl ose