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