@Override protected IBaseOperationOutcome createOperationOutcome(String theSeverity, String theMessage, String theCode) { OperationOutcome oo = new OperationOutcome(); OperationOutcomeIssueComponent issue = oo.addIssue(); issue.getSeverityElement().setValueAsString(theSeverity); issue.setDiagnostics(theMessage); try { issue.setCode(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.fromCode(theCode)); } catch (FHIRException e) { ourLog.error("Unknown code: {}", theCode); } return oo; }
public static org.hl7.fhir.dstu3.model.OperationOutcome convertOperationOutcome(org.hl7.fhir.dstu2016may.model.OperationOutcome src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.OperationOutcome tgt = new org.hl7.fhir.dstu3.model.OperationOutcome(); copyDomainResource(src, tgt); for (org.hl7.fhir.dstu2016may.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); return tgt; }
public org.hl7.fhir.dstu3.model.OperationOutcome convertOperationOutcome(org.hl7.fhir.instance.model.OperationOutcome src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.OperationOutcome tgt = new org.hl7.fhir.dstu3.model.OperationOutcome(); copyDomainResource(src, tgt); for (org.hl7.fhir.instance.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); return tgt; }
@Patch public OperationOutcome patientPatch(@IdParam IdType theId, PatchTypeEnum thePatchType, @ResourceParam String theBody) { if (thePatchType == PatchTypeEnum.JSON_PATCH) { // do something } if (thePatchType == PatchTypeEnum.XML_PATCH) { // do something } OperationOutcome retVal = new OperationOutcome(); retVal.getText().setDivAsString("<div>OK</div>"); return retVal; } //END SNIPPET: patch
@Override public void populateEntryWithOperationOutcome(BaseServerResponseException theCaughtEx, Bundle.BundleEntryComponent theEntry) { OperationOutcome oo = new OperationOutcome(); oo.addIssue().setSeverity(OperationOutcome.IssueSeverity.ERROR).setDiagnostics(theCaughtEx.getMessage()); theEntry.getResponse().setOutcome(oo); }
/** * @deprecated Use Reference#setResource(IBaseResource) instead */ @Deprecated public OperationOutcome addEvaluationMessageTarget() { OperationOutcome r = new OperationOutcome(); if (this.evaluationMessageTarget == null) this.evaluationMessageTarget = new ArrayList<OperationOutcome>(); this.evaluationMessageTarget.add(r); return r; }
@Validate public MethodOutcome validatePatient(@ResourceParam Patient thePatient, @Validate.Mode ValidationModeEnum theMode, @Validate.Profile String theProfile) { // Actually do our validation: The UnprocessableEntityException // results in an HTTP 422, which is appropriate for business rule failure if (thePatient.getIdentifierFirstRep().isEmpty()) { /* It is also possible to pass an OperationOutcome resource * to the UnprocessableEntityException if you want to return * a custom populated OperationOutcome. Otherwise, a simple one * is created using the string supplied below. */ throw new UnprocessableEntityException("No identifier supplied"); } // This method returns a MethodOutcome object MethodOutcome retVal = new MethodOutcome(); // You may also add an OperationOutcome resource to return // This part is optional though: OperationOutcome outcome = new OperationOutcome(); outcome.addIssue().setSeverity(IssueSeverity.WARNING).setDiagnostics("One minor issue detected"); retVal.setOperationOutcome(outcome); return retVal; } //END SNIPPET: validate
OperationOutcome outcome = new OperationOutcome(); outcome.addIssue().setDiagnostics("One minor issue detected"); retVal.setOperationOutcome(outcome);
OperationOutcome outcome = new OperationOutcome(); outcome.addIssue().setDiagnostics("One minor issue detected"); retVal.setOperationOutcome(outcome);
/** * @return {@link #details} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Full details of any issues found in the message.) */ public OperationOutcome getDetailsTarget() { if (this.detailsTarget == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create MessageHeaderResponseComponent.details"); else if (Configuration.doAutoCreate()) this.detailsTarget = new OperationOutcome(); // aa return this.detailsTarget; }
public OperationOutcome copy() { OperationOutcome dst = new OperationOutcome(); copyValues(dst); if (issue != null) { dst.issue = new ArrayList<OperationOutcomeIssueComponent>(); for (OperationOutcomeIssueComponent i : issue) dst.issue.add(i.copy()); }; return dst; }
OperationOutcome oo = new OperationOutcome(); oo.addIssue().setSeverity(IssueSeverity.INFORMATION).setDiagnostics("Ok to delete"); return new MethodOutcome(new IdType(theId.getValue()), oo);
@Override protected IBaseOperationOutcome createOperationOutcome(String theSeverity, String theMessage, String theCode) { OperationOutcome oo = new OperationOutcome(); OperationOutcomeIssueComponent issue = oo.addIssue(); issue.getSeverityElement().setValueAsString(theSeverity); issue.setDiagnostics(theMessage); try { issue.setCode(org.hl7.fhir.dstu3.model.OperationOutcome.IssueType.fromCode(theCode)); } catch (FHIRException e) { ourLog.error("Unknown code: {}", theCode); } return oo; }
public static org.hl7.fhir.dstu3.model.OperationOutcome convertOperationOutcome(org.hl7.fhir.dstu2016may.model.OperationOutcome src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.OperationOutcome tgt = new org.hl7.fhir.dstu3.model.OperationOutcome(); copyDomainResource(src, tgt); for (org.hl7.fhir.dstu2016may.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); return tgt; }
public org.hl7.fhir.dstu3.model.OperationOutcome convertOperationOutcome(org.hl7.fhir.instance.model.OperationOutcome src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.OperationOutcome tgt = new org.hl7.fhir.dstu3.model.OperationOutcome(); copyDomainResource(src, tgt); for (org.hl7.fhir.instance.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); return tgt; }
@Override public void populateEntryWithOperationOutcome(BaseServerResponseException theCaughtEx, Bundle.BundleEntryComponent theEntry) { OperationOutcome oo = new OperationOutcome(); oo.addIssue().setSeverity(OperationOutcome.IssueSeverity.ERROR).setDiagnostics(theCaughtEx.getMessage()); theEntry.getResponse().setOutcome(oo); }
return new EpisodeOfCare(); if ("OperationOutcome".equals(name)) return new OperationOutcome(); if ("Procedure".equals(name)) return new Procedure();
public static <T extends BaseServerResponseException> T exception(Function<String, T> func, OperationOutcome.IssueSeverity severity, OperationOutcome.IssueType type, String code, String diagnostics, String msg, Object... args) { OperationOutcome operationOutcome = new OperationOutcome(); CodeableConcept errorCode = null; if (code != null) { errorCode = new CodeableConcept(); errorCode.addCoding().setCode(code); } operationOutcome.addIssue() .setSeverity(severity) .setCode(type) .setDetails(errorCode) .setDiagnostics(diagnostics); return exception(func, operationOutcome, msg, args); }
OperationOutcome oo = new OperationOutcome(); oo.addIssue().setSeverity(IssueSeverity.INFORMATION).setDiagnostics("Ok to delete"); return new MethodOutcome(new IdType(theId.getValue()), oo);
case 1790214156: return new Observation(); case -2140710406: return new OperationDefinition(); case -526550005: return new OperationOutcome(); case 1343242579: return new Organization(); case 671337916: return new ParameterDefinition();