32. EPMO Open Source Coordination Office Redaction File Detail Report

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

32.1 Files compared

# Location File Last Modified
1 MCCF_EDI_TAS_TASCore v2.0_Build_10.zip\MCCF_EDI_TAS_API_Core\src\test\fsc-837 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\fsc-837 endpoint-fsc-837.js Mon Apr 15 17:59:44 2019 UTC

32.2 Comparison summary

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

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

32.4 Active regular expressions

No regular expressions were active.

32.5 Comparison detail

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