
package ca.uhn.fhir.model.dstu2.valueset;

import ca.uhn.fhir.model.api.*;
import java.util.HashMap;
import java.util.Map;

public enum SurfaceCodesEnum {

	/**
	 * Code Value: <b>0</b>
	 */
	_0("0", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>1</b>
	 */
	_1("1", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>2</b>
	 */
	_2("2", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>3</b>
	 */
	_3("3", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>4</b>
	 */
	_4("4", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>5</b>
	 */
	_5("5", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>10</b>
	 */
	_10("10", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>20</b>
	 */
	_20("20", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>30</b>
	 */
	_30("30", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>40</b>
	 */
	_40("40", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>11</b>
	 */
	_11("11", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>12</b>
	 */
	_12("12", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>13</b>
	 */
	_13("13", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>14</b>
	 */
	_14("14", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>15</b>
	 */
	_15("15", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>16</b>
	 */
	_16("16", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>17</b>
	 */
	_17("17", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>18</b>
	 */
	_18("18", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>21</b>
	 */
	_21("21", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>22</b>
	 */
	_22("22", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>23</b>
	 */
	_23("23", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>24</b>
	 */
	_24("24", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>25</b>
	 */
	_25("25", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>26</b>
	 */
	_26("26", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>27</b>
	 */
	_27("27", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>28</b>
	 */
	_28("28", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>31</b>
	 */
	_31("31", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>32</b>
	 */
	_32("32", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>33</b>
	 */
	_33("33", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>34</b>
	 */
	_34("34", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>35</b>
	 */
	_35("35", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>36</b>
	 */
	_36("36", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>37</b>
	 */
	_37("37", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>38</b>
	 */
	_38("38", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>41</b>
	 */
	_41("41", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>42</b>
	 */
	_42("42", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>43</b>
	 */
	_43("43", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>44</b>
	 */
	_44("44", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>45</b>
	 */
	_45("45", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>46</b>
	 */
	_46("46", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>47</b>
	 */
	_47("47", "http://hl7.org/fhir/ex-surface"),
	
	/**
	 * Code Value: <b>48</b>
	 */
	_48("48", "http://hl7.org/fhir/ex-surface"),
	
	;
	
	/**
	 * Identifier for this Value Set:
	 * http://hl7.org/fhir/vs/tooth
	 */
	public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/tooth";

	/**
	 * Name for this Value Set:
	 * Surface Codes
	 */
	public static final String VALUESET_NAME = "Surface Codes";

	private static Map<String, SurfaceCodesEnum> CODE_TO_ENUM = new HashMap<String, SurfaceCodesEnum>();
	private static Map<String, Map<String, SurfaceCodesEnum>> SYSTEM_TO_CODE_TO_ENUM = new HashMap<String, Map<String, SurfaceCodesEnum>>();
	
	private final String myCode;
	private final String mySystem;
	
	static {
		for (SurfaceCodesEnum next : SurfaceCodesEnum.values()) {
			CODE_TO_ENUM.put(next.getCode(), next);
			
			if (!SYSTEM_TO_CODE_TO_ENUM.containsKey(next.getSystem())) {
				SYSTEM_TO_CODE_TO_ENUM.put(next.getSystem(), new HashMap<String, SurfaceCodesEnum>());
			}
			SYSTEM_TO_CODE_TO_ENUM.get(next.getSystem()).put(next.getCode(), next);			
		}
	}
	
	/**
	 * Returns the code associated with this enumerated value
	 */
	public String getCode() {
		return myCode;
	}
	
	/**
	 * Returns the code system associated with this enumerated value
	 */
	public String getSystem() {
		return mySystem;
	}
	
	/**
	 * Returns the enumerated value associated with this code
	 */
	public SurfaceCodesEnum forCode(String theCode) {
		SurfaceCodesEnum retVal = CODE_TO_ENUM.get(theCode);
		return retVal;
	}

	/**
	 * Converts codes to their respective enumerated values
	 */
	public static final IValueSetEnumBinder<SurfaceCodesEnum> VALUESET_BINDER = new IValueSetEnumBinder<SurfaceCodesEnum>() {
		@Override
		public String toCodeString(SurfaceCodesEnum theEnum) {
			return theEnum.getCode();
		}

		@Override
		public String toSystemString(SurfaceCodesEnum theEnum) {
			return theEnum.getSystem();
		}
		
		@Override
		public SurfaceCodesEnum fromCodeString(String theCodeString) {
			return CODE_TO_ENUM.get(theCodeString);
		}
		
		@Override
		public SurfaceCodesEnum fromCodeString(String theCodeString, String theSystemString) {
			Map<String, SurfaceCodesEnum> map = SYSTEM_TO_CODE_TO_ENUM.get(theSystemString);
			if (map == null) {
				return null;
			}
			return map.get(theCodeString);
		}
		
	};
	
	/** 
	 * Constructor
	 */
	SurfaceCodesEnum(String theCode, String theSystem) {
		myCode = theCode;
		mySystem = theSystem;
	}

	
}
