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 Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0
033
034import org.hl7.fhir.exceptions.FHIRException;
035
036public enum RiskEstimateType {
037
038  /**
039   * dichotomous measure (present or absent) reported as a ratio compared to the
040   * denominator of 1 (A percentage is a proportion with denominator of 100).
041   */
042  PROPORTION,
043  /**
044   * A special use case where the proportion is derived from a formula rather than
045   * derived from summary evidence.
046   */
047  DERIVEDPROPORTION,
048  /**
049   * continuous numerical measure reported as an average.
050   */
051  MEAN,
052  /**
053   * continuous numerical measure reported as the middle of the range.
054   */
055  MEDIAN,
056  /**
057   * descriptive measure reported as total number of items.
058   */
059  COUNT,
060  /**
061   * descriptive measure reported as narrative.
062   */
063  DESCRIPTIVE,
064  /**
065   * added to help the parsers
066   */
067  NULL;
068
069  public static RiskEstimateType fromCode(String codeString) throws FHIRException {
070    if (codeString == null || "".equals(codeString))
071      return null;
072    if ("proportion".equals(codeString))
073      return PROPORTION;
074    if ("derivedProportion".equals(codeString))
075      return DERIVEDPROPORTION;
076    if ("mean".equals(codeString))
077      return MEAN;
078    if ("median".equals(codeString))
079      return MEDIAN;
080    if ("count".equals(codeString))
081      return COUNT;
082    if ("descriptive".equals(codeString))
083      return DESCRIPTIVE;
084    throw new FHIRException("Unknown RiskEstimateType code '" + codeString + "'");
085  }
086
087  public String toCode() {
088    switch (this) {
089    case PROPORTION:
090      return "proportion";
091    case DERIVEDPROPORTION:
092      return "derivedProportion";
093    case MEAN:
094      return "mean";
095    case MEDIAN:
096      return "median";
097    case COUNT:
098      return "count";
099    case DESCRIPTIVE:
100      return "descriptive";
101    case NULL:
102      return null;
103    default:
104      return "?";
105    }
106  }
107
108  public String getSystem() {
109    return "http://terminology.hl7.org/CodeSystem/risk-estimate-type";
110  }
111
112  public String getDefinition() {
113    switch (this) {
114    case PROPORTION:
115      return "dichotomous measure (present or absent) reported as a ratio compared to the denominator of 1 (A percentage is a proportion with denominator of 100).";
116    case DERIVEDPROPORTION:
117      return "A special use case where the proportion is derived from a formula rather than derived from summary evidence.";
118    case MEAN:
119      return "continuous numerical measure reported as an average.";
120    case MEDIAN:
121      return "continuous numerical measure reported as the middle of the range.";
122    case COUNT:
123      return "descriptive measure reported as total number of items.";
124    case DESCRIPTIVE:
125      return "descriptive measure reported as narrative.";
126    case NULL:
127      return null;
128    default:
129      return "?";
130    }
131  }
132
133  public String getDisplay() {
134    switch (this) {
135    case PROPORTION:
136      return "proportion";
137    case DERIVEDPROPORTION:
138      return "derivedProportion";
139    case MEAN:
140      return "mean";
141    case MEDIAN:
142      return "median";
143    case COUNT:
144      return "count";
145    case DESCRIPTIVE:
146      return "descriptive";
147    case NULL:
148      return null;
149    default:
150      return "?";
151    }
152  }
153
154}