![](/hapi-fhir/images/logos/raccoon-forwards.png)
001package org.hl7.fhir.convertors.conv10_40.datatypes10_40; 002 003import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_10_40; 004import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Address10_40; 005import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Age10_40; 006import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Annotation10_40; 007import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Attachment10_40; 008import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.CodeableConcept10_40; 009import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Coding10_40; 010import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.ContactPoint10_40; 011import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Count10_40; 012import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Distance10_40; 013import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Duration10_40; 014import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.HumanName10_40; 015import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Identifier10_40; 016import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Money10_40; 017import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Period10_40; 018import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Quantity10_40; 019import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Range10_40; 020import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Ratio10_40; 021import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.SampledData10_40; 022import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Signature10_40; 023import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.SimpleQuantity10_40; 024import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Timing10_40; 025import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Base64Binary10_40; 026import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Boolean10_40; 027import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Code10_40; 028import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Date10_40; 029import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.DateTime10_40; 030import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Decimal10_40; 031import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Id10_40; 032import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Instant10_40; 033import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Integer10_40; 034import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.MarkDown10_40; 035import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Oid10_40; 036import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.PositiveInt10_40; 037import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; 038import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Time10_40; 039import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.UnsignedInt10_40; 040import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Uri10_40; 041import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Uuid10_40; 042import org.hl7.fhir.exceptions.FHIRException; 043 044public class Type10_40 { 045 046 private final BaseAdvisor_10_40 advisor; 047 048 public Type10_40(BaseAdvisor_10_40 advisor) { 049 this.advisor = advisor; 050 } 051 052 public org.hl7.fhir.r4.model.Type convertType(org.hl7.fhir.dstu2.model.Type src) throws FHIRException { 053 if (src == null || src.isEmpty()) return null; 054 if (src instanceof org.hl7.fhir.dstu2.model.Base64BinaryType) 055 return Base64Binary10_40.convertBase64Binary((org.hl7.fhir.dstu2.model.Base64BinaryType) src); 056 if (src instanceof org.hl7.fhir.dstu2.model.BooleanType) 057 return Boolean10_40.convertBoolean((org.hl7.fhir.dstu2.model.BooleanType) src); 058 if (src instanceof org.hl7.fhir.dstu2.model.CodeType) 059 return Code10_40.convertCode((org.hl7.fhir.dstu2.model.CodeType) src); 060 if (src instanceof org.hl7.fhir.dstu2.model.DateType) 061 return Date10_40.convertDate((org.hl7.fhir.dstu2.model.DateType) src); 062 if (src instanceof org.hl7.fhir.dstu2.model.DateTimeType) 063 return DateTime10_40.convertDateTime((org.hl7.fhir.dstu2.model.DateTimeType) src); 064 if (src instanceof org.hl7.fhir.dstu2.model.DecimalType) 065 return Decimal10_40.convertDecimal((org.hl7.fhir.dstu2.model.DecimalType) src); 066 if (src instanceof org.hl7.fhir.dstu2.model.IdType) return Id10_40.convertId((org.hl7.fhir.dstu2.model.IdType) src); 067 if (src instanceof org.hl7.fhir.dstu2.model.InstantType) 068 return Instant10_40.convertInstant((org.hl7.fhir.dstu2.model.InstantType) src); 069 if (src instanceof org.hl7.fhir.dstu2.model.MarkdownType) 070 return MarkDown10_40.convertMarkdown((org.hl7.fhir.dstu2.model.MarkdownType) src); 071 if (src instanceof org.hl7.fhir.dstu2.model.OidType) 072 return Oid10_40.convertOid((org.hl7.fhir.dstu2.model.OidType) src); 073 if (src instanceof org.hl7.fhir.dstu2.model.PositiveIntType) 074 return PositiveInt10_40.convertPositiveInt((org.hl7.fhir.dstu2.model.PositiveIntType) src); 075 if (src instanceof org.hl7.fhir.dstu2.model.StringType) 076 return String10_40.convertString((org.hl7.fhir.dstu2.model.StringType) src); 077 if (src instanceof org.hl7.fhir.dstu2.model.TimeType) 078 return Time10_40.convertTime((org.hl7.fhir.dstu2.model.TimeType) src); 079 if (src instanceof org.hl7.fhir.dstu2.model.UnsignedIntType) 080 return UnsignedInt10_40.convertUnsignedInt((org.hl7.fhir.dstu2.model.UnsignedIntType) src); 081 if (src instanceof org.hl7.fhir.dstu2.model.IntegerType) 082 return Integer10_40.convertInteger((org.hl7.fhir.dstu2.model.IntegerType) src); 083 if (src instanceof org.hl7.fhir.dstu2.model.UuidType) 084 return Uuid10_40.convertUuid((org.hl7.fhir.dstu2.model.UuidType) src); 085 if (src instanceof org.hl7.fhir.dstu2.model.UriType) 086 return Uri10_40.convertUri((org.hl7.fhir.dstu2.model.UriType) src); 087 if (src instanceof org.hl7.fhir.dstu2.model.Extension) 088 return Extension10_40.convertExtension((org.hl7.fhir.dstu2.model.Extension) src); 089 if (src instanceof org.hl7.fhir.dstu2.model.Narrative) 090 return Narrative10_40.convertNarrative((org.hl7.fhir.dstu2.model.Narrative) src); 091 if (src instanceof org.hl7.fhir.dstu2.model.Annotation) 092 return Annotation10_40.convertAnnotation((org.hl7.fhir.dstu2.model.Annotation) src); 093 if (src instanceof org.hl7.fhir.dstu2.model.Attachment) 094 return Attachment10_40.convertAttachment((org.hl7.fhir.dstu2.model.Attachment) src); 095 if (src instanceof org.hl7.fhir.dstu2.model.CodeableConcept) 096 return CodeableConcept10_40.convertCodeableConcept((org.hl7.fhir.dstu2.model.CodeableConcept) src); 097 if (src instanceof org.hl7.fhir.dstu2.model.Coding) 098 return Coding10_40.convertCoding((org.hl7.fhir.dstu2.model.Coding) src); 099 if (src instanceof org.hl7.fhir.dstu2.model.Identifier) 100 return Identifier10_40.convertIdentifier((org.hl7.fhir.dstu2.model.Identifier) src); 101 if (src instanceof org.hl7.fhir.dstu2.model.Period) 102 return Period10_40.convertPeriod((org.hl7.fhir.dstu2.model.Period) src); 103 if (src instanceof org.hl7.fhir.dstu2.model.Quantity) 104 return Quantity10_40.convertQuantity((org.hl7.fhir.dstu2.model.Quantity) src); 105 if (src instanceof org.hl7.fhir.dstu2.model.Range) 106 return Range10_40.convertRange((org.hl7.fhir.dstu2.model.Range) src); 107 if (src instanceof org.hl7.fhir.dstu2.model.Ratio) 108 return Ratio10_40.convertRatio((org.hl7.fhir.dstu2.model.Ratio) src); 109 if (src instanceof org.hl7.fhir.dstu2.model.Reference) 110 return Reference10_40.convertReference((org.hl7.fhir.dstu2.model.Reference) src); 111 if (src instanceof org.hl7.fhir.dstu2.model.SampledData) 112 return SampledData10_40.convertSampledData((org.hl7.fhir.dstu2.model.SampledData) src); 113 if (src instanceof org.hl7.fhir.dstu2.model.Signature) 114 return Signature10_40.convertSignature((org.hl7.fhir.dstu2.model.Signature) src); 115 if (src instanceof org.hl7.fhir.dstu2.model.Address) 116 return Address10_40.convertAddress((org.hl7.fhir.dstu2.model.Address) src); 117 if (src instanceof org.hl7.fhir.dstu2.model.ContactPoint) 118 return ContactPoint10_40.convertContactPoint((org.hl7.fhir.dstu2.model.ContactPoint) src); 119 if (src instanceof org.hl7.fhir.dstu2.model.HumanName) 120 return HumanName10_40.convertHumanName((org.hl7.fhir.dstu2.model.HumanName) src); 121 if (src instanceof org.hl7.fhir.dstu2.model.Meta) return Meta10_40.convertMeta((org.hl7.fhir.dstu2.model.Meta) src); 122 if (src instanceof org.hl7.fhir.dstu2.model.Timing) 123 return Timing10_40.convertTiming((org.hl7.fhir.dstu2.model.Timing) src); 124 if (src instanceof org.hl7.fhir.dstu2.model.Age) return Age10_40.convertAge((org.hl7.fhir.dstu2.model.Age) src); 125 if (src instanceof org.hl7.fhir.dstu2.model.Count) 126 return Count10_40.convertCount((org.hl7.fhir.dstu2.model.Count) src); 127 if (src instanceof org.hl7.fhir.dstu2.model.Distance) 128 return Distance10_40.convertDistance((org.hl7.fhir.dstu2.model.Distance) src); 129 if (src instanceof org.hl7.fhir.dstu2.model.Duration) 130 return Duration10_40.convertDuration((org.hl7.fhir.dstu2.model.Duration) src); 131 if (src instanceof org.hl7.fhir.dstu2.model.Money) 132 return Money10_40.convertMoney((org.hl7.fhir.dstu2.model.Money) src); 133 if (src instanceof org.hl7.fhir.dstu2.model.SimpleQuantity) 134 return SimpleQuantity10_40.convertSimpleQuantity((org.hl7.fhir.dstu2.model.SimpleQuantity) src); 135 if (advisor.failFastOnNullOrUnknownEntry()) { 136 throw new FHIRException("The type " + src.fhirType()+" cannot be converted from R2 to R4"); 137 } else { 138 return null; 139 } 140 } 141 142 public org.hl7.fhir.dstu2.model.Type convertType(org.hl7.fhir.r4.model.Type src) throws FHIRException { 143 if (src == null || src.isEmpty()) return null; 144 if (src instanceof org.hl7.fhir.r4.model.Base64BinaryType) 145 return Base64Binary10_40.convertBase64Binary((org.hl7.fhir.r4.model.Base64BinaryType) src); 146 if (src instanceof org.hl7.fhir.r4.model.BooleanType) 147 return Boolean10_40.convertBoolean((org.hl7.fhir.r4.model.BooleanType) src); 148 if (src instanceof org.hl7.fhir.r4.model.CodeType) 149 return Code10_40.convertCode((org.hl7.fhir.r4.model.CodeType) src); 150 if (src instanceof org.hl7.fhir.r4.model.DateType) 151 return Date10_40.convertDate((org.hl7.fhir.r4.model.DateType) src); 152 if (src instanceof org.hl7.fhir.r4.model.DateTimeType) 153 return DateTime10_40.convertDateTime((org.hl7.fhir.r4.model.DateTimeType) src); 154 if (src instanceof org.hl7.fhir.r4.model.DecimalType) 155 return Decimal10_40.convertDecimal((org.hl7.fhir.r4.model.DecimalType) src); 156 if (src instanceof org.hl7.fhir.r4.model.IdType) return Id10_40.convertId((org.hl7.fhir.r4.model.IdType) src); 157 if (src instanceof org.hl7.fhir.r4.model.InstantType) 158 return Instant10_40.convertInstant((org.hl7.fhir.r4.model.InstantType) src); 159 if (src instanceof org.hl7.fhir.r4.model.MarkdownType) 160 return MarkDown10_40.convertMarkdown((org.hl7.fhir.r4.model.MarkdownType) src); 161 if (src instanceof org.hl7.fhir.r4.model.OidType) return Oid10_40.convertOid((org.hl7.fhir.r4.model.OidType) src); 162 if (src instanceof org.hl7.fhir.r4.model.PositiveIntType) 163 return PositiveInt10_40.convertPositiveInt((org.hl7.fhir.r4.model.PositiveIntType) src); 164 if (src instanceof org.hl7.fhir.r4.model.StringType) 165 return String10_40.convertString((org.hl7.fhir.r4.model.StringType) src); 166 if (src instanceof org.hl7.fhir.r4.model.TimeType) 167 return Time10_40.convertTime((org.hl7.fhir.r4.model.TimeType) src); 168 if (src instanceof org.hl7.fhir.r4.model.UnsignedIntType) 169 return UnsignedInt10_40.convertUnsignedInt((org.hl7.fhir.r4.model.UnsignedIntType) src); 170 if (src instanceof org.hl7.fhir.r4.model.IntegerType) 171 return Integer10_40.convertInteger((org.hl7.fhir.r4.model.IntegerType) src); 172 if (src instanceof org.hl7.fhir.r4.model.UuidType) 173 return Uuid10_40.convertUuid((org.hl7.fhir.r4.model.UuidType) src); 174 if (src instanceof org.hl7.fhir.r4.model.UriType) return Uri10_40.convertUri((org.hl7.fhir.r4.model.UriType) src); 175 if (src instanceof org.hl7.fhir.r4.model.Extension) 176 return Extension10_40.convertExtension((org.hl7.fhir.r4.model.Extension) src); 177 if (src instanceof org.hl7.fhir.r4.model.Narrative) 178 return Narrative10_40.convertNarrative((org.hl7.fhir.r4.model.Narrative) src); 179 if (src instanceof org.hl7.fhir.r4.model.Annotation) 180 return Annotation10_40.convertAnnotation((org.hl7.fhir.r4.model.Annotation) src); 181 if (src instanceof org.hl7.fhir.r4.model.Attachment) 182 return Attachment10_40.convertAttachment((org.hl7.fhir.r4.model.Attachment) src); 183 if (src instanceof org.hl7.fhir.r4.model.CodeableConcept) 184 return CodeableConcept10_40.convertCodeableConcept((org.hl7.fhir.r4.model.CodeableConcept) src); 185 if (src instanceof org.hl7.fhir.r4.model.Coding) 186 return Coding10_40.convertCoding((org.hl7.fhir.r4.model.Coding) src); 187 if (src instanceof org.hl7.fhir.r4.model.Identifier) 188 return Identifier10_40.convertIdentifier((org.hl7.fhir.r4.model.Identifier) src); 189 if (src instanceof org.hl7.fhir.r4.model.Period) 190 return Period10_40.convertPeriod((org.hl7.fhir.r4.model.Period) src); 191 if (src instanceof org.hl7.fhir.r4.model.Quantity) 192 return Quantity10_40.convertQuantity((org.hl7.fhir.r4.model.Quantity) src); 193 if (src instanceof org.hl7.fhir.r4.model.Range) return Range10_40.convertRange((org.hl7.fhir.r4.model.Range) src); 194 if (src instanceof org.hl7.fhir.r4.model.Ratio) return Ratio10_40.convertRatio((org.hl7.fhir.r4.model.Ratio) src); 195 if (src instanceof org.hl7.fhir.r4.model.Reference) 196 return Reference10_40.convertReference((org.hl7.fhir.r4.model.Reference) src); 197 if (src instanceof org.hl7.fhir.r4.model.SampledData) 198 return SampledData10_40.convertSampledData((org.hl7.fhir.r4.model.SampledData) src); 199 if (src instanceof org.hl7.fhir.r4.model.Signature) 200 return Signature10_40.convertSignature((org.hl7.fhir.r4.model.Signature) src); 201 if (src instanceof org.hl7.fhir.r4.model.Address) 202 return Address10_40.convertAddress((org.hl7.fhir.r4.model.Address) src); 203 if (src instanceof org.hl7.fhir.r4.model.ContactPoint) 204 return ContactPoint10_40.convertContactPoint((org.hl7.fhir.r4.model.ContactPoint) src); 205 if (src instanceof org.hl7.fhir.r4.model.HumanName) 206 return HumanName10_40.convertHumanName((org.hl7.fhir.r4.model.HumanName) src); 207 if (src instanceof org.hl7.fhir.r4.model.Meta) return Meta10_40.convertMeta((org.hl7.fhir.r4.model.Meta) src); 208 if (src instanceof org.hl7.fhir.r4.model.Timing) 209 return Timing10_40.convertTiming((org.hl7.fhir.r4.model.Timing) src); 210 if (src instanceof org.hl7.fhir.r4.model.Age) return Age10_40.convertAge((org.hl7.fhir.r4.model.Age) src); 211 if (src instanceof org.hl7.fhir.r4.model.Count) return Count10_40.convertCount((org.hl7.fhir.r4.model.Count) src); 212 if (src instanceof org.hl7.fhir.r4.model.Distance) 213 return Distance10_40.convertDistance((org.hl7.fhir.r4.model.Distance) src); 214 if (src instanceof org.hl7.fhir.r4.model.Duration) 215 return Duration10_40.convertDuration((org.hl7.fhir.r4.model.Duration) src); 216 if (src instanceof org.hl7.fhir.r4.model.Money) return Money10_40.convertMoney((org.hl7.fhir.r4.model.Money) src); 217 if (src instanceof org.hl7.fhir.r4.model.SimpleQuantity) 218 return SimpleQuantity10_40.convertSimpleQuantity((org.hl7.fhir.r4.model.SimpleQuantity) src); 219 if (advisor.failFastOnNullOrUnknownEntry()) { 220 throw new FHIRException("The type " + src.fhirType()+" cannot be converted from R4 to R2"); 221 } else { 222 return null; 223 } 224 } 225}