Produced by Araxis Merge on 4/27/2018 2:59:10 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 | v2.0_Sprint_15_Build_5.zip\v2.0_Sprint_15_Build_5\Unredacted\ARS_Backend\ars_app\src\main\java\gov\va\med\ars\service\impl | RfaiServiceImpl.java | Tue Apr 24 14:50:45 2018 UTC |
| 2 | v2.0_Sprint_15_Build_5..zip\v2.0_Sprint_15_Build_5\Unredacted\ARS_Backend\ars_app\src\main\java\gov\va\med\ars\service\impl | RfaiServiceImpl.java | Thu Apr 26 16:09:33 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 832 |
| 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 | /** | |
| 2 | * | |
| 3 | */ | |
| 4 | package go v.va.med.a rs.service .impl; | |
| 5 | ||
| 6 | import jav a.math.Big Decimal; | |
| 7 | import jav a.text.Dat eFormat; | |
| 8 | import jav a.text.Sim pleDateFor mat; | |
| 9 | import jav a.time.Loc alDateTime ; | |
| 10 | import jav a.time.Zon eId; | |
| 11 | import jav a.util.Arr ayList; | |
| 12 | import jav a.util.Arr ays; | |
| 13 | import jav a.util.Col lections; | |
| 14 | import jav a.util.Com parator; | |
| 15 | import jav a.util.Dat e; | |
| 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 .springfra mework.bea ns.factory .annotatio n.Autowire d; | |
| 22 | import org .springfra mework.dao .DataAcces sException ; | |
| 23 | import org .springfra mework.dao .DataAcces sResourceF ailureExce ption; | |
| 24 | import org .springfra mework.htt p.HttpStat us; | |
| 25 | import org .springfra mework.ste reotype.Se rvice; | |
| 26 | import org .springfra mework.uti l.StringUt ils; | |
| 27 | ||
| 28 | import gov .va.med.ar s.constant s.ErrorMes sages; | |
| 29 | import gov .va.med.ar s.dao.erep os.IRfaiEr eposReposi tory; | |
| 30 | import gov .va.med.ar s.dao.ewv. IRfaiEwvRe pository; | |
| 31 | import gov .va.med.ar s.dao.fpps .IRfaiFpps ClaimRepos itory; | |
| 32 | import gov .va.med.ar s.errorhan dling.Vali dationMess age; | |
| 33 | import gov .va.med.ar s.exceptio ns.EntityN otFoundExc eption; | |
| 34 | import gov .va.med.ar s.exceptio ns.Generic Exception; | |
| 35 | import gov .va.med.ar s.exceptio ns.Validat ionExcepti on; | |
| 36 | import gov .va.med.ar s.model.re sponse.Rfa iLineItemR esponse; | |
| 37 | import gov .va.med.ar s.model.re sponse.Rfa iResponse; | |
| 38 | import gov .va.med.ar s.service. IRfaiServi ce; | |
| 39 | import gov .va.med.do main.erepo sModel.Ent ityAdtlId; | |
| 40 | import gov .va.med.do main.erepo sModel.Ent ityName; | |
| 41 | import gov .va.med.do main.ewv.E wvClaims; | |
| 42 | import gov .va.med.do main.ewv.E wvServiceL ines; | |
| 43 | import gov .va.med.do main.fee.C laim; | |
| 44 | import gov .va.med.do main.fee.C laimProced ure; | |
| 45 | import gov .va.med.do main.fee.P ersonInfo; | |
| 46 | import gov .va.med.do main.fee.P roviderInf o; | |
| 47 | ||
| 48 | /** | |
| 49 | * @author PI I
|
|
| 50 | * | |
| 51 | */ | |
| 52 | @Service | |
| 53 | public cla ss RfaiSer viceImpl i mplements IRfaiServi ce { | |
| 54 | ||
| 55 | pr ivate stat ic final L ogger logg er = LogMa nager.getL ogger(Rfai ServiceImp l.class); | |
| 56 | ||
| 57 | @A utowired | |
| 58 | IR faiFppsCla imReposito ry rfaiFpp sRepositor y; | |
| 59 | ||
| 60 | @A utowired | |
| 61 | IR faiEreposR epository rfaiErepos Repository ; | |
| 62 | ||
| 63 | @A utowired | |
| 64 | IR faiEwvRepo sitory rfa iEwvReposi tory; | |
| 65 | ||
| 66 | Da teFormat d ateFormat = new Simp leDateForm at("MM/dd/ yyyy"); | |
| 67 | ||
| 68 | pu blic final String ew vPayerId = "84146"; | |
| 69 | pu blic final String fp psPayerId = "12115"; | |
| 70 | pu blic final String pa yerName = "Veteran's Affairs"; | |
| 71 | ||
| 72 | /* | |
| 73 | * (non-Java doc) | |
| 74 | * | |
| 75 | * @see gov. va.med.ars .service.I RfaiServic e#populate RfaiInfo(j ava.lang.L ong, | |
| 76 | * java.lang .String) | |
| 77 | * / | |
| 78 | @O verride | |
| 79 | pu blic RfaiR esponse po pulateRfai Info(Long id) | |
| 80 | throws Validatio nException , GenericE xception, EntityNotF oundExcept ion { | |
| 81 | logg er.info("I n RfaiServ iceImpl"); | |
| 82 | Rfai Response r faiRespons eResult = null; | |
| 83 | // R faiRespons e rfaiResp onseResult = null; | |
| 84 | List <Validatio nMessage> validation Messages = new Array List<>(); | |
| 85 | List <gov.va.me d.domain.e reposModel .Claim> eR eposClaimI nfo = null ; | |
| 86 | bool ean status = true; | |
| 87 | Stri ng idNumbe r = String .valueOf(i d); | |
| 88 | try { | |
| 89 | if (id Number.len gth() <= 1 5) { | |
| 90 | if (Stri ng.valueOf (id).lengt h() == 15) { | |
| 91 | if (Intege r.valueOf( idNumber.s ubstring(4 , 7)) <= 3 66 && chec kclaimType (idNumber. substring( 7, 9))) { | |
| 92 | ||
| 93 | lo gger.info( " getEwvPd iInfo() : getting th e PDI info rmation fr om EWV"); | |
| 94 | Ew vClaims ew vClaimsInf o = rfaiEw vRepositor y.getEwvPd iInfo(idNu mber); | |
| 95 | lo gger.debug ("getEwvPd iInfo() : PDI inform ation from EWV" + va lueOf(ewvC laimsInfo) ); | |
| 96 | lo gger.info( " getErepo sClaimInfo rmation() : getting the PDI in formation from ERepo s"); | |
| 97 | if (ewvClaim sInfo != n ull) { | |
| 98 | eRep osClaimInf o = rfaiEr eposReposi tory | |
| 99 | .getErep osClaimInf ormation(e wvClaimsIn fo.getEdiC laimKey()) ; | |
| 100 | logg er.debug(" getEreposC laimInform ation() : PDI inform ation from Erepos" | |
| 101 | + valueO f(eReposCl aimInfo)); | |
| 102 | rfai ResponseRe sult = get PdiClaimIn formation( ewvClaimsI nfo, eRepo sClaimInfo , id); | |
| 103 | ||
| 104 | logg er.info(" Claim is s elected. S o, returni ng the Cla im informa tion"); | |
| 105 | logg er.debug(" Claim info rmation " + valueOf( rfaiRespon seResult)) ; | |
| 106 | rfai ResponseRe sult = add PdiLineIte mInformati on(ewvClai msInfo, rf aiResponse Result); | |
| 107 | } else { | |
| 108 | logg er.error(" RfaiServic eImpl.popu lateRfaiIn fo() : exc eption occ ured for " + id); | |
| 109 | thro w new Gene ricExcepti on(ErrorMe ssages.NOT _FOUND, "E nter a val id number" , | |
| 110 | HttpStat us.NOT_FOU ND); | |
| 111 | } | |
| 112 | } else { | |
| 113 | lo gger.error ("RfaiServ iceImpl.po pulateRfai Info() : e xception o ccured for " + id); | |
| 114 | th row new Ge nericExcep tion(Error Messages.N OT_FOUND, "Enter a v alid numbe r", | |
| 115 | HttpSt atus.NOT_F OUND); | |
| 116 | } | |
| 117 | } else { | |
| 118 | logger.inf o(" getCla imInformat ion() : ge tting the Claim info rmation fr om FPPS"); | |
| 119 | Claim clai mInfo = rf aiFppsRepo sitory.get ClaimInfor mation(id) ; | |
| 120 | logger.deb ug("getCla imInformat ion() : Cl aim inform ation from FPPS" + v alueOf(cla imInfo)); | |
| 121 | logger.inf o(" getEre posClaimIn formation( ) : gettin g the Clai m informat ion from E Repos"); | |
| 122 | if (claimI nfo != nul l) { | |
| 123 | eR eposClaimI nfo = rfai EreposRepo sitory.get EreposClai mInformati on(claimIn fo.getEdiC laimKey()) ; | |
| 124 | lo gger.debug ("getErepo sClaimInfo rmation() : Claim in formation from ERepo s " | |
| 125 | + valu eOf(eRepos ClaimInfo) ); | |
| 126 | rf aiResponse Result = g etClaimIdC laimInform ation(clai mInfo, eRe posClaimIn fo, id); | |
| 127 | rf aiResponse Result = a ddClaimLin eItemInfor mation(cla imInfo, rf aiResponse Result); | |
| 128 | } else { | |
| 129 | lo gger.error ("RfaiServ iceImpl.po pulateRfai Info() : e xception o ccured for " + id); | |
| 130 | th row new Ge nericExcep tion(Error Messages.N OT_FOUND, "Enter a v alid numbe r", | |
| 131 | HttpSt atus.NOT_F OUND); | |
| 132 | } | |
| 133 | } | |
| 134 | } else { | |
| 135 | Validati onMessage validation Message = new Valida tionMessag e("ERR", " id", | |
| 136 | "S ize of the entered P DI or Clai m Number i s inapprop riate"); | |
| 137 | validati onMessages .add(valid ationMessa ge); | |
| 138 | status = false; | |
| 139 | } | |
| 140 | } ca tch (DataA ccessResou rceFailure Exception e) { | |
| 141 | logger .error("Rf aiServiceI mpl.popula teRfaiInfo () : excep tion occur ed while p rocessing the claim for " + id | |
| 142 | + " " + e) ; | |
| 143 | throw new Generi cException (ErrorMess ages.DATA_ ACCESS_ERR OR, e.getM essage(), | |
| 144 | HttpStatus .INTERNAL_ SERVER_ERR OR); | |
| 145 | } ca tch (DataA ccessExcep tion e) { | |
| 146 | logger .error("Rf aiServiceI mpl.popula teRfaiInfo () : excep tion occur ed while p rocessing the claim for " + id | |
| 147 | + " " + e) ; | |
| 148 | throw new Generi cException (ErrorMess ages.DATA_ ACCESS_ERR OR, e.getM essage(), | |
| 149 | HttpStatus .INTERNAL_ SERVER_ERR OR); | |
| 150 | } ca tch (Excep tion e) { | |
| 151 | logger .error("Rf aiServiceI mpl.popula teRfaiInfo () : excep tion occur ed while p rocessing the claim for " + id | |
| 152 | + " " + e) ; | |
| 153 | throw new Generi cException (ErrorMess ages.NOT_F OUND, e.ge tMessage() , HttpStat us.NOT_FOU ND); | |
| 154 | } | |
| 155 | ||
| 156 | if ( !status) { | |
| 157 | throw new Valida tionExcept ion("", va lidationMe ssages); | |
| 158 | } | |
| 159 | ||
| 160 | if ( rfaiRespon seResult ! = null) { | |
| 161 | return rfaiRespo nseResult; | |
| 162 | } el se { | |
| 163 | logger .error("Rf aiServiceI mpl.popula teRfaiInfo () : excep tion occur ed for " + id); | |
| 164 | throw new Generi cException (ErrorMess ages.NOT_F OUND, "Ent er a valid number", HttpStatus .NOT_FOUND ); | |
| 165 | } | |
| 166 | } | |
| 167 | ||
| 168 | pr ivate Rfai Response a ddClaimLin eItemInfor mation(Cla im claimIn fo, RfaiRe sponse rfa iResponseC laimResult ) | |
| 169 | throws GenericEx ception { | |
| 170 | Rfai Response r faiRespons eResult = null; | |
| 171 | if ( rfaiRespon seClaimRes ult != nul l) { | |
| 172 | rfaiRe sponseClai mResult.se tServiceFr omDate(dat eFormat.fo rmat(claim Info.getBe ginService Date())); | |
| 173 | rfaiRe sponseClai mResult.se tServiceTo Date(dateF ormat.form at(claimIn fo.getEndS erviceDate ())); | |
| 174 | rfaiRe sponseResu lt = getCl aimIdLineI temInforma tion(claim Info.getCl aimProcedu res(), rfa iResponseC laimResult ); | |
| 175 | if (rf aiResponse Result != null) { | |
| 176 | return r faiRespons eResult; | |
| 177 | } else { | |
| 178 | rfaiResp onseResult = rfaiRes ponseClaim Result; | |
| 179 | } | |
| 180 | } el se { | |
| 181 | logger .error( | |
| 182 | "RfaiServi ceImpl.add ClaimLineI temInforma tion() : e xception o ccured whi le process ing getCla imIdLineIt emInformat ion() "); | |
| 183 | throw new Generi cException (ErrorMess ages.NOT_F OUND, "Ent er a valid number", HttpStatus .NOT_FOUND ); | |
| 184 | } | |
| 185 | ||
| 186 | retu rn rfaiRes ponseResul t; | |
| 187 | } | |
| 188 | ||
| 189 | pr ivate Rfai Response a ddPdiLineI temInforma tion(EwvCl aims ewvCl aimsInfo, RfaiRespon se rfaiRes ponseClaim Result) | |
| 190 | throws GenericEx ception { | |
| 191 | Rfai Response r faiRespons eResult = null; | |
| 192 | if ( rfaiRespon seClaimRes ult != nul l) { | |
| 193 | rfaiRe sponseClai mResult.se tServiceFr omDate(ewv ClaimsInfo .getInvoic eStatement FromDate() ); | |
| 194 | rfaiRe sponseClai mResult.se tServiceTo Date(ewvCl aimsInfo.g etInvoiceS tatementTo Date()); | |
| 195 | rfaiRe sponseResu lt = getPd iLineItemI nformation (ewvClaims Info.getEw vServiceLi neses(), | |
| 196 | rfaiRespon seClaimRes ult); | |
| 197 | if (rf aiResponse Result != null) { | |
| 198 | return r faiRespons eResult; | |
| 199 | } else { | |
| 200 | rfaiResp onseResult = rfaiRes ponseClaim Result; | |
| 201 | } | |
| 202 | } el se { | |
| 203 | logger .error( | |
| 204 | "RfaiServi ceImpl.add ClaimLineI temInforma tion() : e xception o ccured whi le process ing getCla imIdLineIt emInformat ion() "); | |
| 205 | throw new Generi cException (ErrorMess ages.NOT_F OUND, "Ent er a valid number", HttpStatus .NOT_FOUND ); | |
| 206 | } | |
| 207 | retu rn rfaiRes ponseResul t; | |
| 208 | } | |
| 209 | ||
| 210 | pr ivate bool ean checkc laimType(S tring subs tring) { | |
| 211 | List <String> c laimTypeCo des = Arra ys.asList( "03", "04" , "05", "0 6", "07", "08", "09" , "10", "5 0", "60", "70", | |
| 212 | "91", "9 2", "93", "94", "95" , "96", "9 8", "99"); | |
| 213 | if ( claimTypeC odes.conta ins(substr ing)) { | |
| 214 | return true; | |
| 215 | } | |
| 216 | retu rn false; | |
| 217 | } | |
| 218 | ||
| 219 | pr ivate Rfai Response g etPdiClaim Informatio n(EwvClaim s ewvClaim sInfo, | |
| 220 | List<g ov.va.med. domain.ere posModel.C laim> eRep osClaimInf o, Long id ) { | |
| 221 | Rfai Response r faiRespons e = new Rf aiResponse (); | |
| 222 | if ( ewvClaimsI nfo != nul l) { | |
| 223 | rfaiRe sponse.set PatientIde ntifier(ew vClaimsInf o.getPatie ntIdNumber ()); | |
| 224 | rfaiRe sponse.set Patientcon trolNumber (ewvClaims Info.getIn voicePatie ntAccountN um()); | |
| 225 | /* | |
| 226 | * if (ewvClaims Info.getSe rviceVendo rName() != null) { | |
| 227 | * rfa iResponse. setProvide rInformati on(ewvClai msInfo. | |
| 228 | * get ServiceVen dorName()) ; | |
| 229 | * rfa iResponse. setProvide rTin(ewvCl aimsInfo. | |
| 230 | * get ServiceVen dorTaxIdNu m()); | |
| 231 | * rfa iResponse. setProvide rNpi(ewvCl aimsInfo.g etServiceV endorNpi() ); | |
| 232 | * } e lse { | |
| 233 | */ | |
| 234 | rfaiRe sponse.set ProviderIn formation( ewvClaimsI nfo.getBil lingVendor Name()); | |
| 235 | rfaiRe sponse.set ProviderTi n(ewvClaim sInfo.getB illingVend orTaxIdNum ()); | |
| 236 | rfaiRe sponse.set ProviderNp i(ewvClaim sInfo.getB illingVend orNpi()); | |
| 237 | // } | |
| 238 | Date d t = new Da te(); | |
| 239 | LocalD ateTime lo calDate = dt.toInsta nt().atZon e(ZoneId.s ystemDefau lt()).toLo calDateTim e(); | |
| 240 | localD ate = loca lDate.plus Days(5); | |
| 241 | Date c urrentDate PlusFiveDa y = Date.f rom(localD ate.atZone (ZoneId.sy stemDefaul t()).toIns tant()); | |
| 242 | rfaiRe sponse.set ResponseDa te(dateFor mat.format (currentDa tePlusFive Day)); | |
| 243 | rfaiRe sponse.set PayerClaim ControlNum ber(String .valueOf(i d)); | |
| 244 | ||
| 245 | if (ew vClaimsInf o.getPatie ntName() ! = null) { | |
| 246 | String[] splitted = ewvClaim sInfo.getP atientName ().split(" \\s*(=>|,| \\s)\\s*") ; | |
| 247 | if (spli tted.lengt h >= 2) { | |
| 248 | rfaiRespon se.setPati entFirstNa me(splitte d[1]); | |
| 249 | rfaiRespon se.setPati entLastnam e(splitted [0]); | |
| 250 | } else { | |
| 251 | rfaiRespon se.setPati entFirstNa me(splitte d[1]); | |
| 252 | } | |
| 253 | } | |
| 254 | } | |
| 255 | if ( !eReposCla imInfo.isE mpty()) { | |
| 256 | for (g ov.va.med. domain.ere posModel.C laim eClai mInfo : eR eposClaimI nfo) { | |
| 257 | getInfor mationRece iver(eClai mInfo.getE ntityNames (), rfaiRe sponse); | |
| 258 | getAdtlE ntityInfor mation(eCl aimInfo.ge tEntityAdt lIds(), rf aiResponse ); | |
| 259 | rfaiResp onse.setBi llType(eCl aimInfo.ge tClm05fcly TypeCd() + eClaimInf o.getClm05 clmFrqCd() ); | |
| 260 | } | |
| 261 | } | |
| 262 | rfai Response.s etPayerId( ewvPayerId ); | |
| 263 | rfai Response.s etPayerNam e(payerNam e); | |
| 264 | logg er.info(" generateEw vClaimLeve lData() : Ewv Claim informatio n "); | |
| 265 | logg er.debug(" generateEw vClaimLeve lData() : Ewv Claim informatio n " + valu eOf(rfaiRe sponse)); | |
| 266 | retu rn rfaiRes ponse; | |
| 267 | } | |
| 268 | ||
| 269 | pr ivate Rfai Response g etPdiLineI temInforma tion(Set<E wvServiceL ines> ewvS erviceLine ses, RfaiR esponse rf aiResponse ) { | |
| 270 | List <RfaiLineI temRespons e> rfaiLin eItemRespo nseList = new ArrayL ist<>(); | |
| 271 | for (EwvServic eLines esl : ewvServ iceLineses ) { | |
| 272 | BigDec imal charg eAmount = new BigDec imal(esl.g etCharge() ); | |
| 273 | ||
| 274 | String Builder mo difiers = new String Builder("" ); | |
| 275 | modifi ers.append (StringUti ls.isEmpty (esl.getMo difier1()) ? "" : es l.getModif ier1()); | |
| 276 | modifi ers.append (StringUti ls.isEmpty (esl.getMo difier2()) ? "" | |
| 277 | : (modifie rs.length( ) > 0 ? ", " : "") + esl.getMod ifier2()); | |
| 278 | modifi ers.append (StringUti ls.isEmpty (esl.getMo difier3()) ? "" | |
| 279 | : (modifie rs.length( ) > 0 ? ", " : "") + esl.getMod ifier3()); | |
| 280 | modifi ers.append (StringUti ls.isEmpty (esl.getMo difier4()) ? "" | |
| 281 | : (modifie rs.length( ) > 0 ? ", " : "") + esl.getMod ifier4()); | |
| 282 | ||
| 283 | RfaiLi neItemResp onse rfaiL ineItemRes ponse = ne w RfaiLine ItemRespon se(esl.get LineNumber (), | |
| 284 | esl.getBeg inDateOfSe rvice(), e sl.getEndD ateOfServi ce(), esl. getRevenue Code(), | |
| 285 | esl.getPro cedureCode (), modifi ers.toStri ng(), char geAmount); | |
| 286 | rfaiLi neItemResp onseList.a dd(rfaiLin eItemRespo nse); | |
| 287 | } | |
| 288 | ||
| 289 | Coll ections.so rt(rfaiLin eItemRespo nseList, n ew Compara tor<RfaiLi neItemResp onse>() { | |
| 290 | ||
| 291 | @Overr ide | |
| 292 | public int compa re(RfaiLin eItemRespo nse o1, Rf aiLineItem Response o 2) { | |
| 293 | return o 1.getServi ceLineId() .compareTo (o2.getSer viceLineId ()); | |
| 294 | } | |
| 295 | }); | |
| 296 | rfai Response.s etRfaiLine ItemRespon se(rfaiLin eItemRespo nseList); | |
| 297 | logg er.info(" getEwvLine ItemInform ation() : Ewv Line I tem inform ation "); | |
| 298 | logg er.debug(" getEwvLine ItemInform ation() : Ewv Line I tem inform ation " + valueOf(rf aiResponse )); | |
| 299 | retu rn rfaiRes ponse; | |
| 300 | } | |
| 301 | ||
| 302 | pr ivate Rfai Response g etClaimIdC laimInform ation(Clai m claimInf o, | |
| 303 | List<g ov.va.med. domain.ere posModel.C laim> eRep osClaimInf o, Long id ) { | |
| 304 | Rfai Response r faiRespons e = new Rf aiResponse (); | |
| 305 | if ( claimInfo != null) { | |
| 306 | getPro viderName( claimInfo. getProvide rInfos(), rfaiRespon se); | |
| 307 | getVet eranInfo(c laimInfo.g etPersonIn fos(), rfa iResponse) ; | |
| 308 | rfaiRe sponse.set Patientcon trolNumber (claimInfo .getPatien tControlNu mber()); | |
| 309 | } | |
| 310 | if ( !eReposCla imInfo.isE mpty()) { | |
| 311 | for (g ov.va.med. domain.ere posModel.C laim eClai mInfo : eR eposClaimI nfo) { | |
| 312 | getInfor mationRece iver(eClai mInfo.getE ntityNames (), rfaiRe sponse); | |
| 313 | getAdtlE ntityInfor mation(eCl aimInfo.ge tEntityAdt lIds(), rf aiResponse ); | |
| 314 | rfaiResp onse.setBi llType(eCl aimInfo.ge tClm05fcly TypeCd() + eClaimInf o.getClm05 clmFrqCd() ); | |
| 315 | } | |
| 316 | } | |
| 317 | Date dt = new Date(); | |
| 318 | Loca lDateTime localDate = dt.toIns tant().atZ one(ZoneId .systemDef ault()).to LocalDateT ime(); | |
| 319 | loca lDate = lo calDate.pl usDays(5); | |
| 320 | Date currentDa tePlusFive Day = Date .from(loca lDate.atZo ne(ZoneId. systemDefa ult()).toI nstant()); | |
| 321 | rfai Response.s etResponse Date(dateF ormat.form at(current DatePlusFi veDay)); | |
| 322 | rfai Response.s etPayerCla imControlN umber(Stri ng.valueOf (id)); | |
| 323 | rfai Response.s etPayerId( fppsPayerI d); | |
| 324 | rfai Response.s etPayerNam e(payerNam e); | |
| 325 | logg er.info(" generateFp psClaimlev elData() : FPPS Clai m informat ion "); | |
| 326 | logg er.debug(" generateFp psClaimlev elData() : FPPS Clai m informat ion " + va lueOf(rfai Response)) ; | |
| 327 | retu rn rfaiRes ponse; | |
| 328 | } | |
| 329 | ||
| 330 | pr ivate Rfai Response g etClaimIdL ineItemInf ormation(S et<ClaimPr ocedure> c laimProced ures, Rfai Response r faiRespons e) { | |
| 331 | List <RfaiLineI temRespons e> rfaiLin eItemRespo nseList = new ArrayL ist<>(); | |
| 332 | for (ClaimProc edure cp : claimProc edures) { | |
| 333 | ||
| 334 | String Builder mo difiers = new String Builder("" ); | |
| 335 | modifi ers.append (StringUti ls.isEmpty (cp.getMod ifier1()) ? "" : cp. getModifie r1()); | |
| 336 | modifi ers.append (StringUti ls.isEmpty (cp.getMod ifier2()) ? "" | |
| 337 | : (modifie rs.length( ) > 0 ? ", " : "") + cp.getModi fier2()); | |
| 338 | modifi ers.append (StringUti ls.isEmpty (cp.getMod ifier3()) ? "" | |
| 339 | : (modifie rs.length( ) > 0 ? ", " : "") + cp.getModi fier3()); | |
| 340 | modifi ers.append (StringUti ls.isEmpty (cp.getMod ifier4()) ? "" | |
| 341 | : (modifie rs.length( ) > 0 ? ", " : "") + cp.getModi fier4()); | |
| 342 | ||
| 343 | RfaiLi neItemResp onse rfaiL ineItemRes ponse = ne w RfaiLine ItemRespon se(cp.getC laimProced ureSeq(), | |
| 344 | dateFormat .format(cp .getServic eFromDate( )), dateFo rmat.forma t(cp.getSe rviceToDat e()), | |
| 345 | cp.getReve nueCode(). getRevenue Cd(), cp.g etProcCode (), modifi ers.toStri ng(), cp.g etBilledAm ount()); | |
| 346 | rfaiLi neItemResp onseList.a dd(rfaiLin eItemRespo nse); | |
| 347 | } | |
| 348 | ||
| 349 | Coll ections.so rt(rfaiLin eItemRespo nseList, n ew Compara tor<RfaiLi neItemResp onse>() { | |
| 350 | ||
| 351 | @Overr ide | |
| 352 | public int compa re(RfaiLin eItemRespo nse o1, Rf aiLineItem Response o 2) { | |
| 353 | return o 1.getServi ceLineId() .compareTo (o2.getSer viceLineId ()); | |
| 354 | } | |
| 355 | }); | |
| 356 | ||
| 357 | rfai Response.s etRfaiLine ItemRespon se(rfaiLin eItemRespo nseList); | |
| 358 | logg er.info(" getLineIte mInformati on() : FPP S Line inf ormation " ); | |
| 359 | logg er.debug(" getLineIte mInformati on() : FPP S Line inf ormation " + valueOf (rfaiRespo nse)); | |
| 360 | retu rn rfaiRes ponse; | |
| 361 | } | |
| 362 | ||
| 363 | pr ivate void getAdtlEn tityInform ation(Set< EntityAdtl Id> entity AdtlIds, R faiRespons e rfaiResp onse) { | |
| 364 | for (EntityAdt lId eId : entityAdtl Ids) { | |
| 365 | if ("D 9".equals( eId.getRef 01idQlfr() )) { | |
| 366 | rfaiResp onse.setCl earingHous eId(eId.ge tRef02scnd Id()); | |
| 367 | } | |
| 368 | if ("E A".equals( eId.getRef 01idQlfr() )) { | |
| 369 | rfaiResp onse.setMe dicalRecor dNumber(eI d.getRef02 scndId()); | |
| 370 | } | |
| 371 | } | |
| 372 | } | |
| 373 | ||
| 374 | pr ivate void getInform ationRecei ver(Set<En tityName> entityName s, RfaiRes ponse rfai Response) { | |
| 375 | for (EntityNam e e : enti tyNames) { | |
| 376 | if ("4 1".equals( e.getNm101 entyIdCd() )) { | |
| 377 | rfaiResp onse.setIn formationR eceiver(e. getNm109id Cd()); | |
| 378 | } | |
| 379 | } | |
| 380 | } | |
| 381 | ||
| 382 | pr ivate void getProvid erName(Set <ProviderI nfo> provi derInfos, RfaiRespon se rfaiRes ponse) { | |
| 383 | for (ProviderI nfo p : pr oviderInfo s) { | |
| 384 | if (p. getProvide rType().ge tProviderT ypeCd() != null) { | |
| 385 | /* | |
| 386 | * if (" SERVICE FA CILITY".eq uals(p.get ProviderTy pe(). | |
| 387 | * getPr oviderType Cd()) || | |
| 388 | * "SERV ICE LOCATI ON".equals (p.getProv iderType() . | |
| 389 | * getPr oviderType Cd())) { | |
| 390 | * rfaiR esponse.se tProviderI nformation (p.getLast Name()); | |
| 391 | * rfaiR esponse.se tProviderT in(p.getPr oviderTin( )); | |
| 392 | * rfaiR esponse.se tProviderN pi(p.getPr oviderNpi( )); break; } | |
| 393 | * else | |
| 394 | */ | |
| 395 | if ("BIL LING PROVI DER".equal s(p.getPro viderType( ).getProvi derTypeCd( )) | |
| 396 | || "REMITADD R".equals( p.getProvi derType(). getProvide rTypeCd()) ) { | |
| 397 | rfaiRespon se.setProv iderInform ation(p.ge tLastName( )); | |
| 398 | rfaiRespon se.setProv iderTin(p. getProvide rTin()); | |
| 399 | rfaiRespon se.setProv iderNpi(p. getProvide rNpi()); | |
| 400 | } | |
| 401 | } | |
| 402 | } | |
| 403 | } | |
| 404 | ||
| 405 | pr ivate void getVetera nInfo(Set< PersonInfo > personIn fos, RfaiR esponse rf aiResponse ) { | |
| 406 | for (PersonInf o pi : per sonInfos) { | |
| 407 | rfaiRe sponse.set PatientLas tname(pi.g etLastName ()); | |
| 408 | rfaiRe sponse.set PatientFir stName(pi. getFirstNa me()); | |
| 409 | rfaiRe sponse.set PatientIde ntifier(pi .getPerson Id()); | |
| 410 | ||
| 411 | } | |
| 412 | } | |
| 413 | ||
| 414 | pu blic stati c String v alueOf(Obj ect obj) { | |
| 415 | retu rn (obj == null) ? " null" : ob j.toString (); | |
| 416 | } | |
| 417 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.