001package org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30; 002 003import org.hl7.fhir.convertors.context.ConversionContext10_30; 004import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30; 005import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; 006import org.hl7.fhir.exceptions.FHIRException; 007 008public class Annotation10_30 { 009 public static org.hl7.fhir.dstu3.model.Annotation convertAnnotation(org.hl7.fhir.dstu2.model.Annotation src) throws FHIRException { 010 if (src == null || src.isEmpty()) return null; 011 org.hl7.fhir.dstu3.model.Annotation tgt = new org.hl7.fhir.dstu3.model.Annotation(); 012 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); 013 if (src.hasAuthor()) 014 tgt.setAuthor(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getAuthor())); 015 if (src.hasTimeElement()) tgt.setTimeElement(DateTime10_30.convertDateTime(src.getTimeElement())); 016 if (src.hasTextElement()) tgt.setTextElement(String10_30.convertString(src.getTextElement())); 017 return tgt; 018 } 019 020 public static org.hl7.fhir.dstu2.model.Annotation convertAnnotation(org.hl7.fhir.dstu3.model.Annotation src) throws FHIRException { 021 if (src == null || src.isEmpty()) return null; 022 org.hl7.fhir.dstu2.model.Annotation tgt = new org.hl7.fhir.dstu2.model.Annotation(); 023 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); 024 if (src.hasAuthor()) 025 tgt.setAuthor(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getAuthor())); 026 if (src.hasTimeElement()) tgt.setTimeElement(DateTime10_30.convertDateTime(src.getTimeElement())); 027 if (src.hasTextElement()) tgt.setTextElement(String10_30.convertString(src.getTextElement())); 028 return tgt; 029 } 030}