835. EPMO Open Source Coordination Office Redaction File Detail Report

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.

835.1 Files compared

# Location File Last Modified
1 ehmp.zip\ehmp\ehmp\product\production\vx-sync\tests\integrationtests\handlers\event-prioritization-request event-prioritization-request-handler-itest-spec.js Mon Jul 10 17:46:22 2017 UTC
2 ehmp.zip\ehmp\ehmp\product\production\vx-sync\tests\integrationtests\handlers\event-prioritization-request event-prioritization-request-handler-itest-spec.js Tue Oct 3 12:48:15 2017 UTC

835.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 5 600
Changed 4 22
Inserted 0 0
Removed 0 0

835.3 Comparison options

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

835.4 Active regular expressions

No regular expressions were active.

835.5 Comparison detail

  1   'use stric t';
  2  
  3   require('. ./../../.. /env-setup ');
  4  
  5   var _ = re quire('und erscore');
  6  
  7   var logger  = require (global.VX _DUMMIES +  'dummy-lo gger');
  8   var jobUti l = requir e(global.V X_UTILS +  'job-utils ');
  9   var testHa ndler = re quire(glob al.VX_INTT ESTS + 'fr amework/ha ndler-test -framework ').testHan dler;
  10   var patien tIdUtil =  require(gl obal.VX_UT ILS + 'pat ient-ident ifier-util s');
  11   var handle r = requir e(global.V X_HANDLERS  + 'event- prioritiza tion-reque st/event-p rioritizat ion-reques t-handler' );
  12   var val =  require(gl obal.VX_UT ILS + 'obj ect-utils' ).getPrope rty;
  13  
  14   var testCo nfig = req uire(globa l.VX_INTTE STS + 'tes t-config') ;
  15   var vx_syn c_ip = tes tConfig.vx syncIP;
  16  
  17   var Publis herRouter  = require( global.VX_ JOBFRAMEWO RK).Publis herRouter;
  18   var JdsCli ent = requ ire(global .VX_SUBSYS TEMS + 'jd s/jds-clie nt');
  19   var JobSta tusUpdater  = require (global.VX _SUBSYSTEM S + 'jds/J obStatusUp dater');
  20   var wConfi g = requir e(global.V X_ROOT + ' worker-con fig');
  21  
  22   var host =  vx_sync_i p;
  23   var port =   PORT ;
  24   var tubena me = 'vx-s ync-test';
  25  
  26   // logger  = require( 'bunyan'). createLogg er({
  27   //     nam e: 'enterp rise-sync- request-ha ndler',
  28   //     lev el: 'debug '
  29   // });
  30  
  31   function g etConfigur ation() {
  32       var be anstalkCon fig = ({
  33           re poUniversa l: {
  34                priority : 10,
  35                delay: 0 ,
  36                ttr: 60,
  37                timeout:  10,
  38                initMill is: 1000,
  39                maxMilli s: 15000,
  40                incMilli s: 1000
  41           },
  42           re poDefaults : {
  43                host: ho st,
  44                port: po rt,
  45                tubename : tubename ,
  46                tubePref ix: 'vxs-' ,
  47                jobTypeF orTube: tr ue
  48           },
  49           jo bTypes: {
  50                'enterpr ise-sync-r equest': { },
  51  
  52                'record- enrichment ': {
  53                    "tub eDetails":  [{"ratio" : 5000, "p riority":  {"startVal ue": 1, "e ndValue":  20}}, {"ra tio": 3000 , "priorit y": {"star tValue": 2 1, "endVal ue": 40}},  {"ratio":  2000, "pr iority": { "startValu e": 41, "e ndValue":  60}}, {"ra tio": 1000 , "priorit y": {"star tValue": 6 1, "endVal ue": 80}},  {"ratio":  500, "pri ority": {" startValue ": 81, "en dValue": 1 00}}]
  54                },
  55                'store-r ecord': {} ,
  56                'event-p rioritizat ion-reques t': {},
  57                'operati onal-store -record':  {},
  58                'publish -data-chan ge-event':  {},
  59                'patient -data-stat e-checker' : {}
  60           }
  61       });
  62  
  63       return  {
  64           "e ventPriori tizationRu les": {
  65                "site-ty pe": {},
  66                "domain- type": {
  67                    "con sult": 20,
  68                    "all ergy": -20 ,
  69                    "ord er": 40
  70                }
  71           },
  72           'v istaSites' : {
  73                'AEDD':  _.defaults (wConfig.v istaSites[ '9E7A'], {
  74                    'nam e': 'panor ama',
  75                      'host': ' IP          ',
  76                      'port':  PORT ,
  77                      'accessCod e': ' REDACT ',
  78                      'verifyCod e': ' REDACTED ',
  79                    'loc alIP': '12 7.0.0.1',
  80                    'loc alAddress' : 'localho st',
  81                    'con nectTimeou t': 3000,
  82                    'sen dTimeout':  10000
  83                }),
  84                'ABCD':  _.defaults (wConfig.v istaSites. C877, {
  85                    'nam e': 'kodak ',
  86                      'host': ' IP          ',
  87                      'port':  PORT ,
  88                      'accessCod e': ' REDACT ',
  89                      'verifyCod e': ' REDACTED ',
  90                    'loc alIP': '12 7.0.0.1',
  91                    'loc alAddress' : 'localho st',
  92                    'con nectTimeou t': 3000,
  93                    'sen dTimeout':  10000
  94                })
  95           },
  96           be anstalkCon fig: beans talkConfig ,
  97           jd s: _.defau lts(wConfi g.jds, {
  98                protocol : 'http',
  99                  host: ' IP          ',
  100                  port:  PORT
  101           })
  102       };
  103   }
  104  
  105   function g etEnvironm ent(config ) {
  106       var en vironment  = {
  107           jd s: new Jds Client(log ger, logge r, config) ,
  108           me trics: log ger
  109       };
  110       enviro nment.jobS tatusUpdat er = new J obStatusUp dater(logg er, config , environm ent.jds);
  111       enviro nment.publ isherRoute r = new Pu blisherRou ter(logger , config,  environmen t.metrics,  environme nt.jobStat usUpdater) ;
  112  
  113       return  environme nt;
  114   }
  115  
  116   function g etTubeWith Job(result s, tubeNum ber) {
  117       return  _.find(re sults, fun ction(resu lt) {
  118           re turn resul t.tubename .slice(-1)  === tubeN umber;
  119       });
  120   }
  121  
  122   function s aveJobStat us(jdsClie nt, starte dEnterpris eSyncReque stState) {
  123       var fi nished;
  124       runs(f unction()  {
  125           jd sClient.sa veJobState (startedEn terpriseSy ncRequestS tate, func tion(error , response ) {
  126                expect(e rror).toBe Null();
  127                finished  = true;
  128           }) ;
  129       });
  130  
  131       waitsF or(functio n() { retu rn finishe d; }, 2000 0);
  132   }
  133  
  134   function s torePatien t(jdsClien t, patient Ids) {
  135       var jd sSave = {
  136           'p atientIden tifiers':  patientIds
  137       };
  138  
  139       var fi nished;
  140       runs(f unction()  {
  141           jd sClient.st orePatient Identifier (jdsSave,  function(e rror, resp onse) {
  142                expect(e rror).toBe Null();
  143                finished  = true;
  144           }) ;
  145       });
  146  
  147       waitsF or(functio n() { retu rn finishe d; }, 2000 0);
  148   }
  149  
  150   function c learJobSta tus(jdsCli ent, patie ntIdentifi er) {
  151       var fi nished;
  152       runs(f unction()  {
  153           jd sClient.cl earJobStat esByPatien tIdentifie r(patientI dentifier,  function( error, res ponse) {
  154                expect(e rror).toBe Null();
  155                finished  = true;
  156           }) ;
  157       });
  158  
  159       waitsF or(functio n() { retu rn finishe d; }, 2000 0);
  160   }
  161  
  162   describe(' event-prio ritization -request-h andler.js' , function () {
  163       descri be('domain  rules', f unction()  {
  164           it ('verify h andler cha nges prior itization  for order  domain and  puts job  in correct  tube', fu nction() {
  165                var conf ig = getCo nfiguratio n();
  166                var envi ronment =  getEnviron ment(confi g);
  167  
  168                var pati entIdentif ier = pati entIdUtil. create('ic n', '50000 00116V0000 01');
  169  
  170                var meta  = {
  171                    root JobId: 1,
  172                    prio rity: 50
  173                };
  174                var job  = jobUtil. createReco rdEnrichme nt(patient Identifier , 'order',  {data: '' }, meta);
  175  
  176                testHand ler(handle r, logger,  config, e nvironment , host, po rt, tubena me, job, [ job.type],  90000, fu nction(res ult) {
  177                    var  tube = get TubeWithJo b(result,  '5');
  178  
  179                    expe ct(tube).t oBeDefined ();
  180                    expe ct(tube.jo bs[0].prio rity).toBe (90);
  181                });
  182           }) ;
  183       });
  184  
  185       descri be('site r ules', fun ction() {
  186           de scribe('sy nced by ic n', functi on() {
  187                var star tedSyncByI cn  = {
  188                    jobI d: 1000002 ,
  189                    root JobId: 100 0003,
  190                    type : 'enterpr ise-sync-r equest',
  191                    time stamp: '14 1769865339 6',
  192                    prio rity: 30,
  193                    pati entIdentif ier: {
  194                         type: 'icn ',
  195                         value: '51 11100116V9 12830'
  196                    },
  197                    stat us: 'start ed'
  198                };
  199  
  200                var conf ig = getCo nfiguratio n();
  201                var envi ronment =  getEnviron ment(confi g);
  202                var pati entIdentif ier = {typ e: 'pid',  value: 'AE DD;3'};
  203  
  204                it('veri fy handler  changes p rioritizat ion for si te and put s job in c orrect tub e', functi on() {
  205                    stor ePatient(e nvironment .jds, [pat ientIdenti fier.value , startedS yncByIcn.p atientIden tifier.val ue]);
  206                    save JobStatus( environmen t.jds, sta rtedSyncBy Icn);
  207  
  208                    var  meta = {
  209                         rootJobId:  startedSy ncByIcn.ro otJobId,
  210                         priority:  50
  211                    };
  212                    var  job = jobU til.create RecordEnri chment(pat ientIdenti fier, 'med s', {data:  ''}, meta );
  213  
  214                    test Handler(ha ndler, log ger, confi g, environ ment, host , port, tu bename, jo b, [job.ty pe], 90000 , function (result) {
  215                         var tube =  getTubeWi thJob(resu lt, '3');
  216  
  217                         expect(tub e).toBeDef ined();
  218                         expect(tub e.jobs[0]. priority). toBe(50);
  219                    });
  220                });
  221  
  222                afterEac h(function () {
  223                    clea rJobStatus (environme nt.jds, pa tientIdent ifier);
  224                });
  225           }) ;
  226  
  227           de scribe('sy nced by my  site', fu nction() {
  228                var star tedSyncByP id  = {
  229                    jobI d: 1000000 ,
  230                    root JobId: 100 0001,
  231                    type : 'enterpr ise-sync-r equest',
  232                    time stamp: '14 1769865339 6',
  233                    prio rity: 30,
  234                    pati entIdentif ier: {
  235                         type: 'pid ',
  236                         value: 'AE DD;4'
  237                    },
  238                    stat us: 'start ed'
  239                };
  240  
  241                var conf ig = getCo nfiguratio n();
  242                var envi ronment =  getEnviron ment(confi g);
  243  
  244                it('veri fy handler  changes p rioritizat ion for si te and put s job in c orrect tub e', functi on() {
  245                    stor ePatient(e nvironment .jds, ['AB CD;4', sta rtedSyncBy Pid.patien tIdentifie r.value]);
  246                    save JobStatus( environmen t.jds, sta rtedSyncBy Pid);
  247  
  248                    var  meta = {
  249                         rootJobId:  startedSy ncByPid.ro otJobId,
  250                         priority:  50
  251                    };
  252                    var  job = jobU til.create RecordEnri chment(sta rtedSyncBy Pid.patien tIdentifie r, 'meds',  {data: '' }, meta);
  253  
  254                    test Handler(ha ndler, log ger, confi g, environ ment, host , port, tu bename, jo b, [job.ty pe], 90000 , function (result) {
  255                         var tube =  getTubeWi thJob(resu lt, '2');
  256  
  257                         expect(tub e).toBeDef ined();
  258                         expect(tub e.jobs[0]. priority). toBe(30);
  259                    });
  260                });
  261  
  262                afterEac h(function () {
  263                    clea rJobStatus (environme nt.jds, st artedSyncB yPid.patie ntIdentifi er);
  264                });
  265           }) ;
  266  
  267           de scribe('jo b for seco ndary site ', functio n() {
  268                var star tedSyncByP id  = {
  269                    jobI d: 1000004 ,
  270                    root JobId: 100 0005,
  271                    type : 'enterpr ise-sync-r equest',
  272                    time stamp: '14 1769865339 6',
  273                    prio rity: 30,
  274                    pati entIdentif ier: {
  275                         type: 'pid ',
  276                         value: 'AE DD;5'
  277                    },
  278                    stat us: 'start ed'
  279                };
  280                var seco ndarySiteP atientIden tifier = {
  281                    type : 'pid',
  282                    valu e: 'VLER;6 '
  283                };
  284  
  285                var conf ig = getCo nfiguratio n();
  286                var envi ronment =  getEnviron ment(confi g);
  287  
  288                it('veri fy handler  changes p rioritizat ion for si te and put s job in c orrect tub e when enr iching sec ondary sit e data', f unction()  {
  289                    stor ePatient(e nvironment .jds, [sec ondarySite PatientIde ntifier.va lue, start edSyncByPi d.patientI dentifier. value]);
  290                    save JobStatus( environmen t.jds, sta rtedSyncBy Pid);
  291  
  292                    var  meta = {
  293                         rootJobId:  startedSy ncByPid.ro otJobId,
  294                         priority:  50
  295                    };
  296                    var  job = jobU til.create RecordEnri chment(sec ondarySite PatientIde ntifier, ' meds', {da ta: ''}, m eta);
  297  
  298                    test Handler(ha ndler, log ger, confi g, environ ment, host , port, tu bename, jo b, [job.ty pe], 90000 , function (result) {
  299                         var tube =  getTubeWi thJob(resu lt, '4');
  300  
  301                         expect(tub e).toBeDef ined();
  302                         expect(tub e.jobs[0]. priority). toBe(70);
  303                    });
  304                });
  305  
  306                afterEac h(function () {
  307                    clea rJobStatus (environme nt.jds, st artedSyncB yPid.patie ntIdentifi er);
  308                });
  309           }) ;
  310       });
  311   });