Skip to content

fix(pdq): guard null otherDataPoints in loadSearchQuery - #67

Merged
mherman22 merged 1 commit into
IsantePlus:mainfrom
mherman22:fix/pdq-null-otherdatapoints
Jul 8, 2026
Merged

mherman22 merged 1 commit into
IsantePlus:mainfrom
mherman22:fix/pdq-null-otherdatapoints

Conversation

@mherman22

Copy link
Copy Markdown

Problem

FhirMpiClientServiceImpl.loadSearchQuery throws NullPointerException when otherDataPoints is null, aborting every FHIR PDQ patient search before any request is sent (and marking the transaction rollback-only).

It happens on the standard MPI similar-patient path: registrationcore calls findPreciseSimilarPatients(patient, null, ...), so otherDataPoints arrives null, and loadSearchQuery dereferences it:

String localBiometricSubjectId   = (String) otherDataPoints.get("localBiometricSubjectId");
String nationalBiometricSubjectId = (String) otherDataPoints.get("nationalBiometricSubjectId");
String phoneNumber               = (String) otherDataPoints.get("phoneNumber");
NullPointerException at FhirMpiClientServiceImpl.loadSearchQuery(...:349)
  ← searchPatient(...:230) ← MpiClientServiceImpl.searchPatient(...:91)
  ← registrationcore FhirSimilarPatientsSearcher.find(...:43)

Fix

Treat a null otherDataPoints as an empty map at the top of loadSearchQuery. One guard; no behavior change when the map is supplied.

Impact

FHIR PDQ patient search / MPI similar-patient lookup no longer NPEs when called without extra data points; the query is built and sent to the MPI as expected.

@mherman22
mherman22 merged commit da33b07 into IsantePlus:main Jul 8, 2026
1 check passed
@mherman22
mherman22 deleted the fix/pdq-null-otherdatapoints branch July 8, 2026 08:02
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