Produced by Araxis Merge on 10/4/2017 8:04:41 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\acceptance-tests\features\steps | tasks_steps.rb | Mon Aug 21 12:51:01 2017 UTC |
| 2 | rdk.zip\rdk\product\tests\acceptance-tests\features\steps | tasks_steps.rb | Tue Oct 3 17:27:36 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 328 |
| 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 | class Task Helper | |
| 2 | def self .formated_ today | |
| 3 | today = Date.tod ay.strftim e("%Y%m%d0 000") | |
| 4 | today | |
| 5 | end | |
| 6 | ||
| 7 | def self .formated_ future | |
| 8 | future = Date.to day.next_m onth(6).st rftime("%Y %m%d0000") | |
| 9 | future | |
| 10 | end | |
| 11 | ||
| 12 | def self .headers | |
| 13 | header s = {} | |
| 14 | header s['Content -Type'] = "applicati on/json" | |
| 15 | header s | |
| 16 | end | |
| 17 | end | |
| 18 | ||
| 19 | When(/^the client re quests tas ks instanc es for "([ ^"]*)" and "([^"]*)" $/) do |co ntext, sub context| | |
| 20 | request = RDKQuery .new('task s-tasks') | |
| 21 | today = TaskHelper .formated_ today | |
| 22 | enddate = TaskHelp er.formate d_future | |
| 23 | payload_ json = JSO N.parse(%Q [{"context ":"#{conte xt}","subC ontext":"# {subcontex t}","statu s":"Create d,Ready,Re served,InP rogress"," getNotific ations":tr ue,"startD ate":"#{to day}","end Date":"#{e nddate}"}] ).to_json | |
| 24 | ||
| 25 | path = r equest.pat h | |
| 26 | ||
| 27 | @respons e = HTTPar tyRDK.post (path, pay load_json, TaskHelpe r.headers) | |
| 28 | end | |
| 29 | ||
| 30 | When(/^the "([^"]*)" client re quests tas ks instanc es for "([ ^"]*)" and "([^"]*)" $/) do |us er, contex t, subcont ext| | |
| 31 | request = RDKQuery .new('task s-tasks') | |
| 32 | today = TaskHelper .formated_ today | |
| 33 | enddate = TaskHelp er.formate d_future | |
| 34 | payload_ json = JSO N.parse(%Q [{"context ":"#{conte xt}","subC ontext":"# {subcontex t}","statu s":"Create d,Ready,Re served,InP rogress"," getNotific ations":tr ue,"startD ate":"#{to day}","end Date":"#{e nddate}"}] ).to_json | |
| 35 | ||
| 36 | path = r equest.pat h | |
| 37 | ||
| 38 | @respons e = HTTPar tyRDK.post _as_user(p ath, user, TestClien ts.passwor d_for(user ), payload _json, Tas kHelper.he aders) | |
| 39 | end | |
| 40 | ||
| 41 | def reques t_task_ins tances(use r, context , subconte xt, patien tid) | |
| 42 | request = RDKQuery .new('task s-tasks') | |
| 43 | ||
| 44 | today = TaskHelper .formated_ today | |
| 45 | enddate = TaskHelp er.formate d_future | |
| 46 | payload_ json = JSO N.parse(%Q [{"context ":"#{conte xt}","pid" :"#{patien tid}","sub Context":" #{subconte xt}","stat us":"Creat ed,Ready,R eserved,In Progress", "getNotifi cations":t rue,"start Date":"#{t oday}","en dDate":"#{ enddate}"} ]).to_json | |
| 47 | ||
| 48 | path = r equest.pat h | |
| 49 | ||
| 50 | @respons e = HTTPar tyRDK.post _as_user(p ath, user, TestClien ts.passwor d_for(user ), payload _json, Tas kHelper.he aders) | |
| 51 | end | |
| 52 | ||
| 53 | When(/^the client re quests tas ks instanc es for "([ ^"]*)" and "([^"]*)" for patie nt "([^"]* )"$/) do | context, s ubcontext, patientid | | |
| 54 | request_ta sk_instanc es(" PW ", context , subconte xt, patien tid) | |
| 55 | end | |
| 56 | ||
| 57 | When(/^the "([^"]*)" client re quests tas ks instanc es for "([ ^"]*)" and "([^"]*)" for patie nt "([^"]* )"$/) do | user, cont ext, subco ntext, pat ientid| | |
| 58 | request_ task_insta nces(user, context, subcontext , patienti d) | |
| 59 | end | |
| 60 | ||
| 61 | Then(/^the response contains t asks$/) do | |
| 62 | json_obj ect = JSON .parse(@re sponse.bod y) | |
| 63 | p json_o bject['dat a']['items '].length | |
| 64 | expect(j son_object ['data'][' items'].le ngth).to b e > 0 | |
| 65 | end | |
| 66 | ||
| 67 | def reques t_all_task s | |
| 68 | context = 'user' | |
| 69 | subconte xt = 'team roles' | |
| 70 | patienti d = '9E7A; 100728' | |
| 71 | request = RDKQuery .new('task s-tasks') | |
| 72 | ||
| 73 | today = TaskHelper .formated_ today | |
| 74 | enddate = TaskHelp er.formate d_future | |
| 75 | payload_ json = JSO N.parse(%Q [{"context ":"#{conte xt}","pid" :"#{patien tid}","sub Context":" #{subconte xt}","stat us":"Creat ed,Ready,R eserved,In Progress", "getNotifi cations":t rue,"start Date":"#{t oday}","en dDate":"#{ enddate}"} ]).to_json | |
| 76 | ||
| 77 | path = r equest.pat h | |
| 78 | p path | |
| 79 | @respons e = HTTPar tyRDK.post (path, pay load_json, TaskHelpe r.headers) | |
| 80 | end | |
| 81 | ||
| 82 | Given(/^th ere is at least (\d+ ) task$/) do |arg1| | |
| 83 | request_ all_tasks | |
| 84 | expect(@ response.c ode).to eq (200) | |
| 85 | json_obj ect = JSON .parse(@re sponse.bod y) | |
| 86 | if json_ object['da ta']['item s'].length < 1 | |
| 87 | p 'no tasks!' | |
| 88 | step ' the client has the c urrent dep loymentid' | |
| 89 | pid = '9E7A;1007 28' | |
| 90 | reques t = RDKQue ry.new('ac tivities-s tart') | |
| 91 | path = request.p ath | |
| 92 | payloa d_json = s tart_activ ity_payloa d pid | |
| 93 | @respo nse = HTTP artyRDK.po st(path, p ayload_jso n, TaskHel per.header s) | |
| 94 | expect (@response .code).to eq(200) | |
| 95 | ||
| 96 | reques t_all_task s | |
| 97 | expect (@response .code).to eq(200) | |
| 98 | json_o bject = JS ON.parse(@ response.b ody) | |
| 99 | end | |
| 100 | p "numbe r of tasks #{json_ob ject['data ']['items' ].length}" | |
| 101 | expect(j son_object ['data'][' items'].le ngth).to b e >= arg1. to_i | |
| 102 | ||
| 103 | @last_ta sk_id = js on_object[ 'data']['i tems'].sor t { |l, r| l['TASKID '] <=> r[' TASKID'] } .last['TAS KID'] | |
| 104 | end | |
| 105 | ||
| 106 | When(/^the client re quests a s pecific ta sk$/) do | |
| 107 | request = RDKQuery .new('task s-gettask' ) | |
| 108 | request. add_parame ter('taski d', @last_ task_id.to _s) | |
| 109 | path = r equest.pat h | |
| 110 | @respons e = HTTPar tyRDK.get( path) | |
| 111 | end | |
| 112 | ||
| 113 | When(/^the client re quests a t ask by id$ /) do | |
| 114 | request = RDKQuery .new('task s-byid') | |
| 115 | request. add_parame ter('taski d', @last_ task_id.to _s) | |
| 116 | path = r equest.pat h | |
| 117 | @respons e = HTTPar tyRDK.get( path) | |
| 118 | end | |
| 119 | ||
| 120 | When(/^the client re quests ope n consults for pid " ([^"]*)"$/ ) do | pat ientid| | |
| 121 | request = RDKQuery .new('task s-opencons ults') | |
| 122 | request. add_parame ter('pid', patientid ) | |
| 123 | path = r equest.pat h | |
| 124 | ||
| 125 | @respons e = HTTPar tyRDK.get( path) | |
| 126 | end | |
| 127 | ||
| 128 | When(/^the client re quests the current t ask with t he process instance id$/) do | |
| 129 | request = RDKQuery .new('task s-current' ) | |
| 130 | payload_ json = JSO N.parse(%Q [{"process InstanceId ":#{@proce ssinstance id}}]).to_ json | |
| 131 | ||
| 132 | path = r equest.pat h | |
| 133 | ||
| 134 | @respons e = HTTPar tyRDK.post (path, pay load_json, TaskHelpe r.headers) | |
| 135 | end | |
| 136 | ||
| 137 | When(/^the client up dates a ta sk$/) do | |
| 138 | request = RDKQuery .new('task s-update') | |
| 139 | ||
| 140 | path = r equest.pat h | |
| 141 | payload_ json = JSO N.parse(%Q [{"deploym entId":"#{ @deploymen t_id}","pr ocessDefId ":"Order.R equest","p arameter": {"out_acti vity":{"de ploymentId ":"#{@depl oyment_id} ","process Definition Id":"Order .Request", "type":"Or der","doma in":"Reque st","proce ssInstance Id":"6347" ,"instance Name":"Tes tAddReques t 2016-08- 10 11:11:0 3","patien tUid":null ,"clinical ObjectUid" :null,"sou rceFacilit yId":"500" ,"destinat ionFacilit yId":null, "state":"a ccepted"," initiator" :"10000000 270","time Stamp":"", "urgency": 9,"assigne dTo":"9E7A ;100000002 70","activ ityHealthy ":null,"ac tivityHeal thDescript ion":null, "objectTyp e":"activi ty"},"out_ response": {"objectTy pe":"reque st","taskI nstanceId" :"6347","a ction":"Ma rk as Comp lete","ass ignTo":"", "submitted ByUid":"ur n:va:user: 9E7A:10000 000270","s ubmittedBy Name":"USE R,PANORAMA ","submitt edTimeStam p":"2016-0 8-10T19:50 :56.033Z", "route":{} ,"visit":{ "location" :"urn:va:l ocation:9E 7A:158","s erviceCate gory":"I", "dateTime" :"20090105 082020"}," earliestDa te":"20160 810040000" ,"latestDa te":"20160 910035959" },"out_for mAction":" start","ou t_action": "Mark as C omplete"}, "icn":"9E7 A;100728", "pid":"9E7 A;100728", "state":"s tart","tas kid":"#{@l ast_task_i d}"}]).to_ json | |
| 142 | ||
| 143 | @respons e = HTTPar tyRDK.post (path, pay load_json, TaskHelpe r.headers) | |
| 144 | end | |
| 145 | ||
| 146 | Then(/^pri nt respons e$/) do | |
| 147 | json_obj ect = JSON .parse(@re sponse.bod y) | |
| 148 | # p @res ponse.body | |
| 149 | p json_o bject | |
| 150 | # p json_ object['da ta']['item s'].length | |
| 151 | end | |
| 152 | ||
| 153 | Then(/^the response contains s ingle task data$/) d o | |
| 154 | json_obj ect = JSON .parse(@re sponse.bod y) | |
| 155 | begin | |
| 156 | length = json_ob ject['data ']['items' ].length | |
| 157 | return ed_id = js on_object[ 'data']['i tems'][0][ 'PROCESSIN STANCEID'] | |
| 158 | rescue = > e | |
| 159 | p "res ponse was not in exp ected form at #{json_ object}" | |
| 160 | raise e | |
| 161 | end | |
| 162 | ||
| 163 | expect(l ength).to eq(1) | |
| 164 | expect(r eturned_id ).to eq(@p rocessinst anceid.to_ i) | |
| 165 | end |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.