Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

483 changes: 181 additions & 302 deletions src/main/java/com/iemr/hwc/controller/anc/AntenatalCareController.java

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1,086 changes: 461 additions & 625 deletions src/main/java/com/iemr/hwc/controller/common/main/WorklistController.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@
import org.springframework.web.bind.annotation.RestController;

import com.iemr.hwc.service.common.master.CommonMasterServiceImpl;
import com.iemr.hwc.utils.exception.IEMRException;
import com.iemr.hwc.utils.response.OutputResponse;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;

import io.swagger.v3.oas.annotations.Operation;
import jakarta.ws.rs.core.MediaType;

@RestController
@RequestMapping(value = "/master", headers = "Authorization", consumes = "application/json", produces = "application/json")
Expand All @@ -56,13 +57,13 @@
* @return list of visit reasons and visit categories
*/
@Operation(summary = "Get visit reasons and categories")
@GetMapping(value = "/get/visitReasonAndCategories", produces = MediaType.APPLICATION_JSON)
public String getVisitReasonAndCategories() {
@GetMapping(value = "/get/visitReasonAndCategories", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<String> getVisitReasonAndCategories() throws Exception {

Check warning on line 61 in src/main/java/com/iemr/hwc/controller/common/master/CommonMasterController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace generic exceptions with specific library exceptions or a custom exception.

See more on https://sonarcloud.io/project/issues?id=PSMRI_HWC-API&issues=AZy9uUb0UWGM6cAyS4qi&open=AZy9uUb0UWGM6cAyS4qi&pullRequest=190
logger.info("getVisitReasonAndCategories ...");
OutputResponse response = new OutputResponse();
response.setResponse(commonMasterServiceImpl.getVisitReasonAndCategories());
logger.info("visitReasonAndCategories" + response.toString());
return response.toString();
return ResponseEntity.ok(response.toString());
}

/**
Expand All @@ -71,23 +72,17 @@
* @return nurse master data for the provided visitCategoryID
*/
@Operation(summary = "Get master data for selected beneficiary for nurse")
@GetMapping(value = "/nurse/masterData/{visitCategoryID}/{providerServiceMapID}/{gender}", produces = MediaType.APPLICATION_JSON)
public String NurseMasterData(@PathVariable("visitCategoryID") Integer visitCategoryID,
@PathVariable("providerServiceMapID") Integer providerServiceMapID, @PathVariable("gender") String gender) {

@GetMapping(value = "/nurse/masterData/{visitCategoryID}/{providerServiceMapID}/{gender}", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<String> NurseMasterData(@PathVariable("visitCategoryID") Integer visitCategoryID,
@PathVariable("providerServiceMapID") Integer providerServiceMapID, @PathVariable("gender") String gender)
throws Exception {
logger.info("Nurse master Data for categoryID:" + visitCategoryID + " and providerServiceMapID:"
+ providerServiceMapID);
OutputResponse response = new OutputResponse();

try {
response.setResponse(
commonMasterServiceImpl.getMasterDataForNurse(visitCategoryID, providerServiceMapID, gender));
logger.info("Nurse master Data for categoryID:" + response.toString());
} catch (Exception e) {
logger.error(e.getLocalizedMessage());
response.setError(5000, "error in getting nurse master data : " + e.getLocalizedMessage());
}
return response.toString();
response.setResponse(
commonMasterServiceImpl.getMasterDataForNurse(visitCategoryID, providerServiceMapID, gender));
logger.info("Nurse master Data for categoryID:" + response.toString());
return ResponseEntity.ok(response.toString());
}

/**
Expand All @@ -96,17 +91,17 @@
* @return doctor master data for the provided visitCategoryID
*/
@Operation(summary = "Get master data for selected beneficiary for doctor")
@GetMapping(value = "/doctor/masterData/{visitCategoryID}/{providerServiceMapID}/{gender}/{facilityID}/{vanID}", produces = MediaType.APPLICATION_JSON)
public String DoctorMasterData(@PathVariable("visitCategoryID") Integer visitCategoryID,
@GetMapping(value = "/doctor/masterData/{visitCategoryID}/{providerServiceMapID}/{gender}/{facilityID}/{vanID}", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<String> DoctorMasterData(@PathVariable("visitCategoryID") Integer visitCategoryID,
@PathVariable("providerServiceMapID") Integer providerServiceMapID, @PathVariable("gender") String gender,
@PathVariable("facilityID") Integer facilityID, @PathVariable("vanID") Integer vanID) {
@PathVariable("facilityID") Integer facilityID, @PathVariable("vanID") Integer vanID) throws Exception {

Check warning on line 97 in src/main/java/com/iemr/hwc/controller/common/master/CommonMasterController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace generic exceptions with specific library exceptions or a custom exception.

See more on https://sonarcloud.io/project/issues?id=PSMRI_HWC-API&issues=AZy9uUb0UWGM6cAyS4qk&open=AZy9uUb0UWGM6cAyS4qk&pullRequest=190
logger.info("Doctor master Data for categoryID:" + visitCategoryID + " and providerServiceMapID:"
+ providerServiceMapID);
OutputResponse response = new OutputResponse();
response.setResponse(commonMasterServiceImpl.getMasterDataForDoctor(visitCategoryID, providerServiceMapID,
gender, facilityID, vanID));
logger.info("Doctor master Data for categoryID:" + response.toString());
return response.toString();
return ResponseEntity.ok(response.toString());
}

/**
Expand All @@ -116,25 +111,21 @@
* cisId
*/
@Operation(summary = "Get current immunization data for selected beneficiary for doctor")
@GetMapping(value = "/common/masterData/getVaccine/{currentImmunizationServiceID}/{visitCategoryID}", produces = MediaType.APPLICATION_JSON)
public String getVaccineDetailsForCISID(
@GetMapping(value = "/common/masterData/getVaccine/{currentImmunizationServiceID}/{visitCategoryID}", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<String> getVaccineDetailsForCISID(
@PathVariable("currentImmunizationServiceID") Integer currentImmunizationServiceID,
@PathVariable("visitCategoryID") Integer visitCategoryID) {
@PathVariable("visitCategoryID") Integer visitCategoryID) throws Exception {
OutputResponse response = new OutputResponse();
try {
if (currentImmunizationServiceID == null)
throw new IEMRException("invalid request / NULL");
logger.info("current-immunization-service-id:" + currentImmunizationServiceID);

response.setResponse(
commonMasterServiceImpl.getVaccineDetailsForCISID(currentImmunizationServiceID, visitCategoryID));
logger.info("response data for : " + currentImmunizationServiceID + response.toString());

} catch (IEMRException e) {
logger.error(e.getLocalizedMessage());
response.setError(5000, e.getLocalizedMessage());
if (currentImmunizationServiceID == null) {
response.setError(5000, "invalid request / NULL");
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(response.toString());
}
return response.toString();
logger.info("current-immunization-service-id:" + currentImmunizationServiceID);

response.setResponse(
commonMasterServiceImpl.getVaccineDetailsForCISID(currentImmunizationServiceID, visitCategoryID));
logger.info("response data for : " + currentImmunizationServiceID + response.toString());
return ResponseEntity.ok(response.toString());
}

}
Loading