Skip to content

Commit

Permalink
feat : add bundle session id for validate endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Shreeja jobin committed Feb 5, 2025
1 parent 9e0943c commit cff38b4
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,12 @@ public Object validateBundle(
LOG.info("FHIRController:Bundle Validate :: Getting shinny Urls from config - Before: ");
final var igPackages = appConfig.getIgPackages();
final var igVersion = appConfig.getIgVersion();
final var interactionId = InteractionsFilter.getActiveRequestEnc(request).requestId()
.toString();
final var sessionBuilder = engine.session()
.withSessionId(UUID.randomUUID().toString())
.onDevice(Device.createDefault())
.withInteractionId(InteractionsFilter.getActiveRequestEnc(request).requestId()
.toString())
.withInteractionId(interactionId)
.withPayloads(List.of(payload))
// .withTracer(tracer)
.withFhirProfileUrl(fhirProfileUrl)
Expand All @@ -317,7 +318,8 @@ public Object validateBundle(
+ appConfig.getOperationOutcomeHelpUrl(),
"validationResults",
session.getValidationResults(), "device",
session.getDevice()));
session.getDevice(),
"bundleSessionId", interactionId));
final var result = Map.of("OperationOutcome", opOutcome);
if (uaValidationStrategyJson != null) {
opOutcome.put("uaValidationStrategy",
Expand All @@ -335,6 +337,7 @@ public Object validateBundle(
LOG.error("FHIRController: Bundle Validate:: Validation failed", e);
return Map.of(
"resourceType", "OperationOutcome",
"bundleSessionId", interactionId,
"error", "Validation failed: " + e.getMessage());
} finally {
// Ensure the session is cleared to avoid memory leaks
Expand Down

0 comments on commit cff38b4

Please sign in to comment.