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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.iemr.common-API</groupId>
<artifactId>common-api</artifactId>
<version>3.2.1</version>
<version>3.4.0</version>
<packaging>war</packaging>

<name>Common-API</name>
Expand Down
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")
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.iemr.common.utils;

import java.io.IOException;
import java.util.Arrays;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -15,7 +16,6 @@
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.util.Arrays;

public class JwtUserIdValidationFilter implements Filter {

Expand All @@ -39,11 +39,11 @@ public void doFilter(ServletRequest servletRequest, ServletResponse servletRespo

logger.debug("Incoming Origin: {}", origin);
logger.debug("Allowed Origins Configured: {}", allowedOrigins);

logger.info("Add server authorization header to response");
if (origin != null && isOriginAllowed(origin)) {
response.setHeader("Access-Control-Allow-Origin", origin);
response.setHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS");
response.setHeader("Access-Control-Allow-Headers", "Authorization, Content-Type, Accept, Jwttoken");
response.setHeader("Access-Control-Allow-Headers", "Authorization, Content-Type, Accept, Jwttoken, serverAuthorization, ServerAuthorization, serverauthorization, Serverauthorization");
response.setHeader("Access-Control-Allow-Credentials", "true");
} else {
logger.warn("Origin [{}] is NOT allowed. CORS headers NOT added.", origin);
Expand Down Expand Up @@ -150,7 +150,9 @@ private boolean isMobileClient(String userAgent) {
if (userAgent == null)
return false;
userAgent = userAgent.toLowerCase();
return userAgent.contains("okhttp"); // iOS (custom clients)
logger.info(userAgent);
// return userAgent.contains("okhttp"); // iOS (custom clients)
return userAgent.contains("okhttp") || userAgent.contains("java/"); // iOS (custom clients)
}

private boolean shouldSkipAuthentication(String path, String contextPath) {
Expand Down