Summary Table

Categories Total Count
PII 0
URL 0
DNS 0
EKL 0
IP 0
PORT 0
VsID 0
CF 0
AI 0
VPD 0
PL 0
Other 0

File Content

package gov.va.med.ars.controller;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import gov.va.med.ars.model.request.Parse277CARequest;
import gov.va.med.ars.service.IParse277CAServiceImpl;
import net.minidev.json.JSONObject;

@RestController
@RequestMapping("/api/ca/277CA")
public class Parse277CAController {

private static final Logger logger = LogManager.getLogger(Parse277CAController.class);

@Autowired
IParse277CAServiceImpl parse277CAService;

/**
* @param parse277CARequest
*/
/**
* @param parse277CARequest
*/
@PostMapping("/parse")
public void parse277(@RequestBody Parse277CARequest parse277CARequest) {
JSONObject entity = new JSONObject();
if (parse277CAService.process277CABatch(parse277CARequest)) {
logger.info("Parsed and CSTAT Generated");
entity.put("code", "Success");
entity.put("message", "Parsed and CSTAT Generated");
} else {
logger.info("Input 277CA file is null/Rejected");
entity.put("errorCode", "Invalid");
entity.put("message", "enter a valid 277CA input");
// return new ResponseEntity<JSONObject>(entity, HttpStatus.OK);
}

}
}