001
002package ca.uhn.fhir.model.dstu2.valueset;
003
004import ca.uhn.fhir.model.api.*;
005import java.util.HashMap;
006import java.util.Map;
007
008public enum SearchModifierCodeEnum {
009
010        /**
011         * Display: <b>Missing</b><br>
012         * Code Value: <b>missing</b>
013         *
014         * The search parameter returns resources that have a value or not.
015         */
016        MISSING("missing", "http://hl7.org/fhir/search-modifier-code"),
017        
018        /**
019         * Display: <b>Exact</b><br>
020         * Code Value: <b>exact</b>
021         *
022         * The search parameter returns resources that have a value that exactly matches the supplied parameter (the whole string, including casing and accents).
023         */
024        EXACT("exact", "http://hl7.org/fhir/search-modifier-code"),
025        
026        /**
027         * Display: <b>Contains</b><br>
028         * Code Value: <b>contains</b>
029         *
030         * The search parameter returns resources that include the supplied parameter value anywhere within the field being searched.
031         */
032        CONTAINS("contains", "http://hl7.org/fhir/search-modifier-code"),
033        
034        /**
035         * Display: <b>Not</b><br>
036         * Code Value: <b>not</b>
037         *
038         * The search parameter returns resources that do not contain a match .
039         */
040        NOT("not", "http://hl7.org/fhir/search-modifier-code"),
041        
042        /**
043         * Display: <b>Text</b><br>
044         * Code Value: <b>text</b>
045         *
046         * 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.
047         */
048        TEXT("text", "http://hl7.org/fhir/search-modifier-code"),
049        
050        /**
051         * Display: <b>In</b><br>
052         * Code Value: <b>in</b>
053         *
054         * 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.
055         */
056        IN("in", "http://hl7.org/fhir/search-modifier-code"),
057        
058        /**
059         * Display: <b>Not In</b><br>
060         * Code Value: <b>not-in</b>
061         *
062         * 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.
063         */
064        NOT_IN("not-in", "http://hl7.org/fhir/search-modifier-code"),
065        
066        /**
067         * Display: <b>Below</b><br>
068         * Code Value: <b>below</b>
069         *
070         * The search parameter tests whether the value in a resource is subsumed by the specified value (is-a, or hierarchical relationships).
071         */
072        BELOW("below", "http://hl7.org/fhir/search-modifier-code"),
073        
074        /**
075         * Display: <b>Above</b><br>
076         * Code Value: <b>above</b>
077         *
078         * The search parameter tests whether the value in a resource subsumes the specified value (is-a, or hierarchical relationships).
079         */
080        ABOVE("above", "http://hl7.org/fhir/search-modifier-code"),
081        
082        /**
083         * Display: <b>Type</b><br>
084         * Code Value: <b>type</b>
085         *
086         * The search parameter only applies to the Resource Type specified as a modifier (e.g. the modifier is not actually :type, but :Patient etc.).
087         */
088        TYPE("type", "http://hl7.org/fhir/search-modifier-code"),
089        
090        ;
091        
092        /**
093         * Identifier for this Value Set:
094         * 
095         */
096        public static final String VALUESET_IDENTIFIER = "";
097
098        /**
099         * Name for this Value Set:
100         * SearchModifierCode
101         */
102        public static final String VALUESET_NAME = "SearchModifierCode";
103
104        private static Map<String, SearchModifierCodeEnum> CODE_TO_ENUM = new HashMap<String, SearchModifierCodeEnum>();
105        private static Map<String, Map<String, SearchModifierCodeEnum>> SYSTEM_TO_CODE_TO_ENUM = new HashMap<String, Map<String, SearchModifierCodeEnum>>();
106        
107        private final String myCode;
108        private final String mySystem;
109        
110        static {
111                for (SearchModifierCodeEnum next : SearchModifierCodeEnum.values()) {
112                        CODE_TO_ENUM.put(next.getCode(), next);
113                        
114                        if (!SYSTEM_TO_CODE_TO_ENUM.containsKey(next.getSystem())) {
115                                SYSTEM_TO_CODE_TO_ENUM.put(next.getSystem(), new HashMap<String, SearchModifierCodeEnum>());
116                        }
117                        SYSTEM_TO_CODE_TO_ENUM.get(next.getSystem()).put(next.getCode(), next);                 
118                }
119        }
120        
121        /**
122         * Returns the code associated with this enumerated value
123         */
124        public String getCode() {
125                return myCode;
126        }
127        
128        /**
129         * Returns the code system associated with this enumerated value
130         */
131        public String getSystem() {
132                return mySystem;
133        }
134        
135        /**
136         * Returns the enumerated value associated with this code
137         */
138        public static SearchModifierCodeEnum forCode(String theCode) {
139                SearchModifierCodeEnum retVal = CODE_TO_ENUM.get(theCode);
140                return retVal;
141        }
142
143        /**
144         * Converts codes to their respective enumerated values
145         */
146        public static final IValueSetEnumBinder<SearchModifierCodeEnum> VALUESET_BINDER = new IValueSetEnumBinder<SearchModifierCodeEnum>() {
147                @Override
148                public String toCodeString(SearchModifierCodeEnum theEnum) {
149                        return theEnum.getCode();
150                }
151
152                @Override
153                public String toSystemString(SearchModifierCodeEnum theEnum) {
154                        return theEnum.getSystem();
155                }
156                
157                @Override
158                public SearchModifierCodeEnum fromCodeString(String theCodeString) {
159                        return CODE_TO_ENUM.get(theCodeString);
160                }
161                
162                @Override
163                public SearchModifierCodeEnum fromCodeString(String theCodeString, String theSystemString) {
164                        Map<String, SearchModifierCodeEnum> map = SYSTEM_TO_CODE_TO_ENUM.get(theSystemString);
165                        if (map == null) {
166                                return null;
167                        }
168                        return map.get(theCodeString);
169                }
170                
171        };
172        
173        /** 
174         * Constructor
175         */
176        SearchModifierCodeEnum(String theCode, String theSystem) {
177                myCode = theCode;
178                mySystem = theSystem;
179        }
180
181        
182}