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