Produced by Araxis Merge on 3/8/2018 10:11:36 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\domain\common\capability\impl | DrugSeverityDomainCapabilityImpl.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\domain\common\capability\impl | DrugSeverityDomainCapabilityImpl.java | Tue Mar 6 23:48:30 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 224 |
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.domain. common.cap ability.im pl; | |
2 | ||
3 | ||
4 | import gov .va.med.ph armacy.pep s.common.v o.DrugSeve rityVo; | |
5 | import gov .va.med.ph armacy.pep s.common.v o.FieldKey ; | |
6 | import gov .va.med.ph armacy.pep s.domain.c ommon.capa bility.Dru gSeverityD omainCapab ility; | |
7 | import gov .va.med.ph armacy.pep s.domain.c ommon.dao. DataAccess Object; | |
8 | import gov .va.med.ph armacy.pep s.domain.c ommon.dao. EplDdiSeve rityDao; | |
9 | import gov .va.med.ph armacy.pep s.domain.c ommon.mode l.EplDdiSe verityDo; | |
10 | import gov .va.med.ph armacy.pep s.domain.c ommon.util ity.Schema Utility; | |
11 | import gov .va.med.ph armacy.pep s.domain.c ommon.util ity.conver ter.Conver ter; | |
12 | import gov .va.med.ph armacy.pep s.domain.c ommon.util ity.conver ter.DrugSe verityConv erter; | |
13 | ||
14 | import jav a.util.Lin kedHashMap ; | |
15 | import jav a.util.Lis t; | |
16 | ||
17 | import org .hibernate .Criteria; | |
18 | import org .hibernate .criterion .Order; | |
19 | import org .hibernate .criterion .Restricti ons; | |
20 | import org .springfra mework.bea ns.factory .annotatio n.Autowire d; | |
21 | ||
22 | ||
23 | ||
24 | /** | |
25 | * @author dn s | |
26 | * Perform retrieve operations on drug s everity | |
27 | */ | |
28 | public cla ss DrugSev erityDomai nCapabilit yImpl exte nds Manage dDataDomai nCapabilit yImpl<Drug SeverityVo , EplDdiSe verityDo> | |
29 | implements DrugSever ityDomainC apability { | |
30 | ||
31 | ||
32 | @Autow ired | |
33 | privat e EplDdiSe verityDao eplDdiSeve rityDao; | |
34 | ||
35 | privat e DrugSeve rityConver ter drugSe verityConv erter; | |
36 | ||
37 | ||
38 | ||
39 | public void setE plDdiSever ityDao(Epl DdiSeverit yDao eplDd iSeverityD ao) { | |
40 | th is.eplDdiS everityDao = eplDdiS everityDao ; | |
41 | } | |
42 | ||
43 | ||
44 | public void setD rugSeverit yConverter (DrugSever ityConvert er drugSev erityConve rter) { | |
45 | th is.drugSev erityConve rter = dru gSeverityC onverter; | |
46 | } | |
47 | ||
48 | @Overr ide | |
49 | public Converter <DrugSever ityVo, Epl DdiSeverit yDo> getCo nverter() { | |
50 | re turn drugS everityCon verter; | |
51 | } | |
52 | ||
53 | @Overr ide | |
54 | public DataAcces sObject ge tDataAcces sObject() { | |
55 | re turn eplDd iSeverityD ao; | |
56 | } | |
57 | ||
58 | @Overr ide | |
59 | protec ted Criter ia createU niquenessC riteria(Dr ugSeverity Vo item) { | |
60 | ||
61 | Cr iteria cri teria = ge tDataAcces sObject(). getCriteri a(); | |
62 | ||
63 | cr iteria.add (Restricti ons.ilike( EplDdiSeve rityDo.SEV ERITY_NAME , item.get Value())); | |
64 | ||
65 | re turn crite ria; | |
66 | } | |
67 | ||
68 | // Ove rride the parent imp lementatio n because EplDdiSeve rityDo doe sn't have the itemSt atus prope rty. | |
69 | @Overr ide | |
70 | public List<Drug SeverityVo > retrieve () { | |
71 | ||
72 | Cr iteria cri teria = ge tDataAcces sObject(). getCriteri a(); | |
73 | ||
74 | St ring sortP ropertyNam e = Schema Utility.ge tPropertyN ame(getDat aObjectCla ss(), Fiel dKey.VALUE ); | |
75 | ||
76 | if (sortProp ertyName ! = null && sortProper tyName.tri m().length () > 0) { | |
77 | Order or der = Orde r.asc(sort PropertyNa me); | |
78 | order.ig noreCase() ; | |
79 | criteria .addOrder( order); | |
80 | } | |
81 | ||
82 | Li st<EplDdiS everityDo> results = criteria. list(); | |
83 | ||
84 | re turn getCo nverter(). convertMin imal(resul ts); | |
85 | } | |
86 | ||
87 | ||
88 | @Overr ide | |
89 | public DrugSever ityVo retr ieveMinima l(String i d) { | |
90 | ||
91 | Ep lDdiSeveri tyDo drug SeverityDo = eplDdiS everityDao .retrieve( Integer.va lueOf(id)) ; | |
92 | ||
93 | re turn drugS everityCon verter.con vertMinima l(drugSeve rityDo); | |
94 | } | |
95 | ||
96 | @Overr ide | |
97 | public LinkedHas hMap<Strin g, String> getSeveri tyMap() { | |
98 | ||
99 | Li st<EplDdiS everityDo> severityL ist = eplD diSeverity Dao.retrie veAll(); | |
100 | ||
101 | Li nkedHashMa p<String, String> se verityMap = new Link edHashMap< String, St ring>(); | |
102 | ||
103 | fo r (EplDdiS everityDo severity: severityLi st){ | |
104 | ||
105 | severity Map.put(se verity.get Name(), St ring.value Of((severi ty.getSeve rityId())) ); | |
106 | ||
107 | } | |
108 | ||
109 | re turn sever ityMap; | |
110 | ||
111 | } | |
112 | ||
113 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.