001package org.hl7.fhir.convertors.conv40_50.resources40_50; 002 003import org.hl7.fhir.convertors.context.ConversionContext40_50; 004import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.CodeableConcept40_50; 005import org.hl7.fhir.convertors.conv40_50.datatypes40_50.metadata40_50.ContactDetail40_50; 006import org.hl7.fhir.convertors.conv40_50.datatypes40_50.metadata40_50.UsageContext40_50; 007import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.*; 008import org.hl7.fhir.exceptions.FHIRException; 009 010/* 011 Copyright (c) 2011+, HL7, Inc. 012 All rights reserved. 013 014 Redistribution and use in source and binary forms, with or without modification, 015 are permitted provided that the following conditions are met: 016 017 * Redistributions of source code must retain the above copyright notice, this 018 list of conditions and the following disclaimer. 019 * Redistributions in binary form must reproduce the above copyright notice, 020 this list of conditions and the following disclaimer in the documentation 021 and/or other materials provided with the distribution. 022 * Neither the name of HL7 nor the names of its contributors may be used to 023 endorse or promote products derived from this software without specific 024 prior written permission. 025 026 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 027 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 028 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 029 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 030 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 031 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 032 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 033 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 034 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 035 POSSIBILITY OF SUCH DAMAGE. 036 037*/ 038// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 039public class GraphDefinition40_50 { 040 041 public static org.hl7.fhir.r5.model.GraphDefinition convertGraphDefinition(org.hl7.fhir.r4.model.GraphDefinition src) throws FHIRException { 042 if (src == null) 043 return null; 044 org.hl7.fhir.r5.model.GraphDefinition tgt = new org.hl7.fhir.r5.model.GraphDefinition(); 045 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt); 046 if (src.hasUrl()) 047 tgt.setUrlElement(Uri40_50.convertUri(src.getUrlElement())); 048 if (src.hasVersion()) 049 tgt.setVersionElement(String40_50.convertString(src.getVersionElement())); 050 if (src.hasName()) 051 tgt.setNameElement(String40_50.convertString(src.getNameElement())); 052 if (src.hasStatus()) 053 tgt.setStatusElement(Enumerations40_50.convertPublicationStatus(src.getStatusElement())); 054 if (src.hasExperimental()) 055 tgt.setExperimentalElement(Boolean40_50.convertBoolean(src.getExperimentalElement())); 056 if (src.hasDate()) 057 tgt.setDateElement(DateTime40_50.convertDateTime(src.getDateElement())); 058 if (src.hasPublisher()) 059 tgt.setPublisherElement(String40_50.convertString(src.getPublisherElement())); 060 for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) 061 tgt.addContact(ContactDetail40_50.convertContactDetail(t)); 062 if (src.hasDescription()) 063 tgt.setDescriptionElement(MarkDown40_50.convertMarkdown(src.getDescriptionElement())); 064 for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) 065 tgt.addUseContext(UsageContext40_50.convertUsageContext(t)); 066 for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) 067 tgt.addJurisdiction(CodeableConcept40_50.convertCodeableConcept(t)); 068 if (src.hasPurpose()) 069 tgt.setPurposeElement(MarkDown40_50.convertMarkdown(src.getPurposeElement())); 070 if (src.hasStart()) 071 tgt.setStartElement(Code40_50.convertResourceEnum(src.getStartElement())); 072 if (src.hasProfile()) 073 tgt.setProfileElement(Canonical40_50.convertCanonical(src.getProfileElement())); 074 for (org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) 075 tgt.addLink(convertGraphDefinitionLinkComponent(t)); 076 return tgt; 077 } 078 079 public static org.hl7.fhir.r4.model.GraphDefinition convertGraphDefinition(org.hl7.fhir.r5.model.GraphDefinition src) throws FHIRException { 080 if (src == null) 081 return null; 082 org.hl7.fhir.r4.model.GraphDefinition tgt = new org.hl7.fhir.r4.model.GraphDefinition(); 083 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt); 084 if (src.hasUrl()) 085 tgt.setUrlElement(Uri40_50.convertUri(src.getUrlElement())); 086 if (src.hasVersion()) 087 tgt.setVersionElement(String40_50.convertString(src.getVersionElement())); 088 if (src.hasName()) 089 tgt.setNameElement(String40_50.convertString(src.getNameElement())); 090 if (src.hasStatus()) 091 tgt.setStatusElement(Enumerations40_50.convertPublicationStatus(src.getStatusElement())); 092 if (src.hasExperimental()) 093 tgt.setExperimentalElement(Boolean40_50.convertBoolean(src.getExperimentalElement())); 094 if (src.hasDate()) 095 tgt.setDateElement(DateTime40_50.convertDateTime(src.getDateElement())); 096 if (src.hasPublisher()) 097 tgt.setPublisherElement(String40_50.convertString(src.getPublisherElement())); 098 for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) 099 tgt.addContact(ContactDetail40_50.convertContactDetail(t)); 100 if (src.hasDescription()) 101 tgt.setDescriptionElement(MarkDown40_50.convertMarkdown(src.getDescriptionElement())); 102 for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) 103 tgt.addUseContext(UsageContext40_50.convertUsageContext(t)); 104 for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) 105 tgt.addJurisdiction(CodeableConcept40_50.convertCodeableConcept(t)); 106 if (src.hasPurpose()) 107 tgt.setPurposeElement(MarkDown40_50.convertMarkdown(src.getPurposeElement())); 108 if (src.hasStart()) 109 tgt.setStartElement(Code40_50.convertResourceEnum(src.getStartElement())); 110 if (src.hasProfile()) 111 tgt.setProfileElement(Canonical40_50.convertCanonical(src.getProfileElement())); 112 for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) 113 tgt.addLink(convertGraphDefinitionLinkComponent(t)); 114 return tgt; 115 } 116 117 public static org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent convertGraphDefinitionLinkComponent(org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent src) throws FHIRException { 118 if (src == null) 119 return null; 120 org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent tgt = new org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent(); 121 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 122 if (src.hasPath()) 123 tgt.setPathElement(String40_50.convertString(src.getPathElement())); 124 if (src.hasSliceName()) 125 tgt.setSliceNameElement(String40_50.convertString(src.getSliceNameElement())); 126 if (src.hasMin()) 127 tgt.setMinElement(Integer40_50.convertInteger(src.getMinElement())); 128 if (src.hasMax()) 129 tgt.setMaxElement(String40_50.convertString(src.getMaxElement())); 130 if (src.hasDescription()) 131 tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement())); 132 for (org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetComponent t : src.getTarget()) 133 tgt.addTarget(convertGraphDefinitionLinkTargetComponent(t)); 134 return tgt; 135 } 136 137 public static org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent convertGraphDefinitionLinkComponent(org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent src) throws FHIRException { 138 if (src == null) 139 return null; 140 org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent tgt = new org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent(); 141 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 142 if (src.hasPath()) 143 tgt.setPathElement(String40_50.convertString(src.getPathElement())); 144 if (src.hasSliceName()) 145 tgt.setSliceNameElement(String40_50.convertString(src.getSliceNameElement())); 146 if (src.hasMin()) 147 tgt.setMinElement(Integer40_50.convertInteger(src.getMinElement())); 148 if (src.hasMax()) 149 tgt.setMaxElement(String40_50.convertString(src.getMaxElement())); 150 if (src.hasDescription()) 151 tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement())); 152 for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent t : src.getTarget()) 153 tgt.addTarget(convertGraphDefinitionLinkTargetComponent(t)); 154 return tgt; 155 } 156 157 public static org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent convertGraphDefinitionLinkTargetComponent(org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetComponent src) throws FHIRException { 158 if (src == null) 159 return null; 160 org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent tgt = new org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent(); 161 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 162 if (src.hasType()) 163 tgt.setTypeElement(Code40_50.convertResourceEnum(src.getTypeElement())); 164 if (src.hasParams()) 165 tgt.setParamsElement(String40_50.convertString(src.getParamsElement())); 166 if (src.hasProfile()) 167 tgt.setProfileElement(Canonical40_50.convertCanonical(src.getProfileElement())); 168 for (org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent t : src.getCompartment()) 169 tgt.addCompartment(convertGraphDefinitionLinkTargetCompartmentComponent(t)); 170 for (org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) 171 tgt.addLink(convertGraphDefinitionLinkComponent(t)); 172 return tgt; 173 } 174 175 public static org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetComponent convertGraphDefinitionLinkTargetComponent(org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent src) throws FHIRException { 176 if (src == null) 177 return null; 178 org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetComponent tgt = new org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetComponent(); 179 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 180 if (src.hasType()) 181 tgt.setTypeElement(Code40_50.convertResourceEnum(src.getTypeElement())); 182 if (src.hasParams()) 183 tgt.setParamsElement(String40_50.convertString(src.getParamsElement())); 184 if (src.hasProfile()) 185 tgt.setProfileElement(Canonical40_50.convertCanonical(src.getProfileElement())); 186 for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent t : src.getCompartment()) 187 tgt.addCompartment(convertGraphDefinitionLinkTargetCompartmentComponent(t)); 188 for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) 189 tgt.addLink(convertGraphDefinitionLinkComponent(t)); 190 return tgt; 191 } 192 193 public static org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent convertGraphDefinitionLinkTargetCompartmentComponent(org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent src) throws FHIRException { 194 if (src == null) 195 return null; 196 org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent tgt = new org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent(); 197 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 198 if (src.hasUse()) 199 tgt.setUseElement(convertGraphCompartmentUse(src.getUseElement())); 200 if (src.hasCode()) 201 tgt.setCodeElement(convertCompartmentCode(src.getCodeElement())); 202 if (src.hasRule()) 203 tgt.setRuleElement(convertGraphCompartmentRule(src.getRuleElement())); 204 if (src.hasExpression()) 205 tgt.setExpressionElement(String40_50.convertString(src.getExpressionElement())); 206 if (src.hasDescription()) 207 tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement())); 208 return tgt; 209 } 210 211 public static org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent convertGraphDefinitionLinkTargetCompartmentComponent(org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent src) throws FHIRException { 212 if (src == null) 213 return null; 214 org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent tgt = new org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent(); 215 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 216 if (src.hasUse()) 217 tgt.setUseElement(convertGraphCompartmentUse(src.getUseElement())); 218 if (src.hasCode()) 219 tgt.setCodeElement(convertCompartmentCode(src.getCodeElement())); 220 if (src.hasRule()) 221 tgt.setRuleElement(convertGraphCompartmentRule(src.getRuleElement())); 222 if (src.hasExpression()) 223 tgt.setExpressionElement(String40_50.convertString(src.getExpressionElement())); 224 if (src.hasDescription()) 225 tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement())); 226 return tgt; 227 } 228 229 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentUse> convertGraphCompartmentUse(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentUse> src) throws FHIRException { 230 if (src == null || src.isEmpty()) 231 return null; 232 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentUse> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentUseEnumFactory()); 233 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 234 switch (src.getValue()) { 235 case CONDITION: 236 tgt.setValue(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentUse.CONDITION); 237 break; 238 case REQUIREMENT: 239 tgt.setValue(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentUse.REQUIREMENT); 240 break; 241 default: 242 tgt.setValue(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentUse.NULL); 243 break; 244 } 245 return tgt; 246 } 247 248 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentUse> convertGraphCompartmentUse(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentUse> src) throws FHIRException { 249 if (src == null || src.isEmpty()) 250 return null; 251 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentUse> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentUseEnumFactory()); 252 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 253 switch (src.getValue()) { 254 case CONDITION: 255 tgt.setValue(org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentUse.CONDITION); 256 break; 257 case REQUIREMENT: 258 tgt.setValue(org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentUse.REQUIREMENT); 259 break; 260 default: 261 tgt.setValue(org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentUse.NULL); 262 break; 263 } 264 return tgt; 265 } 266 267 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.CompartmentType> convertCompartmentCode(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode> src) throws FHIRException { 268 if (src == null || src.isEmpty()) 269 return null; 270 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.CompartmentType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CompartmentTypeEnumFactory()); 271 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 272 switch (src.getValue()) { 273 case PATIENT: 274 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.PATIENT); 275 break; 276 case ENCOUNTER: 277 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.ENCOUNTER); 278 break; 279 case RELATEDPERSON: 280 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.RELATEDPERSON); 281 break; 282 case PRACTITIONER: 283 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.PRACTITIONER); 284 break; 285 case DEVICE: 286 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.DEVICE); 287 break; 288 default: 289 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.NULL); 290 break; 291 } 292 return tgt; 293 } 294 295 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode> convertCompartmentCode(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.CompartmentType> src) throws FHIRException { 296 if (src == null || src.isEmpty()) 297 return null; 298 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.GraphDefinition.CompartmentCodeEnumFactory()); 299 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 300 switch (src.getValue()) { 301 case PATIENT: 302 tgt.setValue(org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.PATIENT); 303 break; 304 case ENCOUNTER: 305 tgt.setValue(org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.ENCOUNTER); 306 break; 307 case RELATEDPERSON: 308 tgt.setValue(org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.RELATEDPERSON); 309 break; 310 case PRACTITIONER: 311 tgt.setValue(org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.PRACTITIONER); 312 break; 313 case DEVICE: 314 tgt.setValue(org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.DEVICE); 315 break; 316 default: 317 tgt.setValue(org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.NULL); 318 break; 319 } 320 return tgt; 321 } 322 323 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule> convertGraphCompartmentRule(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule> src) throws FHIRException { 324 if (src == null || src.isEmpty()) 325 return null; 326 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRuleEnumFactory()); 327 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 328 switch (src.getValue()) { 329 case IDENTICAL: 330 tgt.setValue(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.IDENTICAL); 331 break; 332 case MATCHING: 333 tgt.setValue(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.MATCHING); 334 break; 335 case DIFFERENT: 336 tgt.setValue(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.DIFFERENT); 337 break; 338 case CUSTOM: 339 tgt.setValue(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.CUSTOM); 340 break; 341 default: 342 tgt.setValue(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.NULL); 343 break; 344 } 345 return tgt; 346 } 347 348 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule> convertGraphCompartmentRule(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule> src) throws FHIRException { 349 if (src == null || src.isEmpty()) 350 return null; 351 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRuleEnumFactory()); 352 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 353 switch (src.getValue()) { 354 case IDENTICAL: 355 tgt.setValue(org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule.IDENTICAL); 356 break; 357 case MATCHING: 358 tgt.setValue(org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule.MATCHING); 359 break; 360 case DIFFERENT: 361 tgt.setValue(org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule.DIFFERENT); 362 break; 363 case CUSTOM: 364 tgt.setValue(org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule.CUSTOM); 365 break; 366 default: 367 tgt.setValue(org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule.NULL); 368 break; 369 } 370 return tgt; 371 } 372}