001package org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50; 002 003import org.hl7.fhir.convertors.context.ConversionContext40_50; 004import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.DateTime40_50; 005import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.MarkDown40_50; 006import org.hl7.fhir.exceptions.FHIRException; 007 008public class Annotation40_50 { 009 public static org.hl7.fhir.r5.model.Annotation convertAnnotation(org.hl7.fhir.r4.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 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 013 if (src.hasAuthor()) 014 tgt.setAuthor(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getAuthor())); 015 if (src.hasTime()) tgt.setTimeElement(DateTime40_50.convertDateTime(src.getTimeElement())); 016 if (src.hasText()) tgt.setTextElement(MarkDown40_50.convertMarkdown(src.getTextElement())); 017 return tgt; 018 } 019 020 public static org.hl7.fhir.r4.model.Annotation convertAnnotation(org.hl7.fhir.r5.model.Annotation src) throws FHIRException { 021 if (src == null) return null; 022 org.hl7.fhir.r4.model.Annotation tgt = new org.hl7.fhir.r4.model.Annotation(); 023 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 024 if (src.hasAuthor()) 025 tgt.setAuthor(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getAuthor())); 026 if (src.hasTime()) tgt.setTimeElement(DateTime40_50.convertDateTime(src.getTimeElement())); 027 if (src.hasText()) tgt.setTextElement(MarkDown40_50.convertMarkdown(src.getTextElement())); 028 return tgt; 029 } 030}