Commit 26032ed
Merge 3.8.2 code (#177)
* feat: write anthropometry from rmnch/syncDataToAmrit to i_beneficiarydetails.otherFields
Mobile sends height/weight/bmi/temperature in beneficiaryDetails payload.
i_beneficiarydetails_rmnch has no these columns so they were lost.
FLW-API getBeneficiaryData reads from otherFields (temperatureValue key).
- RMNCHBeneficiaryDetailsRmnch: @transient height/weight/bmi/temperature
- BenDetailRepo: updateOtherFieldsByBenRegId query
- RmnchDataSyncServiceImpl: merge anthropometry into otherFields after save
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: stamp vanID from Redis on all 4 RMNCH entities in syncDataToAmrit
Reads camp:vanID and camp:parkingPlaceID from Redis (written by MMU-API
on van login) and stamps them onto RMNCHBeneficiaryDetailsRmnch,
RMNCHBornBirthDetails, RMNCHCBACdetails, and RMNCHHouseHoldDetails when
the mobile payload carries VanID=null or 0. Also writes anthropometry
(height/weight/bmi/temperature) from mobile beneficiaryDetails payload
into i_beneficiarydetails.otherFields so FLW-API getBeneficiaryData can
return them. Gracefully skips if Redis has no camp configured.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: preserve @transient anthropometry fields lost after JPA saveAll merge
Hibernate merge() returns new managed instances that do not carry
@transient field values (height/weight/bmi/temperature). Keep a
reference to the original list before saveAll so the anthropometry
loop reads from objects that still have the mobile payload values.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: prevent camp:vanID deletion on every syncDataToAmrit call
getObject("camp:vanID", false, 0) was calling EXPIRE key 0 which
immediately deletes the key in Redis after every sync. Replaced with
getRaw() which reads the value without modifying TTL, so camp:vanID
persists across multiple syncs until MMU logout.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(stoptb): add stoptb.enforce.vanid flag to syncDataToAmrit
The Stop TB mobile app calls this RMNCH sync endpoint directly to save
household details. Same issue as elsewhere: vanID stamping is skipped
silently when Redis has no camp:vanID, so household records end up
with vanID=NULL. When stoptb.enforce.vanid=true, sync now fails with a
clear error instead.
* feat(STOP-148): add GPS location capture support for beneficiary and RMNCH records
Introduces GPS-related fields (gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable, and gpsUnavailableReason) across beneficiary address and RMNCH domain models, including MBeneficiaryaddress, Address DTO, RMNCHBeneficiaryDetailsRmnch, and RMNCHHouseHoldDetails.
Enhances IdentityMapper and IdentityService to map and persist GPS information between incoming DTOs and beneficiary address entities.
Updates RmnchDataSyncServiceImpl to extract and synchronize GPS details from the nested i_bendemographics payload during beneficiary sync, and to parse gpsTimestamp from household details during RMNCH household data processing.
* feat(STOP-148): add GPS location capture support for beneficiary and RMNCH records (#167)
Introduces GPS-related fields (gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable, and gpsUnavailableReason) across beneficiary address and RMNCH domain models, including MBeneficiaryaddress, Address DTO, RMNCHBeneficiaryDetailsRmnch, and RMNCHHouseHoldDetails.
Enhances IdentityMapper and IdentityService to map and persist GPS information between incoming DTOs and beneficiary address entities.
Updates RmnchDataSyncServiceImpl to extract and synchronize GPS details from the nested i_bendemographics payload during beneficiary sync, and to parse gpsTimestamp from household details during RMNCH household data processing.
Co-authored-by: Sehjot Singh Pannu <sehjot.singh@unthinkable.co>
* fix(STOP-148): use InputMapper Gson for createIdentity to parse epoch-millis gpsTimestamp
createIdentity() parsed the request body with a bare new Gson(), whose
default Timestamp adapter only accepts ISO8601 date strings. The new
gpsTimestamp field is sent as raw epoch millis, causing
JsonSyntaxException during parsing whenever GPS data is present. That
exception propagated up through JwtUserIdValidationFilter's catch
block and was misreported as a 401 Authorization error.
InputMapper already registers a Timestamp adapter that handles epoch
millis correctly; switch createIdentity() to use it.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(datasync): add vanID column to BenGenID import INSERT query
SQL had 6 placeholders but object array had 7 elements including vanID,
causing parameter index out of bounds error. Added vanID to INSERT columns.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(rmnch): surface pinCode in beneficiary details sync response
permPinCode was already stored correctly in i_beneficiaryaddress but
was never surfaced in the RMNCH sync response, since the response DTO
had no pinCode field and the address mapping never copied it across.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(dob): stop global Timestamp adapter from nulling dob on GPS-enabled endpoints
The GPS feature (STOP-148) registered a custom Gson TypeAdapter<Timestamp>
globally on InputMapper's GsonBuilder to parse the new gpsTimestamp field.
Because it was global, it also intercepted dob, silently returning null
whenever the incoming date string didn't match one of its four hardcoded
formats.
- Add GpsTimestampAdapter, attached only via @JsonAdapter on the gpsTimestamp
field (Address, RMNCHBeneficiaryDetailsRmnch, RMNCHHouseHoldDetails), so it
can't affect any other Timestamp field.
- Remove the global registerTypeAdapter(Timestamp.class, ...) from both
InputMapper.java copies, restoring Gson's default Timestamp parsing for
dob and everything else (matching vb/stoptb).
- Revert createIdentity()'s parser back to a bare new Gson(), matching
Common-API's RegisterBenificiaryServiceImpl, which also serializes the
outgoing identity payload with a bare new Gson(). InputMapper's
setDateFormat is incompatible with that wire format (non-zero-padded day),
which is why dob was nulling specifically for beneficiaries born on the
1st-9th of a month once createIdentity switched to InputMapper's Gson.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Sehjot Singh Pannu <sehjot.singh@unthinkable.co>1 parent 5696472 commit 26032ed
16 files changed
Lines changed: 618 additions & 214 deletions
File tree
- src/main
- environment
- java/com/iemr/common/identity
- controller
- data/rmnch
- domain
- mapper
- repo
- service
- rmnch
- utils
- mapper
- redis
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
608 | 608 | | |
609 | 609 | | |
610 | 610 | | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
611 | 616 | | |
612 | 617 | | |
613 | 618 | | |
| |||
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
390 | 392 | | |
391 | 393 | | |
392 | 394 | | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
393 | 398 | | |
394 | 399 | | |
395 | 400 | | |
| |||
557 | 562 | | |
558 | 563 | | |
559 | 564 | | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
560 | 606 | | |
Lines changed: 51 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
38 | | - | |
| 41 | + | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
| |||
359 | 362 | | |
360 | 363 | | |
361 | 364 | | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
362 | 392 | | |
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
26 | 31 | | |
27 | 32 | | |
28 | 33 | | |
| |||
51 | 56 | | |
52 | 57 | | |
53 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
54 | 66 | | |
Lines changed: 39 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
263 | 281 | | |
264 | 282 | | |
265 | 283 | | |
| |||
0 commit comments