001package org.hl7.fhir.convertors.conv40_50;
002
003
004import org.hl7.fhir.convertors.VersionConvertor_40_50;
005import org.hl7.fhir.exceptions.FHIRException;
006
007/*
008  Copyright (c) 2011+, HL7, Inc.
009  All rights reserved.
010  
011  Redistribution and use in source and binary forms, with or without modification, 
012  are permitted provided that the following conditions are met:
013  
014   * Redistributions of source code must retain the above copyright notice, this 
015     list of conditions and the following disclaimer.
016   * Redistributions in binary form must reproduce the above copyright notice, 
017     this list of conditions and the following disclaimer in the documentation 
018     and/or other materials provided with the distribution.
019   * Neither the name of HL7 nor the names of its contributors may be used to 
020     endorse or promote products derived from this software without specific 
021     prior written permission.
022  
023  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
024  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
025  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
026  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
027  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
028  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
029  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
030  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
031  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
032  POSSIBILITY OF SUCH DAMAGE.
033  
034*/
035// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
036public class PlanDefinition40_50 extends VersionConvertor_40_50 {
037
038    public static org.hl7.fhir.r5.model.PlanDefinition convertPlanDefinition(org.hl7.fhir.r4.model.PlanDefinition src) throws FHIRException {
039        if (src == null)
040            return null;
041        org.hl7.fhir.r5.model.PlanDefinition tgt = new org.hl7.fhir.r5.model.PlanDefinition();
042        copyDomainResource(src, tgt);
043        if (src.hasUrl())
044            tgt.setUrlElement(convertUri(src.getUrlElement()));
045        for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t));
046        if (src.hasVersion())
047            tgt.setVersionElement(convertString(src.getVersionElement()));
048        if (src.hasName())
049            tgt.setNameElement(convertString(src.getNameElement()));
050        if (src.hasTitle())
051            tgt.setTitleElement(convertString(src.getTitleElement()));
052        if (src.hasSubtitle())
053            tgt.setSubtitleElement(convertString(src.getSubtitleElement()));
054        if (src.hasType())
055            tgt.setType(convertCodeableConcept(src.getType()));
056        if (src.hasStatus())
057            tgt.setStatusElement(Enumerations40_50.convertPublicationStatus(src.getStatusElement()));
058        if (src.hasExperimental())
059            tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement()));
060        if (src.hasSubject())
061            tgt.setSubject(convertType(src.getSubject()));
062        if (src.hasDate())
063            tgt.setDateElement(convertDateTime(src.getDateElement()));
064        if (src.hasPublisher())
065            tgt.setPublisherElement(convertString(src.getPublisherElement()));
066        for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t));
067        if (src.hasDescription())
068            tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
069        for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t));
070        for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t));
071        if (src.hasPurpose())
072            tgt.setPurposeElement(convertMarkdown(src.getPurposeElement()));
073        if (src.hasUsage())
074            tgt.setUsageElement(convertString(src.getUsageElement()));
075        if (src.hasCopyright())
076            tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
077        if (src.hasApprovalDate())
078            tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement()));
079        if (src.hasLastReviewDate())
080            tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement()));
081        if (src.hasEffectivePeriod())
082            tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod()));
083        for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTopic()) tgt.addTopic(convertCodeableConcept(t));
084        for (org.hl7.fhir.r4.model.ContactDetail t : src.getAuthor()) tgt.addAuthor(convertContactDetail(t));
085        for (org.hl7.fhir.r4.model.ContactDetail t : src.getEditor()) tgt.addEditor(convertContactDetail(t));
086        for (org.hl7.fhir.r4.model.ContactDetail t : src.getReviewer()) tgt.addReviewer(convertContactDetail(t));
087        for (org.hl7.fhir.r4.model.ContactDetail t : src.getEndorser()) tgt.addEndorser(convertContactDetail(t));
088        for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(convertRelatedArtifact(t));
089        for (org.hl7.fhir.r4.model.CanonicalType t : src.getLibrary()) tgt.getLibrary().add(convertCanonical(t));
090        for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalComponent t : src.getGoal()) tgt.addGoal(convertPlanDefinitionGoalComponent(t));
091        for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) tgt.addAction(convertPlanDefinitionActionComponent(t));
092        return tgt;
093    }
094
095    public static org.hl7.fhir.r4.model.PlanDefinition convertPlanDefinition(org.hl7.fhir.r5.model.PlanDefinition src) throws FHIRException {
096        if (src == null)
097            return null;
098        org.hl7.fhir.r4.model.PlanDefinition tgt = new org.hl7.fhir.r4.model.PlanDefinition();
099        copyDomainResource(src, tgt);
100        if (src.hasUrl())
101            tgt.setUrlElement(convertUri(src.getUrlElement()));
102        for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t));
103        if (src.hasVersion())
104            tgt.setVersionElement(convertString(src.getVersionElement()));
105        if (src.hasName())
106            tgt.setNameElement(convertString(src.getNameElement()));
107        if (src.hasTitle())
108            tgt.setTitleElement(convertString(src.getTitleElement()));
109        if (src.hasSubtitle())
110            tgt.setSubtitleElement(convertString(src.getSubtitleElement()));
111        if (src.hasType())
112            tgt.setType(convertCodeableConcept(src.getType()));
113        if (src.hasStatus())
114            tgt.setStatusElement(Enumerations40_50.convertPublicationStatus(src.getStatusElement()));
115        if (src.hasExperimental())
116            tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement()));
117        if (src.hasSubject())
118            tgt.setSubject(convertType(src.getSubject()));
119        if (src.hasDate())
120            tgt.setDateElement(convertDateTime(src.getDateElement()));
121        if (src.hasPublisher())
122            tgt.setPublisherElement(convertString(src.getPublisherElement()));
123        for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) tgt.addContact(convertContactDetail(t));
124        if (src.hasDescription())
125            tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
126        for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) tgt.addUseContext(convertUsageContext(t));
127        for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) tgt.addJurisdiction(convertCodeableConcept(t));
128        if (src.hasPurpose())
129            tgt.setPurposeElement(convertMarkdown(src.getPurposeElement()));
130        if (src.hasUsage())
131            tgt.setUsageElement(convertString(src.getUsageElement()));
132        if (src.hasCopyright())
133            tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
134        if (src.hasApprovalDate())
135            tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement()));
136        if (src.hasLastReviewDate())
137            tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement()));
138        if (src.hasEffectivePeriod())
139            tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod()));
140        for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic()) tgt.addTopic(convertCodeableConcept(t));
141        for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor()) tgt.addAuthor(convertContactDetail(t));
142        for (org.hl7.fhir.r5.model.ContactDetail t : src.getEditor()) tgt.addEditor(convertContactDetail(t));
143        for (org.hl7.fhir.r5.model.ContactDetail t : src.getReviewer()) tgt.addReviewer(convertContactDetail(t));
144        for (org.hl7.fhir.r5.model.ContactDetail t : src.getEndorser()) tgt.addEndorser(convertContactDetail(t));
145        for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact()) tgt.addRelatedArtifact(convertRelatedArtifact(t));
146        for (org.hl7.fhir.r5.model.CanonicalType t : src.getLibrary()) tgt.getLibrary().add(convertCanonical(t));
147        for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalComponent t : src.getGoal()) tgt.addGoal(convertPlanDefinitionGoalComponent(t));
148        for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) tgt.addAction(convertPlanDefinitionActionComponent(t));
149        return tgt;
150    }
151
152    public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalComponent convertPlanDefinitionGoalComponent(org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalComponent src) throws FHIRException {
153        if (src == null)
154            return null;
155        org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalComponent();
156        copyElement(src, tgt);
157        if (src.hasCategory())
158            tgt.setCategory(convertCodeableConcept(src.getCategory()));
159        if (src.hasDescription())
160            tgt.setDescription(convertCodeableConcept(src.getDescription()));
161        if (src.hasPriority())
162            tgt.setPriority(convertCodeableConcept(src.getPriority()));
163        if (src.hasStart())
164            tgt.setStart(convertCodeableConcept(src.getStart()));
165        for (org.hl7.fhir.r4.model.CodeableConcept t : src.getAddresses()) tgt.addAddresses(convertCodeableConcept(t));
166        for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getDocumentation()) tgt.addDocumentation(convertRelatedArtifact(t));
167        for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalTargetComponent t : src.getTarget()) tgt.addTarget(convertPlanDefinitionGoalTargetComponent(t));
168        return tgt;
169    }
170
171    public static org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalComponent convertPlanDefinitionGoalComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalComponent src) throws FHIRException {
172        if (src == null)
173            return null;
174        org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalComponent tgt = new org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalComponent();
175        copyElement(src, tgt);
176        if (src.hasCategory())
177            tgt.setCategory(convertCodeableConcept(src.getCategory()));
178        if (src.hasDescription())
179            tgt.setDescription(convertCodeableConcept(src.getDescription()));
180        if (src.hasPriority())
181            tgt.setPriority(convertCodeableConcept(src.getPriority()));
182        if (src.hasStart())
183            tgt.setStart(convertCodeableConcept(src.getStart()));
184        for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAddresses()) tgt.addAddresses(convertCodeableConcept(t));
185        for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getDocumentation()) tgt.addDocumentation(convertRelatedArtifact(t));
186        for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalTargetComponent t : src.getTarget()) tgt.addTarget(convertPlanDefinitionGoalTargetComponent(t));
187        return tgt;
188    }
189
190    public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalTargetComponent convertPlanDefinitionGoalTargetComponent(org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalTargetComponent src) throws FHIRException {
191        if (src == null)
192            return null;
193        org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalTargetComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalTargetComponent();
194        copyElement(src, tgt);
195        if (src.hasMeasure())
196            tgt.setMeasure(convertCodeableConcept(src.getMeasure()));
197        if (src.hasDetail())
198            tgt.setDetail(convertType(src.getDetail()));
199        if (src.hasDue())
200            tgt.setDue(convertDuration(src.getDue()));
201        return tgt;
202    }
203
204    public static org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalTargetComponent convertPlanDefinitionGoalTargetComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalTargetComponent src) throws FHIRException {
205        if (src == null)
206            return null;
207        org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalTargetComponent tgt = new org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionGoalTargetComponent();
208        copyElement(src, tgt);
209        if (src.hasMeasure())
210            tgt.setMeasure(convertCodeableConcept(src.getMeasure()));
211        if (src.hasDetail())
212            tgt.setDetail(convertType(src.getDetail()));
213        if (src.hasDue())
214            tgt.setDue(convertDuration(src.getDue()));
215        return tgt;
216    }
217
218    public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent convertPlanDefinitionActionComponent(org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionComponent src) throws FHIRException {
219        if (src == null)
220            return null;
221        org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent();
222        copyElement(src, tgt);
223        if (src.hasPrefix())
224            tgt.setPrefixElement(convertString(src.getPrefixElement()));
225        if (src.hasTitle())
226            tgt.setTitleElement(convertString(src.getTitleElement()));
227        if (src.hasDescription())
228            tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
229        if (src.hasTextEquivalent())
230            tgt.setTextEquivalentElement(convertString(src.getTextEquivalentElement()));
231        if (src.hasPriority())
232            tgt.setPriorityElement(convertRequestPriority(src.getPriorityElement()));
233        for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) tgt.addCode(convertCodeableConcept(t));
234        for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReason()) tgt.addReason(convertCodeableConcept(t));
235        for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getDocumentation()) tgt.addDocumentation(convertRelatedArtifact(t));
236        for (org.hl7.fhir.r4.model.IdType t : src.getGoalId()) tgt.getGoalId().add(convertId(t));
237        if (src.hasSubject())
238            tgt.setSubject(convertType(src.getSubject()));
239        for (org.hl7.fhir.r4.model.TriggerDefinition t : src.getTrigger()) tgt.addTrigger(convertTriggerDefinition(t));
240        for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionConditionComponent t : src.getCondition()) tgt.addCondition(convertPlanDefinitionActionConditionComponent(t));
241        for (org.hl7.fhir.r4.model.DataRequirement t : src.getInput()) tgt.addInput(convertDataRequirement(t));
242        for (org.hl7.fhir.r4.model.DataRequirement t : src.getOutput()) tgt.addOutput(convertDataRequirement(t));
243        for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent t : src.getRelatedAction()) tgt.addRelatedAction(convertPlanDefinitionActionRelatedActionComponent(t));
244        if (src.hasTiming())
245            tgt.setTiming(convertType(src.getTiming()));
246        for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertPlanDefinitionActionParticipantComponent(t));
247        if (src.hasType())
248            tgt.setType(convertCodeableConcept(src.getType()));
249        if (src.hasGroupingBehavior())
250            tgt.setGroupingBehaviorElement(convertActionGroupingBehavior(src.getGroupingBehaviorElement()));
251        if (src.hasSelectionBehavior())
252            tgt.setSelectionBehaviorElement(convertActionSelectionBehavior(src.getSelectionBehaviorElement()));
253        if (src.hasRequiredBehavior())
254            tgt.setRequiredBehaviorElement(convertActionRequiredBehavior(src.getRequiredBehaviorElement()));
255        if (src.hasPrecheckBehavior())
256            tgt.setPrecheckBehaviorElement(convertActionPrecheckBehavior(src.getPrecheckBehaviorElement()));
257        if (src.hasCardinalityBehavior())
258            tgt.setCardinalityBehaviorElement(convertActionCardinalityBehavior(src.getCardinalityBehaviorElement()));
259        if (src.hasDefinition())
260            tgt.setDefinition(convertType(src.getDefinition()));
261        if (src.hasTransform())
262            tgt.setTransformElement(convertCanonical(src.getTransformElement()));
263        for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent t : src.getDynamicValue()) tgt.addDynamicValue(convertPlanDefinitionActionDynamicValueComponent(t));
264        for (org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) tgt.addAction(convertPlanDefinitionActionComponent(t));
265        return tgt;
266    }
267
268    public static org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionComponent convertPlanDefinitionActionComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent src) throws FHIRException {
269        if (src == null)
270            return null;
271        org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionComponent tgt = new org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionComponent();
272        copyElement(src, tgt);
273        if (src.hasPrefix())
274            tgt.setPrefixElement(convertString(src.getPrefixElement()));
275        if (src.hasTitle())
276            tgt.setTitleElement(convertString(src.getTitleElement()));
277        if (src.hasDescription())
278            tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
279        if (src.hasTextEquivalent())
280            tgt.setTextEquivalentElement(convertString(src.getTextEquivalentElement()));
281        if (src.hasPriority())
282            tgt.setPriorityElement(convertRequestPriority(src.getPriorityElement()));
283        for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) tgt.addCode(convertCodeableConcept(t));
284        for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReason()) tgt.addReason(convertCodeableConcept(t));
285        for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getDocumentation()) tgt.addDocumentation(convertRelatedArtifact(t));
286        for (org.hl7.fhir.r5.model.IdType t : src.getGoalId()) tgt.getGoalId().add(convertId(t));
287        if (src.hasSubject())
288            tgt.setSubject(convertType(src.getSubject()));
289        for (org.hl7.fhir.r5.model.TriggerDefinition t : src.getTrigger()) tgt.addTrigger(convertTriggerDefinition(t));
290        for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionConditionComponent t : src.getCondition()) tgt.addCondition(convertPlanDefinitionActionConditionComponent(t));
291        for (org.hl7.fhir.r5.model.DataRequirement t : src.getInput()) tgt.addInput(convertDataRequirement(t));
292        for (org.hl7.fhir.r5.model.DataRequirement t : src.getOutput()) tgt.addOutput(convertDataRequirement(t));
293        for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent t : src.getRelatedAction()) tgt.addRelatedAction(convertPlanDefinitionActionRelatedActionComponent(t));
294        if (src.hasTiming())
295            tgt.setTiming(convertType(src.getTiming()));
296        for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertPlanDefinitionActionParticipantComponent(t));
297        if (src.hasType())
298            tgt.setType(convertCodeableConcept(src.getType()));
299        if (src.hasGroupingBehavior())
300            tgt.setGroupingBehaviorElement(convertActionGroupingBehavior(src.getGroupingBehaviorElement()));
301        if (src.hasSelectionBehavior())
302            tgt.setSelectionBehaviorElement(convertActionSelectionBehavior(src.getSelectionBehaviorElement()));
303        if (src.hasRequiredBehavior())
304            tgt.setRequiredBehaviorElement(convertActionRequiredBehavior(src.getRequiredBehaviorElement()));
305        if (src.hasPrecheckBehavior())
306            tgt.setPrecheckBehaviorElement(convertActionPrecheckBehavior(src.getPrecheckBehaviorElement()));
307        if (src.hasCardinalityBehavior())
308            tgt.setCardinalityBehaviorElement(convertActionCardinalityBehavior(src.getCardinalityBehaviorElement()));
309        if (src.hasDefinition())
310            tgt.setDefinition(convertType(src.getDefinition()));
311        if (src.hasTransform())
312            tgt.setTransformElement(convertCanonical(src.getTransformElement()));
313        for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent t : src.getDynamicValue()) tgt.addDynamicValue(convertPlanDefinitionActionDynamicValueComponent(t));
314        for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) tgt.addAction(convertPlanDefinitionActionComponent(t));
315        return tgt;
316    }
317
318    static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestPriority> convertRequestPriority(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.RequestPriority> src) throws FHIRException {
319        if (src == null || src.isEmpty())
320            return null;
321        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());
322        VersionConvertor_40_50.copyElement(src, tgt);
323        switch(src.getValue()) {
324            case ROUTINE:
325                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE);
326                break;
327            case URGENT:
328                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT);
329                break;
330            case ASAP:
331                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP);
332                break;
333            case STAT:
334                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT);
335                break;
336            default:
337                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL);
338                break;
339        }
340        return tgt;
341    }
342
343    static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.RequestPriority> convertRequestPriority(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestPriority> src) throws FHIRException {
344        if (src == null || src.isEmpty())
345            return null;
346        org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.RequestPriority> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PlanDefinition.RequestPriorityEnumFactory());
347        VersionConvertor_40_50.copyElement(src, tgt);
348        switch(src.getValue()) {
349            case ROUTINE:
350                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.RequestPriority.ROUTINE);
351                break;
352            case URGENT:
353                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.RequestPriority.URGENT);
354                break;
355            case ASAP:
356                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.RequestPriority.ASAP);
357                break;
358            case STAT:
359                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.RequestPriority.STAT);
360                break;
361            default:
362                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.RequestPriority.NULL);
363                break;
364        }
365        return tgt;
366    }
367
368    static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior> convertActionGroupingBehavior(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior> src) throws FHIRException {
369        if (src == null || src.isEmpty())
370            return null;
371        org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehaviorEnumFactory());
372        VersionConvertor_40_50.copyElement(src, tgt);
373        switch(src.getValue()) {
374            case VISUALGROUP:
375                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.VISUALGROUP);
376                break;
377            case LOGICALGROUP:
378                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.LOGICALGROUP);
379                break;
380            case SENTENCEGROUP:
381                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.SENTENCEGROUP);
382                break;
383            default:
384                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior.NULL);
385                break;
386        }
387        return tgt;
388    }
389
390    static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior> convertActionGroupingBehavior(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionGroupingBehavior> src) throws FHIRException {
391        if (src == null || src.isEmpty())
392            return null;
393        org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehaviorEnumFactory());
394        VersionConvertor_40_50.copyElement(src, tgt);
395        switch(src.getValue()) {
396            case VISUALGROUP:
397                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior.VISUALGROUP);
398                break;
399            case LOGICALGROUP:
400                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior.LOGICALGROUP);
401                break;
402            case SENTENCEGROUP:
403                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior.SENTENCEGROUP);
404                break;
405            default:
406                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionGroupingBehavior.NULL);
407                break;
408        }
409        return tgt;
410    }
411
412    static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior> convertActionSelectionBehavior(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior> src) throws FHIRException {
413        if (src == null || src.isEmpty())
414            return null;
415        org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehaviorEnumFactory());
416        VersionConvertor_40_50.copyElement(src, tgt);
417        switch(src.getValue()) {
418            case ANY:
419                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ANY);
420                break;
421            case ALL:
422                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ALL);
423                break;
424            case ALLORNONE:
425                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ALLORNONE);
426                break;
427            case EXACTLYONE:
428                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.EXACTLYONE);
429                break;
430            case ATMOSTONE:
431                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ATMOSTONE);
432                break;
433            case ONEORMORE:
434                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.ONEORMORE);
435                break;
436            default:
437                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior.NULL);
438                break;
439        }
440        return tgt;
441    }
442
443    static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior> convertActionSelectionBehavior(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionSelectionBehavior> src) throws FHIRException {
444        if (src == null || src.isEmpty())
445            return null;
446        org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehaviorEnumFactory());
447        VersionConvertor_40_50.copyElement(src, tgt);
448        switch(src.getValue()) {
449            case ANY:
450                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.ANY);
451                break;
452            case ALL:
453                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.ALL);
454                break;
455            case ALLORNONE:
456                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.ALLORNONE);
457                break;
458            case EXACTLYONE:
459                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.EXACTLYONE);
460                break;
461            case ATMOSTONE:
462                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.ATMOSTONE);
463                break;
464            case ONEORMORE:
465                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.ONEORMORE);
466                break;
467            default:
468                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionSelectionBehavior.NULL);
469                break;
470        }
471        return tgt;
472    }
473
474    static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior> convertActionRequiredBehavior(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior> src) throws FHIRException {
475        if (src == null || src.isEmpty())
476            return null;
477        org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehaviorEnumFactory());
478        VersionConvertor_40_50.copyElement(src, tgt);
479        switch(src.getValue()) {
480            case MUST:
481                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.MUST);
482                break;
483            case COULD:
484                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.COULD);
485                break;
486            case MUSTUNLESSDOCUMENTED:
487                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.MUSTUNLESSDOCUMENTED);
488                break;
489            default:
490                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior.NULL);
491                break;
492        }
493        return tgt;
494    }
495
496    static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior> convertActionRequiredBehavior(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionRequiredBehavior> src) throws FHIRException {
497        if (src == null || src.isEmpty())
498            return null;
499        org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehaviorEnumFactory());
500        VersionConvertor_40_50.copyElement(src, tgt);
501        switch(src.getValue()) {
502            case MUST:
503                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior.MUST);
504                break;
505            case COULD:
506                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior.COULD);
507                break;
508            case MUSTUNLESSDOCUMENTED:
509                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior.MUSTUNLESSDOCUMENTED);
510                break;
511            default:
512                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRequiredBehavior.NULL);
513                break;
514        }
515        return tgt;
516    }
517
518    static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior> convertActionPrecheckBehavior(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.ActionPrecheckBehavior> src) throws FHIRException {
519        if (src == null || src.isEmpty())
520            return null;
521        org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehaviorEnumFactory());
522        VersionConvertor_40_50.copyElement(src, tgt);
523        switch(src.getValue()) {
524            case YES:
525                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior.YES);
526                break;
527            case NO:
528                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior.NO);
529                break;
530            default:
531                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior.NULL);
532                break;
533        }
534        return tgt;
535    }
536
537    static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.ActionPrecheckBehavior> convertActionPrecheckBehavior(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionPrecheckBehavior> src) throws FHIRException {
538        if (src == null || src.isEmpty())
539            return null;
540        org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.ActionPrecheckBehavior> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PlanDefinition.ActionPrecheckBehaviorEnumFactory());
541        VersionConvertor_40_50.copyElement(src, tgt);
542        switch(src.getValue()) {
543            case YES:
544                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionPrecheckBehavior.YES);
545                break;
546            case NO:
547                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionPrecheckBehavior.NO);
548                break;
549            default:
550                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionPrecheckBehavior.NULL);
551                break;
552        }
553        return tgt;
554    }
555
556    static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior> convertActionCardinalityBehavior(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.ActionCardinalityBehavior> src) throws FHIRException {
557        if (src == null || src.isEmpty())
558            return null;
559        org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehaviorEnumFactory());
560        VersionConvertor_40_50.copyElement(src, tgt);
561        switch(src.getValue()) {
562            case SINGLE:
563                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior.SINGLE);
564                break;
565            case MULTIPLE:
566                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior.MULTIPLE);
567                break;
568            default:
569                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior.NULL);
570                break;
571        }
572        return tgt;
573    }
574
575    static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.ActionCardinalityBehavior> convertActionCardinalityBehavior(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionCardinalityBehavior> src) throws FHIRException {
576        if (src == null || src.isEmpty())
577            return null;
578        org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.ActionCardinalityBehavior> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PlanDefinition.ActionCardinalityBehaviorEnumFactory());
579        VersionConvertor_40_50.copyElement(src, tgt);
580        switch(src.getValue()) {
581            case SINGLE:
582                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionCardinalityBehavior.SINGLE);
583                break;
584            case MULTIPLE:
585                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionCardinalityBehavior.MULTIPLE);
586                break;
587            default:
588                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionCardinalityBehavior.NULL);
589                break;
590        }
591        return tgt;
592    }
593
594    public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionConditionComponent convertPlanDefinitionActionConditionComponent(org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionConditionComponent src) throws FHIRException {
595        if (src == null)
596            return null;
597        org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionConditionComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionConditionComponent();
598        copyElement(src, tgt);
599        if (src.hasKind())
600            tgt.setKindElement(convertActionConditionKind(src.getKindElement()));
601        if (src.hasExpression())
602            tgt.setExpression(convertExpression(src.getExpression()));
603        return tgt;
604    }
605
606    public static org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionConditionComponent convertPlanDefinitionActionConditionComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionConditionComponent src) throws FHIRException {
607        if (src == null)
608            return null;
609        org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionConditionComponent tgt = new org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionConditionComponent();
610        copyElement(src, tgt);
611        if (src.hasKind())
612            tgt.setKindElement(convertActionConditionKind(src.getKindElement()));
613        if (src.hasExpression())
614            tgt.setExpression(convertExpression(src.getExpression()));
615        return tgt;
616    }
617
618    static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionConditionKind> convertActionConditionKind(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind> src) throws FHIRException {
619        if (src == null || src.isEmpty())
620            return null;
621        org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionConditionKind> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionConditionKindEnumFactory());
622        VersionConvertor_40_50.copyElement(src, tgt);
623        switch(src.getValue()) {
624            case APPLICABILITY:
625                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.APPLICABILITY);
626                break;
627            case START:
628                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.START);
629                break;
630            case STOP:
631                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.STOP);
632                break;
633            default:
634                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionConditionKind.NULL);
635                break;
636        }
637        return tgt;
638    }
639
640    static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind> convertActionConditionKind(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionConditionKind> src) throws FHIRException {
641        if (src == null || src.isEmpty())
642            return null;
643        org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKindEnumFactory());
644        VersionConvertor_40_50.copyElement(src, tgt);
645        switch(src.getValue()) {
646            case APPLICABILITY:
647                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind.APPLICABILITY);
648                break;
649            case START:
650                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind.START);
651                break;
652            case STOP:
653                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind.STOP);
654                break;
655            default:
656                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionConditionKind.NULL);
657                break;
658        }
659        return tgt;
660    }
661
662    public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent convertPlanDefinitionActionRelatedActionComponent(org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent src) throws FHIRException {
663        if (src == null)
664            return null;
665        org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent();
666        copyElement(src, tgt);
667        if (src.hasActionId())
668            tgt.setActionIdElement(convertId(src.getActionIdElement()));
669        if (src.hasRelationship())
670            tgt.setRelationshipElement(convertActionRelationshipType(src.getRelationshipElement()));
671        if (src.hasOffset())
672            tgt.setOffset(convertType(src.getOffset()));
673        return tgt;
674    }
675
676    public static org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent convertPlanDefinitionActionRelatedActionComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent src) throws FHIRException {
677        if (src == null)
678            return null;
679        org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent tgt = new org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent();
680        copyElement(src, tgt);
681        if (src.hasActionId())
682            tgt.setActionIdElement(convertId(src.getActionIdElement()));
683        if (src.hasRelationship())
684            tgt.setRelationshipElement(convertActionRelationshipType(src.getRelationshipElement()));
685        if (src.hasOffset())
686            tgt.setOffset(convertType(src.getOffset()));
687        return tgt;
688    }
689
690    static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType> convertActionRelationshipType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType> src) throws FHIRException {
691        if (src == null || src.isEmpty())
692            return null;
693        org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionRelationshipTypeEnumFactory());
694        VersionConvertor_40_50.copyElement(src, tgt);
695        switch(src.getValue()) {
696            case BEFORESTART:
697                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.BEFORESTART);
698                break;
699            case BEFORE:
700                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.BEFORE);
701                break;
702            case BEFOREEND:
703                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.BEFOREEND);
704                break;
705            case CONCURRENTWITHSTART:
706                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.CONCURRENTWITHSTART);
707                break;
708            case CONCURRENT:
709                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.CONCURRENT);
710                break;
711            case CONCURRENTWITHEND:
712                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.CONCURRENTWITHEND);
713                break;
714            case AFTERSTART:
715                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.AFTERSTART);
716                break;
717            case AFTER:
718                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.AFTER);
719                break;
720            case AFTEREND:
721                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.AFTEREND);
722                break;
723            default:
724                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType.NULL);
725                break;
726        }
727        return tgt;
728    }
729
730    static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType> convertActionRelationshipType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionRelationshipType> src) throws FHIRException {
731        if (src == null || src.isEmpty())
732            return null;
733        org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipTypeEnumFactory());
734        VersionConvertor_40_50.copyElement(src, tgt);
735        switch(src.getValue()) {
736            case BEFORESTART:
737                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.BEFORESTART);
738                break;
739            case BEFORE:
740                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.BEFORE);
741                break;
742            case BEFOREEND:
743                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.BEFOREEND);
744                break;
745            case CONCURRENTWITHSTART:
746                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.CONCURRENTWITHSTART);
747                break;
748            case CONCURRENT:
749                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.CONCURRENT);
750                break;
751            case CONCURRENTWITHEND:
752                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.CONCURRENTWITHEND);
753                break;
754            case AFTERSTART:
755                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.AFTERSTART);
756                break;
757            case AFTER:
758                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.AFTER);
759                break;
760            case AFTEREND:
761                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.AFTEREND);
762                break;
763            default:
764                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionRelationshipType.NULL);
765                break;
766        }
767        return tgt;
768    }
769
770    public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionParticipantComponent convertPlanDefinitionActionParticipantComponent(org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionParticipantComponent src) throws FHIRException {
771        if (src == null)
772            return null;
773        org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionParticipantComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionParticipantComponent();
774        copyElement(src, tgt);
775        if (src.hasType())
776            tgt.setTypeElement(convertActionParticipantType(src.getTypeElement()));
777        if (src.hasRole())
778            tgt.setRole(convertCodeableConcept(src.getRole()));
779        return tgt;
780    }
781
782    public static org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionParticipantComponent convertPlanDefinitionActionParticipantComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionParticipantComponent src) throws FHIRException {
783        if (src == null)
784            return null;
785        org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionParticipantComponent tgt = new org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionParticipantComponent();
786        copyElement(src, tgt);
787        if (src.hasType())
788            tgt.setTypeElement(convertActionParticipantType(src.getTypeElement()));
789        if (src.hasRole())
790            tgt.setRole(convertCodeableConcept(src.getRole()));
791        return tgt;
792    }
793
794    static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionParticipantType> convertActionParticipantType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType> src) throws FHIRException {
795        if (src == null || src.isEmpty())
796            return null;
797        org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionParticipantType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionParticipantTypeEnumFactory());
798        VersionConvertor_40_50.copyElement(src, tgt);
799        switch(src.getValue()) {
800            case PATIENT:
801                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.PATIENT);
802                break;
803            case PRACTITIONER:
804                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.PRACTITIONER);
805                break;
806            case RELATEDPERSON:
807                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.RELATEDPERSON);
808                break;
809            case DEVICE:
810                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.DEVICE);
811                break;
812            default:
813                tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.NULL);
814                break;
815        }
816        return tgt;
817    }
818
819    static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType> convertActionParticipantType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionParticipantType> src) throws FHIRException {
820        if (src == null || src.isEmpty())
821            return null;
822        org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantTypeEnumFactory());
823        VersionConvertor_40_50.copyElement(src, tgt);
824        switch(src.getValue()) {
825            case PATIENT:
826                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType.PATIENT);
827                break;
828            case PRACTITIONER:
829                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType.PRACTITIONER);
830                break;
831            case RELATEDPERSON:
832                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType.RELATEDPERSON);
833                break;
834            case DEVICE:
835                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType.DEVICE);
836                break;
837            default:
838                tgt.setValue(org.hl7.fhir.r4.model.PlanDefinition.ActionParticipantType.NULL);
839                break;
840        }
841        return tgt;
842    }
843
844    public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent convertPlanDefinitionActionDynamicValueComponent(org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent src) throws FHIRException {
845        if (src == null)
846            return null;
847        org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent();
848        copyElement(src, tgt);
849        if (src.hasPath())
850            tgt.setPathElement(convertString(src.getPathElement()));
851        if (src.hasExpression())
852            tgt.setExpression(convertExpression(src.getExpression()));
853        return tgt;
854    }
855
856    public static org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent convertPlanDefinitionActionDynamicValueComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent src) throws FHIRException {
857        if (src == null)
858            return null;
859        org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent tgt = new org.hl7.fhir.r4.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent();
860        copyElement(src, tgt);
861        if (src.hasPath())
862            tgt.setPathElement(convertString(src.getPathElement()));
863        if (src.hasExpression())
864            tgt.setExpression(convertExpression(src.getExpression()));
865        return tgt;
866    }
867}