Produced by Araxis Merge on 3/8/2018 10:11:37 AM Eastern Standard 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 | PRE_PPS-N_v3.0.1.zip\PS_PPS_domain\src\main\java\gov\va\med\pharmacy\peps\service\common\update\impl | VADispenseUnitNdfFileSyncProcessor.java | Fri Jan 12 15:42:32 2018 UTC |
2 | PRE_PPS-N_v3.0.1.zip\PS_PPS_domain\src\main\java\gov\va\med\pharmacy\peps\service\common\update\impl | VADispenseUnitNdfFileSyncProcessor.java | Wed Mar 7 01:52:47 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 228 |
Changed | 1 | 2 |
Inserted | 0 | 0 |
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.med.p harmacy.pe ps.service .common.up date.impl; | |
2 | ||
3 | import jav a.util.Arr ays; | |
4 | import jav a.util.Col lection; | |
5 | import jav a.util.Col lections; | |
6 | import jav a.util.Lin kedHashSet ; | |
7 | import jav a.util.Map ; | |
8 | import jav a.util.Set ; | |
9 | ||
10 | import org .apache.co mmons.lang 3.StringUt ils; | |
11 | ||
12 | import gov .va.med.ph armacy.pep s.common.u tility.Mum psConverte r; | |
13 | import gov .va.med.ph armacy.pep s.common.v ista.Vista File; | |
14 | import gov .va.med.ph armacy.pep s.common.v o.Dispense UnitVo; | |
15 | import gov .va.med.ph armacy.pep s.common.v o.FieldKey ; | |
16 | import gov .va.med.ph armacy.pep s.common.v o.ManagedI temVo; | |
17 | import gov .va.med.ph armacy.pep s.common.v o.RequestI temStatus; | |
18 | import gov .va.med.ph armacy.pep s.common.v o.UserVo; | |
19 | import gov .va.med.ph armacy.pep s.common.v o.diff.Dif ference; | |
20 | import gov .va.med.ph armacy.pep s.domain.c ommon.mode l.EplNdfOu tgoingDiff erences; | |
21 | import gov .va.med.ph armacy.pep s.external .common.pr eencapsula tion.utili ty.update. item.VaDis penseUnitC onverter; | |
22 | import gov .va.med.ph armacy.pep s.external .common.vo .outbound. common.Ite mAction; | |
23 | import gov .va.med.ph armacy.pep s.service. common.cap ability.Nd fFileSyncC apability; | |
24 | import gov .va.med.ph armacy.pep s.service. common.upd ate.NdfFil eSyncProce ssor; | |
25 | ||
26 | ||
27 | /** | |
28 | * This cl ass implem ents metho ds which p opulate th e new NDF outgoing d ifference table usin g the exis ting | |
29 | * vaDispe nseUnitSyn cRequest o bject for vista file 50.64 def inition an d KID buil d output f or adds an d modifica tions of | |
30 | * PPS VA dispense u nit data. | |
31 | * | |
32 | * @author DNS | |
33 | * @versio n 1.0 | |
34 | */ | |
35 | public cla ss VADispe nseUnitNdf FileSyncPr ocessor ex tends Abst ractSimple NdfFileSyn cProcessor implement s NdfFileS yncProcess or { | |
36 | ||
37 | /** Fi eldKeys of the field s that, if modified, would be processed by the mod ification logic of t his proces sor. */ | |
38 | public static fi nal Set<Fi eldKey> FI ELDS = Col lections.u nmodifiabl eSet(new L inkedHashS et<FieldKe y>(Arrays | |
39 | .a sList( | |
40 | FieldKey .VALUE, | |
41 | FieldKey .INACTIVAT ION_DATE, | |
42 | FieldKey .ITEM_STAT US))); | |
43 | ||
44 | privat e static f inal Strin g FILE_NUM BER = "50. 64"; | |
45 | privat e static f inal Strin g DISPENSE _UNIT_IEN_ FIELD_NUMB ER = ".01" ; | |
46 | privat e static f inal Strin g INACTIVA TION_DATE_ FIELD_NUMB ER = "1"; | |
47 | privat e static f inal org.a pache.logg ing.log4j. Logger LOG = org.apa che.loggin g.log4j.Lo gManager.g etLogger( | |
48 | VA DispenseUn itNdfFileS yncProcess or.class); | |
49 | ||
50 | /** | |
51 | * Ins tantiates a new VADi spenseUnit NdfFileSyn cProcessor . | |
52 | * | |
53 | * @pa ram pNdfFi leSyncCapa bility the ndf file sync capab ility | |
54 | * @se e Abstract SimpleNdfF ileSyncPro cessor#Abs tractSimpl eNdfFileSy ncProcesso r(Set, Str ing, Strin g) | |
55 | */ | |
56 | public VADispens eUnitNdfFi leSyncProc essor(NdfF ileSyncCap ability pN dfFileSync Capability ) { | |
57 | su per(FIELDS , FILE_NUM BER, DISPE NSE_UNIT_I EN_FIELD_N UMBER, pNd fFileSyncC apability) ; | |
58 | } | |
59 | ||
60 | @Overr ide | |
61 | public void proc essNew(Man agedItemVo managedIt em, UserVo user) { | |
62 | // Inserts n ew record into EplNd fOutgoingD ifferences table. | |
63 | ||
64 | // parse out the data and popula te the Epl NdfOutgoin gDifferenc es obj for persisten ce. | |
65 | ||
66 | Di spenseUnit Vo dispenU nitVo = (D ispenseUni tVo) manag edItem; | |
67 | ||
68 | if ( (String Utils.isNo tEmpty(dis penUnitVo. getValue() )) | |
69 | && (Requ estItemSta tus.APPROV ED.equals( dispenUnit Vo.getRequ estItemSta tus()) )) { | |
70 | ||
71 | EplNdfOu tgoingDiff erences di fferencesO bj = new E plNdfOutgo ingDiffere nces(); | |
72 | ||
73 | differen cesObj.set NewValue(d ispenUnitV o.getValue ()); | |
74 | ||
75 | // need to check w hat might go in the else claus e. | |
76 | if(Strin gUtils.isN otEmpty(di spenUnitVo .getDispen seUnitIen( ))){ | |
77 | diff erencesObj .setVistaI en(dispenU nitVo.getD ispenseUni tIen()); | |
78 | } | |
79 | else{ | |
80 | LOG. error("Dis pense Unit IEN can't be null." ); | |
81 | } | |
82 | differen cesObj.set CreatedBy( user.getUs ername()); | |
83 | processI nsert(diff erencesObj ); | |
84 | } | |
85 | } | |
86 | ||
87 | ||
88 | @Overr ide | |
89 | public void proc essModifie d(ManagedI temVo mana gedItem, U serVo user , Collecti on<Differe nce> diffe rences) { | |
90 | ||
91 | // Inserts e ither new record or updates ol der one in the EplNd fOutgoingD ifferences table. | |
92 | ||
93 | Ma p<FieldKey , Differen ce> setDif ference = Difference .toDiffere nceMap(dif ferences); | |
94 | ||
95 | bo olean hasD ifferences = VaDispe nseUnitCon verter.has NewOrModif iedFields( FIELDS, se tDifferenc e, ItemAct ion.MODIFY ); | |
96 | if (hasDiffe rences) { | |
97 | ||
98 | Dispense UnitVo dis penUnitVo = (Dispens eUnitVo) m anagedItem ; | |
99 | ||
100 | if ((Str ingUtils.i sNotEmpty( dispenUnit Vo.getValu e())) | |
101 | && ( RequestIte mStatus.AP PROVED.equ als(dispen UnitVo.get RequestIte mStatus()) )) { | |
102 | ||
103 | if(V aDispenseU nitConvert er.fieldWa sModified( FieldKey.I TEM_STATUS , differen ces)){ | |
104 | if(dispenU nitVo.getI nactivatio nDate() != null){ | |
105 | insert ModifiedEl ement(disp enUnitVo.g etDispense UnitIen(), MumpsConv erter.conv ertDate( | |
106 | di spenUnitVo .getInacti vationDate ()), user. getUsernam e(), INACT IVATION_DA TE_FIELD_N UMBER, nul l); | |
107 | }else{ | |
108 | insert ModifiedEl ement(disp enUnitVo.g etDispense UnitIen(), VistaFile .BLANK, us er.getUser name(), | |
109 | IN ACTIVATION _DATE_FIEL D_NUMBER, null); | |
110 | } | |
111 | } | |
112 | } | |
113 | } | |
114 | } | |
115 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.