Produced by Araxis Merge on 6/9/2017 3:51:29 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:29 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\user\dashboard | ExpiringConsentsWidget.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 | 143 |
| 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 | /* | |||||
| 2 | * To chan ge this li cense head er, choose License H eaders in Project Pr operties. | |||||
| 3 | * To chan ge this te mplate fil e, choose Tools | Te mplates | |||||
| 4 | * and ope n the temp late in th e editor. | |||||
| 5 | */ | |||||
| 6 | package go v.va.nvap. web.user.d ashboard; | |||||
| 7 | ||||||
| 8 | import gov .va.nvap.s vc.consent mgmt.stub. dao.Patien tConsentDi rDAO; | |||||
| 9 | import gov .va.nvap.w eb.helper. report.Rep ortHelper; | |||||
| 10 | import gov .va.nvap.w eb.patient .PatientSe arch; | |||||
| 11 | import jav a.io.IOExc eption; | |||||
| 12 | import jav a.io.Strin gWriter; | |||||
| 13 | import jav a.text.Dat eFormat; | |||||
| 14 | import jav a.text.Sim pleDateFor mat; | |||||
| 15 | import jav a.util.Cal endar; | |||||
| 16 | import jav a.util.Dat e; | |||||
| 17 | import jav a.util.log ging.Level ; | |||||
| 18 | import jav a.util.log ging.Logge r; | |||||
| 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 .json.JSON Exception; | |||||
| 24 | import org .json.JSON Object; | |||||
| 25 | ||||||
| 26 | ||||||
| 27 | /** | |||||
| 28 | * | |||||
| 29 | * @author Raul Alfa ro | |||||
| 30 | */ | |||||
| 31 | public cla ss Expirin gConsentsW idget exte nds gov.va .nvap.web. app.Respon seDispatch erHttpServ let { | |||||
| 32 | ||||||
| 33 | /** | |||||
| 34 | * Pre pares and returns th e data for the Expir ing Consen ts Widget of the use r dashboar d | |||||
| 35 | * @pa ram reques t | |||||
| 36 | * @pa ram respon se | |||||
| 37 | * @th rows IOExc eption | |||||
| 38 | * @th rows Servl etExceptio n | |||||
| 39 | */ | |||||
| 40 | @Overr ide | |||||
| 41 | pu blic void unspecifie d(final Ht tpServletR equest req uest, | |||||
| 42 | final HttpServle tResponse response) throws Ser vletExcept ion, | |||||
| 43 | IOExce ption { | |||||
| 44 | ||||||
| 45 | fina l HttpSess ion sessio n = reques t.getSessi on(false); | |||||
| 46 | se ssion.setA ttribute(" results", gatherExpi ringConsen tCount(ses sion)); | |||||
| 47 | ||||||
| 48 | th is.forward (request, response, "searchRes ultsJSON") ; | |||||
| 49 | } | |||||
| 50 | ||||||
| 51 | /** | |||||
| 52 | * ret urns the a mount of e xpiring co nsents in the next 3 0 days as a JSON obj ect string , | |||||
| 53 | * two data poin ts first b eing NwHIN Authoriza tion type and second being SSA Authoriza tion type. | |||||
| 54 | * @pa ram sessio n | |||||
| 55 | * @re turn | |||||
| 56 | */ | |||||
| 57 | public String ga therExpiri ngConsentC ount(final HttpSessi on session ){ | |||||
| 58 | St ring jsonS tring = "" ; | |||||
| 59 | ||||||
| 60 | tr y { | |||||
| 61 | StringWr iter json = new Stri ngWriter() ; | |||||
| 62 | JSONObje ct obj = n ew JSONObj ect(); | |||||
| 63 | ||||||
| 64 | obj.put( "expiringN wHINConsen ts", expir ingConsent sNwHIN(ses sion)); | |||||
| 65 | obj.put( "expiringS SAConsents ", expirin gConsentsS SA(session )); | |||||
| 66 | ||||||
| 67 | obj.writ e(json); | |||||
| 68 | ||||||
| 69 | jsonStri ng = json. toString() ; | |||||
| 70 | } catch (JSO NException ex) { | |||||
| 71 | Logger.g etLogger(P atientSear ch.class.g etName()). log(Level. SEVERE, nu ll, ex); | |||||
| 72 | } | |||||
| 73 | ||||||
| 74 | re turn jsonS tring; | |||||
| 75 | } | |||||
| 76 | ||||||
| 77 | /** | |||||
| 78 | * get total num ber of exp iring cons ents with NwHIN Auth orization as the con sent Type | |||||
| 79 | * @pa ram sessio n | |||||
| 80 | * @re turn | |||||
| 81 | */ | |||||
| 82 | privat e long exp iringConse ntsNwHIN(H ttpSession session){ | |||||
| 83 | fi nal Patien tConsentDi rDAO.Searc hRequest s earchReque st = prepa reExpiring ConsentReq uest(sessi on, "NwHIN Authoriza tion"); | |||||
| 84 | Pa tientConse ntDirDAO d ao = this. getPatient ConsentDir DAO(); | |||||
| 85 | Pa tientConse ntDirDAO.S earchRespo nse search Response = dao.findC ount(searc hRequest); | |||||
| 86 | re turn searc hResponse. count; | |||||
| 87 | } | |||||
| 88 | ||||||
| 89 | /** | |||||
| 90 | * get total num ber of exp iring cons ents with SSA Author ization as the conse nt Type | |||||
| 91 | * @pa ram sessio n | |||||
| 92 | * @re turn | |||||
| 93 | */ | |||||
| 94 | privat e long exp iringConse ntsSSA(Htt pSession s ession){ | |||||
| 95 | fi nal Patien tConsentDi rDAO.Searc hRequest s earchReque st = prepa reExpiring ConsentReq uest(sessi on, "SSA A uthorizati on"); | |||||
| 96 | Pa tientConse ntDirDAO d ao = this. getPatient ConsentDir DAO(); | |||||
| 97 | Pa tientConse ntDirDAO.S earchRespo nse search Response = dao.findC ount(searc hRequest); | |||||
| 98 | re turn searc hResponse. count; | |||||
| 99 | } | |||||
| 100 | ||||||
| 101 | /** | |||||
| 102 | * Pre pares the request pa rameters r equired fo r the tota l number o f expiring consents in the nex t 30 days | |||||
| 103 | * If a default facility i snt presen t in the s ession, Al l is used. Default v alues are all patien ts, | |||||
| 104 | * NwH IN Authori zation as consenttyp e, include unknown v isn = true , no useri d | |||||
| 105 | * @pa ram sessio n | |||||
| 106 | * @re turn | |||||
| 107 | */ | |||||
| 108 | privat e PatientC onsentDirD AO.SearchR equest pre pareExpiri ngConsentR equest(Htt pSession s ession, St ring sourc e){ | |||||
| 109 | ||||||
| 110 | fi nal gov.va .nvap.svc. facility.d ata.Facili ty facilit y = | |||||
| 111 | (gov .va.nvap.s vc.facilit y.data.Fac ility) ses sion.getAt tribute("d efaultUser Facility") ; | |||||
| 112 | fi nal Patien tConsentDi rDAO.Searc hRequest s earchReque st = | |||||
| 113 | new PatientCon sentDirDAO ().new Sea rchRequest (); | |||||
| 114 | ||||||
| 115 | Ca lendar cal endar = Ca lendar.get Instance() ; | |||||
| 116 | ca lendar.set (Calendar. HOUR_OF_DA Y, 0); | |||||
| 117 | ca lendar.set (Calendar. MINUTE, 0) ; | |||||
| 118 | ca lendar.set (Calendar. SECOND, 0) ; | |||||
| 119 | ca lendar.set (Calendar. MILLISECON D, 0); | |||||
| 120 | Da te startDa te = calen dar.getTim e(); | |||||
| 121 | ||||||
| 122 | ca lendar.add (Calendar. DATE, 29); | |||||
| 123 | Da te endDate = calenda r.getTime( ); | |||||
| 124 | ||||||
| 125 | se archReques t.startDat e = startD ate; | |||||
| 126 | se archReques t.endDate = endDate; | |||||
| 127 | se archReques t.stationN umbers = ( facility ! = null) ? | |||||
| 128 | faci lity.getFa cilityStat ion() : "A LL"; | |||||
| 129 | se archReques t.includeU nknownVisn = (facili ty == null ); | |||||
| 130 | // Were gonna get both, just one at a time. | |||||
| 131 | se archReques t.consentT ypeName = source; | |||||
| 132 | se archReques t.patientT ypes = 1; | |||||
| 133 | se archReques t.userId = ""; | |||||
| 134 | // the count query does nt use the rest of t he searchR equest par ameters so they can be uninsta ntiated. | |||||
| 135 | ||||||
| 136 | re turn searc hRequest; | |||||
| 137 | } | |||||
| 138 | ||||||
| 139 | privat e PatientC onsentDirD AO getPati entConsent DirDAO() { | |||||
| 140 | re turn this. getBean("P atientCons entDirDAO" , PatientC onsentDirD AO.class); | |||||
| 141 | } | |||||
| 142 | ||||||
| 143 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.