64. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 4/5/2017 4:21:46 PM 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.

64.1 Files compared

# Location File Last Modified
1 C:\working_scrub\Unredacted\eHX Code Base\eHX_Bld2_Source Code_CIF_2017-02-14\NHIN_adapter\AdapterLIB\src\main\java\gov\va\med\nhin\adapter\datamanager\adapters ESRDataAdapter.java Fri Feb 10 15:41:44 2017 UTC
2 eHX-CIF.zip\eHX-CIF\eHX Code Base\eHX_Bld2_Source Code_CIF_2017-02-14\NHIN_adapter\AdapterLIB\src\main\java\gov\va\med\nhin\adapter\datamanager\adapters ESRDataAdapter.java Mon Apr 3 14:25:16 2017 UTC

64.2 Comparison summary

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

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

64.4 Active regular expressions

No regular expressions were active.

64.5 Comparison detail

  1   package go v.va.med.n hin.adapte r.datamana ger.adapte rs;
  2  
  3   import jav a.net.URL;
  4   import jav a.util.Arr ayList;
  5   import jav a.util.Lis t;
  6   import jav a.util.Pro perties;
  7   import jav a.util.Set ;
  8  
  9   import jav ax.xml.nam espace.QNa me;
  10   import jav ax.xml.soa p.SOAPElem ent;
  11   import jav ax.xml.soa p.SOAPEnve lope;
  12   import jav ax.xml.soa p.SOAPHead er;
  13   import jav ax.xml.ws. handler.Ha ndler;
  14   import jav ax.xml.ws. handler.Ha ndlerResol ver;
  15   import jav ax.xml.ws. handler.Me ssageConte xt;
  16   import jav ax.xml.ws. handler.Po rtInfo;
  17   import jav ax.xml.ws. handler.so ap.SOAPHan dler;
  18   import jav ax.xml.ws. handler.so ap.SOAPMes sageContex t;
  19   import jav ax.xml.ws. soap.SOAPF aultExcept ion;
  20  
  21   import org .slf4j.Log ger;
  22   import org .slf4j.Log gerFactory ;
  23  
  24   import gov .va.med.es r.webservi ces.jaxws. schemas.De mographicI nfo;
  25   import gov .va.med.es r.webservi ces.jaxws. schemas.Ee Summary;
  26   import gov .va.med.es r.webservi ces.jaxws. schemas.Ee SummaryPor t;
  27   import gov .va.med.es r.webservi ces.jaxws. schemas.Ee SummaryPor tService;
  28   import gov .va.med.es r.webservi ces.jaxws. schemas.Ge tEESummary Request;
  29   import gov .va.med.es r.webservi ces.jaxws. schemas.Ge tEESummary Response;
  30   import gov .va.med.nh in.adapter .datamanag er.DataAda pter;
  31   import gov .va.med.nh in.adapter .datamanag er.DataQue ry;
  32   import gov .va.med.nh in.adapter .utils.Nul lChecker;
  33   import gov .va.med.nh in.adapter .utils.Pro pertiesCol lectionFac tory;
  34  
  35   /**
  36    *
  37    * @author   DN S      VAZQUD
  38    */
  39   public cla ss ESRData Adapter im plements D ataAdapter
  40   {
  41           pr ivate stat ic Logger  logger = L oggerFacto ry.getLogg er(Composi teDataAdap ter.class) ;
  42  
  43           pr ivate clas s HeaderHa ndlerResol ver implem ents Handl erResolver
  44           {
  45                    priv ate String  username;
  46                    priv ate String  password;
  47  
  48                    publ ic HeaderH andlerReso lver(Strin g username , String p assword)
  49                    {
  50                             this.u sername =  username;
  51                             this.p assword =  password;
  52                    }
  53  
  54                    publ ic List<Ha ndler> get HandlerCha in(PortInf o portInfo )
  55                    {
  56                             List<H andler> re t = new Ar rayList<Ha ndler>();
  57                             ret.ad d(new Head erHandler( username,  password)) ;
  58                             return  ret;
  59                    }
  60           }
  61  
  62           pr ivate clas s HeaderHa ndler impl ements SOA PHandler<S OAPMessage Context>
  63           {
  64                    priv ate String  un;
  65                    priv ate String  pw;
  66  
  67                    publ ic HeaderH andler(Str ing userna me, String  password)
  68                    {
  69                             this.u n = userna me;
  70                             this.p w = passwo rd;
  71                    }
  72  
  73                    publ ic Set<QNa me> getHea ders()
  74                    {
  75                             return  null;
  76                    }
  77  
  78                    publ ic void cl ose(Messag eContext c ontext)
  79                    {
  80                    }
  81  
  82                    publ ic boolean  handleFau lt(SOAPMes sageContex t context)
  83                    {
  84                             return  true;
  85                    }
  86  
  87                    publ ic boolean  handleMes sage(SOAPM essageCont ext smc)
  88                    {
  89                             Boolea n outbound Property =  (Boolean)  smc.get(M essageCont ext.MESSAG E_OUTBOUND _PROPERTY) ;
  90  
  91                             if(out boundPrope rty.boolea nValue())
  92                             {
  93                                      try
  94                                      {
  95                                               SOAPEnvelo pe envelop e = smc.ge tMessage() .getSOAPPa rt().getEn velope();
  96                                               SOAPHeader  header =  envelope.g etHeader() ;
  97  
  98                                               if(header  == null)
  99                                               {
  100                                                       he ader = env elope.addH eader();
  101                                               }
  102  
  103                                               SOAPElemen t security  = header. addChildEl ement("Sec urity", "w sse", "htt p://docs.o asis-open. org/wss/20 04/01/oasi s-200401-w ss-wssecur ity-secext -1.0.xsd") ;
  104  
  105                                               SOAPElemen t username Token = se curity.add ChildEleme nt("Userna meToken",  "wsse");
  106                                               usernameTo ken.addAtt ribute(new  QName("xm lns:wsu"),  "http://d ocs.oasis- open.org/w ss/2004/01 /oasis-200 401-wss-ws security-u tility-1.0 .xsd");
  107  
  108                                               SOAPElemen t username  = usernam eToken.add ChildEleme nt("Userna me", "wsse ");
  109                                               username.a ddTextNode (un);
  110  
  111                                               SOAPElemen t password  = usernam eToken.add ChildEleme nt("Passwo rd", "wsse ");
  112                                               password.s etAttribut e("Type",  "http://do cs.oasis-o pen.org/ws s/2004/01/ oasis-2004 01-wss-use rname-toke n-profile- 1.0#Passwo rdText");
  113                                               password.a ddTextNode (pw);
  114                                      }
  115                                      // CCR 1 79231 -Exc eption han dling
  116                                      catch(Ex ception e)
  117                                      {
  118                                               // CCR 179 231
  119                                               throw new  DataAdapte rException ("Exceptio n occurred  while try ing to pro cess SOAP  message.",  e);
  120                                      }
  121                             }
  122  
  123                             return  outboundP roperty;
  124                    }
  125           }
  126  
  127           pr ivate EeSu mmaryPortS ervice eeS ummaryServ ice = null ;
  128  
  129           pu blic List  getData(Da taQuery da taQuery)
  130           {
  131                    Arra yList ret  = new Arra yList();
  132                    Stri ng icn = ( String) da taQuery.ge tParameter ("icn");
  133                    Stri ng connect ionFilenam e = dataQu ery.getPro perty("con nectionFil ename");
  134                    Stri ng connect ion = data Query.getP roperty("c onnection" );
  135  
  136                    GetE ESummaryRe quest eeSu mmaryReque st = new G etEESummar yRequest() ;
  137                    eeSu mmaryReque st.setKey( icn);
  138                    eeSu mmaryReque st.setKeyT ype("VPID" );
  139                    eeSu mmaryReque st.setRequ estName("p referredFa cility");
  140  
  141                    GetE ESummaryRe sponse eeS ummaryResp onse = nul l;
  142                    try
  143                    {
  144                             Proper ties prope rtiesColle ction = Pr opertiesCo llectionFa ctory.getP ropertiesC ollection( connection Filename);
  145                             Proper ties conne ctionPrope rties = (P roperties)  propertie sCollectio n.get(conn ection);
  146                             String  wsdlURL =  connectio nPropertie s.getPrope rty("wsdlU RL");
  147                             String  username  = connecti onProperti es.getProp erty("user name");
  148                             String  password  = connecti onProperti es.getProp erty("pass word");
  149  
  150                             eeSumm aryRespons e = getEES ummaryPort (wsdlURL,  username,  password). getEESumma ry(eeSumma ryRequest) ;
  151                             if(eeS ummaryResp onse.getSu mmary() ==  null || e eSummaryRe sponse.get Summary(). getDemogra phics() ==  null || N ullChecker .isNullOrE mpty(eeSum maryRespon se.getSumm ary().getD emographic s().getPre ferredFaci lity()))
  152                             {
  153                                      eeSummar yResponse  = createDe faultRespo nse("<UNKN OWN>", "<U NKNOWN>");
  154                             }
  155                    }
  156                    catc h(SOAPFaul tException  sfe)
  157                    {
  158                             if(sfe .getMessag e().equals ("PERSON_N OT_FOUND") )
  159                             {
  160   //                                 logger.e rror("ESR  does not k now patien t with ICN  {} ", icn , sfe);
  161                                      logger.e rror("Soap  fault exc eption whi le trying  to get pat ient by IC N : ", sfe );
  162                                      eeSummar yResponse  = createDe faultRespo nse("<UNKN OWN>", "<U NKNOWN>");
  163                             }
  164                             else
  165                             {
  166                                      logger.e rror("Ther e was an e rror getti ng data fr om ESR {}  ", sfe);
  167                                      eeSummar yResponse  = createDe faultRespo nse("<UNAV AILABLE>",  "<UNAVAIL ABLE>");
  168                             }
  169                    }
  170                    // C CR 177986-  improved  log relate d code
  171                    catc h(Exceptio n e)
  172                    {
  173                             logger .error("Th ere was an  error get ting data  from ESR.   Message =  {}", e);
  174                             eeSumm aryRespons e = create DefaultRes ponse("<UN AVAILABLE> ", "<UNAVA ILABLE>");
  175                    }
  176  
  177                    ret. add(eeSumm aryRespons e);
  178  
  179                    retu rn ret;
  180           }
  181  
  182           pr ivate sync hronized E eSummaryPo rt getEESu mmaryPort( String eeS ummaryServ iceWSDL, S tring user name, Stri ng passwor d)
  183           {
  184                    if(e eSummarySe rvice == n ull)
  185                    {
  186                             try
  187                             {
  188                                       eeSummaryS ervice = n ew EeSumma ryPortServ ice(new UR L(eeSummar yServiceWS DL), new Q Name("http ://jaxws.w ebservices .esr. URL         /schemas",  "eeSummar yPortServi ce"));
  189  
  190                                      if(!Null Checker.is NullOrEmpt y(username ) && !Null Checker.is NullOrEmpt y(password ))
  191                                      {
  192                                               eeSummaryS ervice.set HandlerRes olver(new  HeaderHand lerResolve r(username , password ));
  193                                      }
  194                             }
  195                             catch( Throwable  t)
  196                             {
  197                                      throw ne w RuntimeE xception(" Error gett ing EESumm aryPort.",  t);
  198                             }
  199                    }
  200                    retu rn eeSumma ryService. getEeSumma ryPortSoap 11();
  201           }
  202  
  203           pr ivate GetE ESummaryRe sponse cre ateDefault Response(S tring faci lityNumber , String f acilityNam e)
  204           {
  205                    GetE ESummaryRe sponse eeS ummaryResp onse = new  GetEESumm aryRespons e();
  206  
  207                    EeSu mmary eeSu mmary = ne w EeSummar y();
  208                    eeSu mmaryRespo nse.setSum mary(eeSum mary);
  209  
  210                    Demo graphicInf o demograp hicInfo =  new Demogr aphicInfo( );
  211                    eeSu mmary.setD emographic s(demograp hicInfo);
  212  
  213                    // C CR 177986- logging up dates
  214                    logg er.debug(" facilityNu mber: {}",  facilityN umber);
  215                    logg er.debug(" facilityNa me: {}", f acilityNam e);
  216  
  217                    demo graphicInf o.setPrefe rredFacili ty(facilit yNumber +  " - " + fa cilityName );
  218  
  219                    retu rn eeSumma ryResponse ;
  220           }
  221   }