001package org.hl7.fhir.convertors.conv14_50.datatypes14_50; 002 003import org.hl7.fhir.convertors.context.ConversionContext14_50; 004import org.hl7.fhir.convertors.conv14_50.datatypes14_50.complextypes14_50.Coding14_50; 005import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.Id14_50; 006import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.Instant14_50; 007import org.hl7.fhir.exceptions.FHIRException; 008 009public class Meta14_50 { 010 public static org.hl7.fhir.r5.model.Meta convertMeta(org.hl7.fhir.dstu2016may.model.Meta src) throws FHIRException { 011 if (src == null || src.isEmpty()) return null; 012 org.hl7.fhir.r5.model.Meta tgt = new org.hl7.fhir.r5.model.Meta(); 013 ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); 014 if (src.hasVersionId()) tgt.setVersionIdElement(Id14_50.convertId(src.getVersionIdElement())); 015 if (src.hasLastUpdated()) tgt.setLastUpdatedElement(Instant14_50.convertInstant(src.getLastUpdatedElement())); 016 for (org.hl7.fhir.dstu2016may.model.UriType t : src.getProfile()) tgt.addProfile(t.getValue()); 017 for (org.hl7.fhir.dstu2016may.model.Coding t : src.getSecurity()) tgt.addSecurity(Coding14_50.convertCoding(t)); 018 for (org.hl7.fhir.dstu2016may.model.Coding t : src.getTag()) tgt.addTag(Coding14_50.convertCoding(t)); 019 return tgt; 020 } 021 022 public static org.hl7.fhir.dstu2016may.model.Meta convertMeta(org.hl7.fhir.r5.model.Meta src) throws FHIRException { 023 if (src == null || src.isEmpty()) return null; 024 org.hl7.fhir.dstu2016may.model.Meta tgt = new org.hl7.fhir.dstu2016may.model.Meta(); 025 ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); 026 if (src.hasVersionId()) tgt.setVersionIdElement(Id14_50.convertId(src.getVersionIdElement())); 027 if (src.hasLastUpdated()) tgt.setLastUpdatedElement(Instant14_50.convertInstant(src.getLastUpdatedElement())); 028 for (org.hl7.fhir.r5.model.UriType t : src.getProfile()) tgt.addProfile(t.getValue()); 029 for (org.hl7.fhir.r5.model.Coding t : src.getSecurity()) tgt.addSecurity(Coding14_50.convertCoding(t)); 030 for (org.hl7.fhir.r5.model.Coding t : src.getTag()) tgt.addTag(Coding14_50.convertCoding(t)); 031 return tgt; 032 } 033}