001package org.hl7.fhir.r4.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 Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0 036 037 038import org.hl7.fhir.exceptions.FHIRException; 039 040public enum SearchModifierCode { 041 042 /** 043 * The search parameter returns resources that have a value or not. 044 */ 045 MISSING, 046 /** 047 * The search parameter returns resources that have a value that exactly matches the supplied parameter (the whole string, including casing and accents). 048 */ 049 EXACT, 050 /** 051 * The search parameter returns resources that include the supplied parameter value anywhere within the field being searched. 052 */ 053 CONTAINS, 054 /** 055 * The search parameter returns resources that do not contain a match. 056 */ 057 NOT, 058 /** 059 * The search parameter is processed as a string that searches text associated with the code/value - either CodeableConcept.text, Coding.display, or Identifier.type.text. 060 */ 061 TEXT, 062 /** 063 * The search parameter is a URI (relative or absolute) that identifies a value set, and the search parameter tests whether the coding is in the specified value set. 064 */ 065 IN, 066 /** 067 * The search parameter is a URI (relative or absolute) that identifies a value set, and the search parameter tests whether the coding is not in the specified value set. 068 */ 069 NOTIN, 070 /** 071 * The search parameter tests whether the value in a resource is subsumed by the specified value (is-a, or hierarchical relationships). 072 */ 073 BELOW, 074 /** 075 * The search parameter tests whether the value in a resource subsumes the specified value (is-a, or hierarchical relationships). 076 */ 077 ABOVE, 078 /** 079 * The search parameter only applies to the Resource Type specified as a modifier (e.g. the modifier is not actually :type, but :Patient etc.). 080 */ 081 TYPE, 082 /** 083 * The search parameter applies to the identifier on the resource, not the reference. 084 */ 085 IDENTIFIER, 086 /** 087 * The search parameter has the format system|code|value, where the system and code refer to an Identifier.type.coding.system and .code, and match if any of the type codes match. All 3 parts must be present. 088 */ 089 OFTYPE, 090 /** 091 * added to help the parsers 092 */ 093 NULL; 094 public static SearchModifierCode fromCode(String codeString) throws FHIRException { 095 if (codeString == null || "".equals(codeString)) 096 return null; 097 if ("missing".equals(codeString)) 098 return MISSING; 099 if ("exact".equals(codeString)) 100 return EXACT; 101 if ("contains".equals(codeString)) 102 return CONTAINS; 103 if ("not".equals(codeString)) 104 return NOT; 105 if ("text".equals(codeString)) 106 return TEXT; 107 if ("in".equals(codeString)) 108 return IN; 109 if ("not-in".equals(codeString)) 110 return NOTIN; 111 if ("below".equals(codeString)) 112 return BELOW; 113 if ("above".equals(codeString)) 114 return ABOVE; 115 if ("type".equals(codeString)) 116 return TYPE; 117 if ("identifier".equals(codeString)) 118 return IDENTIFIER; 119 if ("ofType".equals(codeString)) 120 return OFTYPE; 121 throw new FHIRException("Unknown SearchModifierCode code '"+codeString+"'"); 122 } 123 public String toCode() { 124 switch (this) { 125 case MISSING: return "missing"; 126 case EXACT: return "exact"; 127 case CONTAINS: return "contains"; 128 case NOT: return "not"; 129 case TEXT: return "text"; 130 case IN: return "in"; 131 case NOTIN: return "not-in"; 132 case BELOW: return "below"; 133 case ABOVE: return "above"; 134 case TYPE: return "type"; 135 case IDENTIFIER: return "identifier"; 136 case OFTYPE: return "ofType"; 137 default: return "?"; 138 } 139 } 140 public String getSystem() { 141 return "http://hl7.org/fhir/search-modifier-code"; 142 } 143 public String getDefinition() { 144 switch (this) { 145 case MISSING: return "The search parameter returns resources that have a value or not."; 146 case EXACT: return "The search parameter returns resources that have a value that exactly matches the supplied parameter (the whole string, including casing and accents)."; 147 case CONTAINS: return "The search parameter returns resources that include the supplied parameter value anywhere within the field being searched."; 148 case NOT: return "The search parameter returns resources that do not contain a match."; 149 case TEXT: return "The search parameter is processed as a string that searches text associated with the code/value - either CodeableConcept.text, Coding.display, or Identifier.type.text."; 150 case IN: return "The search parameter is a URI (relative or absolute) that identifies a value set, and the search parameter tests whether the coding is in the specified value set."; 151 case NOTIN: return "The search parameter is a URI (relative or absolute) that identifies a value set, and the search parameter tests whether the coding is not in the specified value set."; 152 case BELOW: return "The search parameter tests whether the value in a resource is subsumed by the specified value (is-a, or hierarchical relationships)."; 153 case ABOVE: return "The search parameter tests whether the value in a resource subsumes the specified value (is-a, or hierarchical relationships)."; 154 case TYPE: return "The search parameter only applies to the Resource Type specified as a modifier (e.g. the modifier is not actually :type, but :Patient etc.)."; 155 case IDENTIFIER: return "The search parameter applies to the identifier on the resource, not the reference."; 156 case OFTYPE: return "The search parameter has the format system|code|value, where the system and code refer to an Identifier.type.coding.system and .code, and match if any of the type codes match. All 3 parts must be present."; 157 default: return "?"; 158 } 159 } 160 public String getDisplay() { 161 switch (this) { 162 case MISSING: return "Missing"; 163 case EXACT: return "Exact"; 164 case CONTAINS: return "Contains"; 165 case NOT: return "Not"; 166 case TEXT: return "Text"; 167 case IN: return "In"; 168 case NOTIN: return "Not In"; 169 case BELOW: return "Below"; 170 case ABOVE: return "Above"; 171 case TYPE: return "Type"; 172 case IDENTIFIER: return "Identifier"; 173 case OFTYPE: return "Of Type"; 174 default: return "?"; 175 } 176 } 177 178 179}