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 TriggerType {
037
038  /**
039   * The trigger occurs in response to a specific named event, and no other
040   * information about the trigger is specified. Named events are completely
041   * pre-coordinated, and the formal semantics of the trigger are not provided.
042   */
043  NAMEDEVENT,
044  /**
045   * The trigger occurs at a specific time or periodically as described by a
046   * timing or schedule. A periodic event cannot have any data elements, but may
047   * have a name assigned as a shorthand for the event.
048   */
049  PERIODIC,
050  /**
051   * The trigger occurs whenever data of a particular type is changed in any way,
052   * either added, modified, or removed.
053   */
054  DATACHANGED,
055  /**
056   * The trigger occurs whenever data of a particular type is added.
057   */
058  DATAADDED,
059  /**
060   * The trigger occurs whenever data of a particular type is modified.
061   */
062  DATAMODIFIED,
063  /**
064   * The trigger occurs whenever data of a particular type is removed.
065   */
066  DATAREMOVED,
067  /**
068   * The trigger occurs whenever data of a particular type is accessed.
069   */
070  DATAACCESSED,
071  /**
072   * The trigger occurs whenever access to data of a particular type is completed.
073   */
074  DATAACCESSENDED,
075  /**
076   * added to help the parsers
077   */
078  NULL;
079
080  public static TriggerType fromCode(String codeString) throws FHIRException {
081    if (codeString == null || "".equals(codeString))
082      return null;
083    if ("named-event".equals(codeString))
084      return NAMEDEVENT;
085    if ("periodic".equals(codeString))
086      return PERIODIC;
087    if ("data-changed".equals(codeString))
088      return DATACHANGED;
089    if ("data-added".equals(codeString))
090      return DATAADDED;
091    if ("data-modified".equals(codeString))
092      return DATAMODIFIED;
093    if ("data-removed".equals(codeString))
094      return DATAREMOVED;
095    if ("data-accessed".equals(codeString))
096      return DATAACCESSED;
097    if ("data-access-ended".equals(codeString))
098      return DATAACCESSENDED;
099    throw new FHIRException("Unknown TriggerType code '" + codeString + "'");
100  }
101
102  public String toCode() {
103    switch (this) {
104    case NAMEDEVENT:
105      return "named-event";
106    case PERIODIC:
107      return "periodic";
108    case DATACHANGED:
109      return "data-changed";
110    case DATAADDED:
111      return "data-added";
112    case DATAMODIFIED:
113      return "data-modified";
114    case DATAREMOVED:
115      return "data-removed";
116    case DATAACCESSED:
117      return "data-accessed";
118    case DATAACCESSENDED:
119      return "data-access-ended";
120    case NULL:
121      return null;
122    default:
123      return "?";
124    }
125  }
126
127  public String getSystem() {
128    return "http://hl7.org/fhir/trigger-type";
129  }
130
131  public String getDefinition() {
132    switch (this) {
133    case NAMEDEVENT:
134      return "The trigger occurs in response to a specific named event, and no other information about the trigger is specified. Named events are completely pre-coordinated, and the formal semantics of the trigger are not provided.";
135    case PERIODIC:
136      return "The trigger occurs at a specific time or periodically as described by a timing or schedule. A periodic event cannot have any data elements, but may have a name assigned as a shorthand for the event.";
137    case DATACHANGED:
138      return "The trigger occurs whenever data of a particular type is changed in any way, either added, modified, or removed.";
139    case DATAADDED:
140      return "The trigger occurs whenever data of a particular type is added.";
141    case DATAMODIFIED:
142      return "The trigger occurs whenever data of a particular type is modified.";
143    case DATAREMOVED:
144      return "The trigger occurs whenever data of a particular type is removed.";
145    case DATAACCESSED:
146      return "The trigger occurs whenever data of a particular type is accessed.";
147    case DATAACCESSENDED:
148      return "The trigger occurs whenever access to data of a particular type is completed.";
149    case NULL:
150      return null;
151    default:
152      return "?";
153    }
154  }
155
156  public String getDisplay() {
157    switch (this) {
158    case NAMEDEVENT:
159      return "Named Event";
160    case PERIODIC:
161      return "Periodic";
162    case DATACHANGED:
163      return "Data Changed";
164    case DATAADDED:
165      return "Data Added";
166    case DATAMODIFIED:
167      return "Data Updated";
168    case DATAREMOVED:
169      return "Data Removed";
170    case DATAACCESSED:
171      return "Data Accessed";
172    case DATAACCESSENDED:
173      return "Data Access Ended";
174    case NULL:
175      return null;
176    default:
177      return "?";
178    }
179  }
180
181}