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 V3IdentifierScope {
037
038  /**
039   * Description: An identifier whose scope is defined by the business practices
040   * associated with the object. In contrast to the other scope identifiers, the
041   * scope of the use of the id is not necessarily restricted to a single object,
042   * but may be reused for other objects closely associated with the object due to
043   * business practice.
044   */
045  BUSN,
046  /**
047   * Description: The identifier associated with a particular object. It remains
048   * consistent as the object undergoes state transitions.
049   */
050  OBJ,
051  /**
052   * Description: An identifier that references a particular object as it existed
053   * at a given point in time. The identifier SHALL change with each state
054   * transition on the object. I.e. The version identifier of an object prior to a
055   * 'suspend' state transition is distinct from the identifier of the object
056   * after the state transition. Each version identifier can be tied to exactly
057   * one ControlAct event which brought that version into being (though the
058   * control act may never be instantiated).
059   * 
060   * 
061   * NOTE: Applications that do not support versioning of objects must ignore and
062   * not persist these ids to avoid confusion resulting from leaving the same
063   * identifier on an object that undergoes changes.
064   */
065  VER,
066  /**
067   * Description: An identifier that references a particular object as it existed
068   * at a given point in time. The identifier SHALL change with each state
069   * transition on the object.
070   * 
071   * 
072   * Example The version identifier of an object prior to a 'suspend' state
073   * transition is distinct from the identifier of the object after the state
074   * transition. Each version identifier can be tied to exactly one ControlAct
075   * event which brought that version into being (though the control act may never
076   * be instantiated).
077   * 
078   * 
079   * NOTE: Applications that do not support versioning of objects must ignore and
080   * not persist these ids to avoid confusion resulting from leaving the same
081   * identifier on an object that undergoes changes.
082   */
083  VW,
084  /**
085   * added to help the parsers
086   */
087  NULL;
088
089  public static V3IdentifierScope fromCode(String codeString) throws FHIRException {
090    if (codeString == null || "".equals(codeString))
091      return null;
092    if ("BUSN".equals(codeString))
093      return BUSN;
094    if ("OBJ".equals(codeString))
095      return OBJ;
096    if ("VER".equals(codeString))
097      return VER;
098    if ("VW".equals(codeString))
099      return VW;
100    throw new FHIRException("Unknown V3IdentifierScope code '" + codeString + "'");
101  }
102
103  public String toCode() {
104    switch (this) {
105    case BUSN:
106      return "BUSN";
107    case OBJ:
108      return "OBJ";
109    case VER:
110      return "VER";
111    case VW:
112      return "VW";
113    case NULL:
114      return null;
115    default:
116      return "?";
117    }
118  }
119
120  public String getSystem() {
121    return "http://terminology.hl7.org/CodeSystem/v3-IdentifierScope";
122  }
123
124  public String getDefinition() {
125    switch (this) {
126    case BUSN:
127      return "Description: An identifier whose scope is defined by the business practices associated with the object. In contrast to the other scope identifiers, the scope of the use of the id is not necessarily restricted to a single object, but may be reused for other objects closely associated with the object due to business practice.";
128    case OBJ:
129      return "Description: The identifier associated with a particular object. It remains consistent as the object undergoes state transitions.";
130    case VER:
131      return "Description: An identifier that references a particular object as it existed at a given point in time. The identifier SHALL change with each state transition on the object. I.e. The version identifier of an object prior to a 'suspend' state transition is distinct from the identifier of the object after the state transition. Each version identifier can be tied to exactly one ControlAct event which brought that version into being (though the control act may never be instantiated).\r\n\n                        \n                            NOTE: Applications that do not support versioning of objects must ignore and not persist these ids to avoid confusion resulting from leaving the same identifier on an object that undergoes changes.";
132    case VW:
133      return "Description: An identifier that references a particular object as it existed at a given point in time. The identifier SHALL change with each state transition on the object.\r\n\n                        \n                           Example The version identifier of an object prior to a 'suspend' state transition is distinct from the identifier of the object after the state transition. Each version identifier can be tied to exactly one ControlAct event which brought that version into being (though the control act may never be instantiated).\r\n\n                        \n                            NOTE: Applications that do not support versioning of objects must ignore and not persist these ids to avoid confusion resulting from leaving the same identifier on an object that undergoes changes.";
134    case NULL:
135      return null;
136    default:
137      return "?";
138    }
139  }
140
141  public String getDisplay() {
142    switch (this) {
143    case BUSN:
144      return "Business Identifier";
145    case OBJ:
146      return "Object Identifier";
147    case VER:
148      return "Version Identifier";
149    case VW:
150      return "View Specific Identifier";
151    case NULL:
152      return null;
153    default:
154      return "?";
155    }
156  }
157
158}