Skip to content

Feature/device integration#284

Open
sehjotsinghunthinkable wants to merge 40 commits into
PSMRI:vb/tracefrom
sehjotsinghunthinkable:feature/device-integration
Open

Feature/device integration#284
sehjotsinghunthinkable wants to merge 40 commits into
PSMRI:vb/tracefrom
sehjotsinghunthinkable:feature/device-integration

Conversation

@sehjotsinghunthinkable

Copy link
Copy Markdown

📋 Description

JIRA ID: STOP-133 : https://support.piramalfoundation.org/jira/browse/STOP-133

Integrated diagnostic device (X-ray/CAD/Trunat) results and document storage with the diagnostic order workflow

  • New feature (non-breaking change which adds functionality)

sehjotsinghunthinkable and others added 30 commits June 22, 2026 12:20
… a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
* Updated `/complete` to resolve `FormResponse` using `beneficiaryId` and `formUuid` from the request body, removing the dependency on `responseId` as a query parameter.
* Updated `/submitBulk` section editing to match `/complete` behavior by performing in-place `SectionResponse` upserts and per-question delete-and-reinsert operations, instead of deleting and recreating the entire section.
…cessed, syncedDate, syncedBy, syncFailureReason) to domain entities for offline mobile data collection support
…iciaries endpoint

- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
…iciaries endpoint

- Added `sectionName_hindi`, `questionText_hindi`, and `optionValue_hindi` fields to the FormSection, SectionQuestion, and QuestionOption entities to support Hindi localization.
- Added `GET /dynamicForm/response/getCompletedBeneficiaries?formType=` endpoint to return beneficiary IDs with `COMPLETE` status for the specified form type.
Add gpsLatitude, gpsLongitude, digipin, gpsTimestamp, and isGpsUnavailable
fields to RMNCHBeneficiaryDetailsRmnch and RMNCHHouseHoldDetails entities,
mapping to the columns written by Identity-API's /syncDataToAmrit endpoint.

Enable serializeNulls on the Gson builder in BeneficiaryServiceImpl so GPS
keys are always present in householdDetails and beneficiaryDetails — null
for web-registered records, real values for mobile-registered ones.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
  - BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
  - RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
  - RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
This reverts commit 3040a08077d82d27dfd86f29f0fbdd4dc094ec56.
  - BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
  - RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
  - RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
  - BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
  - RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
  - RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields

# Conflicts:
#	src/main/java/com/iemr/flw/domain/identity/RMNCHMBeneficiaryaddress.java
…NERAL_INFO consent gate ahead of the counselling sections.
…led lookup at TB_COUNSELLING_V2 instead of the retired V1 form
…t getCompletedBeneficiaries into completed/refused lists, and extract FormResponseStatus enum
…ard tables

- getBeneficiaryData now reads height/weight/bmi from t_phy_anthropometry
  and temperature/pulse/BP/RBS from t_phy_vitals (latest row per beneficiary)
- Fallback to otherFields if exam not yet saved for the beneficiary
- Stop TB specific fields (personFrom, caseFindingType etc.) still from otherFields
- Add findByBeneficiaryRegIDOrderByCreatedDateDesc and findByBenVisitID
  to BenAnthropometryRepo and BenPhysicalVitalRepo
- Add StopTB_Future_Roadmap.md for future HWC integration and edit support

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…outer loop variable

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…T NULL constraint violation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…PNC flows

If mobile does not send createdDate, ModelMapper leaves it null and MySQL
rejects the insert with NOT NULL constraint. Set server timestamp as fallback.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Without explicit timezone, Docker defaults to UTC. This causes LocalDate.now()
in getOrCreateVisitForToday() to use UTC date, so evening IST registrations
appear as next-day July 1 in DB and visit lookups fail after UTC midnight.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…age display

Timestamp.valueOf() throws on "yyyy-MM-dd HH:mm:ss.SSSZ" format because the
trailing Z is not a valid nanosecond value. Strip Z before parsing so mobile
DOB like "1987-07-01T00:00:00.000Z" is correctly stored in i_ben_flow_outreach.ben_dob.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rydetails.dob is null

Identity-API mapper (@mapping source=dto.dob) is commented out, causing dob to be
null for all mobile registrations. Fall back to ben_dob from i_ben_flow_outreach
so getBeneficiaryData returns correct DOB and mobile shows correct age.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
save() leaves VisitCode UPDATE pending in JPA session — t_benchiefcomplaint
INSERT runs before the UPDATE reaches DB, causing FK constraint failure and
full transaction rollback. saveAndFlush forces the UPDATE to DB immediately.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
vishwab1 and others added 9 commits July 7, 2026 10:53
…etailsOBJ.dob

benDetailsOBJ.dob (i_beneficiarydetails) is null for Stop TB mobile
registrations, which is why c22b3fd added a fallback that fills
benDetailsRMNCH_OBJ.dob from i_ben_flow_outreach. The age calculation
block still read the original, still-null benDetailsOBJ.dob, so dob
came back correct but age/ageFull stayed 0/"". Point it at the
already-corrected benDetailsRMNCH_OBJ.dob instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…tead of userId

Nurse and Counsellor are different logins hitting the same
/tb/suspected/getAll and /tb/confirmed/getAll endpoints, but both queries
filtered by the calling user's own userId. So a Counsellor pulling data
after a Nurse creates a Suspected/Confirmed record saw none of it - only
rows tied to their own login.

Adds an optional providerServiceMapID(+villageID)-scoped query path on
both endpoints, joined through the already-populated BenFlowStatus table
(same pattern as StopTBDiagnosticsRepo), so any role at the same
facility/village sees the same worklist. The old userId-based path is
kept as the fallback when the new fields aren't sent, so already-deployed
app builds are unaffected.
visitDate isn't the right dimension for a facility worklist - an
unresolved Suspected case from months ago is still actionable, and
filtering it out by date would hide it from the Counsellor, working
against the visibility fix in the previous commit. Also matches
StopTBDiagnosticsRepo's facility-scoped query, which never date-filters.
Old ashaId-based fallback path is untouched and still date-filters as
before.
…iaryRegID

TBSuspected.benId / TBConfirmedCase.benId store the person-level
beneficiary_id (e.g. 907797933607), not beneficiaryRegID (e.g. 35137) -
confirmed by querying i_ben_flow_outreach directly. The facility-scoped
query added in the previous two commits joined against
BenFlowStatus.beneficiaryRegID, so it never matched anything and always
returned empty. Switched the join to BenFlowStatus.beneficiaryID, which
is the correct corresponding column.
… a beneficiary has completed the TB Counselling form. Implemented using a single bulk query to avoid N+1 lookups against FormResponse.
This reverts commit 3040a08077d82d27dfd86f29f0fbdd4dc094ec56.
  - BeneficiaryServiceImpl.java — serializeNulls() + GPS fallback from address
  - RMNCHBeneficiaryDetailsRmnch.java — gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable fields
  - RMNCHHouseHoldDetails.java — gpsLatitude, gpsLongitude fields
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 41a96bc0-4995-401c-b635-9ec6892fa7ce

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.


# ── Diagnostic Device Integration ────────────────────────────────────────────
# diagnostic.active-provider must be one of com.iemr.flw.masterEnum.DiagnosticProviderCode (currently: EMRLITE)
diagnostic.active-provider=${DIAGNOSTIC_ACTIVE_PROVIDER}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please coordinate with @sac2kadam and ensure these new variables are added in DevOps repos.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Okay, i will connect with him

@drtechie

Copy link
Copy Markdown
Member

The branch is getting merged to @vishwab1's branch.
We should be merging to release-3.8.3 branch instead. I am not following the branch process followed.

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.

3 participants