122. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 10/4/2017 8:04:37 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.

122.1 Files compared

# Location File Last Modified
1 rdk.zip\rdk\product\production\rdk\src\write\orders\common orders-common-sign-vista-writer-itest-spec.js Mon Aug 21 12:51:00 2017 UTC
2 rdk.zip\rdk\product\production\rdk\src\write\orders\common orders-common-sign-vista-writer-itest-spec.js Tue Oct 3 19:02:59 2017 UTC

122.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 16 562
Changed 15 80
Inserted 0 0
Removed 0 0

122.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

122.4 Active regular expressions

No regular expressions were active.

122.5 Comparison detail

  1   'use stric t';
  2  
  3   var signVi staWriter  = require( './orders- common-sig n-vista-wr iter'),
  4       rpcCli entFactory  = require ('./../../ core/rpc-c lient-fact ory'),
  5       detail VistaWrite r = requir e('./order s-common-d etail-vist a-writer') ,
  6       crypto  = require ('crypto') ;
  7  
  8   //Tests si gn orders  routine -  Uncomment  to test lo cally
  9   //describe ("Checks s ign order  functional ity", func tion() {
  10   //    var  writebackC ontext = {
  11   //          pid: ' R E D A CTED ;100615',
  12   //         vistaConfi g: {
  13   //               host: ' IP          ',
  14   //               port:  PORT ,
  15   //               accessCode : ' PL      ',
  16   //               verifyCode : ' PL      !!',
  17   //               localIP: ' IP        ',
  18   //             localA ddress: 'l ocalhost'
  19   //         },
  20   //         model: {
  21   //             'dfn':  '100615',
  22   //             'provi der': '100 00000271',
  23   //             'locat ion': '285 ',
  24   //               'eSig':' PL      !!',
  25   //             'order List': [{
  26   //                 'o rderId': ' 38999;1'
  27   //             }],
  28   //             overri deReason:' foobar',
  29   //             orderC heckList:[ {
  30   //                 or derCheck:' 38999;1^11 ^2^Duplica te order:  HEMOGLOBIN  A1C BLOOD    SP LB # 18542 10/1 /15 [UNCOL LECTED]'
  31   //             },{
  32   //                 or derCheck:' 38999;1^11 ^2^Duplica te order:  HEMOGLOBIN  A1C BLOOD    SP LB # 18547 10/2 /15 [UNCOL LECTED]'
  33   //             },{
  34   //                 or derCheck:' 38999;1^24 ^2^Max lab  test orde r freq exc eeded for:  HEMOGLOBI N A1C'
  35   //             }]
  36   //         },
  37   //         logger: si non.stub(r equire('bu nyan').cre ateLogger( {name: 'si gn-vista-w riter'}))
  38   //    };
  39   //
  40   //    afte rEach(func tion () {
  41   //         rpcClientF actory.clo seRpcClien t(writebac kContext);
  42   //    });
  43   //
  44   //    it(' test sign  order work flow', fun ction(done ) {
  45   //         this.timeo ut(20000);
  46   //
  47   //         detailVist aWriter.ge tDetail(wr itebackCon text.model .orderList [0].orderI d, writeba ckContext,  function( err, resul t){
  48   //             //comp ute order  detail has h
  49   //             consol e.log("has h: " + cry pto.create Hash('md5' ).update(r esult).dig est('hex') );
  50   //             writeb ackContext .model.ord erList[0]. orderDetai lHash = cr ypto.creat eHash('md5 ').update( result).di gest('hex' );
  51   //
  52   //             signVi staWriter( writebackC ontext, fu nction(err , result)  {
  53   //                 co nsole.log( "\nERR: "  + JSON.str ingify(err ));
  54   //                 co nsole.log( "\nRESULT:  " + JSON. stringify( result));
  55   //                 do ne();
  56   //             });
  57   //
  58   //         });
  59   //    });
  60   //});
  61  
  62   describe(' Checks the  sign orde r send fun ctionality ', functio n() {
  63  
  64       var wr itebackCon text = {
  65           in terceptorR esults: {
  66                patientI dentifiers : {
  67                    'dfn ': '100615 ',
  68                      'siteDfn':  ' R E D A CTED ;100615',
  69                      'site': ' R E D A CTED '
  70                }
  71           },
  72           vi staConfig:  {
  73                  host: ' IP          ',
  74                  port:  PORT ,
  75                  accessCode : ' PL      ',
  76                  verifyCode : ' PL      !!',
  77                  localIP: ' IP        ',
  78                localAdd ress: 'loc alhost',
  79                noReconn ect: true
  80           },
  81           mo del: {
  82                'provide r': '10000 000238',
  83                'locatio n': '285',
  84                  'eSig': ' PL      !!',
  85                'orderDi alog': 'LR  OTHER LAB  TESTS',
  86                'display Group': '5 ',
  87                'quickOr derDialog' : '2',
  88                'inputLi st': [{
  89                    'inp utKey': '4 ',
  90                    'inp utValue':  '1191'
  91                }, {
  92                    'inp utKey': '1 26',
  93                    'inp utValue':  '1'
  94                }, {
  95                    'inp utKey': '1 27',
  96                    'inp utValue':  '72'
  97                }, {
  98                    'inp utKey': '1 80',
  99                    'inp utValue':  '9'
  100                }, {
  101                    'inp utKey': '2 8',
  102                    'inp utValue':  'SP'
  103                }, {
  104                    'inp utKey': '6 ',
  105                    'inp utValue':  'TODAY'
  106                }, {
  107                    'inp utKey': '2 9',
  108                    'inp utValue':  '28'
  109                }],
  110                'comment List': [{
  111                    'com ment': '~F or Test: A MIKACIN'
  112                }, {
  113                    'com ment': '~D ose is exp ected to b e at &UNKN OWN level. '
  114                }, {
  115                    'com ment': 'ad ditional c omment'
  116                }],
  117                'kind':  'Laborator y'
  118           },
  119           lo gger: sino n.stub(req uire('buny an').creat eLogger({
  120                name: 's ign-vista- writer'
  121           }) )
  122       };
  123  
  124       afterE ach(functi on() {
  125           rp cClientFac tory.close RpcClient( writebackC ontext);
  126       });
  127  
  128       //This  test will  create a  new lab or der in Vis ta.  Uncom ment to te st locally
  129       //it(' returns or der ien(s)  if the sa ve sign or der is suc cessful',  function ( done) {
  130       //
  131       //     writebackC ontext.int erceptorRe sults.pati entIdentif iers.dfn =  '100615';   //set mi ssing DFN
  132       //     this.timeo ut(20000);
  133       //     vistaWrite r.create(w ritebackCo ntext, fun ction (err , result)  {
  134       //         expect (err).to.b e.falsy();
  135       //         expect (writeback Context.vp rResponse) .to.be.tru thy();
  136       //         var js onObj = JS ON.parse(w ritebackCo ntext.vprR esponse);
  137       //
  138       //         writeb ackContext .model.ord erIdList =  [];
  139       //         writeb ackContext .model.ord erIdList.p ush(jsonOb j.localId  + ";1");
  140       //
  141       //         //sign  new lab o rder
  142       //         signVi staWriter. signOrderS end(writeb ackContext , function (err, resu lt){
  143       //             ex pect(err). to.be.fals y();
  144       //             ex pect(resul t).to.be.t ruthy();
  145       //             ex pect(resul t.length). to.be.equa l(1);
  146       //             do ne();
  147       //         });
  148       //     });
  149       //});
  150   });
  151  
  152   describe(' Checks the  validate  signature  functional ity', func tion() {
  153  
  154       var wr itebackCon text = {
  155             pid: ' R E D A CTED ;100615',
  156           vi staConfig:  {
  157                  host: ' IP          ',
  158                  port:  PORT ,
  159                  accessCode : ' PL      ',
  160                  verifyCode : ' PL      !!',
  161                  localIP: ' IP        ',
  162                localAdd ress: 'loc alhost'
  163           },
  164           mo del: {
  165                'dfn': ' 100615',
  166                'provide r': '10000 000238',
  167                'locatio n': '285',
  168                  'eSig': ' PL      !!'
  169  
  170           },
  171           lo gger: sino n.stub(req uire('buny an').creat eLogger({
  172                name: 's ign-vista- writer'
  173           }) )
  174       };
  175  
  176       var wr itebackCon text2 = {
  177             pid: ' R E D A CTED ;100615',
  178           vi staConfig:  {
  179                  host: ' IP          ',
  180                  port:  PORT ,
  181                  accessCode : ' PL      ',
  182                  verifyCode : ' PL      !!',
  183                  localIP: ' IP        ',
  184                localAdd ress: 'loc alhost'
  185           },
  186           mo del: {
  187                'dfn': ' 100615',
  188                'provide r': '10000 000238',
  189                'locatio n': '285',
  190                'eSig':  'shouldfai l!!'
  191  
  192           },
  193           lo gger: sino n.stub(req uire('buny an').creat eLogger({
  194                name: 's ign-vista- writer'
  195           }) )
  196       };
  197  
  198       afterE ach(functi on() {
  199           rp cClientFac tory.close RpcClient( writebackC ontext);
  200       });
  201  
  202       it('re turns true  if valida te signatu re is suce ssful', fu nction(don e) {
  203           th is.timeout (5000);
  204           si gnVistaWri ter.valida teSignatur e(writebac kContext,  function(e rr, result ) {
  205                expect(r esult).to. be.truthy( );
  206                expect(e rr).to.be. falsy();
  207                done();
  208           }) ;
  209       });
  210  
  211       it('re turns fals e if valid ate signat ure is uns uccessful' , function (done) {
  212           th is.timeout (7000);
  213           si gnVistaWri ter.valida teSignatur e(writebac kContext2,  function( err, resul t) {
  214                expect(r esult).to. equal('0') ;
  215                done();
  216           }) ;
  217       });
  218   });
  219  
  220   describe(' Checks the  order det ail compar ison funct ionality',  function( ) {
  221  
  222       var de tailWriteb ackContext  = {
  223             pid: ' R E D A CTED ;100615',
  224           vi staConfig:  {
  225                  host: ' IP          ',
  226                  port:  PORT ,
  227                  accessCode : ' PL      ',
  228                  verifyCode : ' PL      !!',
  229                  localIP: ' IP        ',
  230                localAdd ress: 'loc alhost',
  231                noReconn ect: true
  232           },
  233           lo gger: sino n.stub(req uire('buny an').creat eLogger({
  234                name: 'o rder-detai l-comparat or'
  235           }) )
  236       };
  237  
  238       afterE ach(functi on() {
  239           rp cClientFac tory.close RpcClient( detailWrit ebackConte xt);
  240       });
  241  
  242       it('te sts that o rder detai l matches  given hash  string',  function(d one) {
  243           va r self = t his;
  244           se lf.timeout (5000);
  245  
  246           // grab order  detail
  247           de tailVistaW riter.getD etail('125 19;1', det ailWriteba ckContext,  function( err, resul t) {
  248  
  249                expect(e rr).to.be. falsy();
  250                expect(r esult).to. be.truthy( );
  251  
  252                //comput e order de tail hash
  253                var hash  = crypto. createHash ('md5').up date(resul t).digest( 'hex');
  254  
  255                self.tim eout(5000) ;
  256                signVist aWriter.co mpareOrder Details('1 2519;1', h ash, detai lWriteback Context, f unction(er r, result)  {
  257                    expe ct(err).to .be.falsy( );
  258                    expe ct(result) .to.be.tru thy();
  259  
  260                    done ();
  261                });
  262           }) ;
  263       });
  264  
  265       it('te sts that o rder detai l fails to  match a g iven hash  string', f unction(do ne) {
  266           va r self = t his;
  267           se lf.timeout (5000);
  268           si gnVistaWri ter.compar eOrderDeta ils('12519 ;1', 'this isnotacorr ecthashval ue', detai lWriteback Context, f unction(er r, result)  {
  269                expect(e rr).to.be. falsy();
  270                expect(r esult).to. be.falsy() ;
  271  
  272                done();
  273           }) ;
  274       });
  275   });
  276  
  277   //describe ('Checks t he save or der check  functional ity', func tion() {
  278   //    //Te sts save o rder check  to sessio n routine  - Uncommen t to test  locally
  279   //    var  writebackC ontext = {
  280   //          pid: ' R E D A CTED ;100615',
  281   //         vistaConfi g: {
  282   //               host: ' IP          ',
  283   //               port:  PORT ,
  284   //               accessCode : ' PL      ',
  285   //               verifyCode : ' PL      !!',
  286   //               localIP: ' IP        ',
  287   //             localA ddress: 'l ocalhost'
  288   //         },
  289   //         model: {
  290   //             'dfn':  '100615',
  291   //             'provi der': '100 00000238',
  292   //             'locat ion': '285 ',
  293   //             'overr ideReason' : 'foobar' ,
  294   //             'order CheckList' : [
  295   //                 {
  296   //                      "orderCh eck": "389 58;1^11^2^ Duplicate  order: HEM OGLOBIN A1 C BLOOD    SP LB #185 32 9/29/15  [UNCOLLEC TED]^1"
  297   //                 },
  298   //                 {
  299   //                      "orderCh eck": "389 58;1^24^2^ Max lab te st order f req exceed ed for: HE MOGLOBIN A 1C^1"
  300   //                 },
  301   //                 {
  302   //                      "orderCh eck": "389 59;1^11^2^ Duplicate  order: GEN TAMICIN BL OOD   SERU M SP 9/29/ 15 [UNCOLL ECTED]^1"
  303   //                 }
  304   //             ]
  305   //         },
  306   //         logger: si non.stub(r equire('bu nyan').cre ateLogger( {name: 'si gn-vista-w riter'}))
  307   //    };
  308   //
  309   //    afte rEach(func tion() {
  310   //         rpcClientF actory.clo seRpcClien t(writebac kContext);
  311   //    });
  312   //
  313   //    it(' returns tr ue if the  save order  check is  successful ', functio n(done) {
  314   //         this.timeo ut(5000);
  315   //         signVistaW riter.save OrderCheck ForSession (writeback Context, f unction(er r, result)  {
  316   //             expect (result).t o.be.truth y();
  317   //             expect (err).to.b e.falsy();
  318   //             done() ;
  319   //         });
  320   //    });
  321   //});