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 OrganizationTypeEnum {
009
010        /**
011         * Display: <b>Healthcare Provider</b><br>
012         * Code Value: <b>prov</b>
013         *
014         * An organization that provides healthcare services.
015         */
016        HEALTHCARE_PROVIDER("prov", "http://hl7.org/fhir/organization-type"),
017        
018        /**
019         * Display: <b>Hospital Department</b><br>
020         * Code Value: <b>dept</b>
021         *
022         * A department or ward within a hospital (Generally is not applicable to top level organizations)
023         */
024        HOSPITAL_DEPARTMENT("dept", "http://hl7.org/fhir/organization-type"),
025        
026        /**
027         * Display: <b>Organizational team</b><br>
028         * Code Value: <b>team</b>
029         *
030         * An organizational team is usually a grouping of practitioners that perform a specific function within an organization (which could be a top level organization, or a department).
031         */
032        ORGANIZATIONAL_TEAM("team", "http://hl7.org/fhir/organization-type"),
033        
034        /**
035         * Display: <b>Government</b><br>
036         * Code Value: <b>govt</b>
037         *
038         * A political body, often used when including organization records for government bodies such as a Federal Government, State or Local Government.
039         */
040        GOVERNMENT("govt", "http://hl7.org/fhir/organization-type"),
041        
042        /**
043         * Display: <b>Insurance Company</b><br>
044         * Code Value: <b>ins</b>
045         *
046         * A company that provides insurance to its subscribers that may include healthcare related policies.
047         */
048        INSURANCE_COMPANY("ins", "http://hl7.org/fhir/organization-type"),
049        
050        /**
051         * Display: <b>Educational Institute</b><br>
052         * Code Value: <b>edu</b>
053         *
054         * An educational institution that provides education or research facilities.
055         */
056        EDUCATIONAL_INSTITUTE("edu", "http://hl7.org/fhir/organization-type"),
057        
058        /**
059         * Display: <b>Religious Institution</b><br>
060         * Code Value: <b>reli</b>
061         *
062         * An organization that is identified as a part of a religious institution.
063         */
064        RELIGIOUS_INSTITUTION("reli", "http://hl7.org/fhir/organization-type"),
065        
066        /**
067         * Display: <b>Clinical Research Sponsor</b><br>
068         * Code Value: <b>crs</b>
069         *
070         * An organization that is identified as a Pharmaceutical/Clinical Research Sponsor.
071         */
072        CLINICAL_RESEARCH_SPONSOR("crs", "http://hl7.org/fhir/organization-type"),
073        
074        /**
075         * Display: <b>Community Group</b><br>
076         * Code Value: <b>cg</b>
077         *
078         * An un-incorporated community group.
079         */
080        COMMUNITY_GROUP("cg", "http://hl7.org/fhir/organization-type"),
081        
082        /**
083         * Display: <b>Non-Healthcare Business or Corporation</b><br>
084         * Code Value: <b>bus</b>
085         *
086         * An organization that is a registered business or corporation but not identified by other types.
087         */
088        NON_HEALTHCARE_BUSINESS_OR_CORPORATION("bus", "http://hl7.org/fhir/organization-type"),
089        
090        /**
091         * Display: <b>Other</b><br>
092         * Code Value: <b>other</b>
093         *
094         * Other type of organization not already specified.
095         */
096        OTHER("other", "http://hl7.org/fhir/organization-type"),
097        
098        ;
099        
100        /**
101         * Identifier for this Value Set:
102         * 
103         */
104        public static final String VALUESET_IDENTIFIER = "";
105
106        /**
107         * Name for this Value Set:
108         * OrganizationType
109         */
110        public static final String VALUESET_NAME = "OrganizationType";
111
112        private static Map<String, OrganizationTypeEnum> CODE_TO_ENUM = new HashMap<String, OrganizationTypeEnum>();
113        private static Map<String, Map<String, OrganizationTypeEnum>> SYSTEM_TO_CODE_TO_ENUM = new HashMap<String, Map<String, OrganizationTypeEnum>>();
114        
115        private final String myCode;
116        private final String mySystem;
117        
118        static {
119                for (OrganizationTypeEnum next : OrganizationTypeEnum.values()) {
120                        CODE_TO_ENUM.put(next.getCode(), next);
121                        
122                        if (!SYSTEM_TO_CODE_TO_ENUM.containsKey(next.getSystem())) {
123                                SYSTEM_TO_CODE_TO_ENUM.put(next.getSystem(), new HashMap<String, OrganizationTypeEnum>());
124                        }
125                        SYSTEM_TO_CODE_TO_ENUM.get(next.getSystem()).put(next.getCode(), next);                 
126                }
127        }
128        
129        /**
130         * Returns the code associated with this enumerated value
131         */
132        public String getCode() {
133                return myCode;
134        }
135        
136        /**
137         * Returns the code system associated with this enumerated value
138         */
139        public String getSystem() {
140                return mySystem;
141        }
142        
143        /**
144         * Returns the enumerated value associated with this code
145         */
146        public static OrganizationTypeEnum forCode(String theCode) {
147                OrganizationTypeEnum retVal = CODE_TO_ENUM.get(theCode);
148                return retVal;
149        }
150
151        /**
152         * Converts codes to their respective enumerated values
153         */
154        public static final IValueSetEnumBinder<OrganizationTypeEnum> VALUESET_BINDER = new IValueSetEnumBinder<OrganizationTypeEnum>() {
155                @Override
156                public String toCodeString(OrganizationTypeEnum theEnum) {
157                        return theEnum.getCode();
158                }
159
160                @Override
161                public String toSystemString(OrganizationTypeEnum theEnum) {
162                        return theEnum.getSystem();
163                }
164                
165                @Override
166                public OrganizationTypeEnum fromCodeString(String theCodeString) {
167                        return CODE_TO_ENUM.get(theCodeString);
168                }
169                
170                @Override
171                public OrganizationTypeEnum fromCodeString(String theCodeString, String theSystemString) {
172                        Map<String, OrganizationTypeEnum> map = SYSTEM_TO_CODE_TO_ENUM.get(theSystemString);
173                        if (map == null) {
174                                return null;
175                        }
176                        return map.get(theCodeString);
177                }
178                
179        };
180        
181        /** 
182         * Constructor
183         */
184        OrganizationTypeEnum(String theCode, String theSystem) {
185                myCode = theCode;
186                mySystem = theSystem;
187        }
188
189        
190}