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 FilterOperator {
038
039        /**
040         * The specified property of the code equals the provided value.
041         */
042        EQUAL, 
043        /**
044         * Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, including the provided concept itself (include descendant codes and self).
045         */
046        ISA, 
047        /**
048         * Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, excluding the provided concept itself i.e. include descendant codes only).
049         */
050        DESCENDENTOF, 
051        /**
052         * The specified property of the code does not have an is-a relationship with the provided value.
053         */
054        ISNOTA, 
055        /**
056         * The specified property of the code  matches the regex specified in the provided value.
057         */
058        REGEX, 
059        /**
060         * The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list).
061         */
062        IN, 
063        /**
064         * The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list).
065         */
066        NOTIN, 
067        /**
068         * Includes all concept ids that have a transitive is-a relationship from the concept Id provided as the value, including the provided concept itself (i.e. include ancestor codes and self).
069         */
070        GENERALIZES, 
071        /**
072         * The specified property of the code has at least one value (if the specified value is true; if the specified value is false, then matches when the specified property of the code has no values).
073         */
074        EXISTS, 
075        /**
076         * added to help the parsers
077         */
078        NULL;
079        public static FilterOperator fromCode(String codeString) throws FHIRException {
080            if (codeString == null || "".equals(codeString))
081                return null;
082        if ("=".equals(codeString))
083          return EQUAL;
084        if ("is-a".equals(codeString))
085          return ISA;
086        if ("descendent-of".equals(codeString))
087          return DESCENDENTOF;
088        if ("is-not-a".equals(codeString))
089          return ISNOTA;
090        if ("regex".equals(codeString))
091          return REGEX;
092        if ("in".equals(codeString))
093          return IN;
094        if ("not-in".equals(codeString))
095          return NOTIN;
096        if ("generalizes".equals(codeString))
097          return GENERALIZES;
098        if ("exists".equals(codeString))
099          return EXISTS;
100        throw new FHIRException("Unknown FilterOperator code '"+codeString+"'");
101        }
102        public String toCode() {
103          switch (this) {
104            case EQUAL: return "=";
105            case ISA: return "is-a";
106            case DESCENDENTOF: return "descendent-of";
107            case ISNOTA: return "is-not-a";
108            case REGEX: return "regex";
109            case IN: return "in";
110            case NOTIN: return "not-in";
111            case GENERALIZES: return "generalizes";
112            case EXISTS: return "exists";
113            default: return "?";
114          }
115        }
116        public String getSystem() {
117          return "http://hl7.org/fhir/filter-operator";
118        }
119        public String getDefinition() {
120          switch (this) {
121            case EQUAL: return "The specified property of the code equals the provided value.";
122            case ISA: return "Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, including the provided concept itself (include descendant codes and self).";
123            case DESCENDENTOF: return "Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, excluding the provided concept itself i.e. include descendant codes only).";
124            case ISNOTA: return "The specified property of the code does not have an is-a relationship with the provided value.";
125            case REGEX: return "The specified property of the code  matches the regex specified in the provided value.";
126            case IN: return "The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list).";
127            case NOTIN: return "The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list).";
128            case GENERALIZES: return "Includes all concept ids that have a transitive is-a relationship from the concept Id provided as the value, including the provided concept itself (i.e. include ancestor codes and self).";
129            case EXISTS: return "The specified property of the code has at least one value (if the specified value is true; if the specified value is false, then matches when the specified property of the code has no values).";
130            default: return "?";
131          }
132        }
133        public String getDisplay() {
134          switch (this) {
135            case EQUAL: return "Equals";
136            case ISA: return "Is A (by subsumption)";
137            case DESCENDENTOF: return "Descendent Of (by subsumption)";
138            case ISNOTA: return "Not (Is A) (by subsumption)";
139            case REGEX: return "Regular Expression";
140            case IN: return "In Set";
141            case NOTIN: return "Not in Set";
142            case GENERALIZES: return "Generalizes (by Subsumption)";
143            case EXISTS: return "Exists";
144            default: return "?";
145          }
146    }
147
148
149}
150