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 ActionGroupingBehavior {
037
038  /**
039   * Any group marked with this behavior should be displayed as a visual group to
040   * the end user.
041   */
042  VISUALGROUP,
043  /**
044   * A group with this behavior logically groups its sub-elements, and may be
045   * shown as a visual group to the end user, but it is not required to do so.
046   */
047  LOGICALGROUP,
048  /**
049   * A group of related alternative actions is a sentence group if the target
050   * referenced by the action is the same in all the actions and each action
051   * simply constitutes a different variation on how to specify the details for
052   * the target. For example, two actions that could be in a SentenceGroup are
053   * "aspirin, 500 mg, 2 times per day" and "aspirin, 300 mg, 3 times per day". In
054   * both cases, aspirin is the target referenced by the action, and the two
055   * actions represent different options for how aspirin might be ordered for the
056   * patient. Note that a SentenceGroup would almost always have an associated
057   * selection behavior of "AtMostOne", unless it's a required action, in which
058   * case, it would be "ExactlyOne".
059   */
060  SENTENCEGROUP,
061  /**
062   * added to help the parsers
063   */
064  NULL;
065
066  public static ActionGroupingBehavior fromCode(String codeString) throws FHIRException {
067    if (codeString == null || "".equals(codeString))
068      return null;
069    if ("visual-group".equals(codeString))
070      return VISUALGROUP;
071    if ("logical-group".equals(codeString))
072      return LOGICALGROUP;
073    if ("sentence-group".equals(codeString))
074      return SENTENCEGROUP;
075    throw new FHIRException("Unknown ActionGroupingBehavior code '" + codeString + "'");
076  }
077
078  public String toCode() {
079    switch (this) {
080    case VISUALGROUP:
081      return "visual-group";
082    case LOGICALGROUP:
083      return "logical-group";
084    case SENTENCEGROUP:
085      return "sentence-group";
086    case NULL:
087      return null;
088    default:
089      return "?";
090    }
091  }
092
093  public String getSystem() {
094    return "http://hl7.org/fhir/action-grouping-behavior";
095  }
096
097  public String getDefinition() {
098    switch (this) {
099    case VISUALGROUP:
100      return "Any group marked with this behavior should be displayed as a visual group to the end user.";
101    case LOGICALGROUP:
102      return "A group with this behavior logically groups its sub-elements, and may be shown as a visual group to the end user, but it is not required to do so.";
103    case SENTENCEGROUP:
104      return "A group of related alternative actions is a sentence group if the target referenced by the action is the same in all the actions and each action simply constitutes a different variation on how to specify the details for the target. For example, two actions that could be in a SentenceGroup are \"aspirin, 500 mg, 2 times per day\" and \"aspirin, 300 mg, 3 times per day\". In both cases, aspirin is the target referenced by the action, and the two actions represent different options for how aspirin might be ordered for the patient. Note that a SentenceGroup would almost always have an associated selection behavior of \"AtMostOne\", unless it's a required action, in which case, it would be \"ExactlyOne\".";
105    case NULL:
106      return null;
107    default:
108      return "?";
109    }
110  }
111
112  public String getDisplay() {
113    switch (this) {
114    case VISUALGROUP:
115      return "Visual Group";
116    case LOGICALGROUP:
117      return "Logical Group";
118    case SENTENCEGROUP:
119      return "Sentence Group";
120    case NULL:
121      return null;
122    default:
123      return "?";
124    }
125  }
126
127}