Produced by Araxis Merge on 4/2/2019 1:06:57 PM Central 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 | C:\AraxisMergeCompare\Pri_un\ARS_Backend\ars_app\src\test\java\gov\va\med\ars\service\impl | RfaiRequestSubmitServiceImplTest.java | Wed Mar 27 19:22:51 2019 UTC |
2 | C:\AraxisMergeCompare\Pri_re\ARS_Backend\ars_app\src\test\java\gov\va\med\ars\service\impl | RfaiRequestSubmitServiceImplTest.java | Fri Mar 29 17:45:37 2019 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 400 |
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.a rs.service .impl; | |
2 | ||
3 | import sta tic org.ju nit.Assert .assertNot Null; | |
4 | import sta tic org.ju nit.Assert .assertTru e; | |
5 | import sta tic org.mo ckito.Matc hers.any; | |
6 | import sta tic org.mo ckito.Mock ito.when; | |
7 | ||
8 | import jav a.math.Big Decimal; | |
9 | import jav a.math.Big Integer; | |
10 | import jav a.nio.char set.Charse t; | |
11 | import jav a.text.Dat eFormat; | |
12 | import jav a.text.Sim pleDateFor mat; | |
13 | import jav a.util.Arr ayList; | |
14 | import jav a.util.Dat e; | |
15 | import jav a.util.Has hSet; | |
16 | import jav a.util.Lis t; | |
17 | import jav a.util.Set ; | |
18 | ||
19 | import org .apache.lo gging.log4 j.LogManag er; | |
20 | import org .apache.lo gging.log4 j.Logger; | |
21 | import org .junit.Tes t; | |
22 | import org .junit.run ner.RunWit h; | |
23 | import org .mockito.I njectMocks ; | |
24 | import org .mockito.M ock; | |
25 | import org .mockito.r unners.Moc kitoJUnitR unner; | |
26 | import org .springfra mework.htt p.MediaTyp e; | |
27 | ||
28 | import gov .va.med.ar s.dao.ars. ClaimConta ctReposito ry; | |
29 | import gov .va.med.ar s.dao.ars. EmailTempl ateReposit ory; | |
30 | import gov .va.med.ar s.dao.ars. IArsUserRe pository; | |
31 | import gov .va.med.ar s.dao.ars. IClaimSubm issionRepo sitory; | |
32 | import gov .va.med.ar s.dao.ars. IPayerInfo Repository ; | |
33 | import gov .va.med.ar s.model.re sponse.Cod eAndLevel; | |
34 | import gov .va.med.ar s.model.re sponse.Rfa iLineItemR esponse; | |
35 | import gov .va.med.ar s.model.re sponse.Rfa iResponse; | |
36 | import gov .va.med.do main.ars.A rsUser; | |
37 | import gov .va.med.do main.ars.C laimCodeBr idge; | |
38 | import gov .va.med.do main.ars.C laimCodeBr idgeId; | |
39 | import gov .va.med.do main.ars.C laimContac t; | |
40 | import gov .va.med.do main.ars.C laimSubmis sion; | |
41 | import gov .va.med.do main.ars.C laimSvcLin es; | |
42 | import gov .va.med.do main.ars.E mailTempla te; | |
43 | import gov .va.med.do main.ars.P ayerConfig ; | |
44 | ||
45 | @RunWith(M ockitoJUni tRunner.cl ass) | |
46 | ||
47 | public cla ss RfaiReq uestSubmit ServiceImp lTest { | |
48 | pr ivate stat ic final L ogger logg er = LogMa nager.getL ogger(Rfai RequestSub mitService ImplTest.c lass); | |
49 | pu blic stati c final Me diaType AP PLICATION_ JSON_UTF8 = new Medi aType(Medi aType.APPL ICATION_JS ON.getType (), | |
50 | MediaT ype.APPLIC ATION_JSON .getSubtyp e(), Chars et.forName ("utf8")); | |
51 | ||
52 | @M ock | |
53 | IA rsUserRepo sitory ars UserRepo; | |
54 | ||
55 | @M ock | |
56 | IP ayerInfoRe pository p ayerInfoRe po; | |
57 | ||
58 | @M ock | |
59 | pr ivate Clai mContactRe pository c laimContac tRepo; | |
60 | ||
61 | @M ock | |
62 | pr ivate ICla imSubmissi onReposito ry claimSu bmissionRe po; | |
63 | ||
64 | @M ock | |
65 | Em ailTemplat eRepositor y emailRep o; | |
66 | ||
67 | @I njectMocks | |
68 | pr ivate Rfai RequestSub mitService Impl rfaiR equestSubm itServiceI mpl; | |
69 | ||
70 | @T est | |
71 | pu blic void testMockIs Working() { | |
72 | asse rtNotNull( "RfaiReque stSubmitSe rviceTest Injection Failed", r faiRequest SubmitServ iceImpl); | |
73 | logg er.info("R faiRequest SubmitServ iceTest" + rfaiReque stSubmitSe rviceImpl) ; | |
74 | } | |
75 | ||
76 | @S uppressWar nings("dep recation") | |
77 | @T est | |
78 | pu blic void submitAddi tionalInfo rfaiRespon se() throw s Exceptio n { | |
79 | logg er.info("t esting"); | |
80 | ||
81 | Date Format dat eFormat = new Simple DateFormat ("ddMMyyyy "); | |
82 | ||
83 | BigD ecimal big Decimal = new BigDec imal(17888 .41); | |
84 | BigD ecimal big DecimalTwo = new Big Decimal(14 829.52); | |
85 | ||
86 | List <RfaiLineI temRespons e> rfaiLin eItemRespo nseList = new ArrayL ist<>(); | |
87 | Rfai LineItemRe sponse rfa iLineItemR esponse = new RfaiLi neItemResp onse(1l, " 09/13/201 7", "09/13 /2017", "0 651", | |
88 | "Q5001", "G4,RT,LT ,P3", bigD ecimal); | |
89 | Rfai LineItemRe sponse rfa iLineItemR esponsesec = new Rfa iLineItemR esponse(2l , " 09/14/ 2017", "09 /14/2017", "0430", | |
90 | "97140", "JA,EE,QS ,SG", bigD ecimalTwo) ; | |
91 | rfai LineItemRe sponseList .add(rfaiL ineItemRes ponse); | |
92 | rfai LineItemRe sponseList .add(rfaiL ineItemRes ponsesec); | |
93 | ||
94 | Set< CodeAndLev el> codeAn dLevelList = new Has hSet<>(); | |
95 | Code AndLevel c odeAndLeve l = new Co deAndLevel (1l, 2l, 3 l, 4l, "0" ); | |
96 | Code AndLevel c odeAndLeve lSec = new CodeAndLe vel(1l, 3l , 4l, 5l, "0"); | |
97 | Code AndLevel c odeAndLeve lThird = n ew CodeAnd Level(1l, 8l, 7l, 4l , "0"); | |
98 | Code AndLevel c odeAndLeve lFour = ne w CodeAndL evel(3l, 1 l, 5l, 0l, "1"); | |
99 | Code AndLevel c odeAndLeve lFive = ne w CodeAndL evel(1l, 6 l, 7l, 0l, "2"); | |
100 | Code AndLevel c odeAndLeve lSix = new CodeAndLe vel(3l, 5l , 0l, 0l, "3"); | |
101 | ||
102 | code AndLevelLi st.add(cod eAndLevel) ; | |
103 | code AndLevelLi st.add(cod eAndLevelS ec); | |
104 | code AndLevelLi st.add(cod eAndLevelT hird); | |
105 | code AndLevelLi st.add(cod eAndLevelF our); | |
106 | code AndLevelLi st.add(cod eAndLevelF ive); | |
107 | code AndLevelLi st.add(cod eAndLevelS ix); | |
108 | ||
109 | Rfai Response r faiRespons e = new Rf aiResponse (); | |
110 | rfai Response.s etClaimId( new BigInt eger("1009 6")); | |
111 | rfai Response.s etPayerNam e("Veteran 's Affairs "); | |
112 | rfai Response.s etPayerId( "12115"); | |
113 | rfai Response.s etPayerInd ex(1l); | |
114 | rfai Response.s etResponse Date("04/0 3/2019"); | |
115 | rfai Response.s etProvider Npi("10000 00004"); | |
116 | rfai Response.s etProvider Tin("11111 1113"); | |
117 | rfai Response.s etPatientL astname("D uncan"); | |
118 | rfai Response.s etPatientF irstName(" Ester"); | |
119 | rfai Response.s etPatientI dentifier( "000100006 "); | |
120 | rfai Response.s etPatientc ontrolNumb er("100000 00"); | |
121 | rfai Response.s etPayerCla imControlN umber("100 00"); | |
122 | rfai Response.s etProvider Informatio n("RIVERSI DEMETHHOS" ); | |
123 | rfai Response.s etClearing HouseId("c learingHou seId"); | |
124 | rfai Response.s etCodeAndL evelList(c odeAndLeve lList); | |
125 | rfai Response.s etContactI nformation ("d@d"); | |
126 | rfai Response.s etServiceF romDate("0 9/10/2017" ); | |
127 | rfai Response.s etServiceT oDate("09/ 16/2017"); | |
128 | rfai Response.s etSubmitte dBy("user" ); | |
129 | rfai Response.s etCodeAndL evelList(c odeAndLeve lList); | |
130 | rfai Response.s etRfaiLine ItemRespon se(rfaiLin eItemRespo nseList); | |
131 | ||
132 | Clai mContact c laimContac t = new Cl aimContact (); | |
133 | clai mContact.s etContactu serid(100l ); | |
134 | claimConta ct.setCont actemail(" PII "); | |
135 | clai mContact.s etDatecrea ted(dateFo rmat.parse ("110118") ); | |
136 | clai mContact.s etDatemodi fied(dateF ormat.pars e("110118" )); | |
137 | ||
138 | Set< ClaimSvcLi nes> claim SvcLinesSe t = new Ha shSet<>(); | |
139 | ||
140 | Clai mSubmissio n claimSub mission = new ClaimS ubmission( ); | |
141 | clai mSubmissio n.setClaim SvcLineses (claimSvcL inesSet); | |
142 | clai mSubmissio n.setTrn02 claimIndex (rfaiRespo nse.getCla imId()); | |
143 | // c laimSubmis sion.setHl 1nm103pyrN m(rfaiResp onse.getPa yerName()) ; | |
144 | // c laimSubmis sion.setHl 1nm109pyrI d(rfaiResp onse.getPa yerId()); | |
145 | clai mSubmissio n.setHl2nm 103infRcvr (rfaiRespo nse.getInf ormationRe ceiver()); | |
146 | Date responseD ate = new Date(rfaiR esponse.ge tResponseD ate()); | |
147 | clai mSubmissio n.setDtp20 3responsed uedate(res ponseDate) ; | |
148 | clai mSubmissio n.setHl3nm 109prvnpi( rfaiRespon se.getProv iderNpi()) ; | |
149 | clai mSubmissio n.setHl2nm 109svcprvt in(rfaiRes ponse.getP roviderTin ()); | |
150 | clai mSubmissio n.setHl4nm 103ptlstnm (rfaiRespo nse.getPat ientLastna me()); | |
151 | clai mSubmissio n.setHl4nm 104ptftnm( rfaiRespon se.getPati entFirstNa me()); | |
152 | clai mSubmissio n.setHl4nm 109ptid(rf aiResponse .getPatien tIdentifie r()); | |
153 | clai mSubmissio n.setRef10 2ptctrlnmb r(rfaiResp onse.getPa tientcontr olNumber() ); | |
154 | clai mSubmissio n.setTrn02 pyrclmctrl nmbr(rfaiR esponse.ge tPayerClai mControlNu mber()); | |
155 | clai mSubmissio n.setRef20 2billtype( rfaiRespon se.getBill Type()); | |
156 | clai mSubmissio n.setRef40 2clrnghsid (rfaiRespo nse.getCle aringHouse Id()); | |
157 | clai mSubmissio n.setRef30 2medrecnmb r(rfaiResp onse.getMe dicalRecor dNumber()) ; | |
158 | clai mSubmissio n.setHl3nm 103svcbill prvnm(rfai Response.g etProvider Informatio n()); | |
159 | clai mSubmissio n.setSubmi ssionStatu s("PENDING "); | |
160 | clai mSubmissio n.setGener ate277Stat us("PENDIN G"); | |
161 | clai mSubmissio n.setDatec reated(new Date()); | |
162 | clai mSubmissio n.setDatem odified(ne w Date()); | |
163 | clai mSubmissio n.setSubmi ssionid(ne w BigInteg er("1")); | |
164 | ||
165 | Clai mCodeBridg eId claimC odeBridgeI d = new Cl aimCodeBri dgeId(new BigInteger ("1623"), 1416, 3, 5 , 0, 0); | |
166 | Set< ClaimCodeB ridge> cla imCodeBrid geSet = ne w HashSet< >(); | |
167 | Clai mCodeBridg e claimCod eBridge = new ClaimC odeBridge( ); | |
168 | clai mCodeBridg e.setId(cl aimCodeBri dgeId); | |
169 | clai mCodeBridg eSet.add(c laimCodeBr idge); | |
170 | ||
171 | clai mSubmissio n.setClaim CodeBridge s(claimCod eBridgeSet ); | |
172 | ||
173 | Clai mContact c laimContac tForSubmis sion = new ClaimCont act(); | |
174 | clai mContactFo rSubmissio n.setConta ctuserid(1 l); | |
175 | ||
176 | List <ClaimCont act> claim ContactLis t = new Ar rayList<>( ); | |
177 | clai mContactLi st.add(cla imContact) ; | |
178 | ||
179 | ArsU ser arsUse r = new Ar sUser(); | |
180 | arsU ser.setArs UserId(2l) ; | |
181 | arsU ser.setEma ilAddress( "email"); | |
182 | ||
183 | Paye rConfig pa yerRecord = new Paye rConfig(); | |
184 | paye rRecord.se tPayerInde x((long) 1 ); | |
185 | ||
186 | Stri ng templat eType = "P ENDING"; | |
187 | Emai lTemplate template = new Email Template() ; | |
188 | temp late.setEm ailTemplat eId(1l); | |
189 | ||
190 | when (payerInfo Repo.findB yPayerInde x(1l)).the nReturn(pa yerRecord) ; | |
191 | when (arsUserRe po.findByU serNameIgn oreCase("u ser")).the nReturn(ar sUser); | |
192 | when (claimCont actRepo.fi ndOneByCon tactemailA ndSubmitte dbyAllIgno reCase(rfa iResponse. getContact Informatio n(), | |
193 | "email") ).thenRetu rn(claimCo ntact); | |
194 | when (claimCont actRepo.sa ve(claimCo ntact)).th enReturn(c laimContac t); | |
195 | when (claimSubm issionRepo .save(any( ClaimSubmi ssion.clas s))).thenR eturn(clai mSubmissio n); | |
196 | when (claimCont actRepo.fi ndAllBycla imSubmissi ons(claimS ubmission) ).thenRetu rn(claimCo ntactList) ; | |
197 | when (emailRepo .getEmailT emplateByT ype(templa teType)).t henReturn( template); | |
198 | bool ean submit Additional InfoReques t = rfaiRe questSubmi tServiceIm pl.submitA dditionalI nfoRequest (rfaiRespo nse); | |
199 | asse rtTrue(sub mitAdditio nalInfoReq uest); | |
200 | } | |
201 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.