Page Status: updated 2023-01-27

Operation Outcome - Reply

Page index

Introduction

This page contains a few examples of different error scenarios and the response in those cases.

See OperationOutcome for more information about the OperationOutcome resource and Error handling for general information about error handling when communicating with the Swedish national Medication List.

Examples

Create prescription with AFF-issues

This example shows what an OperationOutcome looks like if there are rejection AFF-issues when creating a prescription. The HTTP status in this case would be 422 and no prescription had been created.

Note that if there had only been warnings, the prescription would have been created and then the HTTP status would have been 201. An OperationOutcome would then be returned only if requested by setting the header prefer to "return = OperationOutcome".

Create MedicationRequest with AFF-issues

Update multiple prescriptions in one transaction with AFF-warnings

This example shows what an OperationOutcome looks like when it is contained in a Bundle. This is the case if transaction has succeeded, but there are warnings regarding an entry. The HTTP status in this case would be 200. Examples of requests containing Bundles are available on the page Prescription - Transaction Bundle

Note that if there had been errors, an OperationOutcome would have been returned containing the errors with pointers to which entry in the submitted bundle caused the error. This is illustrated in Create dispense with AFF-errors

Update multiple MedicationRequests with AFF-warnings

Create dispense with AFF-errors

This example shows what an OperationOutcome looks like if there are rejection AFF-issues when dispatching a set of prescriptions, i.e. a Bundle of MedicationDispenses (NLLDispatch). The HTTP status would in this case be 422 and no MedicationDispenses had been created.

Each AFF error points to the related record in the bundle in two ways, via the NLLDispatchRowNo extension and via the FHIR path in issue.expression. The expression points to an entry in the bundle via its index. NLLDispatchRowNo points to a record in the bundle via the unique dispatch row number defined by the requester. This allows the caller to use a standard FHIR parser and map the problem to the expression or association.

Create multiple MedicationDispenses with AFF-errors

Application error

This example shows what an OperationOutcome looks like if the request is rejected by a business rule. The HTTP status would in this case be 400.

In this kind of errors OperationOutcome.issue.details contains an error code and the display element an error text.

OperationOutcome with an application error

System error without error code

This example shows what an OperationOutcome looks like if the request is rejected by the FHIR parser, that is before the call is handled by logic specific to the National Medication List. The HTTP status would in this case be 500.

Note that OperationOutcome.issue.details is missing in this case because it was a parser error.

OperationOutcome with a system error

Low level system error

This example shows a low level error, i.e. a system error. The Content-Type is "text/html" in this case and the HTTP status 503.

Low level system error