001package org.hl7.fhir.dstu3.model.codesystems;
002
003
004
005
006/*
007  Copyright (c) 2011+, HL7, Inc.
008  All rights reserved.
009  
010  Redistribution and use in source and binary forms, with or without modification, 
011  are permitted provided that the following conditions are met:
012  
013   * Redistributions of source code must retain the above copyright notice, this 
014     list of conditions and the following disclaimer.
015   * Redistributions in binary form must reproduce the above copyright notice, 
016     this list of conditions and the following disclaimer in the documentation 
017     and/or other materials provided with the distribution.
018   * Neither the name of HL7 nor the names of its contributors may be used to 
019     endorse or promote products derived from this software without specific 
020     prior written permission.
021  
022  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
023  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
024  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
025  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
026  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
027  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
028  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
029  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
030  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
031  POSSIBILITY OF SUCH DAMAGE.
032  
033*/
034
035// Generated on Sat, Mar 25, 2017 21:03-0400 for FHIR v3.0.0
036
037
038import org.hl7.fhir.exceptions.FHIRException;
039
040public enum MeasurementPrinciple {
041
042        /**
043         * Measurement principle isn't in the list.
044         */
045        OTHER, 
046        /**
047         * Measurement is done using the chemical principle.
048         */
049        CHEMICAL, 
050        /**
051         * Measurement is done using the electrical principle.
052         */
053        ELECTRICAL, 
054        /**
055         * Measurement is done using the impedance principle.
056         */
057        IMPEDANCE, 
058        /**
059         * Measurement is done using the nuclear principle.
060         */
061        NUCLEAR, 
062        /**
063         * Measurement is done using the optical principle.
064         */
065        OPTICAL, 
066        /**
067         * Measurement is done using the thermal principle.
068         */
069        THERMAL, 
070        /**
071         * Measurement is done using the biological principle.
072         */
073        BIOLOGICAL, 
074        /**
075         * Measurement is done using the mechanical principle.
076         */
077        MECHANICAL, 
078        /**
079         * Measurement is done using the acoustical principle.
080         */
081        ACOUSTICAL, 
082        /**
083         * Measurement is done using the manual principle.
084         */
085        MANUAL, 
086        /**
087         * added to help the parsers
088         */
089        NULL;
090        public static MeasurementPrinciple fromCode(String codeString) throws FHIRException {
091            if (codeString == null || "".equals(codeString))
092                return null;
093        if ("other".equals(codeString))
094          return OTHER;
095        if ("chemical".equals(codeString))
096          return CHEMICAL;
097        if ("electrical".equals(codeString))
098          return ELECTRICAL;
099        if ("impedance".equals(codeString))
100          return IMPEDANCE;
101        if ("nuclear".equals(codeString))
102          return NUCLEAR;
103        if ("optical".equals(codeString))
104          return OPTICAL;
105        if ("thermal".equals(codeString))
106          return THERMAL;
107        if ("biological".equals(codeString))
108          return BIOLOGICAL;
109        if ("mechanical".equals(codeString))
110          return MECHANICAL;
111        if ("acoustical".equals(codeString))
112          return ACOUSTICAL;
113        if ("manual".equals(codeString))
114          return MANUAL;
115        throw new FHIRException("Unknown MeasurementPrinciple code '"+codeString+"'");
116        }
117        public String toCode() {
118          switch (this) {
119            case OTHER: return "other";
120            case CHEMICAL: return "chemical";
121            case ELECTRICAL: return "electrical";
122            case IMPEDANCE: return "impedance";
123            case NUCLEAR: return "nuclear";
124            case OPTICAL: return "optical";
125            case THERMAL: return "thermal";
126            case BIOLOGICAL: return "biological";
127            case MECHANICAL: return "mechanical";
128            case ACOUSTICAL: return "acoustical";
129            case MANUAL: return "manual";
130            case NULL: return null;
131            default: return "?";
132          }
133        }
134        public String getSystem() {
135          return "http://hl7.org/fhir/measurement-principle";
136        }
137        public String getDefinition() {
138          switch (this) {
139            case OTHER: return "Measurement principle isn't in the list.";
140            case CHEMICAL: return "Measurement is done using the chemical principle.";
141            case ELECTRICAL: return "Measurement is done using the electrical principle.";
142            case IMPEDANCE: return "Measurement is done using the impedance principle.";
143            case NUCLEAR: return "Measurement is done using the nuclear principle.";
144            case OPTICAL: return "Measurement is done using the optical principle.";
145            case THERMAL: return "Measurement is done using the thermal principle.";
146            case BIOLOGICAL: return "Measurement is done using the biological principle.";
147            case MECHANICAL: return "Measurement is done using the mechanical principle.";
148            case ACOUSTICAL: return "Measurement is done using the acoustical principle.";
149            case MANUAL: return "Measurement is done using the manual principle.";
150            case NULL: return null;
151            default: return "?";
152          }
153        }
154        public String getDisplay() {
155          switch (this) {
156            case OTHER: return "MSP Other";
157            case CHEMICAL: return "MSP Chemical";
158            case ELECTRICAL: return "MSP Electrical";
159            case IMPEDANCE: return "MSP Impedance";
160            case NUCLEAR: return "MSP Nuclear";
161            case OPTICAL: return "MSP Optical";
162            case THERMAL: return "MSP Thermal";
163            case BIOLOGICAL: return "MSP Biological";
164            case MECHANICAL: return "MSP Mechanical";
165            case ACOUSTICAL: return "MSP Acoustical";
166            case MANUAL: return "MSP Manual";
167            case NULL: return null;
168            default: return "?";
169          }
170    }
171
172
173}