959. EPMO Open Source Coordination Office Redaction File Detail Report

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

959.1 Files compared

# Location File Last Modified
1 ehmp.zip\ehmp\ehmp\product\tests\acceptance-tests\features-arch\old_ehmp_features_ruby\steps sync_steps.rb Tue Dec 15 14:05:18 2015 UTC
2 ehmp.zip\ehmp\ehmp\product\tests\acceptance-tests\features-arch\old_ehmp_features_ruby\steps sync_steps.rb Mon Oct 2 20:09:46 2017 UTC

959.2 Comparison summary

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

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

959.4 Active regular expressions

No regular expressions were active.

959.5 Comparison detail

  1   require "T estSupport .rb"
  2  
  3   Given(/^qu ery$/) do
  4     cache =  PatientCac he.new
  5     @respons e = cache. query_vpr_ patients
  6     expect(@ response.c ode).to eq (200), "re sponse cod e was #{@r esponse.co de}: respo nse body # {@response .body}"
  7     expect(c ache.patie nt_count). to eq(3)
  8     expect(c ache.conta ins_patien t? "10102" ).to be_tr ue
  9     expect(c ache.conta ins_patien t? "bad pi d").to be_ false
  10   end
  11  
  12   Given(/^a  patient wi th pid "(. *?)" and i cn "(.*?)"  has not b een synced $/) do |pi d, icn|
  13     base_url  = Default Login.fhir _url
  14     path = " #{base_url }/admin/sy nc/#{pid}"
  15     
  16     @respons e = nil
  17     begin
  18       @respo nse = HTTP artyWithBa sicAuth.de lete_with_ authorizat ion(path)
  19     rescue T imeout::Er ror
  20       p "Syn c timed ou t" 
  21     end
  22     
  23     if @resp onse.nil?
  24       respon se_code =  500
  25       respon se_body =  "Sync time d out"
  26     else
  27       respon se_code =  @response. code
  28       respon se_body =  @response. body
  29     end
  30     
  31     fail "Ex pected res ponse code  200, rece ived #{res ponse_code }: respons e body #{r esponse_bo dy}" unles s response _code == 2 00
  32   end
  33  
  34   Given(/^a  patient wi th pid "(. *?)" has n ot been sy nced in FH IR format$ /) do |pid |
  35     base_url  = Default Login.fhir _url
  36     p path =  "#{base_u rl}/admin/ sync/#{pid }"
  37     @respons e = HTTPar tyWithBasi cAuth.dele te_with_au thorizatio n(path)
  38     expect(@ response.c ode).to eq (200), "re sponse cod e was #{@r esponse.co de}: respo nse body # {@response .body}"
  39  
  40     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(p ath)
  41     expect(@ response.c ode).to eq (404), "re sponse cod e was #{@r esponse.co de}: respo nse body # {@response .body}"
  42   end
  43  
  44   Given(/^a  patient wi th pid "(. *?)" has n ot been sy nced in FH IR format  on "(.*?)" $/) do |pi d, ve|
  45     if ve.up case == "V E2"
  46       base_u rl = Defau ltLogin.ve 2_fhir_url
  47     else
  48       base_u rl = Defau ltLogin.fh ir_url
  49     end
  50  
  51     p path =  "#{base_u rl}/admin/ sync/#{pid }"
  52     @respons e = HTTPar tyWithBasi cAuth.dele te_with_au thorizatio n(path)
  53     expect(@ response.c ode).to eq (200), "re sponse cod e was #{@r esponse.co de}: respo nse body # {@response .body}"
  54  
  55     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(p ath)
  56     expect(@ response.c ode).to eq (404), "re sponse cod e was #{@r esponse.co de}: respo nse body # {@response .body}"
  57   end
  58  
  59   When(/^the  client re quests syn ced throug h FHIR for  patient w ith pid "( .*?)" on " (.*?)"$/)  do |pid, v e|
  60     if ve.up case == "V E2"
  61       base_u rl = Defau ltLogin.ve 2_fhir_url
  62       #wait_ until_oper ational_da ta_is_sync ed_ve2
  63       wait_u ntil_opera tional_dat a_is_synce d(DefaultL ogin.ve2_f hir_url)
  64     else
  65       base_u rl = Defau ltLogin.fh ir_url
  66       wait_u ntil_opera tional_dat a_is_synce d(DefaultL ogin.fhir_ url)
  67     end
  68  
  69     p path =  "#{base_u rl}/admin/ sync/#{pid }"
  70     #p path
  71     begin
  72       @respo nse = HTTP artyWithBa sicAuth.pu t_with_aut horization (path)
  73       expect (@response .code).to  eq(201), " response c ode was #{ @response. code}: res ponse body  #{@respon se.body}"
  74     rescue T imeout::Er ror
  75       p "Syn c timed ou t"
  76     end
  77     #@respon se = HTTPa rtyWithBas icAuth.get _with_auth orization( path)
  78     #expect( @response. code).to e q(200)
  79     time_out  = 60
  80     wait_tim e = 2
  81     current_ time = Tim e.new
  82     wait_unt il = curre nt_time +  time_out
  83     #(0..Int eger(time_ out)/wait_ time).each  do
  84     while Ti me.new <=  wait_until
  85       @respo nse = HTTP artyWithBa sicAuth.ge t_with_aut horization (path)
  86       if @re sponse.cod e != 200
  87         p "n ot sync ye t, wait #{ wait_time}  seconds"
  88         slee p wait_tim e
  89       else
  90         brea k
  91       end #  if
  92     end # fo r
  93     expect(@ response.c ode).to eq (200), "re sponse cod e was #{@r esponse.co de}: respo nse body # {@response .body}"
  94   end
  95  
  96   Then(/^the  patient w ith pid "( .*?)" has  no data on  "(.*?)"$/ ) do |pid,  ve|
  97     if ve.up case == "V E2"
  98       base_u rl = Defau ltLogin.ve 2_fhir_url
  99     else
  100       base_u rl = Defau ltLogin.fh ir_url
  101     end
  102     path = " #{base_url }/admin/sy nc/#{pid}"
  103     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(p ath)
  104     expect(@ response.c ode).to eq (404), "re sponse cod e was #{@r esponse.co de}: respo nse body # {@response .body}"
  105   end
  106  
  107   When(/^a c lient requ ests an as ynchronous  load for  patient wi th icn "(. *?)"$/) do  |icn|
  108     base_url  = Default Login.hmp_ url
  109     path = " #{base_url }/sync/loa dAsync?icn =#{icn}"
  110     @respons e = HTTPar tyWithAuth orization. post_with_ authorizat ion(path)
  111     expect(@ response.c ode).to eq (200), "re sponse cod e was #{@r esponse.co de}: respo nse body # {@response .body}"
  112   end
  113  
  114   Then(/^a N ot Found r esponse is  returned$ /) do
  115     expect(@ response.c ode).to eq (404), "re sponse cod e was #{@r esponse.co de}: respo nse body # {@response .body}"
  116   end
  117  
  118   Then(/^the  patient w ith pid "( .*?)" is s ynced with in (\d+) s econds$/)  do |pid, t ime_out|
  119     cache =  PatientCac he.new
  120     wait_tim e = 1
  121     is_synce d = false
  122     current_ time = Tim e.new
  123     wait_unt il = curre nt_time +  time_out.t o_i
  124     #(0..Int eger(time_ out)/wait_ time).each  do
  125     while Ti me.new <=  wait_until
  126       @respo nse = cach e.query_vp r_patients
  127       if cac he.sync_co mplete_pid ? pid
  128         is_s ynced = tr ue
  129         brea k
  130       else
  131         #p " not synced  yet, wait  #{wait_ti me} second s"
  132         slee p wait_tim e
  133       end #  if
  134     end # fo r
  135     expect(i s_synced). to be_true
  136   end
  137  
  138   def wait_u ntil_opera tional_dat a_is_synce d(base_fhi r_url)
  139     path = " #{base_fhi r_url}/adm in/sync/op erational"
  140  
  141     time_out  = 600
  142     wait_tim e = 5
  143     @is_sync ed = false
  144     current_ time = Tim e.new
  145     wait_unt il = curre nt_time +  time_out
  146     #(0..Int eger(time_ out)/wait_ time).each  do
  147     while Ti me.new <=  wait_until
  148       begin
  149         # p  path
  150         @res ponse = HT TPartyWith BasicAuth. get_with_a uthorizati on(path)
  151         json  = JSON.pa rse(@respo nse.body)
  152         sync _complete  = json["da ta"]["item s"][0]["sy ncOperatio nalComplet e"]
  153         if s ync_comple te
  154           p  "operation al data ha s been syn ced"
  155           @i s_synced =  true
  156           br eak
  157         else
  158           p  "operation al data no t synced y et, wait # {wait_time } seconds"
  159           p  json
  160           sl eep wait_t ime
  161         end  # if
  162       rescue  Exception  => e
  163         p "c all to che ck if oper ational da ta has bee n synced c aused an e xception:  #{e}"
  164         p @r esponse.bo dy unless  @response. nil?
  165         slee p wait_tim e
  166       end #  rescue
  167     end # fo r
  168   end
  169  
  170   Given(/^a  patient wi th pid "(. *?)" has b een synced  through A dmin API$/ ) do | pid  |
  171     #Check t hat the op erational
  172     # unless  TestSuppo rt.operati onal_data_ run?
  173     #   wait _until_ope rational_d ata_is_syn ced(Defaul tLogin.fhi r_url)
  174     #   @@op erational_ data_run =  true
  175     # end
  176     
  177     base_url  = Default Login.hmp_ url
  178     path = " #{base_url }/sync/loa d?pid=#{pi d}"
  179     p path
  180  
  181     @respons e = nil
  182     default_ timeout =  260
  183     response _code = 50 2
  184     max_run_ index = 3
  185     run_inde x = 0
  186  
  187     while re sponse_cod e == 502 & & run_inde x < max_ru n_index
  188       start_ time = Tim e.new
  189       run_in dex += 1
  190       begin
  191         @res ponse = HT TPartyWith BasicAuth. put_with_a uthorizati on(path, d efault_tim eout)
  192       rescue  Timeout:: Error
  193         p "S ync timed  out"
  194       end
  195       p "Wai ted #{Time .new - sta rt_time} s ecs"
  196       
  197       if @re sponse.nil ?
  198         resp onse_code  = 500
  199         resp onse_body  = "Sync ti med out"
  200       else
  201         resp onse_code  = @respons e.code
  202         resp onse_body  = @respons e.body
  203       end
  204     end 
  205     fail "Ex pected res ponse code  201, rece ived #{res ponse_code }: respons e body #{r esponse_bo dy}" unles s response _code == 2 01
  206   end
  207     
  208   Given(/^ol d a patien t with pid  "(.*?)" h as been sy nced throu gh Admin A PI$/) do |  pid |
  209     #Check t hat the op erational
  210  
  211     wait_unt il_operati onal_data_ is_synced( DefaultLog in.fhir_ur l)
  212  
  213     base_url  = Default Login.fhir _url
  214     path = " #{base_url }/admin/sy nc/#{pid}"
  215     p path
  216     
  217     begin
  218       @respo nse = HTTP artyWithBa sicAuth.pu t_with_aut horization (path)
  219       p "Exp ected resp onse code  201, recei ved #{@res ponse.code }" unless  @response. code == 20 1
  220       #expec t(@respons e.code).to  eq(201),  "response  code was # {@response .code}: re sponse bod y #{@respo nse.body}"
  221     rescue T imeout::Er ror
  222       p "Syn c timed ou t"
  223     end
  224     
  225     # if @re sponse.cod e == 500 | | @respons e.code ==  503
  226       # fail  "Expected  response  code 201,  received # {@response .code}: re sponse bod y #{@respo nse.body}"
  227     # else
  228     time_out  = 180
  229     wait_tim e = 2
  230  
  231     current_ time = Tim e.new
  232     wait_unt il = curre nt_time +  time_out
  233     #(0..Int eger(time_ out)/wait_ time).each  do
  234     while Ti me.new <=  wait_until
  235       @respo nse = HTTP artyWithBa sicAuth.ge t_with_aut horization (path)
  236       if @re sponse.cod e != 200
  237         p "n ot sync ye t, wait #{ wait_time}  seconds"
  238         slee p wait_tim e
  239       else
  240         brea k
  241       end #  if
  242     end # fo r
  243     p "Waite d #{Time.n ew - curre nt_time} s ecs"
  244     expect(@ response.c ode).to eq (200), "re sponse cod e was #{@r esponse.co de}: respo nse body # {@response .body}"
  245     # end
  246   end
  247  
  248   # renamed  this funct ion to Giv en(/^a pat ient with  pid "(.*?) " has been  synced th rough Admi n API$/) d o | pid |
  249   #Given(/^a  patient w ith pid "( .*?)" has  been synce d through  FHIR$/) do  | pid |
  250   #  #Check  that the o perational
  251   #
  252   #  wait_un til_operat ional_data _is_synced (DefaultLo gin.fhir_u rl)
  253   #
  254   #  base_ur l = Defaul tLogin.fhi r_url
  255   #  path =  "#{base_ur l}/admin/s ync/#{pid} "
  256   #  p path
  257   #  begin
  258   #    @resp onse = HTT PartyWithB asicAuth.p ut_with_au thorizatio n(path)
  259   #    p "Ex pected res ponse code  201, rece ived #{@re sponse.cod e}" unless  @response .code == 2 01
  260   #    #expe ct(@respon se.code).t o eq(201),  "response  code was  #{@respons e.code}: r esponse bo dy #{@resp onse.body} "
  261   #  rescue  Timeout::E rror
  262   #    p "Sy nc timed o ut"
  263   #  end
  264   #  #@respo nse = HTTP artyWithBa sicAuth.ge t_with_aut horization (path)
  265   #  #expect (@response .code).to  eq(200)
  266   #  time_ou t = 180
  267   #  wait_ti me = 2
  268   #  (0..Int eger(time_ out)/wait_ time).each  do
  269   #    @resp onse = HTT PartyWithB asicAuth.g et_with_au thorizatio n(path)
  270   #    if @r esponse.co de != 200
  271   #      p " not sync y et, wait # {wait_time } seconds"
  272   #      sle ep wait_ti me
  273   #    else
  274   #      bre ak
  275   #    end #  if
  276   #  end # f or
  277   #  expect( @response. code).to e q(200), "r esponse co de was #{@ response.c ode}: resp onse body  #{@respons e.body}"
  278   #end
  279  
  280   Given(/^a  patient wi th pid "(. *?)" and i cn "(.*?)"  has been  synced$/)  do |pid, i cn|
  281     base_url  = Default Login.fhir _url
  282     path = " #{base_url }/admin/sy nc/#{pid}"
  283     #p path
  284     @respons e = HTTPar tyWithBasi cAuth.put_ with_autho rization(p ath)
  285     expect(@ response.c ode).to eq (201), "re sponse cod e was #{@r esponse.co de}: respo nse body # {@response .body}"
  286  
  287     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(p ath)
  288     expect(@ response.c ode).to eq (200), "re sponse cod e was #{@r esponse.co de}: respo nse body # {@response .body}"
  289   end
  290  
  291   When(/^a c lient requ est patien t with pid  "(.*?)" i s cleared  from the c ache$/) do  |pid|
  292     base_url  = Default Login.hmp_ url
  293     path = " #{base_url }/sync/cle arPatient? pid=#{pid} "
  294     @respons e = HTTPar tyWithAuth orization. post_with_ authorizat ion(path)
  295     expect(@ response.c ode).to eq (200), "re sponse cod e was #{@r esponse.co de}: respo nse body # {@response .body}"
  296  
  297   end
  298  
  299   Then(/^the  patient w ith pid "( .*?)" is c leared fro m the cach e within ( \d+) secon ds$/) do | pid, time_ out|
  300     cache =  PatientCac he.new
  301  
  302     wait_tim e = 2
  303     is_clear ed = false
  304     current_ time = Tim e.new
  305     wait_unt il = curre nt_time +  time_out.t o_i
  306     #(0..Int eger(time_ out)/wait_ time).each  do
  307     while Ti me.new <=  wait_until
  308       @respo nse = cach e.query_vp r_patients
  309       if cac he.contain s_patient_ pid? pid
  310         p "n ot cleared  yet, wait  #{wait_ti me} second s"
  311         slee p wait_tim e
  312       else
  313         is_c leared = t rue
  314         brea k
  315       end #  if
  316     end # fo r
  317     expect(i s_cleared) .to be_tru e
  318   end
  319  
  320   When(/^a c lient requ ests patie nt informa tion for p atient wit h pid "(.* ?)" and ic n "(.*?)"$ /) do |pid , icn|
  321     base_url  = Default Login.hmp_ url
  322     path = " #{base_url }/context/ patient?pi d=#{pid}"
  323     @respons e = HTTPar tyWithAuth orization. post_with_ authorizat ion(path)
  324     unless @ response.c ode == 200
  325       p @res ponse.body
  326     end
  327     expect(@ response.c ode).to eq (200), "re sponse cod e was #{@r esponse.co de}: respo nse body # {@response .body}"
  328  
  329       # https:// IP             /vpr/10108 /detail/cw adf?_dc=13 9808678369 1
  330     path = " #{base_url }/vpr/#{pi d}/detail/ cwadf?_dc= 1398086783 691"
  331     @respons e = HTTPar tyWithAuth orization. get_with_a uthorizati on(path)
  332     expect(@ response.c ode).to eq (200), "re sponse cod e was #{@r esponse.co de}: respo nse body # {@response .body}"
  333   end
  334  
  335   When(/^a c lient requ ests sync  status for  patient w ith icn "( .*?)"$/) d o |icn|
  336     base_url  = Default Login.jds_ url
  337     path = " #{base_url }/data/urn :va:syncst atus:#{icn }"
  338     @respons e = HTTPar tyWithAuth orization. get_with_a uthorizati on(path)
  339     expect(@ response.c ode).to eq (200), "re sponse cod e was #{@r esponse.co de}: respo nse body # {@response .body}"
  340   end
  341  
  342   When(/^a c lient requ ests sync  status for  patient w ith dfn "( .*?)"$/) d o |dfn|
  343     base_url  = Default Login.jds_ url
  344     dfn.gsub !(';', ':' )
  345     path = " #{base_url }/data/urn :va:syncst atus:#{dfn }"
  346     @respons e = HTTPar tyWithAuth orization. get_with_a uthorizati on(path)
  347     expect(@ response.c ode).to eq (200), "re sponse cod e was #{@r esponse.co de}: respo nse body # {@response .body}"
  348   end
  349  
  350   Then(/^an  error resp onse "(.*? )" is retu rned after  (\d+) sec onds$/) do  |arg1, ar g2|
  351     pending  # express  the regexp  above wit h the code  you wish  you had
  352   end
  353  
  354   def wait_u ntil_patie nt_has_bee n_synced(p id)
  355     time_out  = 120
  356     wait_tim e = 2
  357     is_clear ed = false
  358     current_ time = Tim e.new
  359     wait_unt il = curre nt_time +  time_out
  360     #(0..Int eger(time_ out)/wait_ time).each  do
  361     while Ti me.new <=  wait_until
  362       is_syn ced = chec k_patient_ has_been_s ynced(pid) [0]
  363       if is_ synced
  364         p "o perational  data has  been synce d"
  365         is_s ynced = tr ue
  366         brea k
  367       else
  368         p "o perational  data not  synced yet , wait #{w ait_time}  seconds"
  369         # p  json
  370         slee p wait_tim e
  371       end
  372     end
  373   end
  374  
  375   def check_ patient_ha s_been_syn ced(pid)
  376     base_url  = Default Login.fhir _url
  377     path = " #{base_url }/admin/sy nc/#{pid}"
  378     can_be_s ync = true
  379     # p path
  380     begin
  381       @respo nse = HTTP artyWithBa sicAuth.ge t_with_aut horization (path)
  382       if @re sponse.cod e == 404
  383         is_s ynced = fa lse
  384       elsif  @response. code == 50 3
  385         p 'R equest to  /admin/syn c/#{pid} b efore oper ational sy nc is comp lete.'
  386         is_s ynced = fa lse
  387         can_ be_sync =  false
  388       elsif  @response. code == 20 0
  389         is_s ynced = ch eck_uncomp eleted_syn c
  390       else
  391           p 'This se ems to be  like an er ror connec ting to ht tps:// IP        /admin/syn c/#{pid}'
  392         is_s ynced = fa lse
  393         can_ be_sync =  false
  394       end
  395     rescue T imeout::Er ror
  396       p "Syn c timed ou t"
  397     end
  398     return i s_synced,  can_be_syn c
  399   end
  400  
  401   def check_ uncompelet ed_sync
  402     json = J SON.parse( @response. body)
  403     sync_com plete = js on["data"] ["items"][ 0]["syncSt atusByVist aSystemId" ]["9E7A"][ "syncCompl ete"]
  404     if sync_ complete
  405       p "ope rational d ata has be en synced"
  406       is_syn ced = true
  407     else
  408       p "ope rational d ata not sy nced yet."
  409       is_syn ced = fals e
  410     end
  411     return i s_synced
  412   end