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