001package org.hl7.fhir.convertors.conv43_50.resources43_50;
002
003import org.hl7.fhir.convertors.context.ConversionContext43_50;
004import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50;
005import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
006import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
007import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50;
008import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Canonical43_50;
009import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50;
010import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
011import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50;
012import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
013import org.hl7.fhir.exceptions.FHIRException;
014import org.hl7.fhir.r5.model.CarePlan;
015import org.hl7.fhir.r5.model.CodeableReference;
016import org.hl7.fhir.r5.model.Enumeration;
017import org.hl7.fhir.r5.model.Enumerations;
018
019/*
020  Copyright (c) 2011+, HL7, Inc.
021  All rights reserved.
022  
023  Redistribution and use in source and binary forms, with or without modification, 
024  are permitted provided that the following conditions are met:
025  
026   * Redistributions of source code must retain the above copyright notice, this 
027     list of conditions and the following disclaimer.
028   * Redistributions in binary form must reproduce the above copyright notice, 
029     this list of conditions and the following disclaimer in the documentation 
030     and/or other materials provided with the distribution.
031   * Neither the name of HL7 nor the names of its contributors may be used to 
032     endorse or promote products derived from this software without specific 
033     prior written permission.
034  
035  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
036  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
037  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
038  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
039  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
040  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
041  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
042  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
043  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
044  POSSIBILITY OF SUCH DAMAGE.
045  
046*/
047// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
048public class CarePlan43_50 {
049
050  public static org.hl7.fhir.r5.model.CarePlan convertCarePlan(org.hl7.fhir.r4b.model.CarePlan src) throws FHIRException {
051    if (src == null)
052      return null;
053    org.hl7.fhir.r5.model.CarePlan tgt = new org.hl7.fhir.r5.model.CarePlan();
054    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
055    for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
056      tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
057    for (org.hl7.fhir.r4b.model.CanonicalType t : src.getInstantiatesCanonical())
058      tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t));
059    for (org.hl7.fhir.r4b.model.UriType t : src.getInstantiatesUri())
060      tgt.getInstantiatesUri().add(Uri43_50.convertUri(t));
061    for (org.hl7.fhir.r4b.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t));
062    for (org.hl7.fhir.r4b.model.Reference t : src.getReplaces()) tgt.addReplaces(Reference43_50.convertReference(t));
063    for (org.hl7.fhir.r4b.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t));
064    if (src.hasStatus())
065      tgt.setStatusElement(convertCarePlanStatus(src.getStatusElement()));
066    if (src.hasIntent())
067      tgt.setIntentElement(convertCarePlanIntent(src.getIntentElement()));
068    for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCategory())
069      tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t));
070    if (src.hasTitle())
071      tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
072    if (src.hasDescription())
073      tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
074    if (src.hasSubject())
075      tgt.setSubject(Reference43_50.convertReference(src.getSubject()));
076    if (src.hasEncounter())
077      tgt.setEncounter(Reference43_50.convertReference(src.getEncounter()));
078    if (src.hasPeriod())
079      tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod()));
080    if (src.hasCreated())
081      tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement()));
082    if (src.hasAuthor())
083      tgt.setCustodian(Reference43_50.convertReference(src.getAuthor()));
084    for (org.hl7.fhir.r4b.model.Reference t : src.getContributor())
085      tgt.addContributor(Reference43_50.convertReference(t));
086    for (org.hl7.fhir.r4b.model.Reference t : src.getCareTeam()) tgt.addCareTeam(Reference43_50.convertReference(t));
087    for (org.hl7.fhir.r4b.model.Reference t : src.getAddresses())
088      tgt.addAddresses(Reference43_50.convertReferenceToCodeableReference(t));
089    for (org.hl7.fhir.r4b.model.Reference t : src.getSupportingInfo())
090      tgt.addSupportingInfo(Reference43_50.convertReference(t));
091    for (org.hl7.fhir.r4b.model.Reference t : src.getGoal()) tgt.addGoal(Reference43_50.convertReference(t));
092    for (org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityComponent t : src.getActivity())
093      tgt.addActivity(convertCarePlanActivityComponent(t));
094    for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
095    return tgt;
096  }
097
098  public static org.hl7.fhir.r4b.model.CarePlan convertCarePlan(org.hl7.fhir.r5.model.CarePlan src) throws FHIRException {
099    if (src == null)
100      return null;
101    org.hl7.fhir.r4b.model.CarePlan tgt = new org.hl7.fhir.r4b.model.CarePlan();
102    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
103    for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
104      tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
105    for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical())
106      tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t));
107    for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri())
108      tgt.getInstantiatesUri().add(Uri43_50.convertUri(t));
109    for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t));
110    for (org.hl7.fhir.r5.model.Reference t : src.getReplaces()) tgt.addReplaces(Reference43_50.convertReference(t));
111    for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t));
112    if (src.hasStatus())
113      tgt.setStatusElement(convertCarePlanStatus(src.getStatusElement()));
114    if (src.hasIntent())
115      tgt.setIntentElement(convertCarePlanIntent(src.getIntentElement()));
116    for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory())
117      tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t));
118    if (src.hasTitle())
119      tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
120    if (src.hasDescription())
121      tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
122    if (src.hasSubject())
123      tgt.setSubject(Reference43_50.convertReference(src.getSubject()));
124    if (src.hasEncounter())
125      tgt.setEncounter(Reference43_50.convertReference(src.getEncounter()));
126    if (src.hasPeriod())
127      tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod()));
128    if (src.hasCreated())
129      tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement()));
130    if (src.hasCustodian())
131      tgt.setAuthor(Reference43_50.convertReference(src.getCustodian()));
132    for (org.hl7.fhir.r5.model.Reference t : src.getContributor())
133      tgt.addContributor(Reference43_50.convertReference(t));
134    for (org.hl7.fhir.r5.model.Reference t : src.getCareTeam()) tgt.addCareTeam(Reference43_50.convertReference(t));
135    for (CodeableReference t : src.getAddresses())
136      if (t.hasReference())
137        tgt.addAddresses(Reference43_50.convertReference(t.getReference()));
138    for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInfo())
139      tgt.addSupportingInfo(Reference43_50.convertReference(t));
140    for (org.hl7.fhir.r5.model.Reference t : src.getGoal()) tgt.addGoal(Reference43_50.convertReference(t));
141    for (org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent t : src.getActivity())
142      tgt.addActivity(convertCarePlanActivityComponent(t));
143    for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
144    return tgt;
145  }
146
147  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestStatus> convertCarePlanStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestStatus> src) throws FHIRException {
148      if (src == null || src.isEmpty())
149          return null;
150      Enumeration<Enumerations.RequestStatus> tgt = new Enumeration<>(new Enumerations.RequestStatusEnumFactory());
151      ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
152      if (src.getValue() == null) {
153          tgt.setValue(null);
154      } else {
155          switch (src.getValue()) {
156              case DRAFT:
157                  tgt.setValue(Enumerations.RequestStatus.DRAFT);
158                  break;
159              case ACTIVE:
160                  tgt.setValue(Enumerations.RequestStatus.ACTIVE);
161                  break;
162              case ONHOLD:
163                  tgt.setValue(Enumerations.RequestStatus.ONHOLD);
164                  break;
165              case REVOKED:
166                  tgt.setValue(Enumerations.RequestStatus.REVOKED);
167                  break;
168              case COMPLETED:
169                  tgt.setValue(Enumerations.RequestStatus.COMPLETED);
170                  break;
171              case ENTEREDINERROR:
172                  tgt.setValue(Enumerations.RequestStatus.ENTEREDINERROR);
173                  break;
174              case UNKNOWN:
175                  tgt.setValue(Enumerations.RequestStatus.UNKNOWN);
176                  break;
177              default:
178                  tgt.setValue(Enumerations.RequestStatus.NULL);
179                  break;
180          }
181      }
182      return tgt;
183  }
184
185  static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestStatus> convertCarePlanStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestStatus> src) throws FHIRException {
186      if (src == null || src.isEmpty())
187          return null;
188      org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestStatus> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestStatusEnumFactory());
189      ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
190      if (src.getValue() == null) {
191          tgt.setValue(null);
192      } else {
193          switch (src.getValue()) {
194              case DRAFT:
195                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.DRAFT);
196                  break;
197              case ACTIVE:
198                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ACTIVE);
199                  break;
200              case ONHOLD:
201                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ONHOLD);
202                  break;
203              case REVOKED:
204                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.REVOKED);
205                  break;
206              case COMPLETED:
207                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.COMPLETED);
208                  break;
209              case ENTEREDINERROR:
210                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ENTEREDINERROR);
211                  break;
212              case UNKNOWN:
213                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.UNKNOWN);
214                  break;
215              default:
216                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.NULL);
217                  break;
218          }
219      }
220      return tgt;
221  }
222
223  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CarePlan.CarePlanIntent> convertCarePlanIntent(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CarePlan.CarePlanIntent> src) throws FHIRException {
224      if (src == null || src.isEmpty())
225          return null;
226      Enumeration<CarePlan.CarePlanIntent> tgt = new Enumeration<>(new CarePlan.CarePlanIntentEnumFactory());
227      ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
228      if (src.getValue() == null) {
229          tgt.setValue(null);
230      } else {
231          switch (src.getValue()) {
232              case PROPOSAL:
233                  tgt.setValue(CarePlan.CarePlanIntent.PROPOSAL);
234                  break;
235              case PLAN:
236                  tgt.setValue(CarePlan.CarePlanIntent.PLAN);
237                  break;
238              case ORDER:
239                  tgt.setValue(CarePlan.CarePlanIntent.ORDER);
240                  break;
241              case OPTION:
242                  tgt.setValue(CarePlan.CarePlanIntent.OPTION);
243                  break;
244              default:
245                  tgt.setValue(CarePlan.CarePlanIntent.NULL);
246                  break;
247          }
248      }
249      return tgt;
250  }
251
252  static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CarePlan.CarePlanIntent> convertCarePlanIntent(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CarePlan.CarePlanIntent> src) throws FHIRException {
253      if (src == null || src.isEmpty())
254          return null;
255      org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CarePlan.CarePlanIntent> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CarePlan.CarePlanIntentEnumFactory());
256      ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
257      if (src.getValue() == null) {
258          tgt.setValue(null);
259      } else {
260          switch (src.getValue()) {
261              case PROPOSAL:
262                  tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanIntent.PROPOSAL);
263                  break;
264              case PLAN:
265                  tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanIntent.PLAN);
266                  break;
267              case ORDER:
268                  tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanIntent.ORDER);
269                  break;
270              case OPTION:
271                  tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanIntent.OPTION);
272                  break;
273              default:
274                  tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanIntent.NULL);
275                  break;
276          }
277      }
278      return tgt;
279  }
280
281  public static org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent convertCarePlanActivityComponent(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityComponent src) throws FHIRException {
282    if (src == null)
283      return null;
284    org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent tgt = new org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent();
285    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
286    for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getOutcomeCodeableConcept())
287      tgt.addPerformedActivity(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t));
288    for (org.hl7.fhir.r4b.model.Reference t : src.getOutcomeReference())
289      tgt.addPerformedActivity(Reference43_50.convertReferenceToCodeableReference(t));
290    for (org.hl7.fhir.r4b.model.Annotation t : src.getProgress()) tgt.addProgress(Annotation43_50.convertAnnotation(t));
291    if (src.hasReference())
292      tgt.setPlannedActivityReference(Reference43_50.convertReference(src.getReference()));
293//    if (src.hasDetail())
294//      tgt.setPlannedActivityDetail(convertCarePlanActivityDetailComponent(src.getDetail()));
295    return tgt;
296  }
297
298  public static org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityComponent convertCarePlanActivityComponent(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent src) throws FHIRException {
299    if (src == null)
300      return null;
301    org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityComponent tgt = new org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityComponent();
302    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
303    for (CodeableReference t : src.getPerformedActivity())
304      if (t.hasConcept())
305        tgt.addOutcomeCodeableConcept(CodeableConcept43_50.convertCodeableConcept(t.getConcept()));
306    for (CodeableReference t : src.getPerformedActivity())
307      if (t.hasReference())
308        tgt.addOutcomeReference(Reference43_50.convertReference(t.getReference()));
309    for (org.hl7.fhir.r5.model.Annotation t : src.getProgress()) tgt.addProgress(Annotation43_50.convertAnnotation(t));
310    if (src.hasPlannedActivityReference())
311      tgt.setReference(Reference43_50.convertReference(src.getPlannedActivityReference()));
312//    if (src.hasPlannedActivityDetail())
313//      tgt.setDetail(convertCarePlanActivityDetailComponent(src.getPlannedActivityDetail()));
314    return tgt;
315  }
316
317//  public static org.hl7.fhir.r5.model.CarePlan.CarePlanActivityPlannedActivityDetailComponent convertCarePlanActivityDetailComponent(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityDetailComponent src) throws FHIRException {
318//    if (src == null)
319//      return null;
320//    org.hl7.fhir.r5.model.CarePlan.CarePlanActivityPlannedActivityDetailComponent tgt = new org.hl7.fhir.r5.model.CarePlan.CarePlanActivityPlannedActivityDetailComponent();
321//    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
322//    if (src.hasKind())
323//      tgt.setKindElement(convertCarePlanActivityKind(src.getKindElement()));
324//    for (org.hl7.fhir.r4b.model.CanonicalType t : src.getInstantiatesCanonical())
325//      tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t));
326//    for (org.hl7.fhir.r4b.model.UriType t : src.getInstantiatesUri())
327//      tgt.getInstantiatesUri().add(Uri43_50.convertUri(t));
328//    if (src.hasCode())
329//      tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
330//    for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode())
331//      tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t));
332//    for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference())
333//      tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t));
334//    for (org.hl7.fhir.r4b.model.Reference t : src.getGoal()) tgt.addGoal(Reference43_50.convertReference(t));
335//    if (src.hasStatus())
336//      tgt.setStatusElement(convertCarePlanActivityStatus(src.getStatusElement()));
337//    if (src.hasStatusReason())
338//      tgt.setStatusReason(CodeableConcept43_50.convertCodeableConcept(src.getStatusReason()));
339//    if (src.hasDoNotPerform())
340//      tgt.setDoNotPerformElement(Boolean43_50.convertBoolean(src.getDoNotPerformElement()));
341//    if (src.hasScheduled())
342//      tgt.setScheduled(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getScheduled()));
343//    if (src.hasLocation())
344//      tgt.getLocation().setReference(Reference43_50.convertReference(src.getLocation()));
345//    for (org.hl7.fhir.r4b.model.Reference t : src.getPerformer()) tgt.addPerformer(Reference43_50.convertReference(t));
346//    if (src.hasProduct())
347//      tgt.setProduct(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getProduct()));
348//    if (src.hasDailyAmount())
349//      tgt.setDailyAmount(SimpleQuantity43_50.convertSimpleQuantity(src.getDailyAmount()));
350//    if (src.hasQuantity())
351//      tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
352//    if (src.hasDescription())
353//      tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
354//    return tgt;
355//  }
356//
357//  public static org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityDetailComponent convertCarePlanActivityDetailComponent(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityPlannedActivityDetailComponent src) throws FHIRException {
358//    if (src == null)
359//      return null;
360//    org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityDetailComponent tgt = new org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityDetailComponent();
361//    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
362//    if (src.hasKind())
363//      tgt.setKindElement(convertCarePlanActivityKind(src.getKindElement()));
364//    for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical())
365//      tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t));
366//    for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri())
367//      tgt.getInstantiatesUri().add(Uri43_50.convertUri(t));
368//    if (src.hasCode())
369//      tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
370//    for (CodeableReference t : src.getReason())
371//      if (t.hasConcept())
372//        tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept()));
373//    for (CodeableReference t : src.getReason())
374//      if (t.hasReference())
375//        tgt.addReasonReference(Reference43_50.convertReference(t.getReference()));
376//    for (org.hl7.fhir.r5.model.Reference t : src.getGoal()) tgt.addGoal(Reference43_50.convertReference(t));
377//    if (src.hasStatus())
378//      tgt.setStatusElement(convertCarePlanActivityStatus(src.getStatusElement()));
379//    if (src.hasStatusReason())
380//      tgt.setStatusReason(CodeableConcept43_50.convertCodeableConcept(src.getStatusReason()));
381//    if (src.hasDoNotPerform())
382//      tgt.setDoNotPerformElement(Boolean43_50.convertBoolean(src.getDoNotPerformElement()));
383//    if (src.hasScheduled())
384//      tgt.setScheduled(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getScheduled()));
385//    if (src.getLocation().hasReference())
386//      tgt.setLocation(Reference43_50.convertReference(src.getLocation().getReference()));
387//    for (org.hl7.fhir.r5.model.Reference t : src.getPerformer()) tgt.addPerformer(Reference43_50.convertReference(t));
388//    if (src.hasProduct())
389//      tgt.setProduct(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getProduct()));
390//    if (src.hasDailyAmount())
391//      tgt.setDailyAmount(SimpleQuantity43_50.convertSimpleQuantity(src.getDailyAmount()));
392//    if (src.hasQuantity())
393//      tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
394//    if (src.hasDescription())
395//      tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
396//    return tgt;
397//  }
398//
399//  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind> convertCarePlanActivityKind(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind> src) throws FHIRException {
400//    if (src == null || src.isEmpty())
401//      return null;
402//    org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKindEnumFactory());
403//    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
404//    switch (src.getValue()) {
405//      case APPOINTMENT:
406//        tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.APPOINTMENT);
407//        break;
408//      case COMMUNICATIONREQUEST:
409//        tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.COMMUNICATIONREQUEST);
410//        break;
411//      case DEVICEREQUEST:
412//        tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.DEVICEREQUEST);
413//        break;
414//      case MEDICATIONREQUEST:
415//        tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.MEDICATIONREQUEST);
416//        break;
417//      case NUTRITIONORDER:
418//        tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.NUTRITIONORDER);
419//        break;
420//      case TASK:
421//        tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.TASK);
422//        break;
423//      case SERVICEREQUEST:
424//        tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.SERVICEREQUEST);
425//        break;
426//      case VISIONPRESCRIPTION:
427//        tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.VISIONPRESCRIPTION);
428//        break;
429//      default:
430//        tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.NULL);
431//        break;
432//    }
433//    return tgt;
434//  }
435//
436//  static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind> convertCarePlanActivityKind(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind> src) throws FHIRException {
437//    if (src == null || src.isEmpty())
438//      return null;
439//    org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKindEnumFactory());
440//    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
441//    switch (src.getValue()) {
442//      case APPOINTMENT:
443//        tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.APPOINTMENT);
444//        break;
445//      case COMMUNICATIONREQUEST:
446//        tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.COMMUNICATIONREQUEST);
447//        break;
448//      case DEVICEREQUEST:
449//        tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.DEVICEREQUEST);
450//        break;
451//      case MEDICATIONREQUEST:
452//        tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.MEDICATIONREQUEST);
453//        break;
454//      case NUTRITIONORDER:
455//        tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.NUTRITIONORDER);
456//        break;
457//      case TASK:
458//        tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.TASK);
459//        break;
460//      case SERVICEREQUEST:
461//        tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.SERVICEREQUEST);
462//        break;
463//      case VISIONPRESCRIPTION:
464//        tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.VISIONPRESCRIPTION);
465//        break;
466//      default:
467//        tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.NULL);
468//        break;
469//    }
470//    return tgt;
471//  }
472//
473//  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus> convertCarePlanActivityStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus> src) throws FHIRException {
474//    if (src == null || src.isEmpty())
475//      return null;
476//    org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatusEnumFactory());
477//    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
478//    switch (src.getValue()) {
479//      case NOTSTARTED:
480//        tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.NOTSTARTED);
481//        break;
482//      case SCHEDULED:
483//        tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.SCHEDULED);
484//        break;
485//      case INPROGRESS:
486//        tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.INPROGRESS);
487//        break;
488//      case ONHOLD:
489//        tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.ONHOLD);
490//        break;
491//      case COMPLETED:
492//        tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.COMPLETED);
493//        break;
494//      case CANCELLED:
495//        tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.CANCELLED);
496//        break;
497//      case STOPPED:
498//        tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.STOPPED);
499//        break;
500//      case UNKNOWN:
501//        tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.UNKNOWN);
502//        break;
503//      case ENTEREDINERROR:
504//        tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.ENTEREDINERROR);
505//        break;
506//      default:
507//        tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.NULL);
508//        break;
509//    }
510//    return tgt;
511//  }
512//
513//  static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus> convertCarePlanActivityStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus> src) throws FHIRException {
514//    if (src == null || src.isEmpty())
515//      return null;
516//    org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatusEnumFactory());
517//    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
518//    switch (src.getValue()) {
519//      case NOTSTARTED:
520//        tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.NOTSTARTED);
521//        break;
522//      case SCHEDULED:
523//        tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.SCHEDULED);
524//        break;
525//      case INPROGRESS:
526//        tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.INPROGRESS);
527//        break;
528//      case ONHOLD:
529//        tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.ONHOLD);
530//        break;
531//      case COMPLETED:
532//        tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.COMPLETED);
533//        break;
534//      case CANCELLED:
535//        tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.CANCELLED);
536//        break;
537//      case STOPPED:
538//        tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.STOPPED);
539//        break;
540//      case UNKNOWN:
541//        tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.UNKNOWN);
542//        break;
543//      case ENTEREDINERROR:
544//        tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.ENTEREDINERROR);
545//        break;
546//      default:
547//        tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.NULL);
548//        break;
549//    }
550//    return tgt;
551//  }
552}