001package org.hl7.fhir.convertors.conv40_50.resources40_50;
002
003import org.hl7.fhir.convertors.context.ConversionContext40_50;
004import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.CodeableConcept40_50;
005import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.Identifier40_50;
006import org.hl7.fhir.convertors.conv40_50.datatypes40_50.metadata40_50.ContactDetail40_50;
007import org.hl7.fhir.convertors.conv40_50.datatypes40_50.metadata40_50.UsageContext40_50;
008import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Boolean40_50;
009import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Canonical40_50;
010import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.DateTime40_50;
011import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Id40_50;
012import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.MarkDown40_50;
013import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50;
014import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50;
015import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Url40_50;
016import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50;
017import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Url43_50;
018import org.hl7.fhir.exceptions.FHIRException;
019import org.hl7.fhir.r4.model.Extension;
020import org.hl7.fhir.r5.model.CanonicalType;
021import org.hl7.fhir.r5.model.CodeableConcept;
022import org.hl7.fhir.r5.model.ContactDetail;
023import org.hl7.fhir.r5.model.Enumeration;
024import org.hl7.fhir.r5.model.Enumerations.PublicationStatus;
025import org.hl7.fhir.r5.model.Reference;
026import org.hl7.fhir.r5.model.Requirements.ConformanceExpectation;
027import org.hl7.fhir.r5.model.Requirements.RequirementsStatementComponent;
028import org.hl7.fhir.r5.model.UrlType;
029import org.hl7.fhir.r5.model.UsageContext;
030
031/*
032  Copyright (c) 2011+, HL7, Inc.
033  All rights reserved.
034  
035  Redistribution and use in source and binary forms, with or without modification, 
036  are permitted provided that the following conditions are met:
037  
038   * Redistributions of source code must retain the above copyright notice, this 
039     list of conditions and the following disclaimer.
040   * Redistributions in binary form must reproduce the above copyright notice, 
041     this list of conditions and the following disclaimer in the documentation 
042     and/or other materials provided with the distribution.
043   * Neither the name of HL7 nor the names of its contributors may be used to 
044     endorse or promote products derived from this software without specific 
045     prior written permission.
046  
047  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
048  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
049  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
050  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
051  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
052  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
053  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
054  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
055  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
056  POSSIBILITY OF SUCH DAMAGE.
057  
058*/
059// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
060public class Requirements40_50 {
061
062  public static final String URL_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.url";
063  public static final String VERSION_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.version";
064  public static final String NAME_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.name";
065  public static final String TITLE_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.title";
066  public static final String STATUS_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.status";
067  public static final String EXPERIMENTAL_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.experimental";
068  public static final String DATE_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.date";
069  public static final String PUBLISHER_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.publisher";
070  public static final String CONTACT_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.contact";
071  public static final String DESCRIPTION_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.description";
072  public static final String USE_CONTEXT_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.useContext";
073  public static final String JURISDICTION_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.jurisdiction";
074  public static final String PURPOSE_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.purpose";
075  public static final String COPYRIGHT_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.copyright";
076  public static final String COPYRIGHT_LABEL_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.copyrightLabel";
077  public static final String DERIVED_FROM_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.derivedFrom";
078  public static final String ACTOR_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.actor";
079  public static final String REFERENCE_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.reference";
080  public static final String STATEMENT_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement";
081
082  private static final String[] IGNORED_EXTENSION_URLS = new String[]{
083    URL_EXTENSION_URL,
084    VERSION_EXTENSION_URL,
085    NAME_EXTENSION_URL,
086    TITLE_EXTENSION_URL,
087    STATUS_EXTENSION_URL,
088    EXPERIMENTAL_EXTENSION_URL,
089    DATE_EXTENSION_URL,
090    PUBLISHER_EXTENSION_URL,
091    CONTACT_EXTENSION_URL,
092    DESCRIPTION_EXTENSION_URL,
093    USE_CONTEXT_EXTENSION_URL,
094    JURISDICTION_EXTENSION_URL,
095    PURPOSE_EXTENSION_URL,
096    COPYRIGHT_EXTENSION_URL,
097    COPYRIGHT_LABEL_EXTENSION_URL,
098    DERIVED_FROM_EXTENSION_URL,
099    ACTOR_EXTENSION_URL,
100    REFERENCE_EXTENSION_URL,
101    STATEMENT_EXTENSION_URL
102  };
103
104  public static org.hl7.fhir.r5.model.Requirements convertRequirements(org.hl7.fhir.r4.model.Basic src) throws FHIRException {
105    if (src == null)
106      return null;
107    if (!src.getCode().hasCoding("http://hl7.org/fhir/fhir-types", "Requirements")) {
108      throw new FHIRException("Error in logic: this basic resource is not an Requirements");
109    }
110    org.hl7.fhir.r5.model.Requirements tgt = new org.hl7.fhir.r5.model.Requirements();
111
112    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt, IGNORED_EXTENSION_URLS);
113    
114    for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
115      tgt.addIdentifier(Identifier40_50.convertIdentifier(t));
116
117    if (src.hasExtension(URL_EXTENSION_URL)) {
118      tgt.setUrlElement(Uri40_50.convertUri((org.hl7.fhir.r4.model.UriType) src.getExtensionByUrl(URL_EXTENSION_URL).getValue()));
119    }
120    if (src.hasExtension(VERSION_EXTENSION_URL)) {
121      tgt.setVersionElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl(VERSION_EXTENSION_URL).getValue()));
122    }
123    if (src.hasExtension(NAME_EXTENSION_URL)) {
124      tgt.setNameElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl(NAME_EXTENSION_URL).getValue()));
125    }
126    if (src.hasExtension(TITLE_EXTENSION_URL)) {
127      tgt.setTitleElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl(TITLE_EXTENSION_URL).getValue()));
128    }
129    if (src.hasExtension(STATUS_EXTENSION_URL)) {
130      tgt.setStatus(PublicationStatus.fromCode(src.getExtensionByUrl(STATUS_EXTENSION_URL).getValue().primitiveValue()));
131    }
132    if (src.hasExtension(EXPERIMENTAL_EXTENSION_URL)) {
133      tgt.setExperimentalElement(Boolean40_50.convertBoolean((org.hl7.fhir.r4.model.BooleanType) src.getExtensionByUrl(EXPERIMENTAL_EXTENSION_URL).getValue()));
134    }
135    if (src.hasExtension(DATE_EXTENSION_URL)) {
136      tgt.setDateElement(DateTime40_50.convertDateTime((org.hl7.fhir.r4.model.DateTimeType) src.getExtensionByUrl(DATE_EXTENSION_URL).getValue()));
137    }
138    if (src.hasExtension(PUBLISHER_EXTENSION_URL)) {
139      tgt.setPublisherElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl(PUBLISHER_EXTENSION_URL).getValue()));
140    }
141    for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl(CONTACT_EXTENSION_URL)) {
142      tgt.addContact(ContactDetail40_50.convertContactDetail((org.hl7.fhir.r4.model.ContactDetail) ext.getValue()));
143    }
144    if (src.hasExtension(DESCRIPTION_EXTENSION_URL)) {
145      tgt.setPublisherElement(MarkDown40_50.convertMarkdown((org.hl7.fhir.r4.model.MarkdownType) src.getExtensionByUrl(DESCRIPTION_EXTENSION_URL).getValue()));
146    }
147    for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl(USE_CONTEXT_EXTENSION_URL)) {
148      tgt.addUseContext(UsageContext40_50.convertUsageContext((org.hl7.fhir.r4.model.UsageContext) ext.getValue()));
149    }
150    for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl(JURISDICTION_EXTENSION_URL)) {
151      tgt.addJurisdiction(CodeableConcept40_50.convertCodeableConcept((org.hl7.fhir.r4.model.CodeableConcept) ext.getValue()));
152    }
153    if (src.hasExtension(PURPOSE_EXTENSION_URL)) {
154      tgt.setPurposeElement(MarkDown40_50.convertMarkdown((org.hl7.fhir.r4.model.MarkdownType) src.getExtensionByUrl(PURPOSE_EXTENSION_URL).getValue()));
155    }
156    if (src.hasExtension(COPYRIGHT_EXTENSION_URL)) {
157      tgt.setCopyrightElement(MarkDown40_50.convertMarkdown((org.hl7.fhir.r4.model.MarkdownType) src.getExtensionByUrl(COPYRIGHT_EXTENSION_URL).getValue()));
158    }
159    if (src.hasExtension(COPYRIGHT_LABEL_EXTENSION_URL)) {
160      tgt.setCopyrightLabelElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl(COPYRIGHT_LABEL_EXTENSION_URL).getValue()));
161    }
162    for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl(DERIVED_FROM_EXTENSION_URL)) {
163      tgt.getDerivedFrom().add(Canonical40_50.convertCanonical((org.hl7.fhir.r4.model.CanonicalType) ext.getValue()));
164    }
165    for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl(ACTOR_EXTENSION_URL)) {
166      tgt.getActor().add(Canonical40_50.convertCanonical((org.hl7.fhir.r4.model.CanonicalType) ext.getValue()));
167    }
168    for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl(REFERENCE_EXTENSION_URL)) {
169      tgt.getReference().add(Url40_50.convertUrl((org.hl7.fhir.r4.model.UrlType) ext.getValue()));
170    }
171    for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl(STATEMENT_EXTENSION_URL)) {
172      convertRequirementsStatement(ext, tgt.addStatement());
173    }
174    return tgt;
175  }
176
177
178  public static org.hl7.fhir.r4.model.Basic convertRequirements(org.hl7.fhir.r5.model.Requirements src) throws FHIRException {
179    if (src == null)
180      return null;
181    org.hl7.fhir.r4.model.Basic tgt = new org.hl7.fhir.r4.model.Basic();
182    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt);
183    tgt.getCode().getCodingFirstRep().setSystem("http://hl7.org/fhir/fhir-types").setCode("Requirements"); // note use of R5 type system
184    
185    for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
186      tgt.addIdentifier(Identifier40_50.convertIdentifier(t));
187    if (src.hasUrl()) {
188      tgt.addExtension(URL_EXTENSION_URL, Uri40_50.convertUri(src.getUrlElement()));
189    }
190    if (src.hasVersion()) {
191      tgt.addExtension(VERSION_EXTENSION_URL, String40_50.convertString(src.getVersionElement()));
192    }
193    if (src.hasName()) {
194      tgt.addExtension(NAME_EXTENSION_URL, String40_50.convertString(src.getNameElement()));
195    }
196    if (src.hasTitle()) {
197      tgt.addExtension(TITLE_EXTENSION_URL, String40_50.convertString(src.getTitleElement()));
198    }
199    if (src.hasStatus()) {
200      tgt.addExtension(STATUS_EXTENSION_URL, new org.hl7.fhir.r4.model.CodeType(src.getStatus().toCode()));
201    }
202    if (src.hasExperimental()) {
203      tgt.addExtension(EXPERIMENTAL_EXTENSION_URL, Boolean40_50.convertBoolean(src.getExperimentalElement()));
204    }
205    if (src.hasDate()) {
206      tgt.addExtension(DATE_EXTENSION_URL, DateTime40_50.convertDateTime(src.getDateElement()));
207    }
208    if (src.hasPublisher()) {
209      tgt.addExtension(PUBLISHER_EXTENSION_URL, String40_50.convertString(src.getPublisherElement()));
210    }
211    for (ContactDetail cd : src.getContact()) {
212      tgt.addExtension(CONTACT_EXTENSION_URL, ContactDetail40_50.convertContactDetail(cd));
213    }
214    if (src.hasDescription()) {
215      tgt.addExtension(DESCRIPTION_EXTENSION_URL, MarkDown40_50.convertMarkdown(src.getDescriptionElement()));
216    }
217    for (UsageContext cd : src.getUseContext()) {
218      tgt.addExtension(USE_CONTEXT_EXTENSION_URL, UsageContext40_50.convertUsageContext(cd));
219    }
220    for (CodeableConcept cd : src.getJurisdiction()) {
221      tgt.addExtension(JURISDICTION_EXTENSION_URL, CodeableConcept40_50.convertCodeableConcept(cd));
222    }
223    if (src.hasPurpose()) {
224      tgt.addExtension(PURPOSE_EXTENSION_URL, MarkDown40_50.convertMarkdown(src.getPurposeElement()));
225    }
226    if (src.hasCopyright()) {
227      tgt.addExtension(COPYRIGHT_EXTENSION_URL, MarkDown40_50.convertMarkdown(src.getCopyrightElement()));
228    }
229    if (src.hasCopyrightLabel()) {
230      tgt.addExtension(COPYRIGHT_LABEL_EXTENSION_URL, String40_50.convertString(src.getCopyrightLabelElement()));
231    }
232    for (CanonicalType ref : src.getDerivedFrom()) {
233      tgt.addExtension(DERIVED_FROM_EXTENSION_URL, Canonical40_50.convertCanonical(ref));
234    }
235    for (CanonicalType ref : src.getActor()) {
236      tgt.addExtension(ACTOR_EXTENSION_URL, Canonical40_50.convertCanonical(ref));
237    }
238    for (UrlType ref : src.getReference()) {
239      tgt.addExtension(REFERENCE_EXTENSION_URL, Url40_50.convertUrl(ref));
240    }
241    for (RequirementsStatementComponent ref : src.getStatement()) {
242      org.hl7.fhir.r4.model.Extension tgte = new org.hl7.fhir.r4.model.Extension(STATEMENT_EXTENSION_URL);
243      tgt.addExtension(tgte);
244      convertRequirementsStatement(ref, tgte);
245    }
246
247    return tgt;
248  }
249
250  private static void convertRequirementsStatement(RequirementsStatementComponent src, Extension tgt) {
251    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
252    if (src.hasKey()) {
253      tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.key", Id40_50.convertId(src.getKeyElement()));
254    }
255    if (src.hasLabel()) {
256      tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.label", String40_50.convertString(src.getLabelElement()));
257    }
258    for (Enumeration<ConformanceExpectation> t : src.getConformance()) {
259      tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.conformance", new org.hl7.fhir.r4.model.CodeType(t.getCode()));
260    }
261    if (src.hasRequirement()) {
262      tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.requirement", MarkDown40_50.convertMarkdown(src.getRequirementElement()));
263    }
264    if (src.hasDerivedFrom()) {
265      tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.derivedFrom", String40_50.convertString(src.getDerivedFromElement()));
266    }
267    for (UrlType ref : src.getSatisfiedBy()) {
268      tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.satisfiedBy", Url40_50.convertUrl(ref));
269    }
270    for (UrlType ref : src.getReference()) {
271      tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.reference", Url40_50.convertUrl(ref));
272    }
273    for (Reference ref : src.getSource()) {
274      tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.source", Reference40_50.convertReference(ref));
275    }
276  }
277
278
279  private static void convertRequirementsStatement(Extension src, RequirementsStatementComponent tgt) {
280    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt, 
281        "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.key",
282        "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.label",
283        "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.conformance",
284        "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.requirement",
285        "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.derivedFrom",
286        "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.satisfiedBy",
287        "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.reference",
288        "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.source"
289        );
290    if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.key")) {
291      tgt.setKeyElement(Id40_50.convertId((org.hl7.fhir.r4.model.IdType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.key").getValue()));
292    }
293    if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.label")) {
294      tgt.setLabelElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.label").getValue()));
295    }
296    for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.conformance")) {
297      tgt.addConformance(ConformanceExpectation.fromCode(ext.getValue().primitiveValue()));
298    }
299    if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.requirement")) {
300      tgt.setRequirementElement(MarkDown40_50.convertMarkdown((org.hl7.fhir.r4.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.requirement").getValue()));
301    }
302    if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.derivedFrom")) {
303      tgt.setDerivedFromElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.derivedFrom").getValue()));
304    }
305    for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.satisfiedBy")) {
306      tgt.getSatisfiedBy().add(Url40_50.convertUrl((org.hl7.fhir.r4.model.UrlType) ext.getValue()));
307    }
308    for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.reference")) {
309      tgt.getReference().add(Url40_50.convertUrl((org.hl7.fhir.r4.model.UrlType) ext.getValue()));
310    }
311    for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement.source")) {
312      tgt.getSource().add(Reference40_50.convertReference((org.hl7.fhir.r4.model.Reference) ext.getValue()));
313    }
314  }
315}