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 V3EntityNamePartTypeR2 {
037
038  /**
039   * Description:A delimiter has no meaning other than being literally printed in
040   * this name representation. A delimiter has no implicit leading and trailing
041   * white space.
042   */
043  DEL,
044  /**
045   * Description:Family name, this is the name that links to the genealogy. In
046   * some cultures (e.g. Eritrea) the family name of a son is the first name of
047   * his father.
048   */
049  FAM,
050  /**
051   * Description:Given name. Note: don't call it "first name" since the given
052   * names do not always come first.
053   */
054  GIV,
055  /**
056   * Description:Part of the name that is acquired as a title due to academic,
057   * legal, employment or nobility status etc.
058   * 
059   * 
060   * Note:Title name parts include name parts that come after the name such as
061   * qualifications, even if they are not always considered to be titles.
062   */
063  TITLE,
064  /**
065   * added to help the parsers
066   */
067  NULL;
068
069  public static V3EntityNamePartTypeR2 fromCode(String codeString) throws FHIRException {
070    if (codeString == null || "".equals(codeString))
071      return null;
072    if ("DEL".equals(codeString))
073      return DEL;
074    if ("FAM".equals(codeString))
075      return FAM;
076    if ("GIV".equals(codeString))
077      return GIV;
078    if ("TITLE".equals(codeString))
079      return TITLE;
080    throw new FHIRException("Unknown V3EntityNamePartTypeR2 code '" + codeString + "'");
081  }
082
083  public String toCode() {
084    switch (this) {
085    case DEL:
086      return "DEL";
087    case FAM:
088      return "FAM";
089    case GIV:
090      return "GIV";
091    case TITLE:
092      return "TITLE";
093    case NULL:
094      return null;
095    default:
096      return "?";
097    }
098  }
099
100  public String getSystem() {
101    return "http://terminology.hl7.org/CodeSystem/v3-EntityNamePartTypeR2";
102  }
103
104  public String getDefinition() {
105    switch (this) {
106    case DEL:
107      return "Description:A delimiter has no meaning other than being literally printed in this name representation. A delimiter has no implicit leading and trailing white space.";
108    case FAM:
109      return "Description:Family name, this is the name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.";
110    case GIV:
111      return "Description:Given name. Note: don't call it \"first name\" since the given names do not always come first.";
112    case TITLE:
113      return "Description:Part of the name that is acquired as a title due to academic, legal, employment or nobility status etc.\r\n\n                        \n                           Note:Title name parts include name parts that come after the name such as qualifications, even if they are not always considered to be titles.";
114    case NULL:
115      return null;
116    default:
117      return "?";
118    }
119  }
120
121  public String getDisplay() {
122    switch (this) {
123    case DEL:
124      return "delimiter";
125    case FAM:
126      return "family";
127    case GIV:
128      return "given";
129    case TITLE:
130      return "title";
131    case NULL:
132      return null;
133    default:
134      return "?";
135    }
136  }
137
138}