Produced by Araxis Merge on 6/9/2017 3:50:58 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:50:58 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-server\src\main\java\gov\va\nvap\server\service\pdq\filter | MostRecentDateFilter.java | Fri Apr 21 20:03:28 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 1 | 95 |
| 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. server.ser vice.pdq.f ilter; | |||||
| 2 | ||||||
| 3 | import gov .va.nvap.c ommon.date .DateUtil; | |||||
| 4 | import gov .va.nvap.c ommon.filt er.Filter; | |||||
| 5 | import gov .va.nvap.c ommon.filt er.FilterE xception; | |||||
| 6 | import gov .va.nvap.c ommon.vali dation.Nul lChecker; | |||||
| 7 | ||||||
| 8 | import jav a.util.Dat e; | |||||
| 9 | import jav a.util.Map ; | |||||
| 10 | import jav a.util.Set ; | |||||
| 11 | ||||||
| 12 | /** | |||||
| 13 | * Get the response that has t he most re cent date. | |||||
| 14 | * | |||||
| 15 | * @author Asha Amri traj | |||||
| 16 | * | |||||
| 17 | */ | |||||
| 18 | public cla ss MostRec entDateFil ter implem ents | |||||
| 19 | Filt er<Map<Str ing, Map<S tring, Obj ect>>, Str ing> { | |||||
| 20 | ||||||
| 21 | @O verride | |||||
| 22 | pu blic Strin g filter(f inal Map<S tring, Map <String, O bject>> re sponses) | |||||
| 23 | throws FilterExc eption { | |||||
| 24 | // G et respons es | |||||
| 25 | fina l Set<Stri ng> keySet = respons es.keySet( ); | |||||
| 26 | if ( NullChecke r.isEmpty( keySet)) { | |||||
| 27 | return null; | |||||
| 28 | } | |||||
| 29 | // I f only one response, then retu rn the res ponse | |||||
| 30 | if ( keySet.siz e() == 1) { | |||||
| 31 | for (f inal Strin g key : ke ySet) { | |||||
| 32 | final Ma p<String, Object> pr operties = responses .get(key); | |||||
| 33 | if (Null Checker.is Empty(prop erties)) { | |||||
| 34 | return nul l; | |||||
| 35 | } else { | |||||
| 36 | final Obje ct rpcResp onse = pro perties.ge t("rpcResp onse"); | |||||
| 37 | if (String .class.isI nstance(rp cResponse) ) { | |||||
| 38 | re turn (Stri ng) proper ties.get(" rpcRespons e"); | |||||
| 39 | } | |||||
| 40 | return nul l; | |||||
| 41 | } | |||||
| 42 | } | |||||
| 43 | } | |||||
| 44 | // G et the mos t recent d ate | |||||
| 45 | Date mostRecen tDate = nu ll; | |||||
| 46 | Stri ng mostRec entFacilit y = null; | |||||
| 47 | for (final Str ing key : keySet) { | |||||
| 48 | final Map<String , Object> record = r esponses.g et(key); | |||||
| 49 | // Use the corre lation dat e and the date last treated | |||||
| 50 | final Object las tCorrelate dDateObj = record.ge t("correla tionDate") ; | |||||
| 51 | final Object las tTreatedDa teObj = re cord.get(" dateLastTr eated"); | |||||
| 52 | ||||||
| 53 | // JUN 01, 2007@ 10:40:01 | |||||
| 54 | Date l astCorrela tedDate = null; | |||||
| 55 | Date l astTreated Date = nul l; | |||||
| 56 | ||||||
| 57 | if (Da te.class.i sInstance( lastCorrel atedDateOb j)) { | |||||
| 58 | lastCorr elatedDate = (Date) lastCorrel atedDateOb j; | |||||
| 59 | } | |||||
| 60 | if (Da te.class.i sInstance( lastTreate dDateObj)) { | |||||
| 61 | lastTrea tedDate = (Date) las tTreatedDa teObj; | |||||
| 62 | } | |||||
| 63 | // Fin d the rece nt date | |||||
| 64 | Date r ecentDate = null; | |||||
| 65 | if (Nu llChecker. isNotEmpty (lastTreat edDate) | |||||
| 66 | && NullChe cker.isNot Empty(last Correlated Date)) { | |||||
| 67 | recentDa te = DateU til.getRec entDate(la stCorrelat edDate, | |||||
| 68 | la stTreatedD ate); | |||||
| 69 | } else if (NullC hecker.isN otEmpty(la stTreatedD ate)) { | |||||
| 70 | recentDa te = lastT reatedDate ; | |||||
| 71 | } else if (NullC hecker.isN otEmpty(la stCorrelat edDate)) { | |||||
| 72 | recentDa te = lastC orrelatedD ate; | |||||
| 73 | } | |||||
| 74 | // Get the most recently u pdated fac ility | |||||
| 75 | if (Nu llChecker. isEmpty(mo stRecentDa te) | |||||
| 76 | || (recent Date != nu ll && Null Checker.is NotEmpty(r ecentDate) && recent Date.after (mostRecen tDate))) { | |||||
| 77 | mostRece ntDate = r ecentDate; | |||||
| 78 | mostRece ntFacility = key; | |||||
| 79 | } | |||||
| 80 | } | |||||
| 81 | // R eturn the RPC respon se | |||||
| 82 | if ( NullChecke r.isNotEmp ty(mostRec entFacilit y)) { | |||||
| 83 | final Map<String , Object> facilityMa p = respon ses | |||||
| 84 | .get(mostR ecentFacil ity); | |||||
| 85 | if (Nu llChecker. isNotEmpty (facilityM ap)) { | |||||
| 86 | // Get t he respons e | |||||
| 87 | final Ob ject respo nse = faci lityMap.ge t("rpcResp onse"); | |||||
| 88 | if (Stri ng.class.i sInstance( response)) { | |||||
| 89 | return (St ring) faci lityMap.ge t("rpcResp onse"); | |||||
| 90 | } | |||||
| 91 | } | |||||
| 92 | } | |||||
| 93 | retu rn null; | |||||
| 94 | } | |||||
| 95 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.