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.primitivetypes30_40.String30_40; 005import org.hl7.fhir.exceptions.FHIRException; 006 007public class Parameters30_40 { 008 009 public static org.hl7.fhir.dstu3.model.Parameters convertParameters(org.hl7.fhir.r4.model.Parameters src) throws FHIRException { 010 if (src == null) 011 return null; 012 org.hl7.fhir.dstu3.model.Parameters tgt = new org.hl7.fhir.dstu3.model.Parameters(); 013 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyResource(src, tgt); 014 for (org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent t : src.getParameter()) 015 tgt.addParameter(convertParametersParameterComponent(t)); 016 return tgt; 017 } 018 019 public static org.hl7.fhir.r4.model.Parameters convertParameters(org.hl7.fhir.dstu3.model.Parameters src) throws FHIRException { 020 if (src == null) 021 return null; 022 org.hl7.fhir.r4.model.Parameters tgt = new org.hl7.fhir.r4.model.Parameters(); 023 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyResource(src, tgt); 024 for (org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent t : src.getParameter()) 025 tgt.addParameter(convertParametersParameterComponent(t)); 026 return tgt; 027 } 028 029 public static org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent convertParametersParameterComponent(org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent src) throws FHIRException { 030 if (src == null) 031 return null; 032 org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent tgt = new org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent(); 033 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 034 if (src.hasName()) 035 tgt.setNameElement(String30_40.convertString(src.getNameElement())); 036 if (src.hasValue()) 037 tgt.setValue(ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().convertType(src.getValue())); 038 if (src.hasResource()) 039 tgt.setResource(ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().convertResource(src.getResource())); 040 for (org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent t : src.getPart()) 041 tgt.addPart(convertParametersParameterComponent(t)); 042 return tgt; 043 } 044 045 public static org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent convertParametersParameterComponent(org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent src) throws FHIRException { 046 if (src == null) 047 return null; 048 org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent tgt = new org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent(); 049 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 050 if (src.hasName()) 051 tgt.setNameElement(String30_40.convertString(src.getNameElement())); 052 if (src.hasValue()) 053 tgt.setValue(ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().convertType(src.getValue())); 054 if (src.hasResource()) 055 tgt.setResource(ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().convertResource(src.getResource())); 056 for (org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent t : src.getPart()) 057 tgt.addPart(convertParametersParameterComponent(t)); 058 return tgt; 059 } 060}