Search in sources :

Example 31 with IssueSeverity

use of org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity in project nia-patient-switching-standard-adaptor by NHSDigital.

the class OperationOutcomeUtils method createOperationOutcome.

public static OperationOutcome createOperationOutcome(IssueType type, IssueSeverity severity, CodeableConcept details, String diagnostics) {
    var operationOutcome = new OperationOutcome();
    Meta meta = new Meta();
    meta.setProfile(Collections.singletonList(new UriType(URI_TYPE)));
    operationOutcome.setMeta(meta);
    operationOutcome.addIssue().setCode(type).setSeverity(severity).setDetails(details).setDiagnostics(diagnostics);
    return operationOutcome;
}
Also used : Meta(org.hl7.fhir.dstu3.model.Meta) OperationOutcome(org.hl7.fhir.dstu3.model.OperationOutcome) UriType(org.hl7.fhir.dstu3.model.UriType)

Aggregations

ValidationMessage (org.hl7.fhir.utilities.validation.ValidationMessage)12 ArrayList (java.util.ArrayList)9 IssueSeverity (org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity)9 FHIRFormatError (org.hl7.fhir.exceptions.FHIRFormatError)5 FHIRException (org.hl7.fhir.exceptions.FHIRException)4 JsonObject (com.google.gson.JsonObject)3 File (java.io.File)2 FileNotFoundException (java.io.FileNotFoundException)2 IOException (java.io.IOException)2 OperationOutcome (org.hl7.fhir.r4.model.OperationOutcome)2 ValidationResult (org.hl7.fhir.r4b.context.IWorkerContext.ValidationResult)2 ConceptDefinitionComponent (org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionComponent)2 ValidationResult (org.hl7.fhir.r5.context.IWorkerContext.ValidationResult)2 ConceptDefinitionComponent (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent)2 TextFile (org.hl7.fhir.utilities.TextFile)2 JsonNull (com.google.gson.JsonNull)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 Meta (org.hl7.fhir.dstu3.model.Meta)1 OperationOutcome (org.hl7.fhir.dstu3.model.OperationOutcome)1 UriType (org.hl7.fhir.dstu3.model.UriType)1