Produced by Araxis Merge on 10/3/2017 11:16:01 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 | demographics-sync-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 | demographics-sync-itest-spec.js | Tue Oct 3 12:52:29 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 378 |
| 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 demogr aphicsSync = require (global.VX _HANDLERS + 'resync- request/de mographics -sync'); | |
| 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(' demographi cs-sync', function() { | |
| 77 | descri be('When a demograph ics sync r equest is made', fun ction() { | |
| 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;3' ); | |
| 112 | }) ; | |
| 113 | ||
| 114 | ||
| 115 | it ('then the patient i s synced', function( ) { | |
| 116 | var job = { | |
| 117 | type : 'resync- request', | |
| 118 | pati entIdentif ier: { | |
| 119 | type: 'icn ', | |
| 120 | value: '10 108V420871 ' | |
| 121 | }, | |
| 122 | root JobId: '1' , | |
| 123 | jobI d: '1', | |
| 124 | demo graphics: { | |
| 125 | "birthDate ": "193504 07", | |
| 126 | "displayNa me": "Eigh t,Patient" , | |
| 127 | "familyNam e": "EIGHT ", | |
| 128 | "fullName" : "EIGHT,P ATIENT", | |
| 129 | "genderCod e": "urn:v a:pat-gend er:M", | |
| 130 | "genderNam e": "Male" , | |
| 131 | "givenName s": "PATIE NT", | |
| 132 | "icn": "10 108V420871 ", | |
| 133 | "last4": " 0008", | |
| 134 | "last5": " E0008", | |
| 135 | "lastUpdat eTime": 20 1602221554 13, | |
| 136 | "localId": "3", | |
| 137 | "lrdfn": " 27", | |
| 138 | "maritalSt atusCode": "urn:va:p at-marital Status:M", | |
| 139 | "maritalSt atusName": "Married" , | |
| 140 | "pid": "29 39;19", | |
| 141 | "ssn": "66 6000008", | |
| 142 | "uid": "ur n:va:patie nt:2939:19 :19", | |
| 143 | "veteran": true | |
| 144 | }, | |
| 145 | refe renceInfo: { | |
| 146 | 'sessionId ': 'Test s ession', | |
| 147 | 'requestId ': 'Test r equest' | |
| 148 | } | |
| 149 | }; | |
| 150 | var comp leted = fa lse; | |
| 151 | var actu alError, a ctualSyncS tatus; | |
| 152 | ||
| 153 | demograp hicsSync(d ummyLogger , config.s yncRequest Api, job, function(e rror) { | |
| 154 | actu alError = error; | |
| 155 | retr ieveSyncSt atus(job.p atientIden tifier, en vironment, function( error, syn cStatus) { | |
| 156 | actualErro r = error; | |
| 157 | actualSync Status = s yncStatus; | |
| 158 | completed = true; | |
| 159 | }); | |
| 160 | }); | |
| 161 | ||
| 162 | waitsFor (function( ) { | |
| 163 | retu rn complet ed; | |
| 164 | }, 'resp onse from demographi cs sync ti med out.', 20000); | |
| 165 | ||
| 166 | var getJ obComplete = false; | |
| 167 | ||
| 168 | runs(fun ction() { | |
| 169 | expe ct(actualE rror).toBe Falsy(); | |
| 170 | expe ct(actualS yncStatus) .toBe(200) ; | |
| 171 | ||
| 172 | //Ve rify refer enceInfo w as passed into enter prise-sync -request | |
| 173 | retr ieveEnterp riseSyncJo bHistory(j ob.patient Identifier , environm ent, funct ion(error, response, result){ | |
| 174 | expect(err or).toBeFa lsy(); | |
| 175 | expect(res ponse).toB eTruthy(); | |
| 176 | expect(res ponse.mess age).toBeF alsy(); | |
| 177 | expect(val (result, [ 'items','0 ', 'refere nceInfo']) ).toEqual( jasmine.ob jectContai ning({ | |
| 178 | 'sessi onId': 'Te st session ', | |
| 179 | 'reque stId': 'Te st request ' | |
| 180 | })); | |
| 181 | getJobComp lete = tru e; | |
| 182 | }); | |
| 183 | }); | |
| 184 | ||
| 185 | waitsFor (function( ) { | |
| 186 | retu rn getJobC omplete; | |
| 187 | }, 'wait ing for en terprise s ync job', 20000); | |
| 188 | ||
| 189 | }) ; | |
| 190 | }); | |
| 191 | }); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.