001package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50; 002 003import org.hl7.fhir.convertors.context.ConversionContext43_50; 004import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50; 005import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.MarkDown43_50; 006import org.hl7.fhir.exceptions.FHIRException; 007 008public class Annotation43_50 { 009 public static org.hl7.fhir.r5.model.Annotation convertAnnotation(org.hl7.fhir.r4b.model.Annotation src) throws FHIRException { 010 if (src == null) return null; 011 org.hl7.fhir.r5.model.Annotation tgt = new org.hl7.fhir.r5.model.Annotation(); 012 ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); 013 if (src.hasAuthor()) 014 tgt.setAuthor(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAuthor())); 015 if (src.hasTime()) tgt.setTimeElement(DateTime43_50.convertDateTime(src.getTimeElement())); 016 if (src.hasText()) tgt.setTextElement(MarkDown43_50.convertMarkdown(src.getTextElement())); 017 return tgt; 018 } 019 020 public static org.hl7.fhir.r4b.model.Annotation convertAnnotation(org.hl7.fhir.r5.model.Annotation src) throws FHIRException { 021 if (src == null) return null; 022 org.hl7.fhir.r4b.model.Annotation tgt = new org.hl7.fhir.r4b.model.Annotation(); 023 ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); 024 if (src.hasAuthor()) 025 tgt.setAuthor(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAuthor())); 026 if (src.hasTime()) tgt.setTimeElement(DateTime43_50.convertDateTime(src.getTimeElement())); 027 if (src.hasText()) tgt.setTextElement(MarkDown43_50.convertMarkdown(src.getTextElement())); 028 return tgt; 029 } 030}