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 GoalStatusEnum {
009
010        /**
011         * Display: <b>Proposed</b><br>
012         * Code Value: <b>proposed</b>
013         *
014         * A goal is proposed for this patient
015         */
016        PROPOSED("proposed", "http://hl7.org/fhir/goal-status"),
017        
018        /**
019         * Display: <b>Planned</b><br>
020         * Code Value: <b>planned</b>
021         *
022         * A goal is planned for this patient
023         */
024        PLANNED("planned", "http://hl7.org/fhir/goal-status"),
025        
026        /**
027         * Display: <b>Accepted</b><br>
028         * Code Value: <b>accepted</b>
029         *
030         * A proposed goal was accepted
031         */
032        ACCEPTED("accepted", "http://hl7.org/fhir/goal-status"),
033        
034        /**
035         * Display: <b>Rejected</b><br>
036         * Code Value: <b>rejected</b>
037         *
038         * A proposed goal was rejected
039         */
040        REJECTED("rejected", "http://hl7.org/fhir/goal-status"),
041        
042        /**
043         * Display: <b>In Progress</b><br>
044         * Code Value: <b>in-progress</b>
045         *
046         * The goal is being sought but has not yet been reached.  (Also applies if goal was reached in the past but there has been regression and goal is being sought again)
047         */
048        IN_PROGRESS("in-progress", "http://hl7.org/fhir/goal-status"),
049        
050        /**
051         * Display: <b>Achieved</b><br>
052         * Code Value: <b>achieved</b>
053         *
054         * The goal has been met and no further action is needed
055         */
056        ACHIEVED("achieved", "http://hl7.org/fhir/goal-status"),
057        
058        /**
059         * Display: <b>Sustaining</b><br>
060         * Code Value: <b>sustaining</b>
061         *
062         * The goal has been met, but ongoing activity is needed to sustain the goal objective
063         */
064        SUSTAINING("sustaining", "http://hl7.org/fhir/goal-status"),
065        
066        /**
067         * Display: <b>On Hold</b><br>
068         * Code Value: <b>on-hold</b>
069         *
070         * The goal remains a long term objective but is no longer being actively pursued for a temporary period of time.
071         */
072        ON_HOLD("on-hold", "http://hl7.org/fhir/goal-status"),
073        
074        /**
075         * Display: <b>Cancelled</b><br>
076         * Code Value: <b>cancelled</b>
077         *
078         * The goal is no longer being sought
079         */
080        CANCELLED("cancelled", "http://hl7.org/fhir/goal-status"),
081        
082        ;
083        
084        /**
085         * Identifier for this Value Set:
086         * 
087         */
088        public static final String VALUESET_IDENTIFIER = "";
089
090        /**
091         * Name for this Value Set:
092         * GoalStatus
093         */
094        public static final String VALUESET_NAME = "GoalStatus";
095
096        private static Map<String, GoalStatusEnum> CODE_TO_ENUM = new HashMap<String, GoalStatusEnum>();
097        private static Map<String, Map<String, GoalStatusEnum>> SYSTEM_TO_CODE_TO_ENUM = new HashMap<String, Map<String, GoalStatusEnum>>();
098        
099        private final String myCode;
100        private final String mySystem;
101        
102        static {
103                for (GoalStatusEnum next : GoalStatusEnum.values()) {
104                        CODE_TO_ENUM.put(next.getCode(), next);
105                        
106                        if (!SYSTEM_TO_CODE_TO_ENUM.containsKey(next.getSystem())) {
107                                SYSTEM_TO_CODE_TO_ENUM.put(next.getSystem(), new HashMap<String, GoalStatusEnum>());
108                        }
109                        SYSTEM_TO_CODE_TO_ENUM.get(next.getSystem()).put(next.getCode(), next);                 
110                }
111        }
112        
113        /**
114         * Returns the code associated with this enumerated value
115         */
116        public String getCode() {
117                return myCode;
118        }
119        
120        /**
121         * Returns the code system associated with this enumerated value
122         */
123        public String getSystem() {
124                return mySystem;
125        }
126        
127        /**
128         * Returns the enumerated value associated with this code
129         */
130        public static GoalStatusEnum forCode(String theCode) {
131                GoalStatusEnum retVal = CODE_TO_ENUM.get(theCode);
132                return retVal;
133        }
134
135        /**
136         * Converts codes to their respective enumerated values
137         */
138        public static final IValueSetEnumBinder<GoalStatusEnum> VALUESET_BINDER = new IValueSetEnumBinder<GoalStatusEnum>() {
139                @Override
140                public String toCodeString(GoalStatusEnum theEnum) {
141                        return theEnum.getCode();
142                }
143
144                @Override
145                public String toSystemString(GoalStatusEnum theEnum) {
146                        return theEnum.getSystem();
147                }
148                
149                @Override
150                public GoalStatusEnum fromCodeString(String theCodeString) {
151                        return CODE_TO_ENUM.get(theCodeString);
152                }
153                
154                @Override
155                public GoalStatusEnum fromCodeString(String theCodeString, String theSystemString) {
156                        Map<String, GoalStatusEnum> map = SYSTEM_TO_CODE_TO_ENUM.get(theSystemString);
157                        if (map == null) {
158                                return null;
159                        }
160                        return map.get(theCodeString);
161                }
162                
163        };
164        
165        /** 
166         * Constructor
167         */
168        GoalStatusEnum(String theCode, String theSystem) {
169                myCode = theCode;
170                mySystem = theSystem;
171        }
172
173        
174}