001package org.hl7.fhir.convertors.conv10_30.resources10_30; 002 003import org.hl7.fhir.convertors.context.ConversionContext10_30; 004import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; 005import org.hl7.fhir.exceptions.FHIRException; 006 007public class Parameters10_30 { 008 009 public static org.hl7.fhir.dstu3.model.Parameters convertParameters(org.hl7.fhir.dstu2.model.Parameters src) throws FHIRException { 010 if (src == null || src.isEmpty()) 011 return null; 012 org.hl7.fhir.dstu3.model.Parameters tgt = new org.hl7.fhir.dstu3.model.Parameters(); 013 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyResource(src, tgt); 014 for (org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent t : src.getParameter()) 015 tgt.addParameter(convertParametersParameterComponent(t)); 016 return tgt; 017 } 018 019 public static org.hl7.fhir.dstu2.model.Parameters convertParameters(org.hl7.fhir.dstu3.model.Parameters src) throws FHIRException { 020 if (src == null || src.isEmpty()) 021 return null; 022 org.hl7.fhir.dstu2.model.Parameters tgt = new org.hl7.fhir.dstu2.model.Parameters(); 023 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().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.dstu2.model.Parameters.ParametersParameterComponent src) throws FHIRException { 030 if (src == null || src.isEmpty()) 031 return null; 032 org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent tgt = new org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent(); 033 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 034 if (src.hasNameElement()) 035 tgt.setNameElement(String10_30.convertString(src.getNameElement())); 036 if (src.hasValue()) 037 tgt.setValue(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getValue())); 038 if (src.hasResource()) 039 tgt.setResource(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertResource(src.getResource())); 040 for (org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent t : src.getPart()) 041 tgt.addPart(convertParametersParameterComponent(t)); 042 return tgt; 043 } 044 045 public static org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent convertParametersParameterComponent(org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent src) throws FHIRException { 046 if (src == null || src.isEmpty()) 047 return null; 048 org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent tgt = new org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent(); 049 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 050 if (src.hasNameElement()) 051 tgt.setNameElement(String10_30.convertString(src.getNameElement())); 052 if (src.hasValue()) 053 tgt.setValue(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getValue())); 054 if (src.hasResource()) 055 tgt.setResource(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().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}