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