Produced by Araxis Merge on 10/4/2017 8:04:36 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\production\rdk\src\write\numeric-lab-results | save-note-object-spec.js | Mon Aug 21 12:51:00 2017 UTC |
| 2 | rdk.zip\rdk\product\production\rdk\src\write\numeric-lab-results | save-note-object-spec.js | Tue Oct 3 18:56:34 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 14 | 286 |
| Changed | 13 | 42 |
| 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 | var saveNo teObject = require(' ./save-not e-object') ; | |
| 4 | var pjds = require(' ../../subs ystems/cli nical-obje cts/clinic al-objects -subsystem '); | |
| 5 | ||
| 6 | var writeb ackContext = { | |
| 7 | pid: ' R E D A CTED ;100615', | |
| 8 | appCon fig: { | |
| 9 | ge neralPurpo seJdsServe r: { | |
| 10 | baseUrl: 'foo' | |
| 11 | } | |
| 12 | }, | |
| 13 | vistaC onfig: { | |
| 14 | host: ' IP ', | |
| 15 | port: PORT , | |
| 16 | accessCode : ' PL ', | |
| 17 | verifyCode : ' PL !!', | |
| 18 | localIP: ' IP ', | |
| 19 | lo calAddress : 'localho st', | |
| 20 | no Reconnect: true | |
| 21 | }, | |
| 22 | model: { | |
| 23 | 'reference Id': 'urn: va:ehmp-ob servation: R E D A CTED :100615:b5 f0e8ff-434 a-433f-a4d 9-37459d1b 419e', | |
| 24 | 'patientUi d': 'urn:v a:patient: R E D A CTED :100615:10 0615', | |
| 25 | 'authorUid ': 'urn:va :user: R E D A CTED :100000002 38', | |
| 26 | 'v isit': { | |
| 27 | 'location' : 'urn:va: location: R E D A CTED :285', | |
| 28 | 'service Category': 'PSB', | |
| 29 | 'dateTim e': '20160 102123040' | |
| 30 | }, | |
| 31 | 'd ata': { | |
| 32 | 'madlib' : null, | |
| 33 | 'annotat ion': 'bar ', | |
| 34 | 'problemRe lationship ': 'urn:va :problem: R E D A CTED :100615:18 3' | |
| 35 | } | |
| 36 | }, | |
| 37 | logger : sinon.st ub(require ('bunyan') .createLog ger({ | |
| 38 | na me: 'save- note-objec t-spec' | |
| 39 | })) | |
| 40 | }; | |
| 41 | ||
| 42 | describe(' findClinic alObject', function( ) { | |
| 43 | ||
| 44 | afterE ach(functi on() { | |
| 45 | pj ds.find.re store(); | |
| 46 | }); | |
| 47 | ||
| 48 | it('te sts that f ind clinic al object returns no t found re sponse', f unction() { | |
| 49 | si non.stub(p jds, 'find ', functio n(logger, appConfig, model, lo adReferenc e, callbac k) { | |
| 50 | var err = [pjds.CL INICAL_OBJ ECT_NOT_FO UND]; | |
| 51 | callback (err); | |
| 52 | }) ; | |
| 53 | ||
| 54 | sa veNoteObje ct._findCl inicalObje ct(writeba ckContext, function( err, conte xt, result ) { | |
| 55 | expect(r esult).eql (null); | |
| 56 | }) ; | |
| 57 | }); | |
| 58 | ||
| 59 | it('te sts that f ind clinic al object returns cl inical obj ect UID', function() { | |
| 60 | si non.stub(p jds, 'find ', functio n(logger, appConfig, model, lo adReferenc e, callbac k) { | |
| 61 | var resp onse = { | |
| 62 | 'ite ms': [{ | |
| 63 | 'uid': 'ur n:va:ehmp- observatio n: R E D A CTED :100615:b5 f0e8ff-434 a-433f-a4d 9-37459d1b 419e' | |
| 64 | }] | |
| 65 | }; | |
| 66 | callback (null, res ponse); | |
| 67 | }) ; | |
| 68 | ||
| 69 | sa veNoteObje ct._findCl inicalObje ct(writeba ckContext, function( err, conte xt, result ) { | |
| 70 | expect(res ult).eql(' urn:va:ehm p-observat ion: R E D A CTED :100615:b5 f0e8ff-434 a-433f-a4d 9-37459d1b 419e'); | |
| 71 | }) ; | |
| 72 | }); | |
| 73 | ||
| 74 | it('te sts that f ind clinic al object returns er ror respon se', funct ion() { | |
| 75 | si non.stub(p jds, 'find ', functio n(logger, appConfig, model, lo adReferenc e, callbac k) { | |
| 76 | var err = [pjds.PJ DS_CONNECT ION_ERROR] ; | |
| 77 | callback (err); | |
| 78 | }) ; | |
| 79 | ||
| 80 | sa veNoteObje ct._findCl inicalObje ct(writeba ckContext, function( err, conte xt, result ) { | |
| 81 | expect(e rr).to.be. truthy(); | |
| 82 | expect(e rr[0]).to. equal(pjds .PJDS_CONN ECTION_ERR OR); | |
| 83 | }) ; | |
| 84 | }); | |
| 85 | }); | |
| 86 | ||
| 87 | describe(' getClinica lObjectUid ', functio n() { | |
| 88 | ||
| 89 | afterE ach(functi on() { | |
| 90 | pj ds.create. restore(); | |
| 91 | }); | |
| 92 | ||
| 93 | it('te sts that g et clinica l object U ID returns existing UID', func tion() { | |
| 94 | si non.stub(p jds, 'crea te', funct ion(logger , appConfi g, model, callback) { | |
| 95 | callback (null); | |
| 96 | }) ; | |
| 97 | ||
| 98 | saveNoteOb ject._getC linicalObj ectUid(wri tebackCont ext, 'urn: va:ehmp-ob servation: R E D A CTED :100615:b5 f0e8ff-434 a-433f-a4d 9-37459d1b 419e', fun ction(err, context, result) { | |
| 99 | expect(res ult).eql(' urn:va:ehm p-observat ion: R E D A CTED :100615:b5 f0e8ff-434 a-433f-a4d 9-37459d1b 419e'); | |
| 100 | }) ; | |
| 101 | }); | |
| 102 | ||
| 103 | it('te sts that g et clinica l object U ID returns newly cre ated clini cal object UID', fun ction() { | |
| 104 | si non.stub(p jds, 'crea te', funct ion(logger , appConfi g, model, callback) { | |
| 105 | var resu lt = { | |
| 106 | head ers: { | |
| 107 | location: 'http:// IP /clinicobj /urn:va:eh mp-observa tion: R E D A CTED :100615:b5 f0e8ff-434 a-433f-a4d 9-37459d1b 419e' | |
| 108 | } | |
| 109 | }; | |
| 110 | callback (null, res ult); | |
| 111 | }) ; | |
| 112 | ||
| 113 | sa veNoteObje ct._getCli nicalObjec tUid(write backContex t, null, f unction(er r, context , result) { | |
| 114 | expect(res ult).eql(' urn:va:ehm p-observat ion: R E D A CTED :100615:b5 f0e8ff-434 a-433f-a4d 9-37459d1b 419e'); | |
| 115 | }) ; | |
| 116 | }); | |
| 117 | ||
| 118 | ||
| 119 | it('te sts that g et clinica l object U ID returns error res ponse', fu nction() { | |
| 120 | si non.stub(p jds, 'crea te', funct ion(logger , appConfi g, model, callback) { | |
| 121 | var err = ['Failed to create clinical object']; | |
| 122 | callback (err); | |
| 123 | }) ; | |
| 124 | ||
| 125 | sa veNoteObje ct._getCli nicalObjec tUid(write backContex t, null, f unction(er r, context , result) { | |
| 126 | expect(e rr).to.be. truthy(); | |
| 127 | expect(e rr[0]).to. equal('Fai led to cre ate clinic al object' ); | |
| 128 | }) ; | |
| 129 | }); | |
| 130 | }); | |
| 131 | ||
| 132 | describe(' createNote Object', f unction() { | |
| 133 | ||
| 134 | afterE ach(functi on() { | |
| 135 | pj ds.create. restore(); | |
| 136 | }); | |
| 137 | ||
| 138 | it('te sts that c reate note object re turns corr ect note o bject', fu nction() { | |
| 139 | si non.stub(p jds, 'crea te', funct ion(logger , appConfi g, model, callback) { | |
| 140 | var resu lt = { | |
| 141 | head ers: { | |
| 142 | location: 'http:// IP /clinicobj /urn:va:eh mp-note: R E D A CTED :100615:67 f4ce62-8f0 f-4c89-9ec 0-4ad83a36 45ef' | |
| 143 | } | |
| 144 | }; | |
| 145 | callback (null, res ult); | |
| 146 | }) ; | |
| 147 | ||
| 148 | saveNoteOb ject._crea teNoteObje ct(writeba ckContext, 'urn:va:e hmp: R E D A CTED ;100615:0b abd148-3f0 d-4a0f-8c1 a-c39ce3be 48f4', fun ction(err, result) { | |
| 149 | expect(res ult).eql(' http:// IP /clinicobj /urn:va:eh mp-note: R E D A CTED :100615:67 f4ce62-8f0 f-4c89-9ec 0-4ad83a36 45ef'); | |
| 150 | }) ; | |
| 151 | }); | |
| 152 | ||
| 153 | it('te sts that c reate note object re turns erro r response ', functio n() { | |
| 154 | si non.stub(p jds, 'crea te', funct ion(logger , appConfi g, model, callback) { | |
| 155 | var err = ['Failed to create clinical object']; | |
| 156 | callback (err); | |
| 157 | }) ; | |
| 158 | ||
| 159 | saveNoteOb ject._crea teNoteObje ct(writeba ckContext, 'urn:va:e hmp: R E D A CTED ;100615:0b abd148-3f0 d-4a0f-8c1 a-c39ce3be 48f4', fun ction(err, context, result) { | |
| 160 | expect(e rr).to.be. truthy(); | |
| 161 | expect(e rr[0]).to. equal('Fai led to cre ate clinic al object' ); | |
| 162 | }) ; | |
| 163 | }); | |
| 164 | }); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.