Produced by Araxis Merge on 10/3/2017 11:16:02 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\utils\patient-record-retirement\retirementruleengine | patients-assigned-cds-panel-rule-itest-spec.js | Mon Jul 10 17:46:22 2017 UTC |
| 2 | ehmp.zip\ehmp\ehmp\product\production\vx-sync\tests\integrationtests\utils\patient-record-retirement\retirementruleengine | patients-assigned-cds-panel-rule-itest-spec.js | Tue Oct 3 13:13:39 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 326 |
| 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 | /*global d escribe, i t, beforeE ach, after Each, expe ct, runs, waitsFor * / | |
| 2 | /*jslint n ode: true */ | |
| 3 | 'use stric t'; | |
| 4 | ||
| 5 | var _ = re quire('und erscore'); | |
| 6 | ||
| 7 | require('. ./../../.. /../env-se tup'); | |
| 8 | var Retire mentRulesE ngine = re quire(glob al.VX_RETI REMENTRULE S + '/rule s-engine') ; | |
| 9 | var wConfi g = requir e(global.V X_ROOT + ' worker-con fig'); | |
| 10 | var JdsCli ent = requ ire(global .VX_SUBSYS TEMS + 'jd s/jds-clie nt'); | |
| 11 | var val = require(gl obal.VX_UT ILS + 'obj ect-utils' ).getPrope rty; | |
| 12 | ||
| 13 | var patien tIdentifie rs = [{ | |
| 14 | 'type' : 'pid', | |
| 15 | 'value ': 'AAAA;1 ' | |
| 16 | }, { | |
| 17 | 'type' : 'pid', | |
| 18 | 'value ': 'BBBB;1 ' | |
| 19 | }, { | |
| 20 | 'type' : 'pid', | |
| 21 | 'value ': 'DOD;11 11111' | |
| 22 | }]; | |
| 23 | ||
| 24 | var oneDay Ago = new Date(); | |
| 25 | var overAY earAgo = n ew Date(); | |
| 26 | oneDayAgo. setDate(on eDayAgo.ge tDate() - 1); | |
| 27 | overAYearA go.setDate (overAYear Ago.getDat e() - 370) ; | |
| 28 | ||
| 29 | var patien tIds = [{ | |
| 30 | value: '9E7A;3', | |
| 31 | type: 'PID', | |
| 32 | cdsPan el: true, | |
| 33 | lastAc cessed: ov erAYearAgo | |
| 34 | }, { | |
| 35 | type: 'icn', | |
| 36 | value: '10107V39 5912' | |
| 37 | }, { | |
| 38 | value: '30239423 4V323425', | |
| 39 | type: 'ICN', | |
| 40 | cdsPan el: true, | |
| 41 | lastAc cessed: ov erAYearAgo | |
| 42 | }, { | |
| 43 | value: 'DOD;0000 000003', | |
| 44 | type: 'PID', | |
| 45 | cdsPan el: true, | |
| 46 | lastAc cessed: ov erAYearAgo | |
| 47 | }]; | |
| 48 | ||
| 49 | var patien tsAssigned CdsPanelJo b = { | |
| 50 | 'type' : 'patient s-assigned -cds-panel ', | |
| 51 | 'patie ntIdentifi er': patie ntIdentifi ers[2], | |
| 52 | 'rootJ obId': '1' , | |
| 53 | 'jobId ': '5' | |
| 54 | }; | |
| 55 | ||
| 56 | var log = require(gl obal.VX_DU MMIES + 'd ummy-logge r'); | |
| 57 | var config = { | |
| 58 | vistaS ites: { | |
| 59 | 'A AAA': {}, | |
| 60 | 'B BBB': {} | |
| 61 | }, | |
| 62 | jds: _ .defaults( wConfig.jd s, { | |
| 63 | pr otocol: 'h ttp', | |
| 64 | host: ' IP ', | |
| 65 | port: PORT | |
| 66 | }), | |
| 67 | record Retirement : { | |
| 68 | ru les: { | |
| 69 | 'patient s-assigned -cds-panel ': { | |
| 70 | 'def ault': 600 00 | |
| 71 | } | |
| 72 | } | |
| 73 | } | |
| 74 | }; | |
| 75 | var enviro nment = { | |
| 76 | 'jds': new JdsCl ient(log, log, confi g), | |
| 77 | 'metri cs': log | |
| 78 | }; | |
| 79 | ||
| 80 | var engine = new Ret irementRul esEngine(l og, config , environm ent); | |
| 81 | var jpid; | |
| 82 | ||
| 83 | describe(' patients-a ssigned-cd s-panel', function() { | |
| 84 | before Each(funct ion() { | |
| 85 | va r finished = false; | |
| 86 | ru ns(functio n() { | |
| 87 | environm ent.jds.st orePatient Identifier ({ | |
| 88 | 'pat ientIdenti fiers': _. pluck(pati entIdentif iers, 'val ue') | |
| 89 | }, funct ion() { | |
| 90 | envi ronment.jd s.getPatie ntIdentifi er({ | |
| 91 | 'patientId entifier': patientId entifiers[ 0] | |
| 92 | }, f unction(er ror, respo nse, resul t) { | |
| 93 | if (error) { | |
| 94 | consol e.log(erro r); | |
| 95 | } | |
| 96 | //jpid = r esult.jpid ; | |
| 97 | //patients AssignedCd sPanelJob. jpid = jpi d; | |
| 98 | var starte dState = _ .clone(pat ientsAssig nedCdsPane lJob); | |
| 99 | startedSta te.status = 'started '; | |
| 100 | startedSta te.timesta mp = Date. now().toSt ring(); | |
| 101 | environmen t.jds.save JobState(s tartedStat e, functio n() { | |
| 102 | finish ed = true; | |
| 103 | }); | |
| 104 | }); | |
| 105 | }); | |
| 106 | }) ; | |
| 107 | ||
| 108 | wa itsFor(fun ction() { | |
| 109 | return f inished; | |
| 110 | }) ; | |
| 111 | }); | |
| 112 | ||
| 113 | it('le ts all ide ntifiers t hrough whe n unsynced ', functio n() { | |
| 114 | va r finished = false; | |
| 115 | ru ns(functio n() { | |
| 116 | engine.p rocessReti rementRule s(patientI ds, functi on(error, ids) { | |
| 117 | expe ct(val(ids , 'length' )).toBe(4) ; | |
| 118 | fini shed = tru e; | |
| 119 | }); | |
| 120 | }) ; | |
| 121 | ||
| 122 | wa itsFor(fun ction() { | |
| 123 | return f inished; | |
| 124 | }) ; | |
| 125 | }); | |
| 126 | ||
| 127 | it('in tercepts i dentifiers for non-e xpired dat a when not forced', function() { | |
| 128 | va r finished = false; | |
| 129 | ru ns(functio n() { | |
| 130 | var comp letedEnter priseJob = _.clone(p atientsAss ignedCdsPa nelJob); | |
| 131 | complete dEnterpris eJob.statu s = 'compl eted'; | |
| 132 | complete dEnterpris eJob.times tamp = (Da te.now() - 10000).to String(); | |
| 133 | ||
| 134 | //var co mpletedDod Job = _.cl one(jmeado wsJob); | |
| 135 | //comple tedDodJob. status = ' completed' ; | |
| 136 | //comple tedDodJob. timestamp = (Date.no w() - 9000 ).toString (); | |
| 137 | ||
| 138 | environm ent.jds.sa veJobState (completed Enterprise Job, funct ion() { | |
| 139 | //en vironment. jds.saveJo bState(com pletedDodJ ob, functi on() { | |
| 140 | engi ne.process Retirement Rules(pati entIds, fu nction(err or, ids) { | |
| 141 | expect(val (ids, 'len gth')).toB e(4); | |
| 142 | finished = true; | |
| 143 | }); | |
| 144 | //}) ; | |
| 145 | }); | |
| 146 | }) ; | |
| 147 | ||
| 148 | wa itsFor(fun ction() { | |
| 149 | return f inished; | |
| 150 | }) ; | |
| 151 | }); | |
| 152 | ||
| 153 | afterE ach(functi on() { | |
| 154 | va r finished = false; | |
| 155 | ru ns(functio n() { | |
| 156 | environm ent.jds.de letePatien tByPid(pat ientIdenti fiers[0].v alue, func tion() { | |
| 157 | fini shed = tru e; | |
| 158 | }); | |
| 159 | }) ; | |
| 160 | ||
| 161 | wa itsFor(fun ction() { | |
| 162 | return f inished; | |
| 163 | }, 10000); | |
| 164 | }); | |
| 165 | }); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.