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 Thu, Sep 13, 2018 09:04-0400 for FHIR v3.5.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         * Special logic applies to this parameter per the description of the search parameter.
073         */
074        SPECIAL, 
075        /**
076         * added to help the parsers
077         */
078        NULL;
079        public static SearchParamType fromCode(String codeString) throws FHIRException {
080            if (codeString == null || "".equals(codeString))
081                return null;
082        if ("number".equals(codeString))
083          return NUMBER;
084        if ("date".equals(codeString))
085          return DATE;
086        if ("string".equals(codeString))
087          return STRING;
088        if ("token".equals(codeString))
089          return TOKEN;
090        if ("reference".equals(codeString))
091          return REFERENCE;
092        if ("composite".equals(codeString))
093          return COMPOSITE;
094        if ("quantity".equals(codeString))
095          return QUANTITY;
096        if ("uri".equals(codeString))
097          return URI;
098        if ("special".equals(codeString))
099          return SPECIAL;
100        throw new FHIRException("Unknown SearchParamType code '"+codeString+"'");
101        }
102        public String toCode() {
103          switch (this) {
104            case NUMBER: return "number";
105            case DATE: return "date";
106            case STRING: return "string";
107            case TOKEN: return "token";
108            case REFERENCE: return "reference";
109            case COMPOSITE: return "composite";
110            case QUANTITY: return "quantity";
111            case URI: return "uri";
112            case SPECIAL: return "special";
113            default: return "?";
114          }
115        }
116        public String getSystem() {
117          return "http://hl7.org/fhir/search-param-type";
118        }
119        public String getDefinition() {
120          switch (this) {
121            case NUMBER: return "Search parameter SHALL be a number (a whole number, or a decimal).";
122            case DATE: return "Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported.";
123            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.";
124            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.";
125            case REFERENCE: return "A reference to another resource (Reference or canonical).";
126            case COMPOSITE: return "A composite search parameter that combines a search on two values together.";
127            case QUANTITY: return "A search parameter that searches on a quantity.";
128            case URI: return "A search parameter that searches on a URI (RFC 3986).";
129            case SPECIAL: return "Special logic applies to this parameter per the description of the search parameter.";
130            default: return "?";
131          }
132        }
133        public String getDisplay() {
134          switch (this) {
135            case NUMBER: return "Number";
136            case DATE: return "Date/DateTime";
137            case STRING: return "String";
138            case TOKEN: return "Token";
139            case REFERENCE: return "Reference";
140            case COMPOSITE: return "Composite";
141            case QUANTITY: return "Quantity";
142            case URI: return "URI";
143            case SPECIAL: return "Special";
144            default: return "?";
145          }
146    }
147
148
149}
150