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 @@ -35,6 +35,7 @@

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.JsonObject;
import com.google.gson.annotations.Expose;
import com.iemr.common.model.user.TitleModel;
Expand Down Expand Up @@ -211,16 +212,19 @@ public class BeneficiaryModel implements Comparable<BeneficiaryModel> {
@Expose
private Integer occupationId;
@Expose
@JsonProperty("occupationOther")
private String occupationName;
@Expose
private String occupation;
@Expose
@JsonProperty("incomeName")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't follow this. The string below looks different?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't follow this. The string below looks different?
Yes. For these fields income, occupation and education, there is mismatch in the json property and entity names. So to tag those used 'JsonProperty'

private String incomeStatus;
@Expose
private BigInteger religionId;
@Expose
private String religion;
@Expose
@JsonProperty("educationQualificationName")
private String education;
@Expose
private Integer providerServiceMapID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.Gson;
import com.iemr.common.data.beneficiary.Beneficiary;
import com.iemr.common.data.mctshistory.MctsOutboundCallDetail;
Expand Down Expand Up @@ -112,7 +111,6 @@ private void updateBeneficiaryID(String beneficiaryID, Long beneficiaryRegID) {
@Override
public Integer updateBenificiary(BeneficiaryModel benificiaryDetails, String auth) throws IEMRException {
Integer updatedRows = 0;

IdentityEditDTO identityEditDTO = identityBenEditMapper.BenToIdentityEditMapper(benificiaryDetails);
setDemographicDetails(identityEditDTO,benificiaryDetails);

Expand All @@ -122,11 +120,9 @@ public Integer updateBenificiary(BeneficiaryModel benificiaryDetails, String aut
benificiaryDetails.getCreatedBy()));
}
identityEditDTO.setDob(benificiaryDetails.getDOB());
// identityEditDTO.setOtherFields(benificiaryDetails.getOtherFields());
// String jsoninput=new Gson().toJson(identityEditDTO);
updatedRows = identityBeneficiaryService.editIdentityEditDTO(identityEditDTO, auth,
benificiaryDetails.getIs1097());

return updatedRows;
}

Expand All @@ -140,11 +136,22 @@ else if(null != benificiaryDetails.getI_bendemographics().getReligion())
identityEditDTO.setReligion(benificiaryDetails.getI_bendemographics().getReligion());
else
identityEditDTO.setReligion(benificiaryDetails.getI_bendemographics().getReligionName());
if(null != benificiaryDetails.getOccupation())
identityEditDTO.setOccupationName(benificiaryDetails.getOccupation());
else
identityEditDTO.setOccupationName(benificiaryDetails.getI_bendemographics().getOccupation());
identityEditDTO.setEducation(benificiaryDetails.getI_bendemographics().getEducationName());

if (null != benificiaryDetails.getOccupation()) {
identityEditDTO.setOccupationName(benificiaryDetails.getOccupation());
} else if (null != benificiaryDetails.getI_bendemographics() &&
null != benificiaryDetails.getI_bendemographics().getOccupation()) {
identityEditDTO.setOccupationName(benificiaryDetails.getI_bendemographics().getOccupation());
} else {
identityEditDTO.setOccupationName(benificiaryDetails.getOccupationName());
}

if (null != benificiaryDetails.getEducation()) {
identityEditDTO.setEducation(benificiaryDetails.getEducation());
} else if (null != benificiaryDetails.getI_bendemographics() &&
null != benificiaryDetails.getI_bendemographics().getEducationName()) {
identityEditDTO.setEducation(benificiaryDetails.getI_bendemographics().getEducationName());
}
if(null != benificiaryDetails.getIncomeStatus())
identityEditDTO.setIncomeStatus(benificiaryDetails.getIncomeStatus());
else
Expand Down Expand Up @@ -206,12 +213,25 @@ else if(null != beneficiaryModel.getI_bendemographics().getReligion())
identityDTO.setReligion(beneficiaryModel.getI_bendemographics().getReligion());
else
identityDTO.setReligion(beneficiaryModel.getI_bendemographics().getReligionName());
if(null != beneficiaryModel.getOccupation())
identityDTO.setOccupationName(beneficiaryModel.getOccupation());
else
identityDTO.setOccupationName(beneficiaryModel.getI_bendemographics().getOccupation());
if(null != beneficiaryModel.getI_bendemographics().getEducationName())
identityDTO.setEducation(beneficiaryModel.getI_bendemographics().getEducationName());

if (null != beneficiaryModel.getOccupation()) {
identityDTO.setOccupationName(beneficiaryModel.getOccupation());
} else if (null != beneficiaryModel.getI_bendemographics() &&
null != beneficiaryModel.getI_bendemographics().getOccupation()) {
identityDTO.setOccupationName(beneficiaryModel.getI_bendemographics().getOccupation());
} else {
identityDTO.setOccupationName(beneficiaryModel.getOccupationName());
}

if (null != beneficiaryModel.getEducation()) {
identityDTO.setEducation(beneficiaryModel.getEducation());
} else if (null != beneficiaryModel.getI_bendemographics() &&
null != beneficiaryModel.getI_bendemographics().getEducationName()) {
identityDTO.setEducation(beneficiaryModel.getI_bendemographics().getEducationName());
}



if(null != beneficiaryModel.getIncomeStatus())
identityDTO.setIncomeStatus(beneficiaryModel.getIncomeStatus());
else
Expand Down