001package org.hl7.fhir.convertors.conv14_40.datatypes14_40;
002
003import org.hl7.fhir.convertors.context.ConversionContext14_40;
004import org.hl7.fhir.convertors.conv14_40.datatypes14_40.complextypes14_40.Coding14_40;
005import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.Id14_40;
006import org.hl7.fhir.convertors.conv14_40.datatypes14_40.primitivetypes14_40.Instant14_40;
007import org.hl7.fhir.exceptions.FHIRException;
008
009public class Meta14_40 {
010  public static org.hl7.fhir.r4.model.Meta convertMeta(org.hl7.fhir.dstu2016may.model.Meta src) throws FHIRException {
011    if (src == null || src.isEmpty()) return null;
012    org.hl7.fhir.r4.model.Meta tgt = new org.hl7.fhir.r4.model.Meta();
013    ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt);
014    if (src.hasVersionId()) tgt.setVersionIdElement(Id14_40.convertId(src.getVersionIdElement()));
015    if (src.hasLastUpdated()) tgt.setLastUpdatedElement(Instant14_40.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_40.convertCoding(t));
018    for (org.hl7.fhir.dstu2016may.model.Coding t : src.getTag()) tgt.addTag(Coding14_40.convertCoding(t));
019    return tgt;
020  }
021
022  public static org.hl7.fhir.dstu2016may.model.Meta convertMeta(org.hl7.fhir.r4.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_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt);
026    if (src.hasVersionId()) tgt.setVersionIdElement(Id14_40.convertId(src.getVersionIdElement()));
027    if (src.hasLastUpdated()) tgt.setLastUpdatedElement(Instant14_40.convertInstant(src.getLastUpdatedElement()));
028    for (org.hl7.fhir.r4.model.UriType t : src.getProfile()) tgt.addProfile(t.getValue());
029    for (org.hl7.fhir.r4.model.Coding t : src.getSecurity()) tgt.addSecurity(Coding14_40.convertCoding(t));
030    for (org.hl7.fhir.r4.model.Coding t : src.getTag()) tgt.addTag(Coding14_40.convertCoding(t));
031    return tgt;
032  }
033}