incorrectResultType<T> function
OperationOutcome
incorrectResultType<T>(
- Resource result
Returns an OperationOutcome that contains the given Resource and a message stating that it was not the type of resource that was specified
Implementation
OperationOutcome incorrectResultType<T>(Resource result) => OperationOutcome(
contained: <Resource>[result],
issue: <OperationOutcomeIssue>[
OperationOutcomeIssue(
severity: FhirCode('error'),
code: FhirCode('structure'),
diagnostics:
'This request returned a bundle, and should have been a $T but '
'is a ${result.resourceTypeString}. The resource is contained in '
'this new and locally created OperationOutcome for '
'troubleshooting purposes',
),
],
);