4318. EPMO Open Source Coordination Office Redaction File Detail Report

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

4318.1 Files compared

# Location File Last Modified
1 Fri Jun 9 19:51:28 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 OptInOptOutSummaryReportResults.java Fri Apr 21 20:03:30 2017 UTC

4318.2 Comparison summary

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

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

4318.4 Active regular expressions

No regular expressions were active.

4318.5 Comparison detail

        1   package go v.va.nvap. web.report ;
        2  
        3   import gov .va.nvap.c ommon.vali dation.Nul lChecker;
        4   import gov .va.nvap.p rivacy.Con sentType;
        5   import gov .va.nvap.w eb.app.Res ponseDispa tcherHttpS ervlet;
        6   import gov .va.nvap.w eb.consent .audit.Aud itedConsen tSummary;
        7   import gov .va.nvap.w eb.consent .audit.dao .AuditedCo nsentDAO;
        8   import gov .va.nvap.w eb.dao.Fac ilityDAO;
        9   import gov .va.nvap.w eb.helper. report.Rep ortHelper;
        10   import gov .va.nvap.w eb.util.Co nstants;
        11   import gov .va.nvap.w eb.util.xl s.ExcelExp orter;
        12   import jav a.io.IOExc eption;
        13   import jav a.util.Arr ayList;
        14   import jav a.util.Dat e;
        15   import jav a.util.Has hMap;
        16   import jav a.util.Lis t;
        17   import jav a.util.Map ;
        18   import jav a.util.Lin kedHashMap ;
        19   import jav ax.servlet .ServletEx ception;
        20   import jav ax.servlet .http.Http ServletReq uest;
        21   import jav ax.servlet .http.Http ServletRes ponse;
        22   import jav ax.servlet .http.Http Session;
        23   import org .apache.po i.ss.userm odel.Workb ook;
        24  
        25   /**
        26    * Consent  Directive  Summary R eport resu lts servle t
        27    *
        28    * @author  Asha Amri traj edite d by Steph en Miller  edited by  Irakli Kak ushadze
        29    */
        30   public cla ss OptInOp tOutSummar yReportRes ults exten ds Respons eDispatche rHttpServl et {
        31  
        32       /**
        33        * Ser ial UID.
        34        */
        35       privat e static f inal long  serialVers ionUID = - 1131510956 121479062L ;
        36  
        37       /**
        38        * 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
        39        * Res ponseDispa tcherHttpS ervlet to  call this  method bas ed on the  http param eters.
        40        *
        41        * @pa ram reques t HTTP Req uest
        42        * @pa ram respon se HTTP Re sponse
        43        * @th rows Servl etExceptio n
        44        * @th rows IOExc eption
        45        */
        46       public  void expo rtToExcel( final Http ServletReq uest reque st, final  HttpServle tResponse  response)  throws Ser vletExcept ion, IOExc eption {
        47           fi nal HttpSe ssion sess ion = requ est.getSes sion(false );
        48           fi nal List<M ap<String,  Object>>  results =  this.getRe sults(requ est.getSes sion());
        49           fi nal Map<St ring, Stri ng> consen tDirective SummaryMap  = new Lin kedHashMap <String, S tring>();
        50           //  Set the o ptional ro ws
        51           fi nal Object  nwhinAuth orizationT otal = ses sion.getAt tribute("n whinAuthor izationTot al");
        52           fi nal Object  ssaAuthor izationTot al = sessi on.getAttr ibute("ssa Authorizat ionTotal") ;
        53           fi nal Object  nwhinRevo cationTota l = sessio n.getAttri bute("nwhi nRevocatio nTotal");
        54           fi nal Object  ssaRevoca tionTotal  = session. getAttribu te("ssaRev ocationTot al");
        55           fi nal Object  nwhinRest rictionTot al = sessi on.getAttr ibute("nwh inRestrict ionTotal") ;
        56           fi nal Object  nwhinRest rictionRev ocationTot al = sessi on.getAttr ibute("nwh inRestrict ionRevocat ionTotal") ;
        57           fi nal Map<St ring, List <Object>>  optionalRo ws = new L inkedHashM ap<String,  List<Obje ct>>();
        58           fi nal List<O bject> nwh inAuthoriz ationRow =  new Array List<Objec t>();
        59           nw hinAuthori zationRow. add(nwhinA uthorizati onTotal);
        60           fi nal List<O bject> ssa Authorizat ionRow = n ew ArrayLi st<Object> ();
        61           ss aAuthoriza tionRow.ad d(ssaAutho rizationTo tal);
        62           fi nal List<O bject> nwh inRevocati onRow = ne w ArrayLis t<Object>( );
        63           nw hinRevocat ionRow.add (nwhinRevo cationTota l);
        64           fi nal List<O bject> ssa Revocation Row = new  ArrayList< Object>();
        65           ss aRevocatio nRow.add(s saRevocati onTotal);
        66           fi nal List<O bject> nwh inRestrict ionRow = n ew ArrayLi st<Object> ();
        67           nw hinRestric tionRow.ad d(nwhinRes trictionTo tal);
        68           fi nal List<O bject> nwh inRestrict ionRevocat ionRow = n ew ArrayLi st<Object> ();
        69           nw hinRestric tionRevoca tionRow.ad d(nwhinRes trictionRe vocationTo tal);
        70           op tionalRows .put("Gran d Total eH ealth Exch ange Autho rizations" , nwhinAut horization Row);
        71           op tionalRows .put("Gran d Total SS A Authoriz ations", s saAuthoriz ationRow);
        72           op tionalRows .put("Gran d Total eH ealth Exch ange Revoc ations", n whinRevoca tionRow);
        73           op tionalRows .put("Gran d Total SS A Revocati ons", ssaR evocationR ow);
        74           op tionalRows .put("Gran d Total eH ealth Exch ange Restr ictions",  nwhinRestr ictionRow) ;
        75           op tionalRows .put("Gran d Total eH ealth Exch ange Restr iction Rev ocations",  nwhinRest rictionRev ocationRow );
        76  
        77           //  Generate  filters
        78           fi nal Map<St ring, List <Object>>  filterMap  = new Link edHashMap< String, Li st<Object> >();
        79           fi nal Linked HashMap<St ring, Obje ct> filter s = new Li nkedHashMa p<String,  Object>();
        80  
        81           fi lters.put( "Start Dat e", this.g etReportHe lper().get FormattedD ate((Date)  session.g etAttribut e("optInOp tOutSummar yQueryStar tDate")));
        82           fi lters.put( "End Date" , this.get ReportHelp er().getFo rmattedDat e((Date) s ession.get Attribute( "optInOptO utSummaryQ ueryEndDat e")));
        83           fi lters.put( "Authentic ating Faci lity", Exc elExporter .getFacili tiesFilter (getFacili tyDAO(), ( String) se ssion.getA ttribute(" optInOptOu tSummaryQu eryStation Numbers")) );
        84           fi lters.put( "Consent T ype", Exce lExporter. getFilterV alue(sessi on.getAttr ibute("con sentTypeNa me")));
        85           fi lters.put( "Entered B y", sessio n.getAttri bute("ente redBy"));
        86           Ex celExporte r.populate FilterMapF orExport(r equest, fi lters, fil terMap, se ssion.getA ttribute(" patientTyp es").toStr ing());
        87  
        88           if  (NullChec ker.isNull OrEmpty(re sults)) {
        89                consentD irectiveSu mmaryMap.p ut("", "No  records w ere found. ");
        90           }  else {
        91                consentD irectiveSu mmaryMap.p ut("facili tyName", " Authentica ting Facil ity");
        92                consentD irectiveSu mmaryMap.p ut("consen tType", "C onsent Typ e");
        93                consentD irectiveSu mmaryMap.p ut("count" , "Total") ;
        94           }
        95  
        96           //  Create wo rkbook
        97           St ring title  = "Consen t Directiv e Summary  Report";
        98           fi nal Workbo ok wb = th is.getExce lExporter( ).exportTo Excel(titl e, title,  consentDir ectiveSumm aryMap, re sults, fil terMap, op tionalRows );
        99           //  Write Exc el to Stre am
        100  
        101           th is.getExce lExporter( ).writeExc elToStream ("Consent_ Directive_ Summary_Re port", wb,  response) ;
        102       }
        103  
        104       @Overr ide
        105       public  void unsp ecified(fi nal HttpSe rvletReque st request , final Ht tpServletR esponse re sponse) th rows Servl etExceptio n, IOExcep tion {
        106           fi nal HttpSe ssion sess ion = requ est.getSes sion(false );
        107           fi nal String  optInOptO utSummaryR eportSortV alue = req uest.getPa rameter("o ptInOptOut SummaryRep ortSortVal ue");
        108           fi nal String  optInOptO utSummaryR eportSortD irection =  request.g etParamete r("optInOp tOutSummar yReportSor tDirection ");
        109  
        110           se ssion.setA ttribute(" optInOptOu tSummaryRe portSortVa lue", optI nOptOutSum maryReport SortValue) ;
        111           se ssion.setA ttribute(" optInOptOu tSummaryRe portSortDi rection",  optInOptOu tSummaryRe portSortDi rection);
        112           se ssion.setA ttribute(" optInOptOu tSummaryRe sults", th is.getResu lts(sessio n));
        113  
        114           th is.forward (request,  response,  "show");
        115       }
        116  
        117       privat e List<Map <String, O bject>> ge tResults(f inal HttpS ession ses sion) thro ws Servlet Exception  {
        118           fi nal Audite dConsentDA O auditedC onsentDAO  = this.get Bean("audi tedConsent DAO", Audi tedConsent DAO.class) ;
        119           fi nal Audite dConsentDA O.SummaryR equest req  = audited ConsentDAO .new Summa ryRequest( );
        120           Lo ng nwhinAu thorizatio nTotal = 0 L;
        121           Lo ng ssaAuth orizationT otal = 0L;
        122           Lo ng nwhinRe vocationTo tal = 0L;
        123           Lo ng ssaRevo cationTota l = 0L;
        124           Lo ng nwhinRe strictionT otal = 0L;
        125           Lo ng nwhinRe strictionR evocationT otal = 0L;
        126  
        127           re q.aggregat eAtFacilit yLevel = B oolean.TRU E.equals(s ession.get Attribute( "aggregate AtFacility Level"));
        128           re q.consentT ype = (Str ing) sessi on.getAttr ibute("con sentType") ;
        129           re q.endDate  = (Date) s ession.get Attribute( "optInOptO utSummaryQ ueryEndDat e");
        130           re q.includeU nknownVisn  = Boolean .TRUE.equa ls(session .getAttrib ute("inclu deUnknownV isn"));
        131           re q.patientT ypes = (In teger) ses sion.getAt tribute("p atientType s");
        132           re q.sortDire ction = (S tring) ses sion.getAt tribute("o ptInOptOut SummaryRep ortSortDir ection");
        133           re q.sortFiel d = (Strin g) session .getAttrib ute("optIn OptOutSumm aryReportS ortValue") ;
        134           re q.startDat e = (Date)  session.g etAttribut e("optInOp tOutSummar yQueryStar tDate");
        135           re q.stationN umbers = ( String) se ssion.getA ttribute(" optInOptOu tSummaryQu eryStation Numbers");
        136           re q.userId =  (String)  session.ge tAttribute ("enteredB y");
        137  
        138           fi nal List<A uditedCons entSummary > auditedC onsentSumm aryList =  auditedCon sentDAO.ge tEventsSum mary(req);
        139           fi nal List<M ap<String,  Object>>  results =  new ArrayL ist<Map<St ring, Obje ct>>();
        140  
        141           fo r (final A uditedCons entSummary  auditSumm ary : audi tedConsent SummaryLis t) {
        142  
        143                final Ma p<String,  Object> re sultMap =  new HashMa p<String,  Object>();
        144  
        145                String d isplayCons entType =  auditSumma ry.getCons entType();
        146                if (disp layConsent Type.conta ins("NwHIN ")) {
        147                    disp layConsent Type = dis playConsen tType.repl ace("NwHIN ", Constan ts.getOrga nizationNa me());
        148                }
        149                resultMa p.put("con sentType",  displayCo nsentType) ;
        150                resultMa p.put("fac ilityName" , ReportDa taProcesso r.fixStati on(auditSu mmary.getF acility()) );
        151                resultMa p.put("cou nt", audit Summary.ge tCount());
        152  
        153                //TODO u se consent Type.java
        154                final St ring conse ntType = a uditSummar y.getConse ntType();
        155                final Co nsentType  ct = Conse ntType.fro mValue(con sentType);
        156                switch ( ct) {
        157                    case  NW_HIN_AU THORIZATIO N:
        158                         nwhinAutho rizationTo tal += aud itSummary. getCount() ;
        159                         break;
        160                    case  NW_HIN_RE VOCATION:
        161                         nwhinRevoc ationTotal  += auditS ummary.get Count();
        162                         break;
        163                    case  SSA_AUTHO RIZATION:
        164                         ssaAuthori zationTota l += audit Summary.ge tCount();
        165                         break;
        166                    case  SSA_REVOC ATION:
        167                         ssaRevocat ionTotal + = auditSum mary.getCo unt();
        168                         break;
        169                    case  NW_HIN_OR GANIZATION _RESTRICTI ON_AUTHORI ZATION:
        170                         nwhinRestr ictionTota l += audit Summary.ge tCount();
        171                         break;
        172                    case  NW_HIN_OR GANIZATION _RESTRICTI ON_REVOCAT ION:
        173                         nwhinRestr ictionRevo cationTota l += audit Summary.ge tCount();
        174                         break;
        175                    defa ult:
        176                         try {
        177                             throw  new Except ion("unrec ognized co nsent type : " + cons entType);
        178                         } catch (E xception e ) {
        179                             e.prin tStackTrac e();
        180                         }
        181                         break;
        182                }
        183                results. add(result Map);
        184           }
        185  
        186           se ssion.setA ttribute(" nwhinAutho rizationTo tal", nwhi nAuthoriza tionTotal) ;
        187           se ssion.setA ttribute(" ssaAuthori zationTota l", ssaAut horization Total);
        188           se ssion.setA ttribute(" nwhinRevoc ationTotal ", nwhinRe vocationTo tal);
        189           se ssion.setA ttribute(" ssaRevocat ionTotal",  ssaRevoca tionTotal) ;
        190           se ssion.setA ttribute(" nwhinRestr ictionTota l", nwhinR estriction Total);
        191           se ssion.setA ttribute(" nwhinRestr ictionRevo cationTota l", nwhinR estriction Revocation Total);
        192  
        193           if  (NullChec ker.isEmpt y(auditedC onsentSumm aryList))  {
        194                return r esults;
        195           }
        196  
        197           se ssion.setA ttribute(" optInOptOu tSummaryRe portSortVa lue", req. sortField) ;
        198           se ssion.setA ttribute(" optInOptOu tSummaryRe portSortDi rection",  req.sortDi rection);
        199  
        200           re turn resul ts;
        201       }
        202  
        203       privat e ExcelExp orter getE xcelExport er() {
        204           re turn this. getBean("e xcelExport er", Excel Exporter.c lass);
        205       }
        206  
        207       privat e Facility DAO getFac ilityDAO()  {
        208           re turn this. getBean("F acilityDAO ", Facilit yDAO.class );
        209       }
        210  
        211       privat e ReportHe lper getRe portHelper () {
        212           re turn this. getBean("r eportHelpe r", Report Helper.cla ss);
        213       }
        214  
        215   }