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 QuestionnaireAnswersStatus {
037
038  /**
039   * This QuestionnaireResponse has been partially filled out with answers but
040   * changes or additions are still expected to be made to it.
041   */
042  INPROGRESS,
043  /**
044   * This QuestionnaireResponse has been filled out with answers and the current
045   * content is regarded as definitive.
046   */
047  COMPLETED,
048  /**
049   * This QuestionnaireResponse has been filled out with answers, then marked as
050   * complete, yet changes or additions have been made to it afterwards.
051   */
052  AMENDED,
053  /**
054   * This QuestionnaireResponse was entered in error and voided.
055   */
056  ENTEREDINERROR,
057  /**
058   * This QuestionnaireResponse has been partially filled out with answers but has
059   * been abandoned. It is unknown whether changes or additions are expected to be
060   * made to it.
061   */
062  STOPPED,
063  /**
064   * added to help the parsers
065   */
066  NULL;
067
068  public static QuestionnaireAnswersStatus fromCode(String codeString) throws FHIRException {
069    if (codeString == null || "".equals(codeString))
070      return null;
071    if ("in-progress".equals(codeString))
072      return INPROGRESS;
073    if ("completed".equals(codeString))
074      return COMPLETED;
075    if ("amended".equals(codeString))
076      return AMENDED;
077    if ("entered-in-error".equals(codeString))
078      return ENTEREDINERROR;
079    if ("stopped".equals(codeString))
080      return STOPPED;
081    throw new FHIRException("Unknown QuestionnaireAnswersStatus code '" + codeString + "'");
082  }
083
084  public String toCode() {
085    switch (this) {
086    case INPROGRESS:
087      return "in-progress";
088    case COMPLETED:
089      return "completed";
090    case AMENDED:
091      return "amended";
092    case ENTEREDINERROR:
093      return "entered-in-error";
094    case STOPPED:
095      return "stopped";
096    case NULL:
097      return null;
098    default:
099      return "?";
100    }
101  }
102
103  public String getSystem() {
104    return "http://hl7.org/fhir/questionnaire-answers-status";
105  }
106
107  public String getDefinition() {
108    switch (this) {
109    case INPROGRESS:
110      return "This QuestionnaireResponse has been partially filled out with answers but changes or additions are still expected to be made to it.";
111    case COMPLETED:
112      return "This QuestionnaireResponse has been filled out with answers and the current content is regarded as definitive.";
113    case AMENDED:
114      return "This QuestionnaireResponse has been filled out with answers, then marked as complete, yet changes or additions have been made to it afterwards.";
115    case ENTEREDINERROR:
116      return "This QuestionnaireResponse was entered in error and voided.";
117    case STOPPED:
118      return "This QuestionnaireResponse has been partially filled out with answers but has been abandoned. It is unknown whether changes or additions are expected to be made to it.";
119    case NULL:
120      return null;
121    default:
122      return "?";
123    }
124  }
125
126  public String getDisplay() {
127    switch (this) {
128    case INPROGRESS:
129      return "In Progress";
130    case COMPLETED:
131      return "Completed";
132    case AMENDED:
133      return "Amended";
134    case ENTEREDINERROR:
135      return "Entered in Error";
136    case STOPPED:
137      return "Stopped";
138    case NULL:
139      return null;
140    default:
141      return "?";
142    }
143  }
144
145}