Produced by Araxis Merge on 10/4/2017 8:04:43 AM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | rdk.zip\rdk\product\tests\rspec-tests\lib\module | vxapi_utility.rb | Mon Aug 21 12:51:01 2017 UTC |
| 2 | rdk.zip\rdk\product\tests\rspec-tests\lib\module | vxapi_utility.rb | Tue Oct 3 17:28:22 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 272 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | # vxapi_ut ility | |
| 2 | ||
| 3 | VXAPI_URL = 'http:// IP /resource/ docs/vx-ap i/' | |
| 4 | ||
| 5 | # Utilitie s for RDK API tests | |
| 6 | module VxA PIUtility | |
| 7 | def refr esh_token | |
| 8 | # Refr esh the to ken so tha t the test account d oes not ge t session timeout | |
| 9 | @auth_ refresh_to ken.commit | |
| 10 | @auth_ refresh_to ken.respon seCode_ele ment.when_ visible(@w ait_time) | |
| 11 | @auth_ refresh_to ken.respon seCode_ele ment.text | |
| 12 | end | |
| 13 | ||
| 14 | def veri fy_body_co ntents(res ponseBodyE lement, ex pectedBody ) | |
| 15 | actual _response_ body = res ponseBodyE lement.spl it("\n") | |
| 16 | actual _response_ body.each_ with_index do |e, i| | |
| 17 | # pu ts "verify :<#{i}> Ac tual=<#{e. strip}> E xp=<#{expe ctedBody[i ].strip}>" | |
| 18 | if e .strip[0.. 10] != '"u pdated": ' | |
| 19 | ex pect(e.str ip).to eq( expectedBo dy[i].stri p) | |
| 20 | end | |
| 21 | end | |
| 22 | verify _body_size (actual_re sponse_bod y, expecte dBody) | |
| 23 | end | |
| 24 | ||
| 25 | def veri fy_body_si ze(respons eBodyEleme nt, expect edBody) | |
| 26 | expect (responseB odyElement .size).to eq(expecte dBody.size ) | |
| 27 | end | |
| 28 | ||
| 29 | def rdk_ sync(pid) | |
| 30 | status path = Que ryRDKSync. new('statu s', pid).p ath | |
| 31 | @respo nse = HTTP artyWithBa sicAuth.ge t_with_aut horization (statuspat h) | |
| 32 | until sync_compl ete | |
| 33 | path = QueryRD KSync.new( 'load', pi d).path | |
| 34 | @res ponse = HT TPartyWith BasicAuth. get_with_a uthorizati on(path) | |
| 35 | expe ct(@respon se.code).t o eq(201) | |
| 36 | time _out = 300 | |
| 37 | wait _time = 10 | |
| 38 | is_s ynced = fa lse | |
| 39 | (0.. Integer(ti me_out) / wait_time) .each do | |
| 40 | @r esponse = HTTPartyWi thBasicAut h.get_with _authoriza tion(statu spath) | |
| 41 | if sync_comp lete | |
| 42 | is_synced = true | |
| 43 | break | |
| 44 | el se | |
| 45 | sleep wait _time | |
| 46 | en d | |
| 47 | end | |
| 48 | expe ct(is_sync ed).to eq( true) | |
| 49 | end | |
| 50 | end | |
| 51 | ||
| 52 | def sync _complete | |
| 53 | is_syn c_complete = false | |
| 54 | # 2015 -06-19 new way | |
| 55 | status = JSON.pa rse(@respo nse.body)[ "data"] | |
| 56 | if sta tus == nil | |
| 57 | stat us = JSON. parse(@res ponse.body ) | |
| 58 | end | |
| 59 | # --DE BUG------- ---------- ---------- ---------- ---------- ---------- ---------- | |
| 60 | # puts 'sync_sta tus....... .......... .......... .......... ......' | |
| 61 | # puts status | |
| 62 | # puts '-------- ---------- ----' | |
| 63 | # puts status.ke y?('syncSt atus') | |
| 64 | # puts status['s yncStatus' ].key?('co mpletedSta mp') | |
| 65 | # puts !status[' syncStatus '].key?('i nProgress' ) | |
| 66 | # puts status['j obStatus'] .empty? | |
| 67 | # puts status['j obStatus'] | |
| 68 | # puts 'sync_sta tus....... .......... .......... .......... ......' | |
| 69 | # --DE BUG------- ---------- ---------- ---------- ---------- ---------- ---------- | |
| 70 | ||
| 71 | if sta tus.key?(" syncStatus ") \ | |
| 72 | && s tatus["syn cStatus"]. key?("comp letedStamp ") \ | |
| 73 | && ! status["sy ncStatus"] .key?("inP rogress") \ | |
| 74 | && s tatus["job Status"].e mpty? | |
| 75 | is_s ync_comple te = true | |
| 76 | end | |
| 77 | ||
| 78 | is_syn c_complete | |
| 79 | end | |
| 80 | ||
| 81 | def get_ fhir_compo sition(tes t_pid, add itional_pa rms = '') | |
| 82 | comman d = 'resou rce/fhir/C omposition ?' \ | |
| 83 | "subje ct.identif ier=#{test _pid}&_ack =true" + a dditional_ parms | |
| 84 | ||
| 85 | path = QueryGene ricRDK.new (command). path | |
| 86 | respon se = HTTPa rtyWithBas icAuth.get _with_auth orization( path) | |
| 87 | ||
| 88 | expect (response. code).to e q(200) | |
| 89 | # DEBU G: puts "- ---------- ---------- ---------- ------" | |
| 90 | # DEBU G: puts "e xp=" | |
| 91 | # DEBU G: puts JS ON.pretty_ generate(e xpected_bo dy) | |
| 92 | # DEBU G: puts "- ---------- -" | |
| 93 | # DEBU G: puts "a ct=" | |
| 94 | # DEBU G: puts JS ON.pretty_ generate(J SON.parse( response.b ody)) | |
| 95 | respon se.body | |
| 96 | end | |
| 97 | ||
| 98 | def dump (response_ body) | |
| 99 | puts " ========== ========== ========== ========" | |
| 100 | # puts JSON.pars e(response .body)["da ta"]["curr entItemCou nt"] | |
| 101 | # puts JSON.pars e(response .body)["da ta"]["tota lItems"] | |
| 102 | puts " - - - - - - - - - - - - - - - - - - -" | |
| 103 | puts J SON.pretty _generate( JSON.parse (response_ body)) | |
| 104 | puts " ---------- ---------- ---------- --------" | |
| 105 | end | |
| 106 | ||
| 107 | def rdk_ fetch(reso urce_direc tory_path, parms = n il) | |
| 108 | query = QueryGen ericRDK.ne w(resource _directory _path) | |
| 109 | unless parms.nil ? | |
| 110 | parm s.each do |k, v| | |
| 111 | # puts "<#{k }><#{v}>" | |
| 112 | qu ery.add_pa rameter(k, v) | |
| 113 | end | |
| 114 | end | |
| 115 | # post _resources = [ '/pat ient-searc h/global', | |
| 116 | # '/sy nc/expire' | |
| 117 | # ] | |
| 118 | # if r esource_di rectory_pa th.to_set. intersect? (post_reso urces.to_s et) | |
| 119 | # if r esource_di rectory_pa th.any? { |x| post_r esources.i nclude?(x) } | |
| 120 | if res ource_dire ctory_path .include?( '/patient- search/glo bal') | |
| 121 | retu rn HTTPart yWithBasic Auth.post_ with_autho rization(q uery.path) | |
| 122 | else | |
| 123 | retu rn HTTPart yWithBasic Auth.get_w ith_author ization(qu ery.path) | |
| 124 | end | |
| 125 | end | |
| 126 | ||
| 127 | def rdk_ fetch_post (resource_ directory_ path, parm s = nil) | |
| 128 | query = QueryGen ericRDK.ne w(resource _directory _path) | |
| 129 | unless parms.nil ? | |
| 130 | parm s.each do |k, v| | |
| 131 | # puts "<#{k }><#{v}>" | |
| 132 | qu ery.add_pa rameter(k, v) | |
| 133 | end | |
| 134 | end | |
| 135 | return HTTPartyW ithBasicAu th.post_wi th_authori zation(que ry.path) | |
| 136 | end | |
| 137 | end |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.