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 Sun, May 6, 2018 17:51-0400 for FHIR v3.4.0 033 034 035import org.hl7.fhir.exceptions.FHIRException; 036 037public enum MapTransform { 038 039 /** 040 * create(type : string) - type is passed through to the application on the standard API, and must be known by it 041 */ 042 CREATE, 043 /** 044 * copy(source) 045 */ 046 COPY, 047 /** 048 * truncate(source, length) - source must be stringy type 049 */ 050 TRUNCATE, 051 /** 052 * 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 053 */ 054 ESCAPE, 055 /** 056 * 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 057 */ 058 CAST, 059 /** 060 * append(source...) - source is element or string 061 */ 062 APPEND, 063 /** 064 * translate(source, uri_of_map) - use the translate operation 065 */ 066 TRANSLATE, 067 /** 068 * reference(source : object) - return a string that references the provided tree properly 069 */ 070 REFERENCE, 071 /** 072 * Perform a date operation. *Parameters to be documented* 073 */ 074 DATEOP, 075 /** 076 * Generate a random UUID (in lowercase). No Parameters 077 */ 078 UUID, 079 /** 080 * Return the appropriate string to put in a reference that refers to the resource provided as a parameter 081 */ 082 POINTER, 083 /** 084 * Execute the supplied FHIRPath expression and use the value returned by that 085 */ 086 EVALUATE, 087 /** 088 * Create a CodeableConcept. Parameters = (text) or (system. Code[, display]) 089 */ 090 CC, 091 /** 092 * Create a Coding. Parameters = (system. Code[, display]) 093 */ 094 C, 095 /** 096 * Create a quantity. Parameters = (text) or (value, unit, [system, code]) where text is the natural representation e.g. [comparator]value[space]unit 097 */ 098 QTY, 099 /** 100 * Create an identifier. Parameters = (system, value[, type]) where type is a code from the identifier type value set 101 */ 102 ID, 103 /** 104 * 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 105 */ 106 CP, 107 /** 108 * added to help the parsers 109 */ 110 NULL; 111 public static MapTransform fromCode(String codeString) throws FHIRException { 112 if (codeString == null || "".equals(codeString)) 113 return null; 114 if ("create".equals(codeString)) 115 return CREATE; 116 if ("copy".equals(codeString)) 117 return COPY; 118 if ("truncate".equals(codeString)) 119 return TRUNCATE; 120 if ("escape".equals(codeString)) 121 return ESCAPE; 122 if ("cast".equals(codeString)) 123 return CAST; 124 if ("append".equals(codeString)) 125 return APPEND; 126 if ("translate".equals(codeString)) 127 return TRANSLATE; 128 if ("reference".equals(codeString)) 129 return REFERENCE; 130 if ("dateOp".equals(codeString)) 131 return DATEOP; 132 if ("uuid".equals(codeString)) 133 return UUID; 134 if ("pointer".equals(codeString)) 135 return POINTER; 136 if ("evaluate".equals(codeString)) 137 return EVALUATE; 138 if ("cc".equals(codeString)) 139 return CC; 140 if ("c".equals(codeString)) 141 return C; 142 if ("qty".equals(codeString)) 143 return QTY; 144 if ("id".equals(codeString)) 145 return ID; 146 if ("cp".equals(codeString)) 147 return CP; 148 throw new FHIRException("Unknown MapTransform code '"+codeString+"'"); 149 } 150 public String toCode() { 151 switch (this) { 152 case CREATE: return "create"; 153 case COPY: return "copy"; 154 case TRUNCATE: return "truncate"; 155 case ESCAPE: return "escape"; 156 case CAST: return "cast"; 157 case APPEND: return "append"; 158 case TRANSLATE: return "translate"; 159 case REFERENCE: return "reference"; 160 case DATEOP: return "dateOp"; 161 case UUID: return "uuid"; 162 case POINTER: return "pointer"; 163 case EVALUATE: return "evaluate"; 164 case CC: return "cc"; 165 case C: return "c"; 166 case QTY: return "qty"; 167 case ID: return "id"; 168 case CP: return "cp"; 169 default: return "?"; 170 } 171 } 172 public String getSystem() { 173 return "http://hl7.org/fhir/map-transform"; 174 } 175 public String getDefinition() { 176 switch (this) { 177 case CREATE: return "create(type : string) - type is passed through to the application on the standard API, and must be known by it"; 178 case COPY: return "copy(source)"; 179 case TRUNCATE: return "truncate(source, length) - source must be stringy type"; 180 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"; 181 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"; 182 case APPEND: return "append(source...) - source is element or string"; 183 case TRANSLATE: return "translate(source, uri_of_map) - use the translate operation"; 184 case REFERENCE: return "reference(source : object) - return a string that references the provided tree properly"; 185 case DATEOP: return "Perform a date operation. *Parameters to be documented*"; 186 case UUID: return "Generate a random UUID (in lowercase). No Parameters"; 187 case POINTER: return "Return the appropriate string to put in a reference that refers to the resource provided as a parameter"; 188 case EVALUATE: return "Execute the supplied FHIRPath expression and use the value returned by that"; 189 case CC: return "Create a CodeableConcept. Parameters = (text) or (system. Code[, display])"; 190 case C: return "Create a Coding. Parameters = (system. Code[, display])"; 191 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"; 192 case ID: return "Create an identifier. Parameters = (system, value[, type]) where type is a code from the identifier type value set"; 193 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"; 194 default: return "?"; 195 } 196 } 197 public String getDisplay() { 198 switch (this) { 199 case CREATE: return "create"; 200 case COPY: return "copy"; 201 case TRUNCATE: return "truncate"; 202 case ESCAPE: return "escape"; 203 case CAST: return "cast"; 204 case APPEND: return "append"; 205 case TRANSLATE: return "translate"; 206 case REFERENCE: return "reference"; 207 case DATEOP: return "dateOp"; 208 case UUID: return "uuid"; 209 case POINTER: return "pointer"; 210 case EVALUATE: return "evaluate"; 211 case CC: return "cc"; 212 case C: return "c"; 213 case QTY: return "qty"; 214 case ID: return "id"; 215 case CP: return "cp"; 216 default: return "?"; 217 } 218 } 219 220 221} 222