Produced by Araxis Merge on 10/3/2017 11:16:04 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\unittests\utils\resync | patient-id-comparator-spec.js | Tue Jan 10 16:20:50 2017 UTC |
| 2 | ehmp.zip\ehmp\ehmp\product\production\vx-sync\tests\unittests\utils\resync | patient-id-comparator-spec.js | Tue Oct 3 13:24:37 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 4 | 1026 |
| Changed | 3 | 20 |
| 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 | require('. ./../../.. /env-setup '); | |
| 3 | var patIdC ompareUtil = require (global.VX _UTILS + ' resync/pat ient-id-co mparator') ; | |
| 4 | var JdsCli entDummy = require(g lobal.VX_D UMMIES + ' jds-client -dummy'); | |
| 5 | var jobUti l = requir e(global.V X_UTILS + 'job-utils '); | |
| 6 | var Publis herRouterD ummy = req uire(globa l.VX_DUMMI ES + 'publ isherRoute rDummy'); | |
| 7 | var Publis herDummy = require(g lobal.VX_D UMMIES + ' publisherD ummy'); | |
| 8 | ||
| 9 | ||
| 10 | //-------- ---------- ---------- ---------- ---------- ---------- ---- | |
| 11 | // Uncomme nt the fol lowing to see the lo gging out on the scr een. | |
| 12 | //-------- ---------- ---------- ---------- ---------- ---------- ---- | |
| 13 | /* | |
| 14 | var log = require('b unyan').cr eateLogger ({ | |
| 15 | name : 'patient -id-compar ator', | |
| 16 | leve l: 'debug' | |
| 17 | }); | |
| 18 | */ | |
| 19 | // this sh ould be in productio n code. | |
| 20 | var log = require(gl obal.VX_DU MMIES + 'd ummy-logge r'); | |
| 21 | ||
| 22 | var hmpSer ver = 'The HmpServer' ; | |
| 23 | var reques tJob= { jp id:'000000 00-0000-00 00-0000-00 0000000000 ', | |
| 24 | requ estJob: { | |
| 25 | patientIde ntifier:{ | |
| 26 | 'type' : 'pid', | |
| 27 | 'value ': '9E7A;3 ' } | |
| 28 | } | |
| 29 | }; | |
| 30 | var job = jobUtil.cr eateEnterp riseSyncRe quest(requ estJob.req uestJob.pa tientIdent ifier, req uestJob.jp id, reques tJob.force ); | |
| 31 | job.jo bId = 1; | |
| 32 | ||
| 33 | var config = { | |
| 34 | jds: { | |
| 35 | pr otocol: 'h ttp', | |
| 36 | host: ' IP ', | |
| 37 | port: PORT | |
| 38 | }, | |
| 39 | 'vista Sites': { | |
| 40 | '9 E7A': { | |
| 41 | 'name': 'panorama' , | |
| 42 | 'host': ' IP ', | |
| 43 | 'port': PORT , | |
| 44 | 'accessCod e': ' REDACT ', | |
| 45 | 'verifyCod e': ' REDACTED ', | |
| 46 | 'localIP ': '127.0. 0.1', | |
| 47 | 'localAd dress': 'l ocalhost', | |
| 48 | 'connect Timeout': 3000, | |
| 49 | 'sendTim eout': 100 00 | |
| 50 | }, | |
| 51 | 'C 877': { | |
| 52 | 'name': 'kodak', | |
| 53 | 'host': ' IP ', | |
| 54 | 'port': PORT , | |
| 55 | 'accessCod e': ' REDACT ', | |
| 56 | 'verifyCod e': ' REDACTED ', | |
| 57 | 'localIP ': '127.0. 0.1', | |
| 58 | 'localAd dress': 'l ocalhost', | |
| 59 | 'connect Timeout': 3000, | |
| 60 | 'sendTim eout': 100 00 | |
| 61 | } | |
| 62 | }, | |
| 63 | 'hmp.s erver.id': hmpServer , | |
| 64 | 'hmp.v ersion': ' 0.7-S65', | |
| 65 | 'hmp.b atch.size' : '1000', | |
| 66 | 'hmp.e xtract.sch ema': '3.0 01', | |
| 67 | 'hdr': { | |
| 68 | 'o perationMo de': 'REQ/ RES' | |
| 69 | } | |
| 70 | }; | |
| 71 | ||
| 72 | var demogr aphicsFrom Vista = { | |
| 73 | 'pid': '9E7A;3', | |
| 74 | 'birth Date': '19 350407', | |
| 75 | 'last4 ': '0008', | |
| 76 | 'last5 ': 'E0008' , | |
| 77 | 'icn': '10108V42 0871', | |
| 78 | 'famil yName': 'E IGHT', | |
| 79 | 'given Names': 'P ATIENT', | |
| 80 | 'fullN ame': 'EIG HT,PATIENT ', | |
| 81 | 'displ ayName': ' Eight,Pati ent', | |
| 82 | 'gende rCode': 'u rn:va:pat- gender:M', | |
| 83 | 'gende rName': 'M ale', | |
| 84 | 'sensi tive': fal se, | |
| 85 | 'uid': 'urn:va:p atient:9E7 A:3:3', | |
| 86 | 'summa ry': 'Eigh t,Patient' , | |
| 87 | 'ssn': '66600000 8', | |
| 88 | 'local Id': '3' | |
| 89 | }; | |
| 90 | ||
| 91 | ||
| 92 | ||
| 93 | ||
| 94 | //-------- ---------- ---------- ---------- ---------- ---------- ---------- - | |
| 95 | // Create an instanc e of the e nvironment variable. | |
| 96 | //-------- ---------- ---------- ---------- ---------- ---------- ---------- - | |
| 97 | function c reateEnvir onment(vis taClient, config) { | |
| 98 | var pu blisherRou terDummy = new Publi sherRouter Dummy(log, config, P ublisherDu mmy); | |
| 99 | var jd sClient = new JdsCli entDummy(l og, config ); | |
| 100 | var en vironment = { | |
| 101 | jd s: jdsClie nt, | |
| 102 | pu blisherRou ter: publi sherRouter Dummy, | |
| 103 | mv i: { looku p : jasmin e.createSp y().andCal lFake(mviL ookup) }, | |
| 104 | vi staClient: {} | |
| 105 | }; | |
| 106 | ||
| 107 | if (vi staClient) { | |
| 108 | en vironment. vistaClien t = vistaC lient; | |
| 109 | } | |
| 110 | ||
| 111 | spyOn( environmen t.publishe rRouter, ' publish'). andCallThr ough(); | |
| 112 | ||
| 113 | return environme nt; | |
| 114 | } | |
| 115 | //mock mvi results t o return | |
| 116 | var pidsFr omMvi = [{ type: 'icn ', value:' 10108V4208 71'}, | |
| 117 | {type: ' pid', valu e:'2939;19 '}, | |
| 118 | {type: ' HDR', valu e:'HDR;101 08V420871' }, | |
| 119 | {type: ' VLER', val ue:'VLER;1 0108V42087 1'}, | |
| 120 | {type: ' VHICID', v alue:'VHIC ID;10108V4 20871'}, | |
| 121 | {type: ' pid', valu e:'FFC7;28 '}, | |
| 122 | {type: ' pid', valu e:'9E7A;3' }, | |
| 123 | {type: ' edipi', va lue:'DOD;1 1223344'}, | |
| 124 | {type: ' dfn', valu e:'dfn;998 87766'}]; | |
| 125 | ||
| 126 | //mock mvi results | |
| 127 | function m viLookup(p atientIden tifier, ca llback) { | |
| 128 | return callback( null, pids FromMvi); | |
| 129 | } | |
| 130 | ||
| 131 | describe(' patient-id -comparato r.js', fun ction() { | |
| 132 | descri be('JDS re turns an e rror', fun ction() { | |
| 133 | it ('verify P atient Ide ntifier do es not req uest a res ync', func tion() { | |
| 134 | var vist aClient = { | |
| 135 | getD emographic s: functio n(vistaId, dfn, call back) { | |
| 136 | return cal lback(null , demograp hicsFromVi sta); | |
| 137 | } | |
| 138 | }; | |
| 139 | var envi ronment = createEnvi ronment(vi staClient, config); | |
| 140 | var expe ctedJdsErr or = [null , null]; | |
| 141 | var expe ctedJdsRes ponse = [{ statusCode : 500}]; | |
| 142 | var expe ctedJdsRes ult = { | |
| 143 | patientIde ntifiers: [] | |
| 144 | }; | |
| 145 | environm ent.jds._s etResponse Data(expec tedJdsErro r, expecte dJdsRespon se, expect edJdsResul t); | |
| 146 | ||
| 147 | var call back = jas mine.creat eSpy(); | |
| 148 | patIdCom pareUtil.d etectAndRe sync(log, environmen t, job, nu ll ,callba ck); | |
| 149 | ||
| 150 | waitsFor (function( ) { | |
| 151 | retu rn callbac k.callCoun t > 0; | |
| 152 | }, 'The call timed out.', 50 00); | |
| 153 | ||
| 154 | runs(fun ction() { | |
| 155 | expe ct(callbac k).toHaveB eenCalled( ); | |
| 156 | expe ct(environ ment.publi sherRouter .publish). not.toHave BeenCalled (); | |
| 157 | }); | |
| 158 | }) ; | |
| 159 | }); | |
| 160 | ||
| 161 | descri be('JDS ID list is e mpty patie nt Does No t need a r esync', fu nction() { | |
| 162 | it ('verify P atient Ide ntifier do es not req uire a res ync', func tion() { | |
| 163 | var vist aClient = { | |
| 164 | getD emographic s: functio n(vistaId, dfn, call back) { | |
| 165 | return cal lback(null , demograp hicsFromVi sta); | |
| 166 | } | |
| 167 | }; | |
| 168 | var envi ronment = createEnvi ronment(vi staClient, config); | |
| 169 | var expe ctedJdsErr or = [null , null]; | |
| 170 | var expe ctedJdsRes ponse = [{ statusCode : 200}]; | |
| 171 | var expe ctedJdsRes ult = { | |
| 172 | pati entIdentif iers: [] | |
| 173 | }; | |
| 174 | environm ent.jds._s etResponse Data(expec tedJdsErro r, expecte dJdsRespon se, expect edJdsResul t); | |
| 175 | ||
| 176 | var call back = jas mine.creat eSpy(); | |
| 177 | patIdCom pareUtil.d etectAndRe sync(log, environmen t, job, nu ll,callbac k); | |
| 178 | ||
| 179 | waitsFor (function( ) { | |
| 180 | retu rn callbac k.callCoun t > 0; | |
| 181 | }, 'The call timed out.', 50 00); | |
| 182 | ||
| 183 | runs(fun ction() { | |
| 184 | expe ct(callbac k).toHaveB eenCalled( ); | |
| 185 | expe ct(callbac k).toHaveB eenCalledW ith(null, 'NA'); | |
| 186 | expe ct(environ ment.publi sherRouter .publish). not.toHave BeenCalled (); | |
| 187 | }); | |
| 188 | }) ; | |
| 189 | }); | |
| 190 | ||
| 191 | ||
| 192 | //======== ========== === all th e test bel ow are don e with a n on null Mv iResult == ========== ========== ========= | |
| 193 | ||
| 194 | descri be('JDS re turns an e rror', fun ction() { | |
| 195 | it ('verify P atient Ide ntifier do es not req uest a res ync', func tion() { | |
| 196 | var vist aClient = { | |
| 197 | getD emographic s: functio n(vistaId, dfn, call back) { | |
| 198 | return cal lback(null , demograp hicsFromVi sta); | |
| 199 | } | |
| 200 | }; | |
| 201 | var envi ronment = createEnvi ronment(vi staClient, config); | |
| 202 | var expe ctedJdsErr or = [null , null]; | |
| 203 | var expe ctedJdsRes ponse = [{ statusCode : 500}]; | |
| 204 | var expe ctedJdsRes ult = { | |
| 205 | patientIde ntifiers: [] | |
| 206 | }; | |
| 207 | environm ent.jds._s etResponse Data(expec tedJdsErro r, expecte dJdsRespon se, expect edJdsResul t); | |
| 208 | ||
| 209 | var call back = jas mine.creat eSpy(); | |
| 210 | patIdCom pareUtil.d etectAndRe sync(log, environmen t, job, pi dsFromMvi, callback); | |
| 211 | ||
| 212 | waitsFor (function( ) { | |
| 213 | retu rn callbac k.callCoun t > 0; | |
| 214 | }, 'The call timed out.', 50 00); | |
| 215 | ||
| 216 | runs(fun ction() { | |
| 217 | expe ct(callbac k).toHaveB eenCalled( ); | |
| 218 | expe ct(environ ment.publi sherRouter .publish). not.toHave BeenCalled (); | |
| 219 | }); | |
| 220 | }) ; | |
| 221 | }); | |
| 222 | ||
| 223 | descri be('JDS ID list is e mpty patie nt Does No t need a r esync', fu nction() { | |
| 224 | it ('verify P atient Ide ntifier do es not req uire a res ync', func tion() { | |
| 225 | var vist aClient = { | |
| 226 | getD emographic s: functio n(vistaId, dfn, call back) { | |
| 227 | return cal lback(null , demograp hicsFromVi sta); | |
| 228 | } | |
| 229 | }; | |
| 230 | var envi ronment = createEnvi ronment(vi staClient, config); | |
| 231 | var expe ctedJdsErr or = [null , null]; | |
| 232 | var expe ctedJdsRes ponse = [{ statusCode : 200}]; | |
| 233 | var expe ctedJdsRes ult = { | |
| 234 | pati entIdentif iers: [] | |
| 235 | }; | |
| 236 | environm ent.jds._s etResponse Data(expec tedJdsErro r, expecte dJdsRespon se, expect edJdsResul t); | |
| 237 | ||
| 238 | var call back = jas mine.creat eSpy(); | |
| 239 | patIdCom pareUtil.d etectAndRe sync(log, environmen t, job, pi dsFromMvi, callback); | |
| 240 | ||
| 241 | waitsFor (function( ) { | |
| 242 | retu rn callbac k.callCoun t > 0; | |
| 243 | }, 'The call timed out.', 50 00); | |
| 244 | ||
| 245 | runs(fun ction() { | |
| 246 | expe ct(callbac k).toHaveB eenCalled( ); | |
| 247 | expe ct(callbac k).toHaveB eenCalledW ith(null, 'NA'); | |
| 248 | expe ct(environ ment.publi sherRouter .publish). not.toHave BeenCalled (); | |
| 249 | }); | |
| 250 | }) ; | |
| 251 | }); | |
| 252 | ||
| 253 | descri be('patien t Does Not need a re sync becau se JDS and MVI patie nt id list s are the same', fun ction() { | |
| 254 | it ('verify P atient Ide ntifier do es not req uire a res ync', func tion() { | |
| 255 | var vist aClient = { | |
| 256 | getD emographic s: functio n(vistaId, dfn, call back) { | |
| 257 | return cal lback(null , demograp hicsFromVi sta); | |
| 258 | } | |
| 259 | }; | |
| 260 | var envi ronment = createEnvi ronment(vi staClient, config); | |
| 261 | var expe ctedJdsErr or = [null , null]; | |
| 262 | var expe ctedJdsRes ponse = [{ statusCode : 200},{st atusCode: 200}]; | |
| 263 | var expe ctedJdsRes ult = [{ | |
| 264 | patientIde ntifiers: [ | |
| 265 | '10108 V420871', | |
| 266 | 'HDR;1 0108V42087 1', | |
| 267 | '2939; 19', | |
| 268 | '9E7A; 3', | |
| 269 | 'FFC7; 28', | |
| 270 | 'DOD;1 1223344', | |
| 271 | 'dfn;9 9887766'] | |
| 272 | },{}]; | |
| 273 | environm ent.jds._s etResponse Data(expec tedJdsErro r, expecte dJdsRespon se, expect edJdsResul t); | |
| 274 | ||
| 275 | var call back = jas mine.creat eSpy(); | |
| 276 | patIdCom pareUtil.d etectAndRe sync(log, environmen t, job, p idsFromMvi , callback ); | |
| 277 | ||
| 278 | waitsFor (function( ) { | |
| 279 | retu rn callbac k.callCoun t > 0; | |
| 280 | }, 'The call timed out.', 50 00); | |
| 281 | ||
| 282 | runs(fun ction() { | |
| 283 | expe ct(callbac k).toHaveB eenCalled( ); | |
| 284 | expe ct(environ ment.publi sherRouter .publish). not.toHave BeenCalled (); | |
| 285 | }); | |
| 286 | }) ; | |
| 287 | }); | |
| 288 | ||
| 289 | descri be('patien t Does nee d a resync because J DS Patient list has an id not in MVI', f unction() { | |
| 290 | it ('verify P atient Ide ntifier do es require a resync' , function () { | |
| 291 | var vist aClient = { | |
| 292 | getD emographic s: functio n(vistaId, dfn, call back) { | |
| 293 | return cal lback(null , demograp hicsFromVi sta); | |
| 294 | } | |
| 295 | }; | |
| 296 | var envi ronment = createEnvi ronment(vi staClient, config); | |
| 297 | var expe ctedJdsErr or = [null , null]; | |
| 298 | var expe ctedJdsRes ponse = [{ statusCode : 200}, {s tatusCode: 200}]; | |
| 299 | var expe ctedJdsRes ult = [{ | |
| 300 | patientIde ntifiers: [ | |
| 301 | '10108 V420871', | |
| 302 | '2939; 19', | |
| 303 | '9E7A; 3', | |
| 304 | 'C877; 77', //*n ot in MVI | |
| 305 | 'FFC7; 28'] | |
| 306 | }, {}] ; | |
| 307 | environm ent.jds._s etResponse Data(expec tedJdsErro r, expecte dJdsRespon se, expect edJdsResul t); | |
| 308 | var call back = jas mine.creat eSpy(); | |
| 309 | patIdCom pareUtil.d etectAndRe sync(log, environmen t, job, pi dsFromMvi, callback) ; | |
| 310 | ||
| 311 | waitsFor (function( ) { | |
| 312 | retu rn callbac k.callCoun t > 0; | |
| 313 | }, 'The call timed out.', 50 00); | |
| 314 | ||
| 315 | runs(fun ction() { | |
| 316 | expe ct(callbac k).toHaveB eenCalled( ); | |
| 317 | expe ct(environ ment.publi sherRouter .publish). toHaveBeen Called(); | |
| 318 | }); | |
| 319 | ||
| 320 | }) ; | |
| 321 | }); | |
| 322 | ||
| 323 | descri be('patien t Does Not need a re sync, JDS is missing an ID(s) that is in MVI', fun ction() { | |
| 324 | it ('verify P atient Ide ntifier do es not req uire a res ync', func tion() { | |
| 325 | var vist aClient = { | |
| 326 | getD emographic s: functio n(vistaId, dfn, call back) { | |
| 327 | return cal lback(null , demograp hicsFromVi sta); | |
| 328 | } | |
| 329 | }; | |
| 330 | var envi ronment = createEnvi ronment(vi staClient, config); | |
| 331 | var expe ctedJdsErr or = [null , null]; | |
| 332 | var expe ctedJdsRes ponse = [{ statusCode : 200}, {s tatusCode: 200}]; | |
| 333 | var expe ctedJdsRes ult = [{ | |
| 334 | patientIde ntifiers: [ | |
| 335 | '10108 V420871', | |
| 336 | '2939; 19', | |
| 337 | '9E7A; 3'] | |
| 338 | }, {}] ; | |
| 339 | environm ent.jds._s etResponse Data(expec tedJdsErro r, expecte dJdsRespon se, expect edJdsResul t); | |
| 340 | ||
| 341 | var call back = jas mine.creat eSpy(); | |
| 342 | patIdCom pareUtil.d etectAndRe sync(log, environmen t, job, pi dsFromMvi, callback) ; | |
| 343 | ||
| 344 | waitsFor (function( ) { | |
| 345 | retu rn callbac k.callCoun t > 0; | |
| 346 | }, 'The call timed out.', 50 00); | |
| 347 | ||
| 348 | runs(fun ction() { | |
| 349 | expe ct(callbac k).toHaveB eenCalled( ); | |
| 350 | expe ct(environ ment.publi sherRouter .publish). not.toHave BeenCalled (); | |
| 351 | }); | |
| 352 | }) ; | |
| 353 | }); | |
| 354 | ||
| 355 | // *** ********** ********** ********** ********** ********** ** | |
| 356 | descri be('patien t Does nee d a resync because I CN value i s differen t ', funct ion() { | |
| 357 | it ('verify P atient Ide ntifier do es require a resync' , function () { | |
| 358 | var vist aClient = { | |
| 359 | getD emographic s: functio n(vistaId, dfn, call back) { | |
| 360 | return cal lback(null , demograp hicsFromVi sta); | |
| 361 | } | |
| 362 | }; | |
| 363 | var envi ronment = createEnvi ronment(vi staClient, config); | |
| 364 | var expe ctedJdsErr or = [null , null]; | |
| 365 | var expe ctedJdsRes ponse = [{ statusCode : 200},{st atusCode: 200}]; | |
| 366 | var expe ctedJdsRes ult = [{ | |
| 367 | patientIde ntifiers: [ | |
| 368 | '10108 V420872', | |
| 369 | '2939; 19', | |
| 370 | '9E7A; 3', | |
| 371 | 'FFC7; 28', | |
| 372 | 'DOD;1 1223344'] | |
| 373 | }, {}] ; | |
| 374 | environm ent.jds._s etResponse Data(expec tedJdsErro r, expecte dJdsRespon se, expect edJdsResul t); | |
| 375 | var call back = jas mine.creat eSpy(); | |
| 376 | patIdCom pareUtil.d etectAndRe sync(log, environmen t, job, pi dsFromMvi, callback) ; | |
| 377 | ||
| 378 | waitsFor (function( ) { | |
| 379 | retu rn callbac k.callCoun t > 0; | |
| 380 | }, 'The call timed out.', 50 00); | |
| 381 | ||
| 382 | runs(fun ction() { | |
| 383 | expe ct(callbac k).toHaveB eenCalled( ); | |
| 384 | expe ct(environ ment.publi sherRouter .publish). toHaveBeen Called(); | |
| 385 | }); | |
| 386 | }) ; | |
| 387 | }); | |
| 388 | ||
| 389 | // *** ********** ********** ********** ********** ********** ** | |
| 390 | descri be('patien t Does nee d a resync because E DIPI value is differ ent ', fun ction() { | |
| 391 | it ('verify P atient Ide ntifier do es require a resync' , function () { | |
| 392 | var vist aClient = { | |
| 393 | getD emographic s: functio n(vistaId, dfn, call back) { | |
| 394 | return cal lback(null , demograp hicsFromVi sta); | |
| 395 | } | |
| 396 | }; | |
| 397 | var envi ronment = createEnvi ronment(vi staClient, config); | |
| 398 | var expe ctedJdsErr or = [null , null]; | |
| 399 | var expe ctedJdsRes ponse = [{ statusCode : 200},{st atusCode: 200}]; | |
| 400 | var expe ctedJdsRes ult = [{ | |
| 401 | patientIde ntifiers: [ | |
| 402 | '10108 V420871', | |
| 403 | '2939; 19', | |
| 404 | '9E7A; 3', | |
| 405 | 'FFC7; 28', | |
| 406 | 'DOD;1 1223355'] | |
| 407 | },{}]; | |
| 408 | environm ent.jds._s etResponse Data(expec tedJdsErro r, expecte dJdsRespon se, expect edJdsResul t); | |
| 409 | var call back = jas mine.creat eSpy(); | |
| 410 | patIdCom pareUtil.d etectAndRe sync(log, environmen t, job, pi dsFromMvi, callback) ; | |
| 411 | ||
| 412 | waitsFor (function( ) { | |
| 413 | retu rn callbac k.callCoun t > 0; | |
| 414 | }, 'The call timed out.', 50 00); | |
| 415 | ||
| 416 | runs(fun ction() { | |
| 417 | expe ct(callbac k).toHaveB eenCalled( ); | |
| 418 | expe ct(environ ment.publi sherRouter .publish). toHaveBeen Called(); | |
| 419 | }); | |
| 420 | }) ; | |
| 421 | }); | |
| 422 | ||
| 423 | // *** ********** ********** ********** ********** ********** ** | |
| 424 | descri be('patien t Does nee d a resync because P ID value i s differen t ', funct ion() { | |
| 425 | it ('verify P atient Ide ntifier do es require a resync' , function () { | |
| 426 | var vist aClient = { | |
| 427 | getD emographic s: functio n(vistaId, dfn, call back) { | |
| 428 | return cal lback(null , demograp hicsFromVi sta); | |
| 429 | } | |
| 430 | }; | |
| 431 | var envi ronment = createEnvi ronment(vi staClient, config); | |
| 432 | var expe ctedJdsErr or = [null , null]; | |
| 433 | var expe ctedJdsRes ponse = [{ statusCode : 200},{st atusCode: 200}]; | |
| 434 | var expe ctedJdsRes ult = [{ | |
| 435 | patientIde ntifiers: [ | |
| 436 | '10108 V420871', | |
| 437 | '2939; 19', | |
| 438 | '9E7A; 3', | |
| 439 | 'FFC7; 82'] //di fferent | |
| 440 | },{}]; | |
| 441 | environm ent.jds._s etResponse Data(expec tedJdsErro r, expecte dJdsRespon se, expect edJdsResul t); | |
| 442 | var call back = jas mine.creat eSpy(); | |
| 443 | patIdCom pareUtil.d etectAndRe sync(log, environmen t, job, pi dsFromMvi, callback) ; | |
| 444 | ||
| 445 | waitsFor (function( ) { | |
| 446 | retu rn callbac k.callCoun t > 0; | |
| 447 | }, 'The call timed out.', 50 00); | |
| 448 | ||
| 449 | runs(fun ction() { | |
| 450 | expe ct(callbac k).toHaveB eenCalled( ); | |
| 451 | expe ct(environ ment.publi sherRouter .publish). toHaveBeen Called(); | |
| 452 | }); | |
| 453 | }) ; | |
| 454 | }); | |
| 455 | ||
| 456 | // *** ********** ********** ********** ********** ********** ** | |
| 457 | descri be('patien t Does nee d a resync because D FN value i s differen t ', funct ion() { | |
| 458 | it ('verify P atient Ide ntifier do es require a resync' , function () { | |
| 459 | var vist aClient = { | |
| 460 | getD emographic s: functio n(vistaId, dfn, call back) { | |
| 461 | return cal lback(null , demograp hicsFromVi sta); | |
| 462 | } | |
| 463 | }; | |
| 464 | var envi ronment = createEnvi ronment(vi staClient, config); | |
| 465 | var expe ctedJdsErr or = [null , null]; | |
| 466 | var expe ctedJdsRes ponse = [{ statusCode : 200},{st atusCode: 200}]; | |
| 467 | var expe ctedJdsRes ult = [{ | |
| 468 | patientIde ntifiers: [ | |
| 469 | '10108 V420871', | |
| 470 | '2939; 19', | |
| 471 | '9E7A; 3', | |
| 472 | 'FFC7; 28', | |
| 473 | 'dfn;1 12244'] / /different | |
| 474 | },{}]; | |
| 475 | environm ent.jds._s etResponse Data(expec tedJdsErro r, expecte dJdsRespon se, expect edJdsResul t); | |
| 476 | var call back = jas mine.creat eSpy(); | |
| 477 | patIdCom pareUtil.d etectAndRe sync(log, environmen t, job, pi dsFromMvi, callback) ; | |
| 478 | ||
| 479 | waitsFor (function( ) { | |
| 480 | retu rn callbac k.callCoun t > 0; | |
| 481 | }, 'The call timed out.', 50 00); | |
| 482 | ||
| 483 | runs(fun ction() { | |
| 484 | expe ct(callbac k).toHaveB eenCalled( ); | |
| 485 | expe ct(environ ment.publi sherRouter .publish). toHaveBeen Called(); | |
| 486 | }); | |
| 487 | }) ; | |
| 488 | }); | |
| 489 | ||
| 490 | descri be('patien t Does nee d a resync because D FN value i s differen t but a re sync is al ready in p rocess', f unction() { | |
| 491 | it ('verify P atient Ide ntifier do es not ano ther resyn c', functi on() { | |
| 492 | var vist aClient = { | |
| 493 | getD emographic s: functio n(vistaId, dfn, call back) { | |
| 494 | return cal lback(null , demograp hicsFromVi sta); | |
| 495 | } | |
| 496 | }; | |
| 497 | var envi ronment = createEnvi ronment(vi staClient, config); | |
| 498 | var expe ctedJdsErr or = [null , null]; | |
| 499 | var expe ctedJdsRes ponse = [{ statusCode : 200},{st atusCode: 200}]; | |
| 500 | var expe ctedJdsRes ult = [{ | |
| 501 | pati entIdentif iers: [ | |
| 502 | '10108V420 871', | |
| 503 | '2939;19', | |
| 504 | '9E7A;3', | |
| 505 | 'FFC7;28', | |
| 506 | 'dfn;11224 4'] //dif ferent | |
| 507 | },{jobSt atus: [{ty pe: 'resyn c-request' }]}]; | |
| 508 | environm ent.jds._s etResponse Data(expec tedJdsErro r, expecte dJdsRespon se, expect edJdsResul t); | |
| 509 | var call back = jas mine.creat eSpy(); | |
| 510 | patIdCom pareUtil.d etectAndRe sync(log, environmen t, job, pi dsFromMvi, callback) ; | |
| 511 | ||
| 512 | waitsFor (function( ) { | |
| 513 | retu rn callbac k.callCoun t > 0; | |
| 514 | }, 'The call timed out.', 50 00); | |
| 515 | ||
| 516 | runs(fun ction() { | |
| 517 | expe ct(callbac k).toHaveB eenCalled( ); | |
| 518 | expe ct(environ ment.publi sherRouter .publish). not.toHave BeenCalled (); | |
| 519 | }); | |
| 520 | }) ; | |
| 521 | }); | |
| 522 | ||
| 523 | }); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.