Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ public String createBeneficiary(
// beneficiary registration with common and identity new
@Operation(summary = "Register a new beneficiary new API")
@PostMapping(value = { "/registrarBeneficaryRegistrationNew" })
@PreAuthorize("hasRole('NURSE') || hasRole('REGISTRAR') || hasRole('ASHA') || hasRole('VOLUNTEER') || hasRole('REGISTRATION_OFFICER')")
@PreAuthorize("hasRole('NURSE') || hasRole('REGISTRAR') || hasRole('ASHA') || hasRole('VOLUNTEER') || hasRole('REGISTRATION_OFFICER') || hasRole('COUNSELLOR')")
public String registrarBeneficaryRegistrationNew(@RequestBody String comingReq,
@RequestHeader(value = "Authorization") String Authorization) {
String s;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
int returnOBJ = 0;
try {
BeneficiaryFlowStatus obj = getBenFlowRecordObj(requestOBJ, beneficiaryRegID, beneficiaryID);
System.out.println("TRACE createBenFlowRecord: benRegID=" + obj.getBeneficiaryRegID()

Check warning on line 67 in src/main/java/com/iemr/tm/service/benFlowStatus/CommonBenStatusFlowServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace this use of System.out by a logger.

See more on https://sonarcloud.io/project/issues?id=PSMRI_TM-API&issues=AZ_7BiLCKRL2YGFkPHmj&open=AZ_7BiLCKRL2YGFkPHmj&pullRequest=160
+ " providerServiceMapID=" + obj.getProviderServiceMapID()
+ " villageID=" + obj.getVillageID()
+ " vanID=" + obj.getVanID());

if (beneficiaryRegID != null && beneficiaryID != null && beneficiaryRegID > 0 && beneficiaryID > 0) {
objRS = beneficiaryFlowStatusRepo.save(obj);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@
}

// New beneficiary registration with common and identity
public String registerBeneficiary(String comingRequest, String Authorization) throws Exception {

Check failure on line 672 in src/main/java/com/iemr/tm/service/registrar/RegistrarServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this method to reduce its Cognitive Complexity from 21 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=PSMRI_TM-API&issues=AZ_7BiHiKRL2YGFkPHmf&open=AZ_7BiHiKRL2YGFkPHmf&pullRequest=160

OutputResponse response1 = new OutputResponse();
Long beneficiaryRegID = null;
Expand Down Expand Up @@ -707,13 +707,19 @@
responseMap.put("benRegId", beneficiaryRegID);

BeneficiaryFlowStatus obj = InputMapper.gson().fromJson(comingRequest, BeneficiaryFlowStatus.class);
System.out.println("TRACE registerBeneficiary: benRegID=" + beneficiaryRegID + " isMobile="

Check warning on line 710 in src/main/java/com/iemr/tm/service/registrar/RegistrarServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace this use of System.out by a logger.

See more on https://sonarcloud.io/project/issues?id=PSMRI_TM-API&issues=AZ_7BiHiKRL2YGFkPHmg&open=AZ_7BiHiKRL2YGFkPHmg&pullRequest=160
+ (obj != null ? obj.getIsMobile() : "obj=null") + " providerServiceMapID="
+ (obj != null ? obj.getProviderServiceMapID() : null) + " villageID="
+ (obj != null ? obj.getVillageID() : null));
if (obj != null && obj.getIsMobile() != null && obj.getIsMobile()) {
System.out.println("TRACE registerBeneficiary: isMobile=true branch — createBenFlowRecord SKIPPED, benRegID=" + beneficiaryRegID);

Check warning on line 715 in src/main/java/com/iemr/tm/service/registrar/RegistrarServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace this use of System.out by a logger.

See more on https://sonarcloud.io/project/issues?id=PSMRI_TM-API&issues=AZ_7BiHiKRL2YGFkPHmh&open=AZ_7BiHiKRL2YGFkPHmh&pullRequest=160
responseMap.put("response", "Beneficiary successfully registered. Beneficiary ID is : "+ beneficiaryID+" , BenRegID is : "+beneficiaryRegID);
response1.setResponse(new Gson().toJson(responseMap));

} else {
int i = commonBenStatusFlowServiceImpl.createBenFlowRecord(comingRequest, beneficiaryRegID,
beneficiaryID);
System.out.println("TRACE registerBeneficiary: createBenFlowRecord returned=" + i + " benRegID=" + beneficiaryRegID);

Check warning on line 722 in src/main/java/com/iemr/tm/service/registrar/RegistrarServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace this use of System.out by a logger.

See more on https://sonarcloud.io/project/issues?id=PSMRI_TM-API&issues=AZ_7BiHiKRL2YGFkPHmi&open=AZ_7BiHiKRL2YGFkPHmi&pullRequest=160

if (i > 0) {
responseMap.put("response", "Beneficiary successfully registered. Beneficiary ID is : "+ beneficiaryID+" , BenRegID is : "+beneficiaryRegID);
Expand Down
Loading