001package org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50;
002
003import org.hl7.fhir.convertors.context.ConversionContext30_50;
004import org.hl7.fhir.exceptions.FHIRException;
005
006public class Uri30_50 {
007  
008  public static org.hl7.fhir.r5.model.UriType convertUri(org.hl7.fhir.dstu3.model.UriType src) throws FHIRException {
009    org.hl7.fhir.r5.model.UriType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.UriType(src.getValueAsString()) : new org.hl7.fhir.r5.model.UriType();
010    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
011    return tgt;
012  }
013
014  public static org.hl7.fhir.dstu3.model.UriType convertUri(org.hl7.fhir.r5.model.UriType src) throws FHIRException {
015    org.hl7.fhir.dstu3.model.UriType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.UriType(src.getValueAsString()) : new org.hl7.fhir.dstu3.model.UriType();
016    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
017    return tgt;
018  }
019
020  public static org.hl7.fhir.r5.model.UrlType convertUrl(org.hl7.fhir.dstu3.model.UriType src) throws FHIRException {
021    org.hl7.fhir.r5.model.UrlType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.UrlType(src.getValueAsString()) : new org.hl7.fhir.r5.model.UrlType();
022    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
023    return tgt;
024  }
025
026  public static org.hl7.fhir.dstu3.model.UriType convertUrl(org.hl7.fhir.r5.model.UrlType src) throws FHIRException {
027    org.hl7.fhir.dstu3.model.UriType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.UriType(src.getValueAsString()) : new org.hl7.fhir.dstu3.model.UriType();
028    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
029    return tgt;
030  }
031
032  public static org.hl7.fhir.r5.model.CanonicalType convertCanonical(org.hl7.fhir.dstu3.model.UriType src) throws FHIRException {
033    org.hl7.fhir.r5.model.CanonicalType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.CanonicalType(src.getValueAsString()) : new org.hl7.fhir.r5.model.CanonicalType();
034    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
035    return tgt;
036  }
037
038  public static org.hl7.fhir.dstu3.model.UriType convertCanonical(org.hl7.fhir.r5.model.CanonicalType src) throws FHIRException {
039    org.hl7.fhir.dstu3.model.UriType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.UriType(src.getValueAsString()) : new org.hl7.fhir.dstu3.model.UriType();
040    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
041    return tgt;
042  }
043
044  public static org.hl7.fhir.r5.model.UriType convertCodeToUri(org.hl7.fhir.dstu3.model.CodeType src) throws FHIRException {
045    org.hl7.fhir.r5.model.UriType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.UriType(src.getValue()) : new org.hl7.fhir.r5.model.UriType();
046    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
047    return tgt;
048  }
049
050  public static org.hl7.fhir.dstu3.model.CodeType convertUriToCode(org.hl7.fhir.r5.model.UriType src) throws FHIRException {
051    org.hl7.fhir.dstu3.model.CodeType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.CodeType(src.getValue()) : new org.hl7.fhir.dstu3.model.CodeType();
052    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
053    return tgt;
054  }
055}