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 LinkType {
037
038  /**
039   * The patient resource containing this link must no longer be used. The link
040   * points forward to another patient resource that must be used in lieu of the
041   * patient resource that contains this link.
042   */
043  REPLACEDBY,
044  /**
045   * The patient resource containing this link is the current active patient
046   * record. The link points back to an inactive patient resource that has been
047   * merged into this resource, and should be consulted to retrieve additional
048   * referenced information.
049   */
050  REPLACES,
051  /**
052   * The patient resource containing this link is in use and valid but not
053   * considered the main source of information about a patient. The link points
054   * forward to another patient resource that should be consulted to retrieve
055   * additional patient information.
056   */
057  REFER,
058  /**
059   * The patient resource containing this link is in use and valid, but points to
060   * another patient resource that is known to contain data about the same person.
061   * Data in this resource might overlap or contradict information found in the
062   * other patient resource. This link does not indicate any relative importance
063   * of the resources concerned, and both should be regarded as equally valid.
064   */
065  SEEALSO,
066  /**
067   * added to help the parsers
068   */
069  NULL;
070
071  public static LinkType fromCode(String codeString) throws FHIRException {
072    if (codeString == null || "".equals(codeString))
073      return null;
074    if ("replaced-by".equals(codeString))
075      return REPLACEDBY;
076    if ("replaces".equals(codeString))
077      return REPLACES;
078    if ("refer".equals(codeString))
079      return REFER;
080    if ("seealso".equals(codeString))
081      return SEEALSO;
082    throw new FHIRException("Unknown LinkType code '" + codeString + "'");
083  }
084
085  public String toCode() {
086    switch (this) {
087    case REPLACEDBY:
088      return "replaced-by";
089    case REPLACES:
090      return "replaces";
091    case REFER:
092      return "refer";
093    case SEEALSO:
094      return "seealso";
095    case NULL:
096      return null;
097    default:
098      return "?";
099    }
100  }
101
102  public String getSystem() {
103    return "http://hl7.org/fhir/link-type";
104  }
105
106  public String getDefinition() {
107    switch (this) {
108    case REPLACEDBY:
109      return "The patient resource containing this link must no longer be used. The link points forward to another patient resource that must be used in lieu of the patient resource that contains this link.";
110    case REPLACES:
111      return "The patient resource containing this link is the current active patient record. The link points back to an inactive patient resource that has been merged into this resource, and should be consulted to retrieve additional referenced information.";
112    case REFER:
113      return "The patient resource containing this link is in use and valid but not considered the main source of information about a patient. The link points forward to another patient resource that should be consulted to retrieve additional patient information.";
114    case SEEALSO:
115      return "The patient resource containing this link is in use and valid, but points to another patient resource that is known to contain data about the same person. Data in this resource might overlap or contradict information found in the other patient resource. This link does not indicate any relative importance of the resources concerned, and both should be regarded as equally valid.";
116    case NULL:
117      return null;
118    default:
119      return "?";
120    }
121  }
122
123  public String getDisplay() {
124    switch (this) {
125    case REPLACEDBY:
126      return "Replaced-by";
127    case REPLACES:
128      return "Replaces";
129    case REFER:
130      return "Refer";
131    case SEEALSO:
132      return "See also";
133    case NULL:
134      return null;
135    default:
136      return "?";
137    }
138  }
139
140}