Commit 7b06836
authored
LEGLINK-582: Omit the MeasureReport locator when the MeasureReport has no id (#1755)
resolveMeasureReport derives the ref's id from getIdElement().getIdPart(), which
returns null for a MeasureReport carrying no id. The locator guard only checked
that the ref itself was non-null, so a non-null ref with a null id reached
String.format and emitted
Bundle.entry[0].resource.ofType(MeasureReport).where(id = 'null').extension[0]
— valid FHIRPath that resolves to nothing. The issue still looked well-formed, so
a dead locator would ship in submitted output with nothing logged. The null-ref
path warned; the null-id path did not.
- Require a non-null id alongside the non-null ref, falling through to the
existing omission path. Broaden the warning to "No identifiable MeasureReport",
since it now covers both causes.
- Rename build_nullMeasureReportId_omitsLocatorButKeepsResultExpressions to
build_noMeasureReportRef_...: it passes null for the whole ref, so despite its
name it never covered a null id. That misnaming is why the gap survived review.
- Add build_measureReportWithNullId_... for the case the old name claimed, and
resolveMeasureReport_measureReportWithoutId_yieldsRefWithNullId to pin the
source of the null id, so the guard is re-examined rather than silently
orphaned if resolution ever starts synthesizing an id.
Raised by CodeRabbit on #1753 after it merged, hence the follow-up branch.
Testing: mvn -pl validation -am test on JDK 17, 131 tests pass (0 failures, 0
errors); PreQualOperationOutcomeBuilderTest grew 17 -> 19. The new null-id test
was confirmed to fail without the guard, reproducing where(id = 'null') exactly,
so it pins the fix rather than passing vacuously.1 parent c664e85 commit 7b06836
2 files changed
Lines changed: 36 additions & 3 deletions
File tree
- Java/validation/src
- main/java/com/lantanagroup/link/validation/services
- test/java/com/lantanagroup/link/validation/services
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
100 | 103 | | |
101 | 104 | | |
102 | 105 | | |
103 | | - | |
| 106 | + | |
104 | 107 | | |
105 | 108 | | |
106 | 109 | | |
| |||
Lines changed: 31 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
| 202 | + | |
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
211 | 228 | | |
212 | 229 | | |
213 | 230 | | |
214 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
215 | 245 | | |
216 | 246 | | |
217 | 247 | | |
| |||
0 commit comments