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.instance.model.OperationOutcome convertOperationOutcome(org.hl7.fhir.dstu3.model.OperationOutcome src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.OperationOutcome tgt = new org.hl7.fhir.instance.model.OperationOutcome(); copyDomainResource(src, tgt); for (org.hl7.fhir.dstu3.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
/** * @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; }
@Override public Base addChild(String name) throws FHIRException { if (name.equals("issue")) { return addIssue(); } else return super.addChild(name); }
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; }
@Override public Base setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case 100509913: // issue this.getIssue().add((OperationOutcomeIssueComponent) value); // OperationOutcomeIssueComponent return value; default: return super.setProperty(hash, name, value); } }
private void loadCache() throws FHIRFormatError, IOException { File[] files = new File(cacheFolder).listFiles(); for (File f : files) { if (f.getName().endsWith(".xml")) { final FileInputStream is = new FileInputStream(f); try { Resource r = context.newXmlParser().setOutputStyle(OutputStyle.PRETTY).parse(is); if (r instanceof OperationOutcome) { OperationOutcome oo = (OperationOutcome) r; expansions.put(ToolingExtensions.getExtension(oo,VS_ID_EXT).getValue().toString(), new ValueSetExpansionOutcome(new XhtmlComposer(XhtmlComposer.XML).composePlainText(oo.getText().getDiv()), TerminologyServiceErrorClass.UNKNOWN)); } else { ValueSet vs = (ValueSet) r; expansions.put(vs.getUrl(), new ValueSetExpansionOutcome(vs)); } } finally { IOUtils.closeQuietly(is); } } } }
protected OperationOutcome typedCopy() { return copy(); }
@Override public boolean equalsDeep(Base other_) { if (!super.equalsDeep(other_)) return false; if (!(other_ instanceof OperationOutcome)) return false; OperationOutcome o = (OperationOutcome) other_; return compareDeep(issue, o.issue, true); }
/** * @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; }
@Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case 100509913: return addIssue(); default: return super.makeProperty(hash, name); } }
@Override public EventOutcomeIndicator getEventOutcomeCodeFromOperationOutcome(OperationOutcome response) { if (!response.hasIssue()) { return EventOutcomeIndicator.Success; } // Find out the worst issue severity OperationOutcome.IssueSeverity severity = response.getIssue().stream() .map(OperationOutcome.OperationOutcomeIssueComponent::getSeverity) .min(Comparator.naturalOrder()) .orElse(OperationOutcome.IssueSeverity.NULL); switch (severity) { case FATAL: case ERROR: return EventOutcomeIndicator.MajorFailure; case WARNING: return EventOutcomeIndicator.MinorFailure; default: return EventOutcomeIndicator.Success; } }
@Override public Base setProperty(String name, Base value) throws FHIRException { if (name.equals("issue")) { this.getIssue().add((OperationOutcomeIssueComponent) value); } else return super.setProperty(name, value); return value; }
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; }
return new EpisodeOfCare(); if ("OperationOutcome".equals(name)) return new OperationOutcome(); if ("Procedure".equals(name)) return new Procedure();
public static org.hl7.fhir.dstu2016may.model.OperationOutcome convertOperationOutcome(org.hl7.fhir.dstu3.model.OperationOutcome src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.OperationOutcome tgt = new org.hl7.fhir.dstu2016may.model.OperationOutcome(); copyDomainResource(src, tgt); for (org.hl7.fhir.dstu3.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) tgt.addIssue(convertOperationOutcomeIssueComponent(t)); return tgt; }
@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; }