001package org.hl7.fhir.convertors.conv14_40.datatypes14_40.complextypes14_40;
002
003import org.hl7.fhir.convertors.context.ConversionContext14_40;
004import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.DateTime14_40;
005import org.hl7.fhir.exceptions.FHIRException;
006
007public class Annotation14_40 {
008  public static org.hl7.fhir.r4.model.Annotation convertAnnotation(org.hl7.fhir.dstu2016may.model.Annotation src) throws FHIRException {
009    if (src == null || src.isEmpty()) return null;
010    org.hl7.fhir.r4.model.Annotation tgt = new org.hl7.fhir.r4.model.Annotation();
011    ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt);
012    if (src.hasAuthor())
013      tgt.setAuthor(ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().convertType(src.getAuthor()));
014    if (src.hasTime()) tgt.setTimeElement(DateTime14_40.convertDateTime(src.getTimeElement()));
015    tgt.setText(src.getText());
016    return tgt;
017  }
018
019  public static org.hl7.fhir.dstu2016may.model.Annotation convertAnnotation(org.hl7.fhir.r4.model.Annotation src) throws FHIRException {
020    if (src == null || src.isEmpty()) return null;
021    org.hl7.fhir.dstu2016may.model.Annotation tgt = new org.hl7.fhir.dstu2016may.model.Annotation();
022    ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt);
023    if (src.hasAuthor())
024      tgt.setAuthor(ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().convertType(src.getAuthor()));
025    if (src.hasTime()) tgt.setTimeElement(DateTime14_40.convertDateTime(src.getTimeElement()));
026    tgt.setText(src.getText());
027    return tgt;
028  }
029}