
001package org.hl7.fhir.convertors.conv30_40.resources30_40; 002 003import org.hl7.fhir.convertors.context.ConversionContext30_40; 004import org.hl7.fhir.convertors.conv30_40.datatypes30_40.ContactDetail30_40; 005import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.CodeableConcept30_40; 006import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Coding30_40; 007import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Identifier30_40; 008import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Timing30_40; 009import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Boolean30_40; 010import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Code30_40; 011import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Date30_40; 012import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.DateTime30_40; 013import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Integer30_40; 014import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.MarkDown30_40; 015import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; 016import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.Uri30_40; 017import org.hl7.fhir.exceptions.FHIRException; 018import org.hl7.fhir.r4.model.BooleanType; 019import org.hl7.fhir.r4.model.ValueSet; 020 021public class ValueSet30_40 { 022 023 public static org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent convertConceptReferenceComponent(org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent src) throws FHIRException { 024 if (src == null) 025 return null; 026 org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent(); 027 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 028 if (src.hasCode()) 029 tgt.setCodeElement(Code30_40.convertCode(src.getCodeElement())); 030 if (src.hasDisplay()) 031 tgt.setDisplayElement(String30_40.convertString(src.getDisplayElement())); 032 for (org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) 033 tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); 034 return tgt; 035 } 036 037 public static org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent convertConceptReferenceComponent(org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent src) throws FHIRException { 038 if (src == null) 039 return null; 040 org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent(); 041 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 042 if (src.hasCode()) 043 tgt.setCodeElement(Code30_40.convertCode(src.getCodeElement())); 044 if (src.hasDisplay()) 045 tgt.setDisplayElement(String30_40.convertString(src.getDisplayElement())); 046 for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) 047 tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); 048 return tgt; 049 } 050 051 public static org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent convertConceptReferenceDesignationComponent(org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent src) throws FHIRException { 052 if (src == null) 053 return null; 054 org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent(); 055 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 056 if (src.hasLanguage()) 057 tgt.setLanguageElement(Code30_40.convertCode(src.getLanguageElement())); 058 if (src.hasUse()) 059 tgt.setUse(Coding30_40.convertCoding(src.getUse())); 060 if (src.hasValue()) 061 tgt.setValueElement(String30_40.convertString(src.getValueElement())); 062 return tgt; 063 } 064 065 public static org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent convertConceptReferenceDesignationComponent(org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent src) throws FHIRException { 066 if (src == null) 067 return null; 068 org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent(); 069 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 070 if (src.hasLanguage()) 071 tgt.setLanguageElement(Code30_40.convertCode(src.getLanguageElement())); 072 if (src.hasUse()) 073 tgt.setUse(Coding30_40.convertCoding(src.getUse())); 074 if (src.hasValue()) 075 tgt.setValueElement(String30_40.convertString(src.getValueElement())); 076 return tgt; 077 } 078 079 public static org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent convertConceptSetComponent(org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent src) throws FHIRException { 080 if (src == null) 081 return null; 082 org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent(); 083 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 084 if (src.hasSystem()) 085 tgt.setSystemElement(Uri30_40.convertUri(src.getSystemElement())); 086 if (src.hasVersion()) 087 tgt.setVersionElement(String30_40.convertString(src.getVersionElement())); 088 for (org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) 089 tgt.addConcept(convertConceptReferenceComponent(t)); 090 for (org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) 091 tgt.addFilter(convertConceptSetFilterComponent(t)); 092 for (org.hl7.fhir.r4.model.UriType t : src.getValueSet()) tgt.addValueSet(t.getValue()); 093 return tgt; 094 } 095 096 public static org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent convertConceptSetComponent(org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent src) throws FHIRException { 097 if (src == null) 098 return null; 099 org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent(); 100 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 101 if (src.hasSystem()) 102 tgt.setSystemElement(Uri30_40.convertUri(src.getSystemElement())); 103 if (src.hasVersion()) 104 tgt.setVersionElement(String30_40.convertString(src.getVersionElement())); 105 for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) 106 tgt.addConcept(convertConceptReferenceComponent(t)); 107 for (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) 108 tgt.addFilter(convertConceptSetFilterComponent(t)); 109 for (org.hl7.fhir.dstu3.model.UriType t : src.getValueSet()) tgt.addValueSet(t.getValue()); 110 return tgt; 111 } 112 113 public static org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent convertConceptSetFilterComponent(org.hl7.fhir.dstu3.model.ValueSet.ConceptSetFilterComponent src) throws FHIRException { 114 if (src == null) 115 return null; 116 org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent(); 117 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 118 if (src.hasProperty()) 119 tgt.setPropertyElement(Code30_40.convertCode(src.getPropertyElement())); 120 if (src.hasOp()) 121 tgt.setOpElement(convertFilterOperator(src.getOpElement())); 122 if (src.hasValue()) 123 tgt.setValue(src.getValue()); 124 return tgt; 125 } 126 127 public static org.hl7.fhir.dstu3.model.ValueSet.ConceptSetFilterComponent convertConceptSetFilterComponent(org.hl7.fhir.r4.model.ValueSet.ConceptSetFilterComponent src) throws FHIRException { 128 if (src == null) 129 return null; 130 org.hl7.fhir.dstu3.model.ValueSet.ConceptSetFilterComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ConceptSetFilterComponent(); 131 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 132 if (src.hasProperty()) 133 tgt.setPropertyElement(Code30_40.convertCode(src.getPropertyElement())); 134 if (src.hasOp()) 135 tgt.setOpElement(convertFilterOperator(src.getOpElement())); 136 if (src.hasValue()) 137 tgt.setValue(src.getValue()); 138 return tgt; 139 } 140 141 public static org.hl7.fhir.dstu3.model.ValueSet convertValueSet(org.hl7.fhir.r4.model.ValueSet src) throws FHIRException { 142 if (src == null) 143 return null; 144 org.hl7.fhir.dstu3.model.ValueSet tgt = new org.hl7.fhir.dstu3.model.ValueSet(); 145 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyDomainResource(src, tgt); 146 if (src.hasUrl()) 147 tgt.setUrlElement(Uri30_40.convertUri(src.getUrlElement())); 148 for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) 149 tgt.addIdentifier(Identifier30_40.convertIdentifier(t)); 150 if (src.hasVersion()) 151 tgt.setVersionElement(String30_40.convertString(src.getVersionElement())); 152 if (src.hasName()) 153 tgt.setNameElement(String30_40.convertString(src.getNameElement())); 154 if (src.hasTitle()) 155 tgt.setTitleElement(String30_40.convertString(src.getTitleElement())); 156 if (src.hasStatus()) 157 tgt.setStatusElement(Enumerations30_40.convertPublicationStatus(src.getStatusElement())); 158 if (src.hasExperimental()) 159 tgt.setExperimentalElement(Boolean30_40.convertBoolean(src.getExperimentalElement())); 160 if (src.hasDateElement()) 161 tgt.setDateElement(DateTime30_40.convertDateTime(src.getDateElement())); 162 if (src.hasPublisher()) 163 tgt.setPublisherElement(String30_40.convertString(src.getPublisherElement())); 164 for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) 165 tgt.addContact(ContactDetail30_40.convertContactDetail(t)); 166 if (src.hasDescription()) 167 tgt.setDescriptionElement(MarkDown30_40.convertMarkdown(src.getDescriptionElement())); 168 for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) 169 tgt.addUseContext(Timing30_40.convertUsageContext(t)); 170 for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) 171 tgt.addJurisdiction(CodeableConcept30_40.convertCodeableConcept(t)); 172 if (src.hasImmutable()) 173 tgt.setImmutableElement(Boolean30_40.convertBoolean(src.getImmutableElement())); 174 if (src.hasPurpose()) 175 tgt.setPurposeElement(MarkDown30_40.convertMarkdown(src.getPurposeElement())); 176 if (src.hasCopyright()) 177 tgt.setCopyrightElement(MarkDown30_40.convertMarkdown(src.getCopyrightElement())); 178 if (src.hasExtension("http://hl7.org/fhir/StructureDefinition/valueset-extensible")) 179 tgt.setExtensible(((BooleanType) src.getExtensionByUrl("http://hl7.org/fhir/StructureDefinition/valueset-extensible").getValue()).booleanValue()); 180 if (src.hasCompose()) 181 tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); 182 if (src.hasExpansion()) 183 tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); 184 return tgt; 185 } 186 187 public static org.hl7.fhir.r4.model.ValueSet convertValueSet(org.hl7.fhir.dstu3.model.ValueSet src) throws FHIRException { 188 if (src == null) 189 return null; 190 org.hl7.fhir.r4.model.ValueSet tgt = new org.hl7.fhir.r4.model.ValueSet(); 191 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyDomainResource(src, tgt); 192 if (src.hasUrl()) 193 tgt.setUrlElement(Uri30_40.convertUri(src.getUrlElement())); 194 for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) 195 tgt.addIdentifier(Identifier30_40.convertIdentifier(t)); 196 if (src.hasVersion()) 197 tgt.setVersionElement(String30_40.convertString(src.getVersionElement())); 198 if (src.hasName()) 199 tgt.setNameElement(String30_40.convertString(src.getNameElement())); 200 if (src.hasTitle()) 201 tgt.setTitleElement(String30_40.convertString(src.getTitleElement())); 202 if (src.hasStatus()) 203 tgt.setStatusElement(Enumerations30_40.convertPublicationStatus(src.getStatusElement())); 204 if (src.hasExperimental()) 205 tgt.setExperimentalElement(Boolean30_40.convertBoolean(src.getExperimentalElement())); 206 if (src.hasDateElement()) 207 tgt.setDateElement(DateTime30_40.convertDateTime(src.getDateElement())); 208 if (src.hasPublisher()) 209 tgt.setPublisherElement(String30_40.convertString(src.getPublisherElement())); 210 for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) 211 tgt.addContact(ContactDetail30_40.convertContactDetail(t)); 212 if (src.hasDescription()) 213 tgt.setDescriptionElement(MarkDown30_40.convertMarkdown(src.getDescriptionElement())); 214 for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) 215 tgt.addUseContext(Timing30_40.convertUsageContext(t)); 216 for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) 217 tgt.addJurisdiction(CodeableConcept30_40.convertCodeableConcept(t)); 218 if (src.hasImmutable()) 219 tgt.setImmutableElement(Boolean30_40.convertBoolean(src.getImmutableElement())); 220 if (src.hasPurpose()) 221 tgt.setPurposeElement(MarkDown30_40.convertMarkdown(src.getPurposeElement())); 222 if (src.hasCopyright()) 223 tgt.setCopyrightElement(MarkDown30_40.convertMarkdown(src.getCopyrightElement())); 224 if (src.hasExtensible()) 225 tgt.addExtension("http://hl7.org/fhir/StructureDefinition/valueset-extensible", new BooleanType(src.getExtensible())); 226 if (src.hasCompose()) 227 tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); 228 if (src.hasExpansion()) 229 tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); 230 return tgt; 231 } 232 233 public static org.hl7.fhir.dstu3.model.ValueSet.ValueSetComposeComponent convertValueSetComposeComponent(org.hl7.fhir.r4.model.ValueSet.ValueSetComposeComponent src) throws FHIRException { 234 if (src == null) 235 return null; 236 org.hl7.fhir.dstu3.model.ValueSet.ValueSetComposeComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ValueSetComposeComponent(); 237 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 238 if (src.hasLockedDate()) 239 tgt.setLockedDateElement(Date30_40.convertDate(src.getLockedDateElement())); 240 if (src.hasInactive()) 241 tgt.setInactiveElement(Boolean30_40.convertBoolean(src.getInactiveElement())); 242 for (org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent t : src.getInclude()) 243 tgt.addInclude(convertConceptSetComponent(t)); 244 for (org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent t : src.getExclude()) 245 tgt.addExclude(convertConceptSetComponent(t)); 246 return tgt; 247 } 248 249 public static org.hl7.fhir.r4.model.ValueSet.ValueSetComposeComponent convertValueSetComposeComponent(org.hl7.fhir.dstu3.model.ValueSet.ValueSetComposeComponent src) throws FHIRException { 250 if (src == null) 251 return null; 252 org.hl7.fhir.r4.model.ValueSet.ValueSetComposeComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ValueSetComposeComponent(); 253 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 254 if (src.hasLockedDate()) 255 tgt.setLockedDateElement(Date30_40.convertDate(src.getLockedDateElement())); 256 if (src.hasInactive()) 257 tgt.setInactiveElement(Boolean30_40.convertBoolean(src.getInactiveElement())); 258 for (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent t : src.getInclude()) 259 tgt.addInclude(convertConceptSetComponent(t)); 260 for (org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent t : src.getExclude()) 261 tgt.addExclude(convertConceptSetComponent(t)); 262 return tgt; 263 } 264 265 public static org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionComponent convertValueSetExpansionComponent(org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionComponent src) throws FHIRException { 266 if (src == null) 267 return null; 268 org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionComponent(); 269 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 270 if (src.hasIdentifier()) 271 tgt.setIdentifierElement(Uri30_40.convertUri(src.getIdentifierElement())); 272 if (src.hasTimestamp()) 273 tgt.setTimestampElement(DateTime30_40.convertDateTime(src.getTimestampElement())); 274 if (src.hasTotal()) 275 tgt.setTotalElement(Integer30_40.convertInteger(src.getTotalElement())); 276 if (src.hasOffset()) 277 tgt.setOffsetElement(Integer30_40.convertInteger(src.getOffsetElement())); 278 for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) 279 tgt.addParameter(convertValueSetExpansionParameterComponent(t)); 280 for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) 281 tgt.addContains(convertValueSetExpansionContainsComponent(t)); 282 return tgt; 283 } 284 285 public static org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionComponent convertValueSetExpansionComponent(org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionComponent src) throws FHIRException { 286 if (src == null) 287 return null; 288 org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionComponent(); 289 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 290 if (src.hasIdentifier()) 291 tgt.setIdentifierElement(Uri30_40.convertUri(src.getIdentifierElement())); 292 if (src.hasTimestamp()) 293 tgt.setTimestampElement(DateTime30_40.convertDateTime(src.getTimestampElement())); 294 if (src.hasTotal()) 295 tgt.setTotalElement(Integer30_40.convertInteger(src.getTotalElement())); 296 if (src.hasOffset()) 297 tgt.setOffsetElement(Integer30_40.convertInteger(src.getOffsetElement())); 298 for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) 299 tgt.addParameter(convertValueSetExpansionParameterComponent(t)); 300 for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) 301 tgt.addContains(convertValueSetExpansionContainsComponent(t)); 302 return tgt; 303 } 304 305 public static org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent convertValueSetExpansionContainsComponent(org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent src) throws FHIRException { 306 if (src == null) 307 return null; 308 org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent(); 309 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 310 if (src.hasSystem()) 311 tgt.setSystemElement(Uri30_40.convertUri(src.getSystemElement())); 312 if (src.hasAbstract()) 313 tgt.setAbstractElement(Boolean30_40.convertBoolean(src.getAbstractElement())); 314 if (src.hasInactive()) 315 tgt.setInactiveElement(Boolean30_40.convertBoolean(src.getInactiveElement())); 316 if (src.hasVersion()) 317 tgt.setVersionElement(String30_40.convertString(src.getVersionElement())); 318 if (src.hasCode()) 319 tgt.setCodeElement(Code30_40.convertCode(src.getCodeElement())); 320 if (src.hasDisplay()) 321 tgt.setDisplayElement(String30_40.convertString(src.getDisplayElement())); 322 for (org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) 323 tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); 324 for (org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) 325 tgt.addContains(convertValueSetExpansionContainsComponent(t)); 326 return tgt; 327 } 328 329 public static org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent convertValueSetExpansionContainsComponent(org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent src) throws FHIRException { 330 if (src == null) 331 return null; 332 org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent(); 333 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 334 if (src.hasSystem()) 335 tgt.setSystemElement(Uri30_40.convertUri(src.getSystemElement())); 336 if (src.hasAbstract()) 337 tgt.setAbstractElement(Boolean30_40.convertBoolean(src.getAbstractElement())); 338 if (src.hasInactive()) 339 tgt.setInactiveElement(Boolean30_40.convertBoolean(src.getInactiveElement())); 340 if (src.hasVersion()) 341 tgt.setVersionElement(String30_40.convertString(src.getVersionElement())); 342 if (src.hasCode()) 343 tgt.setCodeElement(Code30_40.convertCode(src.getCodeElement())); 344 if (src.hasDisplay()) 345 tgt.setDisplayElement(String30_40.convertString(src.getDisplayElement())); 346 for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) 347 tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); 348 for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) 349 tgt.addContains(convertValueSetExpansionContainsComponent(t)); 350 return tgt; 351 } 352 353 public static org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionParameterComponent convertValueSetExpansionParameterComponent(org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent src) throws FHIRException { 354 if (src == null) 355 return null; 356 org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionParameterComponent tgt = new org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionParameterComponent(); 357 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 358 if (src.hasName()) 359 tgt.setNameElement(String30_40.convertString(src.getNameElement())); 360 if (src.hasValue()) 361 tgt.setValue(ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().convertType(src.getValue())); 362 return tgt; 363 } 364 365 public static org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent convertValueSetExpansionParameterComponent(org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionParameterComponent src) throws FHIRException { 366 if (src == null) 367 return null; 368 org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent tgt = new org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent(); 369 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 370 if (src.hasName()) 371 tgt.setNameElement(String30_40.convertString(src.getNameElement())); 372 if (src.hasValue()) 373 tgt.setValue(ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().convertType(src.getValue())); 374 return tgt; 375 } 376 377 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.ValueSet.FilterOperator> convertFilterOperator(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ValueSet.FilterOperator> src) throws FHIRException { 378 if (src == null || src.isEmpty()) return null; 379 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.ValueSet.FilterOperator> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ValueSet.FilterOperatorEnumFactory()); 380 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 381 if (src.getValue() == null) { 382 tgt.setValue(null); 383} else { 384 switch(src.getValue()) { 385 case EQUAL: 386 tgt.setValue(ValueSet.FilterOperator.EQUAL); 387 break; 388 case ISA: 389 tgt.setValue(ValueSet.FilterOperator.ISA); 390 break; 391 case DESCENDENTOF: 392 tgt.setValue(ValueSet.FilterOperator.DESCENDENTOF); 393 break; 394 case ISNOTA: 395 tgt.setValue(ValueSet.FilterOperator.ISNOTA); 396 break; 397 case REGEX: 398 tgt.setValue(ValueSet.FilterOperator.REGEX); 399 break; 400 case IN: 401 tgt.setValue(ValueSet.FilterOperator.IN); 402 break; 403 case NOTIN: 404 tgt.setValue(ValueSet.FilterOperator.NOTIN); 405 break; 406 case GENERALIZES: 407 tgt.setValue(ValueSet.FilterOperator.GENERALIZES); 408 break; 409 case EXISTS: 410 tgt.setValue(ValueSet.FilterOperator.EXISTS); 411 break; 412 default: 413 tgt.setValue(ValueSet.FilterOperator.NULL); 414 break; 415 } 416} 417 return tgt; 418 } 419 420 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ValueSet.FilterOperator> convertFilterOperator(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.ValueSet.FilterOperator> src) throws FHIRException { 421 if (src == null || src.isEmpty()) return null; 422 org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ValueSet.FilterOperator> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ValueSet.FilterOperatorEnumFactory()); 423 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 424 if (src.getValue() == null) { 425 tgt.setValue(null); 426} else { 427 switch(src.getValue()) { 428 case EQUAL: 429 tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.EQUAL); 430 break; 431 case ISA: 432 tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.ISA); 433 break; 434 case DESCENDENTOF: 435 tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.DESCENDENTOF); 436 break; 437 case ISNOTA: 438 tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.ISNOTA); 439 break; 440 case REGEX: 441 tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.REGEX); 442 break; 443 case IN: 444 tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.IN); 445 break; 446 case NOTIN: 447 tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.NOTIN); 448 break; 449 case GENERALIZES: 450 tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.GENERALIZES); 451 break; 452 case EXISTS: 453 tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.EXISTS); 454 break; 455 default: 456 tgt.setValue(org.hl7.fhir.dstu3.model.ValueSet.FilterOperator.NULL); 457 break; 458 } 459} 460 return tgt; 461 } 462}