001package org.hl7.fhir.r4.model.codesystems; 002 003/* 004 Copyright (c) 2011+, HL7, Inc. 005 All rights reserved. 006 007 Redistribution and use in source and binary forms, with or without modification, 008 are permitted provided that the following conditions are met: 009 010 * Redistributions of source code must retain the above copyright notice, this 011 list of conditions and the following disclaimer. 012 * Redistributions in binary form must reproduce the above copyright notice, 013 this list of conditions and the following disclaimer in the documentation 014 and/or other materials provided with the distribution. 015 * Neither the name of HL7 nor the names of its contributors may be used to 016 endorse or promote products derived from this software without specific 017 prior written permission. 018 019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 020 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 021 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 022 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 023 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 024 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 025 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 026 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 027 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 028 POSSIBILITY OF SUCH DAMAGE. 029 030*/ 031 032// Generated on Sun, May 6, 2018 17:51-0400 for FHIR v3.4.0 033 034 035import org.hl7.fhir.exceptions.FHIRException; 036 037public enum SearchParamType { 038 039 /** 040 * Search parameter SHALL be a number (a whole number, or a decimal). 041 */ 042 NUMBER, 043 /** 044 * Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported. 045 */ 046 DATE, 047 /** 048 * Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces. 049 */ 050 STRING, 051 /** 052 * Search parameter on a coded element or identifier. May be used to search through the text, display, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a "|", depending on the modifier used. 053 */ 054 TOKEN, 055 /** 056 * A reference to another resource (Reference or canonical). 057 */ 058 REFERENCE, 059 /** 060 * A composite search parameter that combines a search on two values together. 061 */ 062 COMPOSITE, 063 /** 064 * A search parameter that searches on a quantity. 065 */ 066 QUANTITY, 067 /** 068 * A search parameter that searches on a URI (RFC 3986). 069 */ 070 URI, 071 /** 072 * added to help the parsers 073 */ 074 NULL; 075 public static SearchParamType fromCode(String codeString) throws FHIRException { 076 if (codeString == null || "".equals(codeString)) 077 return null; 078 if ("number".equals(codeString)) 079 return NUMBER; 080 if ("date".equals(codeString)) 081 return DATE; 082 if ("string".equals(codeString)) 083 return STRING; 084 if ("token".equals(codeString)) 085 return TOKEN; 086 if ("reference".equals(codeString)) 087 return REFERENCE; 088 if ("composite".equals(codeString)) 089 return COMPOSITE; 090 if ("quantity".equals(codeString)) 091 return QUANTITY; 092 if ("uri".equals(codeString)) 093 return URI; 094 throw new FHIRException("Unknown SearchParamType code '"+codeString+"'"); 095 } 096 public String toCode() { 097 switch (this) { 098 case NUMBER: return "number"; 099 case DATE: return "date"; 100 case STRING: return "string"; 101 case TOKEN: return "token"; 102 case REFERENCE: return "reference"; 103 case COMPOSITE: return "composite"; 104 case QUANTITY: return "quantity"; 105 case URI: return "uri"; 106 default: return "?"; 107 } 108 } 109 public String getSystem() { 110 return "http://hl7.org/fhir/search-param-type"; 111 } 112 public String getDefinition() { 113 switch (this) { 114 case NUMBER: return "Search parameter SHALL be a number (a whole number, or a decimal)."; 115 case DATE: return "Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported."; 116 case STRING: return "Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces."; 117 case TOKEN: return "Search parameter on a coded element or identifier. May be used to search through the text, display, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a \"|\", depending on the modifier used."; 118 case REFERENCE: return "A reference to another resource (Reference or canonical)."; 119 case COMPOSITE: return "A composite search parameter that combines a search on two values together."; 120 case QUANTITY: return "A search parameter that searches on a quantity."; 121 case URI: return "A search parameter that searches on a URI (RFC 3986)."; 122 default: return "?"; 123 } 124 } 125 public String getDisplay() { 126 switch (this) { 127 case NUMBER: return "Number"; 128 case DATE: return "Date/DateTime"; 129 case STRING: return "String"; 130 case TOKEN: return "Token"; 131 case REFERENCE: return "Reference"; 132 case COMPOSITE: return "Composite"; 133 case QUANTITY: return "Quantity"; 134 case URI: return "URI"; 135 default: return "?"; 136 } 137 } 138 139 140} 141