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 @@ -593,16 +593,19 @@
+ " \"sexualOrientationType\": \"String\",\r\n" + " \"vanID\": \"Integer\",\r\n"
+ " \"createdDate\": \"Timestamp\"\r\n" + " \"faceEmbedding\": [\"Float\"]\r\n" + "}") @RequestBody String identityData) throws IEMRException {
logger.info("IdentityController.createIdentity - start");

System.out.println("[TRACE][Identity-API] /id/create raw request body : " + identityData);

Check warning on line 596 in src/main/java/com/iemr/common/identity/controller/IdentityController.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_Identity-API&issues=AZ-jn0qfaiuYSm36s5TV&open=AZ-jn0qfaiuYSm36s5TV&pullRequest=178

// Bare Gson matches Common-API's RegisterBenificiaryServiceImpl, which also
// serializes the outgoing identity payload with a bare new Gson(). dob relies
// on this symmetric default format; gpsTimestamp is still parsed correctly via
// its field-level @JsonAdapter(GpsTimestampAdapter.class) on Address, which
// works regardless of which Gson instance performs the parse.
IdentityDTO identity = new Gson().fromJson(identityData, IdentityDTO.class);
logger.info("identity hit: " + identity);
System.out.println("[TRACE][Identity-API] /id/create parsed IdentityDTO : " + identity);

Check warning on line 605 in src/main/java/com/iemr/common/identity/controller/IdentityController.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_Identity-API&issues=AZ-jn0qfaiuYSm36s5TW&open=AZ-jn0qfaiuYSm36s5TW&pullRequest=178
BeneficiaryCreateResp map;
map = svc.createIdentity(identity);
System.out.println("[TRACE][Identity-API] /id/create svc.createIdentity result : " + InputMapper.getInstance().gson().toJson(map));

Check warning on line 608 in src/main/java/com/iemr/common/identity/controller/IdentityController.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_Identity-API&issues=AZ-jn0qfaiuYSm36s5TX&open=AZ-jn0qfaiuYSm36s5TX&pullRequest=178
String data = InputMapper.getInstance().gson().toJson(map);
String response = getSuccessResponseString(data, 200, "success", "createIdentityByAgent");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@
OutputResponse response = new OutputResponse();
try {
if (requestOBJ != null) {
System.out.println("syncDataToAmrit request body : " + requestOBJ);

Check warning on line 63 in src/main/java/com/iemr/common/identity/controller/rmnch/RMNCHMobileAppController.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_Identity-API&issues=AZ-jn0p2aiuYSm36s5TT&open=AZ-jn0p2aiuYSm36s5TT&pullRequest=178
String s = rmnchDataSyncService.syncDataToAmrit(requestOBJ);
System.out.println("syncDataToAmrit response body : " + s);

Check warning on line 65 in src/main/java/com/iemr/common/identity/controller/rmnch/RMNCHMobileAppController.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_Identity-API&issues=AZ-jn0p2aiuYSm36s5TU&open=AZ-jn0p2aiuYSm36s5TU&pullRequest=178
response.setResponse(s);
} else
response.setError(5000, "Invalid/NULL request obj");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,15 @@ public class RMNCHBeneficiaryDetailsRmnch {
@Expose
private String otherPlaceOfDeath;

@Expose
private String placeOfCurrentLiving;

@Expose
private String otherPlaceOfCurrentLiving;

@Expose
private String institutionName;

@Expose
private Boolean isSpouseAdded;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,23 @@ public class RMNCHHouseHoldDetails {
@Column(name = "familyName")
private String familyName;

@Expose
@SerializedName(value = "address", alternate = "Address")
@Column(name = "address")
private String address;

@Expose
@Column(name = "totalHhMembers")
private Integer totalHhMembers;

@Expose
@Column(name = "registeredAtCampSite")
private String registeredAtCampSite;

@Expose
@Column(name = "registeredAtCampSiteId")
private Integer registeredAtCampSiteId;

@Expose
@Column(name = "fuelUsed")
private String fuelUsed;
Expand Down Expand Up @@ -194,6 +211,7 @@ public class RMNCHHouseHoldDetails {
private String other_sourceofDrinkingWater;

@Expose
@SerializedName(value = "pincode", alternate = "Pincode")
@Column(name = "pincode")
private Integer pincode;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,13 @@ public class RMNCHMBeneficiarydetail {
@Expose
@Transient
private Integer ProviderServiceMapID;

@Expose
private String placeOfCurrentLiving;

@Expose
private String otherPlaceOfCurrentLiving;

@Expose
private String institutionName;
}
Original file line number Diff line number Diff line change
Expand Up @@ -1492,8 +1492,10 @@
Timestamp ts = Timestamp.valueOf(dateToStoreInDataBase);
mDetl.setCreatedDate(ts);
}
System.out.println("[TRACE][Identity-API] before detailRepo.save mDetl.getDob()=" + mDetl.getDob());

Check warning on line 1495 in src/main/java/com/iemr/common/identity/service/IdentityService.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_Identity-API&issues=AZ-jn0pYaiuYSm36s5TQ&open=AZ-jn0pYaiuYSm36s5TQ&pullRequest=178
mDetl = detailRepo.save(mDetl);
logger.info("IdentityService.createIdentity - Details saved - id = " + mDetl.getBeneficiaryDetailsId());
System.out.println("[TRACE][Identity-API] after detailRepo.save mDetl.getDob()=" + mDetl.getDob() + " id=" + mDetl.getBeneficiaryDetailsId());

Check warning on line 1498 in src/main/java/com/iemr/common/identity/service/IdentityService.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_Identity-API&issues=AZ-jn0pYaiuYSm36s5TR&open=AZ-jn0pYaiuYSm36s5TR&pullRequest=178

// Update van serial no for data sync
detailRepo.updateVanSerialNo(mDetl.getBeneficiaryDetailsId());
Expand Down Expand Up @@ -1687,6 +1689,7 @@
}
beneficiarydetail.setCommunity(dto.getCommunity());
beneficiarydetail.setCommunityId(dto.getCommunityId());
System.out.println("[TRACE][Identity-API] convertIdentityDTOToMBeneficiarydetail dto.getDob()=" + dto.getDob());

Check warning on line 1692 in src/main/java/com/iemr/common/identity/service/IdentityService.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_Identity-API&issues=AZ-jn0pYaiuYSm36s5TS&open=AZ-jn0pYaiuYSm36s5TS&pullRequest=178
beneficiarydetail.setDob(dto.getDob());
beneficiarydetail.setEducation(dto.getEducation());
beneficiarydetail.setEducationId(dto.getEducationId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
private boolean enforceVanID;
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
@Override
public String syncDataToAmrit(String requestOBJ) throws Exception {

Check failure on line 126 in src/main/java/com/iemr/common/identity/service/rmnch/RmnchDataSyncServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

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

See more on https://sonarcloud.io/project/issues?id=PSMRI_Identity-API&issues=AZ-jn0kpaiuYSm36s5TO&open=AZ-jn0kpaiuYSm36s5TO&pullRequest=178

Map<String, Object> resultMap = new HashMap<String, Object>();

Expand Down Expand Up @@ -190,6 +190,10 @@
obj.setBenRegId(benRegID);
// Extract GPS from i_bendemographics
JsonObject demog = benGpsMap.get(obj.getBenficieryid());
System.out.println("[TRACE][Identity-API] syncDataToAmrit benficieryid=" + obj.getBenficieryid()

Check warning on line 193 in src/main/java/com/iemr/common/identity/service/rmnch/RmnchDataSyncServiceImpl.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_Identity-API&issues=AZ-jn0kpaiuYSm36s5TP&open=AZ-jn0kpaiuYSm36s5TP&pullRequest=178
+ " i_bendemographics.pinCode=" + (demog != null && demog.has("pinCode") && !demog.get("pinCode").isJsonNull()

Check failure on line 194 in src/main/java/com/iemr/common/identity/service/rmnch/RmnchDataSyncServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "pinCode" 3 times.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Identity-API&issues=AZ-jn0kpaiuYSm36s5TN&open=AZ-jn0kpaiuYSm36s5TN&pullRequest=178
? demog.get("pinCode") : "ABSENT")
+ " entity.getPinCode()=" + obj.getPinCode());
if (demog != null) {
if (demog.has("latitude") && !demog.get("latitude").isJsonNull())
obj.setGpsLatitude(demog.get("latitude").getAsDouble());
Expand Down Expand Up @@ -243,6 +247,9 @@
rmnchmBeneficiarydetail.setGenderId(obj.getGenderId());
rmnchmBeneficiarydetail.setMaritalstatus(obj.getMaritalstatus());
rmnchmBeneficiarydetail.setMaritalstatusId(obj.getMaritalstatusId());
rmnchmBeneficiarydetail.setPlaceOfCurrentLiving(obj.getPlaceOfCurrentLiving());
rmnchmBeneficiarydetail.setOtherPlaceOfCurrentLiving(obj.getOtherPlaceOfCurrentLiving());
rmnchmBeneficiarydetail.setInstitutionName(obj.getInstitutionName());
benDetailsList.add(rmnchmBeneficiarydetail);
}
}
Expand Down
Loading