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\enterprise-sync-request | enterprise-sync-request-handler-itest-spec.js | Mon Aug 28 20:41:42 2017 UTC |
| 2 | ehmp.zip\ehmp\ehmp\product\production\vx-sync\tests\integrationtests\handlers\enterprise-sync-request | enterprise-sync-request-handler-itest-spec.js | Tue Oct 3 12:45:42 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 6 | 568 |
| Changed | 5 | 24 |
| 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 _ = re quire('und erscore'); | |
| 4 | // var ins pect = _.p artial(req uire('util ').inspect , _, { | |
| 5 | // dep th: null | |
| 6 | // }); | |
| 7 | ||
| 8 | require('. ./../../.. /env-setup '); | |
| 9 | ||
| 10 | var logger = require (global.VX _DUMMIES + 'dummy-lo gger'); | |
| 11 | var jobUti l = requir e(global.V X_UTILS + 'job-utils '); | |
| 12 | var testHa ndler = re quire(glob al.VX_INTT ESTS + 'fr amework/ha ndler-test -framework ').testHan dler; | |
| 13 | var patien tIdUtil = require(gl obal.VX_UT ILS + 'pat ient-ident ifier-util s'); | |
| 14 | var handle r = requir e(global.V X_HANDLERS + 'enterp rise-sync- request/en terprise-s ync-reques t-handler' ); | |
| 15 | var VistaC lient = re quire(glob al.VX_SUBS YSTEMS + ' vista/vist a-client') ; | |
| 16 | // var que ueConfig = require(g lobal.VX_J OBFRAMEWOR K).QueueCo nfig; | |
| 17 | var val = require(gl obal.VX_UT ILS + 'obj ect-utils' ).getPrope rty; | |
| 18 | ||
| 19 | var testCo nfig = req uire(globa l.VX_INTTE STS + 'tes t-config') ; | |
| 20 | var vx_syn c_ip = tes tConfig.vx syncIP; | |
| 21 | ||
| 22 | // var Pub lisherRout er = requi re(global. VX_JOBFRAM EWORK).Pub lisherRout er; | |
| 23 | var MviCli ent = requ ire(global .VX_SUBSYS TEMS + 'mv i/mvi-clie nt'); | |
| 24 | var JdsCli ent = requ ire(global .VX_SUBSYS TEMS + 'jd s/jds-clie nt'); | |
| 25 | var JobSta tusUpdater = require (global.VX _SUBSYSTEM S + 'jds/J obStatusUp dater'); | |
| 26 | var wConfi g = requir e(global.V X_ROOT + ' worker-con fig'); | |
| 27 | ||
| 28 | // logger = require( 'bunyan'). createLogg er({ | |
| 29 | // nam e: 'dummy- log', | |
| 30 | // lev el: 'debug ' | |
| 31 | // }); | |
| 32 | ||
| 33 | describe(' enterprise -sync-requ est-handle r.js', fun ction() { | |
| 34 | var pa tientIdent ifier = pa tientIdUti l.create(' icn', '500 0000126V40 6128'); | |
| 35 | var jp id; | |
| 36 | var jo b; | |
| 37 | var ho st = vx_sy nc_ip; | |
| 38 | var port = PORT ; | |
| 39 | var tu bename = ' vx-sync-te st'; | |
| 40 | ||
| 41 | var be anstalkCon fig = ({ | |
| 42 | re poUniversa l: { | |
| 43 | priority : 10, | |
| 44 | delay: 0 , | |
| 45 | ttr: 60, | |
| 46 | timeout: 10, | |
| 47 | initMill is: 1000, | |
| 48 | maxMilli s: 15000, | |
| 49 | incMilli s: 1000 | |
| 50 | }, | |
| 51 | re poDefaults : { | |
| 52 | host: ho st, | |
| 53 | port: po rt, | |
| 54 | tubename : tubename , | |
| 55 | tubePref ix: 'vxs-' , | |
| 56 | jobTypeF orTube: fa lse | |
| 57 | }, | |
| 58 | jo bTypes: { | |
| 59 | 'enterpr ise-sync-r equest': { }, | |
| 60 | 'vista-o perational -subscribe -request': {}, | |
| 61 | ||
| 62 | 'vista-9 E7A-subscr ibe-reques t': {}, | |
| 63 | 'vista-C 877-subscr ibe-reques t': {}, | |
| 64 | ||
| 65 | 'hdr-syn c-request' : {}, | |
| 66 | 'vler-sy nc-request ': {}, | |
| 67 | 'pgd-syn c-request' : {}, | |
| 68 | 'jmeadow s-sync-req uest': {}, | |
| 69 | ||
| 70 | 'hdr-xfo rm-vpr': { }, | |
| 71 | 'vler-xf orm-vpr': {}, | |
| 72 | 'pgd-xfo rm-vpr': { }, | |
| 73 | ||
| 74 | 'jmeadow s-sync-all ergy-reque st': {}, | |
| 75 | 'jmeadow s-sync-app ointment-r equest': { }, | |
| 76 | 'jmeadow s-sync-con sult-reque st': {}, | |
| 77 | 'jmeadow s-sync-dem ographics- request': {}, | |
| 78 | 'jmeadow s-sync-dis chargeSumm ary-reques t': {}, | |
| 79 | 'jmeadow s-sync-enc ounter-req uest': {}, | |
| 80 | 'jmeadow s-sync-imm unization- request': {}, | |
| 81 | 'jmeadow s-sync-lab -request': {}, | |
| 82 | 'jmeadow s-sync-med ication-re quest': {} , | |
| 83 | 'jmeadow s-sync-not e-request' : {}, | |
| 84 | 'jmeadow s-sync-ord er-request ': {}, | |
| 85 | 'jmeadow s-sync-pro blem-reque st': {}, | |
| 86 | 'jmeadow s-sync-pro gressNote- request': {}, | |
| 87 | 'jmeadow s-sync-rad iology-req uest': {}, | |
| 88 | 'jmeadow s-sync-vit al-request ': {}, | |
| 89 | ||
| 90 | 'jmeadow s-xform-al lergy-vpr' : {}, | |
| 91 | 'jmeadow s-xform-ap pointment- vpr': {}, | |
| 92 | 'jmeadow s-xform-co nsult-vpr' : {}, | |
| 93 | 'jmeadow s-xform-de mographics -vpr': {}, | |
| 94 | 'jmeadow s-xform-di schargeSum mary-vpr': {}, | |
| 95 | 'jmeadow s-xform-en counter-vp r': {}, | |
| 96 | 'jmeadow s-xform-im munization -vpr': {}, | |
| 97 | 'jmeadow s-xform-la b-vpr': {} , | |
| 98 | 'jmeadow s-xform-me dication-v pr': {}, | |
| 99 | 'jmeadow s-xform-no te-vpr': { }, | |
| 100 | 'jmeadow s-xform-or der-vpr': {}, | |
| 101 | 'jmeadow s-xform-pr oblem-vpr' : {}, | |
| 102 | 'jmeadow s-xform-pr ogressNote -vpr': {}, | |
| 103 | 'jmeadow s-xform-ra diology-vp r': {}, | |
| 104 | 'jmeadow s-xform-vi tal-vpr': {}, | |
| 105 | ||
| 106 | 'jmeadow s-pdf-docu ment-trans form': {}, | |
| 107 | 'jmeadow s-document -retrieval ': {}, | |
| 108 | ||
| 109 | 'record- enrichment ': {}, | |
| 110 | 'store-r ecord': {} , | |
| 111 | 'event-p rioritizat ion-reques t': {}, | |
| 112 | 'operati onal-store -record': {}, | |
| 113 | 'publish -data-chan ge-event': {}, | |
| 114 | 'patient -data-stat e-checker' : {} | |
| 115 | } | |
| 116 | }); | |
| 117 | ||
| 118 | ||
| 119 | var co nfig = { | |
| 120 | 'v istaSites' : { | |
| 121 | '9E7A': _.defaults (wConfig.v istaSites[ '9E7A'], { | |
| 122 | 'nam e': 'panor ama', | |
| 123 | 'host': ' IP ', | |
| 124 | 'port': PORT , | |
| 125 | 'accessCod e': ' REDACTED ', | |
| 126 | 'verifyCod e': ' REDACTED ', | |
| 127 | 'loc alIP': '12 7.0.0.1', | |
| 128 | 'loc alAddress' : 'localho st', | |
| 129 | 'con nectTimeou t': 3000, | |
| 130 | 'sen dTimeout': 10000 | |
| 131 | }), | |
| 132 | 'C877': _.defaults (wConfig.v istaSites. C877, { | |
| 133 | 'nam e': 'kodak ', | |
| 134 | 'host': ' IP ', | |
| 135 | 'port': PORT , | |
| 136 | 'accessCod e': ' REDACTED ', | |
| 137 | 'verifyCod e': ' REDACTED ', | |
| 138 | 'loc alIP': '12 7.0.0.1', | |
| 139 | 'loc alAddress' : 'localho st', | |
| 140 | 'con nectTimeou t': 3000, | |
| 141 | 'sen dTimeout': 10000 | |
| 142 | }) | |
| 143 | }, | |
| 144 | be anstalkCon fig: beans talkConfig , | |
| 145 | mv i: { | |
| 146 | protocol : 'http', | |
| 147 | host: vx _sync_ip, | |
| 148 | port: PORT , | |
| 149 | path: '/ mvi/corres pondingIds ' | |
| 150 | }, | |
| 151 | jd s: _.defau lts(wConfi g.jds, { | |
| 152 | protocol : 'http', | |
| 153 | host: ' IP ', | |
| 154 | port: PORT | |
| 155 | }) , | |
| 156 | ru les: { | |
| 157 | 'accept- all': {}, | |
| 158 | 'rapid-f ire': {}, | |
| 159 | // 'oper ational-da ta-sync': {}, | |
| 160 | 'expirat ion': { | |
| 161 | 'def ault': 360 0000, | |
| 162 | 'dod ': 3600000 | |
| 163 | } | |
| 164 | }, | |
| 165 | sy nchronizat ionRules: ['accept-a ll-rule'], | |
| 166 | 'h dr': { | |
| 167 | 'operati onMode': ' REQ/RES', | |
| 168 | 'hdrSite s': { | |
| 169 | 'FFC 7': { | |
| 170 | 'stationNu mber': '53 6' | |
| 171 | }, | |
| 172 | '293 9': { | |
| 173 | 'stationNu mber': '55 1' | |
| 174 | }, | |
| 175 | '76C 6': { | |
| 176 | 'stationNu mber': '54 7' | |
| 177 | } | |
| 178 | } | |
| 179 | }, | |
| 180 | 'v istaSitesB yStationCo mbined': _ .defaults( wConfig.vi staSitesBy StationCom bined, {}) | |
| 181 | }; | |
| 182 | ||
| 183 | var en vironment = { | |
| 184 | // publisher Router: {} , | |
| 185 | mv i: new Mvi Client(log ger, logge r, config) , | |
| 186 | jd s: new Jds Client(log ger, logge r, config) , | |
| 187 | me trics: log ger, | |
| 188 | vi staClient: new Vista Client(log ger, logge r, config, null) | |
| 189 | }; | |
| 190 | enviro nment.jobS tatusUpdat er = new J obStatusUp dater(logg er, config , environm ent.jds); | |
| 191 | // env ironment.p ublisherRo uter = new Publisher Router(log ger, confi g, environ ment.jobSt atusUpdate r); | |
| 192 | ||
| 193 | var ma tchingJobT ypes = [ | |
| 194 | jo bUtil.vist aSubscribe RequestTyp e('9E7A'), | |
| 195 | jo bUtil.vist aSubscribe RequestTyp e('C877'), | |
| 196 | jo bUtil.hdrS yncRequest Type(), | |
| 197 | // jobUtil.p gdSyncRequ estType(), | |
| 198 | jo bUtil.vler SyncReques tType(), | |
| 199 | // jobUtil.j meadowsSyn cRequestTy pe() // 5000000126 V406128 do es not hav e a DOD re cord | |
| 200 | ]; | |
| 201 | it('Se t up and r un test', function() { | |
| 202 | ||
| 203 | va r setUpDon e = false; | |
| 204 | ||
| 205 | ru ns(functio n() { | |
| 206 | environm ent.jds.st orePatient Identifier ({ | |
| 207 | pati entIdentif iers: [pat ientIdenti fier.value ] | |
| 208 | }, funct ion(error, response) { | |
| 209 | expe ct(error). toBeFalsy( ); | |
| 210 | ||
| 211 | jpid = val(res ponse, ['h eaders', ' location'] ); | |
| 212 | if(j pid){ | |
| 213 | jpid = jpi d.replace( /(^http:\/ \/.*\/vpr\ /jpid\/)/, ''); | |
| 214 | } | |
| 215 | ||
| 216 | job = jobUtil. createEnte rpriseSync Request(pa tientIdent ifier, jpi d, false); | |
| 217 | ||
| 218 | setU pDone = tr ue; | |
| 219 | }); | |
| 220 | }) ; | |
| 221 | ||
| 222 | wa itsFor(fun ction() { | |
| 223 | return s etUpDone; | |
| 224 | }, 'set up', 20000); | |
| 225 | ||
| 226 | ru ns(functio n() { | |
| 227 | testHand ler(handle r, logger, config, e nvironment , host, po rt, tubena me, job, m atchingJob Types, 900 00, functi on(result) { | |
| 228 | expe ct(result) .toBeTruth y(); | |
| 229 | }); | |
| 230 | }) ; | |
| 231 | }); | |
| 232 | ||
| 233 | afterE ach(functi on() { | |
| 234 | va r checkIde ntifiersDo ne = false ; | |
| 235 | // var expec tedPatient Identifier Values = [ '50000001 26V406128' , '9E7A;10 0625', 'C8 77;100625' , 'HDR;500 0000126V40 6128', 'DA S;50000001 26V406128' , 'VLER;50 00000126V4 06128' ]; | |
| 236 | va r expected PatientIde ntifierVal ues = ['50 00000126V4 06128', '9 E7A;100625 ', 'C877;1 00625', 'H DR;5000000 126V406128 ', 'JPID;' + jpid, ' VLER;50000 00126V4061 28']; | |
| 237 | va r jdsError , jdsRespo nse; | |
| 238 | ru ns(functio n() { | |
| 239 | environm ent.jds.ge tPatientId entifier(j ob, functi on(error, response) { | |
| 240 | chec kIdentifie rsDone = t rue; | |
| 241 | jdsE rror = err or; | |
| 242 | jdsR esponse = response; | |
| 243 | }); | |
| 244 | }) ; | |
| 245 | ||
| 246 | wa itsFor(fun ction() { | |
| 247 | return c heckIdenti fiersDone; | |
| 248 | }, 'response from JDS' , 10000); | |
| 249 | ||
| 250 | ||
| 251 | va r checkVhi cIdEventDo ne = false ; | |
| 252 | ru ns(functio n() { | |
| 253 | environm ent.jds.ge tPatientDa taByUid('u rn:va:vhic -id:JPID:' + jpid + ':' + jpid , function (error, re sponse, re sult) { | |
| 254 | chec kVhicIdEve ntDone = t rue; | |
| 255 | expe ct(error). toBeFalsy( ); | |
| 256 | expe ct(respons e).toBeTru thy(); | |
| 257 | expe ct(result) .toBeTruth y(); | |
| 258 | expe ct(val(res ult, ['dat a', 'items '])).toBeT ruthy(); | |
| 259 | var vhicIds = val(result , ['data', 'items', 0, 'vhicId s']); | |
| 260 | expe ct(vhicIds ).toBeTrut hy(); | |
| 261 | expe ct(vhicIds || []).to Contain(ja smine.obje ctContaini ng({ | |
| 262 | 'vhicId': '1325' | |
| 263 | })); | |
| 264 | }); | |
| 265 | }) ; | |
| 266 | wa itsFor(fun ction() { | |
| 267 | return c heckVhicId EventDone; | |
| 268 | }) ; | |
| 269 | ||
| 270 | va r teardown Done = fal se; | |
| 271 | ||
| 272 | ru ns(functio n() { | |
| 273 | expect(j dsError).t oBeFalsy() ; | |
| 274 | expect(j dsResponse ).toBeTrut hy(); | |
| 275 | expect(v al(jdsResp onse, 'sta tusCode')) .toEqual(2 00); | |
| 276 | ||
| 277 | var body ; | |
| 278 | try { | |
| 279 | body = JSON.pa rse(jdsRes ponse.body ); | |
| 280 | } catch (error) { | |
| 281 | // D o nothing | |
| 282 | } | |
| 283 | ||
| 284 | //Clean up the pat ient we cr eated for the test | |
| 285 | expect(v al(body, ' patientIde ntifiers') ).toEqual( expectedPa tientIdent ifierValue s); | |
| 286 | environm ent.jds.de letePatien tByPid(pat ientIdenti fier.value , function () { | |
| 287 | tear downDone = true; | |
| 288 | }); | |
| 289 | }) ; | |
| 290 | ||
| 291 | wa itsFor(fun ction() { | |
| 292 | return t eardownDon e; | |
| 293 | }, 'clear te st patient from JDS' ); | |
| 294 | }); | |
| 295 | ||
| 296 | }); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.