r4/parse_request_result library

Functions

incorrectResultType<T>(Resource result) → OperationOutcome
Returns an OperationOutcome that contains the given Resource and a message stating that it was not the type of resource that was specified
isInformational(OperationOutcome operationOutcome) bool
parseBundle(Bundle bundle) ReturnResults<Resource>
Extracts all Resources that were returned by the Bundle, as long as they aren't OperationOutcomes, and includes all entries as informational OperationOutcomes that don't contain a Resource
parseBundleForType<T>(Bundle bundle) ReturnResults<T>
Extracts all Resources that were returned by the Bundle as long as they are of type T
parseRequestResult(Resource result) ReturnResults<Resource>
There are usually 3 types of responses from a RESTful request made to a FHIR server. It can be a single Resource, it can be a Bundle, or it can be an OperationOutcome (usually indicating an error). The functions below return an object called ReturnResults. It contains 3 lists.
parseRequestResultForType<T>(Resource result) ReturnResults<T>
If you searched or requested only a specific type of result, this will perform similarly to above, but will return ONLY that type of resource in the resources field, others will be included in the otherResources as well as in an OperationOutcome as a contained resource