Skip to content

Feature/Add Key Place of Anc in ANC module#113

Merged
SauravBizbRolly merged 1 commit intosm/release-3.10.0_tempfrom
feature/amm-2039
Dec 22, 2025
Merged

Feature/Add Key Place of Anc in ANC module#113
SauravBizbRolly merged 1 commit intosm/release-3.10.0_tempfrom
feature/amm-2039

Conversation

@SauravBizbRolly
Copy link
Copy Markdown
Collaborator

@SauravBizbRolly SauravBizbRolly commented Dec 22, 2025

📋 Description

JIRA ID: AMM-2039

Add Key Place of Anc in ANC module

✅ Type of Change

  • 🐞 Bug fix (non-breaking change which resolves an issue)
  • New feature (non-breaking change which adds functionality)
  • 🔥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 🛠 Refactor (change that is neither a fix nor a new feature)
  • ⚙️ Config change (configuration file or build script updates)
  • 📚 Documentation (updates to docs or readme)
  • 🧪 Tests (adding new or updating existing tests)
  • 🎨 UI/UX (changes that affect the user interface)
  • 🚀 Performance (improves performance)
  • 🧹 Chore (miscellaneous changes that don't modify src or test files)

ℹ️ Additional Information

Please describe how the changes were tested, and include any relevant screenshots, logs, or other information that provides additional context.

Summary by CodeRabbit

  • New Features
    • Added fields to capture the location where antenatal care visits take place, enabling better tracking and documentation of visit details.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Dec 22, 2025

Walkthrough

Two new fields (placeOfAnc and placeOfAncId) are added to the ANCVisit entity domain model and its corresponding DTO class to extend the data structure for capturing place-of-visit information in antenatal care visits.

Changes

Cohort / File(s) Change Summary
ANC Visit Data Structure Extensions
src/main/java/com/iemr/flw/domain/iemr/ANCVisit.java, src/main/java/com/iemr/flw/dto/iemr/ANCVisitDTO.java
Added placeOfAnc (String) and placeOfAncId (Integer) fields to both the JPA entity and DTO, with column mapping annotations on the domain entity for database persistence.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

  • Straightforward field additions with no logic, control flow, or dependency changes
  • Consistent pattern applied identically across both files
  • Simple entity and DTO extension with no side effects

Poem

🐰 Two new fields now rest in our care,
For mothers' visits we'll track with flair,
Place of ANC, recorded with grace,
Each consultation finds its place!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding place of ANC fields to the ANC module. It directly relates to the two new fields added to ANCVisit and ANCVisitDTO classes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/amm-2039

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@SauravBizbRolly
Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Dec 22, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2b74a48 and edd3046.

📒 Files selected for processing (2)
  • src/main/java/com/iemr/flw/domain/iemr/ANCVisit.java
  • src/main/java/com/iemr/flw/dto/iemr/ANCVisitDTO.java
🔇 Additional comments (2)
src/main/java/com/iemr/flw/dto/iemr/ANCVisitDTO.java (1)

66-67: LGTM! DTO fields added correctly.

The new placeOfAnc and placeOfAncId fields are properly declared and will work with Lombok's @Data annotation to generate the necessary getters and setters.

src/main/java/com/iemr/flw/domain/iemr/ANCVisit.java (1)

170-174: Missing database migration script and unit test coverage for new fields.

The PR adds placeOfAnc and placeOfAncId fields to the ANCVisit domain and DTO, but lacks:

  1. Database migration script (DDL) to add these columns to the t_anc_visit table
  2. Unit tests covering the new fields

Note: Service and repository layers handle the new fields automatically through ModelMapper mapping between DTO and entity.

Comment on lines +170 to +174
@Column (name = "place_of_anc")
private String placeOfAnc;

@Column(name = "place_of_ancId")
private Integer placeOfAncId;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix column naming inconsistency in place_of_ancId.

Line 173 uses place_of_ancId which breaks the snake_case naming convention used throughout this entity. All similar ID columns follow the pattern field_name_id in lowercase:

  • Line 152: place_of_death_id
  • Line 125: method_of_termination_id
  • Line 131: termination_done_by_id

The column name should be place_of_anc_id (all lowercase) to maintain consistency.

🔎 Proposed fix
 @Column (name = "place_of_anc")
 private String placeOfAnc;

-@Column(name = "place_of_ancId")
+@Column(name = "place_of_anc_id")
 private Integer placeOfAncId;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@Column (name = "place_of_anc")
private String placeOfAnc;
@Column(name = "place_of_ancId")
private Integer placeOfAncId;
@Column (name = "place_of_anc")
private String placeOfAnc;
@Column(name = "place_of_anc_id")
private Integer placeOfAncId;
🤖 Prompt for AI Agents
In src/main/java/com/iemr/flw/domain/iemr/ANCVisit.java around lines 170 to 174,
the @Column name for placeOfAncId is "place_of_ancId" which breaks the
snake_case convention used elsewhere; change the @Column name to
"place_of_anc_id" (all lowercase with underscore before id) so it matches the
existing pattern for ID columns and update any related DB mappings or
migration/DDL if necessary.

@SauravBizbRolly SauravBizbRolly merged commit be0ccda into sm/release-3.10.0_temp Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant