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\utils | pid-validator-spec.js | Mon Aug 21 12:51:00 2017 UTC |
| 2 | rdk.zip\rdk\product\production\rdk\src\utils | pid-validator-spec.js | Tue Oct 3 18:45:43 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 12 | 400 |
| Changed | 11 | 32 |
| 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 | /** | |
| 2 | * Created by alexlu ong on 5/2 6/15. | |
| 3 | */ | |
| 4 | ||
| 5 | 'use stric t'; | |
| 6 | ||
| 7 | var pidVal idator = r equire('./ pid-valida tor'); | |
| 8 | var app = { | |
| 9 | config : { | |
| 10 | vi staSites: { | |
| 11 | ' REDA C TED ': { | |
| 12 | divi sion: [ | |
| 13 | {id: '507' , name: 'K ODAK'}, | |
| 14 | {id: '613' , name: 'M ARTINSBURG '}, | |
| 15 | {id: '688' , name: 'W ASHINGTON' } | |
| 16 | ], | |
| 17 | host: ' IP ', | |
| 18 | localIP: ' IP ', | |
| 19 | loca lAddress: 'localhost ', | |
| 20 | port: PORT , | |
| 21 | prod uction: fa lse, | |
| 22 | accessCode : ' REDACTED ', | |
| 23 | verifyCode : ' REDACTED ', | |
| 24 | info ButtonOid: '1.3.6.1. 4.1.3768', | |
| 25 | abbr eviation: 'KDK', | |
| 26 | uatr acker: tru e | |
| 27 | }, | |
| 28 | ' R E D A CTED ': { | |
| 29 | divi sion: [ | |
| 30 | {id: '500' , name: 'P ANORAMA'} | |
| 31 | ], | |
| 32 | host: ' IP ', | |
| 33 | localIP: ' IP ', | |
| 34 | loca lAddress: 'localhost ', | |
| 35 | port: PORT , | |
| 36 | prod uction: fa lse, | |
| 37 | accessCode : ' REDACTED ', | |
| 38 | verifyCode : ' REDACTED ', | |
| 39 | info ButtonOid: '1.3.6.1. 4.1.3768', | |
| 40 | abbr eviation: 'PAN', | |
| 41 | uatr acker: tru e | |
| 42 | } | |
| 43 | } | |
| 44 | }, | |
| 45 | logger : sinon.st ub(require ('bunyan') .createLog ger({ | |
| 46 | na me: 'pid-v alidator-s pec' | |
| 47 | })) | |
| 48 | }; | |
| 49 | ||
| 50 | pidValidat or.initial ize(app); | |
| 51 | describe(' pid-valida tor', func tion() { | |
| 52 | var pa tientIdent ifiers; | |
| 53 | var re q; | |
| 54 | before Each(funct ion(){ | |
| 55 | pa tientIdent ifiers = { | |
| 56 | icn: '1V 1', | |
| 57 | dfn: '1' , | |
| 58 | currentSit eDfn: ' REDA C TED ;1', | |
| 59 | primarySit eDfn: ' R E D A CTED ;1', | |
| 60 | edipi: ' 01', | |
| 61 | pidEdipi : 'DOD;01' , | |
| 62 | hdr: 'HD R;50099823 V10209899' , | |
| 63 | hdrInval id: 'HDR;5 0099823102 09899', | |
| 64 | siteIcn: ' R E D A CTED ;1V1', | |
| 65 | invalidS iteIcn: 's ite;1v1', | |
| 66 | vhic: 'V HICID;4564 654' | |
| 67 | }; | |
| 68 | re q = {}; | |
| 69 | }); | |
| 70 | ||
| 71 | descri be('site c hecks', fu nction() { | |
| 72 | de scribe('co ntainsSite ', functio n() { | |
| 73 | it('shou ld determi ne if pid contains t he site', function() { | |
| 74 | expe ct(pidVali dator.cont ainsSite(p atientIden tifiers.si teIcn)).to .be.true() ; | |
| 75 | //co ntains sit e doesn't check the validity o f a site j ust that s omething i s present there. | |
| 76 | expe ct(pidVali dator.cont ainsSite(p atientIden tifiers.in validSiteI cn)).to.be .true(); | |
| 77 | expe ct(pidVali dator.cont ainsSite(p atientIden tifiers.ic n)).to.be. false(); | |
| 78 | expe ct(pidVali dator.cont ainsSite(' ;1')).to.b e.false(); | |
| 79 | }); | |
| 80 | }) ; | |
| 81 | de scribe('is CurrentSit e', functi on() { | |
| 82 | it('shou ld determi ne if pid site is th e site cur rently log ged in to' , function () { | |
| 83 | req = { | |
| 84 | session: { | |
| 85 | user: { | |
| 86 | site: ' REDA C TED ' | |
| 87 | } | |
| 88 | } | |
| 89 | }; | |
| 90 | expe ct(pidVali dator.isCu rrentSite( req, patie ntIdentifi ers.curren tSiteDfn)) .to.be.tru e(); | |
| 91 | expe ct(pidVali dator.isCu rrentSite( req, patie ntIdentifi ers.primar ySiteDfn)) .to.be.fal se(); | |
| 92 | expe ct(pidVali dator.isCu rrentSite( req, patie ntIdentifi ers.hdr)). to.be.fals e(); | |
| 93 | expe ct(pidVali dator.isCu rrentSite( req, patie ntIdentifi ers.primar ySiteDfn)) .to.be.fal se(); | |
| 94 | }); | |
| 95 | }) ; | |
| 96 | de scribe('is PrimarySit e', functi on() { | |
| 97 | it('shou ld determi ne if pid site is a primary si te', funct ion() { | |
| 98 | expe ct(pidVali dator.isPr imarySite( patientIde ntifiers.p rimarySite Dfn), 'a p rimary sit e;dfn shou ld return data').to. be.truthy( ); | |
| 99 | expe ct(pidVali dator.isPr imarySite( patientIde ntifiers.c urrentSite Dfn), 'a p rimary sit e;dfn shou ld return data').to. be.truthy( ); | |
| 100 | expe ct(pidVali dator.isPr imarySite( patientIde ntifiers.s iteIcn), ' a primary site;dfn s hould retu rn data'). to.be.trut hy(); | |
| 101 | expe ct(pidVali dator.isPr imarySite( patientIde ntifiers.e dipi), 'a non primar y site sho uld return false').t o.be.false (); | |
| 102 | expe ct(pidVali dator.isPr imarySite( patientIde ntifiers.h dr), 'a no n primary site shoul d return f alse').to. be.false() ; | |
| 103 | expe ct(pidVali dator.isPr imarySite( patientIde ntifiers.v hic), 'a n on primary site shou ld return false').to .be.false( ); | |
| 104 | }); | |
| 105 | }) ; | |
| 106 | de scribe('is SecondaryS ite', func tion() { | |
| 107 | it('shou ld determi ne if pid site is a secondary site', fun ction() { | |
| 108 | expe ct(pidVali dator.isSe condarySit e(patientI dentifiers .vhic), 'V HIC is a s econdary s ite').to.b e.true(); | |
| 109 | expe ct(pidVali dator.isSe condarySit e(patientI dentifiers .hdr), 'HD R is a sec ondary sit e').to.be. true(); | |
| 110 | expe ct(pidVali dator.isSe condarySit e(patientI dentifiers .pidEdipi) , 'DOD is a secondar y site').t o.be.true( ); | |
| 111 | expe ct(pidVali dator.isSe condarySit e(undefine d), 'undef ined is no t secondar y site').t o.be.false (); | |
| 112 | expe ct(pidVali dator.isSe condarySit e(patientI dentifiers .siteIcn), 'ICN with a precedi ng primary site is a not a sec ondary sit e').to.be. false(); | |
| 113 | expe ct(pidVali dator.isSe condarySit e(patientI dentifiers .invalidSi teIcn), 'I CN with a preceding unknown si te is not a secondar y site').t o.be.false (); | |
| 114 | expe ct(pidVali dator.isSe condarySit e(patientI dentifiers .primarySi teDfn), 'P rimary sit es are not secondary sites').t o.be.false (); | |
| 115 | expe ct(pidVali dator.isSe condarySit e(patientI dentifiers .currentSi teDfn), 'P rimary sit es are not secondary sites').t o.be.false (); | |
| 116 | expe ct(pidVali dator.isSe condarySit e(patientI dentifiers .edipi), ' edipi digi ts are not secondary sites').t o.be.false (); | |
| 117 | expe ct(pidVali dator.isSe condarySit e(patientI dentifiers .dfn), 'df n digits a re not sec ondary sit es').to.be .false(); | |
| 118 | expe ct(pidVali dator.isSe condarySit e(patientI dentifiers .icn), 'va lid ICNs a re not sec ondary sit es').to.be .false(); | |
| 119 | expe ct(pidVali dator.isSe condarySit e(patientI dentifiers .hdrInvali d), 'inval id HDR ICN s are not secondary site').to. be.false() ; | |
| 120 | }); | |
| 121 | }) ; | |
| 122 | }); | |
| 123 | ||
| 124 | descri be('patien t identifi er format checks', f unction() { | |
| 125 | de scribe('ic n regex', function() { | |
| 126 | it('shou ld match a valid icn ', functio n() { | |
| 127 | expe ct(pidVali dator.icnR egex.test( patientIde ntifiers.i cn)).to.be .true(); | |
| 128 | }); | |
| 129 | it('shou ld not mat ch an inva lid icn', function() { | |
| 130 | expe ct(pidVali dator.icnR egex.test( patientIde ntifiers.d fn)).to.be .false(); | |
| 131 | }); | |
| 132 | }) ; | |
| 133 | de scribe('df n regex', function() { | |
| 134 | it('shou ld match a valid dfn ', functio n() { | |
| 135 | expe ct(pidVali dator.dfnR egex.test( patientIde ntifiers.d fn)).to.be .true(); | |
| 136 | }); | |
| 137 | it('shou ld not mat ch an inva lid dfn', function() { | |
| 138 | expe ct(pidVali dator.dfnR egex.test( patientIde ntifiers.i cn)).to.be .false(); | |
| 139 | }); | |
| 140 | }) ; | |
| 141 | de scribe('is Icn', func tion() { | |
| 142 | it('shou ld determi ne if pid is icn', f unction() { | |
| 143 | expe ct(pidVali dator.isIc n(patientI dentifiers .icn)).to. be.true(); | |
| 144 | expe ct(pidVali dator.isIc n(patientI dentifiers .dfn)).to. be.false() ; | |
| 145 | }); | |
| 146 | }) ; | |
| 147 | de scribe('is SiteIcn', function() { | |
| 148 | it('shou ld determi ne if pid is site;ic n', functi on() { | |
| 149 | expe ct(pidVali dator.isSi teIcn(pati entIdentif iers.siteI cn)).to.be .true(); | |
| 150 | expe ct(pidVali dator.isSi teIcn(pati entIdentif iers.icn)) .to.be.fal se(); | |
| 151 | }); | |
| 152 | }) ; | |
| 153 | de scribe('is SiteDfn', function() { | |
| 154 | it('shou ld determi ne if pid is site;df n', functi on() { | |
| 155 | expe ct(pidVali dator.isSi teDfn(pati entIdentif iers.curre ntSiteDfn) ).to.be.tr ue(); | |
| 156 | expe ct(pidVali dator.isSi teDfn(pati entIdentif iers.dfn)) .to.be.fal se(); | |
| 157 | }); | |
| 158 | }) ; | |
| 159 | de scribe('is PidEdipi', function( ) { | |
| 160 | it('shou ld determi ne if pid is DOD;edi pi', funct ion() { | |
| 161 | expe ct(pidVali dator.isPi dEdipi(pat ientIdenti fiers.pidE dipi)).to. be.true(); | |
| 162 | expe ct(pidVali dator.isPi dEdipi(pat ientIdenti fiers.prim arySiteDfn )).to.be.f alse(); | |
| 163 | }); | |
| 164 | }) ; | |
| 165 | de scribe('is PidHdr', f unction() { | |
| 166 | it('shou ld determi ne if pid is HDR;<ic n>', funct ion() { | |
| 167 | expe ct(pidVali dator.isPi dHdr(patie ntIdentifi ers.hdr), 'should re turn false with a va lid icn'). to.be.true (); | |
| 168 | expe ct(pidVali dator.isPi dHdr(patie ntIdentifi ers.hdrInv alid), 'sh ould retur n false wi th an inva lid icn'). to.be.fals e(); | |
| 169 | }); | |
| 170 | }) ; | |
| 171 | }); | |
| 172 | ||
| 173 | descri be('pid va lidator ca n handle', function( ) { | |
| 174 | de scribe('wh en pid is empty', fu nction(){ | |
| 175 | it('cont ainsSite r eturns fal se', funct ion() { | |
| 176 | expe ct(pidVali dator.cont ainsSite() ).to.be.fa lse(); | |
| 177 | }); | |
| 178 | ||
| 179 | it('isCu rrentSite returns fa lse', func tion() { | |
| 180 | expe ct(pidVali dator.isCu rrentSite( )).to.be.f alse(); | |
| 181 | }); | |
| 182 | ||
| 183 | it('isPr imarySite returns fa lse', func tion() { | |
| 184 | expe ct(pidVali dator.isPr imarySite( )).to.be.f alse(); | |
| 185 | }); | |
| 186 | ||
| 187 | it('isSe condarySit e returns false', fu nction() { | |
| 188 | expe ct(pidVali dator.isSe condarySit e()).to.be .false(); | |
| 189 | }); | |
| 190 | ||
| 191 | it('isIc n returns false', fu nction() { | |
| 192 | expe ct(pidVali dator.isIc n()).to.be .false(); | |
| 193 | }); | |
| 194 | ||
| 195 | it('isSi teDfn retu rns false' , function () { | |
| 196 | expe ct(pidVali dator.isSi teDfn()).t o.be.false (); | |
| 197 | }); | |
| 198 | ||
| 199 | it('isPi dEdipi ret urns false ', functio n() { | |
| 200 | expe ct(pidVali dator.isPi dEdipi()). to.be.fals e(); | |
| 201 | }); | |
| 202 | ||
| 203 | it('isEd ipi return s false', function() { | |
| 204 | expe ct(pidVali dator.isEd ipi()).to. be.false() ; | |
| 205 | }); | |
| 206 | ||
| 207 | it('isVh ic returns false', f unction() { | |
| 208 | expe ct(pidVali dator.isVh ic()).to.b e.false(); | |
| 209 | }); | |
| 210 | ||
| 211 | it('isPi dHdr retur ns false', function( ) { | |
| 212 | expe ct(pidVali dator.isPi dHdr()).to .be.false( ); | |
| 213 | }); | |
| 214 | }) ; | |
| 215 | }); | |
| 216 | }); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.