use of org.hl7.fhir.r4.model.OperationOutcome.IssueType in project org.hl7.fhir.core by hapifhir.
the class BaseValidator method warningOrHint.
/**
* Test a rule and add a {@link IssueSeverity#WARNING} validation message if the validation fails
*
* @param thePass
* Set this parameter to <code>false</code> if the validation does not pass
* @return Returns <code>thePass</code> (in other words, returns <code>true</code> if the rule did not fail validation)
*/
protected boolean warningOrHint(List<ValidationMessage> errors, IssueType type, String path, boolean thePass, boolean warning, String msg, Object... theMessageArguments) {
if (!thePass) {
String message = context.formatMessage(msg, theMessageArguments);
IssueSeverity lvl = warning ? IssueSeverity.WARNING : IssueSeverity.INFORMATION;
if (doingLevel(lvl)) {
addValidationMessage(errors, type, -1, -1, path, message, lvl, null);
}
}
return thePass;
}
use of org.hl7.fhir.r4.model.OperationOutcome.IssueType in project org.hl7.fhir.core by hapifhir.
the class BaseValidator method txRule.
protected boolean txRule(List<ValidationMessage> errors, String txLink, IssueType type, int line, int col, String path, boolean thePass, String theMessage, Object... theMessageArguments) {
if (!thePass && doingErrors()) {
String message = context.formatMessage(theMessage, theMessageArguments);
ValidationMessage vm = new ValidationMessage(Source.TerminologyEngine, type, line, col, path, message, IssueSeverity.ERROR).setMessageId(theMessage);
if (checkMsgId(theMessage, vm)) {
errors.add(vm.setTxLink(txLink));
}
}
return thePass;
}
use of org.hl7.fhir.r4.model.OperationOutcome.IssueType in project org.hl7.fhir.core by hapifhir.
the class BaseValidator method suppressedwarning.
/**
* Test a rule and add a {@link IssueSeverity#WARNING} validation message if the validation fails
*
* @param thePass
* Set this parameter to <code>false</code> if the validation does not pass
* @return Returns <code>thePass</code> (in other words, returns <code>true</code> if the rule did not fail validation)
*/
protected boolean suppressedwarning(List<ValidationMessage> errors, IssueType type, String path, boolean thePass, String msg, String html) {
if (!thePass && doingWarnings()) {
IssueSeverity severity = IssueSeverity.INFORMATION;
addValidationMessage(errors, type, path, msg, html, severity, null);
}
return thePass;
}
use of org.hl7.fhir.r4.model.OperationOutcome.IssueType 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;
}
use of org.hl7.fhir.r4.model.OperationOutcome.IssueType in project MobileAccessGateway by i4mi.
the class BasePMIRResponseConverter method error.
public OperationOutcome error(IssueType type, String diagnostics) {
OperationOutcome result = new OperationOutcome();
OperationOutcomeIssueComponent issue = result.addIssue();
issue.setSeverity(OperationOutcome.IssueSeverity.ERROR);
issue.setCode(type);
issue.setDiagnostics(diagnostics);
return result;
}
Aggregations