001package org.hl7.fhir.r5.model.codesystems;
002
003/*
004 * #%L
005 * org.hl7.fhir.r5
006 * %%
007 * Copyright (C) 2014 - 2019 Health Level 7
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 * 
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 * 
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023/*
024  Copyright (c) 2011+, HL7, Inc.
025  All rights reserved.
026  
027  Redistribution and use in source and binary forms, with or without modification, 
028  are permitted provided that the following conditions are met:
029  
030   * Redistributions of source code must retain the above copyright notice, this 
031     list of conditions and the following disclaimer.
032   * Redistributions in binary form must reproduce the above copyright notice, 
033     this list of conditions and the following disclaimer in the documentation 
034     and/or other materials provided with the distribution.
035   * Neither the name of HL7 nor the names of its contributors may be used to 
036     endorse or promote products derived from this software without specific 
037     prior written permission.
038  
039  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
040  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
041  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
042  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
043  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
044  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
045  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
046  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
047  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
048  POSSIBILITY OF SUCH DAMAGE.
049  
050*/
051
052// Generated on Thu, Oct 17, 2019 09:42+1100 for FHIR v4.1.0
053
054
055import org.hl7.fhir.exceptions.FHIRException;
056
057public enum ObservationStatistics {
058
059        /**
060         * The [mean](https://en.wikipedia.org/wiki/Arithmetic_mean) of N measurements over the stated period.
061         */
062        AVERAGE, 
063        /**
064         * The [maximum](https://en.wikipedia.org/wiki/Maximal_element) value of N measurements over the stated period.
065         */
066        MAXIMUM, 
067        /**
068         * The [minimum](https://en.wikipedia.org/wiki/Minimal_element) value of N measurements over the stated period.
069         */
070        MINIMUM, 
071        /**
072         * The [number] of valid measurements over the stated period that contributed to the other statistical outputs.
073         */
074        COUNT, 
075        /**
076         * The total [number] of valid measurements over the stated period, including observations that were ignored because they did not contain valid result values.
077         */
078        TOTALCOUNT, 
079        /**
080         * The [median](https://en.wikipedia.org/wiki/Median) of N measurements over the stated period.
081         */
082        MEDIAN, 
083        /**
084         * The [standard deviation](https://en.wikipedia.org/wiki/Standard_deviation) of N measurements over the stated period.
085         */
086        STDDEV, 
087        /**
088         * The [sum](https://en.wikipedia.org/wiki/Summation) of N measurements over the stated period.
089         */
090        SUM, 
091        /**
092         * The [variance](https://en.wikipedia.org/wiki/Variance) of N measurements over the stated period.
093         */
094        VARIANCE, 
095        /**
096         * The 20th [Percentile](https://en.wikipedia.org/wiki/Percentile) of N measurements over the stated period.
097         */
098        _20PERCENT, 
099        /**
100         * The 80th [Percentile](https://en.wikipedia.org/wiki/Percentile) of N measurements over the stated period.
101         */
102        _80PERCENT, 
103        /**
104         * The lower [Quartile](https://en.wikipedia.org/wiki/Quartile) Boundary of N measurements over the stated period.
105         */
106        _4LOWER, 
107        /**
108         * The upper [Quartile](https://en.wikipedia.org/wiki/Quartile) Boundary of N measurements over the stated period.
109         */
110        _4UPPER, 
111        /**
112         * 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.
113         */
114        _4DEV, 
115        /**
116         * 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.
117         */
118        _51, 
119        /**
120         * 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.
121         */
122        _52, 
123        /**
124         * 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.
125         */
126        _53, 
127        /**
128         * 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.
129         */
130        _54, 
131        /**
132         * 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).
133         */
134        SKEW, 
135        /**
136         * 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).
137         */
138        KURTOSIS, 
139        /**
140         * 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.
141         */
142        REGRESSION, 
143        /**
144         * added to help the parsers
145         */
146        NULL;
147        public static ObservationStatistics fromCode(String codeString) throws FHIRException {
148            if (codeString == null || "".equals(codeString))
149                return null;
150        if ("average".equals(codeString))
151          return AVERAGE;
152        if ("maximum".equals(codeString))
153          return MAXIMUM;
154        if ("minimum".equals(codeString))
155          return MINIMUM;
156        if ("count".equals(codeString))
157          return COUNT;
158        if ("total-count".equals(codeString))
159          return TOTALCOUNT;
160        if ("median".equals(codeString))
161          return MEDIAN;
162        if ("std-dev".equals(codeString))
163          return STDDEV;
164        if ("sum".equals(codeString))
165          return SUM;
166        if ("variance".equals(codeString))
167          return VARIANCE;
168        if ("20-percent".equals(codeString))
169          return _20PERCENT;
170        if ("80-percent".equals(codeString))
171          return _80PERCENT;
172        if ("4-lower".equals(codeString))
173          return _4LOWER;
174        if ("4-upper".equals(codeString))
175          return _4UPPER;
176        if ("4-dev".equals(codeString))
177          return _4DEV;
178        if ("5-1".equals(codeString))
179          return _51;
180        if ("5-2".equals(codeString))
181          return _52;
182        if ("5-3".equals(codeString))
183          return _53;
184        if ("5-4".equals(codeString))
185          return _54;
186        if ("skew".equals(codeString))
187          return SKEW;
188        if ("kurtosis".equals(codeString))
189          return KURTOSIS;
190        if ("regression".equals(codeString))
191          return REGRESSION;
192        throw new FHIRException("Unknown ObservationStatistics code '"+codeString+"'");
193        }
194        public String toCode() {
195          switch (this) {
196            case AVERAGE: return "average";
197            case MAXIMUM: return "maximum";
198            case MINIMUM: return "minimum";
199            case COUNT: return "count";
200            case TOTALCOUNT: return "total-count";
201            case MEDIAN: return "median";
202            case STDDEV: return "std-dev";
203            case SUM: return "sum";
204            case VARIANCE: return "variance";
205            case _20PERCENT: return "20-percent";
206            case _80PERCENT: return "80-percent";
207            case _4LOWER: return "4-lower";
208            case _4UPPER: return "4-upper";
209            case _4DEV: return "4-dev";
210            case _51: return "5-1";
211            case _52: return "5-2";
212            case _53: return "5-3";
213            case _54: return "5-4";
214            case SKEW: return "skew";
215            case KURTOSIS: return "kurtosis";
216            case REGRESSION: return "regression";
217            default: return "?";
218          }
219        }
220        public String getSystem() {
221          return "http://terminology.hl7.org/CodeSystem/observation-statistics";
222        }
223        public String getDefinition() {
224          switch (this) {
225            case AVERAGE: return "The [mean](https://en.wikipedia.org/wiki/Arithmetic_mean) of N measurements over the stated period.";
226            case MAXIMUM: return "The [maximum](https://en.wikipedia.org/wiki/Maximal_element) value of N measurements over the stated period.";
227            case MINIMUM: return "The [minimum](https://en.wikipedia.org/wiki/Minimal_element) value of N measurements over the stated period.";
228            case COUNT: return "The [number] of valid measurements over the stated period that contributed to the other statistical outputs.";
229            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.";
230            case MEDIAN: return "The [median](https://en.wikipedia.org/wiki/Median) of N measurements over the stated period.";
231            case STDDEV: return "The [standard deviation](https://en.wikipedia.org/wiki/Standard_deviation) of N measurements over the stated period.";
232            case SUM: return "The [sum](https://en.wikipedia.org/wiki/Summation) of N measurements over the stated period.";
233            case VARIANCE: return "The [variance](https://en.wikipedia.org/wiki/Variance) of N measurements over the stated period.";
234            case _20PERCENT: return "The 20th [Percentile](https://en.wikipedia.org/wiki/Percentile) of N measurements over the stated period.";
235            case _80PERCENT: return "The 80th [Percentile](https://en.wikipedia.org/wiki/Percentile) of N measurements over the stated period.";
236            case _4LOWER: return "The lower [Quartile](https://en.wikipedia.org/wiki/Quartile) Boundary of N measurements over the stated period.";
237            case _4UPPER: return "The upper [Quartile](https://en.wikipedia.org/wiki/Quartile) Boundary of N measurements over the stated period.";
238            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.";
239            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.";
240            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.";
241            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.";
242            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.";
243            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).";
244            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).";
245            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.";
246            default: return "?";
247          }
248        }
249        public String getDisplay() {
250          switch (this) {
251            case AVERAGE: return "Average";
252            case MAXIMUM: return "Maximum";
253            case MINIMUM: return "Minimum";
254            case COUNT: return "Count";
255            case TOTALCOUNT: return "Total Count";
256            case MEDIAN: return "Median";
257            case STDDEV: return "Standard Deviation";
258            case SUM: return "Sum";
259            case VARIANCE: return "Variance";
260            case _20PERCENT: return "20th Percentile";
261            case _80PERCENT: return "80th Percentile";
262            case _4LOWER: return "Lower Quartile";
263            case _4UPPER: return "Upper Quartile";
264            case _4DEV: return "Quartile Deviation";
265            case _51: return "1st Quintile";
266            case _52: return "2nd Quintile";
267            case _53: return "3rd Quintile";
268            case _54: return "4th Quintile";
269            case SKEW: return "Skew";
270            case KURTOSIS: return "Kurtosis";
271            case REGRESSION: return "Regression";
272            default: return "?";
273          }
274    }
275
276
277}
278