![](/hapi-fhir/images/logos/raccoon-forwards.png)
001package org.hl7.fhir.convertors.conv10_50.resources10_50; 002 003import org.hl7.fhir.convertors.context.ConversionContext10_50; 004import org.hl7.fhir.exceptions.FHIRException; 005 006public class Enumerations10_50 { 007 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.BindingStrength> convertBindingStrength(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.BindingStrength> src) throws FHIRException { 008 if (src == null || src.isEmpty()) return null; 009 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.BindingStrength> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.BindingStrengthEnumFactory()); 010 ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); 011 if (src.getValue() == null) { 012 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.NULL); 013 } else { 014 switch (src.getValue()) { 015 case REQUIRED: 016 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.REQUIRED); 017 break; 018 case EXTENSIBLE: 019 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.EXTENSIBLE); 020 break; 021 case PREFERRED: 022 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.PREFERRED); 023 break; 024 case EXAMPLE: 025 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.EXAMPLE); 026 break; 027 default: 028 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.NULL); 029 break; 030 } 031 } 032 return tgt; 033 } 034 035 static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.BindingStrength> convertBindingStrength(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.BindingStrength> src) throws FHIRException { 036 if (src == null || src.isEmpty()) return null; 037 org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.BindingStrength> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.BindingStrengthEnumFactory()); 038 ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); 039 if (src.getValue() == null) { 040 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.NULL); 041 } else { 042 switch (src.getValue()) { 043 case REQUIRED: 044 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.REQUIRED); 045 break; 046 case EXTENSIBLE: 047 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.EXTENSIBLE); 048 break; 049 case PREFERRED: 050 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.PREFERRED); 051 break; 052 case EXAMPLE: 053 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.EXAMPLE); 054 break; 055 default: 056 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.NULL); 057 break; 058 } 059 } 060 return tgt; 061 } 062 063 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.AdministrativeGender> convertAdministrativeGender(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender> src) throws FHIRException { 064 if (src == null || src.isEmpty()) return null; 065 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.AdministrativeGender> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.AdministrativeGenderEnumFactory()); 066 ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); 067 if (src.getValue() == null) { 068 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.NULL); 069 } else { 070 switch (src.getValue()) { 071 case MALE: 072 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.MALE); 073 break; 074 case FEMALE: 075 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.FEMALE); 076 break; 077 case OTHER: 078 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.OTHER); 079 break; 080 case UNKNOWN: 081 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.UNKNOWN); 082 break; 083 default: 084 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.NULL); 085 break; 086 } 087 } 088 return tgt; 089 } 090 091 static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender> convertAdministrativeGender(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.AdministrativeGender> src) throws FHIRException { 092 if (src == null || src.isEmpty()) return null; 093 org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGenderEnumFactory()); 094 ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); 095 if (src.getValue() == null) { 096 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.NULL); 097 } else { 098 switch (src.getValue()) { 099 case MALE: 100 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.MALE); 101 break; 102 case FEMALE: 103 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.FEMALE); 104 break; 105 case OTHER: 106 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.OTHER); 107 break; 108 case UNKNOWN: 109 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.UNKNOWN); 110 break; 111 default: 112 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.AdministrativeGender.NULL); 113 break; 114 } 115 } 116 return tgt; 117 } 118 119 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.SearchParamType> convertSearchParamType(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.SearchParamType> src) throws FHIRException { 120 if (src == null || src.isEmpty()) return null; 121 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.SearchParamType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.SearchParamTypeEnumFactory()); 122 ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); 123 if (src.getValue() == null) { 124 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.NULL); 125 } else { 126 switch (src.getValue()) { 127 case NUMBER: 128 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.NUMBER); 129 break; 130 case DATE: 131 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.DATE); 132 break; 133 case STRING: 134 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.STRING); 135 break; 136 case TOKEN: 137 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.TOKEN); 138 break; 139 case REFERENCE: 140 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.REFERENCE); 141 break; 142 case COMPOSITE: 143 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.COMPOSITE); 144 break; 145 case QUANTITY: 146 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.QUANTITY); 147 break; 148 case URI: 149 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.URI); 150 break; 151 default: 152 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.NULL); 153 break; 154 } 155 } 156 return tgt; 157 } 158 159 static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.SearchParamType> convertSearchParamType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.SearchParamType> src) throws FHIRException { 160 if (src == null || src.isEmpty()) return null; 161 org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.SearchParamType> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.SearchParamTypeEnumFactory()); 162 ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); 163 if (src.getValue() == null) { 164 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.NULL); 165 } else { 166 switch (src.getValue()) { 167 case NUMBER: 168 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.NUMBER); 169 break; 170 case DATE: 171 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.DATE); 172 break; 173 case STRING: 174 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.STRING); 175 break; 176 case TOKEN: 177 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.TOKEN); 178 break; 179 case REFERENCE: 180 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.REFERENCE); 181 break; 182 case COMPOSITE: 183 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.COMPOSITE); 184 break; 185 case QUANTITY: 186 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.QUANTITY); 187 break; 188 case URI: 189 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.URI); 190 break; 191 default: 192 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.SearchParamType.NULL); 193 break; 194 } 195 } 196 return tgt; 197 } 198 199 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.PublicationStatus> convertConformanceResourceStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus> src) throws FHIRException { 200 if (src == null || src.isEmpty()) return null; 201 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.PublicationStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.PublicationStatusEnumFactory()); 202 ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); 203 if (src.getValue() == null) { 204 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.NULL); 205 } else { 206 switch (src.getValue()) { 207 case DRAFT: 208 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.DRAFT); 209 break; 210 case ACTIVE: 211 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.ACTIVE); 212 break; 213 case RETIRED: 214 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.RETIRED); 215 break; 216 default: 217 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.NULL); 218 break; 219 } 220 } 221 return tgt; 222 } 223 224 static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus> convertConformanceResourceStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.PublicationStatus> src) throws FHIRException { 225 if (src == null || src.isEmpty()) return null; 226 org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatusEnumFactory()); 227 ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); 228 if (src.getValue() == null) { 229 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.NULL); 230 } else { 231 switch (src.getValue()) { 232 case DRAFT: 233 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.DRAFT); 234 break; 235 case ACTIVE: 236 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.ACTIVE); 237 break; 238 case RETIRED: 239 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.RETIRED); 240 break; 241 default: 242 tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus.NULL); 243 break; 244 } 245 } 246 return tgt; 247 } 248}