001package org.hl7.fhir.convertors.conv10_50.datatypes10_50.complextypes10_50;
002
003import org.hl7.fhir.convertors.context.ConversionContext10_50;
004import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.DateTime10_50;
005import org.hl7.fhir.exceptions.FHIRException;
006
007public class Annotation10_50 {
008  public static org.hl7.fhir.r5.model.Annotation convertAnnotation(org.hl7.fhir.dstu2.model.Annotation src) throws FHIRException {
009    if (src == null || src.isEmpty()) return null;
010    org.hl7.fhir.r5.model.Annotation tgt = new org.hl7.fhir.r5.model.Annotation();
011    ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
012    if (src.hasAuthor())
013      tgt.setAuthor(ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().convertType(src.getAuthor()));
014    if (src.hasTimeElement()) tgt.setTimeElement(DateTime10_50.convertDateTime(src.getTimeElement()));
015    if (src.hasText()) tgt.setText(src.getText());
016    return tgt;
017  }
018
019  public static org.hl7.fhir.dstu2.model.Annotation convertAnnotation(org.hl7.fhir.r5.model.Annotation src) throws FHIRException {
020    if (src == null || src.isEmpty()) return null;
021    org.hl7.fhir.dstu2.model.Annotation tgt = new org.hl7.fhir.dstu2.model.Annotation();
022    ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
023    if (src.hasAuthor())
024      tgt.setAuthor(ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().convertType(src.getAuthor()));
025    if (src.hasTimeElement()) tgt.setTimeElement(DateTime10_50.convertDateTime(src.getTimeElement()));
026    if (src.hasText()) tgt.setText(src.getText());
027    return tgt;
028  }
029}