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.r4.model.EnumFactory;
035
036public class MapTransformEnumFactory implements EnumFactory<MapTransform> {
037
038  public MapTransform fromCode(String codeString) throws IllegalArgumentException {
039    if (codeString == null || "".equals(codeString))
040      return null;
041    if ("create".equals(codeString))
042      return MapTransform.CREATE;
043    if ("copy".equals(codeString))
044      return MapTransform.COPY;
045    if ("truncate".equals(codeString))
046      return MapTransform.TRUNCATE;
047    if ("escape".equals(codeString))
048      return MapTransform.ESCAPE;
049    if ("cast".equals(codeString))
050      return MapTransform.CAST;
051    if ("append".equals(codeString))
052      return MapTransform.APPEND;
053    if ("translate".equals(codeString))
054      return MapTransform.TRANSLATE;
055    if ("reference".equals(codeString))
056      return MapTransform.REFERENCE;
057    if ("dateOp".equals(codeString))
058      return MapTransform.DATEOP;
059    if ("uuid".equals(codeString))
060      return MapTransform.UUID;
061    if ("pointer".equals(codeString))
062      return MapTransform.POINTER;
063    if ("evaluate".equals(codeString))
064      return MapTransform.EVALUATE;
065    if ("cc".equals(codeString))
066      return MapTransform.CC;
067    if ("c".equals(codeString))
068      return MapTransform.C;
069    if ("qty".equals(codeString))
070      return MapTransform.QTY;
071    if ("id".equals(codeString))
072      return MapTransform.ID;
073    if ("cp".equals(codeString))
074      return MapTransform.CP;
075    throw new IllegalArgumentException("Unknown MapTransform code '" + codeString + "'");
076  }
077
078  public String toCode(MapTransform code) {
079       if (code == MapTransform.NULL)
080           return null;
081       if (code == MapTransform.CREATE)
082      return "create";
083    if (code == MapTransform.COPY)
084      return "copy";
085    if (code == MapTransform.TRUNCATE)
086      return "truncate";
087    if (code == MapTransform.ESCAPE)
088      return "escape";
089    if (code == MapTransform.CAST)
090      return "cast";
091    if (code == MapTransform.APPEND)
092      return "append";
093    if (code == MapTransform.TRANSLATE)
094      return "translate";
095    if (code == MapTransform.REFERENCE)
096      return "reference";
097    if (code == MapTransform.DATEOP)
098      return "dateOp";
099    if (code == MapTransform.UUID)
100      return "uuid";
101    if (code == MapTransform.POINTER)
102      return "pointer";
103    if (code == MapTransform.EVALUATE)
104      return "evaluate";
105    if (code == MapTransform.CC)
106      return "cc";
107    if (code == MapTransform.C)
108      return "c";
109    if (code == MapTransform.QTY)
110      return "qty";
111    if (code == MapTransform.ID)
112      return "id";
113    if (code == MapTransform.CP)
114      return "cp";
115    return "?";
116   }
117
118  public String toSystem(MapTransform code) {
119    return code.getSystem();
120  }
121
122}