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

29.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\Backup112618 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\Backup112618 endpoint-fsc-837.js Tue Apr 16 13:20:39 2019 UTC

29.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 8 708
Changed 7 14
Inserted 0 0
Removed 0 0

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

29.4 Active regular expressions

No regular expressions were active.

29.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  
  14  
  15   let nock
  16   try {
  17       nock =  require(' nock')
  18   } catch (e x) {}
  19  
  20   let mock_c laim = req uire('./mo ck-claim')
  21  
  22   /***
  23  
  24    DJH 6/5/2 018
  25  
  26    Ensure th at TAS_ENA BLE_HTTP i s set in e nvironment , setting  it in code  will not  work
  27    process.e nv.TAS_ENA BLE_HTTP =  true
  28  
  29    */
  30  
  31   //if (nock  && $tas.c onfig.ENAB LE_HTTP == = true) {
  32  
  33   describe(" POST /api/ fsc/v2/837  with nock  - 1", fun ction () {
  34       before (() => {
  35           ap p.start()
  36           
  37           mo ck_claim.C ONFIG.vist aInstance  =  "eBilli ng_dev"
  38           le t iens_url  = busines s.TEMPLATE _fsc_837_i ens_url(mo ck_claim.C ONFIG)
  39  
  40           //  N.B. You  must have  a respone  for every  request, s ince we ar e running  two tests
  41           le t fhir_ser ver_claim_ response =  nock(mock _claim.CON FIG.tasFHI REndpoint)
  42                .get(ien s_url)
  43                .reply(2 00, mock_c laim.MOCK_ FSC_837_IE NS_FOR_MOC HA)
  44  
  45          moc k_claim.CO NFIG.vista Instance =   "eBillin g_cit"
  46  
  47          let  fhir_serv er_claim_r esponse1 =  nock(mock _claim.CON FIG.tasFHI REndpoint)
  48                .get(bus iness.TEMP LATE_fsc_8 37_iens_ur l(mock_cla im.CONFIG) )
  49                .reply(2 00, mock_c laim.MOCK_ FSC_837_IE NS_FOR_MOC HA)
  50  
  51             // url:"ht tps:// DNS . URL /VA-FHIR-S erver/fhir /Bundle?us e=837&loca tion=442&_ id=2113071 "
  52           le t fhir_ser ver_claim_ response_d etail1 = n ock(mock_c laim.CONFI G.tasFHIRE ndpoint)
  53                //.get(' /Bundle?us e=837&loca tion=442&_ id=2113071 ')
  54                .get(bus iness.TEMP LATE_fsc_8 37_bundle_ url(mock_c laim.CONFI G, 837, 'e Billing_de v', 211307 1))
  55                .reply(2 00, mock_c laim.MOCK_ FSC_837_FO R_MOCHA)
  56           
  57                let fhir _server_cl aim_respon se_detail2  = nock(mo ck_claim.C ONFIG.tasF HIREndpoin t)
  58                //.get(' /Bundle?us e=837&loca tion=442&_ id=2113072 ')
  59                .get(bus iness.TEMP LATE_fsc_8 37_bundle_ url(mock_c laim.CONFI G, 837, 'e Billing_de v', 211307 2))
  60                .reply(2 00, mock_c laim.MOCK_ FSC_837_FO R_MOCHA)
  61  
  62                mock_cla im.CONFIG. vistaInsta nce =  "eB illing_dev "
  63           no ck(mock_cl aim.CONFIG .tasFHIREn dpoint)
  64                .put(bus iness.TEMP LATE_fsc_8 37_acknowl edgement_u rl(mock_cl aim.CONFIG , '837WB',  'not used ', 2113071 ))
  65                .reply(2 00, {hello : "world 1 "})
  66  
  67                debug(bu siness.TEM PLATE_fsc_ 837_acknow ledgement_ url(mock_c laim.CONFI G, '837WB' , 'not use d', 211307 1))
  68  
  69           no ck(mock_cl aim.CONFIG .tasFHIREn dpoint)
  70                .put(bus iness.TEMP LATE_fsc_8 37_acknowl edgement_u rl(mock_cl aim.CONFIG , '837WB',  'eBilling _dev', 211 3072))
  71                .reply(2 00, {hello : "world 1 "})
  72  
  73  
  74             // url:"ht tps:// DNS . URL /VA-FHIR-S erver/fhir /Bundle?us e=837&loca tion=442&_ id=2113071 "
  75           le t fhir_ser ver_claim_ response_d etail3 = n ock(mock_c laim.CONFI G.tasFHIRE ndpoint)
  76                //.get(' /Bundle?us e=837&loca tion=442&_ id=2113071 ')
  77                .get(bus iness.TEMP LATE_fsc_8 37_bundle_ url(mock_c laim.CONFI G, 837, 'e Billing_ci t', 211307 1))
  78                .reply(2 00, mock_c laim.MOCK_ FSC_837_FO R_MOCHA)
  79  
  80           le t fhir_ser ver_claim_ response_d etail4 = n ock(mock_c laim.CONFI G.tasFHIRE ndpoint)
  81                //.get(' /Bundle?us e=837&loca tion=442&_ id=2113072 ')
  82                .get(bus iness.TEMP LATE_fsc_8 37_bundle_ url(mock_c laim.CONFI G, 837, 'e Billing_ci t', 211307 2))
  83                .reply(2 00, mock_c laim.MOCK_ FSC_837_FO R_MOCHA)
  84  
  85                mock_cla im.CONFIG. vistaInsta nce =  "eB illing_cit "
  86           no ck(mock_cl aim.CONFIG .tasFHIREn dpoint)
  87                .put(bus iness.TEMP LATE_fsc_8 37_acknowl edgement_u rl(mock_cl aim.CONFIG , '837WB',  'not used ', 2113071 ))
  88                .reply(2 00, {hello : "world 1 "})
  89  
  90           no ck(mock_cl aim.CONFIG .tasFHIREn dpoint)
  91                .put(bus iness.TEMP LATE_fsc_8 37_acknowl edgement_u rl(mock_cl aim.CONFIG , '837WB',  'not used ', 2113072 ))
  92                .reply(2 00, {hello : "world 1 "})
  93  
  94  
  95       })
  96       after( () => {
  97           ap p.stop()
  98           no ck.cleanAl l()
  99       })
  100  
  101  
  102       it("te st put end point", as ync functi on (done)  {
  103  
  104           va r FHIR_Cla im_Resourc e = {
  105                "resourc eType": "C laim",
  106                "id": "1 288473",
  107                "extensi on": [
  108                      {
  109                         "url": "wr iteToQueue Successful ",
  110                         "valueStri ng": 200
  111                      }
  112                    ]
  113              }
  114     
  115              //    PUT  /VA-FHIR-S erver/fhir /Claim/128 8473?locat ion=eBilli ng_cit&amp ; use=837W B HTTP/1.1
  116  
  117             let URL =  "https:// DNS . URL /VA-FHIR-S erver/fhir /Claim/128 8473?locat ion=eBilli ng_cit&use =837WB"
  118          
  119           le t vistaId  = "682|IBT AS,APPLICA TION PROXY ^PN^682^US VHA|A"
  120           // let vistaI d = "681|I BTAS,APPLI CATION PRO XY^PN^681^ USVHA|A"
  121           le t options  = {
  122                method:  'PUT',
  123                uri: URL ,
  124                headers:  {
  125                    vist aid: vista Id
  126                }, 
  127                body: FH IR_Claim_R esource,
  128                json: tr ue
  129           }     
  130  
  131           le t security Context =  null
  132  
  133           co nst { erro r, respons e, body, r etry } = a wait $tas. webclient( securityCo ntext, opt ions)
  134  
  135           de bug(option s)
  136           de bug(error,  body)
  137       })
  138  
  139       
  140       it("ha ppy path ( with amqp  available) ", functio n (done) {
  141                this.tim eout(30000 0)
  142  
  143           le t testConf ig = Objec t.assign({ }, mock_cl aim.CONFIG )
  144           te stConfig.d escription  = "happy  path (with  amqp avai lable)"
  145  
  146           //  chai.requ est(DEV_SE RVER)
  147           ch ai.request (app.baseA ddress())
  148                //chai.r equest('ht tp://local host:3000' )
  149                .post('/ api/fsc/v2 ')
  150  
  151                .set('se cid', '_00 0011111')
  152                .send({
  153                    //pa rams: test Config
  154                })
  155                .end((er r, res) =>  {
  156                    expe ct(res).to .have.stat us(200)
  157                    let  results =  res.body
  158                    // n ot sure wh y json is  empty
  159                    expe ct(results .data.queu e.statusCo de).to.eq( 200)
  160  
  161                    done ()
  162                })
  163       })
  164  
  165   })
  166  
  167   describe(" POST /api/ fsc/v2/837  with nock  - 2", fun ction () {
  168       before (() => {
  169           ap p.start()
  170           le t iens_url  = busines s.TEMPLATE _fsc_837_i ens_url(mo ck_claim.C ONFIG)
  171           
  172           //  N.B. You  must have  a respone  for every  request, s ince we ar e running  two tests
  173           le t fhir_ser ver_claim_ response =  nock(mock _claim.CON FIG.tasFHI REndpoint)
  174                .get(ien s_url)
  175                .reply(2 00, mock_c laim.MOCK_ FSC_837_IE NS_FOR_MOC HA)
  176  
  177          let  fhir_serv er_claim_r esponse1 =  nock(mock _claim.CON FIG.tasFHI REndpoint)
  178                .get(bus iness.TEMP LATE_fsc_8 37_iens_ur l(mock_cla im.CONFIG) )
  179                .reply(2 00, mock_c laim.MOCK_ FSC_837_IE NS_FOR_MOC HA)
  180  
  181             // url:"ht tps:// DNS . URL /VA-FHIR-S erver/fhir /Bundle?us e=837&loca tion=442&_ id=2113071 "
  182           le t fhir_ser ver_claim_ response_d etail1 = n ock(mock_c laim.CONFI G.tasFHIRE ndpoint)
  183                //.get(' /Bundle?us e=837&loca tion=442&_ id=2113071 ')
  184                .get(bus iness.TEMP LATE_fsc_8 37_bundle_ url(mock_c laim.CONFI G, 837, 44 2, 2113071 ))
  185                .reply(2 00, mock_c laim.MOCK_ FSC_837_FO R_MOCHA)
  186           
  187                let fhir _server_cl aim_respon se_detail2  = nock(mo ck_claim.C ONFIG.tasF HIREndpoin t)
  188                //.get(' /Bundle?us e=837&loca tion=442&_ id=2113072 ')
  189                .get(bus iness.TEMP LATE_fsc_8 37_bundle_ url(mock_c laim.CONFI G, 837, 44 2, 2113072 ))
  190                .reply(2 00, mock_c laim.MOCK_ FSC_837_FO R_MOCHA)
  191  
  192  
  193             // url:"ht tps:// DNS . URL /VA-FHIR-S erver/fhir /Bundle?us e=837&loca tion=442&_ id=2113071 "
  194           le t fhir_ser ver_claim_ response_d etail3 = n ock(mock_c laim.CONFI G.tasFHIRE ndpoint)
  195                //.get(' /Bundle?us e=837&loca tion=442&_ id=2113071 ')
  196                .get(bus iness.TEMP LATE_fsc_8 37_bundle_ url(mock_c laim.CONFI G, 837, 44 2, 2113071 ))
  197                .reply(2 00, mock_c laim.MOCK_ FSC_837_FO R_MOCHA)
  198  
  199           le t fhir_ser ver_claim_ response_d etail4 = n ock(mock_c laim.CONFI G.tasFHIRE ndpoint)
  200                //.get(' /Bundle?us e=837&loca tion=442&_ id=2113072 ')
  201                .get(bus iness.TEMP LATE_fsc_8 37_bundle_ url(mock_c laim.CONFI G, 837, 44 2, 2113072 ))
  202                .reply(2 00, mock_c laim.MOCK_ FSC_837_FO R_MOCHA)
  203  
  204           //
  205           //
  206           //
  207  
  208            n ock(mock_c laim.CONFI G.tasFHIRE ndpoint)
  209           .g et(iens_ur l)
  210           .r eply(200,  mock_claim .MOCK_FSC_ 837_IENS_F OR_MOCHA)
  211  
  212       nock(m ock_claim. CONFIG.tas FHIREndpoi nt)
  213           .g et(busines s.TEMPLATE _fsc_837_i ens_url(mo ck_claim.C ONFIG))
  214           .r eply(200,  mock_claim .MOCK_FSC_ 837_IENS_F OR_MOCHA)
  215  
  216         // url:"ht tps:// DNS . URL /VA-FHIR-S erver/fhir /Bundle?us e=837&loca tion=442&_ id=2113071 "
  217        nock( mock_claim .CONFIG.ta sFHIREndpo int)
  218           // .get('/Bun dle?use=83 7&location =442&_id=2 113071')
  219           .g et(busines s.TEMPLATE _fsc_837_b undle_url( mock_claim .CONFIG, 8 37, 442, 2 113071))
  220           .r eply(200,  mock_claim .MOCK_FSC_ 837_FOR_MO CHA)
  221       
  222           no ck(mock_cl aim.CONFIG .tasFHIREn dpoint)
  223           // .get('/Bun dle?use=83 7&location =442&_id=2 113072')
  224           .g et(busines s.TEMPLATE _fsc_837_b undle_url( mock_claim .CONFIG, 8 37, 442, 2 113072))
  225           .r eply(200,  mock_claim .MOCK_FSC_ 837_FOR_MO CHA)
  226  
  227  
  228         // url:"ht tps:// DNS . URL /VA-FHIR-S erver/fhir /Bundle?us e=837&loca tion=442&_ id=2113071 "
  229        nock( mock_claim .CONFIG.ta sFHIREndpo int)
  230           // .get('/Bun dle?use=83 7&location =442&_id=2 113071')
  231           .g et(busines s.TEMPLATE _fsc_837_b undle_url( mock_claim .CONFIG, 8 37, 442, 2 113071))
  232           .r eply(200,  mock_claim .MOCK_FSC_ 837_FOR_MO CHA)
  233  
  234        nock( mock_claim .CONFIG.ta sFHIREndpo int)
  235           // .get('/Bun dle?use=83 7&location =442&_id=2 113072')
  236           .g et(busines s.TEMPLATE _fsc_837_b undle_url( mock_claim .CONFIG, 8 37, 442, 2 113072))
  237           .r eply(200,  mock_claim .MOCK_FSC_ 837_FOR_MO CHA)
  238  
  239  
  240       })
  241       after( () => {
  242           ap p.stop()
  243           no ck.cleanAl l()
  244       })
  245  
  246  
  247       // que ue not ava ilable
  248       it("ma lformed am qp uri", f unction (d one) {
  249           th is.timeout (14000)
  250  
  251           le t hold_TAS _QUEUE_ADD RESS = pro cess.env.T AS_QUEUE_A DDRESS
  252           pr ocess.env. TAS_QUEUE_ ADDRESS =  "http://lo calhost"
  253  
  254           le t testConf ig = Objec t.assign({ }, mock_cl aim.CONFIG )
  255           te stConfig.d escription  = "malfor med amqp u ri"
  256           
  257           //  chai.requ est(DEV_SE RVER)
  258           ch ai.request (app.baseA ddress())
  259                //chai.r equest('ht tp://local host:3000' )
  260                .post('/ api/fsc/v2 ')
  261                .set('se cid', 'MOC K-SECID-00 00011111')
  262                .send({
  263                    para ms: testCo nfig
  264                })
  265                .end((er r, res) =>  {
  266                    proc ess.env.TA S_QUEUE_AD DRESS = ho ld_TAS_QUE UE_ADDRESS
  267                    expe ct(res).to .have.stat us(200)
  268                    let  results =  res.body
  269  
  270                    // e xpect the  queue sect ion to hav e 500 stat us code
  271                    expe ct(results .data.queu e.statusCo de).to.eq( 500)
  272                    done ()
  273                })
  274       })
  275  
  276   })
  277  
  278   describe(" POST /api/ fsc/v2/837  with nock  - 3", fun ction () {
  279       before (() => {
  280           ap p.start()
  281       })
  282       after( () => {
  283           ap p.stop()
  284       })
  285  
  286       // fir st getBund le() fails ; webclien t throws 4 04
  287       it("ma lformed VA _FHIR_SERV ER uri", f unction (d one) {
  288           th is.timeout (14000)
  289  
  290           le t testConf ig = Objec t.assign({ }, mock_cl aim.CONFIG )
  291           te stConfig.d escription  = "malfor med VA_FHI R_SERVER u ri"
  292           te stConfig.t asFHIREndp oint = "ht tp://local host"
  293           //  chai.requ est(DEV_SE RVER)
  294           ch ai.request (app.baseA ddress())
  295                //chai.r equest('ht tp://local host:3000' )
  296                .post('/ api/fsc/v2 ')
  297  
  298                .set('se cid', 'MOC K-SECID-00 00011111')
  299                .send({
  300                    para ms: testCo nfig
  301                })
  302                .end((er r, res) =>  {
  303                  
  304                    // e xpect a ge neral exce ption
  305                    expe ct(res).to .have.stat us(500)
  306                    let  results =  res.body
  307                    done ()
  308                })
  309       })
  310  
  311   })
  312  
  313   describe(" POST /api/ fsc/v2/837  with nock  - 4", fun ction () {
  314       before (() => {
  315           ap p.start()
  316           le t iens_url  = busines s.TEMPLATE _fsc_837_i ens_url(mo ck_claim.C ONFIG)
  317      
  318           //  return 50 0
  319           no ck(mock_cl aim.CONFIG .tasFHIREn dpoint)
  320                .get(bus iness.TEMP LATE_fsc_8 37_iens_ur l(mock_cla im.CONFIG) )
  321                .reply(5 00, { mess age: 'moch aTest:malf ormed VA_F HIR_SERVER  500'})
  322  
  323           no ck(mock_cl aim.CONFIG .tasFHIREn dpoint)
  324                .get(bus iness.TEMP LATE_fsc_8 37_iens_ur l(mock_cla im.CONFIG) )
  325                .reply(5 00, { mess age: 'moch aTest:malf ormed VA_F HIR_SERVER  500'})
  326  
  327       })
  328       after( () => {
  329           ap p.stop()
  330           no ck.cleanAl l()
  331       })
  332  
  333  
  334       // ien s 500 retu rned from  NOCK
  335       // 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
  336       // fhi r_server_c laim_respo nse and fh ir_server_ claim_resp onse1
  337  
  338       it("VA _FHIR_SERV ER 500", f unction (d one) {
  339           th is.timeout (14000)
  340           le t testConf ig = Objec t.assign({ }, mock_cl aim.CONFIG )
  341           te stConfig.d escription  = "VA_FHI R_SERVER 5 00"
  342           //  chai.requ est(DEV_SE RVER)
  343           ch ai.request (app.baseA ddress())
  344                //chai.r equest('ht tp://local host:3000' )
  345                .post('/ api/fsc/v2 ')
  346  
  347                .set('se cid', 'MOC K-SECID-00 00011111')
  348                .send({
  349                    para ms: testCo nfig
  350                })
  351                .end((er r, res) =>  {
  352                    //sh ould.not.e xist(res.b ody.except ion)
  353                    expe ct(res).to .have.stat us(500)
  354                    let  results =  res.body
  355                    expe ct(results .data.iens .statusCod e).to.eq(5 00)
  356                    done ()
  357                })
  358       })
  359  
  360   })
  361