001package ca.uhn.fhir.model.api; 002 003/*- 004 * #%L 005 * HAPI FHIR - Core Library 006 * %% 007 * Copyright (C) 2014 - 2023 Smile CDR, Inc. 008 * %% 009 * Licensed under the Apache License, Version 2.0 (the "License"); 010 * you may not use this file except in compliance with the License. 011 * You may obtain a copy of the License at 012 * 013 * http://www.apache.org/licenses/LICENSE-2.0 014 * 015 * Unless required by applicable law or agreed to in writing, software 016 * distributed under the License is distributed on an "AS IS" BASIS, 017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 018 * See the License for the specific language governing permissions and 019 * limitations under the License. 020 * #L% 021 */ 022 023/** 024 * This enum contains the allowable codes in the HAPI FHIR defined 025 * codesystem: https://hapifhir.io/fhir/CodeSystem/hapi-fhir-storage-response-code 026 * 027 * This is used in CRUD response OperationOutcome resources. 028 */ 029public enum StorageResponseCodeEnum implements ICodingEnum { 030 031 SUCCESSFUL_CREATE("Create succeeded."), 032 SUCCESSFUL_CREATE_NO_CONDITIONAL_MATCH("Conditional create succeeded: no existing resource matched the conditional URL."), 033 SUCCESSFUL_CREATE_WITH_CONDITIONAL_MATCH("Conditional create succeeded: an existing resource matched the conditional URL so no action was taken."), 034 SUCCESSFUL_UPDATE("Update succeeded."), 035 SUCCESSFUL_UPDATE_AS_CREATE("Update as create succeeded."), 036 SUCCESSFUL_UPDATE_NO_CHANGE("Update succeeded: No changes were detected so no action was taken."), 037 SUCCESSFUL_UPDATE_NO_CONDITIONAL_MATCH("Conditional update succeeded: no existing resource matched the conditional URL so a new resource was created."), 038 SUCCESSFUL_UPDATE_WITH_CONDITIONAL_MATCH("Conditional update succeeded: an existing resource matched the conditional URL and was updated."), 039 SUCCESSFUL_UPDATE_WITH_CONDITIONAL_MATCH_NO_CHANGE("Conditional update succeeded: an existing resource matched the conditional URL and was updated, but no changes were detected so no action was taken."), 040 SUCCESSFUL_DELETE("Delete succeeded."), 041 SUCCESSFUL_DELETE_ALREADY_DELETED("Delete succeeded: Resource was already deleted so no action was taken."), 042 SUCCESSFUL_DELETE_NOT_FOUND("Delete succeeded: No existing resource was found so no action was taken."), 043 044 SUCCESSFUL_PATCH("Patch succeeded."), 045 046 SUCCESSFUL_PATCH_NO_CHANGE("Patch succeeded: No changes were detected so no action was taken."), 047 SUCCESSFUL_CONDITIONAL_PATCH("Conditional patch succeeded."), 048 SUCCESSFUL_CONDITIONAL_PATCH_NO_CHANGE("Conditional patch succeeded: No changes were detected so no action was taken."); 049 050 public static final String SYSTEM = "https://hapifhir.io/fhir/CodeSystem/hapi-fhir-storage-response-code"; 051 052 private final String myDisplay; 053 054 StorageResponseCodeEnum(String theDisplay) { 055 myDisplay = theDisplay; 056 } 057 058 @Override 059 public String getCode() { 060 return name(); 061 } 062 063 @Override 064 public String getSystem() { 065 return SYSTEM; 066 } 067 068 @Override 069 public String getDisplay() { 070 return myDisplay; 071 } 072}