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 @@ -54,6 +54,8 @@ public class CommonIdentityDTO {
private Integer beneficiaryRegId;
private Integer communityId;
private String community;
private Boolean isConsent=false;
Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ’‘ Verification agent

🧩 Analysis chain

Field naming consistency concern

The new isConsent field appears to overlap with the existing beneficiaryConsent field (line 154). Consider either removing one of these fields or clarifying the distinct purpose of each through documentation to avoid confusion.


🏁 Script executed:

#!/bin/bash
# Check if both fields are used differently in the codebase

echo "Checking usage of beneficiaryConsent field:"
rg "beneficiaryConsent" -A 3 -B 3

echo -e "\nChecking usage of isConsent field:"
rg "isConsent" -A 3 -B 3

Length of output: 9398


Duplicate Consent Fields Detected – Resolve Naming Inconsistencies

It appears that both a beneficiaryConsent field and an isConsent field are defined in the codebaseβ€”with beneficiaryConsent prevalent in several models (e.g., in the beneficiary and feedback models) and isConsent found in both BeneficiaryModel.java and CommonIdentityDTO.java. In particular, in CommonIdentityDTO.java both fields coexist, which is likely to lead to confusion or unintended behavior.

Please address one of the following:

  • Remove one of the fields if they are intended to represent the same concept.
  • Otherwise, add documentation or rename the fields to clearly indicate their distinct purposes.

Specific locations to review:

  • File: src/main/java/com/iemr/common/dto/identity/CommonIdentityDTO.java
    • Both beneficiaryConsent and isConsent are declared.
  • File: src/main/java/com/iemr/common/model/beneficiary/BeneficiaryModel.java
    • Contains the isConsent field.
  • Other files: Several feedback and beneficiary model classes use beneficiaryConsent.


private Timestamp dob;
private Integer ageAtMarriage;
private Integer educationId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ public class BeneficiaryModel implements Comparable<BeneficiaryModel> {
private TitleModel m_title;
@Expose
private String firstName;
@Expose
private Boolean isConsent=false;

@Expose
private String middleName;
@Expose
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,12 @@ private int updateDemographics(BeneficiaryDemographicsModel i_BenDemographics) {
@Override
public String save(BeneficiaryModel beneficiaryModel, HttpServletRequest servletRequest) throws Exception {

// logger.info("benificiaryDetails: " + beneficiaryModel);
logger.info("benificiaryDetails: " + beneficiaryModel);

CommonIdentityDTO identityDTO = identityMapper.beneficiaryModelCommonIdentityDTO(beneficiaryModel);
setSaveDemographicDetails(identityDTO,beneficiaryModel);
// identityDTO.setOtherFields(beneficiaryModel.getOtherFields());
identityDTO.setIsConsent(beneficiaryModel.getIsConsent());
identityDTO.setFaceEmbedding(beneficiaryModel.getFaceEmbedding());
identityDTO.setEmergencyRegistration(beneficiaryModel.isEmergencyRegistration());
identityDTO
Expand Down