001package org.hl7.fhir.convertors.conv14_30.datatypes14_30.complextypes14_30;
002
003import org.hl7.fhir.convertors.context.ConversionContext14_30;
004import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.DateTime14_30;
005import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.String14_30;
006import org.hl7.fhir.exceptions.FHIRException;
007
008public class Annotation14_30 {
009  public static org.hl7.fhir.dstu3.model.Annotation convertAnnotation(org.hl7.fhir.dstu2016may.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    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
013    if (src.hasAuthor())
014      tgt.setAuthor(ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().convertType(src.getAuthor()));
015    if (src.hasTime()) tgt.setTimeElement(DateTime14_30.convertDateTime(src.getTimeElement()));
016    if (src.hasTextElement()) tgt.setTextElement(String14_30.convertString(src.getTextElement()));
017    return tgt;
018  }
019
020  public static org.hl7.fhir.dstu2016may.model.Annotation convertAnnotation(org.hl7.fhir.dstu3.model.Annotation src) throws FHIRException {
021    if (src == null || src.isEmpty()) return null;
022    org.hl7.fhir.dstu2016may.model.Annotation tgt = new org.hl7.fhir.dstu2016may.model.Annotation();
023    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
024    if (src.hasAuthor())
025      tgt.setAuthor(ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().convertType(src.getAuthor()));
026    if (src.hasTime()) tgt.setTimeElement(DateTime14_30.convertDateTime(src.getTimeElement()));
027    if (src.hasTextElement()) tgt.setTextElement(String14_30.convertString(src.getTextElement()));
028    return tgt;
029  }
030}