001package org.hl7.fhir.convertors.conv40_50.resources40_50; 002 003import org.hl7.fhir.convertors.context.ConversionContext40_50; 004import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.Annotation40_50; 005import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.CodeableConcept40_50; 006import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.Identifier40_50; 007import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Boolean40_50; 008import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Canonical40_50; 009import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.DateTime40_50; 010import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; 011import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; 012import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50; 013import org.hl7.fhir.exceptions.FHIRException; 014import org.hl7.fhir.r5.model.CodeableReference; 015import org.hl7.fhir.r5.model.ServiceRequest.ServiceRequestOrderDetailComponent; 016 017/* 018 Copyright (c) 2011+, HL7, Inc. 019 All rights reserved. 020 021 Redistribution and use in source and binary forms, with or without modification, 022 are permitted provided that the following conditions are met: 023 024 * Redistributions of source code must retain the above copyright notice, this 025 list of conditions and the following disclaimer. 026 * Redistributions in binary form must reproduce the above copyright notice, 027 this list of conditions and the following disclaimer in the documentation 028 and/or other materials provided with the distribution. 029 * Neither the name of HL7 nor the names of its contributors may be used to 030 endorse or promote products derived from this software without specific 031 prior written permission. 032 033 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 034 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 035 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 036 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 037 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 038 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 039 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 040 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 041 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 042 POSSIBILITY OF SUCH DAMAGE. 043 044*/ 045// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 046public class ServiceRequest40_50 { 047 048 public static org.hl7.fhir.r5.model.ServiceRequest convertServiceRequest(org.hl7.fhir.r4.model.ServiceRequest src) throws FHIRException { 049 if (src == null) 050 return null; 051 org.hl7.fhir.r5.model.ServiceRequest tgt = new org.hl7.fhir.r5.model.ServiceRequest(); 052 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt); 053 for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) 054 tgt.addIdentifier(Identifier40_50.convertIdentifier(t)); 055 for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical()) 056 tgt.getInstantiatesCanonical().add(Canonical40_50.convertCanonical(t)); 057 for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri()) 058 tgt.getInstantiatesUri().add(Uri40_50.convertUri(t)); 059 for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference40_50.convertReference(t)); 060 for (org.hl7.fhir.r4.model.Reference t : src.getReplaces()) tgt.addReplaces(Reference40_50.convertReference(t)); 061 if (src.hasRequisition()) 062 tgt.setRequisition(Identifier40_50.convertIdentifier(src.getRequisition())); 063 if (src.hasStatus()) 064 tgt.setStatusElement(convertServiceRequestStatus(src.getStatusElement())); 065 if (src.hasIntent()) 066 tgt.setIntentElement(convertServiceRequestIntent(src.getIntentElement())); 067 for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory()) 068 tgt.addCategory(CodeableConcept40_50.convertCodeableConcept(t)); 069 if (src.hasPriority()) 070 tgt.setPriorityElement(convertServiceRequestPriority(src.getPriorityElement())); 071 if (src.hasDoNotPerform()) 072 tgt.setDoNotPerformElement(Boolean40_50.convertBoolean(src.getDoNotPerformElement())); 073 if (src.hasCode()) 074 tgt.setCode(CodeableConcept40_50.convertCodeableConceptToCodeableReference(src.getCode())); 075 for (org.hl7.fhir.r4.model.CodeableConcept t : src.getOrderDetail()) 076 tgt.addOrderDetail().addParameter().setValue(CodeableConcept40_50.convertCodeableConcept(t)); 077 if (src.hasQuantity()) 078 tgt.setQuantity(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getQuantity())); 079 if (src.hasSubject()) 080 tgt.setSubject(Reference40_50.convertReference(src.getSubject())); 081 if (src.hasEncounter()) 082 tgt.setEncounter(Reference40_50.convertReference(src.getEncounter())); 083 if (src.hasOccurrence()) 084 tgt.setOccurrence(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getOccurrence())); 085 if (src.hasAsNeeded()) 086 tgt.setAsNeeded(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getAsNeeded())); 087 if (src.hasAuthoredOn()) 088 tgt.setAuthoredOnElement(DateTime40_50.convertDateTime(src.getAuthoredOnElement())); 089 if (src.hasRequester()) 090 tgt.setRequester(Reference40_50.convertReference(src.getRequester())); 091 if (src.hasPerformerType()) 092 tgt.setPerformerType(CodeableConcept40_50.convertCodeableConcept(src.getPerformerType())); 093 for (org.hl7.fhir.r4.model.Reference t : src.getPerformer()) tgt.addPerformer(Reference40_50.convertReference(t)); 094 for (org.hl7.fhir.r4.model.CodeableConcept t : src.getLocationCode()) 095 tgt.addLocation(CodeableConcept40_50.convertCodeableConceptToCodeableReference(t)); 096 for (org.hl7.fhir.r4.model.Reference t : src.getLocationReference()) 097 tgt.addLocation(Reference40_50.convertReferenceToCodeableReference(t)); 098 for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode()) 099 tgt.addReason(CodeableConcept40_50.convertCodeableConceptToCodeableReference(t)); 100 for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference()) 101 tgt.addReason(Reference40_50.convertReferenceToCodeableReference(t)); 102 for (org.hl7.fhir.r4.model.Reference t : src.getInsurance()) tgt.addInsurance(Reference40_50.convertReference(t)); 103 for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInfo()) 104 tgt.addSupportingInfo(Reference40_50.convertReferenceToCodeableReference(t)); 105 for (org.hl7.fhir.r4.model.Reference t : src.getSpecimen()) tgt.addSpecimen(Reference40_50.convertReference(t)); 106 for (org.hl7.fhir.r4.model.CodeableConcept t : src.getBodySite()) 107 tgt.addBodySite(CodeableConcept40_50.convertCodeableConcept(t)); 108 for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(Annotation40_50.convertAnnotation(t)); 109 if (src.hasPatientInstruction()) 110 tgt.addPatientInstruction().setInstruction(String40_50.convertStringToMarkdown(src.getPatientInstructionElement())); 111 for (org.hl7.fhir.r4.model.Reference t : src.getRelevantHistory()) 112 tgt.addRelevantHistory(Reference40_50.convertReference(t)); 113 return tgt; 114 } 115 116 public static org.hl7.fhir.r4.model.ServiceRequest convertServiceRequest(org.hl7.fhir.r5.model.ServiceRequest src) throws FHIRException { 117 if (src == null) 118 return null; 119 org.hl7.fhir.r4.model.ServiceRequest tgt = new org.hl7.fhir.r4.model.ServiceRequest(); 120 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt); 121 for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) 122 tgt.addIdentifier(Identifier40_50.convertIdentifier(t)); 123 for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) 124 tgt.getInstantiatesCanonical().add(Canonical40_50.convertCanonical(t)); 125 for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) 126 tgt.getInstantiatesUri().add(Uri40_50.convertUri(t)); 127 for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference40_50.convertReference(t)); 128 for (org.hl7.fhir.r5.model.Reference t : src.getReplaces()) tgt.addReplaces(Reference40_50.convertReference(t)); 129 if (src.hasRequisition()) 130 tgt.setRequisition(Identifier40_50.convertIdentifier(src.getRequisition())); 131 if (src.hasStatus()) 132 tgt.setStatusElement(convertServiceRequestStatus(src.getStatusElement())); 133 if (src.hasIntent()) 134 tgt.setIntentElement(convertServiceRequestIntent(src.getIntentElement())); 135 for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) 136 tgt.addCategory(CodeableConcept40_50.convertCodeableConcept(t)); 137 if (src.hasPriority()) 138 tgt.setPriorityElement(convertServiceRequestPriority(src.getPriorityElement())); 139 if (src.hasDoNotPerform()) 140 tgt.setDoNotPerformElement(Boolean40_50.convertBoolean(src.getDoNotPerformElement())); 141 if (src.hasCode()) 142 tgt.setCode(CodeableConcept40_50.convertCodeableReferenceToCodeableConcept(src.getCode())); 143 for (ServiceRequestOrderDetailComponent t : src.getOrderDetail()) { 144 if (t.getParameterFirstRep().hasValueCodeableConcept()) { 145 tgt.addOrderDetail(CodeableConcept40_50.convertCodeableConcept(t.getParameterFirstRep().getValueCodeableConcept())); 146 } 147 } 148 if (src.hasQuantity()) 149 tgt.setQuantity(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getQuantity())); 150 if (src.hasSubject()) 151 tgt.setSubject(Reference40_50.convertReference(src.getSubject())); 152 if (src.hasEncounter()) 153 tgt.setEncounter(Reference40_50.convertReference(src.getEncounter())); 154 if (src.hasOccurrence()) 155 tgt.setOccurrence(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getOccurrence())); 156 if (src.hasAsNeeded()) 157 tgt.setAsNeeded(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getAsNeeded())); 158 if (src.hasAuthoredOn()) 159 tgt.setAuthoredOnElement(DateTime40_50.convertDateTime(src.getAuthoredOnElement())); 160 if (src.hasRequester()) 161 tgt.setRequester(Reference40_50.convertReference(src.getRequester())); 162 if (src.hasPerformerType()) 163 tgt.setPerformerType(CodeableConcept40_50.convertCodeableConcept(src.getPerformerType())); 164 for (org.hl7.fhir.r5.model.Reference t : src.getPerformer()) tgt.addPerformer(Reference40_50.convertReference(t)); 165 for (CodeableReference t : src.getLocation()) 166 if (t.hasConcept()) 167 tgt.addLocationCode(CodeableConcept40_50.convertCodeableConcept(t.getConcept())); 168 for (CodeableReference t : src.getLocation()) 169 if (t.hasReference()) 170 tgt.addLocationReference(Reference40_50.convertReference(t.getReference())); 171 for (CodeableReference t : src.getReason()) 172 if (t.hasConcept()) 173 tgt.addReasonCode(CodeableConcept40_50.convertCodeableConcept(t.getConcept())); 174 for (CodeableReference t : src.getReason()) 175 if (t.hasReference()) 176 tgt.addReasonReference(Reference40_50.convertReference(t.getReference())); 177 for (org.hl7.fhir.r5.model.Reference t : src.getInsurance()) tgt.addInsurance(Reference40_50.convertReference(t)); 178 for (CodeableReference t : src.getSupportingInfo()) 179 if (t.hasReference()) 180 tgt.addSupportingInfo(Reference40_50.convertReference(t.getReference())); 181 for (org.hl7.fhir.r5.model.Reference t : src.getSpecimen()) tgt.addSpecimen(Reference40_50.convertReference(t)); 182 for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodySite()) 183 tgt.addBodySite(CodeableConcept40_50.convertCodeableConcept(t)); 184 for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation40_50.convertAnnotation(t)); 185 if (src.getPatientInstructionFirstRep().hasInstructionMarkdownType()) 186 tgt.setPatientInstructionElement(String40_50.convertString(src.getPatientInstructionFirstRep().getInstructionMarkdownType())); 187 for (org.hl7.fhir.r5.model.Reference t : src.getRelevantHistory()) 188 tgt.addRelevantHistory(Reference40_50.convertReference(t)); 189 return tgt; 190 } 191 192 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestStatus> convertServiceRequestStatus(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus> src) throws FHIRException { 193 if (src == null || src.isEmpty()) 194 return null; 195 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestStatusEnumFactory()); 196 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 197 switch (src.getValue()) { 198 case DRAFT: 199 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT); 200 break; 201 case ACTIVE: 202 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE); 203 break; 204 case ONHOLD: 205 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD); 206 break; 207 case REVOKED: 208 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED); 209 break; 210 case COMPLETED: 211 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED); 212 break; 213 case ENTEREDINERROR: 214 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR); 215 break; 216 case UNKNOWN: 217 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN); 218 break; 219 default: 220 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL); 221 break; 222 } 223 return tgt; 224 } 225 226 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus> convertServiceRequestStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestStatus> src) throws FHIRException { 227 if (src == null || src.isEmpty()) 228 return null; 229 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatusEnumFactory()); 230 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 231 switch (src.getValue()) { 232 case DRAFT: 233 tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.DRAFT); 234 break; 235 case ACTIVE: 236 tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.ACTIVE); 237 break; 238 case ONHOLD: 239 tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.ONHOLD); 240 break; 241 case REVOKED: 242 tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.REVOKED); 243 break; 244 case COMPLETED: 245 tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.COMPLETED); 246 break; 247 case ENTEREDINERROR: 248 tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.ENTEREDINERROR); 249 break; 250 case UNKNOWN: 251 tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.UNKNOWN); 252 break; 253 default: 254 tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestStatus.NULL); 255 break; 256 } 257 return tgt; 258 } 259 260 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestIntent> convertServiceRequestIntent(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent> src) throws FHIRException { 261 if (src == null || src.isEmpty()) 262 return null; 263 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestIntent> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestIntentEnumFactory()); 264 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 265 switch (src.getValue()) { 266 case PROPOSAL: 267 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.PROPOSAL); 268 break; 269 case PLAN: 270 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.PLAN); 271 break; 272 case DIRECTIVE: 273 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.DIRECTIVE); 274 break; 275 case ORDER: 276 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORDER); 277 break; 278 case ORIGINALORDER: 279 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORIGINALORDER); 280 break; 281 case REFLEXORDER: 282 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.REFLEXORDER); 283 break; 284 case FILLERORDER: 285 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.FILLERORDER); 286 break; 287 case INSTANCEORDER: 288 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.INSTANCEORDER); 289 break; 290 case OPTION: 291 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.OPTION); 292 break; 293 default: 294 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.NULL); 295 break; 296 } 297 return tgt; 298 } 299 300 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent> convertServiceRequestIntent(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestIntent> src) throws FHIRException { 301 if (src == null || src.isEmpty()) 302 return null; 303 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntentEnumFactory()); 304 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 305 switch (src.getValue()) { 306 case PROPOSAL: 307 tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.PROPOSAL); 308 break; 309 case PLAN: 310 tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.PLAN); 311 break; 312 case DIRECTIVE: 313 tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.DIRECTIVE); 314 break; 315 case ORDER: 316 tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.ORDER); 317 break; 318 case ORIGINALORDER: 319 tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.ORIGINALORDER); 320 break; 321 case REFLEXORDER: 322 tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.REFLEXORDER); 323 break; 324 case FILLERORDER: 325 tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.FILLERORDER); 326 break; 327 case INSTANCEORDER: 328 tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.INSTANCEORDER); 329 break; 330 case OPTION: 331 tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.OPTION); 332 break; 333 default: 334 tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestIntent.NULL); 335 break; 336 } 337 return tgt; 338 } 339 340 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestPriority> convertServiceRequestPriority(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority> src) throws FHIRException { 341 if (src == null || src.isEmpty()) 342 return null; 343 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestPriority> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestPriorityEnumFactory()); 344 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 345 switch (src.getValue()) { 346 case ROUTINE: 347 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE); 348 break; 349 case URGENT: 350 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT); 351 break; 352 case ASAP: 353 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP); 354 break; 355 case STAT: 356 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT); 357 break; 358 default: 359 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL); 360 break; 361 } 362 return tgt; 363 } 364 365 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority> convertServiceRequestPriority(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestPriority> src) throws FHIRException { 366 if (src == null || src.isEmpty()) 367 return null; 368 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriorityEnumFactory()); 369 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 370 switch (src.getValue()) { 371 case ROUTINE: 372 tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority.ROUTINE); 373 break; 374 case URGENT: 375 tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority.URGENT); 376 break; 377 case ASAP: 378 tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority.ASAP); 379 break; 380 case STAT: 381 tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority.STAT); 382 break; 383 default: 384 tgt.setValue(org.hl7.fhir.r4.model.ServiceRequest.ServiceRequestPriority.NULL); 385 break; 386 } 387 return tgt; 388 } 389}