001package org.hl7.fhir.dstu2016may.model.codesystems; 002 003 004 005 006/* 007 Copyright (c) 2011+, HL7, Inc. 008 All rights reserved. 009 010 Redistribution and use in source and binary forms, with or without modification, 011 are permitted provided that the following conditions are met: 012 013 * Redistributions of source code must retain the above copyright notice, this 014 list of conditions and the following disclaimer. 015 * Redistributions in binary form must reproduce the above copyright notice, 016 this list of conditions and the following disclaimer in the documentation 017 and/or other materials provided with the distribution. 018 * Neither the name of HL7 nor the names of its contributors may be used to 019 endorse or promote products derived from this software without specific 020 prior written permission. 021 022 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 023 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 024 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 025 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 026 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 027 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 028 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 029 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 030 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 031 POSSIBILITY OF SUCH DAMAGE. 032 033*/ 034 035// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 036 037 038import org.hl7.fhir.exceptions.FHIRException; 039 040public enum AssertOperatorCodes { 041 042 /** 043 * Default value. Equals comparison. 044 */ 045 EQUALS, 046 /** 047 * Not equals comparison. 048 */ 049 NOTEQUALS, 050 /** 051 * Compare value within a known set of values. 052 */ 053 IN, 054 /** 055 * Compare value not within a known set of values. 056 */ 057 NOTIN, 058 /** 059 * Compare value to be greater than a known value. 060 */ 061 GREATERTHAN, 062 /** 063 * Compare value to be less than a known value. 064 */ 065 LESSTHAN, 066 /** 067 * Compare value is empty. 068 */ 069 EMPTY, 070 /** 071 * Compare value is not empty. 072 */ 073 NOTEMPTY, 074 /** 075 * Compare value string contains a known value. 076 */ 077 CONTAINS, 078 /** 079 * Compare value string does not contain a known value. 080 */ 081 NOTCONTAINS, 082 /** 083 * added to help the parsers 084 */ 085 NULL; 086 public static AssertOperatorCodes fromCode(String codeString) throws FHIRException { 087 if (codeString == null || "".equals(codeString)) 088 return null; 089 if ("equals".equals(codeString)) 090 return EQUALS; 091 if ("notEquals".equals(codeString)) 092 return NOTEQUALS; 093 if ("in".equals(codeString)) 094 return IN; 095 if ("notIn".equals(codeString)) 096 return NOTIN; 097 if ("greaterThan".equals(codeString)) 098 return GREATERTHAN; 099 if ("lessThan".equals(codeString)) 100 return LESSTHAN; 101 if ("empty".equals(codeString)) 102 return EMPTY; 103 if ("notEmpty".equals(codeString)) 104 return NOTEMPTY; 105 if ("contains".equals(codeString)) 106 return CONTAINS; 107 if ("notContains".equals(codeString)) 108 return NOTCONTAINS; 109 throw new FHIRException("Unknown AssertOperatorCodes code '"+codeString+"'"); 110 } 111 public String toCode() { 112 switch (this) { 113 case EQUALS: return "equals"; 114 case NOTEQUALS: return "notEquals"; 115 case IN: return "in"; 116 case NOTIN: return "notIn"; 117 case GREATERTHAN: return "greaterThan"; 118 case LESSTHAN: return "lessThan"; 119 case EMPTY: return "empty"; 120 case NOTEMPTY: return "notEmpty"; 121 case CONTAINS: return "contains"; 122 case NOTCONTAINS: return "notContains"; 123 case NULL: return null; 124 default: return "?"; 125 } 126 } 127 public String getSystem() { 128 return "http://hl7.org/fhir/assert-operator-codes"; 129 } 130 public String getDefinition() { 131 switch (this) { 132 case EQUALS: return "Default value. Equals comparison."; 133 case NOTEQUALS: return "Not equals comparison."; 134 case IN: return "Compare value within a known set of values."; 135 case NOTIN: return "Compare value not within a known set of values."; 136 case GREATERTHAN: return "Compare value to be greater than a known value."; 137 case LESSTHAN: return "Compare value to be less than a known value."; 138 case EMPTY: return "Compare value is empty."; 139 case NOTEMPTY: return "Compare value is not empty."; 140 case CONTAINS: return "Compare value string contains a known value."; 141 case NOTCONTAINS: return "Compare value string does not contain a known value."; 142 case NULL: return null; 143 default: return "?"; 144 } 145 } 146 public String getDisplay() { 147 switch (this) { 148 case EQUALS: return "equals"; 149 case NOTEQUALS: return "notEquals"; 150 case IN: return "in"; 151 case NOTIN: return "notIn"; 152 case GREATERTHAN: return "greaterThan"; 153 case LESSTHAN: return "lessThan"; 154 case EMPTY: return "empty"; 155 case NOTEMPTY: return "notEmpty"; 156 case CONTAINS: return "contains"; 157 case NOTCONTAINS: return "notContains"; 158 case NULL: return null; 159 default: return "?"; 160 } 161 } 162 163 164}