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\patient-record-retirement\retirementruleengine | largePatientRecord-rule-spec.js | Mon Jul 10 17:46:22 2017 UTC |
| 2 | ehmp.zip\ehmp\ehmp\product\production\vx-sync\tests\unittests\utils\patient-record-retirement\retirementruleengine | largePatientRecord-rule-spec.js | Tue Oct 3 13:23:47 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 9 | 650 |
| Changed | 8 | 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 | /*global d escribe, i t, expect, runs, wai tsFor */ | |
| 2 | 'use stric t'; | |
| 3 | require('. ./../../.. /../env-se tup'); | |
| 4 | var Retire mentRulesE ngine = re quire(glob al.VX_RETI REMENTRULE S + '/rule s-engine') ; | |
| 5 | var nock = require(' nock'); | |
| 6 | var _ = re quire('und erscore'); | |
| 7 | var moment = require ('moment') ; | |
| 8 | ||
| 9 | var log = require(gl obal.VX_DU MMIES + 'd ummy-logge r'); | |
| 10 | ||
| 11 | // var log Util = req uire(globa l.VX_UTILS + 'log'); | |
| 12 | // log = l ogUtil._cr eateLogger ({ | |
| 13 | // nam e: 'test', | |
| 14 | // lev el: 'debug ', | |
| 15 | // chi ld: logUti l._createL ogger | |
| 16 | // }); | |
| 17 | ||
| 18 | var config = { | |
| 19 | 'recor dRetiremen t': { | |
| 20 | 'r ules': { | |
| 21 | 'largePa tientRecor d': { | |
| 22 | 'pat ientTotalS izeLimit': 200, | |
| 23 | 'avg SizePerEve nt': 100 | |
| 24 | } | |
| 25 | }, | |
| 26 | 'l astAccesse d': 10 | |
| 27 | }, | |
| 28 | 'syncR equestApi' : { | |
| 29 | 'p rotocol': 'http', | |
| 30 | 'host': ' IP ', | |
| 31 | 'port': ' PORT ', | |
| 32 | 't imeout': 3 00000 | |
| 33 | }, | |
| 34 | 'vista Sites': { | |
| 35 | 'C 877': { | |
| 36 | 'name': 'KODAK' | |
| 37 | }, | |
| 38 | '9 E7A': { | |
| 39 | 'name': 'PANORAMA' | |
| 40 | } | |
| 41 | } | |
| 42 | }; | |
| 43 | var enviro nment = { | |
| 44 | metric s: log | |
| 45 | }; | |
| 46 | ||
| 47 | var vprDat eFormat = 'YYYYMMDDH Hmmss'; | |
| 48 | describe(' large-pati ent-record -rule', fu nction() { | |
| 49 | ||
| 50 | before Each(funct ion() { | |
| 51 | no ck.cleanAl l(); | |
| 52 | no ck.disable NetConnect (); | |
| 53 | nock('http :// IP ') | |
| 54 | .get('/s ync/status ?pid=9E7A; 10&docStat us=true') | |
| 55 | .reply(2 00, JSON.s tringify({ | |
| 56 | 'jpi d': '215c2 ab2-cfe2-4 702-9395-9 49e32f6d3e 4', | |
| 57 | 'ide ntifierDoc Sizes': { | |
| 58 | 'totalSize ': 10, | |
| 59 | '9E7A;10': 'NO_DOCUM ENTS' | |
| 60 | }, | |
| 61 | 'syn cStatus': { | |
| 62 | 'completed Stamp': { | |
| 63 | 'sourc eMetaStamp ': { | |
| 64 | '9 E7A': { | |
| 65 | 'domainM etaStamp': { | |
| 66 | 'all ergy': { | |
| 67 | 'domain': 'allergy', | |
| 68 | 'eventCoun t': 3 | |
| 69 | } | |
| 70 | } | |
| 71 | } | |
| 72 | } | |
| 73 | } | |
| 74 | } | |
| 75 | })); | |
| 76 | nock('http :// IP ') | |
| 77 | .get('/s ync/status ?icn=10108 V420871&do cStatus=tr ue') | |
| 78 | .reply(2 00, JSON.s tringify({ | |
| 79 | 'jpi d': '215c2 ab2-cfe2-4 702-9395-9 49e32f6d3e 4', | |
| 80 | 'ide ntifierDoc Sizes': { | |
| 81 | 'totalSize ': 100, | |
| 82 | '9E7A;3': 'NO_DOCUME NTS' | |
| 83 | }, | |
| 84 | 'syn cStatus': { | |
| 85 | 'completed Stamp': { | |
| 86 | 'sourc eMetaStamp ': { | |
| 87 | '9 E7A': { | |
| 88 | 'domainM etaStamp': { | |
| 89 | 'all ergy': { | |
| 90 | 'domain': 'allergy', | |
| 91 | 'eventCoun t': 3 | |
| 92 | } | |
| 93 | } | |
| 94 | } | |
| 95 | } | |
| 96 | } | |
| 97 | } | |
| 98 | })); | |
| 99 | ||
| 100 | nock('http :// IP ') | |
| 101 | .get('/s ync/status ?icn=10110 V004877&do cStatus=tr ue') | |
| 102 | .reply(2 00, JSON.s tringify({ | |
| 103 | 'jpi d': '215c2 ab2-cfe2-4 702-9395-9 49e32f6d3e 4', | |
| 104 | 'ide ntifierDoc Sizes': { | |
| 105 | 'totalSize ': 200, | |
| 106 | '9E7A:8': 'NO_DOCUME NTS' | |
| 107 | }, | |
| 108 | 'syn cStatus': { | |
| 109 | 'completed Stamp': { | |
| 110 | 'sourc eMetaStamp ': { | |
| 111 | '9 E7A': { | |
| 112 | 'domainM etaStamp': { | |
| 113 | 'all ergy': { | |
| 114 | 'domain': 'allergy', | |
| 115 | 'eventCoun t': 3 | |
| 116 | } | |
| 117 | } | |
| 118 | } | |
| 119 | } | |
| 120 | } | |
| 121 | } | |
| 122 | })); | |
| 123 | ||
| 124 | nock('http :// IP ') | |
| 125 | .get('/s ync/status ?pid=AAAA; 1&docStatu s=true') | |
| 126 | .reply(4 04); | |
| 127 | ||
| 128 | nock('http :// IP ') | |
| 129 | .get('/s ync/status ?pid=BBBB; 1&docStatu s=true') | |
| 130 | .reply(2 00, JSON.s tringify({ | |
| 131 | 'jpi d': '215c2 ab2-cfe2-4 702-9395-9 49e32f6d3e 4', | |
| 132 | 'ide ntifierDoc Sizes': { | |
| 133 | 'totalSize ': 200, | |
| 134 | 'BBBB:1': 'NO_DOCUME NTS' | |
| 135 | }, | |
| 136 | 'syn cStatus': { | |
| 137 | 'inProgres s': { | |
| 138 | 'sourc eMetaStamp ': { | |
| 139 | 'B BBB': { | |
| 140 | 'domainM etaStamp': { | |
| 141 | 'all ergy': { | |
| 142 | 'domain': 'allergy', | |
| 143 | 'eventCoun t': 1 | |
| 144 | } | |
| 145 | } | |
| 146 | } | |
| 147 | } | |
| 148 | } | |
| 149 | } | |
| 150 | })); | |
| 151 | ||
| 152 | nock('http :// IP ') | |
| 153 | .get('/s ync/status ?pid=CCCC; 1&docStatu s=true') | |
| 154 | .reply(2 00, JSON.s tringify({ | |
| 155 | 'jpi d': '215c2 ab2-cfe2-4 702-9395-9 49e32f6d3e 4', | |
| 156 | 'ide ntifierDoc Sizes': { | |
| 157 | 'totalSize ': 0, | |
| 158 | 'CCCC:1': 'NO_DOCUME NTS' | |
| 159 | }, | |
| 160 | 'syn cStatus': { | |
| 161 | 'completed Stamp': { | |
| 162 | 'sourc eMetaStamp ': { | |
| 163 | 'C CCC': { | |
| 164 | 'domainM etaStamp': { | |
| 165 | 'all ergy': { | |
| 166 | 'domain': 'allergy', | |
| 167 | 'eventCoun t': 1 | |
| 168 | } | |
| 169 | } | |
| 170 | } | |
| 171 | } | |
| 172 | } | |
| 173 | } | |
| 174 | })); | |
| 175 | }); | |
| 176 | it('no patients' , function () { | |
| 177 | va r done = f alse; | |
| 178 | va r items = []; | |
| 179 | va r engine = new Retir ementRules Engine(log , config, environmen t); | |
| 180 | ru ns(functio n() { | |
| 181 | engine.p rocessReti rementRule s(items, f unction(er r, result) { | |
| 182 | expe ct(result. length).to Equal(0); | |
| 183 | done = true; | |
| 184 | }); | |
| 185 | }) ; | |
| 186 | wa itsFor(fun ction() { | |
| 187 | return d one; | |
| 188 | }) ; | |
| 189 | }); | |
| 190 | it('al l small pa tients', f unction() { | |
| 191 | va r done = f alse; | |
| 192 | va r date = m oment().su btract(20, 'days').f ormat('YYY YMMDDHHmms s'); | |
| 193 | va r items = [{ | |
| 194 | 'jpid': '215c2ab2- cfe2-4702- 9395-949e3 2f6d3e4', | |
| 195 | 'lastAcc essTime': date, | |
| 196 | 'patient Identifier s': ['9E7A ;10'] | |
| 197 | }, { | |
| 198 | 'jpid': '516c44cc- a87a-4822- b2eb-979e8 324505e', | |
| 199 | 'lastAcc essTime': date, | |
| 200 | 'patient Identifier s': ['1010 8V420871', '9E7A;3', 'C877;3', 'DOD;0000 000003', ' HDR;10108V 420871', ' VLER;10108 V420871'] | |
| 201 | }, { | |
| 202 | 'jpid': '5888e969- 110c-4d97- 8f56-10652 ffee070', | |
| 203 | 'lastAcc essTime': date, | |
| 204 | 'patient Identifier s': ['1011 0V004877', '9E7A;8', 'C877;8', 'DOD;0000 000008', ' HDR;10110V 004877', ' VLER;10110 V004877'] | |
| 205 | }] ; | |
| 206 | va r engine = new Retir ementRules Engine(log , config, environmen t); | |
| 207 | ru ns(functio n() { | |
| 208 | engine.p rocessReti rementRule s(items, f unction(er r, result) { | |
| 209 | expe ct(result. length).to Equal(0); | |
| 210 | done = true; | |
| 211 | }); | |
| 212 | }) ; | |
| 213 | wa itsFor(fun ction() { | |
| 214 | return d one; | |
| 215 | }) ; | |
| 216 | }); | |
| 217 | ||
| 218 | it('mi x of large and small patients' , function () { | |
| 219 | co nfig = { | |
| 220 | 'recordR etirement' : { | |
| 221 | 'rul es': { | |
| 222 | 'largePati entRecord' : { | |
| 223 | 'large PatientLas tAccessed' : 10, | |
| 224 | 'patie ntTotalSiz eLimit': 1 00, | |
| 225 | 'avgSi zePerEvent ': 0 | |
| 226 | } | |
| 227 | } | |
| 228 | }, | |
| 229 | 'syncReq uestApi': { | |
| 230 | 'pro tocol': 'h ttp', | |
| 231 | 'host': ' IP ', | |
| 232 | 'port': ' PORT ', | |
| 233 | 'tim eout': 300 000 | |
| 234 | }, | |
| 235 | 'vistaSi tes': { | |
| 236 | 'C87 7': { | |
| 237 | 'name': 'K ODAK' | |
| 238 | }, | |
| 239 | '9E7 A': { | |
| 240 | 'name': 'P ANORAMA' | |
| 241 | } | |
| 242 | } | |
| 243 | }; | |
| 244 | va r done = f alse; | |
| 245 | va r date = m oment().su btract(20, 'days').f ormat('YYY YMMDDHHmms s'); | |
| 246 | va r items = [{ | |
| 247 | 'jpid': '215c2ab2- cfe2-4702- 9395-949e3 2f6d3e4', | |
| 248 | 'lastAcc essTime': date, | |
| 249 | 'patient Identifier s': ['9E7A ;10'] | |
| 250 | }, { | |
| 251 | 'jpid': '516c44cc- a87a-4822- b2eb-979e8 324505e', | |
| 252 | 'lastAcc essTime': date, | |
| 253 | 'patient Identifier s': ['1010 8V420871', '9E7A;3', 'C877;3', 'DOD;0000 000003', ' HDR;10108V 420871', ' VLER;10108 V420871'] | |
| 254 | }, { | |
| 255 | 'jpid': '5888e969- 110c-4d97- 8f56-10652 ffee070', | |
| 256 | 'lastAcc essTime': date, | |
| 257 | 'patient Identifier s': ['1011 0V004877', '9E7A;8', 'C877;8', 'DOD;0000 000008', ' HDR;10110V 004877', ' VLER;10110 V004877'] | |
| 258 | }] ; | |
| 259 | ||
| 260 | ||
| 261 | va r engine = new Retir ementRules Engine(log , config, environmen t); | |
| 262 | ru ns(functio n() { | |
| 263 | engine.p rocessReti rementRule s(items, f unction(er r, result) { | |
| 264 | expe ct(result. length).to Equal(1); | |
| 265 | done = true; | |
| 266 | }); | |
| 267 | }) ; | |
| 268 | wa itsFor(fun ction() { | |
| 269 | return d one; | |
| 270 | }) ; | |
| 271 | }); | |
| 272 | ||
| 273 | it('pa tient with no docume nts', func tion(){ | |
| 274 | va r done = f alse; | |
| 275 | va r date = m oment().su btract(20, 'days').f ormat('YYY YMMDDHHmms s'); | |
| 276 | va r items = [{ | |
| 277 | 'jpid': '215c2ab2- cfe2-4702- 9395-949e3 2f6d3e4', | |
| 278 | 'lastAcc essTime': date, | |
| 279 | 'patient Identifier s': ['CCCC ;1'] | |
| 280 | }] ; | |
| 281 | va r engine = new Retir ementRules Engine(log , config, environmen t); | |
| 282 | ru ns(functio n() { | |
| 283 | engine.p rocessReti rementRule s(items, f unction(er r, result) { | |
| 284 | expe ct(result. length).to Equal(1); | |
| 285 | done = true; | |
| 286 | }); | |
| 287 | }) ; | |
| 288 | wa itsFor(fun ction() { | |
| 289 | return d one; | |
| 290 | }) ; | |
| 291 | }); | |
| 292 | ||
| 293 | it('No rmal path: sync in p rogress', function() { | |
| 294 | va r done = f alse; | |
| 295 | va r date = m oment().su btract(20, 'days').f ormat('YYY YMMDDHHmms s'); | |
| 296 | va r items = [{ | |
| 297 | 'jpid': 'aaaaa-bbb bb-ccccc', | |
| 298 | 'lastAcc essTime': date, | |
| 299 | 'patient Identifier s': ['BBBB ;1'] | |
| 300 | }] ; | |
| 301 | va r engine = new Retir ementRules Engine(log , config, environmen t); | |
| 302 | ru ns(functio n() { | |
| 303 | engine.p rocessReti rementRule s(items, f unction(er r, result) { | |
| 304 | expe ct(err).to BeFalsy(); | |
| 305 | expe ct(result) .toBeTruth y(); | |
| 306 | expe ct(_.isEmp ty(result) ).toBe(tru e); | |
| 307 | done = true; | |
| 308 | }); | |
| 309 | }) ; | |
| 310 | wa itsFor(fun ction() { | |
| 311 | return d one; | |
| 312 | }) ; | |
| 313 | }); | |
| 314 | ||
| 315 | it('Er ror path: error retu rned by sy nc status endpoint', function( ) { | |
| 316 | va r done = f alse; | |
| 317 | va r date = m oment().su btract(20, 'days').f ormat('YYY YMMDDHHmms s'); | |
| 318 | va r items = [{ | |
| 319 | 'jpid': 'aaaaa-bbb bb-ccccc', | |
| 320 | 'lastAcc essTime': date, | |
| 321 | 'patient Identifier s': ['AAAA ;1'] | |
| 322 | }] ; | |
| 323 | va r engine = new Retir ementRules Engine(log , config, environmen t); | |
| 324 | ru ns(functio n() { | |
| 325 | engine.p rocessReti rementRule s(items, f unction(er r, result) { | |
| 326 | expe ct(err).to BeTruthy() ; | |
| 327 | expe ct(result) .toBeFalsy (); | |
| 328 | done = true; | |
| 329 | }); | |
| 330 | }) ; | |
| 331 | wa itsFor(fun ction() { | |
| 332 | return d one; | |
| 333 | }) ; | |
| 334 | }); | |
| 335 | }); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.