001package org.hl7.fhir.r5.model.codesystems; 002 003/* 004 * #%L 005 * org.hl7.fhir.r5 006 * %% 007 * Copyright (C) 2014 - 2019 Health Level 7 008 * %% 009 * Licensed under the Apache License, Version 2.0 (the "License"); 010 * you may not use this file except in compliance with the License. 011 * You may obtain a copy of the License at 012 * 013 * http://www.apache.org/licenses/LICENSE-2.0 014 * 015 * Unless required by applicable law or agreed to in writing, software 016 * distributed under the License is distributed on an "AS IS" BASIS, 017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 018 * See the License for the specific language governing permissions and 019 * limitations under the License. 020 * #L% 021 */ 022 023/* 024 Copyright (c) 2011+, HL7, Inc. 025 All rights reserved. 026 027 Redistribution and use in source and binary forms, with or without modification, 028 are permitted provided that the following conditions are met: 029 030 * Redistributions of source code must retain the above copyright notice, this 031 list of conditions and the following disclaimer. 032 * Redistributions in binary form must reproduce the above copyright notice, 033 this list of conditions and the following disclaimer in the documentation 034 and/or other materials provided with the distribution. 035 * Neither the name of HL7 nor the names of its contributors may be used to 036 endorse or promote products derived from this software without specific 037 prior written permission. 038 039 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 040 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 041 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 042 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 043 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 044 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 045 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 046 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 047 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 048 POSSIBILITY OF SUCH DAMAGE. 049 050*/ 051 052// Generated on Thu, Oct 17, 2019 09:42+1100 for FHIR v4.1.0 053 054 055import org.hl7.fhir.exceptions.FHIRException; 056 057public enum MapTransform { 058 059 /** 060 * create(type : string) - type is passed through to the application on the standard API, and must be known by it. 061 */ 062 CREATE, 063 /** 064 * copy(source). 065 */ 066 COPY, 067 /** 068 * truncate(source, length) - source must be stringy type. 069 */ 070 TRUNCATE, 071 /** 072 * escape(source, fmt1, fmt2) - change source from one kind of escaping to another (plain, java, xml, json). note that this is for when the string itself is escaped. 073 */ 074 ESCAPE, 075 /** 076 * cast(source, type?) - case source from one type to another. target type can be left as implicit if there is one and only one target type known. 077 */ 078 CAST, 079 /** 080 * append(source...) - source is element or string. 081 */ 082 APPEND, 083 /** 084 * translate(source, uri_of_map) - use the translate operation. 085 */ 086 TRANSLATE, 087 /** 088 * reference(source : object) - return a string that references the provided tree properly. 089 */ 090 REFERENCE, 091 /** 092 * Perform a date operation. *Parameters to be documented*. 093 */ 094 DATEOP, 095 /** 096 * Generate a random UUID (in lowercase). No Parameters. 097 */ 098 UUID, 099 /** 100 * Return the appropriate string to put in a reference that refers to the resource provided as a parameter. 101 */ 102 POINTER, 103 /** 104 * Execute the supplied FHIRPath expression and use the value returned by that. 105 */ 106 EVALUATE, 107 /** 108 * Create a CodeableConcept. Parameters = (text) or (system. Code[, display]). 109 */ 110 CC, 111 /** 112 * Create a Coding. Parameters = (system. Code[, display]). 113 */ 114 C, 115 /** 116 * Create a quantity. Parameters = (text) or (value, unit, [system, code]) where text is the natural representation e.g. [comparator]value[space]unit. 117 */ 118 QTY, 119 /** 120 * Create an identifier. Parameters = (system, value[, type]) where type is a code from the identifier type value set. 121 */ 122 ID, 123 /** 124 * Create a contact details. Parameters = (value) or (system, value). If no system is provided, the system should be inferred from the content of the value. 125 */ 126 CP, 127 /** 128 * added to help the parsers 129 */ 130 NULL; 131 public static MapTransform fromCode(String codeString) throws FHIRException { 132 if (codeString == null || "".equals(codeString)) 133 return null; 134 if ("create".equals(codeString)) 135 return CREATE; 136 if ("copy".equals(codeString)) 137 return COPY; 138 if ("truncate".equals(codeString)) 139 return TRUNCATE; 140 if ("escape".equals(codeString)) 141 return ESCAPE; 142 if ("cast".equals(codeString)) 143 return CAST; 144 if ("append".equals(codeString)) 145 return APPEND; 146 if ("translate".equals(codeString)) 147 return TRANSLATE; 148 if ("reference".equals(codeString)) 149 return REFERENCE; 150 if ("dateOp".equals(codeString)) 151 return DATEOP; 152 if ("uuid".equals(codeString)) 153 return UUID; 154 if ("pointer".equals(codeString)) 155 return POINTER; 156 if ("evaluate".equals(codeString)) 157 return EVALUATE; 158 if ("cc".equals(codeString)) 159 return CC; 160 if ("c".equals(codeString)) 161 return C; 162 if ("qty".equals(codeString)) 163 return QTY; 164 if ("id".equals(codeString)) 165 return ID; 166 if ("cp".equals(codeString)) 167 return CP; 168 throw new FHIRException("Unknown MapTransform code '"+codeString+"'"); 169 } 170 public String toCode() { 171 switch (this) { 172 case CREATE: return "create"; 173 case COPY: return "copy"; 174 case TRUNCATE: return "truncate"; 175 case ESCAPE: return "escape"; 176 case CAST: return "cast"; 177 case APPEND: return "append"; 178 case TRANSLATE: return "translate"; 179 case REFERENCE: return "reference"; 180 case DATEOP: return "dateOp"; 181 case UUID: return "uuid"; 182 case POINTER: return "pointer"; 183 case EVALUATE: return "evaluate"; 184 case CC: return "cc"; 185 case C: return "c"; 186 case QTY: return "qty"; 187 case ID: return "id"; 188 case CP: return "cp"; 189 default: return "?"; 190 } 191 } 192 public String getSystem() { 193 return "http://hl7.org/fhir/map-transform"; 194 } 195 public String getDefinition() { 196 switch (this) { 197 case CREATE: return "create(type : string) - type is passed through to the application on the standard API, and must be known by it."; 198 case COPY: return "copy(source)."; 199 case TRUNCATE: return "truncate(source, length) - source must be stringy type."; 200 case ESCAPE: return "escape(source, fmt1, fmt2) - change source from one kind of escaping to another (plain, java, xml, json). note that this is for when the string itself is escaped."; 201 case CAST: return "cast(source, type?) - case source from one type to another. target type can be left as implicit if there is one and only one target type known."; 202 case APPEND: return "append(source...) - source is element or string."; 203 case TRANSLATE: return "translate(source, uri_of_map) - use the translate operation."; 204 case REFERENCE: return "reference(source : object) - return a string that references the provided tree properly."; 205 case DATEOP: return "Perform a date operation. *Parameters to be documented*."; 206 case UUID: return "Generate a random UUID (in lowercase). No Parameters."; 207 case POINTER: return "Return the appropriate string to put in a reference that refers to the resource provided as a parameter."; 208 case EVALUATE: return "Execute the supplied FHIRPath expression and use the value returned by that."; 209 case CC: return "Create a CodeableConcept. Parameters = (text) or (system. Code[, display])."; 210 case C: return "Create a Coding. Parameters = (system. Code[, display])."; 211 case QTY: return "Create a quantity. Parameters = (text) or (value, unit, [system, code]) where text is the natural representation e.g. [comparator]value[space]unit."; 212 case ID: return "Create an identifier. Parameters = (system, value[, type]) where type is a code from the identifier type value set."; 213 case CP: return "Create a contact details. Parameters = (value) or (system, value). If no system is provided, the system should be inferred from the content of the value."; 214 default: return "?"; 215 } 216 } 217 public String getDisplay() { 218 switch (this) { 219 case CREATE: return "create"; 220 case COPY: return "copy"; 221 case TRUNCATE: return "truncate"; 222 case ESCAPE: return "escape"; 223 case CAST: return "cast"; 224 case APPEND: return "append"; 225 case TRANSLATE: return "translate"; 226 case REFERENCE: return "reference"; 227 case DATEOP: return "dateOp"; 228 case UUID: return "uuid"; 229 case POINTER: return "pointer"; 230 case EVALUATE: return "evaluate"; 231 case CC: return "cc"; 232 case C: return "c"; 233 case QTY: return "qty"; 234 case ID: return "id"; 235 case CP: return "cp"; 236 default: return "?"; 237 } 238 } 239 240 241} 242