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

1003.1 Files compared

# Location File Last Modified
1 ehmp.zip\ehmp\ehmp\product\tests\performance-tests\client-tests\features\steps perf.ehmp_REST.rb Tue Dec 15 14:05:18 2015 UTC
2 ehmp.zip\ehmp\ehmp\product\tests\performance-tests\client-tests\features\steps perf.ehmp_REST.rb Tue Oct 3 14:35:58 2017 UTC

1003.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 49 2572
Changed 48 100
Inserted 0 0
Removed 0 0

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

1003.4 Active regular expressions

No regular expressions were active.

1003.5 Comparison detail

  1   require 'h ttparty'
  2   require 'r spec/expec tations'
  3   require 'a gilex-load gen/TestRu nnerUtil.r b'
  4   require 'j son'
  5  
  6   class HTTP artyWithAu thorizatio n
  7     include  HTTParty
  8  
  9       # Authoriz ation head er is Base 64 encodin g of " R E D A CTED ;500: REDACT ; REDACTED "
  10     @@header  = { 'Auth orization'  => 'Basic  OUU3QTs1M DA6cHUxMjM 0O3B1MTIzN CEh' }
  11     @@time_s tart = Tim e.new
  12     @@time_d one = Time .new
  13     @@defaul t_timeout  = 300
  14      
  15     def self .time_elap sed_last_c all
  16       return  @@time_do ne - @@tim e_start
  17     end
  18  
  19     def self .post_with _authoriza tion(path)
  20       @@time _start = T ime.new
  21       direct ory = post (path, { : verify =>  false, :he aders => @ @header, : timeout =>  @@default _timeout } )
  22       @@time _done = Ti me.new
  23       return  directory
  24     end
  25  
  26     def self .get_with_ authorizat ion(path)
  27       @@time _start = T ime.new
  28       direct ory = get( path, { :v erify => f alse, :hea ders => @@ header, :t imeout =>  @@default_ timeout })
  29       @@time _done = Ti me.new
  30       return  directory
  31     end
  32   end
  33  
  34   class SETE NV
  35       @@hmp_url  = ENV.keys .include?( 'EHMP_IP')  ? 'https: //' + ENV[ 'EHMP_IP']  + ":8443" : "https:/ / IP             "
  36       @@fhir_url  = ENV.key s.include? ('VE_API_I P') ? 'htt ps://' + E NV['VE_API _IP'] : "h ttps:// IP        "
  37       @@jds_url  = ENV.keys .include?( 'JDS_IP')  ? 'http:// ' + ENV['J DS_IP'] +  ": PORT " : "http: // IP                "
  38     @@run_id  = ENV.key s.include? ('ID') ? ' ENV[ID] =  ' + ENV['I D'] : "[IN FO] There  is no ENV[ ID] to pri nt"
  39       @@perf_url  = ENV.key s.include? ('Perf-Mon itor_IP')  ? 'http:// ' + ENV['P erf-Monito r_IP'] + " : PORT " : "http: // IP                /ehmp/tran sactions"
  40  
  41     def self .fhir_url
  42       return  @@fhir_ur l
  43     end
  44     
  45     def self .hmp_url
  46       return  @@hmp_url
  47     end
  48  
  49     def self .jds_url
  50       return  @@jds_url
  51     end
  52  
  53     def self .run_id
  54       return  @@run_id
  55     end
  56  
  57     def self .perf_url
  58       return  @perf_url
  59     end  
  60   end  
  61  
  62   def wait_u ntil_opera tional_dat a_is_synce d(base_fhi r_url)
  63     #base_fh ir_url = S ETENV.fhir _url
  64     path = " #{base_fhi r_url}/adm in/sync/op erational"
  65  
  66     time_out  = 600
  67     wait_tim e = 5
  68     is_synce d = false
  69     current_ time = Tim e.new
  70     wait_unt il = curre nt_time +  time_out
  71     #(0..Int eger(time_ out)/wait_ time).each  do
  72     while Ti me.new <=  wait_until
  73  
  74       begin
  75         # p  path
  76         @res ponse = HT TPartyWith BasicAuth. get_with_a uthorizati on(path)
  77         json  = JSON.pa rse(@respo nse.body)
  78         sync _complete  = json["da ta"]["item s"][0]["sy ncOperatio nalComplet e"]
  79         if s ync_comple te
  80           p  "operation al data ha s been syn ced"
  81           is _synced =  true
  82           br eak
  83         else
  84           p  "operation al data no t synced y et, wait # {wait_time } seconds"
  85           p  json
  86           sl eep wait_t ime
  87         end  # if
  88       rescue  Exception  => e
  89         p "c all to che ck if oper ational da ta has bee n synced c aused an e xception:  #{e}"
  90         p @r esponse.bo dy
  91         slee p wait_tim e
  92       end #  rescue
  93     end # fo r
  94   end
  95  
  96   class HTTP artyWithBa sicAuth
  97     include  HTTParty
  98       @@auth = {  :username  => " R E D A CTED ", :passwo rd => " REDACTED " }
  99     @@time_s tart = Tim e.new
  100     @@time_d one = Time .new
  101  
  102     @@defaul t_time_out  = 300
  103     def self .time_elap sed_last_c all
  104       return  @@time_do ne - @@tim e_start
  105     end
  106     
  107     def self .check_hos t(path)
  108       if pat h.include?  "C877;"
  109           @@auth = {  :username  => " REDA C TED ", :passwo rd => " REDACTED " }
  110       end
  111     end
  112  
  113     def self .post_with _authoriza tion(path)
  114       # "Aut horization ", "Basic  QjM2Mjs1MD A6cHUxMjM0 O3B1MTIzNC Eh"
  115       # dire ctory = po st(path, {  :verify = > false, : headers =>  @@header,   :basic_a uth => @@a uth })
  116       check_ host(path)
  117       @@time _start = T ime.new
  118       direct ory = post (path, { : verify =>  false, :ba sic_auth = > @@auth,  :timeout = > @@defaul t_time_out  })
  119       @@time _done = Ti me.new
  120       return  directory
  121     end
  122  
  123     def self .get_with_ authorizat ion(path)
  124       #  @re sponse = H TTParty.ge t(@dataHre f, { :veri fy => fals e, :header s => { 'Ac cept' => ' applicatio n/json' },  :basic_au th => auth  })
  125  
  126       # dire ctory = ge t(path, {  :verify =>  false, :h eaders =>  @@header,   :basic_au th => @@au th})
  127       check_ host(path)
  128       @@time _start = T ime.new
  129       direct ory = get( path, { :v erify => f alse, :bas ic_auth =>  @@auth, : timeout =>  @@default _time_out  })
  130       @@time _done = Ti me.new
  131       return  directory
  132     end
  133  
  134     def self .get_with_ authorizat ion_for_us er(path, u ser, pass)
  135       @@time _start = T ime.new
  136       auth =  { :userna me => user , :passwor d => pass  }
  137       direct ory = get( path, { :v erify => f alse, :bas ic_auth =>  auth, :ti meout => @ @default_t ime_out })
  138       @@time _done = Ti me.new
  139       return  directory
  140     end
  141  
  142     def self .put_with_ authorizat ion(path)
  143       check_ host(path)
  144       @@time _start = T ime.new
  145       direct ory = put( path, { :v erify => f alse, :bas ic_auth =>  @@auth, : timeout =>  @@default _time_out  })
  146       @@time _done = Ti me.new
  147       return  directory
  148     end
  149  
  150     def self .delete_wi th_authori zation(pat h)
  151       check_ host(path)
  152       @@time _start = T ime.new
  153       direct ory = dele te(path, {  :verify = > false, : basic_auth  => @@auth ,  :timeou t => @@def ault_time_ out })
  154       @@time _done = Ti me.new
  155       return  directory
  156     end
  157   end
  158  
  159   class Quer yVPR
  160     def init ialize(dat atype, pid , auto_ack nowledge =  "true")
  161       @path  = String.n ew(SETENV. fhir_url)
  162       @path. concat("/v pr/")
  163       @path. concat(pid )
  164       @path. concat("/" )
  165       @path. concat(dat atype)
  166       @numbe r_paramete rs = 0
  167       add_ac knowledge( auto_ackno wledge)
  168     end
  169     
  170     def add_ parameter( param, val ue)
  171       if @nu mber_param eters == 0
  172         @pat h.concat(" ?")
  173       else
  174         @pat h.concat(" &")
  175       end
  176       @numbe r_paramete rs = @numb er_paramet ers + 1
  177       @path. concat(par am)
  178       @path. concat("=" )
  179       @path. concat(val ue)
  180     end
  181  
  182     def add_ acknowledg e(ack)
  183       add_pa rameter("_ ack", ack)
  184     end
  185     
  186     def path
  187       return  @path
  188     end
  189   end # clas s
  190  
  191   class Quer ySearch
  192     def init ialize(dat atype, las t_name, au to_acknowl edge = "tr ue")
  193    
  194       @path  = String.n ew(SETENV. fhir_url)
  195       @path. concat("/v pr/search/ Patient/")
  196       @numbe r_paramete rs = 0
  197       add_pa rameter(da tatype, la st_name)
  198       add_ac knowledge( auto_ackno wledge)
  199     end
  200     
  201     def add_ parameter( param, val ue)
  202       if @nu mber_param eters == 0
  203         @pat h.concat(" ?")
  204       else
  205         @pat h.concat(" &")
  206       end
  207       @numbe r_paramete rs = @numb er_paramet ers + 1
  208       @path. concat(par am)
  209       @path. concat("=" )
  210       @path. concat(val ue)
  211     end
  212  
  213     def add_ acknowledg e(ack)
  214       add_pa rameter("_ ack", ack)
  215     end
  216     
  217     def path
  218       return  @path
  219     end
  220   end # clas s
  221  
  222   class Quer yFhir
  223     def init ialize(dat atype)
  224       @path  = String.n ew(SETENV. fhir_url)
  225       @path. concat("/f hir/")
  226       @path. concat(dat atype)
  227       @numbe r_paramete rs = 0
  228     end
  229  
  230     def add_ parameter( param, val ue)
  231       if @nu mber_param eters == 0
  232         @pat h.concat(" ?")
  233       else
  234         @pat h.concat(" &")
  235       end
  236       @numbe r_paramete rs = @numb er_paramet ers + 1
  237       @path. concat(par am)
  238       @path. concat("=" )
  239       @path. concat(val ue)
  240     end
  241  
  242     def add_ acknowledg e(ack)
  243       add_pa rameter("_ ack", ack)
  244     end
  245  
  246     def add_ format(req uested_for mat)
  247       add_pa rameter("_ format", r equested_f ormat)
  248     end
  249  
  250     def path
  251       return  @path
  252     end
  253   end
  254  
  255   class Quer yPath
  256     def init ialize(sta rt_path)
  257       @path  = String.n ew(SETENV. hmp_url)
  258       @path. concat(sta rt_path)
  259       @path. concat("?_ dc=1396988 436165")
  260     end
  261  
  262     def add_ pid(pid)
  263       @path. concat("&p id=#{pid}" )
  264     end
  265  
  266     def add_ pagination (row_count )
  267       @path. concat("&p age=1&row. start=0&ro w.count=#{ row_count} ")
  268     end
  269  
  270     def add_ start_rang e(start_ra nge)
  271       @path. concat("&r ange.start HL7=#{star t_range}")
  272     end
  273  
  274     def add_ arg(name,  val)
  275       @path. concat("&# {name}=#{v al}")
  276     end
  277  
  278     def add_ end_range
  279       end_ra nge = Time .now.strft ime("%Y%m% d")
  280       @path. concat("&r ange.endHL 7=#{end_ra nge}")
  281     end
  282  
  283     def path
  284       return  @path
  285     end
  286   end
  287  
  288   def query_ with_path( path, pid)
  289     query_pa th = Query Path.new(p ath)
  290     query_pa th.add_pid  pid
  291     query_pa th.add_pag ination 10 00
  292     query_pa th.add_sta rt_range " 19930416"
  293     query_pa th.add_end _range
  294     p query_ path.path
  295     @respons e = HTTPar tyWithAuth orization. get_with_a uthorizati on(query_p ath.path)
  296   end # quer y_with_pat h
  297  
  298   def query_ with_path_ no_range(p ath, pid)
  299     query_pa th = Query Path.new(p ath)
  300     query_pa th.add_pid  pid
  301     query_pa th.add_pag ination 10 00
  302     p query_ path.path
  303     @respons e = HTTPar tyWithAuth orization. get_with_a uthorizati on(query_p ath.path)
  304   end
  305  
  306   def get_do d_document (edipi, ev entId, fil e_extensio n)
  307     path = " /documents /dod/#{edi pi}/#{even tId}.#{fil e_extensio n}"
  308     query_pa th = Query Path.new(p ath)
  309     p query_ path.path
  310     @respons e = HTTPar tyWithAuth orization. get_with_a uthorizati on(query_p ath.path)
  311   end
  312  
  313   Before do  |scenario|
  314     # Featur e name
  315     case sce nario
  316       when C ucumber::A st::Scenar io
  317         @fea ture_name  = scenario .feature.n ame
  318       when C ucumber::A st::Outlin eTable::Ex ampleRow
  319         @fea ture_name  = scenario .scenario_ outline.fe ature.name
  320     end
  321  
  322      # Scena rio name
  323     case sce nario
  324       when C ucumber::A st::Scenar io
  325         @sce nario_name  = scenari o.name
  326       when C ucumber::A st::Outlin eTable::Ex ampleRow
  327         @sce nario_name  = scenari o.scenario _outline.n ame
  328      end
  329  
  330     # Tags ( as an arra y)
  331     @scenari o_tags = s cenario.so urce_tag_n ames
  332   end
  333  
  334   Given(/^a  patient wi th "(.*?)"  in multip le VistAs$ /) do |arg 1|
  335     #there i s no way t o verify t his step n ow.
  336   end
  337  
  338   Then(/^a s uccessful  response i s returned $/) do
  339     expect(@ response.c ode).to eq (200)
  340     #p 'http  response  code = ' +  (@respons e.code).to _s 
  341   end
  342  
  343   Then (/^th e result i s validate d$/) do 
  344     response  = JSON.pa rse(@respo nse.body)
  345     expect(r esponse).t o be_true
  346     # p resp onse
  347   end  
  348  
  349   Then (/^ba ckground$/ ) do 
  350     puts '[I NFO] PID =  ' + Proce ss.pid.to_
  351     puts '[I NFO] Curre ntTime: '  + (Time.no w.to_f).to _s
  352   end
  353  
  354   Then (/^pr int system  time$/) d
  355     puts '[I NFO] PID =  ' + Proce ss.pid.to_
  356     puts '[I NFO] Curre ntTime: '  + (Time.no w.to_f).to _s
  357     rid =  S ETENV.run_ id
  358     puts rid
  359   end
  360  
  361   ########## ########## ########## #### FHIR  api REST e ndpoints s teps
  362  
  363   Given(/^a  patient wi th pid "(. *?)" has b een synced  through A dmin API$/ ) do | pid  |
  364     wait_unt il_operati onal_data_ is_synced( SETENV.fhi r_url)
  365     base_url  = SETENV. fhir_url
  366     path = " #{base_url }/admin/sy nc/#{pid}"
  367     p path
  368     @start_t ime = Time .now.to_f
  369     begin
  370       @respo nse = HTTP artyWithBa sicAuth.pu t_with_aut horization (path)
  371       p "Exp ected resp onse code  201, recei ved #{@res ponse.code }" unless  @response. code == 20 1
  372       #expec t(@respons e.code).to  eq(201),  "response  code was # {@response .code}: re sponse bod y #{@respo nse.body}"
  373     rescue T imeout::Er ror
  374       p "Syn c timed ou t"
  375     end
  376     @end_tim e = Time.n ow.to_f
  377     @elap= ( @end_time  - @start_t ime)
  378     @result  = HTTParty .post(SETE NV.perf_ur l, 
  379       :body  => { :tran saction_na me => 'pat ient_sync'
  380                   :star t_time =>  @start_tim e,
  381                   :end_ time => @e nd_time,
  382                   :elap sed_time = >  @elap.r ound(3),
  383                   :tags  => @scena rio_tags,
  384                   :snar io_name =>  @scenario _name
  385                 }.to_js on,
  386       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  387  
  388     time_out  = 180
  389     wait_tim e = 2
  390  
  391     current_ time = Tim e.new
  392     wait_unt il = curre nt_time +  time_out
  393     #(0..Int eger(time_ out)/wait_ time).each  do
  394     while Ti me.new <=  wait_until
  395       @respo nse = HTTP artyWithBa sicAuth.ge t_with_aut horization (path)
  396       if @re sponse.cod e != 200
  397         p "n ot sync ye t, wait #{ wait_time}  seconds"
  398         slee p wait_tim e
  399       else
  400         brea k
  401       end #  if
  402     end # fo r
  403     p "Waite d #{Time.n ew - curre nt_time} s ecs"
  404     expect(@ response.c ode).to eq (200), "re sponse cod e was #{@r esponse.co de}: respo nse body # {@response .body}"
  405   end
  406  
  407   When(/^a c lient requ ests an as ynchronous  load for  patient wi th icn "(. *?)"$/) do  |icn|
  408     base_url  = SETENV. fhir_url
  409     path = " #{base_url }/sync/loa dAsync?icn =#{icn}"
  410     @start_t ime = Time .now.to_f    
  411     @respons e = HTTPar tyWithAuth orization. post_with_ authorizat ion(path)
  412     @end_tim e = Time.n ow.to_f
  413     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s  
  414     expect(@ response.c ode).to eq (200)
  415   end
  416  
  417   When(/^use r requests  allergies  in FHIR f ormat for  a patient,  "(.*?)"$/ ) do  |pid |
  418       #https:// IP        /fhir/Adve rseReactio n?subject. identifier = R E D A CTED ;100022&_f ormat=json &_ack=true
  419     temp = Q ueryFhir.n ew("Advers eReaction" )
  420     temp.add _parameter ("subject. identifier ", pid)
  421     temp.add _format("j son")
  422     temp.add _acknowled ge("true")
  423     p temp.p ath
  424     @start_t ime = Time .now.to_f   
  425     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(t emp.path)
  426     @end_tim e = Time.n ow.to_f
  427     @elap= ( @end_time  - @start_t ime)
  428     @result  = HTTParty .post(SETE NV.perf_ur l, 
  429       :body  => { :tran saction_na me => 'fhi r_adverser eaction', 
  430                   :star t_time =>  @start_tim e,
  431                   :end_ time => @e nd_time,
  432                   :elap sed_time = >  @elap.r ound(3),
  433                   :tags  => @scena rio_tags,
  434                   :snar io_name =>  @scenario _name
  435                 }.to_js on,
  436       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  437     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s
  438   end
  439  
  440   When(/^use r requests  labs in F HIR format  for a pat ient, "(.* ?)"$/) do   |pid|
  441       #https:// IP        /fhir/Diag nosticRepo rt?subject .identifie r=10105&_f ormat=json &_ack=true
  442     temp = Q ueryFhir.n ew("Diagno sticReport ")
  443     temp.add _parameter ("subject. identifier ", pid)
  444     temp.add _format("j son")
  445     temp.add _acknowled ge("true")
  446     p temp.p ath
  447     @start_t ime = Time .now.to_f
  448     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(t emp.path)
  449     @end_tim e = Time.n ow.to_f
  450     @elap= ( @end_time  - @start_t ime)
  451     @result  = HTTParty .post(SETE NV.perf_ur l, 
  452       :body  => { :tran saction_na me => 'fhi r_diagnost icReport',  
  453                   :star t_time =>  @start_tim e,
  454                   :end_ time => @e nd_time,
  455                   :elap sed_time = >  @elap.r ound(3),
  456                   :tags  => @scena rio_tags,
  457                   :snar io_name =>  @scenario _name
  458                 }.to_js on,
  459       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  460     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s  
  461   end
  462      
  463   Then(/^use r requests  vitals in  FHIR form at for a p atient, "( .*?)"$/) d o  |pid|
  464       #https:// IP        /fhir/Obse rvation?su bject.iden tifier=101 08&_format =json&_ack =true
  465     temp = Q ueryFhir.n ew("Observ ation")
  466     temp.add _parameter ("subject. identifier ", pid)
  467     temp.add _format("j son")
  468     temp.add _acknowled ge("true")
  469     p temp.p ath
  470     @start_t ime = Time .now.to_f   
  471     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(t emp.path)   
  472     @end_tim e = Time.n ow.to_f
  473     @elap= ( @end_time  - @start_t ime)
  474     @result  = HTTParty .post(SETE NV.perf_ur l, 
  475       :body  => { :tran saction_na me => 'fhi r_observat ion', 
  476                   :star t_time =>  @start_tim e,
  477                   :end_ time => @e nd_time,
  478                   :elap sed_time = >  @elap.r ound(3),
  479                   :tags  => @scena rio_tags,
  480                   :snar io_name =>  @scenario _name
  481                 }.to_js on,
  482       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  483     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s  
  484   end
  485  
  486   Then(/^use r requests  demograph ics in FHI R format f or a patie nt, "(.*?) "$/) do  | pid|
  487       #https:// IP        /fhir/pati ent?identi fier= R E D A CTED ;100022&_f ormat=json &_ack=true
  488     temp = Q ueryFhir.n ew("patien t")
  489     temp.add _parameter ("identifi er", pid)
  490     temp.add _format("j son")
  491     temp.add _acknowled ge("true")
  492     p temp.p ath
  493     @start_t ime = Time .now.to_f 
  494     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(t emp.path)
  495     @end_tim e = Time.n ow.to_f
  496     @elap= ( @end_time  - @start_t ime)
  497     @result  = HTTParty .post(SETE NV.perf_ur l, 
  498       :body  => { :tran saction_na me => 'fhi r_patient'
  499                   :star t_time =>  @start_tim e,
  500                   :end_ time => @e nd_time,
  501                   :elap sed_time = >  @elap.r ound(3),
  502                   :tags  => @scena rio_tags,
  503                   :snar io_name =>  @scenario _name
  504                 }.to_js on,
  505       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  506     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s
  507   end
  508  
  509   When(/^the  client re quests non -va medica tion resul ts for tha t patient  "(.*?)" in  FHIR form at$/) do | pid|  
  510       #https:// IP        /fhir/Medi cationStat ement?subj ect.identi fier= R E D A CTED ;100033&_f ormat=json &_ack=true
  511     temp = Q ueryFhir.n ew("Medica tionStatem ent")    
  512     temp.add _parameter ("subject. identifier ", pid)
  513     temp.add _format("j son")
  514     temp.add _acknowled ge("true")
  515     p temp.p ath
  516     @start_t ime = Time .now.to_f     
  517     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(t emp.path)   
  518     @end_tim e = Time.n ow.to_f
  519     @elap= ( @end_time  - @start_t ime)
  520     @result  = HTTParty .post(SETE NV.perf_ur l, 
  521       :body  => { :tran saction_na me => 'fhi r_Medicati onStatemen t', 
  522                   :star t_time =>  @start_tim e,
  523                   :end_ time => @e nd_time,
  524                   :elap sed_time = >  @elap.r ound(3),
  525                   :tags  => @scena rio_tags,
  526                   :snar io_name =>  @scenario _name
  527                 }.to_js on,
  528       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  529     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s   
  530   end
  531  
  532   When(/^the  client re quests in- patient me dication r esults for  that pati ent "(.*?) " in FHIR  format$/)   do |pid| 
  533       #https:// IP        /fhir/Medi cationAdmi nistration ?subject.i dentifier= R E D A CTED ;100033&_f ormat=json &_ack=true
  534     temp = Q ueryFhir.n ew("Medica tionAdmini stration")
  535     temp.add _parameter ("subject. identifier ", pid)
  536     temp.add _format("j son")
  537     temp.add _acknowled ge("true")
  538     p temp.p ath
  539     @start_t ime = Time .now.to_f     
  540     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(t emp.path)
  541     @end_tim e = Time.n ow.to_f
  542     @elap= ( @end_time  - @start_t ime)
  543     @result  = HTTParty .post(SETE NV.perf_ur l, 
  544       :body  => { :tran saction_na me => 'fhi r_Medicati onAdminist ration', 
  545                   :star t_time =>  @start_tim e,
  546                   :end_ time => @e nd_time,
  547                   :elap sed_time = >  @elap.r ound(3),
  548                   :tags  => @scena rio_tags,
  549                   :snar io_name =>  @scenario _name
  550                 }.to_js on,
  551       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  552     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s      
  553   end
  554  
  555   When(/^the  client re quests out -patient m edication  results fo r the pati ent "(.*?) " in FHIR  format$/)  do |pid|
  556       #https:// IP        /fhir/Medi cationDisp ense?subje ct.identif ier=500000 0318&_form at=json&_a ck=true
  557     temp = Q ueryFhir.n ew("Medica tionDispen se")
  558     temp.add _parameter ("subject. identifier ", pid)
  559     temp.add _format("j son")
  560     temp.add _acknowled ge("true")
  561     p temp.p ath
  562     @start_t ime = Time .now.to_f     
  563     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(t emp.path)
  564     @end_tim e = Time.n ow.to_f
  565     @elap= ( @end_time  - @start_t ime)
  566     @result  = HTTParty .post(SETE NV.perf_ur l, 
  567       :body  => { :tran saction_na me => 'fhi r_Medicati onDispense ', 
  568                   :star t_time =>  @start_tim e,
  569                   :end_ time => @e nd_time,
  570                   :elap sed_time = >  @elap.r ound(3),
  571                   :tags  => @scena rio_tags,
  572                   :snar io_name =>  @scenario _name
  573                 }.to_js on,
  574       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  575     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s      
  576   end
  577  
  578   When(/^the  client re quests rad iology rep ort result s for that  patient " (.*?)" in  FHIR forma t$/) do |p id|
  579       #https:// IP        /fhir/Diag nosticRepo rt?subject .identifie r=10107&do main=rad&_ format=jso n&_ack=tru e
  580     temp = Q ueryFhir.n ew("Diagno sticReport ")
  581     temp.add _parameter ("subject. identifier ", pid)
  582     temp.add _parameter ("domain",  "rad")
  583     temp.add _format("j son")
  584     temp.add _acknowled ge("true")
  585     p temp.p ath
  586     @start_t ime = Time .now.to_f     
  587     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(t emp.path)
  588     @end_tim e = Time.n ow.to_f
  589     @elap= ( @end_time  - @start_t ime)
  590     @result  = HTTParty .post(SETE NV.perf_ur l, 
  591       :body  => { :tran saction_na me => 'fhi r_rad', 
  592                   :star t_time =>  @start_tim e,
  593                   :end_ time => @e nd_time,
  594                   :elap sed_time = >  @elap.r ound(3),
  595                   :tags  => @scena rio_tags,
  596                   :snar io_name =>  @scenario _name
  597                 }.to_js on,
  598       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  599     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s      
  600   end
  601  
  602   ########## ########## ########## #### vpr a pi REST en dpoints st eps
  603  
  604   When(/^the  client re quests all ergies fro m VPR for  the patien t, "(.*?)" $/) do |pi d|
  605       #https:// IP        /vpr/ R E D A CTED ;100022/al lergy?_ack =true
  606     full_pat h = QueryV PR.new("al lergy", pi d).path
  607     p full_p ath
  608     @start_t ime = Time .now.to_f 
  609     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(f ull_path)
  610     @end_tim e = Time.n ow.to_f
  611     @elap= ( @end_time  - @start_t ime)
  612     @result  = HTTParty .post(SETE NV.perf_ur l, 
  613       :body  => { :tran saction_na me => 'vpr _allergy',  
  614                   :star t_time =>  @start_tim e,
  615                   :end_ time => @e nd_time,
  616                   :elap sed_time = >  @elap.r ound(3),
  617                   :tags  => @scena rio_tags,
  618                   :snar io_name =>  @scenario _name
  619                 }.to_js on,
  620       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  621     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s
  622   end
  623  
  624   When(/^the  client re quests vit al from VP R for the  patient, " (.*?)"$/)  do |pid|
  625       #https:// IP        /vpr/ R E D A CTED ;100022/vi tal?_ack=t rue
  626     full_pat h = QueryV PR.new("vi tal", pid) .path
  627     p full_p ath
  628     @start_t ime = Time .now.to_f 
  629     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(f ull_path)
  630     @end_tim e = Time.n ow.to_f
  631     @elap= ( @end_time  - @start_t ime)
  632     @result  = HTTParty .post(SETE NV.perf_ur l, 
  633       :body  => { :tran saction_na me => 'vpr _vital', 
  634                   :star t_time =>  @start_tim e,
  635                   :end_ time => @e nd_time,
  636                   :elap sed_time = >  @elap.r ound(3),
  637                   :tags  => @scena rio_tags,
  638                   :snar io_name =>  @scenario _name
  639                 }.to_js on,
  640       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  641     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s
  642   end
  643  
  644   When(/^the  client re quests dem ographics  from VPR f or the pat ient, "(.* ?)"$/) do  |pid|
  645       #https:// IP        /vpr/ R E D A CTED ;100022/pa tient?_ack =true
  646     full_pat h = QueryV PR.new("pa tient", pi d).path
  647     p full_p ath
  648     @start_t ime = Time .now.to_f 
  649     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(f ull_path)
  650     @end_tim e = Time.n ow.to_f
  651     @elap= ( @end_time  - @start_t ime)
  652     @result  = HTTParty .post(SETE NV.perf_ur l, 
  653       :body  => { :tran saction_na me => 'vpr _patient',  
  654                   :star t_time =>  @start_tim e,
  655                   :end_ time => @e nd_time,
  656                   :elap sed_time = >  @elap.r ound(3),
  657                   :tags  => @scena rio_tags,
  658                   :snar io_name =>  @scenario _name
  659                 }.to_js on,
  660       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  661     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s
  662   end
  663  
  664   When(/^the  user sear ches for a  patient " (.*?)" in  VPR format $/) do |la st_name|
  665       #https:// IP        /vpr/searc h/Patient/ ?name=EIGH T
  666     path = Q uerySearch .new("full Name", las t_name).pa th
  667     p path
  668     @start_t ime = Time .now.to_f   
  669     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(p ath)
  670     @end_tim e = Time.n ow.to_f
  671     @elap= ( @end_time  - @start_t ime)
  672     @result  = HTTParty .post(SETE NV.perf_ur l, 
  673       :body  => { :tran saction_na me => 'vpr _search', 
  674                   :star t_time =>  @start_tim e,
  675                   :end_ time => @e nd_time,
  676                   :elap sed_time = >  @elap.r ound(3),
  677                   :tags  => @scena rio_tags,
  678                   :snar io_name =>  @scenario _name
  679                 }.to_js on,
  680       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  681     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s
  682   end
  683  
  684   When(/^the  user sear ches in su mmary resu lts for a  patient "( .*?)" in V PR format$ /) do |las t_name|
  685       #https:// IP        /vpr/searc h/Patient/ ?name=EIGH T&resultsR ecordType= summary
  686     path = Q uerySearch .new("full Name", las t_name).ad d_paramete r("results RecordType ", "summar y")
  687     p path
  688     @start_t ime = Time .now.to_f     
  689     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(p ath)
  690     @end_tim e = Time.n ow.to_f
  691     @elap= ( @end_time  - @start_t ime)
  692     @result  = HTTParty .post(SETE NV.perf_ur l, 
  693       :body  => { :tran saction_na me => 'vpr _search_Re cordTypesu mmary', 
  694                   :star t_time =>  @start_tim e,
  695                   :end_ time => @e nd_time,
  696                   :elap sed_time = >  @elap.r ound(3),
  697                   :tags  => @scena rio_tags,
  698                   :snar io_name =>  @scenario _name
  699                 }.to_js on,
  700       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  701     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s
  702   end
  703  
  704   When(/^the  user sear ches medic ation for  the patien t "(.*?)"  with the " (.*?)" in  VPR format $/) do |pi d, text|
  705       #https:// IP        /vpr/11016 /search/ME D?text=ANA LGESICS
  706     path = Q ueryVPR.ne w("search/ MED", pid) .add_param eter("text ", text)
  707     p path
  708     @start_t ime = Time .now.to_f     
  709     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(p ath)
  710     @end_tim e = Time.n ow.to_f
  711     @elap= ( @end_time  - @start_t ime)
  712     @result  = HTTParty .post(SETE NV.perf_ur l, 
  713       :body  => { :tran saction_na me => 'vpr _search_Me d', 
  714                   :star t_time =>  @start_tim e,
  715                   :end_ time => @e nd_time,
  716                   :elap sed_time = >  @elap.r ound(3),
  717                   :tags  => @scena rio_tags,
  718                   :snar io_name =>  @scenario _name
  719                 }.to_js on,
  720       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  721     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s  
  722   end
  723  
  724   When(/^the  client re quests lab s for the  patient "( .*?)" in V PR format$ /) do |pid |
  725       #https:// IP        /vpr/11016 /lab?_ack= true
  726     path = Q ueryVPR.ne w("lab", p id).path
  727     p path
  728     @start_t ime = Time .now.to_f     
  729     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(p ath)
  730     @end_tim e = Time.n ow.to_f
  731     @elap= ( @end_time  - @start_t ime)
  732     @result  = HTTParty .post(SETE NV.perf_ur l, 
  733       :body  => { :tran saction_na me => 'vpr _lab', 
  734                   :star t_time =>  @start_tim e,
  735                   :end_ time => @e nd_time,
  736                   :elap sed_time = >  @elap.r ound(3),
  737                   :tags  => @scena rio_tags,
  738                   :snar io_name =>  @scenario _name
  739                 }.to_js on,
  740       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  741     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s  
  742   end
  743  
  744   When(/^the  client re quests pro blem lists  for the p atient "(. *?)" in VP R format$/ ) do |pid|
  745       #https:// IP        /vpr/11016 /problem?_ ack=true
  746     path = Q ueryVPR.ne w("problem ", pid).pa th
  747     p path
  748     @start_t ime = Time .now.to_f     
  749     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(p ath)
  750     @end_tim e = Time.n ow.to_f
  751     @elap= ( @end_time  - @start_t ime)
  752     @result  = HTTParty .post(SETE NV.perf_ur l, 
  753       :body  => { :tran saction_na me => 'vpr _problem',  
  754                   :star t_time =>  @start_tim e,
  755                   :end_ time => @e nd_time,
  756                   :elap sed_time = >  @elap.r ound(3),
  757                   :tags  => @scena rio_tags,
  758                   :snar io_name =>  @scenario _name
  759                 }.to_js on,
  760       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  761     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s  
  762   end
  763  
  764   When(/^the  client re quests med ications f or the pat ient "(.*? )" in VPR  format$/)  do |pid|
  765       #https:// IP        /vpr/ R E D A CTED ;100033/me d?_ack=tru e
  766     path = Q ueryVPR.ne w("med", p id).path
  767     p path
  768     @start_t ime = Time .now.to_f     
  769     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(p ath)
  770     @end_tim e = Time.n ow.to_f
  771     @elap= ( @end_time  - @start_t ime)
  772     @result  = HTTParty .post(SETE NV.perf_ur l, 
  773       :body  => { :tran saction_na me => 'vpr _med', 
  774                   :star t_time =>  @start_tim e,
  775                   :end_ time => @e nd_time,
  776                   :elap sed_time = >  @elap.r ound(3),
  777                   :tags  => @scena rio_tags,
  778                   :snar io_name =>  @scenario _name
  779                 }.to_js on,
  780       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  781     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s    
  782   end
  783  
  784   When(/^the  client re quests doc ument for  the patien t "(.*?)"  in VPR for mat$/) do  |pid|
  785       #https:// IP        /vpr/50000 00009/docu ment?_ack= true   
  786     path = Q ueryVPR.ne w("documen t", pid).p ath
  787     p path
  788     @start_t ime = Time .now.to_f     
  789     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(p ath)
  790     @end_tim e = Time.n ow.to_f
  791     @elap= ( @end_time  - @start_t ime)
  792     @result  = HTTParty .post(SETE NV.perf_ur l, 
  793       :body  => { :tran saction_na me => 'vpr _document'
  794                   :star t_time =>  @start_tim e,
  795                   :end_ time => @e nd_time,
  796                   :elap sed_time = >  @elap.r ound(3),
  797                   :tags  => @scena rio_tags,
  798                   :snar io_name =>  @scenario _name
  799                 }.to_js on,
  800       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  801     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s       
  802   end
  803  
  804   When(/^the  client re quests rad iology rep ort result s for that  patient " (.*?)" in  VPR format $/) do |pi d|
  805       #https:// IP        /vpr/10146 /rad?_ack= true
  806     temp = Q ueryVPR.ne w("rad", p id)
  807     p temp.p ath
  808     @start_t ime = Time .now.to_f     
  809     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(t emp.path)
  810     @end_tim e = Time.n ow.to_f
  811     @elap= ( @end_time  - @start_t ime)
  812     @result  = HTTParty .post(SETE NV.perf_ur l, 
  813       :body  => { :tran saction_na me => 'vpr _rad', 
  814                   :star t_time =>  @start_tim e,
  815                   :end_ time => @e nd_time,
  816                   :elap sed_time = >  @elap.r ound(3),
  817                   :tags  => @scena rio_tags,
  818                   :snar io_name =>  @scenario _name
  819                 }.to_js on,
  820       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  821     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s    
  822   end
  823  
  824   When(/^the  client re quests ord er results  for that  patient "( .*?)" in V PR format$ /) do |pid |
  825       #https:// IP        /vpr/50000 00009/orde r?_ack=tru e
  826     temp = Q ueryVPR.ne w("order",  pid)
  827     p temp.p ath
  828     @start_t ime = Time .now.to_f     
  829     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(t emp.path)
  830     @end_tim e = Time.n ow.to_f
  831     @elap= ( @end_time  - @start_t ime)
  832     @result  = HTTParty .post(SETE NV.perf_ur l, 
  833       :body  => { :tran saction_na me => 'vpr _order', 
  834                   :star t_time =>  @start_tim e,
  835                   :end_ time => @e nd_time,
  836                   :elap sed_time = >  @elap.r ound(3),
  837                   :tags  => @scena rio_tags,
  838                   :snar io_name =>  @scenario _name
  839                 }.to_js on,
  840       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  841     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s   
  842   end
  843  
  844   When(/^the  client re quests ana tomic path ology for  the patien t "(.*?)"  in VPR for mat$/) do  |pid|
  845       #https:// IP        /vpr/10110 /accession ?_ack=true
  846     path = Q ueryVPR.ne w("accessi on", pid). path
  847     p path
  848     @start_t ime = Time .now.to_f     
  849     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(p ath)
  850     @end_tim e = Time.n ow.to_f
  851     @elap= ( @end_time  - @start_t ime)
  852     @result  = HTTParty .post(SETE NV.perf_ur l, 
  853       :body  => { :tran saction_na me => 'vpr _accession ', 
  854                   :star t_time =>  @start_tim e,
  855                   :end_ time => @e nd_time,
  856                   :elap sed_time = >  @elap.r ound(3),
  857                   :tags  => @scena rio_tags,
  858                   :snar io_name =>  @scenario _name
  859                 }.to_js on,
  860       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  861     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s      
  862   end
  863  
  864   When(/^the  client re quests imm unization  for the pa tient "(.* ?)" in VPR  format$/)  do |pid|
  865       #https:// IP        /vpr/10108 /immunizat ion?_ack=t rue   
  866     path = Q ueryVPR.ne w("immuniz ation", pi d).path
  867     p path
  868     @start_t ime = Time .now.to_f     
  869     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(p ath)
  870     @end_tim e = Time.n ow.to_f
  871     @elap= ( @end_time  - @start_t ime)
  872     @result  = HTTParty .post(SETE NV.perf_ur l, 
  873       :body  => { :tran saction_na me => 'vpr _immunizat ion', 
  874                   :star t_time =>  @start_tim e,
  875                   :end_ time => @e nd_time,
  876                   :elap sed_time = >  @elap.r ound(3),
  877                   :tags  => @scena rio_tags,
  878                   :snar io_name =>  @scenario _name
  879                 }.to_js on,
  880       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  881     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s    
  882   end
  883  
  884   When(/^the  client re quests con sult resul ts for the  patient " (.*?)" in  VPR format $/) do |pi d|
  885       #https:// IP        /vpr/10107 /consult?_ ack=true 
  886     temp = Q ueryVPR.ne w("consult ", pid)
  887     p temp.p ath
  888     @start_t ime = Time .now.to_f     
  889     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(t emp.path)
  890     @end_tim e = Time.n ow.to_f
  891     @elap= ( @end_time  - @start_t ime)
  892     @result  = HTTParty .post(SETE NV.perf_ur l, 
  893       :body  => { :tran saction_na me => 'vpr _consult',  
  894                   :star t_time =>  @start_tim e,
  895                   :end_ time => @e nd_time,
  896                   :elap sed_time = >  @elap.r ound(3),
  897                   :tags  => @scena rio_tags,
  898                   :snar io_name =>  @scenario _name
  899                 }.to_js on,
  900       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  901     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s       
  902   end
  903  
  904   When(/^the  client re quests app ointments  for the pa tient "(.* ?)" in VPR  format$/)  do |pid|
  905       #https:// IP        /vpr/C877; 737/appoin tment?_ack =true
  906     temp = Q ueryVPR.ne w("appoint ment", pid )
  907     p temp.p ath
  908     @start_t ime = Time .now.to_f     
  909     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(t emp.path)
  910     @end_tim e = Time.n ow.to_f
  911     @elap= ( @end_time  - @start_t ime)
  912     @result  = HTTParty .post(SETE NV.perf_ur l, 
  913       :body  => { :tran saction_na me => 'hdr _appointme nt', 
  914                   :star t_time =>  @start_tim e,
  915                   :end_ time => @e nd_time,
  916                   :elap sed_time = >  @elap.r ound(3),
  917                   :tags  => @scena rio_tags,
  918                   :snar io_name =>  @scenario _name
  919                 }.to_js on,
  920       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  921     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s       
  922   end
  923  
  924   When(/^the  client re quests con sult resul ts for the  patient " (.*?)" in  VPR format _HDR$/) do  |pid|
  925       #https:// IP        /vpr/C877; 737/consul t?_ack=tru e
  926     temp = Q ueryVPR.ne w("consult ", pid)
  927     p temp.p ath
  928     @start_t ime = Time .now.to_f     
  929     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(t emp.path)
  930     @end_tim e = Time.n ow.to_f
  931     @elap= ( @end_time  - @start_t ime)
  932     @result  = HTTParty .post(SETE NV.perf_ur l, 
  933       :body  => { :tran saction_na me => 'hdr _consult',  
  934                   :star t_time =>  @start_tim e,
  935                   :end_ time => @e nd_time,
  936                   :elap sed_time = >  @elap.r ound(3),
  937                   :tags  => @scena rio_tags,
  938                   :snar io_name =>  @scenario _name
  939                 }.to_js on,
  940       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  941     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s       
  942   end
  943  
  944   When(/^the  client re quests cpt  for the p atient "(. *?)" in VP R format$/ ) do |pid|
  945       #https:// IP        /vpr/C877; 737/cpt?_a ck=true
  946     temp = Q ueryVPR.ne w("cpt", p id)
  947     p temp.p ath
  948     @start_t ime = Time .now.to_f     
  949     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(t emp.path)
  950     @end_tim e = Time.n ow.to_f
  951     @elap= ( @end_time  - @start_t ime)
  952     @result  = HTTParty .post(SETE NV.perf_ur l, 
  953       :body  => { :tran saction_na me => 'hdr _cpt', 
  954                   :star t_time =>  @start_tim e,
  955                   :end_ time => @e nd_time,
  956                   :elap sed_time = >  @elap.r ound(3),
  957                   :tags  => @scena rio_tags,
  958                   :snar io_name =>  @scenario _name
  959                 }.to_js on,
  960       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  961     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s       
  962   end
  963  
  964   When(/^the  client re quests doc uments for  the patie nt "(.*?)"  in VPR fo rmat_HDR$/ ) do |pid|
  965       #https:// IP        /vpr/C877; 737/docume nt?_ack=tr ue
  966     path = Q ueryVPR.ne w("documen t", pid).p ath
  967     p path
  968     @start_t ime = Time .now.to_f     
  969     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(p ath)
  970     @end_tim e = Time.n ow.to_f
  971     @elap= ( @end_time  - @start_t ime)
  972     @result  = HTTParty .post(SETE NV.perf_ur l, 
  973       :body  => { :tran saction_na me => 'hdr _document'
  974                   :star t_time =>  @start_tim e,
  975                   :end_ time => @e nd_time,
  976                   :elap sed_time = >  @elap.r ound(3),
  977                   :tags  => @scena rio_tags,
  978                   :snar io_name =>  @scenario _name
  979                 }.to_js on,
  980       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  981     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s       
  982   end
  983  
  984   When(/^the  client re quests edu cations fo r the pati ent "(.*?) " in VPR f ormat$/) d o |pid|
  985       #https:// IP        /vpr/ R E D A CTED ;737/educa tion?_ack= true
  986     path = Q ueryVPR.ne w("educati on", pid). path
  987     p path
  988     @start_t ime = Time .now.to_f     
  989     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(p ath)
  990     @end_tim e = Time.n ow.to_f
  991     @elap= ( @end_time  - @start_t ime)
  992     @result  = HTTParty .post(SETE NV.perf_ur l, 
  993       :body  => { :tran saction_na me => 'hdr _education ', 
  994                   :star t_time =>  @start_tim e,
  995                   :end_ time => @e nd_time,
  996                   :elap sed_time = >  @elap.r ound(3),
  997                   :tags  => @scena rio_tags,
  998                   :snar io_name =>  @scenario _name
  999                 }.to_js on,
  1000       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  1001     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s       
  1002   end
  1003  
  1004   When(/^the  client re quests exa ms for the  patient " (.*?)" in  VPR format $/) do |pi d|
  1005       #https:// IP        /vpr/ R E D A CTED ;737/exam? _ack=true
  1006     path = Q ueryVPR.ne w("exam",  pid).path
  1007     p path
  1008     @start_t ime = Time .now.to_f     
  1009     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(p ath)
  1010     @end_tim e = Time.n ow.to_f
  1011     @elap= ( @end_time  - @start_t ime)
  1012     @result  = HTTParty .post(SETE NV.perf_ur l, 
  1013       :body  => { :tran saction_na me => 'hdr _exams', 
  1014                   :star t_time =>  @start_tim e,
  1015                   :end_ time => @e nd_time,
  1016                   :elap sed_time = >  @elap.r ound(3),
  1017                   :tags  => @scena rio_tags,
  1018                   :snar io_name =>  @scenario _name
  1019                 }.to_js on,
  1020       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  1021     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s       
  1022   end
  1023  
  1024   When(/^the  client re quests fac tors for t he patient  "(.*?)" i n VPR form at$/) do | pid|
  1025       #https:// IP        /vpr/ R E D A CTED ;737/facto r?_ack=tru e
  1026     path = Q ueryVPR.ne w("factor" , pid).pat h
  1027     p path
  1028     @start_t ime = Time .now.to_f     
  1029     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(p ath)
  1030     @end_tim e = Time.n ow.to_f
  1031     @elap= ( @end_time  - @start_t ime)
  1032     @result  = HTTParty .post(SETE NV.perf_ur l, 
  1033       :body  => { :tran saction_na me => 'hdr _factor', 
  1034                   :star t_time =>  @start_tim e,
  1035                   :end_ time => @e nd_time,
  1036                   :elap sed_time = >  @elap.r ound(3),
  1037                   :tags  => @scena rio_tags,
  1038                   :snar io_name =>  @scenario _name
  1039                 }.to_js on,
  1040       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  1041     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s       
  1042   end
  1043  
  1044   When(/^the  client re quests ima ges for th e patient  "(.*?)" in  VPR forma t$/) do |p id|
  1045       #https:// IP        /vpr/ R E D A CTED ;737/image ?_ack=true
  1046     path = Q ueryVPR.ne w("image",  pid).path
  1047     p path
  1048     @start_t ime = Time .now.to_f     
  1049     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(p ath)
  1050     @end_tim e = Time.n ow.to_f
  1051     @elap= ( @end_time  - @start_t ime)
  1052     @result  = HTTParty .post(SETE NV.perf_ur l, 
  1053       :body  => { :tran saction_na me => 'hdr _image', 
  1054                   :star t_time =>  @start_tim e,
  1055                   :end_ time => @e nd_time,
  1056                   :elap sed_time = >  @elap.r ound(3),
  1057                   :tags  => @scena rio_tags,
  1058                   :snar io_name =>  @scenario _name
  1059                 }.to_js on,
  1060       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  1061     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s       
  1062   end
  1063  
  1064  
  1065   When(/^the  client re quests imm unization  for the pa tient "(.* ?)" in VPR  format_HD R$/) do |p id|
  1066       #https:// IP        /vpr/11016 /immunizat ion?_ack=t rue   
  1067     path = Q ueryVPR.ne w("immuniz ation", pi d).path
  1068     p path
  1069     @start_t ime = Time .now.to_f     
  1070     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(p ath)
  1071     @end_tim e = Time.n ow.to_f
  1072     @elap= ( @end_time  - @start_t ime)
  1073     @result  = HTTParty .post(SETE NV.perf_ur l, 
  1074       :body  => { :tran saction_na me => 'hdr _immunizat ion', 
  1075                   :star t_time =>  @start_tim e,
  1076                   :end_ time => @e nd_time,
  1077                   :elap sed_time = >  @elap.r ound(3),
  1078                   :tags  => @scena rio_tags,
  1079                   :snar io_name =>  @scenario _name
  1080                 }.to_js on,
  1081       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  1082     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s    
  1083   end
  1084  
  1085   When(/^the  client re quests ord er results  for the p atient "(. *?)" in VP R format_H DR$/) do | pid|
  1086       #https:// IP        /vpr/11016 /mh?_ack=t rue
  1087     temp = Q ueryVPR.ne w("order",  pid)
  1088     p temp.p ath
  1089     @start_t ime = Time .now.to_f     
  1090     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(t emp.path)
  1091     @end_tim e = Time.n ow.to_f
  1092     @elap= ( @end_time  - @start_t ime)
  1093     @result  = HTTParty .post(SETE NV.perf_ur l, 
  1094       :body  => { :tran saction_na me => 'hdr _order', 
  1095                   :star t_time =>  @start_tim e,
  1096                   :end_ time => @e nd_time,
  1097                   :elap sed_time = >  @elap.r ound(3),
  1098                   :tags  => @scena rio_tags,
  1099                   :snar io_name =>  @scenario _name
  1100                 }.to_js on,
  1101       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  1102     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s   
  1103   end
  1104  
  1105   When(/^the  client re quests men talhealth  for the pa tient "(.* ?)" in VPR  format$/)  do |pid|
  1106       #https:// IP        /vpr/11016 /order?_ac k=true
  1107     path = Q ueryVPR.ne w("mh", pi d).path
  1108     p path
  1109     @start_t ime = Time .now.to_f     
  1110     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(p ath)
  1111     @end_tim e = Time.n ow.to_f
  1112     @elap= ( @end_time  - @start_t ime)
  1113     @result  = HTTParty .post(SETE NV.perf_ur l, 
  1114       :body  => { :tran saction_na me => 'hdr _mentalhea lth', 
  1115                   :star t_time =>  @start_tim e,
  1116                   :end_ time => @e nd_time,
  1117                   :elap sed_time = >  @elap.r ound(3),
  1118                   :tags  => @scena rio_tags,
  1119                   :snar io_name =>  @scenario _name
  1120                 }.to_js on,
  1121       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  1122     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s       
  1123   end
  1124  
  1125   When(/^the  client re quests poi ntofvisits  for the p atient "(. *?)" in VP R format$/ ) do |pid|
  1126       #https:// IP        /vpr/11016 /pov?_ack= true
  1127     path = Q ueryVPR.ne w("pov", p id).path
  1128     p path
  1129     @start_t ime = Time .now.to_f     
  1130     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(p ath)
  1131     @end_tim e = Time.n ow.to_f
  1132     @elap= ( @end_time  - @start_t ime)
  1133     @result  = HTTParty .post(SETE NV.perf_ur l, 
  1134       :body  => { :tran saction_na me => 'hdr _pointofvi sits', 
  1135                   :star t_time =>  @start_tim e,
  1136                   :end_ time => @e nd_time,
  1137                   :elap sed_time = >  @elap.r ound(3),
  1138                   :tags  => @scena rio_tags,
  1139                   :snar io_name =>  @scenario _name
  1140                 }.to_js on,
  1141       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  1142     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s       
  1143   end
  1144  
  1145   When(/^the  client re quests pro blem lists  for the p atient "(. *?)" in VP R format_H DR$/) do | pid|
  1146       #https:// IP        /vpr/11016 /problem?_ ack=true
  1147     path = Q ueryVPR.ne w("problem ", pid).pa th
  1148     p path
  1149     @start_t ime = Time .now.to_f     
  1150     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(p ath)
  1151     @end_tim e = Time.n ow.to_f
  1152     @elap= ( @end_time  - @start_t ime)
  1153     @result  = HTTParty .post(SETE NV.perf_ur l, 
  1154       :body  => { :tran saction_na me => 'hdr _problem',  
  1155                   :star t_time =>  @start_tim e,
  1156                   :end_ time => @e nd_time,
  1157                   :elap sed_time = >  @elap.r ound(3),
  1158                   :tags  => @scena rio_tags,
  1159                   :snar io_name =>  @scenario _name
  1160                 }.to_js on,
  1161       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  1162     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s  
  1163   end
  1164  
  1165   When(/^the  client re quests pro cedure res ults for t he patient  "(.*?)" i n VPR form at$/) do | pid|
  1166       #https:// IP        /vpr/11016 /procedure ?_ack=true
  1167     path = Q ueryVPR.ne w("procedu re", pid). path
  1168     p path
  1169     @start_t ime = Time .now.to_f     
  1170     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(p ath)
  1171     @end_tim e = Time.n ow.to_f
  1172     @elap= ( @end_time  - @start_t ime)
  1173     @result  = HTTParty .post(SETE NV.perf_ur l, 
  1174       :body  => { :tran saction_na me => 'hdr _procedure ', 
  1175                   :star t_time =>  @start_tim e,
  1176                   :end_ time => @e nd_time,
  1177                   :elap sed_time = >  @elap.r ound(3),
  1178                   :tags  => @scena rio_tags,
  1179                   :snar io_name =>  @scenario _name
  1180                 }.to_js on,
  1181       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  1182     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s       
  1183   end
  1184  
  1185   When(/^the  client re quests ski n results  for the pa tient "(.* ?)" in VPR  format$/)  do |pid|
  1186       #https:// IP        /vpr/11016 /skin?_ack =true
  1187     path = Q ueryVPR.ne w("skin",  pid).path
  1188     p path
  1189     @start_t ime = Time .now.to_f     
  1190     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(p ath)
  1191     @end_tim e = Time.n ow.to_f
  1192     @elap= ( @end_time  - @start_t ime)
  1193     @result  = HTTParty .post(SETE NV.perf_ur l, 
  1194       :body  => { :tran saction_na me => 'hdr _skin', 
  1195                   :star t_time =>  @start_tim e,
  1196                   :end_ time => @e nd_time,
  1197                   :elap sed_time = >  @elap.r ound(3),
  1198                   :tags  => @scena rio_tags,
  1199                   :snar io_name =>  @scenario _name
  1200                 }.to_js on,
  1201       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  1202     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s       
  1203   end
  1204  
  1205   When(/^the  client re quests sur gery resul ts for the  patient " (.*?)" in  VPR format $/) do |pi d|
  1206       #https:// IP        /vpr/11016 /surgery?_ ack=true
  1207     path = Q ueryVPR.ne w("surgery ", pid).pa th
  1208     p path
  1209     @start_t ime = Time .now.to_f     
  1210     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(p ath)
  1211     @end_tim e = Time.n ow.to_f
  1212     @elap= ( @end_time  - @start_t ime)
  1213     @result  = HTTParty .post(SETE NV.perf_ur l, 
  1214       :body  => { :tran saction_na me => 'hdr _surgery',  
  1215                   :star t_time =>  @start_tim e,
  1216                   :end_ time => @e nd_time,
  1217                   :elap sed_time = >  @elap.r ound(3),
  1218                   :tags  => @scena rio_tags,
  1219                   :snar io_name =>  @scenario _name
  1220                 }.to_js on,
  1221       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  1222     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s       
  1223   end
  1224  
  1225   When(/^the  client re quests vis it results  for the p atient "(. *?)" in VP R format$/ ) do |pid|
  1226       #https:// IP        /vpr/11016 /visit?_ac k=true
  1227     path = Q ueryVPR.ne w("visit",  pid).path
  1228     p path
  1229     @start_t ime = Time .now.to_f     
  1230     @respons e = HTTPar tyWithBasi cAuth.get_ with_autho rization(p ath)
  1231     @end_tim e = Time.n ow.to_f
  1232     @elap= ( @end_time  - @start_t ime)
  1233     @result  = HTTParty .post(SETE NV.perf_ur l, 
  1234       :body  => { :tran saction_na me => 'hdr _visit', 
  1235                   :star t_time =>  @start_tim e,
  1236                   :end_ time => @e nd_time,
  1237                   :elap sed_time = >  @elap.r ound(3),
  1238                   :tags  => @scena rio_tags,
  1239                   :snar io_name =>  @scenario _name
  1240                 }.to_js on,
  1241       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  1242     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s       
  1243   end
  1244  
  1245   Given(/^th e client r equests Me ds for the  patient " (.*?)"$/)  do |pid|
  1246       #https:// IP             /vpr/view/ gov.va.cpe .vpr.query eng.MedsVi ewDef?_dc= 1396988436 165&pid= R E D A CTED ;71&page=1 &row.start =0&row.cou nt=1000&ra nge.startH L7=1993041 6&range.en dHL7=20140 710
  1247     @start_t ime = Time .now.to_f     
  1248     query_wi th_path "/ vpr/view/g ov.va.cpe. vpr.querye ng.MedsVie wDef", pid
  1249     @end_tim e = Time.n ow.to_f
  1250     @elap= ( @end_time  - @start_t ime)
  1251     @result  = HTTParty .post(SETE NV.perf_ur l, 
  1252       :body  => { :tran saction_na me => 'DoD _MedViewDe f', 
  1253                   :star t_time =>  @start_tim e,
  1254                   :end_ time => @e nd_time,
  1255                   :elap sed_time = >  @elap.r ound(3),
  1256                   :tags  => @scena rio_tags,
  1257                   :snar io_name =>  @scenario _name
  1258                 }.to_js on,
  1259       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  1260     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s    
  1261   end
  1262  
  1263   When(/^the  client re quests unf iltered do cuments fo r the pati ent "(.*?) "$/) do |p id|
  1264       #https:// IP             /vpr/view/ gov.va.cpe .vpr.query eng.NotesU nfilteredV iewDef?_dc =139698843 6165&pid=1 0108&page= 1&row.star t=0&row.co unt=1000&r ange.start HL7=199304 16&range.e ndHL7=2014 0710
  1265     @start_t ime = Time .now.to_f     
  1266     query_wi th_path "/ vpr/view/g ov.va.cpe. vpr.querye ng.NotesUn filteredVi ewDef", pi d
  1267     @end_tim e = Time.n ow.to_f
  1268     @elap= ( @end_time  - @start_t ime)
  1269     @result  = HTTParty .post(SETE NV.perf_ur l, 
  1270       :body  => { :tran saction_na me => 'DoD _NotesUnfi lteredView Def', 
  1271                   :star t_time =>  @start_tim e,
  1272                   :end_ time => @e nd_time,
  1273                   :elap sed_time = >  @elap.r ound(3),
  1274                   :tags  => @scena rio_tags,
  1275                   :snar io_name =>  @scenario _name
  1276                 }.to_js on,
  1277       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  1278     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s    
  1279   end
  1280  
  1281   When(/^the  client re quests pro blems for  the patien t "(.*?)"$ /) do |pid |
  1282       #https:// IP             /vpr/view/ gov.va.cpe .vpr.query eng.Proble mViewDef?_ dc=1396988 436165&pid =10108&pag e=1&row.st art=0&row. count=1000
  1283     @start_t ime = Time .now.to_f     
  1284     query_wi th_path_no _range "/v pr/view/go v.va.cpe.v pr.queryen g.ProblemV iewDef", p id
  1285     @end_tim e = Time.n ow.to_f
  1286     @elap= ( @end_time  - @start_t ime)
  1287     @result  = HTTParty .post(SETE NV.perf_ur l, 
  1288       :body  => { :tran saction_na me => 'DoD _ProblemVi ewDef', 
  1289                   :star t_time =>  @start_tim e,
  1290                   :end_ time => @e nd_time,
  1291                   :elap sed_time = >  @elap.r ound(3),
  1292                   :tags  => @scena rio_tags,
  1293                   :snar io_name =>  @scenario _name
  1294                 }.to_js on,
  1295       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  1296     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s    
  1297   end
  1298  
  1299  
  1300   When(/^the  client re quests doc ument "(.* ?)", "(.*? )", "(.*?) "$/) do |e dipi, even tid, file_ extension|
  1301     @start_t ime = Time .now.to_f     
  1302     get_dod_ document e dipi, even tid, file_ extension
  1303     @end_tim e = Time.n ow.to_f
  1304     @elap= ( @end_time  - @start_t ime)
  1305     @result  = HTTParty .post(SETE NV.perf_ur l, 
  1306       :body  => { :tran saction_na me => 'DoD _document'
  1307                   :star t_time =>  @start_tim e,
  1308                   :end_ time => @e nd_time,
  1309                   :elap sed_time = >  @elap.r ound(3),
  1310                   :tags  => @scena rio_tags,
  1311                   :snar io_name =>  @scenario _name
  1312                 }.to_js on,
  1313       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  1314     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s   
  1315   end
  1316  
  1317  
  1318   When(/^the  client re quests doc uments for  the patie nt "(.*?)" $/) do |pi d|
  1319     @start_t ime = Time .now.to_f     
  1320     query_wi th_path "/ vpr/view/g ov.va.cpe. vpr.querye ng.NotesVi ewDef", pi d
  1321     @end_tim e = Time.n ow.to_f
  1322     @elap= ( @end_time  - @start_t ime)
  1323     @result  = HTTParty .post(SETE NV.perf_ur l, 
  1324       :body  => { :tran saction_na me => 'DoD _NotesView Def', 
  1325                   :star t_time =>  @start_tim e,
  1326                   :end_ time => @e nd_time,
  1327                   :elap sed_time = >  @elap.r ound(3),
  1328                   :tags  => @scena rio_tags,
  1329                   :snar io_name =>  @scenario _name
  1330                 }.to_js on,
  1331       :heade rs => { 'C ontent-Typ e' => 'app lication/j son' } )
  1332     puts '[I NFO] Respo nese time  = ' + (@en d_time - @ start_time ).to_s    
  1333   end
  1334  
  1335  
  1336