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 ServicePlaceEnumFactory implements EnumFactory<ServicePlace> {
037
038  public ServicePlace fromCode(String codeString) throws IllegalArgumentException {
039    if (codeString == null || "".equals(codeString))
040      return null;
041    if ("01".equals(codeString))
042      return ServicePlace._01;
043    if ("03".equals(codeString))
044      return ServicePlace._03;
045    if ("04".equals(codeString))
046      return ServicePlace._04;
047    if ("05".equals(codeString))
048      return ServicePlace._05;
049    if ("06".equals(codeString))
050      return ServicePlace._06;
051    if ("07".equals(codeString))
052      return ServicePlace._07;
053    if ("08".equals(codeString))
054      return ServicePlace._08;
055    if ("09".equals(codeString))
056      return ServicePlace._09;
057    if ("11".equals(codeString))
058      return ServicePlace._11;
059    if ("12".equals(codeString))
060      return ServicePlace._12;
061    if ("13".equals(codeString))
062      return ServicePlace._13;
063    if ("14".equals(codeString))
064      return ServicePlace._14;
065    if ("15".equals(codeString))
066      return ServicePlace._15;
067    if ("19".equals(codeString))
068      return ServicePlace._19;
069    if ("20".equals(codeString))
070      return ServicePlace._20;
071    if ("21".equals(codeString))
072      return ServicePlace._21;
073    if ("41".equals(codeString))
074      return ServicePlace._41;
075    throw new IllegalArgumentException("Unknown ServicePlace code '" + codeString + "'");
076  }
077
078  public String toCode(ServicePlace code) {
079       if (code == ServicePlace.NULL)
080           return null;
081       if (code == ServicePlace._01)
082      return "01";
083    if (code == ServicePlace._03)
084      return "03";
085    if (code == ServicePlace._04)
086      return "04";
087    if (code == ServicePlace._05)
088      return "05";
089    if (code == ServicePlace._06)
090      return "06";
091    if (code == ServicePlace._07)
092      return "07";
093    if (code == ServicePlace._08)
094      return "08";
095    if (code == ServicePlace._09)
096      return "09";
097    if (code == ServicePlace._11)
098      return "11";
099    if (code == ServicePlace._12)
100      return "12";
101    if (code == ServicePlace._13)
102      return "13";
103    if (code == ServicePlace._14)
104      return "14";
105    if (code == ServicePlace._15)
106      return "15";
107    if (code == ServicePlace._19)
108      return "19";
109    if (code == ServicePlace._20)
110      return "20";
111    if (code == ServicePlace._21)
112      return "21";
113    if (code == ServicePlace._41)
114      return "41";
115    return "?";
116   }
117
118  public String toSystem(ServicePlace code) {
119    return code.getSystem();
120  }
121
122}