43. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 8/31/2017 11:16:53 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.

43.1 Files compared

# Location File Last Modified
1 JLV_2.6.zip\JLV_2.6\JLV_2.6\Joint Legacy Viewer\VistaDataService\src\test\integration\java\gov\va\med\vds\dataservice\das DASDataServiceTest.java Thu Aug 31 12:13:12 2017 UTC
2 JLV_2.6.zip\JLV_2.6\JLV_2.6\Joint Legacy Viewer\VistaDataService\src\test\integration\java\gov\va\med\vds\dataservice\das DASDataServiceTest.java Thu Aug 31 14:26:34 2017 UTC

43.2 Comparison summary

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

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

43.4 Active regular expressions

No regular expressions were active.

43.5 Comparison detail

  1   /**
  2    * Janus 4 .0 (c)
  3    * Copyrig ht (c) 201 1 Hawaii R esource Gr oup LLC. A ll Rights  Reserved.
  4    * Develop ed for the  Pacific T elehealth  & Technolo gy Hui and  the Pacif ic Joint I nformation  Technolog y Center
  5    * Contrib utors:
  6    *     Hon orable Sen ator Danie l K. Inouy e
  7    *     VA  Pacific Is lands Heal th Care Sy stem
  8    *     Tri pler Army  Medical Ce nter
  9    */
  10    
  11    
  12   package go v.va.med.v ds.dataser vice.das;
  13  
  14   import jav a.io.Strin gReader;
  15   import jav a.util.Arr ayList;
  16   import jav a.util.Cal endar;
  17   import jav a.util.Lis t;
  18  
  19   import com .fasterxml .jackson.d atabind.De serializat ionFeature ;
  20   import com .fasterxml .jackson.d atabind.Ob jectMapper ;
  21   import gov .va.med.rp c.StringUt ils;
  22   import gov .va.med.vd s.TestConf ig;
  23   import gov .va.med.vd s.TestSite Utils;
  24   import gov .va.med.vd s.base.dat aservice.V DSExceptio n;
  25   import gov .va.med.vd s.das.bean s.Resource ;
  26   import gov .va.med.vd s.das.bean s.Subscrip tion;
  27   import gov .va.med.vd s.dataserv icehandler .DASServic eHandler;
  28   import gov .va.med.vd s.patient. dao.DASDao ;
  29   import gov .va.med.vd s.patient. dataservic e.AllergyD ataService ;
  30   import gov .va.med.vd s.patient. dataservic e.PatientD ataService ;
  31   import gov .va.med.vd s.vistabea ns.*;
  32   import gov .va.med.vd s.vistabea ns.das.DAS ResultColl ection;
  33   import org .apache.co mmons.io.I OUtils;
  34   import org .apache.lo g4j.LogMan ager;
  35   import org .junit.*;
  36   import org .w3c.dom.D ocument;
  37   import org .w3c.dom.N ode;
  38   import org .w3c.dom.N odeList;
  39   import org .xml.sax.I nputSource ;
  40  
  41   import jav ax.xml.par sers.Docum entBuilder Factory;
  42   import jav ax.xml.xpa th.XPath;
  43   import jav ax.xml.xpa th.XPathCo nstants;
  44   import jav ax.xml.xpa th.XPathEx pression;
  45   import jav ax.xml.xpa th.XPathFa ctory;
  46  
  47   import sta tic org.ju nit.Assert .*;
  48   /**
  49    *
  50    *
  51    */
  52   public cla ss DASData ServiceTes t //extend s DataServ iceBaseTes t
  53   {
  54  
  55       protec ted User u ser;
  56       protec ted Patien t patient;
  57       protec ted String  testPatie ntName;
  58  
  59       protec ted Site s ite;
  60  
  61       public  DASDataSe rviceTest( ){
  62           si te = TestS iteUtils.g etInstance ().getSite (TestConfi g.get(Test Config.PRO VIDER_SITE _CODE));
  63       }
  64  
  65       //**** ******
  66       //
  67       // To  test the D AS VLER in terface, m odify the  doGet() me thod in th e
  68       // Not ifications  servlet ( gov.va.med .vds.servl et.Notific ations)
  69       // Ens ure that t he configu ration in  the .prope rties file  is pointi ng to the  proper end point:
  70         // appconf ig.vler.da s.callback  = http:// IP          :[port]/Vi staDataSer vice/notif y/
  71       // Aft er deployi ng to glas sfish in d ebug mode,  you can t hen kick o ff your te st via:
  72         // http:// IP          :[port]/Vi staDataSer vice/notif y/blahblah
  73       //
  74       //**** ******
  75       @Test
  76       public  void test GetVLERAll ergies()
  77       {
  78   ////         QueryBea n queryBea n = initQu eryBean();
  79           Qu eryBean qu eryBean =  setupQuery (user, pat ient, null , null);
  80  
  81           tr y {
  82                DASDao d asDao = ne w DASDao() ;
  83                DASResul tCollectio n resultCo llection =  dasDao.ge tVLERAller gies(query Bean);
  84                assertTr ue(resultC ollection  != null);
  85           }
  86           ca tch (VDSEx ception e)  {
  87                assertTr ue(false);
  88           }
  89       }
  90  
  91       @Test
  92       public  void test GetDASData ()
  93       {
  94   ////         QueryBea n queryBea n = initQu eryBean();
  95           Qu eryBean qu eryBean =  setupQuery (user, pat ient, null , null);
  96  
  97           tr y {
  98                DASServi ceHandler  dh = new D ASServiceH andler();
  99                Subscrip tion subsc ription =  new Subscr iption();
  100                subscrip tion.setPa tientICN(" 106");
  101                subscrip tion.setDo main("Alle rgyIntoler ance");
  102  
  103                DASResul tCollectio n resultCo llection =  dh.getDAS Data(subsc ription);
  104                assertTr ue(resultC ollection  != null);
  105           }
  106           ca tch (Excep tion e) {
  107                assertTr ue(false);
  108           }
  109       }
  110  
  111       @Test
  112       public  void test ParseDocSt atus() thr ows Except ion
  113       {
  114           tr y
  115           {
  116                String d ocStatus =  "<wrap><d ocuments>< document>< PartnerNam e>280004</ PartnerNam e><Partner DocumentID >2.16.840. 1.113883.1 .13.99999. 999362</Pa rtnerDocum entID><sta tus>Availa ble</statu s><timesta mp>1483709 141908</ti mestamp></ document>< /documents ><document s><documen t><Partner Name>KP</P artnerName ><PartnerD ocumentID> KP1</Partn erDocument ID><status >Available Old</statu s><timesta mp></times tamp></doc ument></do cuments></ wrap>";
  117  
  118                final St ring XPATH _DOCUMENTS  = "//docu ment";
  119                final St ring XPATH _PARTNERNA ME = "./Pa rtnerName" ;
  120                final St ring XPATH _DOCUMENTI D = "./Par tnerDocume ntID";
  121                final St ring XPATH _STATUS =  "./status" ;
  122                final St ring XPATH _TIMESTAMP  = "./time stamp";
  123  
  124                InputSou rce is = n ew InputSo urce(new S tringReade r(docStatu s));
  125                Document  xmlDoc =  DocumentBu ilderFacto ry.newInst ance().new DocumentBu ilder().pa rse(is);
  126  
  127                XPath xp ath = XPat hFactory.n ewInstance ().newXPat h();
  128                XPathExp ression ex prDocs = x path.compi le(XPATH_D OCUMENTS);
  129                XPathExp ression ex prStatus =  xpath.com pile(XPATH _STATUS);
  130                XPathExp ression ex prPartnerN ame = xpat h.compile( XPATH_PART NERNAME);
  131                XPathExp ression ex prDocID =  xpath.comp ile(XPATH_ DOCUMENTID );
  132                XPathExp ression ex prTimestam p = xpath. compile(XP ATH_TIMEST AMP);
  133  
  134                NodeList  documents  = (NodeLi st) exprDo cs.evaluat e(xmlDoc,  XPathConst ants.NODES ET);
  135  
  136                List<gov .va.med.vd s.das.bean s.Document > document List = new  ArrayList <gov.va.me d.vds.das. beans.Docu ment>();
  137  
  138                for(int  i = 0; i <  documents .getLength (); i++) {
  139                    Node  doc = doc uments.ite m(i);
  140                    gov. va.med.vds .das.beans .Document  document =  new gov.v a.med.vds. das.beans. Document() ;
  141                    Stri ng status  = (String)  exprStatu s.evaluate (doc, XPat hConstants .STRING);
  142                    docu ment.setPa rtnerDocum entID((Str ing) exprD ocID.evalu ate(doc, X PathConsta nts.STRING ));
  143                    docu ment.setPa rtnerName( (String) e xprPartner Name.evalu ate(doc, X PathConsta nts.STRING ));
  144                    if(S tringUtils .isNumeric ((String)  exprTimest amp.evalua te(doc, XP athConstan ts.STRING) )) {
  145                         document.s etTimestam p(Long.par seLong((St ring) expr Timestamp. evaluate(d oc, XPathC onstants.S TRING)));
  146                    }
  147                    docu ment.setSt atus(statu s);
  148                    docu mentList.a dd(documen t);
  149                }
  150  
  151                assertTr ue(documen tList.size () > 0);
  152   //             for(Al lergy alle rgy : alle rgies)
  153   //             {
  154   //                 as sertFalse( StringUtil s.isEmpty( allergy.ge tSourcePro tocol()));
  155   //                 as sertFalse( allergy.ge tSite() ==  null);
  156   //                 as sertFalse( allergy.ge tAllergyNa me().equal s(DataServ iceBase.CO NNECTION_U NAVAILABLE ));
  157   //             }
  158           }
  159           ca tch(Except ion ex)
  160           {
  161                fail(ex. getMessage ());
  162           }
  163       }
  164  
  165       @Test
  166       public  void test ParseVLERA llergies()  throws Ex ception
  167       {
  168           tr y
  169           {
  170                String i nput = IOU tils.toStr ing(getCla ss().getRe sourceAsSt ream("/Nes tedAllergy Bundle.jso n"), "UTF- 8");
  171  
  172                ObjectMa pper objec tMapper;
  173                objectMa pper = new  ObjectMap per();
  174                //allow  unknown da ta fields
  175                objectMa pper.confi gure(Deser ialization Feature.FA IL_ON_UNKN OWN_PROPER TIES, fals e);
  176                objectMa pper.confi gure(Deser ialization Feature.FA IL_ON_INVA LID_SUBTYP E, false);
  177  
  178                Resource  resource  = (Resourc e) objectM apper.read Value(inpu t, Resourc e.class);
  179  
  180                DASServi ceHandler  dh  = new  DASService Handler();
  181                DASResul tCollectio n rc = dh. mapVLERAll ergies(res ource, new  Subscript ion()) ;
  182                assertTr ue(resourc e.getTotal () > 0);
  183  
  184           }
  185           ca tch(Except ion ex)
  186           {
  187                fail(ex. getMessage ());
  188           }
  189       }
  190  
  191       @Test
  192       public  void test ParseVLERP roblems()  throws Exc eption
  193       {
  194           tr y
  195           {
  196                String i nput = IOU tils.toStr ing(getCla ss().getRe sourceAsSt ream("/Con ditionBund le.json"),  "UTF-8");
  197  
  198                ObjectMa pper objec tMapper;
  199                objectMa pper = new  ObjectMap per();
  200                //allow  unknown da ta fields
  201                objectMa pper.confi gure(Deser ialization Feature.FA IL_ON_UNKN OWN_PROPER TIES, fals e);
  202  
  203                Resource  resource  = (Resourc e) objectM apper.read Value(inpu t, Resourc e.class);
  204  
  205                DASServi ceHandler  dh  = new  DASService Handler();
  206                DASResul tCollectio n rc = dh. mapVLERPro blems(reso urce, new  Subscripti on()) ;
  207                assertTr ue(resourc e.getTotal () > 0);
  208  
  209           }
  210           ca tch(Except ion ex)
  211           {
  212                fail(ex. getMessage ());
  213           }
  214       }
  215  
  216       @Test
  217       public  void test ParseVLERV itals() th rows Excep tion
  218       {
  219           tr y
  220           {
  221                String i nput = IOU tils.toStr ing(getCla ss().getRe sourceAsSt ream("/Obs ervationBu ndle.json" ), "UTF-8" );
  222  
  223                ObjectMa pper objec tMapper;
  224                objectMa pper = new  ObjectMap per();
  225                //allow  unknown da ta fields
  226                objectMa pper.confi gure(Deser ialization Feature.FA IL_ON_UNKN OWN_PROPER TIES, fals e);
  227  
  228                Resource  resource  = (Resourc e) objectM apper.read Value(inpu t, Resourc e.class);
  229  
  230                DASServi ceHandler  dh  = new  DASService Handler();
  231                DASResul tCollectio n rc = dh. mapVLERVit als(resour ce, new Su bscription ()) ;
  232                assertTr ue(resourc e.getTotal () > 0);
  233  
  234           }
  235           ca tch(Except ion ex)
  236           {
  237                fail(ex. getMessage ());
  238           }
  239       }
  240  
  241       @Test
  242       public  void test ParseVLERI mmunizatio ns() throw s Exceptio n
  243       {
  244           tr y
  245           {
  246                String i nput = IOU tils.toStr ing(getCla ss().getRe sourceAsSt ream("/Imm unizationB undle.json "), "UTF-8 ");
  247  
  248                ObjectMa pper objec tMapper;
  249                objectMa pper = new  ObjectMap per();
  250                //allow  unknown da ta fields
  251                objectMa pper.confi gure(Deser ialization Feature.FA IL_ON_UNKN OWN_PROPER TIES, fals e);
  252  
  253                Resource  resource  = (Resourc e) objectM apper.read Value(inpu t, Resourc e.class);
  254  
  255                DASServi ceHandler  dh  = new  DASService Handler();
  256                DASResul tCollectio n rc = dh. mapVLERImm unizations (resource,  new Subsc ription())  ;
  257                assertTr ue(resourc e.getTotal () > 0);
  258  
  259           }
  260           ca tch(Except ion ex)
  261           {
  262                fail(ex. getMessage ());
  263           }
  264       }
  265  
  266       @Test
  267       public  void test ParseVLERP rocedures( ) throws E xception
  268       {
  269           tr y
  270           {
  271                String i nput = IOU tils.toStr ing(getCla ss().getRe sourceAsSt ream("/Pro cedureBund le.json"),  "UTF-8");
  272  
  273                ObjectMa pper objec tMapper;
  274                objectMa pper = new  ObjectMap per();
  275                //allow  unknown da ta fields
  276                objectMa pper.confi gure(Deser ialization Feature.FA IL_ON_UNKN OWN_PROPER TIES, fals e);
  277  
  278                Resource  resource  = (Resourc e) objectM apper.read Value(inpu t, Resourc e.class);
  279  
  280                DASServi ceHandler  dh  = new  DASService Handler();
  281                DASResul tCollectio n rc = dh. mapVLERPro cedures(re source, ne w Subscrip tion()) ;
  282                assertTr ue(resourc e.getTotal () > 0);
  283  
  284           }
  285           ca tch(Except ion ex)
  286           {
  287                fail(ex. getMessage ());
  288           }
  289       }
  290  
  291       @Test
  292       public  void test ParseVLERD emographic s() throws  Exception
  293       {
  294           tr y
  295           {
  296                String i nput = IOU tils.toStr ing(getCla ss().getRe sourceAsSt ream("/Pat ientBundle .json"), " UTF-8");
  297  
  298                ObjectMa pper objec tMapper;
  299                objectMa pper = new  ObjectMap per();
  300                //allow  unknown da ta fields
  301                objectMa pper.confi gure(Deser ialization Feature.FA IL_ON_UNKN OWN_PROPER TIES, fals e);
  302  
  303                Resource  resource  = (Resourc e) objectM apper.read Value(inpu t, Resourc e.class);
  304  
  305                DASServi ceHandler  dh  = new  DASService Handler();
  306                DASResul tCollectio n rc = dh. mapVLERDem ographics( resource,  new Subscr iption())  ;
  307                assertTr ue(resourc e.getTotal () > 0);
  308  
  309           }
  310           ca tch(Except ion ex)
  311           {
  312                fail(ex. getMessage ());
  313           }
  314       }
  315  
  316       @Test
  317       public  void test ParseVLERD ocuments()  throws Ex ception
  318       {
  319           tr y
  320           {
  321                String i nput = IOU tils.toStr ing(getCla ss().getRe sourceAsSt ream("/Doc umentRefer enceBundle .json"), " UTF-8");
  322  
  323                ObjectMa pper objec tMapper;
  324                objectMa pper = new  ObjectMap per();
  325                //allow  unknown da ta fields
  326                objectMa pper.confi gure(Deser ialization Feature.FA IL_ON_UNKN OWN_PROPER TIES, fals e);
  327  
  328                Resource  resource  = (Resourc e) objectM apper.read Value(inpu t, Resourc e.class);
  329  
  330                DASServi ceHandler  dh  = new  DASService Handler();
  331                DASResul tCollectio n rc = dh. mapVLERDoc uments(res ource, new  Subscript ion()) ;
  332                assertTr ue(resourc e.getTotal () > 0);
  333  
  334           }
  335           ca tch(Except ion ex)
  336           {
  337                fail(ex. getMessage ());
  338           }
  339       }
  340  
  341       @Test
  342       public  void test Token()
  343       {
  344           tr y
  345           {
  346                DASServi ceHandler  dh = new D ASServiceH andler();
  347                QueryBea n qb = new  QueryBean ();
  348                Patient  pat = new  Patient();
  349                pat.setI CN("106");
  350  
  351                User use r = new Us er();
  352                user.set Name("Test User");
  353                user.set UserId("98 7");
  354  
  355                qb.setPa tient(pat) ;
  356                qb.setUs er(user);
  357  
  358                String s ubString =  dh.genera teSubscrip tion(qb, " AllergyInt olerance") ;
  359                //String  subString  = dh.gene rateSubscr iptionStri ng("Allerg y", dh.gen erateSubsc riptionStr ing(qb, "A llergyInto lerance")) ;
  360  
  361                assertTr ue(subStri ng.length( ) > 0);
  362  
  363  
  364           }
  365           ca tch(Except ion ex)
  366           {
  367                fail(ex. getMessage ());
  368           }
  369       }
  370  
  371       @Test
  372       public  void test GetAllergy Detail()
  373       {
  374           tr y
  375           {
  376                QueryBea n queryBea n = setupQ uery(user,  patient,  null, null );
  377                AllergyD ataService  allergySe rvice = ne w AllergyD ataService ();
  378                List<All ergy> alle rgies = al lergyServi ce.getPati entAllergi es(queryBe an);
  379                assertTr ue(allergi es.size()  > 0);
  380  
  381                QueryBea n qb2 = ne w QueryBea n();
  382                qb2.setU ser(user);
  383                qb2.setP atient(pat ient);
  384                qb2.setI temId(alle rgies.get( 0).getAlle rgyId());
  385                qb2.setR ecordSite( allergies. get(0).get Site());
  386  
  387                AllergyD etail alle rgyDetail  = allergyS ervice.get AllergyDet ail(qb2);
  388                assertFa lse(String Utils.isEm pty(allerg yDetail.ge tReportTex t()));
  389           }
  390           ca tch(VDSExc eption ex)
  391           {
  392                fail(ex. getMessage ());
  393           }
  394       }
  395  
  396       protec ted QueryB ean setupQ uery(User  user, Pati ent patien t, Calenda r startDat e, Calenda r endDate)
  397       {
  398           Qu eryBean qb  = new Que ryBean();
  399           qb .setUser(u ser);
  400           qb .setPatien t(patient) ;
  401           qb .setStartD ate(startD ate);
  402           qb .setEndDat e(endDate) ;
  403           qb .setMax(ne w Integer( 999));
  404           qb .setActive (new Integ er(0));
  405           re turn qb;
  406       }
  407  
  408  
  409       @Befor e
  410       public  void setU p()
  411       {
  412           Lo gManager.g etRootLogg er().setLe vel(org.ap ache.log4j .Level.DEB UG);
  413  
  414           tr y
  415           {
  416                testPati entName =  TestConfig .get(TestC onfig.PATI ENT_NAME);
  417  
  418                //select  test pati ent
  419                PatientD ataService  patientSe rvice = ne w PatientD ataService ();
  420                QueryBea n queryBea n = new Qu eryBean();
  421  
  422  
  423                List<End point> end points = n ew ArrayLi st<Endpoin t>();
  424                Endpoint  endpoint  = new Endp oint();
  425                endpoint .setModali ty("HIS");
  426                endpoint .setProtoc ol("RPC");
  427                endpoint .setStatus ("active") ;
  428                  endpoint.s etHost(" IP            ");
  429                  endpoint.s etPort( PORT );
  430                endpoint .setSiteCo de("994");
  431                endpoint s.add(endp oint);
  432  
  433                site = n ew Site();
  434                site.set Agency("VA ");
  435                site.set SiteCode(" 994");
  436                site.set Endpoints( endpoints) ;
  437  
  438                //user =  loginTest Provider() ;
  439                user = n ew User();
  440                user.set Agency("VA ");
  441                user.set Name("TEST ER,USER");
  442                user.set UserId("11 1");
  443                user.set HostSite(s ite);
  444  
  445                queryBea n.setUser( user);
  446                queryBea n.setMax(1 00);
  447                queryBea n.setRecor dSite(user .getHostSi te());
  448                queryBea n.setItemI d(testPati entName);
  449  
  450                List<Sit e> sites =  new Array List<Site> ();
  451                sites.ad d(site);
  452  
  453                patient  = new Pati ent();
  454                patient. setICN("10 6");
  455                patient. setName("T ESTING,PAT IENT");
  456                patient. setVistaSi tes(sites) ;
  457                patient. setSSN("44 4331111");
  458  
  459                //Patien t[] patien ts = patie ntService. lookupPati ent(queryB ean);
  460                queryBea n = new Qu eryBean();
  461  
  462                queryBea n.setPatie nt(patient );
  463                queryBea n.setUser( user);
  464  
  465   //             if(!se lect(query Bean))
  466   //                 fa il("Failed  to select  patient") ;
  467  
  468   //             this.p atient = p atients[0] ;
  469  
  470           }
  471           ca tch (Excep tion ex)
  472           {
  473                fail(ex. getMessage ());
  474   //         } catch (V istaKernel HashCountL imitExceed edExceptio n e) {
  475   //             fail(e .getMessag e());
  476           }
  477       }
  478       @Befor eClass
  479       public  static vo id setUpCl ass()
  480       {
  481  
  482       }
  483  
  484       @After Class
  485       public  static vo id tearDow nClass()
  486       {
  487       }
  488       @After
  489       public  void tear Down()
  490       {
  491  
  492       }
  493       
  494   }