001package org.hl7.fhir.r4.model.codesystems;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Sun, May 6, 2018 17:51-0400 for FHIR v3.4.0
033
034
035import org.hl7.fhir.exceptions.FHIRException;
036
037public enum ObservationStatistics {
038
039        /**
040         * The [mean](https://en.wikipedia.org/wiki/Arithmetic_mean) of N measurements over the stated period
041         */
042        AVERAGE, 
043        /**
044         * The [maximum](https://en.wikipedia.org/wiki/Maximal_element) value of N measurements over the stated period
045         */
046        MAXIMUM, 
047        /**
048         * The [minimum](https://en.wikipedia.org/wiki/Minimal_element) value of N measurements over the stated period
049         */
050        MINIMUM, 
051        /**
052         * The [number] of valid measurements over the stated period that contributed to the other statistical outputs
053         */
054        COUNT, 
055        /**
056         * The total [number] of valid measurements over the stated period, including observations that were ignored because they did not contain valid result values
057         */
058        TOTALCOUNT, 
059        /**
060         * The [median](https://en.wikipedia.org/wiki/Median) of N measurements over the stated period
061         */
062        MEDIAN, 
063        /**
064         * The [standard deviation](https://en.wikipedia.org/wiki/Standard_deviation) of N measurements over the stated period
065         */
066        STDDEV, 
067        /**
068         * The [sum](https://en.wikipedia.org/wiki/Summation) of N measurements over the stated period
069         */
070        SUM, 
071        /**
072         * The [variance](https://en.wikipedia.org/wiki/Variance) of N measurements over the stated period
073         */
074        VARIANCE, 
075        /**
076         * The 20th [Percentile](https://en.wikipedia.org/wiki/Percentile) of N measurements over the stated period
077         */
078        _20PERCENT, 
079        /**
080         * The 80th [Percentile](https://en.wikipedia.org/wiki/Percentile) of N measurements over the stated period
081         */
082        _80PERCENT, 
083        /**
084         * The lower [Quartile](https://en.wikipedia.org/wiki/Quartile) Boundary of N measurements over the stated period
085         */
086        _4LOWER, 
087        /**
088         * The upper [Quartile](https://en.wikipedia.org/wiki/Quartile) Boundary of N measurements over the stated period
089         */
090        _4UPPER, 
091        /**
092         * The difference between the upper and lower [Quartiles](https://en.wikipedia.org/wiki/Quartile) is called the Interquartile range. (IQR = Q3-Q1) Quartile deviation or Semi-interquartile range is one-half the difference between the first and the third quartiles.
093         */
094        _4DEV, 
095        /**
096         * The lowest of four values that divide the N measurements into a frequency distribution of five classes with each containing one fifth of the total population
097         */
098        _51, 
099        /**
100         * The second of four values that divide the N measurements into a frequency distribution of five classes with each containing one fifth of the total population
101         */
102        _52, 
103        /**
104         * The third of four values that divide the N measurements into a frequency distribution of five classes with each containing one fifth of the total population
105         */
106        _53, 
107        /**
108         * The fourth of four values that divide the N measurements into a frequency distribution of five classes with each containing one fifth of the total population
109         */
110        _54, 
111        /**
112         * Skewness is a measure of the asymmetry of the probability distribution of a real-valued random variable about its mean. The skewness value can be positive or negative, or even undefined.  Source: [Wikipedia](https://en.wikipedia.org/wiki/Skewness)
113         */
114        SKEW, 
115        /**
116         * Kurtosis  is a measure of the "tailedness" of the probability distribution of a real-valued random variable.   Source: [Wikipedia](https://en.wikipedia.org/wiki/Kurtosis)
117         */
118        KURTOSIS, 
119        /**
120         * Linear regression is an approach for modeling two-dimensional sample points with one independent variable and one dependent variable (conventionally, the x and y coordinates in a Cartesian coordinate system) and finds a linear function (a non-vertical straight line) that, as accurately as possible, predicts the dependent variable values as a function of the independent variables. Source: [Wikipedia](https://en.wikipedia.org/wiki/Simple_linear_regression)  This Statistic code will return both a gradient and an intercept value.
121         */
122        REGRESSION, 
123        /**
124         * added to help the parsers
125         */
126        NULL;
127        public static ObservationStatistics fromCode(String codeString) throws FHIRException {
128            if (codeString == null || "".equals(codeString))
129                return null;
130        if ("average".equals(codeString))
131          return AVERAGE;
132        if ("maximum".equals(codeString))
133          return MAXIMUM;
134        if ("minimum".equals(codeString))
135          return MINIMUM;
136        if ("count".equals(codeString))
137          return COUNT;
138        if ("totalcount".equals(codeString))
139          return TOTALCOUNT;
140        if ("median".equals(codeString))
141          return MEDIAN;
142        if ("std-dev".equals(codeString))
143          return STDDEV;
144        if ("sum".equals(codeString))
145          return SUM;
146        if ("variance".equals(codeString))
147          return VARIANCE;
148        if ("20-percent".equals(codeString))
149          return _20PERCENT;
150        if ("80-percent".equals(codeString))
151          return _80PERCENT;
152        if ("4-lower".equals(codeString))
153          return _4LOWER;
154        if ("4-upper".equals(codeString))
155          return _4UPPER;
156        if ("4-dev".equals(codeString))
157          return _4DEV;
158        if ("5-1".equals(codeString))
159          return _51;
160        if ("5-2".equals(codeString))
161          return _52;
162        if ("5-3".equals(codeString))
163          return _53;
164        if ("5-4".equals(codeString))
165          return _54;
166        if ("skew".equals(codeString))
167          return SKEW;
168        if ("kurtosis".equals(codeString))
169          return KURTOSIS;
170        if ("regression".equals(codeString))
171          return REGRESSION;
172        throw new FHIRException("Unknown ObservationStatistics code '"+codeString+"'");
173        }
174        public String toCode() {
175          switch (this) {
176            case AVERAGE: return "average";
177            case MAXIMUM: return "maximum";
178            case MINIMUM: return "minimum";
179            case COUNT: return "count";
180            case TOTALCOUNT: return "totalcount";
181            case MEDIAN: return "median";
182            case STDDEV: return "std-dev";
183            case SUM: return "sum";
184            case VARIANCE: return "variance";
185            case _20PERCENT: return "20-percent";
186            case _80PERCENT: return "80-percent";
187            case _4LOWER: return "4-lower";
188            case _4UPPER: return "4-upper";
189            case _4DEV: return "4-dev";
190            case _51: return "5-1";
191            case _52: return "5-2";
192            case _53: return "5-3";
193            case _54: return "5-4";
194            case SKEW: return "skew";
195            case KURTOSIS: return "kurtosis";
196            case REGRESSION: return "regression";
197            default: return "?";
198          }
199        }
200        public String getSystem() {
201          return "http://hl7.org/fhir/observation-statistics";
202        }
203        public String getDefinition() {
204          switch (this) {
205            case AVERAGE: return "The [mean](https://en.wikipedia.org/wiki/Arithmetic_mean) of N measurements over the stated period";
206            case MAXIMUM: return "The [maximum](https://en.wikipedia.org/wiki/Maximal_element) value of N measurements over the stated period";
207            case MINIMUM: return "The [minimum](https://en.wikipedia.org/wiki/Minimal_element) value of N measurements over the stated period";
208            case COUNT: return "The [number] of valid measurements over the stated period that contributed to the other statistical outputs";
209            case TOTALCOUNT: return "The total [number] of valid measurements over the stated period, including observations that were ignored because they did not contain valid result values";
210            case MEDIAN: return "The [median](https://en.wikipedia.org/wiki/Median) of N measurements over the stated period";
211            case STDDEV: return "The [standard deviation](https://en.wikipedia.org/wiki/Standard_deviation) of N measurements over the stated period";
212            case SUM: return "The [sum](https://en.wikipedia.org/wiki/Summation) of N measurements over the stated period";
213            case VARIANCE: return "The [variance](https://en.wikipedia.org/wiki/Variance) of N measurements over the stated period";
214            case _20PERCENT: return "The 20th [Percentile](https://en.wikipedia.org/wiki/Percentile) of N measurements over the stated period";
215            case _80PERCENT: return "The 80th [Percentile](https://en.wikipedia.org/wiki/Percentile) of N measurements over the stated period";
216            case _4LOWER: return "The lower [Quartile](https://en.wikipedia.org/wiki/Quartile) Boundary of N measurements over the stated period";
217            case _4UPPER: return "The upper [Quartile](https://en.wikipedia.org/wiki/Quartile) Boundary of N measurements over the stated period";
218            case _4DEV: return "The difference between the upper and lower [Quartiles](https://en.wikipedia.org/wiki/Quartile) is called the Interquartile range. (IQR = Q3-Q1) Quartile deviation or Semi-interquartile range is one-half the difference between the first and the third quartiles.";
219            case _51: return "The lowest of four values that divide the N measurements into a frequency distribution of five classes with each containing one fifth of the total population";
220            case _52: return "The second of four values that divide the N measurements into a frequency distribution of five classes with each containing one fifth of the total population";
221            case _53: return "The third of four values that divide the N measurements into a frequency distribution of five classes with each containing one fifth of the total population";
222            case _54: return "The fourth of four values that divide the N measurements into a frequency distribution of five classes with each containing one fifth of the total population";
223            case SKEW: return "Skewness is a measure of the asymmetry of the probability distribution of a real-valued random variable about its mean. The skewness value can be positive or negative, or even undefined.  Source: [Wikipedia](https://en.wikipedia.org/wiki/Skewness)";
224            case KURTOSIS: return "Kurtosis  is a measure of the \"tailedness\" of the probability distribution of a real-valued random variable.   Source: [Wikipedia](https://en.wikipedia.org/wiki/Kurtosis)";
225            case REGRESSION: return "Linear regression is an approach for modeling two-dimensional sample points with one independent variable and one dependent variable (conventionally, the x and y coordinates in a Cartesian coordinate system) and finds a linear function (a non-vertical straight line) that, as accurately as possible, predicts the dependent variable values as a function of the independent variables. Source: [Wikipedia](https://en.wikipedia.org/wiki/Simple_linear_regression)  This Statistic code will return both a gradient and an intercept value.";
226            default: return "?";
227          }
228        }
229        public String getDisplay() {
230          switch (this) {
231            case AVERAGE: return "Average";
232            case MAXIMUM: return "Maximum";
233            case MINIMUM: return "Minimum";
234            case COUNT: return "Count";
235            case TOTALCOUNT: return "Total Count";
236            case MEDIAN: return "Median";
237            case STDDEV: return "Standard Deviation";
238            case SUM: return "Sum";
239            case VARIANCE: return "Variance";
240            case _20PERCENT: return "20th Percentile";
241            case _80PERCENT: return "80th Percentile";
242            case _4LOWER: return "Lower Quartile";
243            case _4UPPER: return "Upper Quartile";
244            case _4DEV: return "Quartile Deviation";
245            case _51: return "1st Quintile";
246            case _52: return "2nd Quintile";
247            case _53: return "3rd Quintile";
248            case _54: return "4th Quintile";
249            case SKEW: return "Skew";
250            case KURTOSIS: return "Kurtosis";
251            case REGRESSION: return "Regression";
252            default: return "?";
253          }
254    }
255
256
257}
258