Produced by Araxis Merge on 10/3/2017 11:16:03 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\handlers\resync-request | get-patient-demographics-spec.js | Tue Jan 10 16:20:50 2017 UTC |
| 2 | ehmp.zip\ehmp\ehmp\product\production\vx-sync\tests\unittests\handlers\resync-request | get-patient-demographics-spec.js | Tue Oct 3 13:18:45 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 216 |
| 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 | var getDem ographics = require( global.VX_ HANDLERS + 'resync-r equest/get -patient-d emographic s'); | |
| 5 | var JdsCli entDummy = require(g lobal.VX_D UMMIES + ' jds-client -dummy'); | |
| 6 | var log = require(gl obal.VX_DU MMIES + 'd ummy-logge r'); | |
| 7 | ||
| 8 | var config = { | |
| 9 | jds: { | |
| 10 | pr otocol: 'h ttp', | |
| 11 | host: ' IP ', | |
| 12 | port: PORT | |
| 13 | } | |
| 14 | }; | |
| 15 | ||
| 16 | var demogr aphicsData = { | |
| 17 | "apiVe rsion": "1 .0", | |
| 18 | "data" : { | |
| 19 | "u pdated": 2 0160216141 659, | |
| 20 | "t otalItems" : 2, | |
| 21 | "c urrentItem Count": 2, | |
| 22 | "i tems": [ | |
| 23 | { | |
| 24 | "pid ": "9343;2 3", | |
| 25 | "dis playName": "Ten,Pati ent"}, | |
| 26 | { | |
| 27 | "pid ": "DOD;44 3343", | |
| 28 | "dis playName": "Ten,Pati ent"} | |
| 29 | ] | |
| 30 | }}; | |
| 31 | ||
| 32 | describe(' When get p atient dem ographics' , function () { | |
| 33 | var en vironment, job, call back, call ed, called Error; | |
| 34 | ||
| 35 | before Each(funct ion() { | |
| 36 | jo b = {"pati entIdentif ier": {"ty pe": "icn" , "value": "10110V00 4877"}}; | |
| 37 | ||
| 38 | en vironment = {jds: ne w JdsClien tDummy(log , config)} ; | |
| 39 | ||
| 40 | ca llback = f unction(er ror) { | |
| 41 | called = true; | |
| 42 | calledEr ror = erro r; | |
| 43 | }; | |
| 44 | }); | |
| 45 | ||
| 46 | it('ve rify icn d emographic s added to job', fun ction() { | |
| 47 | en vironment. jds._setRe sponseData ([null], [ {statusCod e: 200}], demographi csData); | |
| 48 | ||
| 49 | ge tDemograph ics.loadDe mographics (environme nt, log, j ob, callba ck) | |
| 50 | ||
| 51 | wa itsFor(fun ction() {r eturn call ed;}, 'sho uld be cal led', 100) ; | |
| 52 | ||
| 53 | ru ns(functio n() { | |
| 54 | expect(c alledError ).toBeFals y(); | |
| 55 | expect(j ob.demogra phics).toB eDefined() ; | |
| 56 | expect(j ob.demogra phics.pid) .toBe('934 3;23'); | |
| 57 | }) ; | |
| 58 | }); | |
| 59 | ||
| 60 | it('ve rify dod d emographic s added to job', fun ction() { | |
| 61 | en vironment. jds._setRe sponseData ([null], [ {statusCod e: 200}], demographi csData); | |
| 62 | va r dodJob = {"patient Identifier ": {"type" : "pid", " value": "D OD;443343" }} | |
| 63 | ||
| 64 | ge tDemograph ics.loadDe mographics (environme nt, log, d odJob, cal lback) | |
| 65 | ||
| 66 | wa itsFor(fun ction() {r eturn call ed;}, 'sho uld be cal led', 100) ; | |
| 67 | ||
| 68 | ru ns(functio n() { | |
| 69 | expect(c alledError ).toBeFals y(); | |
| 70 | expect(d odJob.demo graphics). toBeDefine d(); | |
| 71 | expect(d odJob.demo graphics.p id).toBe(' DOD;443343 '); | |
| 72 | }) ; | |
| 73 | }); | |
| 74 | ||
| 75 | it('ve rify error returned if no demo graphics f ound', fun ction() { | |
| 76 | en vironment. jds._setRe sponseData ([null], [ {statusCod e: 200}], {}); | |
| 77 | ||
| 78 | ge tDemograph ics.loadDe mographics (environme nt, log, j ob, callba ck) | |
| 79 | ||
| 80 | wa itsFor(fun ction() {r eturn call ed;}, 'sho uld be cal led', 100) ; | |
| 81 | ||
| 82 | ru ns(functio n() { | |
| 83 | expect(c alledError ).not.toBe Falsy(); | |
| 84 | }) ; | |
| 85 | }); | |
| 86 | ||
| 87 | it('ve rify error returned if error r eturned fr om jds', f unction() { | |
| 88 | en vironment. jds._setRe sponseData (["Connect ion Error" ], [null], null); | |
| 89 | ||
| 90 | ge tDemograph ics.loadDe mographics (environme nt, log, j ob, callba ck) | |
| 91 | ||
| 92 | wa itsFor(fun ction() {r eturn call ed;}, 'sho uld be cal led', 100) ; | |
| 93 | ||
| 94 | ru ns(functio n() { | |
| 95 | expect(c alledError ).not.toBe Falsy(); | |
| 96 | }) ; | |
| 97 | }); | |
| 98 | ||
| 99 | it('ve rify error returned if error r esponse re turned fro m jds', fu nction() { | |
| 100 | en vironment. jds._setRe sponseData ([null], [ {statusCod e: 500}], {error: 'e rror'}); | |
| 101 | ||
| 102 | ge tDemograph ics.loadDe mographics (environme nt, log, j ob, callba ck) | |
| 103 | ||
| 104 | wa itsFor(fun ction() {r eturn call ed;}, 'sho uld be cal led', 100) ; | |
| 105 | ||
| 106 | ru ns(functio n() { | |
| 107 | expect(c alledError ).not.toBe Falsy(); | |
| 108 | }) ; | |
| 109 | }); | |
| 110 | }); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.