Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customization changes #59

Merged
merged 12 commits into from
Jul 11, 2024
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
18 changes: 1 addition & 17 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -240,23 +240,7 @@
<build>
<finalName>identity-0.0.1</finalName>
<plugins>
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>9.0.8</version>
<configuration>
<format>HTML</format>
<nvdApiServerId>nvd</nvdApiServerId>
<nvdApiKey>79597933-f3cc-4601-949b-12513434ade3</nvdApiKey>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,13 +483,13 @@ public String editIdentity(@Param(value = "{\r\n" + " \"eventTypeName\": \"Stri
+ " \"vanID\": \"Integer\",\r\n" + " \"parkingPlaceId\": \"Integer\"\r\n"
+ "}") @RequestBody String identityEditData) {
logger.info("IdentityController.editIdentity - start");
JsonElement json = JsonParser.parseString(identityEditData);
// JsonElement json = JsonParser.parseString(identityEditData);

if (json instanceof JsonNull || json instanceof JsonPrimitive) {
return getErrorResponseString("Null/Empty Identity Edit Data.", 200, "success", "");
}
// if (json instanceof JsonNull || json instanceof JsonPrimitive) {
// return getErrorResponseString("Null/Empty Identity Edit Data.", 200, "success", "");
// }

IdentityEditDTO identity = InputMapper.getInstance().gson().fromJson(json, IdentityEditDTO.class);
IdentityEditDTO identity = InputMapper.getInstance().gson().fromJson(identityEditData, IdentityEditDTO.class);
try {
svc.editIdentity(identity);
String response = getSuccessResponseString("Updated successfully", 200, "success", "editIdentityByAgent");
Expand Down Expand Up @@ -603,12 +603,12 @@ public String createIdentity(@Param(value = "{\r\n" + " \"eventTypeName\": \"St
+ " \"sexualOrientationType\": \"String\",\r\n" + " \"vanID\": \"Integer\",\r\n"
+ " \"createdDate\": \"Timestamp\"\r\n" + "}") @RequestBody String identityData) throws IEMRException {
logger.info("IdentityController.createIdentity - start");
JsonElement json = JsonParser.parseString(identityData);
// JsonElement json = JsonParser.parseString(identityData);

if (json instanceof JsonNull || json instanceof JsonPrimitive) {
return getErrorResponseString("Null/Empty Identity Create Data.", 200, "success", "");
}
IdentityDTO identity = new Gson().fromJson(json, IdentityDTO.class);
// if (json instanceof JsonNull || json instanceof JsonPrimitive) {
// return getErrorResponseString("Null/Empty Identity Create Data.", 200, "success", "");
// }
IdentityDTO identity = new Gson().fromJson(identityData, IdentityDTO.class);
logger.info("identity hit: " + identity);
BeneficiaryCreateResp map;
map = svc.createIdentity(identity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import java.util.Calendar;
import java.util.Date;

import org.json.JSONObject;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
Expand All @@ -37,6 +39,8 @@
import jakarta.persistence.Table;
import jakarta.persistence.Transient;

import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.annotations.Expose;

import lombok.AllArgsConstructor;
Expand Down Expand Up @@ -236,6 +240,12 @@ public class MBeneficiarydetail implements Serializable {

@Column(name = "MonthlyFamilyIncome")
private String monthlyFamilyIncome;

@Column(name = "ExtraFields")
private String otherFields;

// @Column(columnDefinition = "json")
// private JsonElement otherFields;

public MBeneficiarydetail() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,5 @@ public class BenDetailDTO implements Serializable {
private String familyId;
private String other;
private String headOfFamily_Relation;
private String otherFields;
}
11 changes: 11 additions & 0 deletions src/main/java/com/iemr/common/identity/dto/BeneficiariesDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,18 @@
*/
package com.iemr.common.identity.dto;



import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.iemr.common.identity.domain.Address;
import com.iemr.common.identity.domain.Phone;

Expand Down Expand Up @@ -87,4 +95,7 @@ public int compareTo(BeneficiariesDTO ben) {
private String sourceOfInformation;
private String isHIVPos;
// End 1097

private String otherFields;

}
6 changes: 6 additions & 0 deletions src/main/java/com/iemr/common/identity/dto/IdentityDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
import java.sql.Timestamp;
import java.util.List;

import org.json.JSONObject;

import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.annotations.Expose;
import com.iemr.common.identity.domain.Address;
import com.iemr.common.identity.domain.Contact;
Expand Down Expand Up @@ -124,9 +128,11 @@ public class IdentityDTO {

@Expose
private Integer vanID;
private String otherFields;


@Expose
private Boolean beneficiaryConsent;
// private Object otherFields;

}
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,5 @@ public class IdentityEditDTO {
private Integer vanID;
private Integer parkingPlaceId;
private boolean emergencyRegistration;
// private Object otherFields;
}
Original file line number Diff line number Diff line change
Expand Up @@ -176,53 +176,53 @@ MBeneficiaryconsent identityEditDTOToDefaultMBeneficiaryconsent(IdentityEditDTO

MBeneficiarycontact identityEdiDTOToMBeneficiarycontact(IdentityEditDTO dto);

@Mapping(source = "dto.areaId", target = "areaId")
@Mapping(source = "dto.beneficiaryRegId", target = "beneficiaryRegID")
@Mapping(source = "dto.community", target = "community")
@Mapping(source = "dto.communityId", target = "communityId")
@Mapping(source = "dto.dob", target = "dob")
@Mapping(source = "dto.education", target = "education")
@Mapping(source = "dto.educationId", target = "educationId")

@Mapping(source = "dto.healthCareWorkerId", target = "healthCareWorkerId")
@Mapping(source = "dto.healthCareWorker", target = "healthCareWorker")
@Mapping(source = "dto.fatherName", target = "fatherName")
@Mapping(source = "dto.motherName", target = "motherName")
@Mapping(source = "dto.firstName", target = "firstName")
@Mapping(source = "dto.gender", target = "gender")
@Mapping(source = "dto.genderId", target = "genderId")
@Mapping(source = "dto.incomeStatusId", target = "incomeStatusId")
@Mapping(source = "dto.incomeStatus", target = "incomeStatus")
@Mapping(source = "dto.monthlyFamilyIncome", target = "monthlyFamilyIncome")
@Mapping(source = "dto.lastName", target = "lastName")
@Mapping(source = "dto.maritalStatusId", target = "maritalStatusId")
@Mapping(source = "dto.maritalStatus", target = "maritalStatus")
@Mapping(source = "dto.middleName", target = "middleName")
@Mapping(source = "dto.occupation", target = "occupation")
@Mapping(source = "dto.occupationId", target = "occupationId")
@Mapping(source = "dto.phcId", target = "phcId")
@Mapping(source = "dto.placeOfWork", target = "placeOfWork")
@Mapping(source = "dto.preferredLanguage", target = "preferredLanguage")
@Mapping(source = "dto.religion", target = "religion")
@Mapping(source = "dto.religionId", target = "religionId")
@Mapping(source = "dto.remarks", target = "remarks")
@Mapping(source = "dto.servicePointId", target = "servicePointId")
@Mapping(source = "dto.sourceOfInfo", target = "sourceOfInfo")
@Mapping(source = "dto.spouseName", target = "spouseName")
@Mapping(source = "dto.status", target = "status")
@Mapping(source = "dto.title", target = "title")
@Mapping(source = "dto.titleId", target = "titleId")
@Mapping(source = "dto.zoneId", target = "zoneId")
@Mapping(source = "dto.agentName", target = "createdBy")
@Mapping(source = "dto.eventTypeDate", target = "createdDate")
@Mapping(target = "isHIVPositive", expression = "java(MBeneficiarydetail.setIsHIVPositive(dto.getIsHIVPositive()))")
// Start MMU specific code
@Mapping(target = "ageAtMarriage", expression = "java(MBeneficiarydetail.getAgeAtMarriageCalc(dto.getDob(), dto.getMarriageDate(), "
+ "dto.getAgeAtMarriage()))")
@Mapping(target = "marriageDate", expression = "java(MBeneficiarydetail.getMarriageDateCalc(dto.getDob(), dto.getMarriageDate(), "
+ "dto.getAgeAtMarriage()))")

MBeneficiarydetail identityEditDTOToMBeneficiarydetail(IdentityEditDTO dto);
// @Mapping(source = "dto.areaId", target = "areaId")
// @Mapping(source = "dto.beneficiaryRegId", target = "beneficiaryRegID")
// @Mapping(source = "dto.community", target = "community")
// @Mapping(source = "dto.communityId", target = "communityId")
// @Mapping(source = "dto.dob", target = "dob")
// @Mapping(source = "dto.education", target = "education")
// @Mapping(source = "dto.educationId", target = "educationId")
//
// @Mapping(source = "dto.healthCareWorkerId", target = "healthCareWorkerId")
// @Mapping(source = "dto.healthCareWorker", target = "healthCareWorker")
// @Mapping(source = "dto.fatherName", target = "fatherName")
// @Mapping(source = "dto.motherName", target = "motherName")
// @Mapping(source = "dto.firstName", target = "firstName")
// @Mapping(source = "dto.gender", target = "gender")
// @Mapping(source = "dto.genderId", target = "genderId")
// @Mapping(source = "dto.incomeStatusId", target = "incomeStatusId")
// @Mapping(source = "dto.incomeStatus", target = "incomeStatus")
// @Mapping(source = "dto.monthlyFamilyIncome", target = "monthlyFamilyIncome")
// @Mapping(source = "dto.lastName", target = "lastName")
// @Mapping(source = "dto.maritalStatusId", target = "maritalStatusId")
// @Mapping(source = "dto.maritalStatus", target = "maritalStatus")
// @Mapping(source = "dto.middleName", target = "middleName")
// @Mapping(source = "dto.occupation", target = "occupation")
// @Mapping(source = "dto.occupationId", target = "occupationId")
// @Mapping(source = "dto.phcId", target = "phcId")
// @Mapping(source = "dto.placeOfWork", target = "placeOfWork")
// @Mapping(source = "dto.preferredLanguage", target = "preferredLanguage")
// @Mapping(source = "dto.religion", target = "religion")
// @Mapping(source = "dto.religionId", target = "religionId")
// @Mapping(source = "dto.remarks", target = "remarks")
// @Mapping(source = "dto.servicePointId", target = "servicePointId")
// @Mapping(source = "dto.sourceOfInfo", target = "sourceOfInfo")
// @Mapping(source = "dto.spouseName", target = "spouseName")
// @Mapping(source = "dto.status", target = "status")
// @Mapping(source = "dto.title", target = "title")
// @Mapping(source = "dto.titleId", target = "titleId")
// @Mapping(source = "dto.zoneId", target = "zoneId")
// @Mapping(source = "dto.agentName", target = "createdBy")
// @Mapping(source = "dto.eventTypeDate", target = "createdDate")
// @Mapping(target = "isHIVPositive", expression = "java(MBeneficiarydetail.setIsHIVPositive(dto.getIsHIVPositive()))")
// // Start MMU specific code
// @Mapping(target = "ageAtMarriage", expression = "java(MBeneficiarydetail.getAgeAtMarriageCalc(dto.getDob(), dto.getMarriageDate(), "
// + "dto.getAgeAtMarriage()))")
// @Mapping(target = "marriageDate", expression = "java(MBeneficiarydetail.getMarriageDateCalc(dto.getDob(), dto.getMarriageDate(), "
// + "dto.getAgeAtMarriage()))")
//
// MBeneficiarydetail identityEditDTOToMBeneficiarydetail(IdentityEditDTO dto);

@Mapping(source = "benFamilyDTO.isEmergencyContact", target = "isEmergencyContact")
@Mapping(source = "benFamilyDTO.relationshipToSelf", target = "relationshipToSelf")
Expand Down
100 changes: 50 additions & 50 deletions src/main/java/com/iemr/common/identity/mapper/IdentityMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,56 +92,56 @@ public interface IdentityMapper {



@Mapping(source = "dto.areaId", target = "areaId")
@Mapping(source = "dto.beneficiaryRegId", target = "beneficiaryRegID")
@Mapping(source = "dto.community", target = "community")
@Mapping(source = "dto.communityId", target = "communityId")
@Mapping(source = "dto.dob", target = "dob")
@Mapping(source = "dto.education", target = "education")
@Mapping(source = "dto.educationId", target = "educationId")
@Mapping(source = "dto.emergencyRegistration", target = "emergencyRegistration")
@Mapping(source = "dto.healthCareWorkerId", target = "healthCareWorkerId")
@Mapping(source = "dto.healthCareWorker", target = "healthCareWorker")
@Mapping(source = "dto.fatherName", target = "fatherName")
@Mapping(source = "dto.motherName", target = "motherName")
@Mapping(source = "dto.firstName", target = "firstName")
@Mapping(source = "dto.gender", target = "gender")
@Mapping(source = "dto.genderId", target = "genderId")
@Mapping(source = "dto.incomeStatus", target = "incomeStatus")
@Mapping(source = "dto.monthlyFamilyIncome", target = "monthlyFamilyIncome")
@Mapping(source = "dto.incomeStatusId", target = "incomeStatusId")
@Mapping(source = "dto.lastName", target = "lastName")
@Mapping(source = "dto.maritalStatusId", target = "maritalStatusId")
@Mapping(source = "dto.maritalStatus", target = "maritalStatus")
@Mapping(source = "dto.middleName", target = "middleName")
@Mapping(source = "dto.occupation", target = "occupation")
@Mapping(source = "dto.occupationId", target = "occupationId")
@Mapping(source = "dto.phcId", target = "phcId")
@Mapping(source = "dto.placeOfWork", target = "placeOfWork")
@Mapping(source = "dto.preferredLanguage", target = "preferredLanguage")
@Mapping(source = "dto.religion", target = "religion")
@Mapping(source = "dto.religionId", target = "religionId")
@Mapping(source = "dto.remarks", target = "remarks")
@Mapping(source = "dto.servicePointId", target = "servicePointId")
@Mapping(source = "dto.sourceOfInfo", target = "sourceOfInfo")
@Mapping(source = "dto.spouseName", target = "spouseName")
@Mapping(source = "dto.status", target = "status")
@Mapping(source = "dto.title", target = "title")
@Mapping(source = "dto.titleId", target = "titleId")
@Mapping(source = "dto.zoneId", target = "zoneId")
@Mapping(source = "dto.agentName", target = "createdBy")
@Mapping(source = "dto.createdDate", target = "createdDate")
@Mapping(target = "isHIVPositive", expression = "java(MBeneficiarydetail.setIsHIVPositive(dto.getIsHIVPositive()))")

@Mapping(target = "ageAtMarriage", expression = "java(MBeneficiarydetail.getAgeAtMarriageCalc(dto.getDob(), dto.getMarriageDate(), "
+ "dto.getAgeAtMarriage()))")
@Mapping(target = "marriageDate", expression = "java(MBeneficiarydetail.getMarriageDateCalc(dto.getDob(), dto.getMarriageDate(), "
+ "dto.getAgeAtMarriage()))")

@Mapping(source = "dto.vanID", target = "vanID")
@Mapping(source = "dto.parkingPlaceId", target = "parkingPlaceID")

MBeneficiarydetail identityDTOToMBeneficiarydetail(IdentityDTO dto);
// @Mapping(source = "dto.areaId", target = "areaId")
// @Mapping(source = "dto.beneficiaryRegId", target = "beneficiaryRegID")
// @Mapping(source = "dto.community", target = "community")
// @Mapping(source = "dto.communityId", target = "communityId")
// @Mapping(source = "dto.dob", target = "dob")
// @Mapping(source = "dto.education", target = "education")
// @Mapping(source = "dto.educationId", target = "educationId")
// @Mapping(source = "dto.emergencyRegistration", target = "emergencyRegistration")
// @Mapping(source = "dto.healthCareWorkerId", target = "healthCareWorkerId")
// @Mapping(source = "dto.healthCareWorker", target = "healthCareWorker")
// @Mapping(source = "dto.fatherName", target = "fatherName")
// @Mapping(source = "dto.motherName", target = "motherName")
// @Mapping(source = "dto.firstName", target = "firstName")
// @Mapping(source = "dto.gender", target = "gender")
// @Mapping(source = "dto.genderId", target = "genderId")
// @Mapping(source = "dto.incomeStatus", target = "incomeStatus")
// @Mapping(source = "dto.monthlyFamilyIncome", target = "monthlyFamilyIncome")
// @Mapping(source = "dto.incomeStatusId", target = "incomeStatusId")
// @Mapping(source = "dto.lastName", target = "lastName")
// @Mapping(source = "dto.maritalStatusId", target = "maritalStatusId")
// @Mapping(source = "dto.maritalStatus", target = "maritalStatus")
// @Mapping(source = "dto.middleName", target = "middleName")
// @Mapping(source = "dto.occupation", target = "occupation")
// @Mapping(source = "dto.occupationId", target = "occupationId")
// @Mapping(source = "dto.phcId", target = "phcId")
// @Mapping(source = "dto.placeOfWork", target = "placeOfWork")
// @Mapping(source = "dto.preferredLanguage", target = "preferredLanguage")
// @Mapping(source = "dto.religion", target = "religion")
// @Mapping(source = "dto.religionId", target = "religionId")
// @Mapping(source = "dto.remarks", target = "remarks")
// @Mapping(source = "dto.servicePointId", target = "servicePointId")
// @Mapping(source = "dto.sourceOfInfo", target = "sourceOfInfo")
// @Mapping(source = "dto.spouseName", target = "spouseName")
// @Mapping(source = "dto.status", target = "status")
// @Mapping(source = "dto.title", target = "title")
// @Mapping(source = "dto.titleId", target = "titleId")
// @Mapping(source = "dto.zoneId", target = "zoneId")
// @Mapping(source = "dto.agentName", target = "createdBy")
// @Mapping(source = "dto.createdDate", target = "createdDate")
// @Mapping(target = "isHIVPositive", expression = "java(MBeneficiarydetail.setIsHIVPositive(dto.getIsHIVPositive()))")
//
// @Mapping(target = "ageAtMarriage", expression = "java(MBeneficiarydetail.getAgeAtMarriageCalc(dto.getDob(), dto.getMarriageDate(), "
// + "dto.getAgeAtMarriage()))")
// @Mapping(target = "marriageDate", expression = "java(MBeneficiarydetail.getMarriageDateCalc(dto.getDob(), dto.getMarriageDate(), "
// + "dto.getAgeAtMarriage()))")
//
// @Mapping(source = "dto.vanID", target = "vanID")
// @Mapping(source = "dto.parkingPlaceId", target = "parkingPlaceID")
// MBeneficiarydetail identityDTOToMBeneficiarydetail(IdentityDTO dto);


@Mapping(source = "benFamilyDTO.isEmergencyContact", target = "isEmergencyContact")
@Mapping(source = "benFamilyDTO.relationshipToSelf", target = "relationshipToSelf")
Expand Down
Loading
Loading