206. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 6/9/2017 3:45:43 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.

206.1 Files compared

# Location File Last Modified
1 eHealth_Exch (eHealth Exchange Enhancements) Build 3 docs & code_May_2017.zip\eHXE_Build3_2017-05-04.zip\NHIN_adapter\AdapterEJB\src\main\java\gov\va\med\nhin\adapter\adaptergateway\docretrieve AdapterGatewayDocRetrieve.java Wed May 3 15:58:46 2017 UTC
2 eHealth_Exch (eHealth Exchange Enhancements) Build 3 docs & code_May_2017.zip\eHXE_Build3_2017-05-04.zip\NHIN_adapter\AdapterEJB\src\main\java\gov\va\med\nhin\adapter\adaptergateway\docretrieve AdapterGatewayDocRetrieve.java Thu Jun 1 21:35:30 2017 UTC

206.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 796
Changed 1 2
Inserted 0 0
Removed 0 0

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

206.4 Active regular expressions

No regular expressions were active.

206.5 Comparison detail

  1   package go v.va.med.n hin.adapte r.adapterg ateway.doc retrieve;
  2  
  3   import jav a.util.con current.Ca llable;
  4   import jav a.util.con current.Ex ecutionExc eption;
  5   import jav a.util.con current.Ex ecutorComp letionServ ice;
  6   import jav a.util.con current.Ex ecutorServ ice;
  7  
  8   import jav ax.ejb.EJB ;
  9   import jav ax.ejb.*;
  10  
  11   import org .apache.co mmons.lang 3.StringUt ils;
  12   import org .slf4j.Log ger;
  13   import org .slf4j.Log gerFactory ;
  14  
  15   import gov .hhs.fha.n hinc.adapt erpolicyen gine.Adapt erPolicyEn ginePortTy pe;
  16   import gov .hhs.fha.n hinc.commo n.eventcom mon.DocRet rieveEvent Type;
  17   import gov .hhs.fha.n hinc.commo n.eventcom mon.DocRet rieveMessa geType;
  18   import gov .hhs.fha.n hinc.commo n.nhinccom mon.Assert ionType;
  19   import gov .hhs.fha.n hinc.commo n.nhinccom mon.HomeCo mmunityTyp e;
  20   import gov .hhs.fha.n hinc.commo n.nhinccom monadapter .CheckPoli cyRequestT ype;
  21   import gov .hhs.fha.n hinc.commo n.nhinccom monadapter .CheckPoli cyResponse Type;
  22   import gov .hhs.fha.n hinc.commo n.nhinccom monentity. Responding GatewayCro ssGatewayR etrieveReq uestType;
  23   import gov .hhs.fha.n hinc.nhinc lib.NhincC onstants;
  24   import gov .hhs.fha.n hinc.trans form.polic y.PolicyEn gineTransf ormer;
  25   import gov .va.med.nh in.adapter .adapterga teway.work manager.Wo rkManagerE xecutorSer viceLocal;
  26   import gov .va.med.nh in.adapter .facilitym anager.Fac ility;
  27   import gov .va.med.nh in.adapter .facilitym anager.Fac ilityManag er;
  28   import gov .va.med.nh in.adapter .facilitym anager.Fac ilityManag erLocal;
  29   import gov .va.med.nh in.adapter .facilitym anager.Ope rationOnOf f;
  30   import gov .va.med.nh in.adapter .logging.C heckPolicy ;
  31   import gov .va.med.nh in.adapter .logging.E ntityRetri eveError;
  32   import gov .va.med.nh in.adapter .logging.E rrorMessag e;
  33   import gov .va.med.nh in.adapter .logging.E ventAuditi ngFactory;
  34   import gov .va.med.nh in.adapter .logging.E ventAuditi ngFactoryI mpl;
  35   import gov .va.med.nh in.adapter .logging.L ogConstant s.Auditing Event;
  36   import gov .va.med.nh in.adapter .logging.M aintLog;
  37   import gov .va.med.nh in.adapter .policyeng ine.Adapte rPolicyEng inePortTyp eLocal;
  38   import ihe .iti.xds_b ._2007.Ret rieveDocum entSetRequ estType;
  39   import ihe .iti.xds_b ._2007.Ret rieveDocum entSetRequ estType.Do cumentRequ est;
  40   import ihe .iti.xds_b ._2007.Ret rieveDocum entSetResp onseType;
  41   import oas is.names.t c.ebxml_re grep.xsd.r s._3.Regis tryError;
  42   import oas is.names.t c.ebxml_re grep.xsd.r s._3.Regis tryErrorLi st;
  43   import oas is.names.t c.ebxml_re grep.xsd.r s._3.Regis tryRespons eType;
  44   import org .hl7.fhir. dstu3.mode l.AuditEve nt;
  45  
  46   /**
  47    *
  48    * @author   DN S     
  49    */
  50  
  51   @Transacti onAttribut e(value =  Transactio nAttribute Type.SUPPO RTS)
  52   @Stateless (name = "A dapterGate wayDocRetr ieve")
  53   public cla ss Adapter GatewayDoc Retrieve i mplements  EntityDocR etrievePor tTypeLocal
  54   {
  55           pr ivate stat ic final L ogger logg er = Logge rFactory.g etLogger(A dapterGate wayDocRetr ieve.class .getName() );
  56  
  57           pr ivate clas s SendRequ estRespons e
  58           {
  59                    publ ic Retriev eDocumentS etResponse Type retri eveDocumen tSetRespon se;
  60                    publ ic SendReq uestExcept ion sre =  null;
  61  
  62                    publ ic boolean  hasError( )
  63                    {
  64                             return  sre != nu ll;
  65                    }
  66           }
  67  
  68           pr ivate clas s SendRequ estExcepti on extends  Exception
  69           {
  70                    priv ate static  final lon g serialVe rsionUID =  1L;
  71                    
  72                    publ ic String  remoteHome CommunityI d;
  73           }
  74  
  75           pr ivate clas s SendRequ estCallabl e implemen ts Callabl e<SendRequ estRespons e>
  76           {
  77                    publ ic final R etrieveDoc umentSetRe questType  retrieveDo cumentSetR equest;
  78                    publ ic final A ssertionTy pe asserti on;
  79                    publ ic final S tring remo teHomeComm unityId;
  80  
  81                    publ ic SendReq uestCallab le(Retriev eDocumentS etRequestT ype retrie veDocument SetRequest , Assertio nType asse rtion, Str ing remote HomeCommun ityId)
  82                    {
  83                             this.r etrieveDoc umentSetRe quest = re trieveDocu mentSetReq uest;
  84                             this.a ssertion =  assertion ;
  85                             this.r emoteHomeC ommunityId  = remoteH omeCommuni tyId;
  86  
  87                             logger .info("RD  request ca llable cre ated.");
  88                    }
  89  
  90                    @Ove rride
  91                    publ ic SendReq uestRespon se call()  throws Exc eption
  92                    {
  93                             logger .info("RD  request ca llable sen ding reque st...");
  94                             return  sendReque st(retriev eDocumentS etRequest,  assertion , remoteHo meCommunit yId);
  95                    }
  96           }
  97  
  98           pr ivate Faci lityManage r facility Manager;
  99           pr ivate Adap terPolicyE nginePortT ype adapte rPolicyEng ine;
  100           pr ivate NHIN DocRetriev eRequestSe nder nhinD ocRetrieve RequestSen der;
  101           pr ivate Exec utorServic e executor Service;
  102  
  103           @E JB(beanInt erface = F acilityMan agerLocal. class, bea nName = "F acilityMan ager")
  104           pu blic void  setFacilit yManager(F acilityMan ager facil ityManager )
  105           {
  106                    this .facilityM anager = f acilityMan ager;
  107           }
  108  
  109           @E JB(beanInt erface = A dapterPoli cyEnginePo rtTypeLoca l.class, b eanName =  "AdapterPo licyEngine ")
  110           pu blic void  setAdapter PolicyEngi ne(Adapter PolicyEngi nePortType  adapterPo licyEngine )
  111           {
  112                    this .adapterPo licyEngine  = adapter PolicyEngi ne;
  113           }
  114  
  115           @E JB(beanInt erface = N HINDocRetr ieveReques tSender.cl ass, beanN ame = "Nhi ncProxyNHI NDocRetrie veRequestS ender")
  116           pu blic void  setNhinDoc QueryReque stSender(N HINDocRetr ieveReques tSender nh inDocQuery RequestSen der)
  117           {
  118                    this .nhinDocRe trieveRequ estSender  = nhinDocQ ueryReques tSender;
  119           }
  120  
  121           // @EJB(beanI nterface =  WorkManag erExecutor ServiceLoc al.class,  beanName =  "WorkMana gerExecuto rService")
  122           @E JB(beanInt erface = W orkManager ExecutorSe rviceLocal .class, be anName = " OutboundRD WorkManage rExecutorS ervice")   //changed  1/24/2017
  123           pu blic void  setExecuto rService(E xecutorSer vice execu torService )
  124           {
  125                    this .executorS ervice = e xecutorSer vice;
  126           }
  127  
  128           @O verride
  129           pu blic Retri eveDocumen tSetRespon seType res pondingGat ewayCrossG atewayRetr ieve(Respo ndingGatew ayCrossGat ewayRetrie veRequestT ype respon dingGatewa yCrossGate wayRetriev eRequest)
  130           {
  131  
  132                    Even tAuditingF actory<Aud itEvent> a fac
  133                                      = EventA uditingFac toryImpl.g etFactory(  AuditEven t.class );
  134                    afac .debug( af ac.newEven t( respond ingGateway CrossGatew ayRetrieve Request.ge tAssertion (),
  135                                      Auditing Event.RDOU T_BEGIN, g etClass()  ) );
  136                    // C CR 177986
  137                    logg er.debug(" responding GatewayCro ssGatewayR etrieve()  invoked");
  138  
  139                    Retr ieveDocume ntSetRespo nseType re t = new Re trieveDocu mentSetRes ponseType( );
  140                    Retr ieveDocume ntSetReque stType ret rieveDocum entSetRequ est
  141                                      = respon dingGatewa yCrossGate wayRetriev eRequest.g etRetrieve DocumentSe tRequest() ;
  142  
  143                    // C CR 177986
  144                    logg er.debug(" RetrieveDo cumentSetR equestType  retrieveD ocumentSet Request {}  ", retrie veDocument SetRequest );
  145  
  146                    Asse rtionType  assertion  = respondi ngGatewayC rossGatewa yRetrieveR equest.get Assertion( );
  147  
  148                    // C CR 177986
  149                    logg er.debug("  Assertion Type asser tion {} ",  assertion );
  150  
  151                    Exec utorComple tionServic e<SendRequ estRespons e> complet ionService
  152                                      = new Ex ecutorComp letionServ ice<>(exec utorServic e);
  153                    int  numSubmitt ed = 0;
  154  
  155                    for( DocumentRe quest docu mentReques t : retrie veDocument SetRequest .getDocume ntRequest( ))
  156                    {
  157                             Retrie veDocument SetRequest Type newRe quest = cr eateRetrie veDocument SetRequest (documentR equest);
  158  
  159                             logger .debug("Re trieveDocu mentSetReq uestType n ewRequest  {} ", newR equest); / / CCR
  160                                                                                                                                                                                                    // 1 77986
  161                             logger .debug("Ho me Communi ty Id {} :  ", docume ntRequest. getHomeCom munityId() );
  162  
  163                             if(che ckPolicy(n ewRequest,  assertion , document Request.ge tHomeCommu nityId()))
  164                             {
  165                                      if(facil ityManager .isPartner Allowed(do cumentRequ est.getHom eCommunity Id(), Oper ationOnOff .ONBOARD))
  166                                      {
  167                                               if(facilit yManager.i sPartnerAl lowed(docu mentReques t.getHomeC ommunityId (), Operat ionOnOff.O UT_DR))
  168                                               {
  169                                                       af ac.debug(  afac.messa ging().par tnerauth(  AuditingEv ent.RDOUT_ PARTNERAUT H,
  170                                                                         getCla ss(), docu mentReques t.getHomeC ommunityId () ) );
  171  
  172                                                       Se ndRequestC allable ca llable = n ew SendReq uestCallab le(newRequ est, asser tion, docu mentReques t.getHomeC ommunityId ());
  173                                                       af ac.debug(  afac.messa ging().req res( Audit ingEvent.R DOUT_RD, g etClass(),
  174                                                                         docume ntRequest. getHomeCom munityId()  ) );
  175                                                       co mpletionSe rvice.subm it(callabl e);
  176                                                       ++ numSubmitt ed;
  177  
  178                                                       lo gger.debug ("numSubmi tted {} ",  numSubmit ted);
  179                                               }
  180                                               else
  181                                               {
  182                                                       //  Outbound  DR Error
  183                                                       ad dErrorToRe sponse(ret , "Interna l Registry /Repositor y Error: "  + ErrorMe ssage.OUT_ DR_DISABLE D.getMessa ge(), docu mentReques t.getHomeC ommunityId ());
  184                                                       Ma intLog.que ryError(nu ll, ErrorM essage.OUT _DQ_DISABL ED, docume ntRequest. getHomeCom munityId() , logger);
  185                                               }
  186                                      }
  187                                      else
  188                                      {
  189                                               // Outboun d no partn er
  190                                               addErrorTo Response(r et, "Inter nal Regist ry/Reposit ory Error:  " + Error Message.OU T_DR_NOT_A _PARTNER.g etMessage( ), documen tRequest.g etHomeComm unityId()) ;
  191                                               MaintLog.q ueryError( null, Erro rMessage.O UT_DR_NOT_ A_PARTNER,  documentR equest.get HomeCommun ityId(), l ogger);
  192                                      }
  193                             }
  194                    }
  195  
  196                    for( int i = 0;  i < numSu bmitted; + +i)
  197                    {
  198                             try
  199                             {
  200                                      SendRequ estRespons e response  = complet ionService .take().ge t();
  201                                      if(!resp onse.hasEr ror())
  202                                      {
  203                                               addResultT oResponse( ret, respo nse.retrie veDocument SetRespons e);
  204                                      }
  205                                      else
  206                                      {
  207                                               SendReques tException  sre = res ponse.sre;
  208                                               addErrorTo Response(r et, "Inter nal Regist ry/Reposit ory Error  - HCID = "  + sre.rem oteHomeCom munityId,  sre.remote HomeCommun ityId);
  209                                               logger.war n("Error s ending Doc Retrieve f or communi ty id: {}  with excep tion: {} " , sre.remo teHomeComm unityId, s re); // CC R
  210                                                                                                                                                                                                                                                                                                              // 17798 6-
  211                                                                                                                                                                                                                                                                                                              // loggi ng
  212  
  213                                      }
  214                             }
  215                             catch( ExecutionE xception e e)
  216                             {
  217                                      logger.e rror("An U nknown err or occured  processin g an outbo und doc re trieve req uest.", ee );
  218                                      EntityRe trieveErro r.retrieve Error(resp ondingGate wayCrossGa tewayRetri eveRequest , ErrorMes sage.OUT_D R_UKNOWN,  ee.getMess age());
  219                             }
  220                             catch( Interrupte dException  ie)
  221                             {
  222                                      logger.e rror("Outb ound Doc R etrieve Th reads inte rrupted.   Return wil l not be c omplete.",  ie);
  223                             }
  224                    }
  225  
  226                    afac .debug( Au ditingEven t.RDOUT_EN D, getClas s() );
  227                    retu rn ret;
  228           }
  229  
  230           pr ivate Retr ieveDocume ntSetReque stType cre ateRetriev eDocumentS etRequest( DocumentRe quest docu mentReques t)
  231           {
  232                    Retr ieveDocume ntSetReque stType ret  = new Ret rieveDocum entSetRequ estType();
  233                    ret. getDocumen tRequest() .add(docum entRequest );
  234                    retu rn ret;
  235           }
  236  
  237           pr ivate bool ean checkP olicy(Retr ieveDocume ntSetReque stType ret rieveDocum entSetRequ est, Asser tionType a ssertion,  String rem oteHomeCom munityId)
  238           {
  239                    logg er.debug(" DR Check P olicy");
  240  
  241                    DocR etrieveMes sageType d ocRetrieve Message =  new DocRet rieveMessa geType();
  242                    docR etrieveMes sage.setRe trieveDocu mentSetReq uest(retri eveDocumen tSetReques t);
  243                    docR etrieveMes sage.setAs sertion(as sertion);
  244                    logg er.info("R equest doc RetrieveMe ssage crea ted");
  245  
  246                    Home CommunityT ype receiv ingHomeCom munity = n ew HomeCom munityType ();
  247                    rece ivingHomeC ommunity.s etHomeComm unityId(re moteHomeCo mmunityId) ;
  248                    logg er.debug(" Request re ceivingHom eCommunity : {}", rem oteHomeCom munityId);
  249  
  250                    Home CommunityT ype sendin gHomeCommu nity = new  HomeCommu nityType() ;
  251                    send ingHomeCom munity.set HomeCommun ityId(getH omeCommuni tyId());
  252                    logg er.debug(" Request se ndingHomeC ommunity:  {}", sendi ngHomeComm unity.getH omeCommuni tyId());
  253  
  254                    DocR etrieveEve ntType doc RetrieveEv ent = new  DocRetriev eEventType ();
  255                    docR etrieveEve nt.setMess age(docRet rieveMessa ge);
  256                    docR etrieveEve nt.setDire ction(Nhin cConstants .POLICYENG INE_OUTBOU ND_DIRECTI ON);
  257                    logg er.debug(" Request do cRetrieveE vent Direc tion: {}",  NhincCons tants.POLI CYENGINE_O UTBOUND_DI RECTION);
  258                    docR etrieveEve nt.setInte rface(Nhin cConstants .AUDIT_LOG _ENTITY_IN TERFACE);
  259                    logg er.debug(" Request do cRetrieveE vent Inter face: {}",  NhincCons tants.AUDI T_LOG_ENTI TY_INTERFA CE);
  260                    docR etrieveEve nt.setRece ivingHomeC ommunity(r eceivingHo meCommunit y);
  261                    docR etrieveEve nt.setSend ingHomeCom munity(sen dingHomeCo mmunity);
  262                    logg er.debug(" Request do cRetrieveE vent creat ed");
  263  
  264                    Poli cyEngineTr ansformer  transforme r = new Po licyEngine Transforme r();
  265                    Chec kPolicyReq uestType c heckPolicy Request =  transforme r.transfor mDocRetrie veToCheckP olicy(docR etrieveEve nt);
  266                    logg er.debug(" checkPolic yRequest c ompleted") ;
  267  
  268           if  (facility Manager.ge tFacilityB yFacilityN umber("200 NSS") == n ull || !re moteHomeCo mmunityId. contains(f acilityMan ager.getFa cilityByFa cilityNumb er("200NSS ").getFull HomeCommun ityId()))
  269                    {
  270                             logger .info("Goi ng to chec kPolicy in  adapterPo licyEngine ...");
  271                             CheckP olicyRespo nseType ch eckPolicyR esponse =  adapterPol icyEngine. checkPolic y(checkPol icyRequest );
  272                             return  CheckPoli cy.checkPo licy(check PolicyRequ est, check PolicyResp onse);
  273                    }
  274  
  275                    retu rn true;
  276           }
  277  
  278           pr ivate void  addResult ToResponse (RetrieveD ocumentSet ResponseTy pe retriev eDocumentS etResponse , Retrieve DocumentSe tResponseT ype result )
  279           {
  280                    logg er.debug(" In addResu ltToRespon se");
  281                    if(r etrieveDoc umentSetRe sponse.get RegistryRe sponse() = = null)
  282                    {
  283                             if(res ult.getReg istryRespo nse() != n ull)
  284                             {
  285                                      retrieve DocumentSe tResponse. setRegistr yResponse( result.get RegistryRe sponse());
  286                             }
  287                             else
  288                             {
  289                                      retrieve DocumentSe tResponse. setRegistr yResponse( new Regist ryResponse Type());
  290                             }
  291                    }
  292  
  293                    if(r esult.getR egistryRes ponse().ge tRegistryE rrorList()  != null)
  294                    {
  295                             logger .debug("Re gistry Err or List is  not null.  Adding er rors to Re gistry Res ponse");
  296                             if(ret rieveDocum entSetResp onse.getRe gistryResp onse() ==  null)
  297                             {
  298                                      retrieve DocumentSe tResponse. setRegistr yResponse( new Regist ryResponse Type());
  299                             }
  300                             if(ret rieveDocum entSetResp onse.getRe gistryResp onse().get RegistryEr rorList()  == null)
  301                             {
  302                                      retrieve DocumentSe tResponse. getRegistr yResponse( ).setRegis tryErrorLi st(new Reg istryError List());
  303                             }
  304                             retrie veDocument SetRespons e.getRegis tryRespons e().getReg istryError List().get RegistryEr ror().addA ll(result. getRegistr yResponse( ).getRegis tryErrorLi st().getRe gistryErro r());
  305                             retrie veDocument SetRespons e.getRegis tryRespons e().getReg istryError List().set HighestSev erity(resu lt.getRegi stryRespon se().getRe gistryErro rList().ge tHighestSe verity());
  306                    }
  307  
  308                    if(r esult.getR egistryRes ponse().ge tStatus()  != null)
  309                    {
  310                             if(ret rieveDocum entSetResp onse.getRe gistryResp onse() !=  null)
  311                             {
  312                                      retrieve DocumentSe tResponse. getRegistr yResponse( ).setStatu s(result.g etRegistry Response() .getStatus ());
  313                             }
  314                    }
  315                    retr ieveDocume ntSetRespo nse.getDoc umentRespo nse().addA ll(result. getDocumen tResponse( ));
  316           }
  317  
  318           pr ivate void  addErrorT oResponse( RetrieveDo cumentSetR esponseTyp e retrieve DocumentSe tResponse,  String er rorString,  final Str ing hcid)
  319           {
  320                    logg er.debug(" In addErro rToRespons e");
  321                    if(r etrieveDoc umentSetRe sponse !=  null)
  322                    {
  323                             if(ret rieveDocum entSetResp onse.getRe gistryResp onse() ==  null)
  324                             {
  325                                      retrieve DocumentSe tResponse. setRegistr yResponse( new Regist ryResponse Type());
  326                             }
  327  
  328                             if(ret rieveDocum entSetResp onse.getRe gistryResp onse().get RegistryEr rorList()  == null)
  329                             {
  330                                      retrieve DocumentSe tResponse. getRegistr yResponse( ).setRegis tryErrorLi st(new Reg istryError List());
  331                             }
  332  
  333                             retrie veDocument SetRespons e.getRegis tryRespons e().getReg istryError List().set HighestSev erity("urn :oasis:nam es:tc:ebxm l-regrep:E rrorSeveri tyType:Err or");
  334  
  335                             Regist ryError re gistryErro r = new Re gistryErro r();
  336                             regist ryError.se tErrorCode ("XDSRegis tryError") ;
  337                             regist ryError.se tCodeConte xt(errorSt ring);
  338                             
  339                             if(Str ingUtils.i sNotBlank( hcid))
  340                             {
  341                                      registry Error.setL ocation(hc id);
  342                             }
  343                             
  344                             regist ryError.se tSeverity( "urn:oasis :names:tc: ebxml-regr ep:ErrorSe verityType :Error");
  345                             retrie veDocument SetRespons e.getRegis tryRespons e().getReg istryError List().get RegistryEr ror().add( registryEr ror);
  346                    }
  347           }
  348  
  349           pr ivate bool ean commun itySupport s2011Specs (String hi eCommunity Oid)
  350           {
  351                    logg er.debug(" In communi tySupports 2011Specs" );
  352                    // f etch the f acility in formation
  353                    Faci lity facil ity = faci lityManage r.getFacil ityByFullH omeCommuni tyId(hieCo mmunityOid );
  354                    if(f acility ==  null)
  355                    {
  356                             logger .error("Er ror gettin g facility  from {}",  hieCommun ityOid);
  357                             return  false;
  358                    }
  359                    retu rn Facilit y.SPEC_VER SION_2011. equals(fac ility.getU seSpecVers ion());
  360           }
  361  
  362           pr ivate Send RequestRes ponse send Request(Re trieveDocu mentSetReq uestType r etrieveDoc umentSetRe quest, Ass ertionType  assertion , String r emoteHomeC ommunityId ) throws S endRequest Exception
  363           {
  364                    logg er.info("D R Send Req uest...");
  365  
  366                    Send RequestRes ponse ret  = new Send RequestRes ponse();
  367  
  368                    try
  369                    {
  370                             boolea n use2011S pec = fals e;
  371                             if(com munitySupp orts2011Sp ecs(remote HomeCommun ityId))
  372                             {
  373                                      use2011S pec = true ;
  374                             }
  375                             ret.re trieveDocu mentSetRes ponse = nh inDocRetri eveRequest Sender.sen dRequest(r etrieveDoc umentSetRe quest, ass ertion, re moteHomeCo mmunityId,  use2011Sp ec);
  376                             logger .debug("RD  response  recieved f rom SSA");
  377                    }
  378                    catc h(Throwabl e e)
  379                    {
  380                             SendRe questExcep tion sre =  new SendR equestExce ption();
  381                             sre.re moteHomeCo mmunityId  = remoteHo meCommunit yId;
  382                             sre.in itCause(e) ;
  383                             ret.sr e = sre;
  384                             logger .debug("Er ror sendin g RD to SS A: {}", e. getMessage ());
  385                    }
  386                    retu rn ret;
  387           }
  388  
  389           pr ivate Stri ng getHome CommunityI d()
  390           {
  391                    Stri ng ret = n ull;
  392                    Faci lity facil ity = faci lityManage r.getFacil ityByFacil ityNumber( "VA");
  393                    if(f acility !=  null)
  394                    {
  395                             ret =  facility.g etHomeComm unityId();
  396                    }
  397                    retu rn ret;
  398           }
  399   }