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);
}
}