4306. EPMO Open Source Coordination Office Redaction File Detail Report

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

4306.1 Files compared

# Location File Last Modified
1 Fri Jun 9 19:51:27 2017 UTC
2 eHealth_Exch (eHealth Exchange Enhancements) Build 3 docs & code_May_2017.zip\VAP_CIF_CODE0502.zip\VAP_CIF_CODE0502\VAP_CIF_CODE0502\nvap-web\src\main\java\gov\va\nvap\web\report DisclosureSummaryReportResults.java Fri Apr 21 20:03:30 2017 UTC

4306.2 Comparison summary

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

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

4306.4 Active regular expressions

No regular expressions were active.

4306.5 Comparison detail

        1   package go v.va.nvap. web.report ;
        2  
        3   import gov .va.med.nh in.adapter .audit.Act ionType;
        4   import gov .va.med.nh in.adapter .audit.Act ionValuesT ype;
        5   import gov .va.med.nh in.adapter .audit.Aud itSummarie sType;
        6   import gov .va.med.nh in.adapter .audit.Aud itSummaryT ype;
        7   import gov .va.med.nh in.adapter .audit.Fie ldType;
        8   import gov .va.med.nh in.adapter .audit.Get AuditsSumm ary;
        9   import gov .va.med.nh in.adapter .audit.Get AuditsSumm aryRespons e;
        10   import gov .va.med.nh in.adapter .audit.Gro upByFields Type;
        11   import gov .va.med.nh in.adapter .audit.Pag eInfoType;
        12   import gov .va.med.nh in.adapter .audit.Str ingValuesT ype;
        13   import gov .va.med.nh in.adapter .audit.Sum maryFields Type;
        14   import gov .va.nvap.c ommon.date .Gregorian DateUtil;
        15   import gov .va.nvap.c ommon.sort .BubbleSor tListMap;
        16   import gov .va.nvap.c ommon.vali dation.Nul lChecker;
        17   import gov .va.nvap.p rivacy.Org anizationT ype;
        18   import gov .va.nvap.s ervice.ada pter.audit .AdapterAu ditManager ;
        19   import gov .va.nvap.s ervice.ada pter.audit .DirectAud itManager;
        20   import gov .va.nvap.s ervice.ada pter.audit .DirectSer viceEndpoi nt;
        21   import gov .va.nvap.s ervice.aud it.AuditEx ception;
        22   import gov .va.nvap.w eb.app.Res ponseDispa tcherHttpS ervlet;
        23   import gov .va.nvap.w eb.dao.Fac ilityDAO;
        24   import gov .va.nvap.w eb.helper. document.D ocumentHel per;
        25   import gov .va.nvap.w eb.helper. facility.F acilityHel per;
        26   import gov .va.nvap.w eb.helper. privacy.Co nsentManag ementHelpe r;
        27   import gov .va.nvap.w eb.helper. report.Rep ortHelper;
        28   import gov .va.nvap.w eb.util.xl s.ExcelExp orter;
        29  
        30   import jav a.io.IOExc eption;
        31   import jav a.util.Arr ayList;
        32   import jav a.util.Dat e;
        33   import jav a.util.Has hMap;
        34   import jav a.util.Lis t;
        35   import jav a.util.Map ;
        36  
        37   import jav ax.ejb.EJB ;
        38   import jav ax.servlet .ServletEx ception;
        39   import jav ax.servlet .http.Http ServletReq uest;
        40   import jav ax.servlet .http.Http ServletRes ponse;
        41   import jav ax.servlet .http.Http Session;
        42  
        43   import jav a.util.Lin kedHashMap ;
        44   import org .apache.po i.ss.userm odel.Workb ook;
        45  
        46   /**
        47    * Disclos ures Summa ry Report  results se rvlet
        48    */
        49   public cla ss Disclos ureSummary ReportResu lts extend s
        50       Respon seDispatch erHttpServ let {
        51  
        52       /**
        53        * Ser ial UID.
        54        */
        55       privat e static f inal long  serialVers ionUID = - 7902989393 412212166L ;
        56       privat e AdapterA uditManage r adapterA uditManage r;
        57       privat e final Di rectAuditM anager dir ectAuditMa nager = ne w DirectSe rviceEndpo int();
        58  
        59       /**
        60        * Exp ort to exc el - This  method is  called whe n the user  clicks on  the excel  icon in t he JSP. Re flection i s used in  the
        61        * Res ponseDispa tcherHttpS ervlet to  call this  method bas ed on the  http param eters.
        62        *
        63        * @pa ram reques t HTTP Req uest
        64        * @pa ram respon se HTTP Re sponse
        65        * @th rows Servl etExceptio n
        66        * @th rows IOExc eption
        67        */
        68       public  void expo rtToExcel( final Http ServletReq uest reque st,
        69           fi nal HttpSe rvletRespo nse respon se) throws  ServletEx ception,
        70           IO Exception  {
        71           //  Get the s ession
        72           fi nal HttpSe ssion sess ion = requ est.getSes sion(false );
        73           //  Get the r esults fro m the adap ter
        74           fi nal List<M ap<String,  Object>>  results =  this.getRe sults(
        75                request. getSession ());
        76                                      //reques t.getSessi on(), new  Paginator( -1));
        77           //  Create a  map of key  which is  based on t he result  data key a nd the
        78           //  heading v alue
        79           //  The headi ng is used  to create  the colum n headers  and the ke y is used
        80           //  to pull t he data fr om the res ults
        81           fi nal Map<St ring, Stri ng> disclo sureSummar yMap = new  LinkedHas hMap<Strin g, String> ();
        82           di sclosureSu mmaryMap.p ut("partne rOrg", "eH ealth Exch ange Organ ization");
        83           if  ("Exchang e".equals( (String) s ession.get Attribute( "disclosur eSummaryQu erySource" ))) {
        84                disclosu reSummaryM ap.put("va Facility",  "Patient  Preferred  Facility") ;
        85                disclosu reSummaryM ap.put("va FacilityNu mber", "Pa tient Pref erred Faci lity Stati on ID");
        86                disclosu reSummaryM ap.put("oi d", "OID") ;
        87           }
        88           di sclosureSu mmaryMap.p ut("total" , "Total") ;
        89  
        90           //  Generate  filters.
        91           fi nal Map<St ring, List <Object>>  filterMap  = new Link edHashMap< String, Li st<Object> >();
        92           Li nkedHashMa p<String,  Object> fi lters = ne w LinkedHa shMap<Stri ng, Object >();
        93           
        94           St ring orgNa me = (Stri ng) sessio n.getAttri bute("disc losureSumm aryQueryOr gName");
        95           if  (NullChec ker.isNull OrEmpty(or gName)) {
        96                orgName  = "ALL";
        97           }
        98           
        99           fi lters.put( "Disclosur e Source",  session.g etAttribut e("disclos ureSummary QuerySourc e"));
        100           fi lters.put( "Start Dat e", this.g etReportHe lper().get FormattedD ate((Date)  session.g etAttribut e("disclos ureSummary QueryStart Date")));
        101           fi lters.put( "End Date" , this.get ReportHelp er().getFo rmattedDat e((Date) s ession.get Attribute( "disclosur eSummaryQu eryEndDate ")));
        102           // filters.pu t("User ID ", session .getAttrib ute("discl osureSumma ryQueryUse rId"));
        103           fi lters.put( "Patient P referred F acility",  ExcelExpor ter.getPat ientPrefer redFacilit yFilter(ge tFacilityD AO(), (Str ing) sessi on.getAttr ibute("dis closureSum maryQueryF acility")) );
        104           fi lters.put( "eHealth E xchange Or ganization ", orgName );
        105           Ex celExporte r.populate FilterMapF orExport(r equest, fi lters, fil terMap, se ssion.getA ttribute(" patientTyp es").toStr ing());
        106  
        107                    // C reate the  optional d ata rows
        108           fi nal Object  disclosur eDocumentC ount = ses sion.getAt tribute("d isclosureS ummaryTota lCount");
        109           fi nal Map<St ring, List <Object>>  optionalRo ws = new L inkedHashM ap<String,  List<Obje ct>>();
        110           fi nal List<O bject> dis closureDoc umentRow =  new Array List<Objec t>();
        111           di sclosureDo cumentRow. add(disclo sureDocume ntCount);
        112           op tionalRows .put("Gran d Total",  disclosure DocumentRo w);
        113           
        114           //  Create th e workbook
        115           fi nal String  title = " Disclosure s Summary  Report";
        116           fi nal Workbo ok wb = th is.getExce lExporter( ).exportTo Excel(titl e, title,  disclosure SummaryMap , results,  filterMap , optional Rows);
        117           
        118           //  Write Exc el to Stre am
        119           th is.getExce lExporter( ).writeExc elToStream ("Disclosu res_Summar y_Report",  wb, respo nse);
        120       }
        121  
        122       /**
        123        * Get  the conse nt managem ent helper  from Spri ng.
        124        * @re turn Conse ntManageme ntHelper
        125        */
        126       public  ConsentMa nagementHe lper getCm sHelper()  {
        127           fi nal Consen tManagemen tHelper cm sHelper =  this.getBe an("cmsHel per",
        128                ConsentM anagementH elper.clas s);
        129           re turn cmsHe lper;
        130       }
        131  
        132       /**
        133        * Get  the docum ent helper  from Spri ng.
        134        * @re turn Docum entHelper
        135        */
        136       public  DocumentH elper getD ocumentHel per() {
        137           re turn this. getBean("a dapterDocu mentHelper ", Documen tHelper.cl ass);
        138       }
        139  
        140       /**
        141        * Get  the excel  exporter  class from  Spring.
        142        *
        143        * @re turn the e xcel expor ter object
        144        */
        145       public  ExcelExpo rter getEx celExporte r() {
        146           fi nal ExcelE xporter ex celExporte r = this.g etBean("ex celExporte r",
        147                ExcelExp orter.clas s);
        148           re turn excel Exporter;
        149       }
        150  
        151       /**
        152        * Get  the facil ity helper  from Spri ng.
        153        * @re turn Facil ityHelper
        154        */
        155       public  FacilityH elper getF acilityHel per() {
        156           re turn this. getBean("f acilityHel per", Faci lityHelper .class);
        157       }
        158  
        159       public  ReportHel per getRep ortHelper( ) {
        160           fi nal Report Helper rep ortHelper  = this.get Bean("repo rtHelper",
        161                ReportHe lper.class );
        162           re turn repor tHelper;
        163       }
        164  
        165       privat e List<Map <String, O bject>> ge tResults(f inal HttpS ession ses sion)
        166           th rows Servl etExceptio n {
        167           
        168           fi nal String  source =  (String) s ession.get Attribute( "disclosur eSummaryQu erySource" );
        169           fi nal Date s d = (Date)  session.g etAttribut e("disclos ureSummary QueryStart Date");
        170           fi nal Date e d = (Date)  session.g etAttribut e("disclos ureSummary QueryEndDa te");
        171           fi nal String  userId =  (String) s ession.get Attribute( "disclosur eSummaryQu eryUserId" );
        172           fi nal String  patientFa cility = ( String) se ssion.getA ttribute(" disclosure SummaryQue ryFacility ");
        173           fi nal String  externalP artnerOrg  = (String)  session.g etAttribut e("disclos ureSummary QueryOrg") ;
        174           fi nal int pa tientTypes  = (Intege r) session .getAttrib ute("patie ntTypes");
        175           
        176           //  sort
        177           fi nal String  disclosur eSummarySo rtValue =  (String) s ession.get Attribute( "disclosur eSummarySo rtValue");
        178           fi nal String  disclosur eSummarySo rtDirectio n = (Strin g) session .getAttrib ute("discl osureSumma rySortDire ction");
        179           
        180           fi nal GetAud itsSummary  getAudits Summary =  new GetAud itsSummary ();
        181  
        182           //  start tim e
        183           if  (NullChec ker.isNotE mpty(sd))  {
        184                getAudit sSummary.s etFromDate (Gregorian DateUtil
        185                    .get GregorianC alendarByD ate(sd));
        186           }
        187           //  to time
        188           if  (NullChec ker.isNotE mpty(ed))  {
        189                getAudit sSummary.s etToDate(G regorianDa teUtil
        190                    .get GregorianC alendarByD ate(ed));
        191           }
        192           // Set User I D
        193           if  (NullChec ker.isNotE mpty(userI d)) {
        194                final St ringValues Type userI dValue = n ew StringV aluesType( );
        195                userIdVa lue.getVal ue().add(u serId);
        196                userIdVa lue.setNot In(false);
        197                getAudit sSummary.s etUserIds( userIdValu e);
        198           }
        199           ge tAuditsSum mary.setPa tientTypes (patientTy pes);
        200           
        201                    // / / sorting
        202           //  if (NullC hecker.isN otEmpty(di sclosureSu mmarySortV alue)) {
        203           //  SortField Type sortF ield = new  SortField Type();
        204           //  sortField .setField( FieldType. fromValue( disclosure SummarySor tValue));
        205           //  if ("DESC ".equalsIg noreCase(d isclosureS ummarySort Direction) ) {
        206           //  sortField .setDirect ion(SortDi rection.DE SC);
        207           //  } else {
        208           //  sortField .setDirect ion(SortDi rection.AS C);
        209           //  }
        210           //  SortField sType sort FieldsType  = new Sor tFieldsTyp e();
        211           //  sortField sType.getS ortField() .add(sortF ield);
        212           //  getAudits Request.se tSortField s(sortFiel dsType);
        213           //  }
        214           //  action ty pe
        215           fi nal Action ValuesType  actionVal uesType =  new Action ValuesType ();
        216           fi nal List<A ctionType>  actiontyp e = action ValuesType .getValue( );
        217           ac tiontype.a dd(ActionT ype.RETRIE VE_DOCUMEN T);
        218           ac tionValues Type.setNo tIn(false) ;
        219           ge tAuditsSum mary.setAc tions(acti onValuesTy pe);
        220  
        221           //  patient p referred f acility
        222           if  (!NullChe cker.isNul lOrEmpty(p atientFaci lity)) {
        223  
        224                final St ringValues Type patie ntFacilyNu mber = new  StringVal uesType();
        225                patientF acilyNumbe r.setNotIn (false);
        226                final Li st<String>  patientFa cilyNumber List = pat ientFacily Number
        227                    .get Value();
        228                patientF acilyNumbe rList.add( patientFac ility);
        229                getAudit sSummary.s etPatientF acilityNum bers(patie ntFacilyNu mber);
        230           }
        231  
        232           if  (!NullChe cker.isNul lOrEmpty(e xternalPar tnerOrg)
        233                && !exte rnalPartne rOrg.equal s("externa l")) {
        234                final St ringValues Type organ izationIds  = new Str ingValuesT ype();// g etAuditsSu mmary.getR emoteOrgan izationIds ();
        235                organiza tionIds.se tNotIn(fal se);
        236                final Li st<String>  organizat ionIdsList  = organiz ationIds.g etValue();
        237                organiza tionIdsLis t
        238                    .add (externalP artnerOrg. replace("% ", "urn:oi d:"));
        239                getAudit sSummary.s etOrganiza tionIds(or ganization Ids);
        240           }  else {
        241                // input  orgs are  empty - in tent is to  retrieve  all orgs e xcept VA
        242                final St ringValues Type organ izationIds  = new Str ingValuesT ype();
        243                organiza tionIds.se tNotIn(tru e);
        244                organiza tionIds.ge tValue().a dd(
        245                    this .getCmsHel per().getC ompleteHom eCommunity Id());
        246                getAudit sSummary.s etOrganiza tionIds(or ganization Ids);
        247           }
        248  
        249           //  group by
        250           fi nal GroupB yFieldsTyp e groupByF ieldsType  = new Grou pByFieldsT ype();
        251           fi nal List<F ieldType>  fieldTypeL ist = grou pByFieldsT ype
        252                .getGrou pByField() ;
        253           fi eldTypeLis t.add(Fiel dType.ORGA NIZATION_I D);
        254           fi eldTypeLis t.add(Fiel dType.PATI ENT_FACILI TY_NUMBER) ;
        255           fi eldTypeLis t.add(Fiel dType.PATI ENT_FACILI TY_NAME);
        256           fi eldTypeLis t.add(Fiel dType.ORGA NIZATION_N AME);
        257           ge tAuditsSum mary.setGr oupByField s(groupByF ieldsType) ;
        258  
        259           //  Set Page  informatio n
        260           fi nal PageIn foType pag eInfoType  = new Page InfoType() ;
        261           pa geInfoType .setPageSi ze(-1);
        262           ge tAuditsSum mary.setPa geInfo(pag eInfoType) ;
        263  
        264           //  web servi ces respon se
        265           Ge tAuditsSum maryRespon se getAudi tsSummaryR esponse;
        266           tr y {
        267                if (sour ce.equals( "Direct"))  {
        268                    getA uditsSumma ryResponse  = this.di rectAuditM anager.get AuditSumma ry(getAudi tsSummary) ;
        269                } else {
        270                    getA uditsSumma ryResponse  = this.ad apterAudit Manager.ge tAuditSumm ary(getAud itsSummary );
        271                }
        272           }  catch (fin al AuditEx ception e)  {
        273                throw ne w AuditExc eption(e);
        274           }
        275  
        276           fi nal List<M ap<String,  Object>>  results =  new ArrayL ist<Map<St ring, Obje ct>>();
        277           lo ng totalCo unt = 0l;
        278           fi nal AuditS ummariesTy pe auditSu mmariesTyp e = getAud itsSummary Response
        279                .getAudi tSummaries ();
        280           Li st<AuditSu mmaryType>  auditSumm ary = new  ArrayList< AuditSumma ryType>();
        281           if  (auditSum mariesType  != null)  {
        282                auditSum mary = aud itSummarie sType.getA uditSummar y();
        283           }
        284           fo r (final A uditSummar yType audi tSummaryTy pe2 : audi tSummary)  {
        285                final Au ditSummary Type audit SummaryTyp e = auditS ummaryType 2;
        286  
        287                final Ma p<String,  Object> re sultMap =  new HashMa p<String,  Object>();
        288                final lo ng count =  auditSumm aryType.ge tCount();
        289                final Su mmaryField sType summ aryFields  = auditSum maryType
        290                    .get SummaryFie lds();
        291                final Li st<String>  summaryFi eld = summ aryFields. getSummary Field();
        292  
        293                Organiza tionType o rganizatio nType = nu ll;
        294                if (Null Checker.is Empty(summ aryField))  {
        295                    cont inue;
        296                }
        297  
        298                if (sour ce.equals( "Direct"))  {
        299                    if ( summaryFie ld.size()  < 1) {
        300                         continue;
        301                    }
        302                    resu ltMap.put( "partnerOr g", summar yField.get (0));
        303                } else {
        304                    if ( summaryFie ld.size()  < 4) {
        305                         continue;
        306                    }
        307  
        308                    if ( NullChecke r.isNotEmp ty(summary Field.get( 0))) {
        309                         organizati onType = ( this.getCm sHelper()
        310                             .getOr ganization ByHomeComm unityId(su mmaryField .get(0)
        311                                 .r eplace("ur n:oid:", " ")));
        312                         if (!NullC hecker.isN ullOrEmpty (organizat ionType))  {
        313                             result Map.put("o id", Repor tDataProce ssor.nullE mptyReplac eWithUnkno wn(organiz ationType. getOrgOid( )));
        314                         }
        315                         else {
        316                             result Map.put("o id", "Unkn own");
        317                         }
        318                    }
        319  
        320                    if ( organizati onType !=  null) {
        321                         resultMap. put("partn erOrg", Re portDataPr ocessor
        322                             .nullE mptyReplac eWithUnkno wn(organiz ationType
        323                                 .g etOrgName( )));
        324                    } el se {
        325                         resultMap. put("partn erOrg", Re portDataPr ocessor
        326                             .nullE mptyReplac eWithUnkno wn(summary Field.get( 3)));
        327                    }
        328  
        329                    // E xtract val ue
        330                    fina l String a dapterVAFa cility = s ummaryFiel d.get(1);
        331                    Stri ng vaFacil ity;
        332                    if ( ReportData Processor. isValidSta tion(adapt erVAFacili ty)) {
        333                         vaFacility  = this.ge tFacilityH elper()
        334                             .getFa cilityName ByStationI d(adapterV AFacility) ;
        335                         if (NullCh ecker.isEm pty(vaFaci lity)) {
        336                             vaFaci lity = sum maryField. get(2);
        337                         }
        338                    } el se {
        339                         vaFacility  = summary Field.get( 2);
        340                    }
        341  
        342                    resu ltMap.put( "vaFacilit y",
        343                         ReportData Processor. fixStation (vaFacilit y));
        344  
        345                    fina l String a dapterVAFa cilityNumb er = summa ryField.ge t(1);
        346                    if ( !NullCheck er.isNullO rEmpty(ada pterVAFaci lityNumber )) {
        347                         resultMap. put("vaFac ilityNumbe r",
        348                             Report DataProces sor.fixSta tion(summa ryField.ge t(1)));
        349                    } el se {
        350                         resultMap. put("vaFac ilityNumbe r",
        351                             Report DataProces sor.fixSta tion("Unav ailable")) ;
        352                    }
        353                }
        354                resultMa p.put("tot al", count );
        355                results. add(result Map);
        356                totalCou nt += coun t;
        357  
        358           }
        359           se ssion.setA ttribute(" disclosure SummaryTot alCount",  totalCount );
        360           //  sort
        361           bo olean asce nding = tr ue;
        362           if  (!NullChe cker.isNul lOrEmpty(d isclosureS ummarySort Direction)
        363                && !Null Checker.is NullOrEmpt y(disclosu reSummaryS ortValue))  { // firs t
        364                // time
        365                // throu gh,
        366                // no
        367                // sort
        368                // speci fied
        369                if (disc losureSumm arySortDir ection.equ alsIgnoreC ase("DESC" )) {
        370                    asce nding = fa lse;
        371                }
        372                final Bu bbleSortLi stMap bSor ter = new  BubbleSort ListMap();
        373                return b Sorter.sor tByColumn( results, d isclosureS ummarySort Value,
        374                    asce nding);
        375           }
        376           re turn resul ts;
        377       }
        378  
        379       @EJB(b eanInterfa ce = Adapt erAuditMan ager.class , mappedNa me = "Adap terAuditMa nager")
        380       public  void setA dapterAudi tManager(
        381           fi nal Adapte rAuditMana ger adapte rAuditMana ger) {
        382           th is.adapter AuditManag er = adapt erAuditMan ager;
        383       }
        384  
        385       @Overr ide
        386       public  void unsp ecified(fi nal HttpSe rvletReque st request ,
        387           fi nal HttpSe rvletRespo nse respon se) throws  ServletEx ception,
        388           IO Exception  {
        389           
        390           fi nal HttpSe ssion sess ion = requ est.getSes sion(false );
        391           fi nal String  sortValue  = request .getParame ter("discl osureSumma rySortValu e");
        392           fi nal String  sortDirec tion = req uest.getPa rameter("d isclosureS ummarySort Direction" );
        393           
        394           se ssion.setA ttribute(" disclosure SummarySor tValue", s ortValue);
        395           se ssion.setA ttribute(" disclosure SummarySor tDirection ", sortDir ection);
        396           se ssion.setA ttribute(" disclosure SummaryRes ults", thi s.getResul ts(session ));
        397           
        398           th is.forward (request,  response,  "show");
        399       }
        400  
        401       privat e Facility DAO getFac ilityDAO()  {
        402           re turn this. getBean("F acilityDAO ", Facilit yDAO.class );
        403       }
        404       
        405   }