
001package org.hl7.fhir.convertors.conv14_50.datatypes14_50.complextypes14_50; 002 003import org.hl7.fhir.convertors.context.ConversionContext14_50; 004import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.DateTime14_50; 005import org.hl7.fhir.exceptions.FHIRException; 006 007public class Annotation14_50 { 008 public static org.hl7.fhir.r5.model.Annotation convertAnnotation(org.hl7.fhir.dstu2016may.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 ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); 012 if (src.hasAuthor()) 013 tgt.setAuthor(ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().convertType(src.getAuthor())); 014 if (src.hasTime()) tgt.setTimeElement(DateTime14_50.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.r5.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_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); 023 if (src.hasAuthor()) 024 tgt.setAuthor(ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().convertType(src.getAuthor())); 025 if (src.hasTime()) tgt.setTimeElement(DateTime14_50.convertDateTime(src.getTimeElement())); 026 tgt.setText(src.getText()); 027 return tgt; 028 } 029}