
001package org.hl7.fhir.convertors.conv10_30.resources10_30; 002 003import org.hl7.fhir.convertors.context.ConversionContext10_30; 004import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Integer10_30; 005import org.hl7.fhir.exceptions.FHIRException; 006 007public class ProcessRequest10_30 { 008 public static org.hl7.fhir.dstu3.model.ProcessRequest.ItemsComponent convertItemsComponent(org.hl7.fhir.dstu2.model.ProcessRequest.ItemsComponent src) throws FHIRException { 009 if (src == null || src.isEmpty()) return null; 010 org.hl7.fhir.dstu3.model.ProcessRequest.ItemsComponent tgt = new org.hl7.fhir.dstu3.model.ProcessRequest.ItemsComponent(); 011 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 012 if (src.hasSequenceLinkIdElement()) 013 tgt.setSequenceLinkIdElement(Integer10_30.convertInteger(src.getSequenceLinkIdElement())); 014 return tgt; 015 } 016 017 public static org.hl7.fhir.dstu2.model.ProcessRequest.ItemsComponent convertItemsComponent(org.hl7.fhir.dstu3.model.ProcessRequest.ItemsComponent src) throws FHIRException { 018 if (src == null || src.isEmpty()) return null; 019 org.hl7.fhir.dstu2.model.ProcessRequest.ItemsComponent tgt = new org.hl7.fhir.dstu2.model.ProcessRequest.ItemsComponent(); 020 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 021 if (src.hasSequenceLinkIdElement()) 022 tgt.setSequenceLinkIdElement(Integer10_30.convertInteger(src.getSequenceLinkIdElement())); 023 return tgt; 024 } 025 026 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ProcessRequest.ActionList> convertActionList(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ProcessRequest.ActionList> src) throws FHIRException { 027 if (src == null || src.isEmpty()) return null; 028 org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ProcessRequest.ActionList> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ProcessRequest.ActionListEnumFactory()); 029 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); 030 if (src.getValue() == null) { 031 tgt.setValue(org.hl7.fhir.dstu3.model.ProcessRequest.ActionList.NULL); 032 } else { 033 switch (src.getValue()) { 034 case CANCEL: 035 tgt.setValue(org.hl7.fhir.dstu3.model.ProcessRequest.ActionList.CANCEL); 036 break; 037 case POLL: 038 tgt.setValue(org.hl7.fhir.dstu3.model.ProcessRequest.ActionList.POLL); 039 break; 040 case REPROCESS: 041 tgt.setValue(org.hl7.fhir.dstu3.model.ProcessRequest.ActionList.REPROCESS); 042 break; 043 case STATUS: 044 tgt.setValue(org.hl7.fhir.dstu3.model.ProcessRequest.ActionList.STATUS); 045 break; 046 default: 047 tgt.setValue(org.hl7.fhir.dstu3.model.ProcessRequest.ActionList.NULL); 048 break; 049 } 050 } 051 return tgt; 052 } 053 054 static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ProcessRequest.ActionList> convertActionList(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ProcessRequest.ActionList> src) throws FHIRException { 055 if (src == null || src.isEmpty()) return null; 056 org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ProcessRequest.ActionList> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ProcessRequest.ActionListEnumFactory()); 057 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); 058 if (src.getValue() == null) { 059 tgt.setValue(org.hl7.fhir.dstu2.model.ProcessRequest.ActionList.NULL); 060 } else { 061 switch (src.getValue()) { 062 case CANCEL: 063 tgt.setValue(org.hl7.fhir.dstu2.model.ProcessRequest.ActionList.CANCEL); 064 break; 065 case POLL: 066 tgt.setValue(org.hl7.fhir.dstu2.model.ProcessRequest.ActionList.POLL); 067 break; 068 case REPROCESS: 069 tgt.setValue(org.hl7.fhir.dstu2.model.ProcessRequest.ActionList.REPROCESS); 070 break; 071 case STATUS: 072 tgt.setValue(org.hl7.fhir.dstu2.model.ProcessRequest.ActionList.STATUS); 073 break; 074 default: 075 tgt.setValue(org.hl7.fhir.dstu2.model.ProcessRequest.ActionList.NULL); 076 break; 077 } 078 } 079 return tgt; 080 } 081}