Produced by Araxis Merge on 10/3/2017 11:16:02 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 | ehmp.zip\ehmp\ehmp\product\production\vx-sync\tests\integrationtests\handlers\resync-request | load-patient-itest-spec.js | Mon Jul 10 17:46:22 2017 UTC |
| 2 | ehmp.zip\ehmp\ehmp\product\production\vx-sync\tests\integrationtests\handlers\resync-request | load-patient-itest-spec.js | Tue Oct 3 12:52:47 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 336 |
| Changed | 1 | 4 |
| 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 | 'use stric t'; | |
| 2 | ||
| 3 | require('. ./../../.. /env-setup '); | |
| 4 | ||
| 5 | var _ = re quire('und erscore'); | |
| 6 | var reques t = requir e('request '); | |
| 7 | var loadPa tient = re quire(glob al.VX_HAND LERS + 're sync-reque st/load-pa tient'); | |
| 8 | var JdsCli ent = requ ire(global .VX_SUBSYS TEMS + 'jd s/jds-clie nt'); | |
| 9 | var val = require(gl obal.VX_UT ILS + 'obj ect-utils' ).getPrope rty; | |
| 10 | var dummyL ogger = re quire(glob al.VX_DUMM IES + 'dum my-logger' ); | |
| 11 | ||
| 12 | // NOTE: b e sure nex t lines ar e commente d out befo re pushing | |
| 13 | // var log Util = req uire(globa l.VX_UTILS + 'log'); | |
| 14 | // dummyLo gger = log Util._crea teLogger({ | |
| 15 | // nam e: 'test', | |
| 16 | // lev el: 'debug ', | |
| 17 | // chi ld: logUti l._createL ogger | |
| 18 | // }); | |
| 19 | ||
| 20 | var wConfi g = requir e(global.V X_ROOT + ' worker-con fig'); | |
| 21 | ||
| 22 | var testCo nfig = req uire(globa l.VX_INTTE STS + 'tes t-config') ; | |
| 23 | var host = testConfi g.vxsyncIP ; | |
| 24 | var hostPo rt = testC onfig.vxsy ncPort; | |
| 25 | ||
| 26 | function c learTestPa tient(conf ig, patien tIdentifie rValue) { | |
| 27 | var co mpleted = false; | |
| 28 | var ac tualError, actualRes ponse; | |
| 29 | ||
| 30 | runs(f unction() { | |
| 31 | va r options = { | |
| 32 | url: con fig.protoc ol + '://' + config. host + ':' + config. port + con fig.patien tUnsyncPat h, | |
| 33 | method: 'POST', | |
| 34 | qs: { | |
| 35 | pid: patientId entifierVa lue | |
| 36 | } | |
| 37 | }; | |
| 38 | ||
| 39 | re quest.post (options, function(e rror, resp onse) { | |
| 40 | actualEr ror = erro r; | |
| 41 | actualRe sponse = r esponse; | |
| 42 | complete d = true; | |
| 43 | }) ; | |
| 44 | }); | |
| 45 | ||
| 46 | waitsF or(functio n() { | |
| 47 | re turn compl eted; | |
| 48 | }, 'Ti med out wa iting for patient to clear.', 20000); | |
| 49 | ||
| 50 | runs(f unction() { | |
| 51 | ex pect(actua lError).to BeFalsy(); | |
| 52 | ex pect(actua lResponse) .toBeTruth y(); | |
| 53 | }); | |
| 54 | } | |
| 55 | ||
| 56 | function r etrieveSyn cStatus(pa tientIdent ifier, env ironment, callback) { | |
| 57 | enviro nment.jds. getSyncSta tus(patien tIdentifie r, functio n(error, r esponse) { | |
| 58 | ca llback(err or, respon se.statusC ode); | |
| 59 | }); | |
| 60 | } | |
| 61 | ||
| 62 | function r etrieveEnt erpriseSyn cJobHistor y(patientI dentifier, environme nt, callba ck) { | |
| 63 | var jo b = { | |
| 64 | pa tientIdent ifier: pat ientIdenti fier | |
| 65 | }; | |
| 66 | ||
| 67 | var fi lter = { | |
| 68 | fi lter: '?fi lter=eq(\" type\",\"e nterprise- sync-reque st\")' | |
| 69 | }; | |
| 70 | ||
| 71 | enviro nment.jds. getJobStat us(job, fi lter, func tion(error , response , result) { | |
| 72 | ca llback(err or, respon se, result ); | |
| 73 | }); | |
| 74 | } | |
| 75 | ||
| 76 | describe(' load-patie nt', funct ion() { | |
| 77 | descri be('When l oad-patien t is calle d', functi on() { | |
| 78 | va r config, environmen t; | |
| 79 | ||
| 80 | be foreEach(f unction() { | |
| 81 | config = { | |
| 82 | retr ySync: { | |
| 83 | maxRetries : 3 | |
| 84 | }, | |
| 85 | sync RequestApi : { | |
| 86 | protocol: 'http', | |
| 87 | host: host , | |
| 88 | port: host Port, | |
| 89 | patientSyn cPath: '/s ync/doLoad ', | |
| 90 | patientUns yncPath: ' /sync/clea rPatient', | |
| 91 | patientSta tusPath: ' /sync/stat us', | |
| 92 | patientSyn cDemoPath: '/sync/de mographicS ync', | |
| 93 | method: 'P OST' | |
| 94 | }, | |
| 95 | vist aSites: { | |
| 96 | '9E7A': {} , | |
| 97 | 'C877': {} | |
| 98 | }, | |
| 99 | jds: _.default s(wConfig. jds, { | |
| 100 | protocol: 'http', | |
| 101 | host: ' IP ', | |
| 102 | port: PORT | |
| 103 | }) | |
| 104 | }; | |
| 105 | ||
| 106 | environm ent = { | |
| 107 | metr ics: dummy Logger, | |
| 108 | jds: new JdsCl ient(dummy Logger, du mmyLogger, config) | |
| 109 | }; | |
| 110 | ||
| 111 | clearTes tPatient(c onfig.sync RequestApi , '9E7A;23 '); | |
| 112 | }) ; | |
| 113 | ||
| 114 | ||
| 115 | it ('then a s ync reques t is sent' , function () { | |
| 116 | var job = { | |
| 117 | type : 'resync- request', | |
| 118 | pati entIdentif ier: { | |
| 119 | type: 'pid ', | |
| 120 | value: '9E 7A;23' | |
| 121 | }, | |
| 122 | root JobId: '1' , | |
| 123 | jobI d: '1', | |
| 124 | refe renceInfo: { | |
| 125 | 'sessionId ': 'Test s ession', | |
| 126 | 'requestId ': 'Test r equest' | |
| 127 | } | |
| 128 | }; | |
| 129 | var comp leted = fa lse; | |
| 130 | var actu alError, a ctualSyncS tatus; | |
| 131 | ||
| 132 | loadPati ent(dummyL ogger, con fig.syncRe questApi, job, funct ion(error) { | |
| 133 | actu alError = error; | |
| 134 | retr ieveSyncSt atus(job.p atientIden tifier, en vironment, function( error, syn cStatus) { | |
| 135 | actualErro r = error; | |
| 136 | actualSync Status = s yncStatus; | |
| 137 | completed = true; | |
| 138 | }); | |
| 139 | }); | |
| 140 | ||
| 141 | waitsFor (function( ) { | |
| 142 | retu rn complet ed; | |
| 143 | }, 'resp onse from demographi cs sync ti med out.', 20000); | |
| 144 | ||
| 145 | var getJ obComplete = false; | |
| 146 | ||
| 147 | runs(fun ction() { | |
| 148 | expe ct(actualE rror).toBe Falsy(); | |
| 149 | expe ct(actualS yncStatus) .toBe(200) ; | |
| 150 | ||
| 151 | //Ve rify refer enceInfo w as passed into enter prise-sync -request | |
| 152 | retr ieveEnterp riseSyncJo bHistory(j ob.patient Identifier , environm ent, funct ion(error, response, result) { | |
| 153 | expect(err or).toBeFa lsy(); | |
| 154 | expect(res ponse).toB eTruthy(); | |
| 155 | expect(res ponse.mess age).toBeF alsy(); | |
| 156 | expect(val (result, [ 'items', ' 0', 'refer enceInfo'] )).toEqual (jasmine.o bjectConta ining({ | |
| 157 | 'sessi onId': 'Te st session ', | |
| 158 | 'reque stId': 'Te st request ' | |
| 159 | })); | |
| 160 | getJobComp lete = tru e; | |
| 161 | }); | |
| 162 | }); | |
| 163 | ||
| 164 | waitsFor (function( ) { | |
| 165 | retu rn getJobC omplete; | |
| 166 | }, 'wait ing for en terprise s ync job', 20000); | |
| 167 | ||
| 168 | }) ; | |
| 169 | }); | |
| 170 | }); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.