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 | PackageSizeNdfFileSyncProcessor.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 | PackageSizeNdfFileSyncProcessor.java | Wed Mar 7 01:52:26 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 220 |
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 .springfra mework.ste reotype.Se rvice; | |
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.FieldKey ; | |
15 | import gov .va.med.ph armacy.pep s.common.v o.ManagedI temVo; | |
16 | import gov .va.med.ph armacy.pep s.common.v o.PackageS izeVo; | |
17 | import gov .va.med.ph armacy.pep s.common.v o.UserVo; | |
18 | import gov .va.med.ph armacy.pep s.common.v o.diff.Dif ference; | |
19 | import gov .va.med.ph armacy.pep s.domain.c ommon.mode l.EplNdfOu tgoingDiff erences; | |
20 | import gov .va.med.ph armacy.pep s.external .common.pr eencapsula tion.utili ty.update. item.Packa geSizeConv erter; | |
21 | import gov .va.med.ph armacy.pep s.external .common.vo .outbound. common.Ite mAction; | |
22 | import gov .va.med.ph armacy.pep s.service. common.cap ability.Nd fFileSyncC apability; | |
23 | import gov .va.med.ph armacy.pep s.service. common.upd ate.NdfFil eSyncProce ssor; | |
24 | ||
25 | /** | |
26 | * Used to save addi tions/modi fications to Package Size obje cts so tha t the info rmation wi ll be sent out | |
27 | * in the NDF Update File. | |
28 | * | |
29 | * @author DNS DNS | |
30 | * | |
31 | */ | |
32 | @Service | |
33 | public cla ss Package SizeNdfFil eSyncProce ssor exten ds Abstrac tSimpleNdf FileSyncPr ocessor im plements N dfFileSync Processor { | |
34 | ||
35 | /** Fi eldKeys of the field s that, if modified, would be processed by the mod ification logic of t his proces sor. */ | |
36 | public static fi nal Set<Fi eldKey> FI ELDS = Col lections.u nmodifiabl eSet(new L inkedHashS et<FieldKe y>(Arrays | |
37 | .a sList( | |
38 | FieldKey .VALUE, | |
39 | FieldKey .INACTIVAT ION_DATE | |
40 | ))); | |
41 | ||
42 | privat e static f inal Strin g PACKAGE_ SIZE_IEN_F IELD_NUMBE R = ".01"; | |
43 | privat e static f inal Strin g FILE_NUM BER = "50. 609"; | |
44 | ||
45 | /** | |
46 | * Th e Inactiva tion Date Field Numb er | |
47 | */ | |
48 | privat e static f inal Strin g INACTIVA TION_DATE_ FIELD_NUMB ER = "1"; | |
49 | ||
50 | /** | |
51 | * Con structor f or creatin g a new cl ass. | |
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 PackageSi zeNdfFileS yncProcess or(NdfFile SyncCapabi lity pNdfF ileSyncCap ability) { | |
57 | su per(FIELDS , FILE_NUM BER, PACKA GE_SIZE_IE N_FIELD_NU MBER, pNdf FileSyncCa pability); | |
58 | } | |
59 | ||
60 | /** | |
61 | * Sav es a new P ackage Siz e object's informati on for inc lusion in the next N DF Update File. | |
62 | * | |
63 | * @pa ram manage dItem the Package Si ze informa tion | |
64 | * @pa ram user t he user wh o inserted the Packa ge Size in formation | |
65 | */ | |
66 | @Overr ide | |
67 | public final voi d processN ew(Managed ItemVo man agedItem, UserVo use r) { | |
68 | Pa ckageSizeV o packageS izeVo = (P ackageSize Vo) manage dItem; | |
69 | ||
70 | // There is currently no way to "Approve" a new Pack age Size. So do not even chec k for Appr oval. | |
71 | Ep lNdfOutgoi ngDifferen ces diffOb j = new Ep lNdfOutgoi ngDifferen ces(); | |
72 | ||
73 | // IEN | |
74 | di ffObj.setV istaIen(pa ckageSizeV o.getNdfPa ckageSizeI en()); | |
75 | di ffObj.setN ewValue(pa ckageSizeV o.getPacka geSize().t oString()) ; | |
76 | di ffObj.setC reatedBy(u ser.getUse rname()); | |
77 | pr ocessInser t(diffObj) ; | |
78 | } | |
79 | ||
80 | /** | |
81 | * Thi s method w ould be us ed to upda te a Packa ge Size. But since PPS-N curr ently does not have a way | |
82 | * to update a P ackage Siz e, this me thod will never be c alled. | |
83 | * | |
84 | * @pa ram manage dItem the modified P ackage Siz e data | |
85 | * @pa ram user t he user up dating the informati on | |
86 | * @pa ram differ ences the difference s between the old a new Packag e Size inf ormation | |
87 | */ | |
88 | @Overr ide | |
89 | public final voi d processM odified(Ma nagedItemV o managedI tem, UserV o user, Co llection<D ifference> differenc es) { | |
90 | @S uppressWar nings("raw types") Ma p<FieldKey , Differen ce> setDif ference = Differenc e.toDiffer enceMap(di fferences) ; | |
91 | bo olean hasD ifference = PackageS izeConvert er.hasNewO rModifiedF ields(getF ields(), s etDifferen ce, ItemAc tion.MODIF Y); | |
92 | ||
93 | Pa ckageSizeV o packageS izeVo = (P ackageSize Vo) manage dItem; | |
94 | ||
95 | if (hasDiffe rence) { | |
96 | EplNdfOu tgoingDiff erences di ffObj = ne w EplNdfOu tgoingDiff erences(); | |
97 | ||
98 | diffObj. setVistaIe n(packageS izeVo.getN dfPackageS izeIen()); | |
99 | diffObj. setVistaFi eldNumber( INACTIVATI ON_DATE_FI ELD_NUMBER ); | |
100 | if(packa geSizeVo.g etInactiva tionDate() != null){ | |
101 | diff Obj.setNew Value(Mump sConverter .convertDa te(package SizeVo.get Inactivati onDate())) ; | |
102 | } | |
103 | else{ | |
104 | //pa ssing an e mpty strin g because this is a non null f ield | |
105 | diff Obj.setNew Value(Vist aFile.BLAN K); | |
106 | } | |
107 | diffObj. setCreated By(user.ge tUsername( )); | |
108 | processU pdate(diff Obj); | |
109 | } | |
110 | } | |
111 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.