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 GuidePageKindEnum {
009
010        /**
011         * Display: <b>Page</b><br>
012         * Code Value: <b>page</b>
013         *
014         * This is a page of content that is included in the implementation guide. It has no particular function.
015         */
016        PAGE("page", "http://hl7.org/fhir/guide-page-kind"),
017        
018        /**
019         * Display: <b>Example</b><br>
020         * Code Value: <b>example</b>
021         *
022         * This is a page that represents a human readable rendering of an example.
023         */
024        EXAMPLE("example", "http://hl7.org/fhir/guide-page-kind"),
025        
026        /**
027         * Display: <b>List</b><br>
028         * Code Value: <b>list</b>
029         *
030         * This is a page that represents a list of resources of one or more types.
031         */
032        LIST("list", "http://hl7.org/fhir/guide-page-kind"),
033        
034        /**
035         * Display: <b>Include</b><br>
036         * Code Value: <b>include</b>
037         *
038         * This is a page showing where an included guide is injected.
039         */
040        INCLUDE("include", "http://hl7.org/fhir/guide-page-kind"),
041        
042        /**
043         * Display: <b>Directory</b><br>
044         * Code Value: <b>directory</b>
045         *
046         * This is a page that lists the resources of a given type, and also creates pages for all the listed types as other pages in the section.
047         */
048        DIRECTORY("directory", "http://hl7.org/fhir/guide-page-kind"),
049        
050        /**
051         * Display: <b>Dictionary</b><br>
052         * Code Value: <b>dictionary</b>
053         *
054         * This is a page that creates the listed resources as a dictionary.
055         */
056        DICTIONARY("dictionary", "http://hl7.org/fhir/guide-page-kind"),
057        
058        /**
059         * Display: <b>Table Of Contents</b><br>
060         * Code Value: <b>toc</b>
061         *
062         * This is a generated page that contains the table of contents.
063         */
064        TABLE_OF_CONTENTS("toc", "http://hl7.org/fhir/guide-page-kind"),
065        
066        /**
067         * Display: <b>Resource</b><br>
068         * Code Value: <b>resource</b>
069         *
070         * This is a page that represents a presented resource. This is typically used for generated conformance resource presentations.
071         */
072        RESOURCE("resource", "http://hl7.org/fhir/guide-page-kind"),
073        
074        ;
075        
076        /**
077         * Identifier for this Value Set:
078         * 
079         */
080        public static final String VALUESET_IDENTIFIER = "";
081
082        /**
083         * Name for this Value Set:
084         * GuidePageKind
085         */
086        public static final String VALUESET_NAME = "GuidePageKind";
087
088        private static Map<String, GuidePageKindEnum> CODE_TO_ENUM = new HashMap<String, GuidePageKindEnum>();
089        private static Map<String, Map<String, GuidePageKindEnum>> SYSTEM_TO_CODE_TO_ENUM = new HashMap<String, Map<String, GuidePageKindEnum>>();
090        
091        private final String myCode;
092        private final String mySystem;
093        
094        static {
095                for (GuidePageKindEnum next : GuidePageKindEnum.values()) {
096                        CODE_TO_ENUM.put(next.getCode(), next);
097                        
098                        if (!SYSTEM_TO_CODE_TO_ENUM.containsKey(next.getSystem())) {
099                                SYSTEM_TO_CODE_TO_ENUM.put(next.getSystem(), new HashMap<String, GuidePageKindEnum>());
100                        }
101                        SYSTEM_TO_CODE_TO_ENUM.get(next.getSystem()).put(next.getCode(), next);                 
102                }
103        }
104        
105        /**
106         * Returns the code associated with this enumerated value
107         */
108        public String getCode() {
109                return myCode;
110        }
111        
112        /**
113         * Returns the code system associated with this enumerated value
114         */
115        public String getSystem() {
116                return mySystem;
117        }
118        
119        /**
120         * Returns the enumerated value associated with this code
121         */
122        public static GuidePageKindEnum forCode(String theCode) {
123                GuidePageKindEnum retVal = CODE_TO_ENUM.get(theCode);
124                return retVal;
125        }
126
127        /**
128         * Converts codes to their respective enumerated values
129         */
130        public static final IValueSetEnumBinder<GuidePageKindEnum> VALUESET_BINDER = new IValueSetEnumBinder<GuidePageKindEnum>() {
131                @Override
132                public String toCodeString(GuidePageKindEnum theEnum) {
133                        return theEnum.getCode();
134                }
135
136                @Override
137                public String toSystemString(GuidePageKindEnum theEnum) {
138                        return theEnum.getSystem();
139                }
140                
141                @Override
142                public GuidePageKindEnum fromCodeString(String theCodeString) {
143                        return CODE_TO_ENUM.get(theCodeString);
144                }
145                
146                @Override
147                public GuidePageKindEnum fromCodeString(String theCodeString, String theSystemString) {
148                        Map<String, GuidePageKindEnum> map = SYSTEM_TO_CODE_TO_ENUM.get(theSystemString);
149                        if (map == null) {
150                                return null;
151                        }
152                        return map.get(theCodeString);
153                }
154                
155        };
156        
157        /** 
158         * Constructor
159         */
160        GuidePageKindEnum(String theCode, String theSystem) {
161                myCode = theCode;
162                mySystem = theSystem;
163        }
164
165        
166}