Produced by Araxis Merge on 4/27/2018 2:59:09 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\controller | CodeAndModifiersController.java | Tue Apr 24 14:49:54 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\controller | CodeAndModifiersController.java | Thu Apr 26 14:59:24 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 178 |
| 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.control ler; | |
| 5 | ||
| 6 | import jav a.util.Lis t; | |
| 7 | ||
| 8 | import jav ax.servlet .http.Http ServletReq uest; | |
| 9 | ||
| 10 | import org .apache.lo gging.log4 j.LogManag er; | |
| 11 | import org .apache.lo gging.log4 j.Logger; | |
| 12 | import org .springfra mework.bea ns.factory .annotatio n.Autowire d; | |
| 13 | import org .springfra mework.htt p.HttpStat us; | |
| 14 | import org .springfra mework.htt p.Response Entity; | |
| 15 | import org .springfra mework.web .bind.anno tation.Pos tMapping; | |
| 16 | import org .springfra mework.web .bind.anno tation.Req uestBody; | |
| 17 | import org .springfra mework.web .bind.anno tation.Req uestMappin g; | |
| 18 | import org .springfra mework.web .bind.anno tation.Req uestMethod ; | |
| 19 | import org .springfra mework.web .bind.anno tation.Res tControlle r; | |
| 20 | ||
| 21 | import gov .va.med.ar s.exceptio ns.Generic Exception; | |
| 22 | import gov .va.med.ar s.model.re quest.Gene ricRequest ; | |
| 23 | import gov .va.med.ar s.service. ICodeAndMo difierServ ice; | |
| 24 | import net .minidev.j son.JSONOb ject; | |
| 25 | ||
| 26 | /** | |
| 27 | * @author PI I
|
|
| 28 | * | |
| 29 | */ | |
| 30 | @RestContr oller | |
| 31 | @RequestMa pping("api /v1/popula te") | |
| 32 | public cla ss CodeAnd ModifiersC ontroller { | |
| 33 | ||
| 34 | pr ivate stat ic final L ogger logg er = LogMa nager.getL ogger(Code AndModifie rsControll er.class); | |
| 35 | ||
| 36 | @A utowired | |
| 37 | IC odeAndModi fierServic e codeAndM odiferServ ice; | |
| 38 | ||
| 39 | /* * | |
| 40 | * | |
| 41 | * / | |
| 42 | @P ostMapping (value = { "/loinc", "/loincMo d", "/hccs " }) | |
| 43 | pu blic Respo nseEntity< ?> getCode s(@Request Body List< String> co desToProce ss, HttpSe rvletReque st request ) | |
| 44 | throws GenericEx ception { | |
| 45 | Stri ng current Url = requ est.getReq uestURI(). toString() ; | |
| 46 | try { | |
| 47 | List<? > response = codeAnd ModiferSer vice.getCo deAndModif ier(curren tUrl, code sToProcess ); | |
| 48 | return new Respo nseEntity< >(response , HttpStat us.OK); | |
| 49 | } ca tch (Excep tion e) { | |
| 50 | logger .error("Po pulateCode AndModifie rsControll er:getCode s() except ion occure d for clai m index : " | |
| 51 | + e.getMes sage()); | |
| 52 | throw e; | |
| 53 | } | |
| 54 | } | |
| 55 | ||
| 56 | @R equestMapp ing(value = { "/add" }, method = { Reque stMethod.P OST, Reque stMethod.P UT }) | |
| 57 | pu blic Respo nseEntity< ?> addOrMo difyCodes( @RequestBo dy Generic Request co deAndModif ierRequest , | |
| 58 | HttpSe rvletReque st request ) throws G enericExce ption { | |
| 59 | JSON Object jso nResponse = null; | |
| 60 | try { | |
| 61 | if(cod eAndModifi erRequest != null) { | |
| 62 | List<Str ing> dupli cateCheck = codeAndM odiferServ ice | |
| 63 | .c heckSubmit tedModific ationsForD upes(codeA ndModifier Request); | |
| 64 | if (!dup licateChec k.isEmpty( )) { | |
| 65 | logger.war n("Found D uplicates in Request "); | |
| 66 | JSONObject entity = new JSONOb ject(); | |
| 67 | entity.put ("errorCod e", "Updat e Codes No t Complete : Duplicat es Found") ; | |
| 68 | entity.put ("message" , duplicat eCheck); | |
| 69 | return new ResponseE ntity<>(en tity, Http Status.BAD _REQUEST); | |
| 70 | } | |
| 71 | boolean response = codeAndMo diferServi ce.addOrMo difyCodeAn dModifier( codeAndMod ifierReque st); | |
| 72 | JSONObje ct entity = new JSON Object(); | |
| 73 | entity.p ut("result ", respons e); | |
| 74 | return n ew Respons eEntity<>( entity, Ht tpStatus.O K); | |
| 75 | } else { | |
| 76 | jsonResp onse = new JSONObjec t(); | |
| 77 | logger.w arn("getCl aim : no i nformation was passe d"); | |
| 78 | jsonResp onse.put(" errorCode" , "Un-Auth orized"); | |
| 79 | jsonResp onse.put(" message", "The enter ed user ha s no acces s to the a dd the cod es"); | |
| 80 | return n ew Respons eEntity<>( jsonRespon se,HttpSta tus.NOT_FO UND); | |
| 81 | } | |
| 82 | ||
| 83 | } ca tch (Excep tion e) { | |
| 84 | logger .error("Po pulateCode AndModifie rsControll er:getCode s() except ion occure d for clai m index : " | |
| 85 | + e.getMes sage()); | |
| 86 | throw e; | |
| 87 | } | |
| 88 | } | |
| 89 | ||
| 90 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.