Produced by Araxis Merge on 6/9/2017 3:51:25 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.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | Fri Jun 9 19:51:25 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\dao | ActiveConsentSummaryDAO.java | Fri Apr 21 20:03:30 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 1 | 92 |
| Removed | 0 | 0 |
| 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 |
No regular expressions were active.
| 1 | package go v.va.nvap. web.dao; | |||||
| 2 | ||||||
| 3 | import gov .va.nvap.c ommon.vali dation.Nul lChecker; | |||||
| 4 | import gov .va.nvap.w eb.consent .audit.Act iveConsent Summary; | |||||
| 5 | import jav a.util.Arr ays; | |||||
| 6 | import jav a.util.Has hMap; | |||||
| 7 | import jav a.util.Lis t; | |||||
| 8 | import jav a.util.Map ; | |||||
| 9 | import jav ax.persist ence.Entit yManager; | |||||
| 10 | import jav ax.persist ence.Persi stenceCont ext; | |||||
| 11 | import jav ax.persist ence.Query ; | |||||
| 12 | ||||||
| 13 | /** | |||||
| 14 | * This DA O handles summary Op t-In Patie nts report requests. | |||||
| 15 | * | |||||
| 16 | * @author Irakli Ka kushadze | |||||
| 17 | * @since 07/16/2016 | |||||
| 18 | */ | |||||
| 19 | public cla ss ActiveC onsentSumm aryDAO { | |||||
| 20 | ||||||
| 21 | @Persi stenceCont ext | |||||
| 22 | privat e EntityMa nager em; | |||||
| 23 | ||||||
| 24 | // Pub lic method s | |||||
| 25 | ||||||
| 26 | public List<Acti veConsentS ummary> fi nd(final S ummaryRequ est req) { | |||||
| 27 | fi nal HashMa p<String, Object> qu eryParams = new Hash Map<String , Object>( ); | |||||
| 28 | fi nal String stationNu mberColumn = req.agg regateAtFa cilityLeve l ? "PAREN T_STATION_ NUMBER" : "FACILITY" ; | |||||
| 29 | St ring query String = A ctiveConse ntSummary. activeCons entSummary NativeSQL; | |||||
| 30 | St ring facil ityFilter = ""; | |||||
| 31 | ||||||
| 32 | if ( req.statio nNumbers = = null || "ALL".equa ls(req.sta tionNumber s)) { | |||||
| 33 | if (req. includeUnk nownVisn) { | |||||
| 34 | // U ser chose to include everythin g, so ther e's no nee d for the WHERE clau se | |||||
| 35 | } else { | |||||
| 36 | // U ser chose to see eve rything BU T unknown VISN | |||||
| 37 | faci lityFilter = "and ca .VISN_NUMB ER is not null"; | |||||
| 38 | } | |||||
| 39 | } else if (r eq.station Numbers.le ngth() == 0) { | |||||
| 40 | if (req. includeUnk nownVisn) { | |||||
| 41 | // U ser chose to see unk nown VISN only | |||||
| 42 | faci lityFilter = "and ca .VISN_NUMB ER is null "; | |||||
| 43 | } else { | |||||
| 44 | // T his should never be the case | |||||
| 45 | } | |||||
| 46 | } else { | |||||
| 47 | if (re q.includeU nknownVisn ) { | |||||
| 48 | // U ser chose to see sel ected stat ion number s AND unkn own VISNs | |||||
| 49 | facility Filter = " and (ca." + stationN umberColum n + " in ( :stationNu mbers) or ca.VISN_NU MBER is nu ll)"; | |||||
| 50 | } else { | |||||
| 51 | // U ser chose to see sel ected stat ions only | |||||
| 52 | facility Filter = " and ca." + stationNu mberColumn + " in (: stationNum bers)"; | |||||
| 53 | } | |||||
| 54 | List<Str ing> items = Arrays. asList(req .stationNu mbers.spli t(",")); | |||||
| 55 | queryPar ams.put("s tationNumb ers", item s); | |||||
| 56 | } | |||||
| 57 | ||||||
| 58 | qu eryString = queryStr ing.replac e("/*facil ity_filter */", facil ityFilter) ; | |||||
| 59 | ||||||
| 60 | if (req.aggr egateAtFac ilityLevel ) { | |||||
| 61 | queryStr ing = quer yString.re place("ca. FACILITY_N AME", "ca. PARENT_FAC ILITY_NAME "); | |||||
| 62 | } | |||||
| 63 | ||||||
| 64 | // Create qu ery object | |||||
| 65 | Qu ery query = this.em. createNati veQuery(qu eryString, ActiveCon sentSummar y.class); | |||||
| 66 | ||||||
| 67 | // Set query parameter s, if any | |||||
| 68 | fo r (final M ap.Entry<S tring, Obj ect> entry : queryPa rams.entry Set()) { | |||||
| 69 | query.se tParameter (entry.get Key(), ent ry.getValu e()); | |||||
| 70 | } | |||||
| 71 | ||||||
| 72 | // Execute t he query | |||||
| 73 | Li st<ActiveC onsentSumm ary> resul t = query. getResultL ist(); | |||||
| 74 | ||||||
| 75 | re turn resul t; | |||||
| 76 | } | |||||
| 77 | ||||||
| 78 | public void setE ntityManag er(final E ntityManag er entityM anager) { | |||||
| 79 | th is.em = en tityManage r; | |||||
| 80 | } | |||||
| 81 | ||||||
| 82 | // Inn er classes | |||||
| 83 | ||||||
| 84 | public class Sum maryReques t { | |||||
| 85 | ||||||
| 86 | pu blic boole an aggrega teAtFacili tyLevel; | |||||
| 87 | pu blic boole an include UnknownVis n; | |||||
| 88 | pu blic Strin g stationN umbers; | |||||
| 89 | ||||||
| 90 | } | |||||
| 91 | ||||||
| 92 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.