String message = "Transaction Bundle did not specify valid Bundle.type, assuming " + Bundle.BundleType.TRANSACTION.toCode(); ourLog.warn(message); transactionType = org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTION.toCode();
@Override protected void preProcessResourceForStorage(Bundle theResource) { super.preProcessResourceForStorage(theResource); Set<String> allowedBundleTypes = getConfig().getBundleTypesAllowedForStorage(); if (theResource.getType() == null || !allowedBundleTypes.contains(defaultString(theResource.getType().toCode()))) { String message = "Unable to store a Bundle resource on this server with a Bundle.type value of: " + (theResource.getType() != null ? theResource.getType().toCode() : "(missing)"); throw new UnprocessableEntityException(message); } }
String message = "Transaction Bundle did not specify valid Bundle.type, assuming " + Bundle.BundleType.TRANSACTION.toCode(); ourLog.warn(message); transactionType = org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTION.toCode();
/** * Validates bundle type, meta data and consistency of contained resources * * @param bundle transaction bundle */ protected void validateTransactionBundle(Bundle bundle) { if (!Bundle.BundleType.TRANSACTION.equals(bundle.getType())) { throw FhirUtils.unprocessableEntity( OperationOutcome.IssueSeverity.ERROR, OperationOutcome.IssueType.INVALID, null, null, "Bundle type must be %s, but was %s", Bundle.BundleType.TRANSACTION.toCode(), bundle.getType().toCode()); } List<UriType> profiles = bundle.getMeta().getProfile(); if (profiles.isEmpty() || !Iti65Constants.ITI65_PROFILE.equals(profiles.get(0).getValue())) { throw FhirUtils.unprocessableEntity( OperationOutcome.IssueSeverity.ERROR, OperationOutcome.IssueType.INVALID, null, null, "Request bundle must have profile", Iti65Constants.ITI65_PROFILE); } }
@Override protected void preProcessResourceForStorage(Bundle theResource) { super.preProcessResourceForStorage(theResource); Set<String> allowedBundleTypes = getConfig().getBundleTypesAllowedForStorage(); if (theResource.getType() == null || !allowedBundleTypes.contains(defaultString(theResource.getType().toCode()))) { String message = "Unable to store a Bundle resource on this server with a Bundle.type value of: " + (theResource.getType() != null ? theResource.getType().toCode() : "(missing)"); throw new UnprocessableEntityException(message); } }
@Override public String getBundleType(Bundle theRequest) { if (theRequest.getType() == null) { return null; } return theRequest.getTypeElement().getValue().toCode(); }
@Override public String getBundleType(Bundle theRequest) { if (theRequest.getType() == null) { return null; } return theRequest.getTypeElement().getValue().toCode(); }