42. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 4/18/2019 5:55:21 PM Eastern 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.

42.1 Files compared

# Location File Last Modified
1 MCCF_EDI_TAS_TASCore v2.0_Build_10.zip\MCCF_EDI_TAS_API_Core\src\test endpoint-fsc-837.js Wed Apr 3 02:27:36 2019 UTC
2 MCCF_EDI_TAS_TASCore v2.0_Build_10.zip\MCCF_EDI_TAS_API_Core\src\test endpoint-fsc-837.js Mon Apr 15 17:59:44 2019 UTC

42.2 Comparison summary

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

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

42.4 Active regular expressions

No regular expressions were active.

42.5 Comparison detail

  1   "use stric t"
  2  
  3   const debu g = requir e('debug') ('test')
  4  
  5   const $tas  = require ('../tas') ()
  6   const busi ness = req uire('../a pp/fsc/837 /business' )
  7   const {
  8       app,
  9       chai
  10   } = $tas.c haiTest()
  11   const expe ct = chai. expect
  12   const shou ld = chai. should()
  13   const util  = require ('util')
  14  
  15  
  16   let nock
  17   try {
  18       nock =  require(' nock')
  19   } catch (e x) {}
  20  
  21   let mock_c laim = req uire('./fs c-837/mock -claim')
  22  
  23   /***
  24  
  25    DJH 6/5/2 018
  26  
  27    Ensure th at TAS_ENA BLE_HTTP i s set in e nvironment , setting  it in code  will not  work
  28    process.e nv.TAS_ENA BLE_HTTP =  true
  29  
  30    */
  31  
  32   //if (nock  && $tas.c onfig.ENAB LE_HTTP == = true) {
  33  
  34   describe(" regex", fu nction ()  {
  35       it("re gex", func tion (done ) {
  36           co nst regex  = /(\d+\|) (\d+)(.*)/ gm
  37           co nst str =  `681|391^P N^681^USVH A|A`
  38           le t _new = s tr.replace (regex, "$ 1IBTAS,APP LICATION P ROXY$3")
  39           de bug(_new)
  40           do ne()
  41       })
  42   })
  43  
  44  
  45   describe(" load test  rabbitmq",  function  () {
  46  
  47  
  48       it("li stens / ad ds to queu e / waits  (observabl e)", async  () => {
  49           if  (!process .env.TAS_Q UEUE_ADDRE SS && proc ess.env.TA S_QUEUE_AD DRESS !==  'undefined ') {
  50                return
  51           }
  52           le t queues =  []
  53           co nst TEST_I D = +new D ate()
  54           co nst prefix QueueName  = name =>  'TEST_' +  TEST_ID +  name
  55           co nst queue_ name = pre fixQueueNa me($tas.he lpers.idge n.generate (this.titl e))
  56           qu eues.push( queue_name )
  57           co nst obj =  {
  58                a: 1,
  59                b: 2
  60           }
  61           le t complete d = {}
  62  
  63           tr y {
  64                await $t as.provide rs.amqp.co nnect(proc ess.env.TA S_QUEUE_AD DRESS)
  65                await $t as.provide rs.amqp.en sureSendCh annel(queu e_name)
  66           }  catch (ex)  {
  67                debug('a mqp::conne ct() faile d ' + util .inspect(e x))
  68                return
  69           }
  70  
  71           le t files =  new Array( 100)
  72           fo r (let i =  0; i < 10 0; i++) {
  73                files.pu sh(obj)
  74           }
  75           le t n = 0
  76  
  77           aw ait Promis e.all(file s.map(asyn c (file) = > {
  78                n = n++
  79                await $t as.provide rs.amqp.se nd(queue_n ame, Objec t.assign({ }, obj, {
  80                    n
  81                }))
  82                //debug( 'push comp lete')
  83           }) )
  84  
  85           //  await $ta s.helpers. process.wh en(() => O bject.keys (completed ).length <  100, () = > {
  86           //      debug ('length',  Object.ke ys(complet ed).length )
  87           //  })
  88           aw ait $tas.p roviders.a mqp.close( )
  89       }).tim eout(10000 000)
  90  
  91   })
  92  
  93   describe(" POST /api/ fsc/v2/837  with nock  - 1", ()  => {
  94       before (async ()  => {
  95           ap p.start()
  96  
  97           mo ck_claim.C ONFIG.vist aInstance  = 'eBillin g_sqa' //  do not do  this, meta base::comm on not ini tialized / / await bu siness.tem plateInsta nceHelper( null, 681)
  98  
  99           le t iens_url  = busines s.TEMPLATE _fsc_837_i ens_url(mo ck_claim.C ONFIG)
  100  
  101           //  N.B. You  must have  a respone  for every  request, s ince we ar e running  two tests
  102           le t fhir_ser ver_claim_ response =  nock(mock _claim.CON FIG.tasFHI REndpoint)
  103                .get(ien s_url)
  104                .reply(2 00, mock_c laim.MOCK_ FSC_837_IE NS_FOR_MOC HA)
  105  
  106           le t fhir_ser ver_claim_ response1  = nock(moc k_claim.CO NFIG.tasFH IREndpoint )
  107                .get(bus iness.TEMP LATE_fsc_8 37_iens_ur l(mock_cla im.CONFIG) )
  108                .reply(2 00, mock_c laim.MOCK_ FSC_837_IE NS_FOR_MOC HA)
  109  
  110             // url:"ht tps:// DNS . URL /VA-FHIR-S erver/fhir /Bundle?us e=837&loca tion=681&_ id=2113071 "
  111  
  112           // debug('GET : ', busin ess.TEMPLA TE_fsc_837 _bundle_ur l(mock_cla im.CONFIG,  837, 2113 071))
  113           le t fhir_ser ver_claim_ response_d etail1 = n ock(mock_c laim.CONFI G.tasFHIRE ndpoint)
  114                //.get(' /Bundle?us e=837&loca tion=681&_ id=2113071 ')
  115                .get(bus iness.TEMP LATE_fsc_8 37_bundle_ url(mock_c laim.CONFI G, 837, 21 13071))
  116                .reply(2 00, mock_c laim.MOCK_ FSC_837_FO R_MOCHA)
  117  
  118           le t fhir_ser ver_claim_ response_d etail2 = n ock(mock_c laim.CONFI G.tasFHIRE ndpoint)
  119                //.get(' /Bundle?us e=837&loca tion=681&_ id=2113072 ')
  120                .get(bus iness.TEMP LATE_fsc_8 37_bundle_ url(mock_c laim.CONFI G, 837, 21 13072))
  121                .reply(2 00, mock_c laim.MOCK_ FSC_837_FO R_MOCHA)
  122  
  123  
  124             // url:"ht tps:// DNS . URL /VA-FHIR-S erver/fhir /Bundle?us e=837&loca tion=681&_ id=2113071 "
  125           le t fhir_ser ver_claim_ response_d etail3 = n ock(mock_c laim.CONFI G.tasFHIRE ndpoint)
  126                //.get(' /Bundle?us e=837&loca tion=681&_ id=2113071 ')
  127                .get(bus iness.TEMP LATE_fsc_8 37_bundle_ url(mock_c laim.CONFI G, 837, 21 13071))
  128                .reply(2 00, mock_c laim.MOCK_ FSC_837_FO R_MOCHA)
  129  
  130           le t fhir_ser ver_claim_ response_d etail4 = n ock(mock_c laim.CONFI G.tasFHIRE ndpoint)
  131                //.get(' /Bundle?us e=837&loca tion=681&_ id=2113072 ')
  132                .get(bus iness.TEMP LATE_fsc_8 37_bundle_ url(mock_c laim.CONFI G, 837, 21 13072))
  133                .reply(2 00, mock_c laim.MOCK_ FSC_837_FO R_MOCHA)
  134  
  135  
  136           // debug('PUT : ', busin ess.TEMPLA TE_fsc_837 _writeback _url(mock_ claim.CONF IG, '837WB ', 2113071 ))
  137           no ck(mock_cl aim.CONFIG .tasFHIREn dpoint)
  138                //.get(' /Bundle?us e=837&loca tion=681&_ id=2113071 ')
  139                .put(bus iness.TEMP LATE_fsc_8 37_writeba ck_url(moc k_claim.CO NFIG, '837 WB', 21130 71))
  140                .reply(2 00, {
  141                    'hap py': 'happ y joy joy'
  142                })
  143  
  144           no ck(mock_cl aim.CONFIG .tasFHIREn dpoint)
  145                //.get(' /Bundle?us e=837&loca tion=681&_ id=2113072 ')
  146                .put(bus iness.TEMP LATE_fsc_8 37_writeba ck_url(moc k_claim.CO NFIG, '837 WB', 21130 72))
  147                .reply(2 00, {
  148                    'hap py': 'happ y joy joy'
  149                })
  150  
  151       })
  152       after( () => {
  153           ap p.stop()
  154           no ck.cleanAl l()
  155       })
  156  
  157  
  158       it("ha ppy path",  async fun ction () {
  159           // let iamVis taIds  = a wait $tas. command.ru n('metabas e','data', 'load',{na mes: 'vist aid,samAcc ountName'} ,{'secid': 'IBTAS,APP LICATION P ROXY'})
  160           // debug(iamV istaIds)
  161           //  done()
  162  
  163           th is.timeout (5000)
  164           aw ait $tas.c ache.flush ()
  165           aw ait $tas.p roviders.m emory.rese tDatabase( )
  166           aw ait $tas.c ommand.run ('metabase ', 'iam',  'init')
  167           aw ait $tas.c ommand.run ('metabase ', 'data',  'init')
  168  
  169  
  170           le t testConf ig = Objec t.assign({ }, mock_cl aim.CONFIG )
  171           te stConfig.d escription  = "happy  path (with  amqp avai lable)"
  172  
  173           //  N.B.!
  174           te stConfig.q ueueAddres s = proces s.env.TAS_ QUEUE_ADDR ESS
  175  
  176           //  chai.requ est(DEV_SE RVER)
  177           co nst res =  await chai .request(a pp.baseAdd ress())
  178                //chai.r equest('ht tp://local host:3000' )
  179                .post('/ api/fsc/v2 ')
  180                .set('se cid', 'IBT AS,APPLICA TION PROXY ')
  181                .send({
  182                    para ms: testCo nfig
  183                })
  184           if  (!process .env.TAS_Q UEUE_ADDRE SS && proc ess.env.TA S_QUEUE_AD DRESS !==  'undefined ') {
  185                expect(r es).to.hav e.status(2 00)
  186                let body  = res.bod y
  187                // not s ure why js on is empt y
  188                expect(b ody[0].bun dleUrls.st atusCode). to.eq(200)
  189                expect(b ody[0].cla ims.status Code).to.e q(500)
  190                expect(b ody[0].con fig.status Code).to.e q(200)
  191                expect(b ody[0].ien s.statusCo de).to.eq( 200)
  192                expect(b ody[0].cla ims.summar y.bundleSu ccess).to. eq(2)
  193                expect(b ody[0].cla ims.summar y.queueWri teFailure) .to.eq(2)
  194                expect(b ody[0].cla ims.summar y.writeBac kSkip).to. eq(2)
  195           }  else {
  196                expect(r es).to.hav e.status(2 00)
  197                let body  = res.bod y
  198                // not s ure why js on is empt y
  199                expect(b ody[0].bun dleUrls.st atusCode). to.eq(200)
  200                expect(b ody[0].cla ims.status Code).to.e q(200)
  201                expect(b ody[0].con fig.status Code).to.e q(200)
  202                expect(b ody[0].ien s.statusCo de).to.eq( 200)
  203                expect(b ody[0].cla ims.summar y.bundleSu ccess).to. eq(2)
  204                expect(b ody[0].cla ims.summar y.queueWri teSuccess) .to.eq(2)
  205                expect(b ody[0].cla ims.summar y.writeBac kSuccess). to.eq(2)
  206           }
  207       })
  208   })
  209  
  210   describe(" POST /api/ fsc/v2/837  with nock  - 2", fun ction () {
  211       before (() => {
  212           ap p.start()
  213           mo ck_claim.C ONFIG.vist aInstance  = "eBillin g_dev" //b usiness.te mplateInst anceHelper (null, 681 )
  214  
  215           le t iens_url  = busines s.TEMPLATE _fsc_837_i ens_url(mo ck_claim.C ONFIG)
  216  
  217           //  N.B. You  must have  a respone  for every  request, s ince we ar e running  two tests
  218           le t fhir_ser ver_claim_ response =  nock(mock _claim.CON FIG.tasFHI REndpoint)
  219                .get(ien s_url)
  220                .reply(2 00, mock_c laim.MOCK_ FSC_837_IE NS_FOR_MOC HA)
  221  
  222           le t fhir_ser ver_claim_ response1  = nock(moc k_claim.CO NFIG.tasFH IREndpoint )
  223                .get(bus iness.TEMP LATE_fsc_8 37_iens_ur l(mock_cla im.CONFIG) )
  224                .reply(2 00, mock_c laim.MOCK_ FSC_837_IE NS_FOR_MOC HA)
  225  
  226             // url:"ht tps:// DNS . URL /VA-FHIR-S erver/fhir /Bundle?us e=837&loca tion=681&_ id=2113071 "
  227  
  228           // debug('GET : ', busin ess.TEMPLA TE_fsc_837 _bundle_ur l(mock_cla im.CONFIG,  837, 2113 071))
  229           le t fhir_ser ver_claim_ response_d etail1 = n ock(mock_c laim.CONFI G.tasFHIRE ndpoint)
  230                //.get(' /Bundle?us e=837&loca tion=681&_ id=2113071 ')
  231                .get(bus iness.TEMP LATE_fsc_8 37_bundle_ url(mock_c laim.CONFI G, 837, 21 13071))
  232                .reply(2 00, mock_c laim.MOCK_ FSC_837_FO R_MOCHA)
  233  
  234           le t fhir_ser ver_claim_ response_d etail2 = n ock(mock_c laim.CONFI G.tasFHIRE ndpoint)
  235                //.get(' /Bundle?us e=837&loca tion=681&_ id=2113072 ')
  236                .get(bus iness.TEMP LATE_fsc_8 37_bundle_ url(mock_c laim.CONFI G, 837, 21 13072))
  237                .reply(2 00, mock_c laim.MOCK_ FSC_837_FO R_MOCHA)
  238  
  239  
  240             // url:"ht tps:// DNS . URL /VA-FHIR-S erver/fhir /Bundle?us e=837&loca tion=681&_ id=2113071 "
  241           le t fhir_ser ver_claim_ response_d etail3 = n ock(mock_c laim.CONFI G.tasFHIRE ndpoint)
  242                //.get(' /Bundle?us e=837&loca tion=681&_ id=2113071 ')
  243                .get(bus iness.TEMP LATE_fsc_8 37_bundle_ url(mock_c laim.CONFI G, 837, 21 13071))
  244                .reply(2 00, mock_c laim.MOCK_ FSC_837_FO R_MOCHA)
  245  
  246           le t fhir_ser ver_claim_ response_d etail4 = n ock(mock_c laim.CONFI G.tasFHIRE ndpoint)
  247                //.get(' /Bundle?us e=837&loca tion=681&_ id=2113072 ')
  248                .get(bus iness.TEMP LATE_fsc_8 37_bundle_ url(mock_c laim.CONFI G, 837, 21 13072))
  249                .reply(2 00, mock_c laim.MOCK_ FSC_837_FO R_MOCHA)
  250  
  251  
  252           // debug('PUT : ', busin ess.TEMPLA TE_fsc_837 _writeback _url(mock_ claim.CONF IG, '837WB ', 2113071 ))
  253           no ck(mock_cl aim.CONFIG .tasFHIREn dpoint)
  254                //.get(' /Bundle?us e=837&loca tion=681&_ id=2113071 ')
  255                .put(bus iness.TEMP LATE_fsc_8 37_writeba ck_url(moc k_claim.CO NFIG, '837 WB', 21130 71))
  256                .reply(2 00, {
  257                    'hap py': 'happ y joy joy'
  258                })
  259  
  260           no ck(mock_cl aim.CONFIG .tasFHIREn dpoint)
  261                //.get(' /Bundle?us e=837&loca tion=681&_ id=2113072 ')
  262                .put(bus iness.TEMP LATE_fsc_8 37_writeba ck_url(moc k_claim.CO NFIG, '837 WB', 21130 72))
  263                .reply(2 00, {
  264                    'hap py': 'happ y joy joy'
  265                })
  266  
  267       })
  268       after( () => {
  269           ap p.stop()
  270           no ck.cleanAl l()
  271       })
  272  
  273  
  274       // que ue not ava ilable
  275       it("ma lformed am qp uri", f unction (d one) {
  276           th is.timeout (14000)
  277  
  278           le t hold_TAS _QUEUE_ADD RESS = pro cess.env.T AS_QUEUE_A DDRESS
  279           pr ocess.env. TAS_QUEUE_ ADDRESS =  "http://lo calhost"
  280  
  281           le t testConf ig = Objec t.assign({ }, mock_cl aim.CONFIG )
  282           te stConfig.d escription  = "malfor med amqp u ri"
  283  
  284           //  chai.requ est(DEV_SE RVER)
  285           ch ai.request (app.baseA ddress())
  286                //chai.r equest('ht tp://local host:3000' )
  287                .post('/ api/fsc/v2 ')
  288                .set('se cid', 'MOC K-SECID-00 00011111')
  289                .send({
  290                    para ms: testCo nfig
  291                })
  292                .end((er r, res) =>  {
  293                    proc ess.env.TA S_QUEUE_AD DRESS = ho ld_TAS_QUE UE_ADDRESS
  294                    expe ct(res).to .have.stat us(200)
  295                    let  body = res .body
  296  
  297                    // e xpect the  queue sect ion to hav e 500 stat us code
  298                    expe ct(body[0] .iens.stat usCode).to .eq(500)
  299                    done ()
  300                })
  301       })
  302  
  303   })
  304  
  305   describe(" POST /api/ fsc/v2/837  3", funct ion () {
  306       before (() => {
  307           ap p.start()
  308       })
  309       after( () => {
  310           ap p.stop()
  311       })
  312  
  313       // fir st getBund le() fails ; webclien t throws 4 04
  314       it("ma lformed VA _FHIR_SERV ER uri", a sync () =>  {
  315           th is.timeout (14000)
  316  
  317           aw ait $tas.c ache.flush ()
  318           aw ait $tas.p roviders.m emory.rese tDatabase( )
  319           aw ait $tas.c ommand.run ('metabase ', 'iam',  'init')
  320           aw ait $tas.c ommand.run ('metabase ', 'data',  'init')
  321  
  322  
  323           le t testConf ig = Objec t.assign({ }, mock_cl aim.CONFIG )
  324           te stConfig.d escription  = "malfor med VA_FHI R_SERVER u ri"
  325           te stConfig.t asFHIREndp oint = app .baseAddre ss()
  326           //  chai.requ est(DEV_SE RVER)
  327           co nst res =  await chai .request(a pp.baseAdd ress())
  328                //chai.r equest('ht tp://local host:3000' )
  329                .post('/ api/fsc/v2 ')
  330                .set('se cid', 'MOC K-SECID-00 00011111')
  331                .send({
  332                    para ms: testCo nfig
  333                })
  334           //  expect a  general ex ception
  335           ex pect(res). to.have.st atus(200)
  336           le t body = r es.body
  337           ex pect(body[ 0].bundleU rls.status Code).to.e q(201)
  338       })
  339  
  340   })
  341  
  342   describe(" POST /api/ fsc/v2/837  with nock  - 4", fun ction () {
  343       before (() => {
  344           ap p.start()
  345           le t iens_url  = busines s.TEMPLATE _fsc_837_i ens_url(mo ck_claim.C ONFIG)
  346  
  347           //  return 50 0
  348           no ck(mock_cl aim.CONFIG .tasFHIREn dpoint)
  349                .get(bus iness.TEMP LATE_fsc_8 37_iens_ur l(mock_cla im.CONFIG) )
  350                .reply(5 00, {
  351                    mess age: 'moch aTest:malf ormed VA_F HIR_SERVER  500'
  352                })
  353  
  354           no ck(mock_cl aim.CONFIG .tasFHIREn dpoint)
  355                .get(bus iness.TEMP LATE_fsc_8 37_iens_ur l(mock_cla im.CONFIG) )
  356                .reply(5 00, {
  357                    mess age: 'moch aTest:malf ormed VA_F HIR_SERVER  500'
  358                })
  359  
  360       })
  361       after( () => {
  362           ap p.stop()
  363           no ck.cleanAl l()
  364       })
  365  
  366  
  367  
  368       // ien s 500 retu rned from  NOCK
  369       // N.B .  If you  want to te st standlo ne, then y ou need to  comment o ut the fir st two noc k response s above
  370       // fhi r_server_c laim_respo nse and fh ir_server_ claim_resp onse1
  371  
  372       it("VA _FHIR_SERV ER 500", a sync funct ion () {
  373           th is.timeout (14000)
  374           aw ait $tas.c ache.flush ()
  375           aw ait $tas.p roviders.m emory.rese tDatabase( )
  376           aw ait $tas.c ommand.run ('metabase ', 'iam',  'init')
  377           aw ait $tas.c ommand.run ('metabase ', 'data',  'init')
  378  
  379  
  380           le t testConf ig = Objec t.assign({ }, mock_cl aim.CONFIG )
  381           te stConfig.d escription  = "VA_FHI R_SERVER 5 00"
  382           //  chai.requ est(DEV_SE RVER)
  383           co nst res =  await chai .request(a pp.baseAdd ress())
  384                //chai.r equest('ht tp://local host:3000' )
  385                .post('/ api/fsc/v2 ')
  386  
  387                .set('se cid', 'MOC K-SECID-00 00011111')
  388                .send({
  389                    para ms: testCo nfig
  390                })
  391  
  392           // should.not .exist(res .body.exce ption)
  393           ex pect(res). to.have.st atus(200)
  394           le t body = r es.body
  395           ex pect(body[ 0].iens.st atusCode). to.eq(500)
  396  
  397       })
  398  
  399  
  400  
  401       /**
  402        *              / / DJH 12/1 3/2018 - f ind out ho w to set m etabase
  403        */
  404       xdescr ibe("POST  /api/fsc/v 2/837 with  nock - 5" , function  () {
  405           be fore(() =>  {
  406                process. env.TAS_PR OVIDERS =  "METABASE: junk,REPOR TS:mongodb ,REPORTS-L OG:mongodb "
  407                app.star t()
  408           })
  409           af ter(() =>  {
  410                app.stop ()
  411                nock.cle anAll()
  412           })
  413  
  414  
  415           //  iens 500  returned f rom NOCK
  416           //  N.B.  If  you want t o test sta ndlone, th en you nee d to comme nt out the  first two  nock resp onses abov e
  417           //  fhir_serv er_claim_r esponse an d fhir_ser ver_claim_ response1
  418  
  419           it ("metabase  request d enied", fu nction (do ne) {
  420                this.tim eout(14000 )
  421                let test Config = O bject.assi gn({}, moc k_claim.CO NFIG)
  422                testConf ig.descrip tion = "me tabase req uest denie d"
  423                // chai. request(DE V_SERVER)
  424                chai.req uest(app.b aseAddress ())
  425                    //ch ai.request ('http://l ocalhost:3 000')
  426                    .pos t('/api/fs c/v2')
  427  
  428                    .set ('secid',  'MOCK-SECI D-00000111 11')
  429                    .sen d({
  430                         params: te stConfig
  431                    })
  432                    .end ((err, res ) => {
  433                         //should.n ot.exist(r es.body.ex ception)
  434                         expect(res ).to.have. status(500 )
  435                         let body =  res.body
  436                         expect(bod y.iens.sta tusCode).t o.eq(500)
  437                         done()
  438                    })
  439           })
  440  
  441       })
  442   })