
Package ca.uhn.fhir.util
Class OperationOutcomeUtil
java.lang.Object
ca.uhn.fhir.util.OperationOutcomeUtil
Utilities for dealing with OperationOutcome resources across various model versions
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final StringNote: This code was added in FHIR R5, so theaddIssuemethods here will automatically convert it toOO_ISSUE_CODE_INFORMATIONALfor previous versions of FHIR.static final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddDetailsToIssue(FhirContext theFhirContext, IBase theIssue, String theSystem, String theCode) static voidaddDetailsToIssue(FhirContext theFhirContext, IBase theIssue, String theSystem, String theCode, String theText) static voidaddExpressionToIssue(FhirContext theContext, IBase theIssue, String theLocationExpression) Given an instance ofOperationOutcome.issue, adds a new instance ofOperationOutcome.issue.expressionwith the given string value.static IBaseaddIssue(FhirContext theCtx, IBaseOperationOutcome theOperationOutcome, String theSeverity, String theDiagnostics, String theLocation, String theCode) Add an issue to an OperationOutcomestatic IBaseaddIssue(FhirContext theCtx, IBaseOperationOutcome theOperationOutcome, String theSeverity, String theDiagnostics, String theLocation, String theCode, String theDetailSystem, String theDetailCode, String theDetailDescription) static voidaddIssueColExtensionToIssue(FhirContext theCtx, IBase theIssue, String theColumn) static voidaddIssueLineExtensionToIssue(FhirContext theCtx, IBase theIssue, String theLine) static IBaseaddIssueWithMessageId(FhirContext myCtx, IBaseOperationOutcome theOperationOutcome, String theSeverity, String theMessage, String theMessageId, String theLocation, String theCode) static voidaddLocationToIssue(FhirContext theContext, IBase theIssue, String theLocation) static voidaddMessageIdExtensionToIssue(FhirContext theCtx, IBase theIssue, String theMessageId) static IBaseOperationOutcomecreateOperationOutcome(String theSeverity, String theMessage, String theCode, FhirContext theFhirContext, StorageResponseCodeEnum theStorageResponseCode) static StringgetFirstIssueDetails(FhirContext theCtx, IBaseOperationOutcome theOutcome) Deprecated, for removal: This API element is subject to removal in a future version.static StringgetFirstIssueDiagnostics(FhirContext theCtx, IBaseOperationOutcome theOutcome) static StringgetFirstIssueLocation(FhirContext theCtx, IBaseOperationOutcome theOutcome) static intgetIssueCount(FhirContext theCtx, IBaseOperationOutcome theOutcome) static StringgetIssueDiagnostics(FhirContext theCtx, IBaseOperationOutcome theOutcome, int theIndex) static booleanhasIssues(FhirContext theCtx, IBaseOperationOutcome theOutcome) Returns true if the given OperationOutcome has 1 or more Operation.issue repetitionsstatic booleanhasIssuesOfSeverity(FhirContext theCtx, IBaseOperationOutcome theOutcome, String theSeverity) static IBaseOperationOutcomenewInstance(FhirContext theCtx)
-
Field Details
-
OO_SEVERITY_ERROR
- See Also:
-
OO_SEVERITY_INFO
- See Also:
-
OO_SEVERITY_WARN
- See Also:
-
OO_ISSUE_CODE_INFORMATIONAL
- See Also:
-
OO_ISSUE_CODE_SUCCESS
Note: This code was added in FHIR R5, so theaddIssuemethods here will automatically convert it toOO_ISSUE_CODE_INFORMATIONALfor previous versions of FHIR.- Since:
- 8.6.0
- See Also:
-
OO_ISSUE_CODE_PROCESSING
- Since:
- 8.6.0
- See Also:
-
-
Constructor Details
-
OperationOutcomeUtil
public OperationOutcomeUtil()
-
-
Method Details
-
addIssue
public static IBase addIssue(FhirContext theCtx, IBaseOperationOutcome theOperationOutcome, String theSeverity, String theDiagnostics, String theLocation, String theCode) Add an issue to an OperationOutcome- Parameters:
theCtx- The fhir contexttheOperationOutcome- The OO resource to add totheSeverity- The severity (fatal | error | warning | information)theDiagnostics- The diagnostics string (this was called "details" in FHIR DSTU2 but was renamed to diagnostics in DSTU3)theCode- A code, such asOO_ISSUE_CODE_INFORMATIONALorOO_ISSUE_CODE_SUCCESS- Returns:
- Returns the newly added issue
-
addIssue
-
getFirstIssueDetails
@Deprecated(forRemoval=true, since="8.2.0") public static String getFirstIssueDetails(FhirContext theCtx, IBaseOperationOutcome theOutcome) Deprecated, for removal: This API element is subject to removal in a future version.UsegetFirstIssueDiagnostics(FhirContext, IBaseOperationOutcome)instead. This method has always been misnamed for historical reasons. -
getFirstIssueDiagnostics
-
getIssueDiagnostics
public static String getIssueDiagnostics(FhirContext theCtx, IBaseOperationOutcome theOutcome, int theIndex) -
getFirstIssueLocation
-
hasIssues
Returns true if the given OperationOutcome has 1 or more Operation.issue repetitions -
getIssueCount
-
hasIssuesOfSeverity
public static boolean hasIssuesOfSeverity(FhirContext theCtx, IBaseOperationOutcome theOutcome, String theSeverity) -
newInstance
-
addLocationToIssue
-
addExpressionToIssue
public static void addExpressionToIssue(FhirContext theContext, IBase theIssue, String theLocationExpression) Given an instance ofOperationOutcome.issue, adds a new instance ofOperationOutcome.issue.expressionwith the given string value.- Parameters:
theContext- The FhirContext for the appropriate FHIR versiontheIssue- TheOperationOutcome.issueto add totheLocationExpression- The string to use as content
-
addIssueWithMessageId
public static IBase addIssueWithMessageId(FhirContext myCtx, IBaseOperationOutcome theOperationOutcome, String theSeverity, String theMessage, String theMessageId, String theLocation, String theCode) -
addDetailsToIssue
public static void addDetailsToIssue(FhirContext theFhirContext, IBase theIssue, String theSystem, String theCode) -
addDetailsToIssue
public static void addDetailsToIssue(FhirContext theFhirContext, IBase theIssue, String theSystem, String theCode, String theText) -
addIssueLineExtensionToIssue
-
addIssueColExtensionToIssue
public static void addIssueColExtensionToIssue(FhirContext theCtx, IBase theIssue, String theColumn) -
addMessageIdExtensionToIssue
public static void addMessageIdExtensionToIssue(FhirContext theCtx, IBase theIssue, String theMessageId) -
createOperationOutcome
public static IBaseOperationOutcome createOperationOutcome(String theSeverity, String theMessage, String theCode, FhirContext theFhirContext, @Nullable StorageResponseCodeEnum theStorageResponseCode)
-
getFirstIssueDiagnostics(FhirContext, IBaseOperationOutcome)instead.