Fix test tx frmework to handle diagnostics correctly

This commit is contained in:
Grahame Grieve 2024-10-22 17:31:36 +10:30
parent c9c04aec3b
commit 533142cefd
2 changed files with 4 additions and 1 deletions

View File

@ -402,6 +402,7 @@ public class TxTester {
} catch (EFhirClientException e) {
code = e.getCode();
OperationOutcome oo = e.getServerError();
TxTesterScrubbers.scrubOO(oo, tight);
oo.setText(null);
pj = new org.hl7.fhir.r5.formats.JsonParser().setOutputStyle(OutputStyle.PRETTY).composeString(oo);
}

View File

@ -92,7 +92,9 @@ public class TxTesterScrubbers {
scrubDR(po, tight);
po.getIssue().removeIf(i -> i.hasDiagnostics() & !i.hasDetails());
for (OperationOutcomeIssueComponent iss : po.getIssue()) {
iss.setDiagnostics(null);
if (iss.hasDiagnostics() && !iss.getDiagnostics().toLowerCase().contains("x-request-id")) {
iss.setDiagnostics(null);
}
}
}