001package org.hl7.fhir.r4.formats;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Tue, May 12, 2020 07:48+1000 for FHIR v4.0.1
033import org.hl7.fhir.r4.model.*;
034import org.hl7.fhir.r4.utils.formats.Turtle.Complex;
035import org.hl7.fhir.utilities.Utilities;
036
037public class RdfParser extends RdfParserBase {
038
039  public RdfParser() {
040    super();
041  }
042
043  public RdfParser(boolean allowUnknownContent) {
044    super();
045    setAllowUnknownContent(allowUnknownContent);
046  }
047
048  protected void composeElement(Complex t, String parentType, String name, Element element, int index) {
049    if (element == null)
050      return;
051    if (index > -1)
052      t.predicate("fhir:index", Integer.toString(index));
053    if (element.hasIdElement())
054      composeString(t, "Element", "id", element.getIdElement(), -1);
055    for (int i = 0; i < element.getExtension().size(); i++)
056      composeExtension(t, "Element", "extension", element.getExtension().get(i), i);
057  }
058
059  protected void composeBackboneElement(Complex t, String tType, String name, BackboneElement element, int index) {
060    composeElement(t, tType, name, element, index);
061    for (int i = 0; i < element.getModifierExtension().size(); i++)
062      composeExtension(t, "Element", "modifierExtension", element.getModifierExtension().get(i), i);
063  }
064
065  private void composeEnum(Complex parent, String parentType, String name, Enumeration<? extends Enum> value,
066      int index) {
067    if (value == null)
068      return;
069    Complex t = parent.predicate("fhir:" + parentType + "." + name);
070    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
071    composeElement(t, parentType, name, value, index);
072    decorateCode(t, value);
073  }
074
075  protected void composeDate(Complex parent, String parentType, String name, DateType value, int index) {
076    if (value == null)
077      return;
078    Complex t = parent.predicate("fhir:" + parentType + "." + name);
079    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
080    composeElement(t, parentType, name, value, index);
081  }
082
083  protected void composeDateTime(Complex parent, String parentType, String name, DateTimeType value, int index) {
084    if (value == null)
085      return;
086    Complex t = parent.predicate("fhir:" + parentType + "." + name);
087    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
088    composeElement(t, parentType, name, value, index);
089  }
090
091  protected void composeCode(Complex parent, String parentType, String name, CodeType value, int index) {
092    if (value == null)
093      return;
094    Complex t = parent.predicate("fhir:" + parentType + "." + name);
095    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
096    composeElement(t, parentType, name, value, index);
097    decorateCode(t, value);
098  }
099
100  protected void composeString(Complex parent, String parentType, String name, StringType value, int index) {
101    if (value == null)
102      return;
103    Complex t = parent.predicate("fhir:" + parentType + "." + name);
104    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
105    composeElement(t, parentType, name, value, index);
106  }
107
108  protected void composeInteger(Complex parent, String parentType, String name, IntegerType value, int index) {
109    if (value == null)
110      return;
111    Complex t = parent.predicate("fhir:" + parentType + "." + name);
112    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
113    composeElement(t, parentType, name, value, index);
114  }
115
116  protected void composeOid(Complex parent, String parentType, String name, OidType value, int index) {
117    if (value == null)
118      return;
119    Complex t = parent.predicate("fhir:" + parentType + "." + name);
120    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
121    composeElement(t, parentType, name, value, index);
122  }
123
124  protected void composeCanonical(Complex parent, String parentType, String name, CanonicalType value, int index) {
125    if (value == null)
126      return;
127    Complex t = parent.predicate("fhir:" + parentType + "." + name);
128    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
129    composeElement(t, parentType, name, value, index);
130  }
131
132  protected void composeUri(Complex parent, String parentType, String name, UriType value, int index) {
133    if (value == null)
134      return;
135    Complex t = parent.predicate("fhir:" + parentType + "." + name);
136    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
137    composeElement(t, parentType, name, value, index);
138  }
139
140  protected void composeUuid(Complex parent, String parentType, String name, UuidType value, int index) {
141    if (value == null)
142      return;
143    Complex t = parent.predicate("fhir:" + parentType + "." + name);
144    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
145    composeElement(t, parentType, name, value, index);
146  }
147
148  protected void composeUrl(Complex parent, String parentType, String name, UrlType value, int index) {
149    if (value == null)
150      return;
151    Complex t = parent.predicate("fhir:" + parentType + "." + name);
152    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
153    composeElement(t, parentType, name, value, index);
154  }
155
156  protected void composeInstant(Complex parent, String parentType, String name, InstantType value, int index) {
157    if (value == null)
158      return;
159    Complex t = parent.predicate("fhir:" + parentType + "." + name);
160    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
161    composeElement(t, parentType, name, value, index);
162  }
163
164  protected void composeBoolean(Complex parent, String parentType, String name, BooleanType value, int index) {
165    if (value == null)
166      return;
167    Complex t = parent.predicate("fhir:" + parentType + "." + name);
168    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
169    composeElement(t, parentType, name, value, index);
170  }
171
172  protected void composeBase64Binary(Complex parent, String parentType, String name, Base64BinaryType value,
173      int index) {
174    if (value == null)
175      return;
176    Complex t = parent.predicate("fhir:" + parentType + "." + name);
177    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
178    composeElement(t, parentType, name, value, index);
179  }
180
181  protected void composeUnsignedInt(Complex parent, String parentType, String name, UnsignedIntType value, int index) {
182    if (value == null)
183      return;
184    Complex t = parent.predicate("fhir:" + parentType + "." + name);
185    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
186    composeElement(t, parentType, name, value, index);
187  }
188
189  protected void composeMarkdown(Complex parent, String parentType, String name, MarkdownType value, int index) {
190    if (value == null)
191      return;
192    Complex t = parent.predicate("fhir:" + parentType + "." + name);
193    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
194    composeElement(t, parentType, name, value, index);
195  }
196
197  protected void composeTime(Complex parent, String parentType, String name, TimeType value, int index) {
198    if (value == null)
199      return;
200    Complex t = parent.predicate("fhir:" + parentType + "." + name);
201    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
202    composeElement(t, parentType, name, value, index);
203  }
204
205  protected void composeId(Complex parent, String parentType, String name, IdType value, int index) {
206    if (value == null)
207      return;
208    Complex t = parent.predicate("fhir:" + parentType + "." + name);
209    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
210    composeElement(t, parentType, name, value, index);
211  }
212
213  protected void composePositiveInt(Complex parent, String parentType, String name, PositiveIntType value, int index) {
214    if (value == null)
215      return;
216    Complex t = parent.predicate("fhir:" + parentType + "." + name);
217    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
218    composeElement(t, parentType, name, value, index);
219  }
220
221  protected void composeDecimal(Complex parent, String parentType, String name, DecimalType value, int index) {
222    if (value == null)
223      return;
224    Complex t = parent.predicate("fhir:" + parentType + "." + name);
225    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
226    composeElement(t, parentType, name, value, index);
227  }
228
229  protected void composeExtension(Complex parent, String parentType, String name, Extension element, int index) {
230    if (element == null)
231      return;
232    Complex t;
233    if (Utilities.noString(parentType))
234      t = parent;
235    else {
236      t = parent.predicate("fhir:" + parentType + '.' + name);
237    }
238    composeElement(t, "Extension", name, element, index);
239    if (element.hasUrlElement())
240      composeUri(t, "Extension", "url", element.getUrlElement(), -1);
241    if (element.hasValue())
242      composeType(t, "Extension", "value", element.getValue(), -1);
243  }
244
245  protected void composeNarrative(Complex parent, String parentType, String name, Narrative element, int index) {
246    if (element == null)
247      return;
248    Complex t;
249    if (Utilities.noString(parentType))
250      t = parent;
251    else {
252      t = parent.predicate("fhir:" + parentType + '.' + name);
253    }
254    composeElement(t, "Narrative", name, element, index);
255    if (element.hasStatusElement())
256      composeEnum(t, "Narrative", "status", element.getStatusElement(), -1);
257    if (element.hasDiv())
258      composeXhtml(t, "Narrative", "div", element.getDiv(), -1);
259  }
260
261  protected void composeMeta(Complex parent, String parentType, String name, Meta element, int index) {
262    if (element == null)
263      return;
264    Complex t;
265    if (Utilities.noString(parentType))
266      t = parent;
267    else {
268      t = parent.predicate("fhir:" + parentType + '.' + name);
269    }
270    composeElement(t, "Meta", name, element, index);
271    if (element.hasVersionIdElement())
272      composeId(t, "Meta", "versionId", element.getVersionIdElement(), -1);
273    if (element.hasLastUpdatedElement())
274      composeInstant(t, "Meta", "lastUpdated", element.getLastUpdatedElement(), -1);
275    if (element.hasSourceElement())
276      composeUri(t, "Meta", "source", element.getSourceElement(), -1);
277    for (int i = 0; i < element.getProfile().size(); i++)
278      composeCanonical(t, "Meta", "profile", element.getProfile().get(i), i);
279    for (int i = 0; i < element.getSecurity().size(); i++)
280      composeCoding(t, "Meta", "security", element.getSecurity().get(i), i);
281    for (int i = 0; i < element.getTag().size(); i++)
282      composeCoding(t, "Meta", "tag", element.getTag().get(i), i);
283  }
284
285  protected void composeAddress(Complex parent, String parentType, String name, Address element, int index) {
286    if (element == null)
287      return;
288    Complex t;
289    if (Utilities.noString(parentType))
290      t = parent;
291    else {
292      t = parent.predicate("fhir:" + parentType + '.' + name);
293    }
294    composeElement(t, "Address", name, element, index);
295    if (element.hasUseElement())
296      composeEnum(t, "Address", "use", element.getUseElement(), -1);
297    if (element.hasTypeElement())
298      composeEnum(t, "Address", "type", element.getTypeElement(), -1);
299    if (element.hasTextElement())
300      composeString(t, "Address", "text", element.getTextElement(), -1);
301    for (int i = 0; i < element.getLine().size(); i++)
302      composeString(t, "Address", "line", element.getLine().get(i), i);
303    if (element.hasCityElement())
304      composeString(t, "Address", "city", element.getCityElement(), -1);
305    if (element.hasDistrictElement())
306      composeString(t, "Address", "district", element.getDistrictElement(), -1);
307    if (element.hasStateElement())
308      composeString(t, "Address", "state", element.getStateElement(), -1);
309    if (element.hasPostalCodeElement())
310      composeString(t, "Address", "postalCode", element.getPostalCodeElement(), -1);
311    if (element.hasCountryElement())
312      composeString(t, "Address", "country", element.getCountryElement(), -1);
313    if (element.hasPeriod())
314      composePeriod(t, "Address", "period", element.getPeriod(), -1);
315  }
316
317  protected void composeContributor(Complex parent, String parentType, String name, Contributor element, int index) {
318    if (element == null)
319      return;
320    Complex t;
321    if (Utilities.noString(parentType))
322      t = parent;
323    else {
324      t = parent.predicate("fhir:" + parentType + '.' + name);
325    }
326    composeElement(t, "Contributor", name, element, index);
327    if (element.hasTypeElement())
328      composeEnum(t, "Contributor", "type", element.getTypeElement(), -1);
329    if (element.hasNameElement())
330      composeString(t, "Contributor", "name", element.getNameElement(), -1);
331    for (int i = 0; i < element.getContact().size(); i++)
332      composeContactDetail(t, "Contributor", "contact", element.getContact().get(i), i);
333  }
334
335  protected void composeAttachment(Complex parent, String parentType, String name, Attachment element, int index) {
336    if (element == null)
337      return;
338    Complex t;
339    if (Utilities.noString(parentType))
340      t = parent;
341    else {
342      t = parent.predicate("fhir:" + parentType + '.' + name);
343    }
344    composeElement(t, "Attachment", name, element, index);
345    if (element.hasContentTypeElement())
346      composeCode(t, "Attachment", "contentType", element.getContentTypeElement(), -1);
347    if (element.hasLanguageElement())
348      composeCode(t, "Attachment", "language", element.getLanguageElement(), -1);
349    if (element.hasDataElement())
350      composeBase64Binary(t, "Attachment", "data", element.getDataElement(), -1);
351    if (element.hasUrlElement())
352      composeUrl(t, "Attachment", "url", element.getUrlElement(), -1);
353    if (element.hasSizeElement())
354      composeUnsignedInt(t, "Attachment", "size", element.getSizeElement(), -1);
355    if (element.hasHashElement())
356      composeBase64Binary(t, "Attachment", "hash", element.getHashElement(), -1);
357    if (element.hasTitleElement())
358      composeString(t, "Attachment", "title", element.getTitleElement(), -1);
359    if (element.hasCreationElement())
360      composeDateTime(t, "Attachment", "creation", element.getCreationElement(), -1);
361  }
362
363  protected void composeCount(Complex parent, String parentType, String name, Count element, int index) {
364    if (element == null)
365      return;
366    Complex t;
367    if (Utilities.noString(parentType))
368      t = parent;
369    else {
370      t = parent.predicate("fhir:" + parentType + '.' + name);
371    }
372    composeElement(t, "Count", name, element, index);
373  }
374
375  protected void composeDataRequirement(Complex parent, String parentType, String name, DataRequirement element,
376      int index) {
377    if (element == null)
378      return;
379    Complex t;
380    if (Utilities.noString(parentType))
381      t = parent;
382    else {
383      t = parent.predicate("fhir:" + parentType + '.' + name);
384    }
385    composeElement(t, "DataRequirement", name, element, index);
386    if (element.hasTypeElement())
387      composeCode(t, "DataRequirement", "type", element.getTypeElement(), -1);
388    for (int i = 0; i < element.getProfile().size(); i++)
389      composeCanonical(t, "DataRequirement", "profile", element.getProfile().get(i), i);
390    if (element.hasSubject())
391      composeType(t, "DataRequirement", "subject", element.getSubject(), -1);
392    for (int i = 0; i < element.getMustSupport().size(); i++)
393      composeString(t, "DataRequirement", "mustSupport", element.getMustSupport().get(i), i);
394    for (int i = 0; i < element.getCodeFilter().size(); i++)
395      composeDataRequirementDataRequirementCodeFilterComponent(t, "DataRequirement", "codeFilter",
396          element.getCodeFilter().get(i), i);
397    for (int i = 0; i < element.getDateFilter().size(); i++)
398      composeDataRequirementDataRequirementDateFilterComponent(t, "DataRequirement", "dateFilter",
399          element.getDateFilter().get(i), i);
400    if (element.hasLimitElement())
401      composePositiveInt(t, "DataRequirement", "limit", element.getLimitElement(), -1);
402    for (int i = 0; i < element.getSort().size(); i++)
403      composeDataRequirementDataRequirementSortComponent(t, "DataRequirement", "sort", element.getSort().get(i), i);
404  }
405
406  protected void composeDataRequirementDataRequirementCodeFilterComponent(Complex parent, String parentType,
407      String name, DataRequirement.DataRequirementCodeFilterComponent element, int index) {
408    if (element == null)
409      return;
410    Complex t;
411    if (Utilities.noString(parentType))
412      t = parent;
413    else {
414      t = parent.predicate("fhir:" + parentType + '.' + name);
415    }
416    composeElement(t, "codeFilter", name, element, index);
417    if (element.hasPathElement())
418      composeString(t, "DataRequirement", "path", element.getPathElement(), -1);
419    if (element.hasSearchParamElement())
420      composeString(t, "DataRequirement", "searchParam", element.getSearchParamElement(), -1);
421    if (element.hasValueSetElement())
422      composeCanonical(t, "DataRequirement", "valueSet", element.getValueSetElement(), -1);
423    for (int i = 0; i < element.getCode().size(); i++)
424      composeCoding(t, "DataRequirement", "code", element.getCode().get(i), i);
425  }
426
427  protected void composeDataRequirementDataRequirementDateFilterComponent(Complex parent, String parentType,
428      String name, DataRequirement.DataRequirementDateFilterComponent element, int index) {
429    if (element == null)
430      return;
431    Complex t;
432    if (Utilities.noString(parentType))
433      t = parent;
434    else {
435      t = parent.predicate("fhir:" + parentType + '.' + name);
436    }
437    composeElement(t, "dateFilter", name, element, index);
438    if (element.hasPathElement())
439      composeString(t, "DataRequirement", "path", element.getPathElement(), -1);
440    if (element.hasSearchParamElement())
441      composeString(t, "DataRequirement", "searchParam", element.getSearchParamElement(), -1);
442    if (element.hasValue())
443      composeType(t, "DataRequirement", "value", element.getValue(), -1);
444  }
445
446  protected void composeDataRequirementDataRequirementSortComponent(Complex parent, String parentType, String name,
447      DataRequirement.DataRequirementSortComponent element, int index) {
448    if (element == null)
449      return;
450    Complex t;
451    if (Utilities.noString(parentType))
452      t = parent;
453    else {
454      t = parent.predicate("fhir:" + parentType + '.' + name);
455    }
456    composeElement(t, "sort", name, element, index);
457    if (element.hasPathElement())
458      composeString(t, "DataRequirement", "path", element.getPathElement(), -1);
459    if (element.hasDirectionElement())
460      composeEnum(t, "DataRequirement", "direction", element.getDirectionElement(), -1);
461  }
462
463  protected void composeDosage(Complex parent, String parentType, String name, Dosage element, int index) {
464    if (element == null)
465      return;
466    Complex t;
467    if (Utilities.noString(parentType))
468      t = parent;
469    else {
470      t = parent.predicate("fhir:" + parentType + '.' + name);
471    }
472    composeElement(t, "Dosage", name, element, index);
473    if (element.hasSequenceElement())
474      composeInteger(t, "Dosage", "sequence", element.getSequenceElement(), -1);
475    if (element.hasTextElement())
476      composeString(t, "Dosage", "text", element.getTextElement(), -1);
477    for (int i = 0; i < element.getAdditionalInstruction().size(); i++)
478      composeCodeableConcept(t, "Dosage", "additionalInstruction", element.getAdditionalInstruction().get(i), i);
479    if (element.hasPatientInstructionElement())
480      composeString(t, "Dosage", "patientInstruction", element.getPatientInstructionElement(), -1);
481    if (element.hasTiming())
482      composeTiming(t, "Dosage", "timing", element.getTiming(), -1);
483    if (element.hasAsNeeded())
484      composeType(t, "Dosage", "asNeeded", element.getAsNeeded(), -1);
485    if (element.hasSite())
486      composeCodeableConcept(t, "Dosage", "site", element.getSite(), -1);
487    if (element.hasRoute())
488      composeCodeableConcept(t, "Dosage", "route", element.getRoute(), -1);
489    if (element.hasMethod())
490      composeCodeableConcept(t, "Dosage", "method", element.getMethod(), -1);
491    for (int i = 0; i < element.getDoseAndRate().size(); i++)
492      composeDosageDosageDoseAndRateComponent(t, "Dosage", "doseAndRate", element.getDoseAndRate().get(i), i);
493    if (element.hasMaxDosePerPeriod())
494      composeRatio(t, "Dosage", "maxDosePerPeriod", element.getMaxDosePerPeriod(), -1);
495    if (element.hasMaxDosePerAdministration())
496      composeQuantity(t, "Dosage", "maxDosePerAdministration", element.getMaxDosePerAdministration(), -1);
497    if (element.hasMaxDosePerLifetime())
498      composeQuantity(t, "Dosage", "maxDosePerLifetime", element.getMaxDosePerLifetime(), -1);
499  }
500
501  protected void composeDosageDosageDoseAndRateComponent(Complex parent, String parentType, String name,
502      Dosage.DosageDoseAndRateComponent element, int index) {
503    if (element == null)
504      return;
505    Complex t;
506    if (Utilities.noString(parentType))
507      t = parent;
508    else {
509      t = parent.predicate("fhir:" + parentType + '.' + name);
510    }
511    composeElement(t, "doseAndRate", name, element, index);
512    if (element.hasType())
513      composeCodeableConcept(t, "Dosage", "type", element.getType(), -1);
514    if (element.hasDose())
515      composeType(t, "Dosage", "dose", element.getDose(), -1);
516    if (element.hasRate())
517      composeType(t, "Dosage", "rate", element.getRate(), -1);
518  }
519
520  protected void composeMoney(Complex parent, String parentType, String name, Money element, int index) {
521    if (element == null)
522      return;
523    Complex t;
524    if (Utilities.noString(parentType))
525      t = parent;
526    else {
527      t = parent.predicate("fhir:" + parentType + '.' + name);
528    }
529    composeElement(t, "Money", name, element, index);
530    if (element.hasValueElement())
531      composeDecimal(t, "Money", "value", element.getValueElement(), -1);
532    if (element.hasCurrencyElement())
533      composeCode(t, "Money", "currency", element.getCurrencyElement(), -1);
534  }
535
536  protected void composeHumanName(Complex parent, String parentType, String name, HumanName element, int index) {
537    if (element == null)
538      return;
539    Complex t;
540    if (Utilities.noString(parentType))
541      t = parent;
542    else {
543      t = parent.predicate("fhir:" + parentType + '.' + name);
544    }
545    composeElement(t, "HumanName", name, element, index);
546    if (element.hasUseElement())
547      composeEnum(t, "HumanName", "use", element.getUseElement(), -1);
548    if (element.hasTextElement())
549      composeString(t, "HumanName", "text", element.getTextElement(), -1);
550    if (element.hasFamilyElement())
551      composeString(t, "HumanName", "family", element.getFamilyElement(), -1);
552    for (int i = 0; i < element.getGiven().size(); i++)
553      composeString(t, "HumanName", "given", element.getGiven().get(i), i);
554    for (int i = 0; i < element.getPrefix().size(); i++)
555      composeString(t, "HumanName", "prefix", element.getPrefix().get(i), i);
556    for (int i = 0; i < element.getSuffix().size(); i++)
557      composeString(t, "HumanName", "suffix", element.getSuffix().get(i), i);
558    if (element.hasPeriod())
559      composePeriod(t, "HumanName", "period", element.getPeriod(), -1);
560  }
561
562  protected void composeContactPoint(Complex parent, String parentType, String name, ContactPoint element, int index) {
563    if (element == null)
564      return;
565    Complex t;
566    if (Utilities.noString(parentType))
567      t = parent;
568    else {
569      t = parent.predicate("fhir:" + parentType + '.' + name);
570    }
571    composeElement(t, "ContactPoint", name, element, index);
572    if (element.hasSystemElement())
573      composeEnum(t, "ContactPoint", "system", element.getSystemElement(), -1);
574    if (element.hasValueElement())
575      composeString(t, "ContactPoint", "value", element.getValueElement(), -1);
576    if (element.hasUseElement())
577      composeEnum(t, "ContactPoint", "use", element.getUseElement(), -1);
578    if (element.hasRankElement())
579      composePositiveInt(t, "ContactPoint", "rank", element.getRankElement(), -1);
580    if (element.hasPeriod())
581      composePeriod(t, "ContactPoint", "period", element.getPeriod(), -1);
582  }
583
584  protected void composeMarketingStatus(Complex parent, String parentType, String name, MarketingStatus element,
585      int index) {
586    if (element == null)
587      return;
588    Complex t;
589    if (Utilities.noString(parentType))
590      t = parent;
591    else {
592      t = parent.predicate("fhir:" + parentType + '.' + name);
593    }
594    composeElement(t, "MarketingStatus", name, element, index);
595    if (element.hasCountry())
596      composeCodeableConcept(t, "MarketingStatus", "country", element.getCountry(), -1);
597    if (element.hasJurisdiction())
598      composeCodeableConcept(t, "MarketingStatus", "jurisdiction", element.getJurisdiction(), -1);
599    if (element.hasStatus())
600      composeCodeableConcept(t, "MarketingStatus", "status", element.getStatus(), -1);
601    if (element.hasDateRange())
602      composePeriod(t, "MarketingStatus", "dateRange", element.getDateRange(), -1);
603    if (element.hasRestoreDateElement())
604      composeDateTime(t, "MarketingStatus", "restoreDate", element.getRestoreDateElement(), -1);
605  }
606
607  protected void composeIdentifier(Complex parent, String parentType, String name, Identifier element, int index) {
608    if (element == null)
609      return;
610    Complex t;
611    if (Utilities.noString(parentType))
612      t = parent;
613    else {
614      t = parent.predicate("fhir:" + parentType + '.' + name);
615    }
616    composeElement(t, "Identifier", name, element, index);
617    if (element.hasUseElement())
618      composeEnum(t, "Identifier", "use", element.getUseElement(), -1);
619    if (element.hasType())
620      composeCodeableConcept(t, "Identifier", "type", element.getType(), -1);
621    if (element.hasSystemElement())
622      composeUri(t, "Identifier", "system", element.getSystemElement(), -1);
623    if (element.hasValueElement())
624      composeString(t, "Identifier", "value", element.getValueElement(), -1);
625    if (element.hasPeriod())
626      composePeriod(t, "Identifier", "period", element.getPeriod(), -1);
627    if (element.hasAssigner())
628      composeReference(t, "Identifier", "assigner", element.getAssigner(), -1);
629  }
630
631  protected void composeSubstanceAmount(Complex parent, String parentType, String name, SubstanceAmount element,
632      int index) {
633    if (element == null)
634      return;
635    Complex t;
636    if (Utilities.noString(parentType))
637      t = parent;
638    else {
639      t = parent.predicate("fhir:" + parentType + '.' + name);
640    }
641    composeElement(t, "SubstanceAmount", name, element, index);
642    if (element.hasAmount())
643      composeType(t, "SubstanceAmount", "amount", element.getAmount(), -1);
644    if (element.hasAmountType())
645      composeCodeableConcept(t, "SubstanceAmount", "amountType", element.getAmountType(), -1);
646    if (element.hasAmountTextElement())
647      composeString(t, "SubstanceAmount", "amountText", element.getAmountTextElement(), -1);
648    if (element.hasReferenceRange())
649      composeSubstanceAmountSubstanceAmountReferenceRangeComponent(t, "SubstanceAmount", "referenceRange",
650          element.getReferenceRange(), -1);
651  }
652
653  protected void composeSubstanceAmountSubstanceAmountReferenceRangeComponent(Complex parent, String parentType,
654      String name, SubstanceAmount.SubstanceAmountReferenceRangeComponent element, int index) {
655    if (element == null)
656      return;
657    Complex t;
658    if (Utilities.noString(parentType))
659      t = parent;
660    else {
661      t = parent.predicate("fhir:" + parentType + '.' + name);
662    }
663    composeElement(t, "referenceRange", name, element, index);
664    if (element.hasLowLimit())
665      composeQuantity(t, "SubstanceAmount", "lowLimit", element.getLowLimit(), -1);
666    if (element.hasHighLimit())
667      composeQuantity(t, "SubstanceAmount", "highLimit", element.getHighLimit(), -1);
668  }
669
670  protected void composeCoding(Complex parent, String parentType, String name, Coding element, int index) {
671    if (element == null)
672      return;
673    Complex t;
674    if (Utilities.noString(parentType))
675      t = parent;
676    else {
677      t = parent.predicate("fhir:" + parentType + '.' + name);
678    }
679    composeElement(t, "Coding", name, element, index);
680    decorateCoding(t, element);
681    if (element.hasSystemElement())
682      composeUri(t, "Coding", "system", element.getSystemElement(), -1);
683    if (element.hasVersionElement())
684      composeString(t, "Coding", "version", element.getVersionElement(), -1);
685    if (element.hasCodeElement())
686      composeCode(t, "Coding", "code", element.getCodeElement(), -1);
687    if (element.hasDisplayElement())
688      composeString(t, "Coding", "display", element.getDisplayElement(), -1);
689    if (element.hasUserSelectedElement())
690      composeBoolean(t, "Coding", "userSelected", element.getUserSelectedElement(), -1);
691  }
692
693  protected void composeSampledData(Complex parent, String parentType, String name, SampledData element, int index) {
694    if (element == null)
695      return;
696    Complex t;
697    if (Utilities.noString(parentType))
698      t = parent;
699    else {
700      t = parent.predicate("fhir:" + parentType + '.' + name);
701    }
702    composeElement(t, "SampledData", name, element, index);
703    if (element.hasOrigin())
704      composeQuantity(t, "SampledData", "origin", element.getOrigin(), -1);
705    if (element.hasPeriodElement())
706      composeDecimal(t, "SampledData", "period", element.getPeriodElement(), -1);
707    if (element.hasFactorElement())
708      composeDecimal(t, "SampledData", "factor", element.getFactorElement(), -1);
709    if (element.hasLowerLimitElement())
710      composeDecimal(t, "SampledData", "lowerLimit", element.getLowerLimitElement(), -1);
711    if (element.hasUpperLimitElement())
712      composeDecimal(t, "SampledData", "upperLimit", element.getUpperLimitElement(), -1);
713    if (element.hasDimensionsElement())
714      composePositiveInt(t, "SampledData", "dimensions", element.getDimensionsElement(), -1);
715    if (element.hasDataElement())
716      composeString(t, "SampledData", "data", element.getDataElement(), -1);
717  }
718
719  protected void composePopulation(Complex parent, String parentType, String name, Population element, int index) {
720    if (element == null)
721      return;
722    Complex t;
723    if (Utilities.noString(parentType))
724      t = parent;
725    else {
726      t = parent.predicate("fhir:" + parentType + '.' + name);
727    }
728    composeElement(t, "Population", name, element, index);
729    if (element.hasAge())
730      composeType(t, "Population", "age", element.getAge(), -1);
731    if (element.hasGender())
732      composeCodeableConcept(t, "Population", "gender", element.getGender(), -1);
733    if (element.hasRace())
734      composeCodeableConcept(t, "Population", "race", element.getRace(), -1);
735    if (element.hasPhysiologicalCondition())
736      composeCodeableConcept(t, "Population", "physiologicalCondition", element.getPhysiologicalCondition(), -1);
737  }
738
739  protected void composeRatio(Complex parent, String parentType, String name, Ratio element, int index) {
740    if (element == null)
741      return;
742    Complex t;
743    if (Utilities.noString(parentType))
744      t = parent;
745    else {
746      t = parent.predicate("fhir:" + parentType + '.' + name);
747    }
748    composeElement(t, "Ratio", name, element, index);
749    if (element.hasNumerator())
750      composeQuantity(t, "Ratio", "numerator", element.getNumerator(), -1);
751    if (element.hasDenominator())
752      composeQuantity(t, "Ratio", "denominator", element.getDenominator(), -1);
753  }
754
755  protected void composeDistance(Complex parent, String parentType, String name, Distance element, int index) {
756    if (element == null)
757      return;
758    Complex t;
759    if (Utilities.noString(parentType))
760      t = parent;
761    else {
762      t = parent.predicate("fhir:" + parentType + '.' + name);
763    }
764    composeElement(t, "Distance", name, element, index);
765  }
766
767  protected void composeAge(Complex parent, String parentType, String name, Age element, int index) {
768    if (element == null)
769      return;
770    Complex t;
771    if (Utilities.noString(parentType))
772      t = parent;
773    else {
774      t = parent.predicate("fhir:" + parentType + '.' + name);
775    }
776    composeElement(t, "Age", name, element, index);
777  }
778
779  protected void composeReference(Complex parent, String parentType, String name, Reference element, int index) {
780    if (element == null)
781      return;
782    Complex t;
783    if (Utilities.noString(parentType))
784      t = parent;
785    else {
786      t = parent.predicate("fhir:" + parentType + '.' + name);
787    }
788    composeElement(t, "Reference", name, element, index);
789    if (element.hasReferenceElement())
790      composeString(t, "Reference", "reference", element.getReferenceElement_(), -1);
791    if (element.hasTypeElement())
792      composeUri(t, "Reference", "type", element.getTypeElement(), -1);
793    if (element.hasIdentifier())
794      composeIdentifier(t, "Reference", "identifier", element.getIdentifier(), -1);
795    if (element.hasDisplayElement())
796      composeString(t, "Reference", "display", element.getDisplayElement(), -1);
797  }
798
799  protected void composeTriggerDefinition(Complex parent, String parentType, String name, TriggerDefinition element,
800      int index) {
801    if (element == null)
802      return;
803    Complex t;
804    if (Utilities.noString(parentType))
805      t = parent;
806    else {
807      t = parent.predicate("fhir:" + parentType + '.' + name);
808    }
809    composeElement(t, "TriggerDefinition", name, element, index);
810    if (element.hasTypeElement())
811      composeEnum(t, "TriggerDefinition", "type", element.getTypeElement(), -1);
812    if (element.hasNameElement())
813      composeString(t, "TriggerDefinition", "name", element.getNameElement(), -1);
814    if (element.hasTiming())
815      composeType(t, "TriggerDefinition", "timing", element.getTiming(), -1);
816    for (int i = 0; i < element.getData().size(); i++)
817      composeDataRequirement(t, "TriggerDefinition", "data", element.getData().get(i), i);
818    if (element.hasCondition())
819      composeExpression(t, "TriggerDefinition", "condition", element.getCondition(), -1);
820  }
821
822  protected void composeQuantity(Complex parent, String parentType, String name, Quantity element, int index) {
823    if (element == null)
824      return;
825    Complex t;
826    if (Utilities.noString(parentType))
827      t = parent;
828    else {
829      t = parent.predicate("fhir:" + parentType + '.' + name);
830    }
831    composeElement(t, "Quantity", name, element, index);
832    if (element.hasValueElement())
833      composeDecimal(t, "Quantity", "value", element.getValueElement(), -1);
834    if (element.hasComparatorElement())
835      composeEnum(t, "Quantity", "comparator", element.getComparatorElement(), -1);
836    if (element.hasUnitElement())
837      composeString(t, "Quantity", "unit", element.getUnitElement(), -1);
838    if (element.hasSystemElement())
839      composeUri(t, "Quantity", "system", element.getSystemElement(), -1);
840    if (element.hasCodeElement())
841      composeCode(t, "Quantity", "code", element.getCodeElement(), -1);
842  }
843
844  protected void composePeriod(Complex parent, String parentType, String name, Period element, int index) {
845    if (element == null)
846      return;
847    Complex t;
848    if (Utilities.noString(parentType))
849      t = parent;
850    else {
851      t = parent.predicate("fhir:" + parentType + '.' + name);
852    }
853    composeElement(t, "Period", name, element, index);
854    if (element.hasStartElement())
855      composeDateTime(t, "Period", "start", element.getStartElement(), -1);
856    if (element.hasEndElement())
857      composeDateTime(t, "Period", "end", element.getEndElement(), -1);
858  }
859
860  protected void composeDuration(Complex parent, String parentType, String name, Duration element, int index) {
861    if (element == null)
862      return;
863    Complex t;
864    if (Utilities.noString(parentType))
865      t = parent;
866    else {
867      t = parent.predicate("fhir:" + parentType + '.' + name);
868    }
869    composeElement(t, "Duration", name, element, index);
870  }
871
872  protected void composeRange(Complex parent, String parentType, String name, Range element, int index) {
873    if (element == null)
874      return;
875    Complex t;
876    if (Utilities.noString(parentType))
877      t = parent;
878    else {
879      t = parent.predicate("fhir:" + parentType + '.' + name);
880    }
881    composeElement(t, "Range", name, element, index);
882    if (element.hasLow())
883      composeQuantity(t, "Range", "low", element.getLow(), -1);
884    if (element.hasHigh())
885      composeQuantity(t, "Range", "high", element.getHigh(), -1);
886  }
887
888  protected void composeRelatedArtifact(Complex parent, String parentType, String name, RelatedArtifact element,
889      int index) {
890    if (element == null)
891      return;
892    Complex t;
893    if (Utilities.noString(parentType))
894      t = parent;
895    else {
896      t = parent.predicate("fhir:" + parentType + '.' + name);
897    }
898    composeElement(t, "RelatedArtifact", name, element, index);
899    if (element.hasTypeElement())
900      composeEnum(t, "RelatedArtifact", "type", element.getTypeElement(), -1);
901    if (element.hasLabelElement())
902      composeString(t, "RelatedArtifact", "label", element.getLabelElement(), -1);
903    if (element.hasDisplayElement())
904      composeString(t, "RelatedArtifact", "display", element.getDisplayElement(), -1);
905    if (element.hasCitationElement())
906      composeMarkdown(t, "RelatedArtifact", "citation", element.getCitationElement(), -1);
907    if (element.hasUrlElement())
908      composeUrl(t, "RelatedArtifact", "url", element.getUrlElement(), -1);
909    if (element.hasDocument())
910      composeAttachment(t, "RelatedArtifact", "document", element.getDocument(), -1);
911    if (element.hasResourceElement())
912      composeCanonical(t, "RelatedArtifact", "resource", element.getResourceElement(), -1);
913  }
914
915  protected void composeAnnotation(Complex parent, String parentType, String name, Annotation element, int index) {
916    if (element == null)
917      return;
918    Complex t;
919    if (Utilities.noString(parentType))
920      t = parent;
921    else {
922      t = parent.predicate("fhir:" + parentType + '.' + name);
923    }
924    composeElement(t, "Annotation", name, element, index);
925    if (element.hasAuthor())
926      composeType(t, "Annotation", "author", element.getAuthor(), -1);
927    if (element.hasTimeElement())
928      composeDateTime(t, "Annotation", "time", element.getTimeElement(), -1);
929    if (element.hasTextElement())
930      composeMarkdown(t, "Annotation", "text", element.getTextElement(), -1);
931  }
932
933  protected void composeProductShelfLife(Complex parent, String parentType, String name, ProductShelfLife element,
934      int index) {
935    if (element == null)
936      return;
937    Complex t;
938    if (Utilities.noString(parentType))
939      t = parent;
940    else {
941      t = parent.predicate("fhir:" + parentType + '.' + name);
942    }
943    composeElement(t, "ProductShelfLife", name, element, index);
944    if (element.hasIdentifier())
945      composeIdentifier(t, "ProductShelfLife", "identifier", element.getIdentifier(), -1);
946    if (element.hasType())
947      composeCodeableConcept(t, "ProductShelfLife", "type", element.getType(), -1);
948    if (element.hasPeriod())
949      composeQuantity(t, "ProductShelfLife", "period", element.getPeriod(), -1);
950    for (int i = 0; i < element.getSpecialPrecautionsForStorage().size(); i++)
951      composeCodeableConcept(t, "ProductShelfLife", "specialPrecautionsForStorage",
952          element.getSpecialPrecautionsForStorage().get(i), i);
953  }
954
955  protected void composeContactDetail(Complex parent, String parentType, String name, ContactDetail element,
956      int index) {
957    if (element == null)
958      return;
959    Complex t;
960    if (Utilities.noString(parentType))
961      t = parent;
962    else {
963      t = parent.predicate("fhir:" + parentType + '.' + name);
964    }
965    composeElement(t, "ContactDetail", name, element, index);
966    if (element.hasNameElement())
967      composeString(t, "ContactDetail", "name", element.getNameElement(), -1);
968    for (int i = 0; i < element.getTelecom().size(); i++)
969      composeContactPoint(t, "ContactDetail", "telecom", element.getTelecom().get(i), i);
970  }
971
972  protected void composeUsageContext(Complex parent, String parentType, String name, UsageContext element, int index) {
973    if (element == null)
974      return;
975    Complex t;
976    if (Utilities.noString(parentType))
977      t = parent;
978    else {
979      t = parent.predicate("fhir:" + parentType + '.' + name);
980    }
981    composeElement(t, "UsageContext", name, element, index);
982    if (element.hasCode())
983      composeCoding(t, "UsageContext", "code", element.getCode(), -1);
984    if (element.hasValue())
985      composeType(t, "UsageContext", "value", element.getValue(), -1);
986  }
987
988  protected void composeExpression(Complex parent, String parentType, String name, Expression element, int index) {
989    if (element == null)
990      return;
991    Complex t;
992    if (Utilities.noString(parentType))
993      t = parent;
994    else {
995      t = parent.predicate("fhir:" + parentType + '.' + name);
996    }
997    composeElement(t, "Expression", name, element, index);
998    if (element.hasDescriptionElement())
999      composeString(t, "Expression", "description", element.getDescriptionElement(), -1);
1000    if (element.hasNameElement())
1001      composeId(t, "Expression", "name", element.getNameElement(), -1);
1002    if (element.hasLanguageElement())
1003      composeCode(t, "Expression", "language", element.getLanguageElement(), -1);
1004    if (element.hasExpressionElement())
1005      composeString(t, "Expression", "expression", element.getExpressionElement(), -1);
1006    if (element.hasReferenceElement())
1007      composeUri(t, "Expression", "reference", element.getReferenceElement(), -1);
1008  }
1009
1010  protected void composeSignature(Complex parent, String parentType, String name, Signature element, int index) {
1011    if (element == null)
1012      return;
1013    Complex t;
1014    if (Utilities.noString(parentType))
1015      t = parent;
1016    else {
1017      t = parent.predicate("fhir:" + parentType + '.' + name);
1018    }
1019    composeElement(t, "Signature", name, element, index);
1020    for (int i = 0; i < element.getType().size(); i++)
1021      composeCoding(t, "Signature", "type", element.getType().get(i), i);
1022    if (element.hasWhenElement())
1023      composeInstant(t, "Signature", "when", element.getWhenElement(), -1);
1024    if (element.hasWho())
1025      composeReference(t, "Signature", "who", element.getWho(), -1);
1026    if (element.hasOnBehalfOf())
1027      composeReference(t, "Signature", "onBehalfOf", element.getOnBehalfOf(), -1);
1028    if (element.hasTargetFormatElement())
1029      composeCode(t, "Signature", "targetFormat", element.getTargetFormatElement(), -1);
1030    if (element.hasSigFormatElement())
1031      composeCode(t, "Signature", "sigFormat", element.getSigFormatElement(), -1);
1032    if (element.hasDataElement())
1033      composeBase64Binary(t, "Signature", "data", element.getDataElement(), -1);
1034  }
1035
1036  protected void composeTiming(Complex parent, String parentType, String name, Timing element, int index) {
1037    if (element == null)
1038      return;
1039    Complex t;
1040    if (Utilities.noString(parentType))
1041      t = parent;
1042    else {
1043      t = parent.predicate("fhir:" + parentType + '.' + name);
1044    }
1045    composeElement(t, "Timing", name, element, index);
1046    for (int i = 0; i < element.getEvent().size(); i++)
1047      composeDateTime(t, "Timing", "event", element.getEvent().get(i), i);
1048    if (element.hasRepeat())
1049      composeTimingTimingRepeatComponent(t, "Timing", "repeat", element.getRepeat(), -1);
1050    if (element.hasCode())
1051      composeCodeableConcept(t, "Timing", "code", element.getCode(), -1);
1052  }
1053
1054  protected void composeTimingTimingRepeatComponent(Complex parent, String parentType, String name,
1055      Timing.TimingRepeatComponent element, int index) {
1056    if (element == null)
1057      return;
1058    Complex t;
1059    if (Utilities.noString(parentType))
1060      t = parent;
1061    else {
1062      t = parent.predicate("fhir:" + parentType + '.' + name);
1063    }
1064    composeElement(t, "repeat", name, element, index);
1065    if (element.hasBounds())
1066      composeType(t, "Timing", "bounds", element.getBounds(), -1);
1067    if (element.hasCountElement())
1068      composePositiveInt(t, "Timing", "count", element.getCountElement(), -1);
1069    if (element.hasCountMaxElement())
1070      composePositiveInt(t, "Timing", "countMax", element.getCountMaxElement(), -1);
1071    if (element.hasDurationElement())
1072      composeDecimal(t, "Timing", "duration", element.getDurationElement(), -1);
1073    if (element.hasDurationMaxElement())
1074      composeDecimal(t, "Timing", "durationMax", element.getDurationMaxElement(), -1);
1075    if (element.hasDurationUnitElement())
1076      composeEnum(t, "Timing", "durationUnit", element.getDurationUnitElement(), -1);
1077    if (element.hasFrequencyElement())
1078      composePositiveInt(t, "Timing", "frequency", element.getFrequencyElement(), -1);
1079    if (element.hasFrequencyMaxElement())
1080      composePositiveInt(t, "Timing", "frequencyMax", element.getFrequencyMaxElement(), -1);
1081    if (element.hasPeriodElement())
1082      composeDecimal(t, "Timing", "period", element.getPeriodElement(), -1);
1083    if (element.hasPeriodMaxElement())
1084      composeDecimal(t, "Timing", "periodMax", element.getPeriodMaxElement(), -1);
1085    if (element.hasPeriodUnitElement())
1086      composeEnum(t, "Timing", "periodUnit", element.getPeriodUnitElement(), -1);
1087    for (int i = 0; i < element.getDayOfWeek().size(); i++)
1088      composeEnum(t, "Timing", "dayOfWeek", element.getDayOfWeek().get(i), i);
1089    for (int i = 0; i < element.getTimeOfDay().size(); i++)
1090      composeTime(t, "Timing", "timeOfDay", element.getTimeOfDay().get(i), i);
1091    for (int i = 0; i < element.getWhen().size(); i++)
1092      composeEnum(t, "Timing", "when", element.getWhen().get(i), i);
1093    if (element.hasOffsetElement())
1094      composeUnsignedInt(t, "Timing", "offset", element.getOffsetElement(), -1);
1095  }
1096
1097  protected void composeProdCharacteristic(Complex parent, String parentType, String name, ProdCharacteristic element,
1098      int index) {
1099    if (element == null)
1100      return;
1101    Complex t;
1102    if (Utilities.noString(parentType))
1103      t = parent;
1104    else {
1105      t = parent.predicate("fhir:" + parentType + '.' + name);
1106    }
1107    composeElement(t, "ProdCharacteristic", name, element, index);
1108    if (element.hasHeight())
1109      composeQuantity(t, "ProdCharacteristic", "height", element.getHeight(), -1);
1110    if (element.hasWidth())
1111      composeQuantity(t, "ProdCharacteristic", "width", element.getWidth(), -1);
1112    if (element.hasDepth())
1113      composeQuantity(t, "ProdCharacteristic", "depth", element.getDepth(), -1);
1114    if (element.hasWeight())
1115      composeQuantity(t, "ProdCharacteristic", "weight", element.getWeight(), -1);
1116    if (element.hasNominalVolume())
1117      composeQuantity(t, "ProdCharacteristic", "nominalVolume", element.getNominalVolume(), -1);
1118    if (element.hasExternalDiameter())
1119      composeQuantity(t, "ProdCharacteristic", "externalDiameter", element.getExternalDiameter(), -1);
1120    if (element.hasShapeElement())
1121      composeString(t, "ProdCharacteristic", "shape", element.getShapeElement(), -1);
1122    for (int i = 0; i < element.getColor().size(); i++)
1123      composeString(t, "ProdCharacteristic", "color", element.getColor().get(i), i);
1124    for (int i = 0; i < element.getImprint().size(); i++)
1125      composeString(t, "ProdCharacteristic", "imprint", element.getImprint().get(i), i);
1126    for (int i = 0; i < element.getImage().size(); i++)
1127      composeAttachment(t, "ProdCharacteristic", "image", element.getImage().get(i), i);
1128    if (element.hasScoring())
1129      composeCodeableConcept(t, "ProdCharacteristic", "scoring", element.getScoring(), -1);
1130  }
1131
1132  protected void composeCodeableConcept(Complex parent, String parentType, String name, CodeableConcept element,
1133      int index) {
1134    if (element == null)
1135      return;
1136    Complex t;
1137    if (Utilities.noString(parentType))
1138      t = parent;
1139    else {
1140      t = parent.predicate("fhir:" + parentType + '.' + name);
1141    }
1142    composeElement(t, "CodeableConcept", name, element, index);
1143    decorateCodeableConcept(t, element);
1144    for (int i = 0; i < element.getCoding().size(); i++)
1145      composeCoding(t, "CodeableConcept", "coding", element.getCoding().get(i), i);
1146    if (element.hasTextElement())
1147      composeString(t, "CodeableConcept", "text", element.getTextElement(), -1);
1148  }
1149
1150  protected void composeParameterDefinition(Complex parent, String parentType, String name, ParameterDefinition element,
1151      int index) {
1152    if (element == null)
1153      return;
1154    Complex t;
1155    if (Utilities.noString(parentType))
1156      t = parent;
1157    else {
1158      t = parent.predicate("fhir:" + parentType + '.' + name);
1159    }
1160    composeElement(t, "ParameterDefinition", name, element, index);
1161    if (element.hasNameElement())
1162      composeCode(t, "ParameterDefinition", "name", element.getNameElement(), -1);
1163    if (element.hasUseElement())
1164      composeEnum(t, "ParameterDefinition", "use", element.getUseElement(), -1);
1165    if (element.hasMinElement())
1166      composeInteger(t, "ParameterDefinition", "min", element.getMinElement(), -1);
1167    if (element.hasMaxElement())
1168      composeString(t, "ParameterDefinition", "max", element.getMaxElement(), -1);
1169    if (element.hasDocumentationElement())
1170      composeString(t, "ParameterDefinition", "documentation", element.getDocumentationElement(), -1);
1171    if (element.hasTypeElement())
1172      composeCode(t, "ParameterDefinition", "type", element.getTypeElement(), -1);
1173    if (element.hasProfileElement())
1174      composeCanonical(t, "ParameterDefinition", "profile", element.getProfileElement(), -1);
1175  }
1176
1177  protected void composeElementDefinition(Complex parent, String parentType, String name, ElementDefinition element,
1178      int index) {
1179    if (element == null)
1180      return;
1181    Complex t;
1182    if (Utilities.noString(parentType))
1183      t = parent;
1184    else {
1185      t = parent.predicate("fhir:" + parentType + '.' + name);
1186    }
1187    composeElement(t, "ElementDefinition", name, element, index);
1188    if (element.hasPathElement())
1189      composeString(t, "ElementDefinition", "path", element.getPathElement(), -1);
1190    for (int i = 0; i < element.getRepresentation().size(); i++)
1191      composeEnum(t, "ElementDefinition", "representation", element.getRepresentation().get(i), i);
1192    if (element.hasSliceNameElement())
1193      composeString(t, "ElementDefinition", "sliceName", element.getSliceNameElement(), -1);
1194    if (element.hasSliceIsConstrainingElement())
1195      composeBoolean(t, "ElementDefinition", "sliceIsConstraining", element.getSliceIsConstrainingElement(), -1);
1196    if (element.hasLabelElement())
1197      composeString(t, "ElementDefinition", "label", element.getLabelElement(), -1);
1198    for (int i = 0; i < element.getCode().size(); i++)
1199      composeCoding(t, "ElementDefinition", "code", element.getCode().get(i), i);
1200    if (element.hasSlicing())
1201      composeElementDefinitionElementDefinitionSlicingComponent(t, "ElementDefinition", "slicing", element.getSlicing(),
1202          -1);
1203    if (element.hasShortElement())
1204      composeString(t, "ElementDefinition", "short", element.getShortElement(), -1);
1205    if (element.hasDefinitionElement())
1206      composeMarkdown(t, "ElementDefinition", "definition", element.getDefinitionElement(), -1);
1207    if (element.hasCommentElement())
1208      composeMarkdown(t, "ElementDefinition", "comment", element.getCommentElement(), -1);
1209    if (element.hasRequirementsElement())
1210      composeMarkdown(t, "ElementDefinition", "requirements", element.getRequirementsElement(), -1);
1211    for (int i = 0; i < element.getAlias().size(); i++)
1212      composeString(t, "ElementDefinition", "alias", element.getAlias().get(i), i);
1213    if (element.hasMinElement())
1214      composeUnsignedInt(t, "ElementDefinition", "min", element.getMinElement(), -1);
1215    if (element.hasMaxElement())
1216      composeString(t, "ElementDefinition", "max", element.getMaxElement(), -1);
1217    if (element.hasBase())
1218      composeElementDefinitionElementDefinitionBaseComponent(t, "ElementDefinition", "base", element.getBase(), -1);
1219    if (element.hasContentReferenceElement())
1220      composeUri(t, "ElementDefinition", "contentReference", element.getContentReferenceElement(), -1);
1221    for (int i = 0; i < element.getType().size(); i++)
1222      composeElementDefinitionTypeRefComponent(t, "ElementDefinition", "type", element.getType().get(i), i);
1223    if (element.hasDefaultValue())
1224      composeType(t, "ElementDefinition", "defaultValue", element.getDefaultValue(), -1);
1225    if (element.hasMeaningWhenMissingElement())
1226      composeMarkdown(t, "ElementDefinition", "meaningWhenMissing", element.getMeaningWhenMissingElement(), -1);
1227    if (element.hasOrderMeaningElement())
1228      composeString(t, "ElementDefinition", "orderMeaning", element.getOrderMeaningElement(), -1);
1229    if (element.hasFixed())
1230      composeType(t, "ElementDefinition", "fixed", element.getFixed(), -1);
1231    if (element.hasPattern())
1232      composeType(t, "ElementDefinition", "pattern", element.getPattern(), -1);
1233    for (int i = 0; i < element.getExample().size(); i++)
1234      composeElementDefinitionElementDefinitionExampleComponent(t, "ElementDefinition", "example",
1235          element.getExample().get(i), i);
1236    if (element.hasMinValue())
1237      composeType(t, "ElementDefinition", "minValue", element.getMinValue(), -1);
1238    if (element.hasMaxValue())
1239      composeType(t, "ElementDefinition", "maxValue", element.getMaxValue(), -1);
1240    if (element.hasMaxLengthElement())
1241      composeInteger(t, "ElementDefinition", "maxLength", element.getMaxLengthElement(), -1);
1242    for (int i = 0; i < element.getCondition().size(); i++)
1243      composeId(t, "ElementDefinition", "condition", element.getCondition().get(i), i);
1244    for (int i = 0; i < element.getConstraint().size(); i++)
1245      composeElementDefinitionElementDefinitionConstraintComponent(t, "ElementDefinition", "constraint",
1246          element.getConstraint().get(i), i);
1247    if (element.hasMustSupportElement())
1248      composeBoolean(t, "ElementDefinition", "mustSupport", element.getMustSupportElement(), -1);
1249    if (element.hasIsModifierElement())
1250      composeBoolean(t, "ElementDefinition", "isModifier", element.getIsModifierElement(), -1);
1251    if (element.hasIsModifierReasonElement())
1252      composeString(t, "ElementDefinition", "isModifierReason", element.getIsModifierReasonElement(), -1);
1253    if (element.hasIsSummaryElement())
1254      composeBoolean(t, "ElementDefinition", "isSummary", element.getIsSummaryElement(), -1);
1255    if (element.hasBinding())
1256      composeElementDefinitionElementDefinitionBindingComponent(t, "ElementDefinition", "binding", element.getBinding(),
1257          -1);
1258    for (int i = 0; i < element.getMapping().size(); i++)
1259      composeElementDefinitionElementDefinitionMappingComponent(t, "ElementDefinition", "mapping",
1260          element.getMapping().get(i), i);
1261  }
1262
1263  protected void composeElementDefinitionElementDefinitionSlicingComponent(Complex parent, String parentType,
1264      String name, ElementDefinition.ElementDefinitionSlicingComponent element, int index) {
1265    if (element == null)
1266      return;
1267    Complex t;
1268    if (Utilities.noString(parentType))
1269      t = parent;
1270    else {
1271      t = parent.predicate("fhir:" + parentType + '.' + name);
1272    }
1273    composeElement(t, "slicing", name, element, index);
1274    for (int i = 0; i < element.getDiscriminator().size(); i++)
1275      composeElementDefinitionElementDefinitionSlicingDiscriminatorComponent(t, "ElementDefinition", "discriminator",
1276          element.getDiscriminator().get(i), i);
1277    if (element.hasDescriptionElement())
1278      composeString(t, "ElementDefinition", "description", element.getDescriptionElement(), -1);
1279    if (element.hasOrderedElement())
1280      composeBoolean(t, "ElementDefinition", "ordered", element.getOrderedElement(), -1);
1281    if (element.hasRulesElement())
1282      composeEnum(t, "ElementDefinition", "rules", element.getRulesElement(), -1);
1283  }
1284
1285  protected void composeElementDefinitionElementDefinitionSlicingDiscriminatorComponent(Complex parent,
1286      String parentType, String name, ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent element,
1287      int index) {
1288    if (element == null)
1289      return;
1290    Complex t;
1291    if (Utilities.noString(parentType))
1292      t = parent;
1293    else {
1294      t = parent.predicate("fhir:" + parentType + '.' + name);
1295    }
1296    composeElement(t, "discriminator", name, element, index);
1297    if (element.hasTypeElement())
1298      composeEnum(t, "ElementDefinition", "type", element.getTypeElement(), -1);
1299    if (element.hasPathElement())
1300      composeString(t, "ElementDefinition", "path", element.getPathElement(), -1);
1301  }
1302
1303  protected void composeElementDefinitionElementDefinitionBaseComponent(Complex parent, String parentType, String name,
1304      ElementDefinition.ElementDefinitionBaseComponent element, int index) {
1305    if (element == null)
1306      return;
1307    Complex t;
1308    if (Utilities.noString(parentType))
1309      t = parent;
1310    else {
1311      t = parent.predicate("fhir:" + parentType + '.' + name);
1312    }
1313    composeElement(t, "base", name, element, index);
1314    if (element.hasPathElement())
1315      composeString(t, "ElementDefinition", "path", element.getPathElement(), -1);
1316    if (element.hasMinElement())
1317      composeUnsignedInt(t, "ElementDefinition", "min", element.getMinElement(), -1);
1318    if (element.hasMaxElement())
1319      composeString(t, "ElementDefinition", "max", element.getMaxElement(), -1);
1320  }
1321
1322  protected void composeElementDefinitionTypeRefComponent(Complex parent, String parentType, String name,
1323      ElementDefinition.TypeRefComponent element, int index) {
1324    if (element == null)
1325      return;
1326    Complex t;
1327    if (Utilities.noString(parentType))
1328      t = parent;
1329    else {
1330      t = parent.predicate("fhir:" + parentType + '.' + name);
1331    }
1332    composeElement(t, "type", name, element, index);
1333    if (element.hasCodeElement())
1334      composeUri(t, "ElementDefinition", "code", element.getCodeElement(), -1);
1335    for (int i = 0; i < element.getProfile().size(); i++)
1336      composeCanonical(t, "ElementDefinition", "profile", element.getProfile().get(i), i);
1337    for (int i = 0; i < element.getTargetProfile().size(); i++)
1338      composeCanonical(t, "ElementDefinition", "targetProfile", element.getTargetProfile().get(i), i);
1339    for (int i = 0; i < element.getAggregation().size(); i++)
1340      composeEnum(t, "ElementDefinition", "aggregation", element.getAggregation().get(i), i);
1341    if (element.hasVersioningElement())
1342      composeEnum(t, "ElementDefinition", "versioning", element.getVersioningElement(), -1);
1343  }
1344
1345  protected void composeElementDefinitionElementDefinitionExampleComponent(Complex parent, String parentType,
1346      String name, ElementDefinition.ElementDefinitionExampleComponent element, int index) {
1347    if (element == null)
1348      return;
1349    Complex t;
1350    if (Utilities.noString(parentType))
1351      t = parent;
1352    else {
1353      t = parent.predicate("fhir:" + parentType + '.' + name);
1354    }
1355    composeElement(t, "example", name, element, index);
1356    if (element.hasLabelElement())
1357      composeString(t, "ElementDefinition", "label", element.getLabelElement(), -1);
1358    if (element.hasValue())
1359      composeType(t, "ElementDefinition", "value", element.getValue(), -1);
1360  }
1361
1362  protected void composeElementDefinitionElementDefinitionConstraintComponent(Complex parent, String parentType,
1363      String name, ElementDefinition.ElementDefinitionConstraintComponent element, int index) {
1364    if (element == null)
1365      return;
1366    Complex t;
1367    if (Utilities.noString(parentType))
1368      t = parent;
1369    else {
1370      t = parent.predicate("fhir:" + parentType + '.' + name);
1371    }
1372    composeElement(t, "constraint", name, element, index);
1373    if (element.hasKeyElement())
1374      composeId(t, "ElementDefinition", "key", element.getKeyElement(), -1);
1375    if (element.hasRequirementsElement())
1376      composeString(t, "ElementDefinition", "requirements", element.getRequirementsElement(), -1);
1377    if (element.hasSeverityElement())
1378      composeEnum(t, "ElementDefinition", "severity", element.getSeverityElement(), -1);
1379    if (element.hasHumanElement())
1380      composeString(t, "ElementDefinition", "human", element.getHumanElement(), -1);
1381    if (element.hasExpressionElement())
1382      composeString(t, "ElementDefinition", "expression", element.getExpressionElement(), -1);
1383    if (element.hasXpathElement())
1384      composeString(t, "ElementDefinition", "xpath", element.getXpathElement(), -1);
1385    if (element.hasSourceElement())
1386      composeCanonical(t, "ElementDefinition", "source", element.getSourceElement(), -1);
1387  }
1388
1389  protected void composeElementDefinitionElementDefinitionBindingComponent(Complex parent, String parentType,
1390      String name, ElementDefinition.ElementDefinitionBindingComponent element, int index) {
1391    if (element == null)
1392      return;
1393    Complex t;
1394    if (Utilities.noString(parentType))
1395      t = parent;
1396    else {
1397      t = parent.predicate("fhir:" + parentType + '.' + name);
1398    }
1399    composeElement(t, "binding", name, element, index);
1400    if (element.hasStrengthElement())
1401      composeEnum(t, "ElementDefinition", "strength", element.getStrengthElement(), -1);
1402    if (element.hasDescriptionElement())
1403      composeString(t, "ElementDefinition", "description", element.getDescriptionElement(), -1);
1404    if (element.hasValueSetElement())
1405      composeCanonical(t, "ElementDefinition", "valueSet", element.getValueSetElement(), -1);
1406  }
1407
1408  protected void composeElementDefinitionElementDefinitionMappingComponent(Complex parent, String parentType,
1409      String name, ElementDefinition.ElementDefinitionMappingComponent element, int index) {
1410    if (element == null)
1411      return;
1412    Complex t;
1413    if (Utilities.noString(parentType))
1414      t = parent;
1415    else {
1416      t = parent.predicate("fhir:" + parentType + '.' + name);
1417    }
1418    composeElement(t, "mapping", name, element, index);
1419    if (element.hasIdentityElement())
1420      composeId(t, "ElementDefinition", "identity", element.getIdentityElement(), -1);
1421    if (element.hasLanguageElement())
1422      composeCode(t, "ElementDefinition", "language", element.getLanguageElement(), -1);
1423    if (element.hasMapElement())
1424      composeString(t, "ElementDefinition", "map", element.getMapElement(), -1);
1425    if (element.hasCommentElement())
1426      composeString(t, "ElementDefinition", "comment", element.getCommentElement(), -1);
1427  }
1428
1429  protected void composeDomainResource(Complex t, String parentType, String name, DomainResource element, int index) {
1430    composeResource(t, parentType, name, element, index);
1431    if (element.hasText())
1432      composeNarrative(t, "DomainResource", "text", element.getText(), -1);
1433    for (int i = 0; i < element.getContained().size(); i++)
1434      composeResource(t, "DomainResource", "contained", element.getContained().get(i), i);
1435    for (int i = 0; i < element.getExtension().size(); i++)
1436      composeExtension(t, "DomainResource", "extension", element.getExtension().get(i), i);
1437    for (int i = 0; i < element.getModifierExtension().size(); i++)
1438      composeExtension(t, "DomainResource", "modifierExtension", element.getModifierExtension().get(i), i);
1439  }
1440
1441  protected void composeParameters(Complex parent, String parentType, String name, Parameters element, int index) {
1442    if (element == null)
1443      return;
1444    Complex t;
1445    if (Utilities.noString(parentType))
1446      t = parent;
1447    else {
1448      t = parent.predicate("fhir:" + parentType + '.' + name);
1449    }
1450    composeResource(t, "Parameters", name, element, index);
1451    for (int i = 0; i < element.getParameter().size(); i++)
1452      composeParametersParametersParameterComponent(t, "Parameters", "parameter", element.getParameter().get(i), i);
1453  }
1454
1455  protected void composeParametersParametersParameterComponent(Complex parent, String parentType, String name,
1456      Parameters.ParametersParameterComponent element, int index) {
1457    if (element == null)
1458      return;
1459    Complex t;
1460    if (Utilities.noString(parentType))
1461      t = parent;
1462    else {
1463      t = parent.predicate("fhir:" + parentType + '.' + name);
1464    }
1465    composeBackboneElement(t, "parameter", name, element, index);
1466    if (element.hasNameElement())
1467      composeString(t, "Parameters", "name", element.getNameElement(), -1);
1468    if (element.hasValue())
1469      composeType(t, "Parameters", "value", element.getValue(), -1);
1470    if (element.hasResource())
1471      composeResource(t, "Parameters", "resource", element.getResource(), -1);
1472    for (int i = 0; i < element.getPart().size(); i++)
1473      composeParametersParametersParameterComponent(t, "Parameters", "part", element.getPart().get(i), i);
1474  }
1475
1476  protected void composeResource(Complex t, String parentType, String name, Resource element, int index) {
1477    if (element.hasIdElement())
1478      composeId(t, "Resource", "id", element.getIdElement(), -1);
1479    if (element.hasMeta())
1480      composeMeta(t, "Resource", "meta", element.getMeta(), -1);
1481    if (element.hasImplicitRulesElement())
1482      composeUri(t, "Resource", "implicitRules", element.getImplicitRulesElement(), -1);
1483    if (element.hasLanguageElement())
1484      composeCode(t, "Resource", "language", element.getLanguageElement(), -1);
1485  }
1486
1487  protected void composeAccount(Complex parent, String parentType, String name, Account element, int index) {
1488    if (element == null)
1489      return;
1490    Complex t;
1491    if (Utilities.noString(parentType))
1492      t = parent;
1493    else {
1494      t = parent.predicate("fhir:" + parentType + '.' + name);
1495    }
1496    composeDomainResource(t, "Account", name, element, index);
1497    for (int i = 0; i < element.getIdentifier().size(); i++)
1498      composeIdentifier(t, "Account", "identifier", element.getIdentifier().get(i), i);
1499    if (element.hasStatusElement())
1500      composeEnum(t, "Account", "status", element.getStatusElement(), -1);
1501    if (element.hasType())
1502      composeCodeableConcept(t, "Account", "type", element.getType(), -1);
1503    if (element.hasNameElement())
1504      composeString(t, "Account", "name", element.getNameElement(), -1);
1505    for (int i = 0; i < element.getSubject().size(); i++)
1506      composeReference(t, "Account", "subject", element.getSubject().get(i), i);
1507    if (element.hasServicePeriod())
1508      composePeriod(t, "Account", "servicePeriod", element.getServicePeriod(), -1);
1509    for (int i = 0; i < element.getCoverage().size(); i++)
1510      composeAccountCoverageComponent(t, "Account", "coverage", element.getCoverage().get(i), i);
1511    if (element.hasOwner())
1512      composeReference(t, "Account", "owner", element.getOwner(), -1);
1513    if (element.hasDescriptionElement())
1514      composeString(t, "Account", "description", element.getDescriptionElement(), -1);
1515    for (int i = 0; i < element.getGuarantor().size(); i++)
1516      composeAccountGuarantorComponent(t, "Account", "guarantor", element.getGuarantor().get(i), i);
1517    if (element.hasPartOf())
1518      composeReference(t, "Account", "partOf", element.getPartOf(), -1);
1519  }
1520
1521  protected void composeAccountCoverageComponent(Complex parent, String parentType, String name,
1522      Account.CoverageComponent element, int index) {
1523    if (element == null)
1524      return;
1525    Complex t;
1526    if (Utilities.noString(parentType))
1527      t = parent;
1528    else {
1529      t = parent.predicate("fhir:" + parentType + '.' + name);
1530    }
1531    composeBackboneElement(t, "coverage", name, element, index);
1532    if (element.hasCoverage())
1533      composeReference(t, "Account", "coverage", element.getCoverage(), -1);
1534    if (element.hasPriorityElement())
1535      composePositiveInt(t, "Account", "priority", element.getPriorityElement(), -1);
1536  }
1537
1538  protected void composeAccountGuarantorComponent(Complex parent, String parentType, String name,
1539      Account.GuarantorComponent element, int index) {
1540    if (element == null)
1541      return;
1542    Complex t;
1543    if (Utilities.noString(parentType))
1544      t = parent;
1545    else {
1546      t = parent.predicate("fhir:" + parentType + '.' + name);
1547    }
1548    composeBackboneElement(t, "guarantor", name, element, index);
1549    if (element.hasParty())
1550      composeReference(t, "Account", "party", element.getParty(), -1);
1551    if (element.hasOnHoldElement())
1552      composeBoolean(t, "Account", "onHold", element.getOnHoldElement(), -1);
1553    if (element.hasPeriod())
1554      composePeriod(t, "Account", "period", element.getPeriod(), -1);
1555  }
1556
1557  protected void composeActivityDefinition(Complex parent, String parentType, String name, ActivityDefinition element,
1558      int index) {
1559    if (element == null)
1560      return;
1561    Complex t;
1562    if (Utilities.noString(parentType))
1563      t = parent;
1564    else {
1565      t = parent.predicate("fhir:" + parentType + '.' + name);
1566    }
1567    composeDomainResource(t, "ActivityDefinition", name, element, index);
1568    if (element.hasUrlElement())
1569      composeUri(t, "ActivityDefinition", "url", element.getUrlElement(), -1);
1570    for (int i = 0; i < element.getIdentifier().size(); i++)
1571      composeIdentifier(t, "ActivityDefinition", "identifier", element.getIdentifier().get(i), i);
1572    if (element.hasVersionElement())
1573      composeString(t, "ActivityDefinition", "version", element.getVersionElement(), -1);
1574    if (element.hasNameElement())
1575      composeString(t, "ActivityDefinition", "name", element.getNameElement(), -1);
1576    if (element.hasTitleElement())
1577      composeString(t, "ActivityDefinition", "title", element.getTitleElement(), -1);
1578    if (element.hasSubtitleElement())
1579      composeString(t, "ActivityDefinition", "subtitle", element.getSubtitleElement(), -1);
1580    if (element.hasStatusElement())
1581      composeEnum(t, "ActivityDefinition", "status", element.getStatusElement(), -1);
1582    if (element.hasExperimentalElement())
1583      composeBoolean(t, "ActivityDefinition", "experimental", element.getExperimentalElement(), -1);
1584    if (element.hasSubject())
1585      composeType(t, "ActivityDefinition", "subject", element.getSubject(), -1);
1586    if (element.hasDateElement())
1587      composeDateTime(t, "ActivityDefinition", "date", element.getDateElement(), -1);
1588    if (element.hasPublisherElement())
1589      composeString(t, "ActivityDefinition", "publisher", element.getPublisherElement(), -1);
1590    for (int i = 0; i < element.getContact().size(); i++)
1591      composeContactDetail(t, "ActivityDefinition", "contact", element.getContact().get(i), i);
1592    if (element.hasDescriptionElement())
1593      composeMarkdown(t, "ActivityDefinition", "description", element.getDescriptionElement(), -1);
1594    for (int i = 0; i < element.getUseContext().size(); i++)
1595      composeUsageContext(t, "ActivityDefinition", "useContext", element.getUseContext().get(i), i);
1596    for (int i = 0; i < element.getJurisdiction().size(); i++)
1597      composeCodeableConcept(t, "ActivityDefinition", "jurisdiction", element.getJurisdiction().get(i), i);
1598    if (element.hasPurposeElement())
1599      composeMarkdown(t, "ActivityDefinition", "purpose", element.getPurposeElement(), -1);
1600    if (element.hasUsageElement())
1601      composeString(t, "ActivityDefinition", "usage", element.getUsageElement(), -1);
1602    if (element.hasCopyrightElement())
1603      composeMarkdown(t, "ActivityDefinition", "copyright", element.getCopyrightElement(), -1);
1604    if (element.hasApprovalDateElement())
1605      composeDate(t, "ActivityDefinition", "approvalDate", element.getApprovalDateElement(), -1);
1606    if (element.hasLastReviewDateElement())
1607      composeDate(t, "ActivityDefinition", "lastReviewDate", element.getLastReviewDateElement(), -1);
1608    if (element.hasEffectivePeriod())
1609      composePeriod(t, "ActivityDefinition", "effectivePeriod", element.getEffectivePeriod(), -1);
1610    for (int i = 0; i < element.getTopic().size(); i++)
1611      composeCodeableConcept(t, "ActivityDefinition", "topic", element.getTopic().get(i), i);
1612    for (int i = 0; i < element.getAuthor().size(); i++)
1613      composeContactDetail(t, "ActivityDefinition", "author", element.getAuthor().get(i), i);
1614    for (int i = 0; i < element.getEditor().size(); i++)
1615      composeContactDetail(t, "ActivityDefinition", "editor", element.getEditor().get(i), i);
1616    for (int i = 0; i < element.getReviewer().size(); i++)
1617      composeContactDetail(t, "ActivityDefinition", "reviewer", element.getReviewer().get(i), i);
1618    for (int i = 0; i < element.getEndorser().size(); i++)
1619      composeContactDetail(t, "ActivityDefinition", "endorser", element.getEndorser().get(i), i);
1620    for (int i = 0; i < element.getRelatedArtifact().size(); i++)
1621      composeRelatedArtifact(t, "ActivityDefinition", "relatedArtifact", element.getRelatedArtifact().get(i), i);
1622    for (int i = 0; i < element.getLibrary().size(); i++)
1623      composeCanonical(t, "ActivityDefinition", "library", element.getLibrary().get(i), i);
1624    if (element.hasKindElement())
1625      composeEnum(t, "ActivityDefinition", "kind", element.getKindElement(), -1);
1626    if (element.hasProfileElement())
1627      composeCanonical(t, "ActivityDefinition", "profile", element.getProfileElement(), -1);
1628    if (element.hasCode())
1629      composeCodeableConcept(t, "ActivityDefinition", "code", element.getCode(), -1);
1630    if (element.hasIntentElement())
1631      composeEnum(t, "ActivityDefinition", "intent", element.getIntentElement(), -1);
1632    if (element.hasPriorityElement())
1633      composeEnum(t, "ActivityDefinition", "priority", element.getPriorityElement(), -1);
1634    if (element.hasDoNotPerformElement())
1635      composeBoolean(t, "ActivityDefinition", "doNotPerform", element.getDoNotPerformElement(), -1);
1636    if (element.hasTiming())
1637      composeType(t, "ActivityDefinition", "timing", element.getTiming(), -1);
1638    if (element.hasLocation())
1639      composeReference(t, "ActivityDefinition", "location", element.getLocation(), -1);
1640    for (int i = 0; i < element.getParticipant().size(); i++)
1641      composeActivityDefinitionActivityDefinitionParticipantComponent(t, "ActivityDefinition", "participant",
1642          element.getParticipant().get(i), i);
1643    if (element.hasProduct())
1644      composeType(t, "ActivityDefinition", "product", element.getProduct(), -1);
1645    if (element.hasQuantity())
1646      composeQuantity(t, "ActivityDefinition", "quantity", element.getQuantity(), -1);
1647    for (int i = 0; i < element.getDosage().size(); i++)
1648      composeDosage(t, "ActivityDefinition", "dosage", element.getDosage().get(i), i);
1649    for (int i = 0; i < element.getBodySite().size(); i++)
1650      composeCodeableConcept(t, "ActivityDefinition", "bodySite", element.getBodySite().get(i), i);
1651    for (int i = 0; i < element.getSpecimenRequirement().size(); i++)
1652      composeReference(t, "ActivityDefinition", "specimenRequirement", element.getSpecimenRequirement().get(i), i);
1653    for (int i = 0; i < element.getObservationRequirement().size(); i++)
1654      composeReference(t, "ActivityDefinition", "observationRequirement", element.getObservationRequirement().get(i),
1655          i);
1656    for (int i = 0; i < element.getObservationResultRequirement().size(); i++)
1657      composeReference(t, "ActivityDefinition", "observationResultRequirement",
1658          element.getObservationResultRequirement().get(i), i);
1659    if (element.hasTransformElement())
1660      composeCanonical(t, "ActivityDefinition", "transform", element.getTransformElement(), -1);
1661    for (int i = 0; i < element.getDynamicValue().size(); i++)
1662      composeActivityDefinitionActivityDefinitionDynamicValueComponent(t, "ActivityDefinition", "dynamicValue",
1663          element.getDynamicValue().get(i), i);
1664  }
1665
1666  protected void composeActivityDefinitionActivityDefinitionParticipantComponent(Complex parent, String parentType,
1667      String name, ActivityDefinition.ActivityDefinitionParticipantComponent element, int index) {
1668    if (element == null)
1669      return;
1670    Complex t;
1671    if (Utilities.noString(parentType))
1672      t = parent;
1673    else {
1674      t = parent.predicate("fhir:" + parentType + '.' + name);
1675    }
1676    composeBackboneElement(t, "participant", name, element, index);
1677    if (element.hasTypeElement())
1678      composeEnum(t, "ActivityDefinition", "type", element.getTypeElement(), -1);
1679    if (element.hasRole())
1680      composeCodeableConcept(t, "ActivityDefinition", "role", element.getRole(), -1);
1681  }
1682
1683  protected void composeActivityDefinitionActivityDefinitionDynamicValueComponent(Complex parent, String parentType,
1684      String name, ActivityDefinition.ActivityDefinitionDynamicValueComponent element, int index) {
1685    if (element == null)
1686      return;
1687    Complex t;
1688    if (Utilities.noString(parentType))
1689      t = parent;
1690    else {
1691      t = parent.predicate("fhir:" + parentType + '.' + name);
1692    }
1693    composeBackboneElement(t, "dynamicValue", name, element, index);
1694    if (element.hasPathElement())
1695      composeString(t, "ActivityDefinition", "path", element.getPathElement(), -1);
1696    if (element.hasExpression())
1697      composeExpression(t, "ActivityDefinition", "expression", element.getExpression(), -1);
1698  }
1699
1700  protected void composeAdverseEvent(Complex parent, String parentType, String name, AdverseEvent element, int index) {
1701    if (element == null)
1702      return;
1703    Complex t;
1704    if (Utilities.noString(parentType))
1705      t = parent;
1706    else {
1707      t = parent.predicate("fhir:" + parentType + '.' + name);
1708    }
1709    composeDomainResource(t, "AdverseEvent", name, element, index);
1710    if (element.hasIdentifier())
1711      composeIdentifier(t, "AdverseEvent", "identifier", element.getIdentifier(), -1);
1712    if (element.hasActualityElement())
1713      composeEnum(t, "AdverseEvent", "actuality", element.getActualityElement(), -1);
1714    for (int i = 0; i < element.getCategory().size(); i++)
1715      composeCodeableConcept(t, "AdverseEvent", "category", element.getCategory().get(i), i);
1716    if (element.hasEvent())
1717      composeCodeableConcept(t, "AdverseEvent", "event", element.getEvent(), -1);
1718    if (element.hasSubject())
1719      composeReference(t, "AdverseEvent", "subject", element.getSubject(), -1);
1720    if (element.hasEncounter())
1721      composeReference(t, "AdverseEvent", "encounter", element.getEncounter(), -1);
1722    if (element.hasDateElement())
1723      composeDateTime(t, "AdverseEvent", "date", element.getDateElement(), -1);
1724    if (element.hasDetectedElement())
1725      composeDateTime(t, "AdverseEvent", "detected", element.getDetectedElement(), -1);
1726    if (element.hasRecordedDateElement())
1727      composeDateTime(t, "AdverseEvent", "recordedDate", element.getRecordedDateElement(), -1);
1728    for (int i = 0; i < element.getResultingCondition().size(); i++)
1729      composeReference(t, "AdverseEvent", "resultingCondition", element.getResultingCondition().get(i), i);
1730    if (element.hasLocation())
1731      composeReference(t, "AdverseEvent", "location", element.getLocation(), -1);
1732    if (element.hasSeriousness())
1733      composeCodeableConcept(t, "AdverseEvent", "seriousness", element.getSeriousness(), -1);
1734    if (element.hasSeverity())
1735      composeCodeableConcept(t, "AdverseEvent", "severity", element.getSeverity(), -1);
1736    if (element.hasOutcome())
1737      composeCodeableConcept(t, "AdverseEvent", "outcome", element.getOutcome(), -1);
1738    if (element.hasRecorder())
1739      composeReference(t, "AdverseEvent", "recorder", element.getRecorder(), -1);
1740    for (int i = 0; i < element.getContributor().size(); i++)
1741      composeReference(t, "AdverseEvent", "contributor", element.getContributor().get(i), i);
1742    for (int i = 0; i < element.getSuspectEntity().size(); i++)
1743      composeAdverseEventAdverseEventSuspectEntityComponent(t, "AdverseEvent", "suspectEntity",
1744          element.getSuspectEntity().get(i), i);
1745    for (int i = 0; i < element.getSubjectMedicalHistory().size(); i++)
1746      composeReference(t, "AdverseEvent", "subjectMedicalHistory", element.getSubjectMedicalHistory().get(i), i);
1747    for (int i = 0; i < element.getReferenceDocument().size(); i++)
1748      composeReference(t, "AdverseEvent", "referenceDocument", element.getReferenceDocument().get(i), i);
1749    for (int i = 0; i < element.getStudy().size(); i++)
1750      composeReference(t, "AdverseEvent", "study", element.getStudy().get(i), i);
1751  }
1752
1753  protected void composeAdverseEventAdverseEventSuspectEntityComponent(Complex parent, String parentType, String name,
1754      AdverseEvent.AdverseEventSuspectEntityComponent element, int index) {
1755    if (element == null)
1756      return;
1757    Complex t;
1758    if (Utilities.noString(parentType))
1759      t = parent;
1760    else {
1761      t = parent.predicate("fhir:" + parentType + '.' + name);
1762    }
1763    composeBackboneElement(t, "suspectEntity", name, element, index);
1764    if (element.hasInstance())
1765      composeReference(t, "AdverseEvent", "instance", element.getInstance(), -1);
1766    for (int i = 0; i < element.getCausality().size(); i++)
1767      composeAdverseEventAdverseEventSuspectEntityCausalityComponent(t, "AdverseEvent", "causality",
1768          element.getCausality().get(i), i);
1769  }
1770
1771  protected void composeAdverseEventAdverseEventSuspectEntityCausalityComponent(Complex parent, String parentType,
1772      String name, AdverseEvent.AdverseEventSuspectEntityCausalityComponent element, int index) {
1773    if (element == null)
1774      return;
1775    Complex t;
1776    if (Utilities.noString(parentType))
1777      t = parent;
1778    else {
1779      t = parent.predicate("fhir:" + parentType + '.' + name);
1780    }
1781    composeBackboneElement(t, "causality", name, element, index);
1782    if (element.hasAssessment())
1783      composeCodeableConcept(t, "AdverseEvent", "assessment", element.getAssessment(), -1);
1784    if (element.hasProductRelatednessElement())
1785      composeString(t, "AdverseEvent", "productRelatedness", element.getProductRelatednessElement(), -1);
1786    if (element.hasAuthor())
1787      composeReference(t, "AdverseEvent", "author", element.getAuthor(), -1);
1788    if (element.hasMethod())
1789      composeCodeableConcept(t, "AdverseEvent", "method", element.getMethod(), -1);
1790  }
1791
1792  protected void composeAllergyIntolerance(Complex parent, String parentType, String name, AllergyIntolerance element,
1793      int index) {
1794    if (element == null)
1795      return;
1796    Complex t;
1797    if (Utilities.noString(parentType))
1798      t = parent;
1799    else {
1800      t = parent.predicate("fhir:" + parentType + '.' + name);
1801    }
1802    composeDomainResource(t, "AllergyIntolerance", name, element, index);
1803    for (int i = 0; i < element.getIdentifier().size(); i++)
1804      composeIdentifier(t, "AllergyIntolerance", "identifier", element.getIdentifier().get(i), i);
1805    if (element.hasClinicalStatus())
1806      composeCodeableConcept(t, "AllergyIntolerance", "clinicalStatus", element.getClinicalStatus(), -1);
1807    if (element.hasVerificationStatus())
1808      composeCodeableConcept(t, "AllergyIntolerance", "verificationStatus", element.getVerificationStatus(), -1);
1809    if (element.hasTypeElement())
1810      composeEnum(t, "AllergyIntolerance", "type", element.getTypeElement(), -1);
1811    for (int i = 0; i < element.getCategory().size(); i++)
1812      composeEnum(t, "AllergyIntolerance", "category", element.getCategory().get(i), i);
1813    if (element.hasCriticalityElement())
1814      composeEnum(t, "AllergyIntolerance", "criticality", element.getCriticalityElement(), -1);
1815    if (element.hasCode())
1816      composeCodeableConcept(t, "AllergyIntolerance", "code", element.getCode(), -1);
1817    if (element.hasPatient())
1818      composeReference(t, "AllergyIntolerance", "patient", element.getPatient(), -1);
1819    if (element.hasEncounter())
1820      composeReference(t, "AllergyIntolerance", "encounter", element.getEncounter(), -1);
1821    if (element.hasOnset())
1822      composeType(t, "AllergyIntolerance", "onset", element.getOnset(), -1);
1823    if (element.hasRecordedDateElement())
1824      composeDateTime(t, "AllergyIntolerance", "recordedDate", element.getRecordedDateElement(), -1);
1825    if (element.hasRecorder())
1826      composeReference(t, "AllergyIntolerance", "recorder", element.getRecorder(), -1);
1827    if (element.hasAsserter())
1828      composeReference(t, "AllergyIntolerance", "asserter", element.getAsserter(), -1);
1829    if (element.hasLastOccurrenceElement())
1830      composeDateTime(t, "AllergyIntolerance", "lastOccurrence", element.getLastOccurrenceElement(), -1);
1831    for (int i = 0; i < element.getNote().size(); i++)
1832      composeAnnotation(t, "AllergyIntolerance", "note", element.getNote().get(i), i);
1833    for (int i = 0; i < element.getReaction().size(); i++)
1834      composeAllergyIntoleranceAllergyIntoleranceReactionComponent(t, "AllergyIntolerance", "reaction",
1835          element.getReaction().get(i), i);
1836  }
1837
1838  protected void composeAllergyIntoleranceAllergyIntoleranceReactionComponent(Complex parent, String parentType,
1839      String name, AllergyIntolerance.AllergyIntoleranceReactionComponent element, int index) {
1840    if (element == null)
1841      return;
1842    Complex t;
1843    if (Utilities.noString(parentType))
1844      t = parent;
1845    else {
1846      t = parent.predicate("fhir:" + parentType + '.' + name);
1847    }
1848    composeBackboneElement(t, "reaction", name, element, index);
1849    if (element.hasSubstance())
1850      composeCodeableConcept(t, "AllergyIntolerance", "substance", element.getSubstance(), -1);
1851    for (int i = 0; i < element.getManifestation().size(); i++)
1852      composeCodeableConcept(t, "AllergyIntolerance", "manifestation", element.getManifestation().get(i), i);
1853    if (element.hasDescriptionElement())
1854      composeString(t, "AllergyIntolerance", "description", element.getDescriptionElement(), -1);
1855    if (element.hasOnsetElement())
1856      composeDateTime(t, "AllergyIntolerance", "onset", element.getOnsetElement(), -1);
1857    if (element.hasSeverityElement())
1858      composeEnum(t, "AllergyIntolerance", "severity", element.getSeverityElement(), -1);
1859    if (element.hasExposureRoute())
1860      composeCodeableConcept(t, "AllergyIntolerance", "exposureRoute", element.getExposureRoute(), -1);
1861    for (int i = 0; i < element.getNote().size(); i++)
1862      composeAnnotation(t, "AllergyIntolerance", "note", element.getNote().get(i), i);
1863  }
1864
1865  protected void composeAppointment(Complex parent, String parentType, String name, Appointment element, int index) {
1866    if (element == null)
1867      return;
1868    Complex t;
1869    if (Utilities.noString(parentType))
1870      t = parent;
1871    else {
1872      t = parent.predicate("fhir:" + parentType + '.' + name);
1873    }
1874    composeDomainResource(t, "Appointment", name, element, index);
1875    for (int i = 0; i < element.getIdentifier().size(); i++)
1876      composeIdentifier(t, "Appointment", "identifier", element.getIdentifier().get(i), i);
1877    if (element.hasStatusElement())
1878      composeEnum(t, "Appointment", "status", element.getStatusElement(), -1);
1879    if (element.hasCancelationReason())
1880      composeCodeableConcept(t, "Appointment", "cancelationReason", element.getCancelationReason(), -1);
1881    for (int i = 0; i < element.getServiceCategory().size(); i++)
1882      composeCodeableConcept(t, "Appointment", "serviceCategory", element.getServiceCategory().get(i), i);
1883    for (int i = 0; i < element.getServiceType().size(); i++)
1884      composeCodeableConcept(t, "Appointment", "serviceType", element.getServiceType().get(i), i);
1885    for (int i = 0; i < element.getSpecialty().size(); i++)
1886      composeCodeableConcept(t, "Appointment", "specialty", element.getSpecialty().get(i), i);
1887    if (element.hasAppointmentType())
1888      composeCodeableConcept(t, "Appointment", "appointmentType", element.getAppointmentType(), -1);
1889    for (int i = 0; i < element.getReasonCode().size(); i++)
1890      composeCodeableConcept(t, "Appointment", "reasonCode", element.getReasonCode().get(i), i);
1891    for (int i = 0; i < element.getReasonReference().size(); i++)
1892      composeReference(t, "Appointment", "reasonReference", element.getReasonReference().get(i), i);
1893    if (element.hasPriorityElement())
1894      composeUnsignedInt(t, "Appointment", "priority", element.getPriorityElement(), -1);
1895    if (element.hasDescriptionElement())
1896      composeString(t, "Appointment", "description", element.getDescriptionElement(), -1);
1897    for (int i = 0; i < element.getSupportingInformation().size(); i++)
1898      composeReference(t, "Appointment", "supportingInformation", element.getSupportingInformation().get(i), i);
1899    if (element.hasStartElement())
1900      composeInstant(t, "Appointment", "start", element.getStartElement(), -1);
1901    if (element.hasEndElement())
1902      composeInstant(t, "Appointment", "end", element.getEndElement(), -1);
1903    if (element.hasMinutesDurationElement())
1904      composePositiveInt(t, "Appointment", "minutesDuration", element.getMinutesDurationElement(), -1);
1905    for (int i = 0; i < element.getSlot().size(); i++)
1906      composeReference(t, "Appointment", "slot", element.getSlot().get(i), i);
1907    if (element.hasCreatedElement())
1908      composeDateTime(t, "Appointment", "created", element.getCreatedElement(), -1);
1909    if (element.hasCommentElement())
1910      composeString(t, "Appointment", "comment", element.getCommentElement(), -1);
1911    if (element.hasPatientInstructionElement())
1912      composeString(t, "Appointment", "patientInstruction", element.getPatientInstructionElement(), -1);
1913    for (int i = 0; i < element.getBasedOn().size(); i++)
1914      composeReference(t, "Appointment", "basedOn", element.getBasedOn().get(i), i);
1915    for (int i = 0; i < element.getParticipant().size(); i++)
1916      composeAppointmentAppointmentParticipantComponent(t, "Appointment", "participant",
1917          element.getParticipant().get(i), i);
1918    for (int i = 0; i < element.getRequestedPeriod().size(); i++)
1919      composePeriod(t, "Appointment", "requestedPeriod", element.getRequestedPeriod().get(i), i);
1920  }
1921
1922  protected void composeAppointmentAppointmentParticipantComponent(Complex parent, String parentType, String name,
1923      Appointment.AppointmentParticipantComponent element, int index) {
1924    if (element == null)
1925      return;
1926    Complex t;
1927    if (Utilities.noString(parentType))
1928      t = parent;
1929    else {
1930      t = parent.predicate("fhir:" + parentType + '.' + name);
1931    }
1932    composeBackboneElement(t, "participant", name, element, index);
1933    for (int i = 0; i < element.getType().size(); i++)
1934      composeCodeableConcept(t, "Appointment", "type", element.getType().get(i), i);
1935    if (element.hasActor())
1936      composeReference(t, "Appointment", "actor", element.getActor(), -1);
1937    if (element.hasRequiredElement())
1938      composeEnum(t, "Appointment", "required", element.getRequiredElement(), -1);
1939    if (element.hasStatusElement())
1940      composeEnum(t, "Appointment", "status", element.getStatusElement(), -1);
1941    if (element.hasPeriod())
1942      composePeriod(t, "Appointment", "period", element.getPeriod(), -1);
1943  }
1944
1945  protected void composeAppointmentResponse(Complex parent, String parentType, String name, AppointmentResponse element,
1946      int index) {
1947    if (element == null)
1948      return;
1949    Complex t;
1950    if (Utilities.noString(parentType))
1951      t = parent;
1952    else {
1953      t = parent.predicate("fhir:" + parentType + '.' + name);
1954    }
1955    composeDomainResource(t, "AppointmentResponse", name, element, index);
1956    for (int i = 0; i < element.getIdentifier().size(); i++)
1957      composeIdentifier(t, "AppointmentResponse", "identifier", element.getIdentifier().get(i), i);
1958    if (element.hasAppointment())
1959      composeReference(t, "AppointmentResponse", "appointment", element.getAppointment(), -1);
1960    if (element.hasStartElement())
1961      composeInstant(t, "AppointmentResponse", "start", element.getStartElement(), -1);
1962    if (element.hasEndElement())
1963      composeInstant(t, "AppointmentResponse", "end", element.getEndElement(), -1);
1964    for (int i = 0; i < element.getParticipantType().size(); i++)
1965      composeCodeableConcept(t, "AppointmentResponse", "participantType", element.getParticipantType().get(i), i);
1966    if (element.hasActor())
1967      composeReference(t, "AppointmentResponse", "actor", element.getActor(), -1);
1968    if (element.hasParticipantStatusElement())
1969      composeEnum(t, "AppointmentResponse", "participantStatus", element.getParticipantStatusElement(), -1);
1970    if (element.hasCommentElement())
1971      composeString(t, "AppointmentResponse", "comment", element.getCommentElement(), -1);
1972  }
1973
1974  protected void composeAuditEvent(Complex parent, String parentType, String name, AuditEvent element, int index) {
1975    if (element == null)
1976      return;
1977    Complex t;
1978    if (Utilities.noString(parentType))
1979      t = parent;
1980    else {
1981      t = parent.predicate("fhir:" + parentType + '.' + name);
1982    }
1983    composeDomainResource(t, "AuditEvent", name, element, index);
1984    if (element.hasType())
1985      composeCoding(t, "AuditEvent", "type", element.getType(), -1);
1986    for (int i = 0; i < element.getSubtype().size(); i++)
1987      composeCoding(t, "AuditEvent", "subtype", element.getSubtype().get(i), i);
1988    if (element.hasActionElement())
1989      composeEnum(t, "AuditEvent", "action", element.getActionElement(), -1);
1990    if (element.hasPeriod())
1991      composePeriod(t, "AuditEvent", "period", element.getPeriod(), -1);
1992    if (element.hasRecordedElement())
1993      composeInstant(t, "AuditEvent", "recorded", element.getRecordedElement(), -1);
1994    if (element.hasOutcomeElement())
1995      composeEnum(t, "AuditEvent", "outcome", element.getOutcomeElement(), -1);
1996    if (element.hasOutcomeDescElement())
1997      composeString(t, "AuditEvent", "outcomeDesc", element.getOutcomeDescElement(), -1);
1998    for (int i = 0; i < element.getPurposeOfEvent().size(); i++)
1999      composeCodeableConcept(t, "AuditEvent", "purposeOfEvent", element.getPurposeOfEvent().get(i), i);
2000    for (int i = 0; i < element.getAgent().size(); i++)
2001      composeAuditEventAuditEventAgentComponent(t, "AuditEvent", "agent", element.getAgent().get(i), i);
2002    if (element.hasSource())
2003      composeAuditEventAuditEventSourceComponent(t, "AuditEvent", "source", element.getSource(), -1);
2004    for (int i = 0; i < element.getEntity().size(); i++)
2005      composeAuditEventAuditEventEntityComponent(t, "AuditEvent", "entity", element.getEntity().get(i), i);
2006  }
2007
2008  protected void composeAuditEventAuditEventAgentComponent(Complex parent, String parentType, String name,
2009      AuditEvent.AuditEventAgentComponent element, int index) {
2010    if (element == null)
2011      return;
2012    Complex t;
2013    if (Utilities.noString(parentType))
2014      t = parent;
2015    else {
2016      t = parent.predicate("fhir:" + parentType + '.' + name);
2017    }
2018    composeBackboneElement(t, "agent", name, element, index);
2019    if (element.hasType())
2020      composeCodeableConcept(t, "AuditEvent", "type", element.getType(), -1);
2021    for (int i = 0; i < element.getRole().size(); i++)
2022      composeCodeableConcept(t, "AuditEvent", "role", element.getRole().get(i), i);
2023    if (element.hasWho())
2024      composeReference(t, "AuditEvent", "who", element.getWho(), -1);
2025    if (element.hasAltIdElement())
2026      composeString(t, "AuditEvent", "altId", element.getAltIdElement(), -1);
2027    if (element.hasNameElement())
2028      composeString(t, "AuditEvent", "name", element.getNameElement(), -1);
2029    if (element.hasRequestorElement())
2030      composeBoolean(t, "AuditEvent", "requestor", element.getRequestorElement(), -1);
2031    if (element.hasLocation())
2032      composeReference(t, "AuditEvent", "location", element.getLocation(), -1);
2033    for (int i = 0; i < element.getPolicy().size(); i++)
2034      composeUri(t, "AuditEvent", "policy", element.getPolicy().get(i), i);
2035    if (element.hasMedia())
2036      composeCoding(t, "AuditEvent", "media", element.getMedia(), -1);
2037    if (element.hasNetwork())
2038      composeAuditEventAuditEventAgentNetworkComponent(t, "AuditEvent", "network", element.getNetwork(), -1);
2039    for (int i = 0; i < element.getPurposeOfUse().size(); i++)
2040      composeCodeableConcept(t, "AuditEvent", "purposeOfUse", element.getPurposeOfUse().get(i), i);
2041  }
2042
2043  protected void composeAuditEventAuditEventAgentNetworkComponent(Complex parent, String parentType, String name,
2044      AuditEvent.AuditEventAgentNetworkComponent element, int index) {
2045    if (element == null)
2046      return;
2047    Complex t;
2048    if (Utilities.noString(parentType))
2049      t = parent;
2050    else {
2051      t = parent.predicate("fhir:" + parentType + '.' + name);
2052    }
2053    composeBackboneElement(t, "network", name, element, index);
2054    if (element.hasAddressElement())
2055      composeString(t, "AuditEvent", "address", element.getAddressElement(), -1);
2056    if (element.hasTypeElement())
2057      composeEnum(t, "AuditEvent", "type", element.getTypeElement(), -1);
2058  }
2059
2060  protected void composeAuditEventAuditEventSourceComponent(Complex parent, String parentType, String name,
2061      AuditEvent.AuditEventSourceComponent element, int index) {
2062    if (element == null)
2063      return;
2064    Complex t;
2065    if (Utilities.noString(parentType))
2066      t = parent;
2067    else {
2068      t = parent.predicate("fhir:" + parentType + '.' + name);
2069    }
2070    composeBackboneElement(t, "source", name, element, index);
2071    if (element.hasSiteElement())
2072      composeString(t, "AuditEvent", "site", element.getSiteElement(), -1);
2073    if (element.hasObserver())
2074      composeReference(t, "AuditEvent", "observer", element.getObserver(), -1);
2075    for (int i = 0; i < element.getType().size(); i++)
2076      composeCoding(t, "AuditEvent", "type", element.getType().get(i), i);
2077  }
2078
2079  protected void composeAuditEventAuditEventEntityComponent(Complex parent, String parentType, String name,
2080      AuditEvent.AuditEventEntityComponent element, int index) {
2081    if (element == null)
2082      return;
2083    Complex t;
2084    if (Utilities.noString(parentType))
2085      t = parent;
2086    else {
2087      t = parent.predicate("fhir:" + parentType + '.' + name);
2088    }
2089    composeBackboneElement(t, "entity", name, element, index);
2090    if (element.hasWhat())
2091      composeReference(t, "AuditEvent", "what", element.getWhat(), -1);
2092    if (element.hasType())
2093      composeCoding(t, "AuditEvent", "type", element.getType(), -1);
2094    if (element.hasRole())
2095      composeCoding(t, "AuditEvent", "role", element.getRole(), -1);
2096    if (element.hasLifecycle())
2097      composeCoding(t, "AuditEvent", "lifecycle", element.getLifecycle(), -1);
2098    for (int i = 0; i < element.getSecurityLabel().size(); i++)
2099      composeCoding(t, "AuditEvent", "securityLabel", element.getSecurityLabel().get(i), i);
2100    if (element.hasNameElement())
2101      composeString(t, "AuditEvent", "name", element.getNameElement(), -1);
2102    if (element.hasDescriptionElement())
2103      composeString(t, "AuditEvent", "description", element.getDescriptionElement(), -1);
2104    if (element.hasQueryElement())
2105      composeBase64Binary(t, "AuditEvent", "query", element.getQueryElement(), -1);
2106    for (int i = 0; i < element.getDetail().size(); i++)
2107      composeAuditEventAuditEventEntityDetailComponent(t, "AuditEvent", "detail", element.getDetail().get(i), i);
2108  }
2109
2110  protected void composeAuditEventAuditEventEntityDetailComponent(Complex parent, String parentType, String name,
2111      AuditEvent.AuditEventEntityDetailComponent element, int index) {
2112    if (element == null)
2113      return;
2114    Complex t;
2115    if (Utilities.noString(parentType))
2116      t = parent;
2117    else {
2118      t = parent.predicate("fhir:" + parentType + '.' + name);
2119    }
2120    composeBackboneElement(t, "detail", name, element, index);
2121    if (element.hasTypeElement())
2122      composeString(t, "AuditEvent", "type", element.getTypeElement(), -1);
2123    if (element.hasValue())
2124      composeType(t, "AuditEvent", "value", element.getValue(), -1);
2125  }
2126
2127  protected void composeBasic(Complex parent, String parentType, String name, Basic element, int index) {
2128    if (element == null)
2129      return;
2130    Complex t;
2131    if (Utilities.noString(parentType))
2132      t = parent;
2133    else {
2134      t = parent.predicate("fhir:" + parentType + '.' + name);
2135    }
2136    composeDomainResource(t, "Basic", name, element, index);
2137    for (int i = 0; i < element.getIdentifier().size(); i++)
2138      composeIdentifier(t, "Basic", "identifier", element.getIdentifier().get(i), i);
2139    if (element.hasCode())
2140      composeCodeableConcept(t, "Basic", "code", element.getCode(), -1);
2141    if (element.hasSubject())
2142      composeReference(t, "Basic", "subject", element.getSubject(), -1);
2143    if (element.hasCreatedElement())
2144      composeDate(t, "Basic", "created", element.getCreatedElement(), -1);
2145    if (element.hasAuthor())
2146      composeReference(t, "Basic", "author", element.getAuthor(), -1);
2147  }
2148
2149  protected void composeBinary(Complex parent, String parentType, String name, Binary element, int index) {
2150    if (element == null)
2151      return;
2152    Complex t;
2153    if (Utilities.noString(parentType))
2154      t = parent;
2155    else {
2156      t = parent.predicate("fhir:" + parentType + '.' + name);
2157    }
2158    composeResource(t, "Binary", name, element, index);
2159    if (element.hasContentTypeElement())
2160      composeCode(t, "Binary", "contentType", element.getContentTypeElement(), -1);
2161    if (element.hasSecurityContext())
2162      composeReference(t, "Binary", "securityContext", element.getSecurityContext(), -1);
2163    if (element.hasDataElement())
2164      composeBase64Binary(t, "Binary", "data", element.getDataElement(), -1);
2165  }
2166
2167  protected void composeBiologicallyDerivedProduct(Complex parent, String parentType, String name,
2168      BiologicallyDerivedProduct element, int index) {
2169    if (element == null)
2170      return;
2171    Complex t;
2172    if (Utilities.noString(parentType))
2173      t = parent;
2174    else {
2175      t = parent.predicate("fhir:" + parentType + '.' + name);
2176    }
2177    composeDomainResource(t, "BiologicallyDerivedProduct", name, element, index);
2178    for (int i = 0; i < element.getIdentifier().size(); i++)
2179      composeIdentifier(t, "BiologicallyDerivedProduct", "identifier", element.getIdentifier().get(i), i);
2180    if (element.hasProductCategoryElement())
2181      composeEnum(t, "BiologicallyDerivedProduct", "productCategory", element.getProductCategoryElement(), -1);
2182    if (element.hasProductCode())
2183      composeCodeableConcept(t, "BiologicallyDerivedProduct", "productCode", element.getProductCode(), -1);
2184    if (element.hasStatusElement())
2185      composeEnum(t, "BiologicallyDerivedProduct", "status", element.getStatusElement(), -1);
2186    for (int i = 0; i < element.getRequest().size(); i++)
2187      composeReference(t, "BiologicallyDerivedProduct", "request", element.getRequest().get(i), i);
2188    if (element.hasQuantityElement())
2189      composeInteger(t, "BiologicallyDerivedProduct", "quantity", element.getQuantityElement(), -1);
2190    for (int i = 0; i < element.getParent().size(); i++)
2191      composeReference(t, "BiologicallyDerivedProduct", "parent", element.getParent().get(i), i);
2192    if (element.hasCollection())
2193      composeBiologicallyDerivedProductBiologicallyDerivedProductCollectionComponent(t, "BiologicallyDerivedProduct",
2194          "collection", element.getCollection(), -1);
2195    for (int i = 0; i < element.getProcessing().size(); i++)
2196      composeBiologicallyDerivedProductBiologicallyDerivedProductProcessingComponent(t, "BiologicallyDerivedProduct",
2197          "processing", element.getProcessing().get(i), i);
2198    if (element.hasManipulation())
2199      composeBiologicallyDerivedProductBiologicallyDerivedProductManipulationComponent(t, "BiologicallyDerivedProduct",
2200          "manipulation", element.getManipulation(), -1);
2201    for (int i = 0; i < element.getStorage().size(); i++)
2202      composeBiologicallyDerivedProductBiologicallyDerivedProductStorageComponent(t, "BiologicallyDerivedProduct",
2203          "storage", element.getStorage().get(i), i);
2204  }
2205
2206  protected void composeBiologicallyDerivedProductBiologicallyDerivedProductCollectionComponent(Complex parent,
2207      String parentType, String name, BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent element,
2208      int index) {
2209    if (element == null)
2210      return;
2211    Complex t;
2212    if (Utilities.noString(parentType))
2213      t = parent;
2214    else {
2215      t = parent.predicate("fhir:" + parentType + '.' + name);
2216    }
2217    composeBackboneElement(t, "collection", name, element, index);
2218    if (element.hasCollector())
2219      composeReference(t, "BiologicallyDerivedProduct", "collector", element.getCollector(), -1);
2220    if (element.hasSource())
2221      composeReference(t, "BiologicallyDerivedProduct", "source", element.getSource(), -1);
2222    if (element.hasCollected())
2223      composeType(t, "BiologicallyDerivedProduct", "collected", element.getCollected(), -1);
2224  }
2225
2226  protected void composeBiologicallyDerivedProductBiologicallyDerivedProductProcessingComponent(Complex parent,
2227      String parentType, String name, BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent element,
2228      int index) {
2229    if (element == null)
2230      return;
2231    Complex t;
2232    if (Utilities.noString(parentType))
2233      t = parent;
2234    else {
2235      t = parent.predicate("fhir:" + parentType + '.' + name);
2236    }
2237    composeBackboneElement(t, "processing", name, element, index);
2238    if (element.hasDescriptionElement())
2239      composeString(t, "BiologicallyDerivedProduct", "description", element.getDescriptionElement(), -1);
2240    if (element.hasProcedure())
2241      composeCodeableConcept(t, "BiologicallyDerivedProduct", "procedure", element.getProcedure(), -1);
2242    if (element.hasAdditive())
2243      composeReference(t, "BiologicallyDerivedProduct", "additive", element.getAdditive(), -1);
2244    if (element.hasTime())
2245      composeType(t, "BiologicallyDerivedProduct", "time", element.getTime(), -1);
2246  }
2247
2248  protected void composeBiologicallyDerivedProductBiologicallyDerivedProductManipulationComponent(Complex parent,
2249      String parentType, String name,
2250      BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent element, int index) {
2251    if (element == null)
2252      return;
2253    Complex t;
2254    if (Utilities.noString(parentType))
2255      t = parent;
2256    else {
2257      t = parent.predicate("fhir:" + parentType + '.' + name);
2258    }
2259    composeBackboneElement(t, "manipulation", name, element, index);
2260    if (element.hasDescriptionElement())
2261      composeString(t, "BiologicallyDerivedProduct", "description", element.getDescriptionElement(), -1);
2262    if (element.hasTime())
2263      composeType(t, "BiologicallyDerivedProduct", "time", element.getTime(), -1);
2264  }
2265
2266  protected void composeBiologicallyDerivedProductBiologicallyDerivedProductStorageComponent(Complex parent,
2267      String parentType, String name, BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent element,
2268      int index) {
2269    if (element == null)
2270      return;
2271    Complex t;
2272    if (Utilities.noString(parentType))
2273      t = parent;
2274    else {
2275      t = parent.predicate("fhir:" + parentType + '.' + name);
2276    }
2277    composeBackboneElement(t, "storage", name, element, index);
2278    if (element.hasDescriptionElement())
2279      composeString(t, "BiologicallyDerivedProduct", "description", element.getDescriptionElement(), -1);
2280    if (element.hasTemperatureElement())
2281      composeDecimal(t, "BiologicallyDerivedProduct", "temperature", element.getTemperatureElement(), -1);
2282    if (element.hasScaleElement())
2283      composeEnum(t, "BiologicallyDerivedProduct", "scale", element.getScaleElement(), -1);
2284    if (element.hasDuration())
2285      composePeriod(t, "BiologicallyDerivedProduct", "duration", element.getDuration(), -1);
2286  }
2287
2288  protected void composeBodyStructure(Complex parent, String parentType, String name, BodyStructure element,
2289      int index) {
2290    if (element == null)
2291      return;
2292    Complex t;
2293    if (Utilities.noString(parentType))
2294      t = parent;
2295    else {
2296      t = parent.predicate("fhir:" + parentType + '.' + name);
2297    }
2298    composeDomainResource(t, "BodyStructure", name, element, index);
2299    for (int i = 0; i < element.getIdentifier().size(); i++)
2300      composeIdentifier(t, "BodyStructure", "identifier", element.getIdentifier().get(i), i);
2301    if (element.hasActiveElement())
2302      composeBoolean(t, "BodyStructure", "active", element.getActiveElement(), -1);
2303    if (element.hasMorphology())
2304      composeCodeableConcept(t, "BodyStructure", "morphology", element.getMorphology(), -1);
2305    if (element.hasLocation())
2306      composeCodeableConcept(t, "BodyStructure", "location", element.getLocation(), -1);
2307    for (int i = 0; i < element.getLocationQualifier().size(); i++)
2308      composeCodeableConcept(t, "BodyStructure", "locationQualifier", element.getLocationQualifier().get(i), i);
2309    if (element.hasDescriptionElement())
2310      composeString(t, "BodyStructure", "description", element.getDescriptionElement(), -1);
2311    for (int i = 0; i < element.getImage().size(); i++)
2312      composeAttachment(t, "BodyStructure", "image", element.getImage().get(i), i);
2313    if (element.hasPatient())
2314      composeReference(t, "BodyStructure", "patient", element.getPatient(), -1);
2315  }
2316
2317  protected void composeBundle(Complex parent, String parentType, String name, Bundle element, int index) {
2318    if (element == null)
2319      return;
2320    Complex t;
2321    if (Utilities.noString(parentType))
2322      t = parent;
2323    else {
2324      t = parent.predicate("fhir:" + parentType + '.' + name);
2325    }
2326    composeResource(t, "Bundle", name, element, index);
2327    if (element.hasIdentifier())
2328      composeIdentifier(t, "Bundle", "identifier", element.getIdentifier(), -1);
2329    if (element.hasTypeElement())
2330      composeEnum(t, "Bundle", "type", element.getTypeElement(), -1);
2331    if (element.hasTimestampElement())
2332      composeInstant(t, "Bundle", "timestamp", element.getTimestampElement(), -1);
2333    if (element.hasTotalElement())
2334      composeUnsignedInt(t, "Bundle", "total", element.getTotalElement(), -1);
2335    for (int i = 0; i < element.getLink().size(); i++)
2336      composeBundleBundleLinkComponent(t, "Bundle", "link", element.getLink().get(i), i);
2337    for (int i = 0; i < element.getEntry().size(); i++)
2338      composeBundleBundleEntryComponent(t, "Bundle", "entry", element.getEntry().get(i), i);
2339    if (element.hasSignature())
2340      composeSignature(t, "Bundle", "signature", element.getSignature(), -1);
2341  }
2342
2343  protected void composeBundleBundleLinkComponent(Complex parent, String parentType, String name,
2344      Bundle.BundleLinkComponent element, int index) {
2345    if (element == null)
2346      return;
2347    Complex t;
2348    if (Utilities.noString(parentType))
2349      t = parent;
2350    else {
2351      t = parent.predicate("fhir:" + parentType + '.' + name);
2352    }
2353    composeBackboneElement(t, "link", name, element, index);
2354    if (element.hasRelationElement())
2355      composeString(t, "Bundle", "relation", element.getRelationElement(), -1);
2356    if (element.hasUrlElement())
2357      composeUri(t, "Bundle", "url", element.getUrlElement(), -1);
2358  }
2359
2360  protected void composeBundleBundleEntryComponent(Complex parent, String parentType, String name,
2361      Bundle.BundleEntryComponent element, int index) {
2362    if (element == null)
2363      return;
2364    Complex t;
2365    if (Utilities.noString(parentType))
2366      t = parent;
2367    else {
2368      t = parent.predicate("fhir:" + parentType + '.' + name);
2369    }
2370    composeBackboneElement(t, "entry", name, element, index);
2371    for (int i = 0; i < element.getLink().size(); i++)
2372      composeBundleBundleLinkComponent(t, "Bundle", "link", element.getLink().get(i), i);
2373    if (element.hasFullUrlElement())
2374      composeUri(t, "Bundle", "fullUrl", element.getFullUrlElement(), -1);
2375    if (element.hasResource())
2376      composeResource(t, "Bundle", "resource", element.getResource(), -1);
2377    if (element.hasSearch())
2378      composeBundleBundleEntrySearchComponent(t, "Bundle", "search", element.getSearch(), -1);
2379    if (element.hasRequest())
2380      composeBundleBundleEntryRequestComponent(t, "Bundle", "request", element.getRequest(), -1);
2381    if (element.hasResponse())
2382      composeBundleBundleEntryResponseComponent(t, "Bundle", "response", element.getResponse(), -1);
2383  }
2384
2385  protected void composeBundleBundleEntrySearchComponent(Complex parent, String parentType, String name,
2386      Bundle.BundleEntrySearchComponent element, int index) {
2387    if (element == null)
2388      return;
2389    Complex t;
2390    if (Utilities.noString(parentType))
2391      t = parent;
2392    else {
2393      t = parent.predicate("fhir:" + parentType + '.' + name);
2394    }
2395    composeBackboneElement(t, "search", name, element, index);
2396    if (element.hasModeElement())
2397      composeEnum(t, "Bundle", "mode", element.getModeElement(), -1);
2398    if (element.hasScoreElement())
2399      composeDecimal(t, "Bundle", "score", element.getScoreElement(), -1);
2400  }
2401
2402  protected void composeBundleBundleEntryRequestComponent(Complex parent, String parentType, String name,
2403      Bundle.BundleEntryRequestComponent element, int index) {
2404    if (element == null)
2405      return;
2406    Complex t;
2407    if (Utilities.noString(parentType))
2408      t = parent;
2409    else {
2410      t = parent.predicate("fhir:" + parentType + '.' + name);
2411    }
2412    composeBackboneElement(t, "request", name, element, index);
2413    if (element.hasMethodElement())
2414      composeEnum(t, "Bundle", "method", element.getMethodElement(), -1);
2415    if (element.hasUrlElement())
2416      composeUri(t, "Bundle", "url", element.getUrlElement(), -1);
2417    if (element.hasIfNoneMatchElement())
2418      composeString(t, "Bundle", "ifNoneMatch", element.getIfNoneMatchElement(), -1);
2419    if (element.hasIfModifiedSinceElement())
2420      composeInstant(t, "Bundle", "ifModifiedSince", element.getIfModifiedSinceElement(), -1);
2421    if (element.hasIfMatchElement())
2422      composeString(t, "Bundle", "ifMatch", element.getIfMatchElement(), -1);
2423    if (element.hasIfNoneExistElement())
2424      composeString(t, "Bundle", "ifNoneExist", element.getIfNoneExistElement(), -1);
2425  }
2426
2427  protected void composeBundleBundleEntryResponseComponent(Complex parent, String parentType, String name,
2428      Bundle.BundleEntryResponseComponent element, int index) {
2429    if (element == null)
2430      return;
2431    Complex t;
2432    if (Utilities.noString(parentType))
2433      t = parent;
2434    else {
2435      t = parent.predicate("fhir:" + parentType + '.' + name);
2436    }
2437    composeBackboneElement(t, "response", name, element, index);
2438    if (element.hasStatusElement())
2439      composeString(t, "Bundle", "status", element.getStatusElement(), -1);
2440    if (element.hasLocationElement())
2441      composeUri(t, "Bundle", "location", element.getLocationElement(), -1);
2442    if (element.hasEtagElement())
2443      composeString(t, "Bundle", "etag", element.getEtagElement(), -1);
2444    if (element.hasLastModifiedElement())
2445      composeInstant(t, "Bundle", "lastModified", element.getLastModifiedElement(), -1);
2446    if (element.hasOutcome())
2447      composeResource(t, "Bundle", "outcome", element.getOutcome(), -1);
2448  }
2449
2450  protected void composeCapabilityStatement(Complex parent, String parentType, String name, CapabilityStatement element,
2451      int index) {
2452    if (element == null)
2453      return;
2454    Complex t;
2455    if (Utilities.noString(parentType))
2456      t = parent;
2457    else {
2458      t = parent.predicate("fhir:" + parentType + '.' + name);
2459    }
2460    composeDomainResource(t, "CapabilityStatement", name, element, index);
2461    if (element.hasUrlElement())
2462      composeUri(t, "CapabilityStatement", "url", element.getUrlElement(), -1);
2463    if (element.hasVersionElement())
2464      composeString(t, "CapabilityStatement", "version", element.getVersionElement(), -1);
2465    if (element.hasNameElement())
2466      composeString(t, "CapabilityStatement", "name", element.getNameElement(), -1);
2467    if (element.hasTitleElement())
2468      composeString(t, "CapabilityStatement", "title", element.getTitleElement(), -1);
2469    if (element.hasStatusElement())
2470      composeEnum(t, "CapabilityStatement", "status", element.getStatusElement(), -1);
2471    if (element.hasExperimentalElement())
2472      composeBoolean(t, "CapabilityStatement", "experimental", element.getExperimentalElement(), -1);
2473    if (element.hasDateElement())
2474      composeDateTime(t, "CapabilityStatement", "date", element.getDateElement(), -1);
2475    if (element.hasPublisherElement())
2476      composeString(t, "CapabilityStatement", "publisher", element.getPublisherElement(), -1);
2477    for (int i = 0; i < element.getContact().size(); i++)
2478      composeContactDetail(t, "CapabilityStatement", "contact", element.getContact().get(i), i);
2479    if (element.hasDescriptionElement())
2480      composeMarkdown(t, "CapabilityStatement", "description", element.getDescriptionElement(), -1);
2481    for (int i = 0; i < element.getUseContext().size(); i++)
2482      composeUsageContext(t, "CapabilityStatement", "useContext", element.getUseContext().get(i), i);
2483    for (int i = 0; i < element.getJurisdiction().size(); i++)
2484      composeCodeableConcept(t, "CapabilityStatement", "jurisdiction", element.getJurisdiction().get(i), i);
2485    if (element.hasPurposeElement())
2486      composeMarkdown(t, "CapabilityStatement", "purpose", element.getPurposeElement(), -1);
2487    if (element.hasCopyrightElement())
2488      composeMarkdown(t, "CapabilityStatement", "copyright", element.getCopyrightElement(), -1);
2489    if (element.hasKindElement())
2490      composeEnum(t, "CapabilityStatement", "kind", element.getKindElement(), -1);
2491    for (int i = 0; i < element.getInstantiates().size(); i++)
2492      composeCanonical(t, "CapabilityStatement", "instantiates", element.getInstantiates().get(i), i);
2493    for (int i = 0; i < element.getImports().size(); i++)
2494      composeCanonical(t, "CapabilityStatement", "imports", element.getImports().get(i), i);
2495    if (element.hasSoftware())
2496      composeCapabilityStatementCapabilityStatementSoftwareComponent(t, "CapabilityStatement", "software",
2497          element.getSoftware(), -1);
2498    if (element.hasImplementation())
2499      composeCapabilityStatementCapabilityStatementImplementationComponent(t, "CapabilityStatement", "implementation",
2500          element.getImplementation(), -1);
2501    if (element.hasFhirVersionElement())
2502      composeEnum(t, "CapabilityStatement", "fhirVersion", element.getFhirVersionElement(), -1);
2503    for (int i = 0; i < element.getFormat().size(); i++)
2504      composeCode(t, "CapabilityStatement", "format", element.getFormat().get(i), i);
2505    for (int i = 0; i < element.getPatchFormat().size(); i++)
2506      composeCode(t, "CapabilityStatement", "patchFormat", element.getPatchFormat().get(i), i);
2507    for (int i = 0; i < element.getImplementationGuide().size(); i++)
2508      composeCanonical(t, "CapabilityStatement", "implementationGuide", element.getImplementationGuide().get(i), i);
2509    for (int i = 0; i < element.getRest().size(); i++)
2510      composeCapabilityStatementCapabilityStatementRestComponent(t, "CapabilityStatement", "rest",
2511          element.getRest().get(i), i);
2512    for (int i = 0; i < element.getMessaging().size(); i++)
2513      composeCapabilityStatementCapabilityStatementMessagingComponent(t, "CapabilityStatement", "messaging",
2514          element.getMessaging().get(i), i);
2515    for (int i = 0; i < element.getDocument().size(); i++)
2516      composeCapabilityStatementCapabilityStatementDocumentComponent(t, "CapabilityStatement", "document",
2517          element.getDocument().get(i), i);
2518  }
2519
2520  protected void composeCapabilityStatementCapabilityStatementSoftwareComponent(Complex parent, String parentType,
2521      String name, CapabilityStatement.CapabilityStatementSoftwareComponent element, int index) {
2522    if (element == null)
2523      return;
2524    Complex t;
2525    if (Utilities.noString(parentType))
2526      t = parent;
2527    else {
2528      t = parent.predicate("fhir:" + parentType + '.' + name);
2529    }
2530    composeBackboneElement(t, "software", name, element, index);
2531    if (element.hasNameElement())
2532      composeString(t, "CapabilityStatement", "name", element.getNameElement(), -1);
2533    if (element.hasVersionElement())
2534      composeString(t, "CapabilityStatement", "version", element.getVersionElement(), -1);
2535    if (element.hasReleaseDateElement())
2536      composeDateTime(t, "CapabilityStatement", "releaseDate", element.getReleaseDateElement(), -1);
2537  }
2538
2539  protected void composeCapabilityStatementCapabilityStatementImplementationComponent(Complex parent, String parentType,
2540      String name, CapabilityStatement.CapabilityStatementImplementationComponent element, int index) {
2541    if (element == null)
2542      return;
2543    Complex t;
2544    if (Utilities.noString(parentType))
2545      t = parent;
2546    else {
2547      t = parent.predicate("fhir:" + parentType + '.' + name);
2548    }
2549    composeBackboneElement(t, "implementation", name, element, index);
2550    if (element.hasDescriptionElement())
2551      composeString(t, "CapabilityStatement", "description", element.getDescriptionElement(), -1);
2552    if (element.hasUrlElement())
2553      composeUrl(t, "CapabilityStatement", "url", element.getUrlElement(), -1);
2554    if (element.hasCustodian())
2555      composeReference(t, "CapabilityStatement", "custodian", element.getCustodian(), -1);
2556  }
2557
2558  protected void composeCapabilityStatementCapabilityStatementRestComponent(Complex parent, String parentType,
2559      String name, CapabilityStatement.CapabilityStatementRestComponent element, int index) {
2560    if (element == null)
2561      return;
2562    Complex t;
2563    if (Utilities.noString(parentType))
2564      t = parent;
2565    else {
2566      t = parent.predicate("fhir:" + parentType + '.' + name);
2567    }
2568    composeBackboneElement(t, "rest", name, element, index);
2569    if (element.hasModeElement())
2570      composeEnum(t, "CapabilityStatement", "mode", element.getModeElement(), -1);
2571    if (element.hasDocumentationElement())
2572      composeMarkdown(t, "CapabilityStatement", "documentation", element.getDocumentationElement(), -1);
2573    if (element.hasSecurity())
2574      composeCapabilityStatementCapabilityStatementRestSecurityComponent(t, "CapabilityStatement", "security",
2575          element.getSecurity(), -1);
2576    for (int i = 0; i < element.getResource().size(); i++)
2577      composeCapabilityStatementCapabilityStatementRestResourceComponent(t, "CapabilityStatement", "resource",
2578          element.getResource().get(i), i);
2579    for (int i = 0; i < element.getInteraction().size(); i++)
2580      composeCapabilityStatementSystemInteractionComponent(t, "CapabilityStatement", "interaction",
2581          element.getInteraction().get(i), i);
2582    for (int i = 0; i < element.getSearchParam().size(); i++)
2583      composeCapabilityStatementCapabilityStatementRestResourceSearchParamComponent(t, "CapabilityStatement",
2584          "searchParam", element.getSearchParam().get(i), i);
2585    for (int i = 0; i < element.getOperation().size(); i++)
2586      composeCapabilityStatementCapabilityStatementRestResourceOperationComponent(t, "CapabilityStatement", "operation",
2587          element.getOperation().get(i), i);
2588    for (int i = 0; i < element.getCompartment().size(); i++)
2589      composeCanonical(t, "CapabilityStatement", "compartment", element.getCompartment().get(i), i);
2590  }
2591
2592  protected void composeCapabilityStatementCapabilityStatementRestSecurityComponent(Complex parent, String parentType,
2593      String name, CapabilityStatement.CapabilityStatementRestSecurityComponent element, int index) {
2594    if (element == null)
2595      return;
2596    Complex t;
2597    if (Utilities.noString(parentType))
2598      t = parent;
2599    else {
2600      t = parent.predicate("fhir:" + parentType + '.' + name);
2601    }
2602    composeBackboneElement(t, "security", name, element, index);
2603    if (element.hasCorsElement())
2604      composeBoolean(t, "CapabilityStatement", "cors", element.getCorsElement(), -1);
2605    for (int i = 0; i < element.getService().size(); i++)
2606      composeCodeableConcept(t, "CapabilityStatement", "service", element.getService().get(i), i);
2607    if (element.hasDescriptionElement())
2608      composeMarkdown(t, "CapabilityStatement", "description", element.getDescriptionElement(), -1);
2609  }
2610
2611  protected void composeCapabilityStatementCapabilityStatementRestResourceComponent(Complex parent, String parentType,
2612      String name, CapabilityStatement.CapabilityStatementRestResourceComponent element, int index) {
2613    if (element == null)
2614      return;
2615    Complex t;
2616    if (Utilities.noString(parentType))
2617      t = parent;
2618    else {
2619      t = parent.predicate("fhir:" + parentType + '.' + name);
2620    }
2621    composeBackboneElement(t, "resource", name, element, index);
2622    if (element.hasTypeElement())
2623      composeCode(t, "CapabilityStatement", "type", element.getTypeElement(), -1);
2624    if (element.hasProfileElement())
2625      composeCanonical(t, "CapabilityStatement", "profile", element.getProfileElement(), -1);
2626    for (int i = 0; i < element.getSupportedProfile().size(); i++)
2627      composeCanonical(t, "CapabilityStatement", "supportedProfile", element.getSupportedProfile().get(i), i);
2628    if (element.hasDocumentationElement())
2629      composeMarkdown(t, "CapabilityStatement", "documentation", element.getDocumentationElement(), -1);
2630    for (int i = 0; i < element.getInteraction().size(); i++)
2631      composeCapabilityStatementResourceInteractionComponent(t, "CapabilityStatement", "interaction",
2632          element.getInteraction().get(i), i);
2633    if (element.hasVersioningElement())
2634      composeEnum(t, "CapabilityStatement", "versioning", element.getVersioningElement(), -1);
2635    if (element.hasReadHistoryElement())
2636      composeBoolean(t, "CapabilityStatement", "readHistory", element.getReadHistoryElement(), -1);
2637    if (element.hasUpdateCreateElement())
2638      composeBoolean(t, "CapabilityStatement", "updateCreate", element.getUpdateCreateElement(), -1);
2639    if (element.hasConditionalCreateElement())
2640      composeBoolean(t, "CapabilityStatement", "conditionalCreate", element.getConditionalCreateElement(), -1);
2641    if (element.hasConditionalReadElement())
2642      composeEnum(t, "CapabilityStatement", "conditionalRead", element.getConditionalReadElement(), -1);
2643    if (element.hasConditionalUpdateElement())
2644      composeBoolean(t, "CapabilityStatement", "conditionalUpdate", element.getConditionalUpdateElement(), -1);
2645    if (element.hasConditionalDeleteElement())
2646      composeEnum(t, "CapabilityStatement", "conditionalDelete", element.getConditionalDeleteElement(), -1);
2647    for (int i = 0; i < element.getReferencePolicy().size(); i++)
2648      composeEnum(t, "CapabilityStatement", "referencePolicy", element.getReferencePolicy().get(i), i);
2649    for (int i = 0; i < element.getSearchInclude().size(); i++)
2650      composeString(t, "CapabilityStatement", "searchInclude", element.getSearchInclude().get(i), i);
2651    for (int i = 0; i < element.getSearchRevInclude().size(); i++)
2652      composeString(t, "CapabilityStatement", "searchRevInclude", element.getSearchRevInclude().get(i), i);
2653    for (int i = 0; i < element.getSearchParam().size(); i++)
2654      composeCapabilityStatementCapabilityStatementRestResourceSearchParamComponent(t, "CapabilityStatement",
2655          "searchParam", element.getSearchParam().get(i), i);
2656    for (int i = 0; i < element.getOperation().size(); i++)
2657      composeCapabilityStatementCapabilityStatementRestResourceOperationComponent(t, "CapabilityStatement", "operation",
2658          element.getOperation().get(i), i);
2659  }
2660
2661  protected void composeCapabilityStatementResourceInteractionComponent(Complex parent, String parentType, String name,
2662      CapabilityStatement.ResourceInteractionComponent element, int index) {
2663    if (element == null)
2664      return;
2665    Complex t;
2666    if (Utilities.noString(parentType))
2667      t = parent;
2668    else {
2669      t = parent.predicate("fhir:" + parentType + '.' + name);
2670    }
2671    composeBackboneElement(t, "interaction", name, element, index);
2672    if (element.hasCodeElement())
2673      composeEnum(t, "CapabilityStatement", "code", element.getCodeElement(), -1);
2674    if (element.hasDocumentationElement())
2675      composeMarkdown(t, "CapabilityStatement", "documentation", element.getDocumentationElement(), -1);
2676  }
2677
2678  protected void composeCapabilityStatementCapabilityStatementRestResourceSearchParamComponent(Complex parent,
2679      String parentType, String name, CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent element,
2680      int index) {
2681    if (element == null)
2682      return;
2683    Complex t;
2684    if (Utilities.noString(parentType))
2685      t = parent;
2686    else {
2687      t = parent.predicate("fhir:" + parentType + '.' + name);
2688    }
2689    composeBackboneElement(t, "searchParam", name, element, index);
2690    if (element.hasNameElement())
2691      composeString(t, "CapabilityStatement", "name", element.getNameElement(), -1);
2692    if (element.hasDefinitionElement())
2693      composeCanonical(t, "CapabilityStatement", "definition", element.getDefinitionElement(), -1);
2694    if (element.hasTypeElement())
2695      composeEnum(t, "CapabilityStatement", "type", element.getTypeElement(), -1);
2696    if (element.hasDocumentationElement())
2697      composeMarkdown(t, "CapabilityStatement", "documentation", element.getDocumentationElement(), -1);
2698  }
2699
2700  protected void composeCapabilityStatementCapabilityStatementRestResourceOperationComponent(Complex parent,
2701      String parentType, String name, CapabilityStatement.CapabilityStatementRestResourceOperationComponent element,
2702      int index) {
2703    if (element == null)
2704      return;
2705    Complex t;
2706    if (Utilities.noString(parentType))
2707      t = parent;
2708    else {
2709      t = parent.predicate("fhir:" + parentType + '.' + name);
2710    }
2711    composeBackboneElement(t, "operation", name, element, index);
2712    if (element.hasNameElement())
2713      composeString(t, "CapabilityStatement", "name", element.getNameElement(), -1);
2714    if (element.hasDefinitionElement())
2715      composeCanonical(t, "CapabilityStatement", "definition", element.getDefinitionElement(), -1);
2716    if (element.hasDocumentationElement())
2717      composeMarkdown(t, "CapabilityStatement", "documentation", element.getDocumentationElement(), -1);
2718  }
2719
2720  protected void composeCapabilityStatementSystemInteractionComponent(Complex parent, String parentType, String name,
2721      CapabilityStatement.SystemInteractionComponent element, int index) {
2722    if (element == null)
2723      return;
2724    Complex t;
2725    if (Utilities.noString(parentType))
2726      t = parent;
2727    else {
2728      t = parent.predicate("fhir:" + parentType + '.' + name);
2729    }
2730    composeBackboneElement(t, "interaction", name, element, index);
2731    if (element.hasCodeElement())
2732      composeEnum(t, "CapabilityStatement", "code", element.getCodeElement(), -1);
2733    if (element.hasDocumentationElement())
2734      composeMarkdown(t, "CapabilityStatement", "documentation", element.getDocumentationElement(), -1);
2735  }
2736
2737  protected void composeCapabilityStatementCapabilityStatementMessagingComponent(Complex parent, String parentType,
2738      String name, CapabilityStatement.CapabilityStatementMessagingComponent element, int index) {
2739    if (element == null)
2740      return;
2741    Complex t;
2742    if (Utilities.noString(parentType))
2743      t = parent;
2744    else {
2745      t = parent.predicate("fhir:" + parentType + '.' + name);
2746    }
2747    composeBackboneElement(t, "messaging", name, element, index);
2748    for (int i = 0; i < element.getEndpoint().size(); i++)
2749      composeCapabilityStatementCapabilityStatementMessagingEndpointComponent(t, "CapabilityStatement", "endpoint",
2750          element.getEndpoint().get(i), i);
2751    if (element.hasReliableCacheElement())
2752      composeUnsignedInt(t, "CapabilityStatement", "reliableCache", element.getReliableCacheElement(), -1);
2753    if (element.hasDocumentationElement())
2754      composeMarkdown(t, "CapabilityStatement", "documentation", element.getDocumentationElement(), -1);
2755    for (int i = 0; i < element.getSupportedMessage().size(); i++)
2756      composeCapabilityStatementCapabilityStatementMessagingSupportedMessageComponent(t, "CapabilityStatement",
2757          "supportedMessage", element.getSupportedMessage().get(i), i);
2758  }
2759
2760  protected void composeCapabilityStatementCapabilityStatementMessagingEndpointComponent(Complex parent,
2761      String parentType, String name, CapabilityStatement.CapabilityStatementMessagingEndpointComponent element,
2762      int index) {
2763    if (element == null)
2764      return;
2765    Complex t;
2766    if (Utilities.noString(parentType))
2767      t = parent;
2768    else {
2769      t = parent.predicate("fhir:" + parentType + '.' + name);
2770    }
2771    composeBackboneElement(t, "endpoint", name, element, index);
2772    if (element.hasProtocol())
2773      composeCoding(t, "CapabilityStatement", "protocol", element.getProtocol(), -1);
2774    if (element.hasAddressElement())
2775      composeUrl(t, "CapabilityStatement", "address", element.getAddressElement(), -1);
2776  }
2777
2778  protected void composeCapabilityStatementCapabilityStatementMessagingSupportedMessageComponent(Complex parent,
2779      String parentType, String name, CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent element,
2780      int index) {
2781    if (element == null)
2782      return;
2783    Complex t;
2784    if (Utilities.noString(parentType))
2785      t = parent;
2786    else {
2787      t = parent.predicate("fhir:" + parentType + '.' + name);
2788    }
2789    composeBackboneElement(t, "supportedMessage", name, element, index);
2790    if (element.hasModeElement())
2791      composeEnum(t, "CapabilityStatement", "mode", element.getModeElement(), -1);
2792    if (element.hasDefinitionElement())
2793      composeCanonical(t, "CapabilityStatement", "definition", element.getDefinitionElement(), -1);
2794  }
2795
2796  protected void composeCapabilityStatementCapabilityStatementDocumentComponent(Complex parent, String parentType,
2797      String name, CapabilityStatement.CapabilityStatementDocumentComponent element, int index) {
2798    if (element == null)
2799      return;
2800    Complex t;
2801    if (Utilities.noString(parentType))
2802      t = parent;
2803    else {
2804      t = parent.predicate("fhir:" + parentType + '.' + name);
2805    }
2806    composeBackboneElement(t, "document", name, element, index);
2807    if (element.hasModeElement())
2808      composeEnum(t, "CapabilityStatement", "mode", element.getModeElement(), -1);
2809    if (element.hasDocumentationElement())
2810      composeMarkdown(t, "CapabilityStatement", "documentation", element.getDocumentationElement(), -1);
2811    if (element.hasProfileElement())
2812      composeCanonical(t, "CapabilityStatement", "profile", element.getProfileElement(), -1);
2813  }
2814
2815  protected void composeCarePlan(Complex parent, String parentType, String name, CarePlan element, int index) {
2816    if (element == null)
2817      return;
2818    Complex t;
2819    if (Utilities.noString(parentType))
2820      t = parent;
2821    else {
2822      t = parent.predicate("fhir:" + parentType + '.' + name);
2823    }
2824    composeDomainResource(t, "CarePlan", name, element, index);
2825    for (int i = 0; i < element.getIdentifier().size(); i++)
2826      composeIdentifier(t, "CarePlan", "identifier", element.getIdentifier().get(i), i);
2827    for (int i = 0; i < element.getInstantiatesCanonical().size(); i++)
2828      composeCanonical(t, "CarePlan", "instantiatesCanonical", element.getInstantiatesCanonical().get(i), i);
2829    for (int i = 0; i < element.getInstantiatesUri().size(); i++)
2830      composeUri(t, "CarePlan", "instantiatesUri", element.getInstantiatesUri().get(i), i);
2831    for (int i = 0; i < element.getBasedOn().size(); i++)
2832      composeReference(t, "CarePlan", "basedOn", element.getBasedOn().get(i), i);
2833    for (int i = 0; i < element.getReplaces().size(); i++)
2834      composeReference(t, "CarePlan", "replaces", element.getReplaces().get(i), i);
2835    for (int i = 0; i < element.getPartOf().size(); i++)
2836      composeReference(t, "CarePlan", "partOf", element.getPartOf().get(i), i);
2837    if (element.hasStatusElement())
2838      composeEnum(t, "CarePlan", "status", element.getStatusElement(), -1);
2839    if (element.hasIntentElement())
2840      composeEnum(t, "CarePlan", "intent", element.getIntentElement(), -1);
2841    for (int i = 0; i < element.getCategory().size(); i++)
2842      composeCodeableConcept(t, "CarePlan", "category", element.getCategory().get(i), i);
2843    if (element.hasTitleElement())
2844      composeString(t, "CarePlan", "title", element.getTitleElement(), -1);
2845    if (element.hasDescriptionElement())
2846      composeString(t, "CarePlan", "description", element.getDescriptionElement(), -1);
2847    if (element.hasSubject())
2848      composeReference(t, "CarePlan", "subject", element.getSubject(), -1);
2849    if (element.hasEncounter())
2850      composeReference(t, "CarePlan", "encounter", element.getEncounter(), -1);
2851    if (element.hasPeriod())
2852      composePeriod(t, "CarePlan", "period", element.getPeriod(), -1);
2853    if (element.hasCreatedElement())
2854      composeDateTime(t, "CarePlan", "created", element.getCreatedElement(), -1);
2855    if (element.hasAuthor())
2856      composeReference(t, "CarePlan", "author", element.getAuthor(), -1);
2857    for (int i = 0; i < element.getContributor().size(); i++)
2858      composeReference(t, "CarePlan", "contributor", element.getContributor().get(i), i);
2859    for (int i = 0; i < element.getCareTeam().size(); i++)
2860      composeReference(t, "CarePlan", "careTeam", element.getCareTeam().get(i), i);
2861    for (int i = 0; i < element.getAddresses().size(); i++)
2862      composeReference(t, "CarePlan", "addresses", element.getAddresses().get(i), i);
2863    for (int i = 0; i < element.getSupportingInfo().size(); i++)
2864      composeReference(t, "CarePlan", "supportingInfo", element.getSupportingInfo().get(i), i);
2865    for (int i = 0; i < element.getGoal().size(); i++)
2866      composeReference(t, "CarePlan", "goal", element.getGoal().get(i), i);
2867    for (int i = 0; i < element.getActivity().size(); i++)
2868      composeCarePlanCarePlanActivityComponent(t, "CarePlan", "activity", element.getActivity().get(i), i);
2869    for (int i = 0; i < element.getNote().size(); i++)
2870      composeAnnotation(t, "CarePlan", "note", element.getNote().get(i), i);
2871  }
2872
2873  protected void composeCarePlanCarePlanActivityComponent(Complex parent, String parentType, String name,
2874      CarePlan.CarePlanActivityComponent element, int index) {
2875    if (element == null)
2876      return;
2877    Complex t;
2878    if (Utilities.noString(parentType))
2879      t = parent;
2880    else {
2881      t = parent.predicate("fhir:" + parentType + '.' + name);
2882    }
2883    composeBackboneElement(t, "activity", name, element, index);
2884    for (int i = 0; i < element.getOutcomeCodeableConcept().size(); i++)
2885      composeCodeableConcept(t, "CarePlan", "outcomeCodeableConcept", element.getOutcomeCodeableConcept().get(i), i);
2886    for (int i = 0; i < element.getOutcomeReference().size(); i++)
2887      composeReference(t, "CarePlan", "outcomeReference", element.getOutcomeReference().get(i), i);
2888    for (int i = 0; i < element.getProgress().size(); i++)
2889      composeAnnotation(t, "CarePlan", "progress", element.getProgress().get(i), i);
2890    if (element.hasReference())
2891      composeReference(t, "CarePlan", "reference", element.getReference(), -1);
2892    if (element.hasDetail())
2893      composeCarePlanCarePlanActivityDetailComponent(t, "CarePlan", "detail", element.getDetail(), -1);
2894  }
2895
2896  protected void composeCarePlanCarePlanActivityDetailComponent(Complex parent, String parentType, String name,
2897      CarePlan.CarePlanActivityDetailComponent element, int index) {
2898    if (element == null)
2899      return;
2900    Complex t;
2901    if (Utilities.noString(parentType))
2902      t = parent;
2903    else {
2904      t = parent.predicate("fhir:" + parentType + '.' + name);
2905    }
2906    composeBackboneElement(t, "detail", name, element, index);
2907    if (element.hasKindElement())
2908      composeEnum(t, "CarePlan", "kind", element.getKindElement(), -1);
2909    for (int i = 0; i < element.getInstantiatesCanonical().size(); i++)
2910      composeCanonical(t, "CarePlan", "instantiatesCanonical", element.getInstantiatesCanonical().get(i), i);
2911    for (int i = 0; i < element.getInstantiatesUri().size(); i++)
2912      composeUri(t, "CarePlan", "instantiatesUri", element.getInstantiatesUri().get(i), i);
2913    if (element.hasCode())
2914      composeCodeableConcept(t, "CarePlan", "code", element.getCode(), -1);
2915    for (int i = 0; i < element.getReasonCode().size(); i++)
2916      composeCodeableConcept(t, "CarePlan", "reasonCode", element.getReasonCode().get(i), i);
2917    for (int i = 0; i < element.getReasonReference().size(); i++)
2918      composeReference(t, "CarePlan", "reasonReference", element.getReasonReference().get(i), i);
2919    for (int i = 0; i < element.getGoal().size(); i++)
2920      composeReference(t, "CarePlan", "goal", element.getGoal().get(i), i);
2921    if (element.hasStatusElement())
2922      composeEnum(t, "CarePlan", "status", element.getStatusElement(), -1);
2923    if (element.hasStatusReason())
2924      composeCodeableConcept(t, "CarePlan", "statusReason", element.getStatusReason(), -1);
2925    if (element.hasDoNotPerformElement())
2926      composeBoolean(t, "CarePlan", "doNotPerform", element.getDoNotPerformElement(), -1);
2927    if (element.hasScheduled())
2928      composeType(t, "CarePlan", "scheduled", element.getScheduled(), -1);
2929    if (element.hasLocation())
2930      composeReference(t, "CarePlan", "location", element.getLocation(), -1);
2931    for (int i = 0; i < element.getPerformer().size(); i++)
2932      composeReference(t, "CarePlan", "performer", element.getPerformer().get(i), i);
2933    if (element.hasProduct())
2934      composeType(t, "CarePlan", "product", element.getProduct(), -1);
2935    if (element.hasDailyAmount())
2936      composeQuantity(t, "CarePlan", "dailyAmount", element.getDailyAmount(), -1);
2937    if (element.hasQuantity())
2938      composeQuantity(t, "CarePlan", "quantity", element.getQuantity(), -1);
2939    if (element.hasDescriptionElement())
2940      composeString(t, "CarePlan", "description", element.getDescriptionElement(), -1);
2941  }
2942
2943  protected void composeCareTeam(Complex parent, String parentType, String name, CareTeam element, int index) {
2944    if (element == null)
2945      return;
2946    Complex t;
2947    if (Utilities.noString(parentType))
2948      t = parent;
2949    else {
2950      t = parent.predicate("fhir:" + parentType + '.' + name);
2951    }
2952    composeDomainResource(t, "CareTeam", name, element, index);
2953    for (int i = 0; i < element.getIdentifier().size(); i++)
2954      composeIdentifier(t, "CareTeam", "identifier", element.getIdentifier().get(i), i);
2955    if (element.hasStatusElement())
2956      composeEnum(t, "CareTeam", "status", element.getStatusElement(), -1);
2957    for (int i = 0; i < element.getCategory().size(); i++)
2958      composeCodeableConcept(t, "CareTeam", "category", element.getCategory().get(i), i);
2959    if (element.hasNameElement())
2960      composeString(t, "CareTeam", "name", element.getNameElement(), -1);
2961    if (element.hasSubject())
2962      composeReference(t, "CareTeam", "subject", element.getSubject(), -1);
2963    if (element.hasEncounter())
2964      composeReference(t, "CareTeam", "encounter", element.getEncounter(), -1);
2965    if (element.hasPeriod())
2966      composePeriod(t, "CareTeam", "period", element.getPeriod(), -1);
2967    for (int i = 0; i < element.getParticipant().size(); i++)
2968      composeCareTeamCareTeamParticipantComponent(t, "CareTeam", "participant", element.getParticipant().get(i), i);
2969    for (int i = 0; i < element.getReasonCode().size(); i++)
2970      composeCodeableConcept(t, "CareTeam", "reasonCode", element.getReasonCode().get(i), i);
2971    for (int i = 0; i < element.getReasonReference().size(); i++)
2972      composeReference(t, "CareTeam", "reasonReference", element.getReasonReference().get(i), i);
2973    for (int i = 0; i < element.getManagingOrganization().size(); i++)
2974      composeReference(t, "CareTeam", "managingOrganization", element.getManagingOrganization().get(i), i);
2975    for (int i = 0; i < element.getTelecom().size(); i++)
2976      composeContactPoint(t, "CareTeam", "telecom", element.getTelecom().get(i), i);
2977    for (int i = 0; i < element.getNote().size(); i++)
2978      composeAnnotation(t, "CareTeam", "note", element.getNote().get(i), i);
2979  }
2980
2981  protected void composeCareTeamCareTeamParticipantComponent(Complex parent, String parentType, String name,
2982      CareTeam.CareTeamParticipantComponent element, int index) {
2983    if (element == null)
2984      return;
2985    Complex t;
2986    if (Utilities.noString(parentType))
2987      t = parent;
2988    else {
2989      t = parent.predicate("fhir:" + parentType + '.' + name);
2990    }
2991    composeBackboneElement(t, "participant", name, element, index);
2992    for (int i = 0; i < element.getRole().size(); i++)
2993      composeCodeableConcept(t, "CareTeam", "role", element.getRole().get(i), i);
2994    if (element.hasMember())
2995      composeReference(t, "CareTeam", "member", element.getMember(), -1);
2996    if (element.hasOnBehalfOf())
2997      composeReference(t, "CareTeam", "onBehalfOf", element.getOnBehalfOf(), -1);
2998    if (element.hasPeriod())
2999      composePeriod(t, "CareTeam", "period", element.getPeriod(), -1);
3000  }
3001
3002  protected void composeCatalogEntry(Complex parent, String parentType, String name, CatalogEntry element, int index) {
3003    if (element == null)
3004      return;
3005    Complex t;
3006    if (Utilities.noString(parentType))
3007      t = parent;
3008    else {
3009      t = parent.predicate("fhir:" + parentType + '.' + name);
3010    }
3011    composeDomainResource(t, "CatalogEntry", name, element, index);
3012    for (int i = 0; i < element.getIdentifier().size(); i++)
3013      composeIdentifier(t, "CatalogEntry", "identifier", element.getIdentifier().get(i), i);
3014    if (element.hasType())
3015      composeCodeableConcept(t, "CatalogEntry", "type", element.getType(), -1);
3016    if (element.hasOrderableElement())
3017      composeBoolean(t, "CatalogEntry", "orderable", element.getOrderableElement(), -1);
3018    if (element.hasReferencedItem())
3019      composeReference(t, "CatalogEntry", "referencedItem", element.getReferencedItem(), -1);
3020    for (int i = 0; i < element.getAdditionalIdentifier().size(); i++)
3021      composeIdentifier(t, "CatalogEntry", "additionalIdentifier", element.getAdditionalIdentifier().get(i), i);
3022    for (int i = 0; i < element.getClassification().size(); i++)
3023      composeCodeableConcept(t, "CatalogEntry", "classification", element.getClassification().get(i), i);
3024    if (element.hasStatusElement())
3025      composeEnum(t, "CatalogEntry", "status", element.getStatusElement(), -1);
3026    if (element.hasValidityPeriod())
3027      composePeriod(t, "CatalogEntry", "validityPeriod", element.getValidityPeriod(), -1);
3028    if (element.hasValidToElement())
3029      composeDateTime(t, "CatalogEntry", "validTo", element.getValidToElement(), -1);
3030    if (element.hasLastUpdatedElement())
3031      composeDateTime(t, "CatalogEntry", "lastUpdated", element.getLastUpdatedElement(), -1);
3032    for (int i = 0; i < element.getAdditionalCharacteristic().size(); i++)
3033      composeCodeableConcept(t, "CatalogEntry", "additionalCharacteristic",
3034          element.getAdditionalCharacteristic().get(i), i);
3035    for (int i = 0; i < element.getAdditionalClassification().size(); i++)
3036      composeCodeableConcept(t, "CatalogEntry", "additionalClassification",
3037          element.getAdditionalClassification().get(i), i);
3038    for (int i = 0; i < element.getRelatedEntry().size(); i++)
3039      composeCatalogEntryCatalogEntryRelatedEntryComponent(t, "CatalogEntry", "relatedEntry",
3040          element.getRelatedEntry().get(i), i);
3041  }
3042
3043  protected void composeCatalogEntryCatalogEntryRelatedEntryComponent(Complex parent, String parentType, String name,
3044      CatalogEntry.CatalogEntryRelatedEntryComponent element, int index) {
3045    if (element == null)
3046      return;
3047    Complex t;
3048    if (Utilities.noString(parentType))
3049      t = parent;
3050    else {
3051      t = parent.predicate("fhir:" + parentType + '.' + name);
3052    }
3053    composeBackboneElement(t, "relatedEntry", name, element, index);
3054    if (element.hasRelationtypeElement())
3055      composeEnum(t, "CatalogEntry", "relationtype", element.getRelationtypeElement(), -1);
3056    if (element.hasItem())
3057      composeReference(t, "CatalogEntry", "item", element.getItem(), -1);
3058  }
3059
3060  protected void composeChargeItem(Complex parent, String parentType, String name, ChargeItem element, int index) {
3061    if (element == null)
3062      return;
3063    Complex t;
3064    if (Utilities.noString(parentType))
3065      t = parent;
3066    else {
3067      t = parent.predicate("fhir:" + parentType + '.' + name);
3068    }
3069    composeDomainResource(t, "ChargeItem", name, element, index);
3070    for (int i = 0; i < element.getIdentifier().size(); i++)
3071      composeIdentifier(t, "ChargeItem", "identifier", element.getIdentifier().get(i), i);
3072    for (int i = 0; i < element.getDefinitionUri().size(); i++)
3073      composeUri(t, "ChargeItem", "definitionUri", element.getDefinitionUri().get(i), i);
3074    for (int i = 0; i < element.getDefinitionCanonical().size(); i++)
3075      composeCanonical(t, "ChargeItem", "definitionCanonical", element.getDefinitionCanonical().get(i), i);
3076    if (element.hasStatusElement())
3077      composeEnum(t, "ChargeItem", "status", element.getStatusElement(), -1);
3078    for (int i = 0; i < element.getPartOf().size(); i++)
3079      composeReference(t, "ChargeItem", "partOf", element.getPartOf().get(i), i);
3080    if (element.hasCode())
3081      composeCodeableConcept(t, "ChargeItem", "code", element.getCode(), -1);
3082    if (element.hasSubject())
3083      composeReference(t, "ChargeItem", "subject", element.getSubject(), -1);
3084    if (element.hasContext())
3085      composeReference(t, "ChargeItem", "context", element.getContext(), -1);
3086    if (element.hasOccurrence())
3087      composeType(t, "ChargeItem", "occurrence", element.getOccurrence(), -1);
3088    for (int i = 0; i < element.getPerformer().size(); i++)
3089      composeChargeItemChargeItemPerformerComponent(t, "ChargeItem", "performer", element.getPerformer().get(i), i);
3090    if (element.hasPerformingOrganization())
3091      composeReference(t, "ChargeItem", "performingOrganization", element.getPerformingOrganization(), -1);
3092    if (element.hasRequestingOrganization())
3093      composeReference(t, "ChargeItem", "requestingOrganization", element.getRequestingOrganization(), -1);
3094    if (element.hasCostCenter())
3095      composeReference(t, "ChargeItem", "costCenter", element.getCostCenter(), -1);
3096    if (element.hasQuantity())
3097      composeQuantity(t, "ChargeItem", "quantity", element.getQuantity(), -1);
3098    for (int i = 0; i < element.getBodysite().size(); i++)
3099      composeCodeableConcept(t, "ChargeItem", "bodysite", element.getBodysite().get(i), i);
3100    if (element.hasFactorOverrideElement())
3101      composeDecimal(t, "ChargeItem", "factorOverride", element.getFactorOverrideElement(), -1);
3102    if (element.hasPriceOverride())
3103      composeMoney(t, "ChargeItem", "priceOverride", element.getPriceOverride(), -1);
3104    if (element.hasOverrideReasonElement())
3105      composeString(t, "ChargeItem", "overrideReason", element.getOverrideReasonElement(), -1);
3106    if (element.hasEnterer())
3107      composeReference(t, "ChargeItem", "enterer", element.getEnterer(), -1);
3108    if (element.hasEnteredDateElement())
3109      composeDateTime(t, "ChargeItem", "enteredDate", element.getEnteredDateElement(), -1);
3110    for (int i = 0; i < element.getReason().size(); i++)
3111      composeCodeableConcept(t, "ChargeItem", "reason", element.getReason().get(i), i);
3112    for (int i = 0; i < element.getService().size(); i++)
3113      composeReference(t, "ChargeItem", "service", element.getService().get(i), i);
3114    if (element.hasProduct())
3115      composeType(t, "ChargeItem", "product", element.getProduct(), -1);
3116    for (int i = 0; i < element.getAccount().size(); i++)
3117      composeReference(t, "ChargeItem", "account", element.getAccount().get(i), i);
3118    for (int i = 0; i < element.getNote().size(); i++)
3119      composeAnnotation(t, "ChargeItem", "note", element.getNote().get(i), i);
3120    for (int i = 0; i < element.getSupportingInformation().size(); i++)
3121      composeReference(t, "ChargeItem", "supportingInformation", element.getSupportingInformation().get(i), i);
3122  }
3123
3124  protected void composeChargeItemChargeItemPerformerComponent(Complex parent, String parentType, String name,
3125      ChargeItem.ChargeItemPerformerComponent element, int index) {
3126    if (element == null)
3127      return;
3128    Complex t;
3129    if (Utilities.noString(parentType))
3130      t = parent;
3131    else {
3132      t = parent.predicate("fhir:" + parentType + '.' + name);
3133    }
3134    composeBackboneElement(t, "performer", name, element, index);
3135    if (element.hasFunction())
3136      composeCodeableConcept(t, "ChargeItem", "function", element.getFunction(), -1);
3137    if (element.hasActor())
3138      composeReference(t, "ChargeItem", "actor", element.getActor(), -1);
3139  }
3140
3141  protected void composeChargeItemDefinition(Complex parent, String parentType, String name,
3142      ChargeItemDefinition element, int index) {
3143    if (element == null)
3144      return;
3145    Complex t;
3146    if (Utilities.noString(parentType))
3147      t = parent;
3148    else {
3149      t = parent.predicate("fhir:" + parentType + '.' + name);
3150    }
3151    composeDomainResource(t, "ChargeItemDefinition", name, element, index);
3152    if (element.hasUrlElement())
3153      composeUri(t, "ChargeItemDefinition", "url", element.getUrlElement(), -1);
3154    for (int i = 0; i < element.getIdentifier().size(); i++)
3155      composeIdentifier(t, "ChargeItemDefinition", "identifier", element.getIdentifier().get(i), i);
3156    if (element.hasVersionElement())
3157      composeString(t, "ChargeItemDefinition", "version", element.getVersionElement(), -1);
3158    if (element.hasTitleElement())
3159      composeString(t, "ChargeItemDefinition", "title", element.getTitleElement(), -1);
3160    for (int i = 0; i < element.getDerivedFromUri().size(); i++)
3161      composeUri(t, "ChargeItemDefinition", "derivedFromUri", element.getDerivedFromUri().get(i), i);
3162    for (int i = 0; i < element.getPartOf().size(); i++)
3163      composeCanonical(t, "ChargeItemDefinition", "partOf", element.getPartOf().get(i), i);
3164    for (int i = 0; i < element.getReplaces().size(); i++)
3165      composeCanonical(t, "ChargeItemDefinition", "replaces", element.getReplaces().get(i), i);
3166    if (element.hasStatusElement())
3167      composeEnum(t, "ChargeItemDefinition", "status", element.getStatusElement(), -1);
3168    if (element.hasExperimentalElement())
3169      composeBoolean(t, "ChargeItemDefinition", "experimental", element.getExperimentalElement(), -1);
3170    if (element.hasDateElement())
3171      composeDateTime(t, "ChargeItemDefinition", "date", element.getDateElement(), -1);
3172    if (element.hasPublisherElement())
3173      composeString(t, "ChargeItemDefinition", "publisher", element.getPublisherElement(), -1);
3174    for (int i = 0; i < element.getContact().size(); i++)
3175      composeContactDetail(t, "ChargeItemDefinition", "contact", element.getContact().get(i), i);
3176    if (element.hasDescriptionElement())
3177      composeMarkdown(t, "ChargeItemDefinition", "description", element.getDescriptionElement(), -1);
3178    for (int i = 0; i < element.getUseContext().size(); i++)
3179      composeUsageContext(t, "ChargeItemDefinition", "useContext", element.getUseContext().get(i), i);
3180    for (int i = 0; i < element.getJurisdiction().size(); i++)
3181      composeCodeableConcept(t, "ChargeItemDefinition", "jurisdiction", element.getJurisdiction().get(i), i);
3182    if (element.hasCopyrightElement())
3183      composeMarkdown(t, "ChargeItemDefinition", "copyright", element.getCopyrightElement(), -1);
3184    if (element.hasApprovalDateElement())
3185      composeDate(t, "ChargeItemDefinition", "approvalDate", element.getApprovalDateElement(), -1);
3186    if (element.hasLastReviewDateElement())
3187      composeDate(t, "ChargeItemDefinition", "lastReviewDate", element.getLastReviewDateElement(), -1);
3188    if (element.hasEffectivePeriod())
3189      composePeriod(t, "ChargeItemDefinition", "effectivePeriod", element.getEffectivePeriod(), -1);
3190    if (element.hasCode())
3191      composeCodeableConcept(t, "ChargeItemDefinition", "code", element.getCode(), -1);
3192    for (int i = 0; i < element.getInstance().size(); i++)
3193      composeReference(t, "ChargeItemDefinition", "instance", element.getInstance().get(i), i);
3194    for (int i = 0; i < element.getApplicability().size(); i++)
3195      composeChargeItemDefinitionChargeItemDefinitionApplicabilityComponent(t, "ChargeItemDefinition", "applicability",
3196          element.getApplicability().get(i), i);
3197    for (int i = 0; i < element.getPropertyGroup().size(); i++)
3198      composeChargeItemDefinitionChargeItemDefinitionPropertyGroupComponent(t, "ChargeItemDefinition", "propertyGroup",
3199          element.getPropertyGroup().get(i), i);
3200  }
3201
3202  protected void composeChargeItemDefinitionChargeItemDefinitionApplicabilityComponent(Complex parent,
3203      String parentType, String name, ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent element,
3204      int index) {
3205    if (element == null)
3206      return;
3207    Complex t;
3208    if (Utilities.noString(parentType))
3209      t = parent;
3210    else {
3211      t = parent.predicate("fhir:" + parentType + '.' + name);
3212    }
3213    composeBackboneElement(t, "applicability", name, element, index);
3214    if (element.hasDescriptionElement())
3215      composeString(t, "ChargeItemDefinition", "description", element.getDescriptionElement(), -1);
3216    if (element.hasLanguageElement())
3217      composeString(t, "ChargeItemDefinition", "language", element.getLanguageElement(), -1);
3218    if (element.hasExpressionElement())
3219      composeString(t, "ChargeItemDefinition", "expression", element.getExpressionElement(), -1);
3220  }
3221
3222  protected void composeChargeItemDefinitionChargeItemDefinitionPropertyGroupComponent(Complex parent,
3223      String parentType, String name, ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent element,
3224      int index) {
3225    if (element == null)
3226      return;
3227    Complex t;
3228    if (Utilities.noString(parentType))
3229      t = parent;
3230    else {
3231      t = parent.predicate("fhir:" + parentType + '.' + name);
3232    }
3233    composeBackboneElement(t, "propertyGroup", name, element, index);
3234    for (int i = 0; i < element.getApplicability().size(); i++)
3235      composeChargeItemDefinitionChargeItemDefinitionApplicabilityComponent(t, "ChargeItemDefinition", "applicability",
3236          element.getApplicability().get(i), i);
3237    for (int i = 0; i < element.getPriceComponent().size(); i++)
3238      composeChargeItemDefinitionChargeItemDefinitionPropertyGroupPriceComponentComponent(t, "ChargeItemDefinition",
3239          "priceComponent", element.getPriceComponent().get(i), i);
3240  }
3241
3242  protected void composeChargeItemDefinitionChargeItemDefinitionPropertyGroupPriceComponentComponent(Complex parent,
3243      String parentType, String name,
3244      ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent element, int index) {
3245    if (element == null)
3246      return;
3247    Complex t;
3248    if (Utilities.noString(parentType))
3249      t = parent;
3250    else {
3251      t = parent.predicate("fhir:" + parentType + '.' + name);
3252    }
3253    composeBackboneElement(t, "priceComponent", name, element, index);
3254    if (element.hasTypeElement())
3255      composeEnum(t, "ChargeItemDefinition", "type", element.getTypeElement(), -1);
3256    if (element.hasCode())
3257      composeCodeableConcept(t, "ChargeItemDefinition", "code", element.getCode(), -1);
3258    if (element.hasFactorElement())
3259      composeDecimal(t, "ChargeItemDefinition", "factor", element.getFactorElement(), -1);
3260    if (element.hasAmount())
3261      composeMoney(t, "ChargeItemDefinition", "amount", element.getAmount(), -1);
3262  }
3263
3264  protected void composeClaim(Complex parent, String parentType, String name, Claim element, int index) {
3265    if (element == null)
3266      return;
3267    Complex t;
3268    if (Utilities.noString(parentType))
3269      t = parent;
3270    else {
3271      t = parent.predicate("fhir:" + parentType + '.' + name);
3272    }
3273    composeDomainResource(t, "Claim", name, element, index);
3274    for (int i = 0; i < element.getIdentifier().size(); i++)
3275      composeIdentifier(t, "Claim", "identifier", element.getIdentifier().get(i), i);
3276    if (element.hasStatusElement())
3277      composeEnum(t, "Claim", "status", element.getStatusElement(), -1);
3278    if (element.hasType())
3279      composeCodeableConcept(t, "Claim", "type", element.getType(), -1);
3280    if (element.hasSubType())
3281      composeCodeableConcept(t, "Claim", "subType", element.getSubType(), -1);
3282    if (element.hasUseElement())
3283      composeEnum(t, "Claim", "use", element.getUseElement(), -1);
3284    if (element.hasPatient())
3285      composeReference(t, "Claim", "patient", element.getPatient(), -1);
3286    if (element.hasBillablePeriod())
3287      composePeriod(t, "Claim", "billablePeriod", element.getBillablePeriod(), -1);
3288    if (element.hasCreatedElement())
3289      composeDateTime(t, "Claim", "created", element.getCreatedElement(), -1);
3290    if (element.hasEnterer())
3291      composeReference(t, "Claim", "enterer", element.getEnterer(), -1);
3292    if (element.hasInsurer())
3293      composeReference(t, "Claim", "insurer", element.getInsurer(), -1);
3294    if (element.hasProvider())
3295      composeReference(t, "Claim", "provider", element.getProvider(), -1);
3296    if (element.hasPriority())
3297      composeCodeableConcept(t, "Claim", "priority", element.getPriority(), -1);
3298    if (element.hasFundsReserve())
3299      composeCodeableConcept(t, "Claim", "fundsReserve", element.getFundsReserve(), -1);
3300    for (int i = 0; i < element.getRelated().size(); i++)
3301      composeClaimRelatedClaimComponent(t, "Claim", "related", element.getRelated().get(i), i);
3302    if (element.hasPrescription())
3303      composeReference(t, "Claim", "prescription", element.getPrescription(), -1);
3304    if (element.hasOriginalPrescription())
3305      composeReference(t, "Claim", "originalPrescription", element.getOriginalPrescription(), -1);
3306    if (element.hasPayee())
3307      composeClaimPayeeComponent(t, "Claim", "payee", element.getPayee(), -1);
3308    if (element.hasReferral())
3309      composeReference(t, "Claim", "referral", element.getReferral(), -1);
3310    if (element.hasFacility())
3311      composeReference(t, "Claim", "facility", element.getFacility(), -1);
3312    for (int i = 0; i < element.getCareTeam().size(); i++)
3313      composeClaimCareTeamComponent(t, "Claim", "careTeam", element.getCareTeam().get(i), i);
3314    for (int i = 0; i < element.getSupportingInfo().size(); i++)
3315      composeClaimSupportingInformationComponent(t, "Claim", "supportingInfo", element.getSupportingInfo().get(i), i);
3316    for (int i = 0; i < element.getDiagnosis().size(); i++)
3317      composeClaimDiagnosisComponent(t, "Claim", "diagnosis", element.getDiagnosis().get(i), i);
3318    for (int i = 0; i < element.getProcedure().size(); i++)
3319      composeClaimProcedureComponent(t, "Claim", "procedure", element.getProcedure().get(i), i);
3320    for (int i = 0; i < element.getInsurance().size(); i++)
3321      composeClaimInsuranceComponent(t, "Claim", "insurance", element.getInsurance().get(i), i);
3322    if (element.hasAccident())
3323      composeClaimAccidentComponent(t, "Claim", "accident", element.getAccident(), -1);
3324    for (int i = 0; i < element.getItem().size(); i++)
3325      composeClaimItemComponent(t, "Claim", "item", element.getItem().get(i), i);
3326    if (element.hasTotal())
3327      composeMoney(t, "Claim", "total", element.getTotal(), -1);
3328  }
3329
3330  protected void composeClaimRelatedClaimComponent(Complex parent, String parentType, String name,
3331      Claim.RelatedClaimComponent element, int index) {
3332    if (element == null)
3333      return;
3334    Complex t;
3335    if (Utilities.noString(parentType))
3336      t = parent;
3337    else {
3338      t = parent.predicate("fhir:" + parentType + '.' + name);
3339    }
3340    composeBackboneElement(t, "related", name, element, index);
3341    if (element.hasClaim())
3342      composeReference(t, "Claim", "claim", element.getClaim(), -1);
3343    if (element.hasRelationship())
3344      composeCodeableConcept(t, "Claim", "relationship", element.getRelationship(), -1);
3345    if (element.hasReference())
3346      composeIdentifier(t, "Claim", "reference", element.getReference(), -1);
3347  }
3348
3349  protected void composeClaimPayeeComponent(Complex parent, String parentType, String name,
3350      Claim.PayeeComponent element, int index) {
3351    if (element == null)
3352      return;
3353    Complex t;
3354    if (Utilities.noString(parentType))
3355      t = parent;
3356    else {
3357      t = parent.predicate("fhir:" + parentType + '.' + name);
3358    }
3359    composeBackboneElement(t, "payee", name, element, index);
3360    if (element.hasType())
3361      composeCodeableConcept(t, "Claim", "type", element.getType(), -1);
3362    if (element.hasParty())
3363      composeReference(t, "Claim", "party", element.getParty(), -1);
3364  }
3365
3366  protected void composeClaimCareTeamComponent(Complex parent, String parentType, String name,
3367      Claim.CareTeamComponent element, int index) {
3368    if (element == null)
3369      return;
3370    Complex t;
3371    if (Utilities.noString(parentType))
3372      t = parent;
3373    else {
3374      t = parent.predicate("fhir:" + parentType + '.' + name);
3375    }
3376    composeBackboneElement(t, "careTeam", name, element, index);
3377    if (element.hasSequenceElement())
3378      composePositiveInt(t, "Claim", "sequence", element.getSequenceElement(), -1);
3379    if (element.hasProvider())
3380      composeReference(t, "Claim", "provider", element.getProvider(), -1);
3381    if (element.hasResponsibleElement())
3382      composeBoolean(t, "Claim", "responsible", element.getResponsibleElement(), -1);
3383    if (element.hasRole())
3384      composeCodeableConcept(t, "Claim", "role", element.getRole(), -1);
3385    if (element.hasQualification())
3386      composeCodeableConcept(t, "Claim", "qualification", element.getQualification(), -1);
3387  }
3388
3389  protected void composeClaimSupportingInformationComponent(Complex parent, String parentType, String name,
3390      Claim.SupportingInformationComponent element, int index) {
3391    if (element == null)
3392      return;
3393    Complex t;
3394    if (Utilities.noString(parentType))
3395      t = parent;
3396    else {
3397      t = parent.predicate("fhir:" + parentType + '.' + name);
3398    }
3399    composeBackboneElement(t, "supportingInfo", name, element, index);
3400    if (element.hasSequenceElement())
3401      composePositiveInt(t, "Claim", "sequence", element.getSequenceElement(), -1);
3402    if (element.hasCategory())
3403      composeCodeableConcept(t, "Claim", "category", element.getCategory(), -1);
3404    if (element.hasCode())
3405      composeCodeableConcept(t, "Claim", "code", element.getCode(), -1);
3406    if (element.hasTiming())
3407      composeType(t, "Claim", "timing", element.getTiming(), -1);
3408    if (element.hasValue())
3409      composeType(t, "Claim", "value", element.getValue(), -1);
3410    if (element.hasReason())
3411      composeCodeableConcept(t, "Claim", "reason", element.getReason(), -1);
3412  }
3413
3414  protected void composeClaimDiagnosisComponent(Complex parent, String parentType, String name,
3415      Claim.DiagnosisComponent element, int index) {
3416    if (element == null)
3417      return;
3418    Complex t;
3419    if (Utilities.noString(parentType))
3420      t = parent;
3421    else {
3422      t = parent.predicate("fhir:" + parentType + '.' + name);
3423    }
3424    composeBackboneElement(t, "diagnosis", name, element, index);
3425    if (element.hasSequenceElement())
3426      composePositiveInt(t, "Claim", "sequence", element.getSequenceElement(), -1);
3427    if (element.hasDiagnosis())
3428      composeType(t, "Claim", "diagnosis", element.getDiagnosis(), -1);
3429    for (int i = 0; i < element.getType().size(); i++)
3430      composeCodeableConcept(t, "Claim", "type", element.getType().get(i), i);
3431    if (element.hasOnAdmission())
3432      composeCodeableConcept(t, "Claim", "onAdmission", element.getOnAdmission(), -1);
3433    if (element.hasPackageCode())
3434      composeCodeableConcept(t, "Claim", "packageCode", element.getPackageCode(), -1);
3435  }
3436
3437  protected void composeClaimProcedureComponent(Complex parent, String parentType, String name,
3438      Claim.ProcedureComponent element, int index) {
3439    if (element == null)
3440      return;
3441    Complex t;
3442    if (Utilities.noString(parentType))
3443      t = parent;
3444    else {
3445      t = parent.predicate("fhir:" + parentType + '.' + name);
3446    }
3447    composeBackboneElement(t, "procedure", name, element, index);
3448    if (element.hasSequenceElement())
3449      composePositiveInt(t, "Claim", "sequence", element.getSequenceElement(), -1);
3450    for (int i = 0; i < element.getType().size(); i++)
3451      composeCodeableConcept(t, "Claim", "type", element.getType().get(i), i);
3452    if (element.hasDateElement())
3453      composeDateTime(t, "Claim", "date", element.getDateElement(), -1);
3454    if (element.hasProcedure())
3455      composeType(t, "Claim", "procedure", element.getProcedure(), -1);
3456    for (int i = 0; i < element.getUdi().size(); i++)
3457      composeReference(t, "Claim", "udi", element.getUdi().get(i), i);
3458  }
3459
3460  protected void composeClaimInsuranceComponent(Complex parent, String parentType, String name,
3461      Claim.InsuranceComponent element, int index) {
3462    if (element == null)
3463      return;
3464    Complex t;
3465    if (Utilities.noString(parentType))
3466      t = parent;
3467    else {
3468      t = parent.predicate("fhir:" + parentType + '.' + name);
3469    }
3470    composeBackboneElement(t, "insurance", name, element, index);
3471    if (element.hasSequenceElement())
3472      composePositiveInt(t, "Claim", "sequence", element.getSequenceElement(), -1);
3473    if (element.hasFocalElement())
3474      composeBoolean(t, "Claim", "focal", element.getFocalElement(), -1);
3475    if (element.hasIdentifier())
3476      composeIdentifier(t, "Claim", "identifier", element.getIdentifier(), -1);
3477    if (element.hasCoverage())
3478      composeReference(t, "Claim", "coverage", element.getCoverage(), -1);
3479    if (element.hasBusinessArrangementElement())
3480      composeString(t, "Claim", "businessArrangement", element.getBusinessArrangementElement(), -1);
3481    for (int i = 0; i < element.getPreAuthRef().size(); i++)
3482      composeString(t, "Claim", "preAuthRef", element.getPreAuthRef().get(i), i);
3483    if (element.hasClaimResponse())
3484      composeReference(t, "Claim", "claimResponse", element.getClaimResponse(), -1);
3485  }
3486
3487  protected void composeClaimAccidentComponent(Complex parent, String parentType, String name,
3488      Claim.AccidentComponent element, int index) {
3489    if (element == null)
3490      return;
3491    Complex t;
3492    if (Utilities.noString(parentType))
3493      t = parent;
3494    else {
3495      t = parent.predicate("fhir:" + parentType + '.' + name);
3496    }
3497    composeBackboneElement(t, "accident", name, element, index);
3498    if (element.hasDateElement())
3499      composeDate(t, "Claim", "date", element.getDateElement(), -1);
3500    if (element.hasType())
3501      composeCodeableConcept(t, "Claim", "type", element.getType(), -1);
3502    if (element.hasLocation())
3503      composeType(t, "Claim", "location", element.getLocation(), -1);
3504  }
3505
3506  protected void composeClaimItemComponent(Complex parent, String parentType, String name, Claim.ItemComponent element,
3507      int index) {
3508    if (element == null)
3509      return;
3510    Complex t;
3511    if (Utilities.noString(parentType))
3512      t = parent;
3513    else {
3514      t = parent.predicate("fhir:" + parentType + '.' + name);
3515    }
3516    composeBackboneElement(t, "item", name, element, index);
3517    if (element.hasSequenceElement())
3518      composePositiveInt(t, "Claim", "sequence", element.getSequenceElement(), -1);
3519    for (int i = 0; i < element.getCareTeamSequence().size(); i++)
3520      composePositiveInt(t, "Claim", "careTeamSequence", element.getCareTeamSequence().get(i), i);
3521    for (int i = 0; i < element.getDiagnosisSequence().size(); i++)
3522      composePositiveInt(t, "Claim", "diagnosisSequence", element.getDiagnosisSequence().get(i), i);
3523    for (int i = 0; i < element.getProcedureSequence().size(); i++)
3524      composePositiveInt(t, "Claim", "procedureSequence", element.getProcedureSequence().get(i), i);
3525    for (int i = 0; i < element.getInformationSequence().size(); i++)
3526      composePositiveInt(t, "Claim", "informationSequence", element.getInformationSequence().get(i), i);
3527    if (element.hasRevenue())
3528      composeCodeableConcept(t, "Claim", "revenue", element.getRevenue(), -1);
3529    if (element.hasCategory())
3530      composeCodeableConcept(t, "Claim", "category", element.getCategory(), -1);
3531    if (element.hasProductOrService())
3532      composeCodeableConcept(t, "Claim", "productOrService", element.getProductOrService(), -1);
3533    for (int i = 0; i < element.getModifier().size(); i++)
3534      composeCodeableConcept(t, "Claim", "modifier", element.getModifier().get(i), i);
3535    for (int i = 0; i < element.getProgramCode().size(); i++)
3536      composeCodeableConcept(t, "Claim", "programCode", element.getProgramCode().get(i), i);
3537    if (element.hasServiced())
3538      composeType(t, "Claim", "serviced", element.getServiced(), -1);
3539    if (element.hasLocation())
3540      composeType(t, "Claim", "location", element.getLocation(), -1);
3541    if (element.hasQuantity())
3542      composeQuantity(t, "Claim", "quantity", element.getQuantity(), -1);
3543    if (element.hasUnitPrice())
3544      composeMoney(t, "Claim", "unitPrice", element.getUnitPrice(), -1);
3545    if (element.hasFactorElement())
3546      composeDecimal(t, "Claim", "factor", element.getFactorElement(), -1);
3547    if (element.hasNet())
3548      composeMoney(t, "Claim", "net", element.getNet(), -1);
3549    for (int i = 0; i < element.getUdi().size(); i++)
3550      composeReference(t, "Claim", "udi", element.getUdi().get(i), i);
3551    if (element.hasBodySite())
3552      composeCodeableConcept(t, "Claim", "bodySite", element.getBodySite(), -1);
3553    for (int i = 0; i < element.getSubSite().size(); i++)
3554      composeCodeableConcept(t, "Claim", "subSite", element.getSubSite().get(i), i);
3555    for (int i = 0; i < element.getEncounter().size(); i++)
3556      composeReference(t, "Claim", "encounter", element.getEncounter().get(i), i);
3557    for (int i = 0; i < element.getDetail().size(); i++)
3558      composeClaimDetailComponent(t, "Claim", "detail", element.getDetail().get(i), i);
3559  }
3560
3561  protected void composeClaimDetailComponent(Complex parent, String parentType, String name,
3562      Claim.DetailComponent element, int index) {
3563    if (element == null)
3564      return;
3565    Complex t;
3566    if (Utilities.noString(parentType))
3567      t = parent;
3568    else {
3569      t = parent.predicate("fhir:" + parentType + '.' + name);
3570    }
3571    composeBackboneElement(t, "detail", name, element, index);
3572    if (element.hasSequenceElement())
3573      composePositiveInt(t, "Claim", "sequence", element.getSequenceElement(), -1);
3574    if (element.hasRevenue())
3575      composeCodeableConcept(t, "Claim", "revenue", element.getRevenue(), -1);
3576    if (element.hasCategory())
3577      composeCodeableConcept(t, "Claim", "category", element.getCategory(), -1);
3578    if (element.hasProductOrService())
3579      composeCodeableConcept(t, "Claim", "productOrService", element.getProductOrService(), -1);
3580    for (int i = 0; i < element.getModifier().size(); i++)
3581      composeCodeableConcept(t, "Claim", "modifier", element.getModifier().get(i), i);
3582    for (int i = 0; i < element.getProgramCode().size(); i++)
3583      composeCodeableConcept(t, "Claim", "programCode", element.getProgramCode().get(i), i);
3584    if (element.hasQuantity())
3585      composeQuantity(t, "Claim", "quantity", element.getQuantity(), -1);
3586    if (element.hasUnitPrice())
3587      composeMoney(t, "Claim", "unitPrice", element.getUnitPrice(), -1);
3588    if (element.hasFactorElement())
3589      composeDecimal(t, "Claim", "factor", element.getFactorElement(), -1);
3590    if (element.hasNet())
3591      composeMoney(t, "Claim", "net", element.getNet(), -1);
3592    for (int i = 0; i < element.getUdi().size(); i++)
3593      composeReference(t, "Claim", "udi", element.getUdi().get(i), i);
3594    for (int i = 0; i < element.getSubDetail().size(); i++)
3595      composeClaimSubDetailComponent(t, "Claim", "subDetail", element.getSubDetail().get(i), i);
3596  }
3597
3598  protected void composeClaimSubDetailComponent(Complex parent, String parentType, String name,
3599      Claim.SubDetailComponent element, int index) {
3600    if (element == null)
3601      return;
3602    Complex t;
3603    if (Utilities.noString(parentType))
3604      t = parent;
3605    else {
3606      t = parent.predicate("fhir:" + parentType + '.' + name);
3607    }
3608    composeBackboneElement(t, "subDetail", name, element, index);
3609    if (element.hasSequenceElement())
3610      composePositiveInt(t, "Claim", "sequence", element.getSequenceElement(), -1);
3611    if (element.hasRevenue())
3612      composeCodeableConcept(t, "Claim", "revenue", element.getRevenue(), -1);
3613    if (element.hasCategory())
3614      composeCodeableConcept(t, "Claim", "category", element.getCategory(), -1);
3615    if (element.hasProductOrService())
3616      composeCodeableConcept(t, "Claim", "productOrService", element.getProductOrService(), -1);
3617    for (int i = 0; i < element.getModifier().size(); i++)
3618      composeCodeableConcept(t, "Claim", "modifier", element.getModifier().get(i), i);
3619    for (int i = 0; i < element.getProgramCode().size(); i++)
3620      composeCodeableConcept(t, "Claim", "programCode", element.getProgramCode().get(i), i);
3621    if (element.hasQuantity())
3622      composeQuantity(t, "Claim", "quantity", element.getQuantity(), -1);
3623    if (element.hasUnitPrice())
3624      composeMoney(t, "Claim", "unitPrice", element.getUnitPrice(), -1);
3625    if (element.hasFactorElement())
3626      composeDecimal(t, "Claim", "factor", element.getFactorElement(), -1);
3627    if (element.hasNet())
3628      composeMoney(t, "Claim", "net", element.getNet(), -1);
3629    for (int i = 0; i < element.getUdi().size(); i++)
3630      composeReference(t, "Claim", "udi", element.getUdi().get(i), i);
3631  }
3632
3633  protected void composeClaimResponse(Complex parent, String parentType, String name, ClaimResponse element,
3634      int index) {
3635    if (element == null)
3636      return;
3637    Complex t;
3638    if (Utilities.noString(parentType))
3639      t = parent;
3640    else {
3641      t = parent.predicate("fhir:" + parentType + '.' + name);
3642    }
3643    composeDomainResource(t, "ClaimResponse", name, element, index);
3644    for (int i = 0; i < element.getIdentifier().size(); i++)
3645      composeIdentifier(t, "ClaimResponse", "identifier", element.getIdentifier().get(i), i);
3646    if (element.hasStatusElement())
3647      composeEnum(t, "ClaimResponse", "status", element.getStatusElement(), -1);
3648    if (element.hasType())
3649      composeCodeableConcept(t, "ClaimResponse", "type", element.getType(), -1);
3650    if (element.hasSubType())
3651      composeCodeableConcept(t, "ClaimResponse", "subType", element.getSubType(), -1);
3652    if (element.hasUseElement())
3653      composeEnum(t, "ClaimResponse", "use", element.getUseElement(), -1);
3654    if (element.hasPatient())
3655      composeReference(t, "ClaimResponse", "patient", element.getPatient(), -1);
3656    if (element.hasCreatedElement())
3657      composeDateTime(t, "ClaimResponse", "created", element.getCreatedElement(), -1);
3658    if (element.hasInsurer())
3659      composeReference(t, "ClaimResponse", "insurer", element.getInsurer(), -1);
3660    if (element.hasRequestor())
3661      composeReference(t, "ClaimResponse", "requestor", element.getRequestor(), -1);
3662    if (element.hasRequest())
3663      composeReference(t, "ClaimResponse", "request", element.getRequest(), -1);
3664    if (element.hasOutcomeElement())
3665      composeEnum(t, "ClaimResponse", "outcome", element.getOutcomeElement(), -1);
3666    if (element.hasDispositionElement())
3667      composeString(t, "ClaimResponse", "disposition", element.getDispositionElement(), -1);
3668    if (element.hasPreAuthRefElement())
3669      composeString(t, "ClaimResponse", "preAuthRef", element.getPreAuthRefElement(), -1);
3670    if (element.hasPreAuthPeriod())
3671      composePeriod(t, "ClaimResponse", "preAuthPeriod", element.getPreAuthPeriod(), -1);
3672    if (element.hasPayeeType())
3673      composeCodeableConcept(t, "ClaimResponse", "payeeType", element.getPayeeType(), -1);
3674    for (int i = 0; i < element.getItem().size(); i++)
3675      composeClaimResponseItemComponent(t, "ClaimResponse", "item", element.getItem().get(i), i);
3676    for (int i = 0; i < element.getAddItem().size(); i++)
3677      composeClaimResponseAddedItemComponent(t, "ClaimResponse", "addItem", element.getAddItem().get(i), i);
3678    for (int i = 0; i < element.getAdjudication().size(); i++)
3679      composeClaimResponseAdjudicationComponent(t, "ClaimResponse", "adjudication", element.getAdjudication().get(i),
3680          i);
3681    for (int i = 0; i < element.getTotal().size(); i++)
3682      composeClaimResponseTotalComponent(t, "ClaimResponse", "total", element.getTotal().get(i), i);
3683    if (element.hasPayment())
3684      composeClaimResponsePaymentComponent(t, "ClaimResponse", "payment", element.getPayment(), -1);
3685    if (element.hasFundsReserve())
3686      composeCodeableConcept(t, "ClaimResponse", "fundsReserve", element.getFundsReserve(), -1);
3687    if (element.hasFormCode())
3688      composeCodeableConcept(t, "ClaimResponse", "formCode", element.getFormCode(), -1);
3689    if (element.hasForm())
3690      composeAttachment(t, "ClaimResponse", "form", element.getForm(), -1);
3691    for (int i = 0; i < element.getProcessNote().size(); i++)
3692      composeClaimResponseNoteComponent(t, "ClaimResponse", "processNote", element.getProcessNote().get(i), i);
3693    for (int i = 0; i < element.getCommunicationRequest().size(); i++)
3694      composeReference(t, "ClaimResponse", "communicationRequest", element.getCommunicationRequest().get(i), i);
3695    for (int i = 0; i < element.getInsurance().size(); i++)
3696      composeClaimResponseInsuranceComponent(t, "ClaimResponse", "insurance", element.getInsurance().get(i), i);
3697    for (int i = 0; i < element.getError().size(); i++)
3698      composeClaimResponseErrorComponent(t, "ClaimResponse", "error", element.getError().get(i), i);
3699  }
3700
3701  protected void composeClaimResponseItemComponent(Complex parent, String parentType, String name,
3702      ClaimResponse.ItemComponent element, int index) {
3703    if (element == null)
3704      return;
3705    Complex t;
3706    if (Utilities.noString(parentType))
3707      t = parent;
3708    else {
3709      t = parent.predicate("fhir:" + parentType + '.' + name);
3710    }
3711    composeBackboneElement(t, "item", name, element, index);
3712    if (element.hasItemSequenceElement())
3713      composePositiveInt(t, "ClaimResponse", "itemSequence", element.getItemSequenceElement(), -1);
3714    for (int i = 0; i < element.getNoteNumber().size(); i++)
3715      composePositiveInt(t, "ClaimResponse", "noteNumber", element.getNoteNumber().get(i), i);
3716    for (int i = 0; i < element.getAdjudication().size(); i++)
3717      composeClaimResponseAdjudicationComponent(t, "ClaimResponse", "adjudication", element.getAdjudication().get(i),
3718          i);
3719    for (int i = 0; i < element.getDetail().size(); i++)
3720      composeClaimResponseItemDetailComponent(t, "ClaimResponse", "detail", element.getDetail().get(i), i);
3721  }
3722
3723  protected void composeClaimResponseAdjudicationComponent(Complex parent, String parentType, String name,
3724      ClaimResponse.AdjudicationComponent element, int index) {
3725    if (element == null)
3726      return;
3727    Complex t;
3728    if (Utilities.noString(parentType))
3729      t = parent;
3730    else {
3731      t = parent.predicate("fhir:" + parentType + '.' + name);
3732    }
3733    composeBackboneElement(t, "adjudication", name, element, index);
3734    if (element.hasCategory())
3735      composeCodeableConcept(t, "ClaimResponse", "category", element.getCategory(), -1);
3736    if (element.hasReason())
3737      composeCodeableConcept(t, "ClaimResponse", "reason", element.getReason(), -1);
3738    if (element.hasAmount())
3739      composeMoney(t, "ClaimResponse", "amount", element.getAmount(), -1);
3740    if (element.hasValueElement())
3741      composeDecimal(t, "ClaimResponse", "value", element.getValueElement(), -1);
3742  }
3743
3744  protected void composeClaimResponseItemDetailComponent(Complex parent, String parentType, String name,
3745      ClaimResponse.ItemDetailComponent element, int index) {
3746    if (element == null)
3747      return;
3748    Complex t;
3749    if (Utilities.noString(parentType))
3750      t = parent;
3751    else {
3752      t = parent.predicate("fhir:" + parentType + '.' + name);
3753    }
3754    composeBackboneElement(t, "detail", name, element, index);
3755    if (element.hasDetailSequenceElement())
3756      composePositiveInt(t, "ClaimResponse", "detailSequence", element.getDetailSequenceElement(), -1);
3757    for (int i = 0; i < element.getNoteNumber().size(); i++)
3758      composePositiveInt(t, "ClaimResponse", "noteNumber", element.getNoteNumber().get(i), i);
3759    for (int i = 0; i < element.getAdjudication().size(); i++)
3760      composeClaimResponseAdjudicationComponent(t, "ClaimResponse", "adjudication", element.getAdjudication().get(i),
3761          i);
3762    for (int i = 0; i < element.getSubDetail().size(); i++)
3763      composeClaimResponseSubDetailComponent(t, "ClaimResponse", "subDetail", element.getSubDetail().get(i), i);
3764  }
3765
3766  protected void composeClaimResponseSubDetailComponent(Complex parent, String parentType, String name,
3767      ClaimResponse.SubDetailComponent element, int index) {
3768    if (element == null)
3769      return;
3770    Complex t;
3771    if (Utilities.noString(parentType))
3772      t = parent;
3773    else {
3774      t = parent.predicate("fhir:" + parentType + '.' + name);
3775    }
3776    composeBackboneElement(t, "subDetail", name, element, index);
3777    if (element.hasSubDetailSequenceElement())
3778      composePositiveInt(t, "ClaimResponse", "subDetailSequence", element.getSubDetailSequenceElement(), -1);
3779    for (int i = 0; i < element.getNoteNumber().size(); i++)
3780      composePositiveInt(t, "ClaimResponse", "noteNumber", element.getNoteNumber().get(i), i);
3781    for (int i = 0; i < element.getAdjudication().size(); i++)
3782      composeClaimResponseAdjudicationComponent(t, "ClaimResponse", "adjudication", element.getAdjudication().get(i),
3783          i);
3784  }
3785
3786  protected void composeClaimResponseAddedItemComponent(Complex parent, String parentType, String name,
3787      ClaimResponse.AddedItemComponent element, int index) {
3788    if (element == null)
3789      return;
3790    Complex t;
3791    if (Utilities.noString(parentType))
3792      t = parent;
3793    else {
3794      t = parent.predicate("fhir:" + parentType + '.' + name);
3795    }
3796    composeBackboneElement(t, "addItem", name, element, index);
3797    for (int i = 0; i < element.getItemSequence().size(); i++)
3798      composePositiveInt(t, "ClaimResponse", "itemSequence", element.getItemSequence().get(i), i);
3799    for (int i = 0; i < element.getDetailSequence().size(); i++)
3800      composePositiveInt(t, "ClaimResponse", "detailSequence", element.getDetailSequence().get(i), i);
3801    for (int i = 0; i < element.getSubdetailSequence().size(); i++)
3802      composePositiveInt(t, "ClaimResponse", "subdetailSequence", element.getSubdetailSequence().get(i), i);
3803    for (int i = 0; i < element.getProvider().size(); i++)
3804      composeReference(t, "ClaimResponse", "provider", element.getProvider().get(i), i);
3805    if (element.hasProductOrService())
3806      composeCodeableConcept(t, "ClaimResponse", "productOrService", element.getProductOrService(), -1);
3807    for (int i = 0; i < element.getModifier().size(); i++)
3808      composeCodeableConcept(t, "ClaimResponse", "modifier", element.getModifier().get(i), i);
3809    for (int i = 0; i < element.getProgramCode().size(); i++)
3810      composeCodeableConcept(t, "ClaimResponse", "programCode", element.getProgramCode().get(i), i);
3811    if (element.hasServiced())
3812      composeType(t, "ClaimResponse", "serviced", element.getServiced(), -1);
3813    if (element.hasLocation())
3814      composeType(t, "ClaimResponse", "location", element.getLocation(), -1);
3815    if (element.hasQuantity())
3816      composeQuantity(t, "ClaimResponse", "quantity", element.getQuantity(), -1);
3817    if (element.hasUnitPrice())
3818      composeMoney(t, "ClaimResponse", "unitPrice", element.getUnitPrice(), -1);
3819    if (element.hasFactorElement())
3820      composeDecimal(t, "ClaimResponse", "factor", element.getFactorElement(), -1);
3821    if (element.hasNet())
3822      composeMoney(t, "ClaimResponse", "net", element.getNet(), -1);
3823    if (element.hasBodySite())
3824      composeCodeableConcept(t, "ClaimResponse", "bodySite", element.getBodySite(), -1);
3825    for (int i = 0; i < element.getSubSite().size(); i++)
3826      composeCodeableConcept(t, "ClaimResponse", "subSite", element.getSubSite().get(i), i);
3827    for (int i = 0; i < element.getNoteNumber().size(); i++)
3828      composePositiveInt(t, "ClaimResponse", "noteNumber", element.getNoteNumber().get(i), i);
3829    for (int i = 0; i < element.getAdjudication().size(); i++)
3830      composeClaimResponseAdjudicationComponent(t, "ClaimResponse", "adjudication", element.getAdjudication().get(i),
3831          i);
3832    for (int i = 0; i < element.getDetail().size(); i++)
3833      composeClaimResponseAddedItemDetailComponent(t, "ClaimResponse", "detail", element.getDetail().get(i), i);
3834  }
3835
3836  protected void composeClaimResponseAddedItemDetailComponent(Complex parent, String parentType, String name,
3837      ClaimResponse.AddedItemDetailComponent element, int index) {
3838    if (element == null)
3839      return;
3840    Complex t;
3841    if (Utilities.noString(parentType))
3842      t = parent;
3843    else {
3844      t = parent.predicate("fhir:" + parentType + '.' + name);
3845    }
3846    composeBackboneElement(t, "detail", name, element, index);
3847    if (element.hasProductOrService())
3848      composeCodeableConcept(t, "ClaimResponse", "productOrService", element.getProductOrService(), -1);
3849    for (int i = 0; i < element.getModifier().size(); i++)
3850      composeCodeableConcept(t, "ClaimResponse", "modifier", element.getModifier().get(i), i);
3851    if (element.hasQuantity())
3852      composeQuantity(t, "ClaimResponse", "quantity", element.getQuantity(), -1);
3853    if (element.hasUnitPrice())
3854      composeMoney(t, "ClaimResponse", "unitPrice", element.getUnitPrice(), -1);
3855    if (element.hasFactorElement())
3856      composeDecimal(t, "ClaimResponse", "factor", element.getFactorElement(), -1);
3857    if (element.hasNet())
3858      composeMoney(t, "ClaimResponse", "net", element.getNet(), -1);
3859    for (int i = 0; i < element.getNoteNumber().size(); i++)
3860      composePositiveInt(t, "ClaimResponse", "noteNumber", element.getNoteNumber().get(i), i);
3861    for (int i = 0; i < element.getAdjudication().size(); i++)
3862      composeClaimResponseAdjudicationComponent(t, "ClaimResponse", "adjudication", element.getAdjudication().get(i),
3863          i);
3864    for (int i = 0; i < element.getSubDetail().size(); i++)
3865      composeClaimResponseAddedItemSubDetailComponent(t, "ClaimResponse", "subDetail", element.getSubDetail().get(i),
3866          i);
3867  }
3868
3869  protected void composeClaimResponseAddedItemSubDetailComponent(Complex parent, String parentType, String name,
3870      ClaimResponse.AddedItemSubDetailComponent element, int index) {
3871    if (element == null)
3872      return;
3873    Complex t;
3874    if (Utilities.noString(parentType))
3875      t = parent;
3876    else {
3877      t = parent.predicate("fhir:" + parentType + '.' + name);
3878    }
3879    composeBackboneElement(t, "subDetail", name, element, index);
3880    if (element.hasProductOrService())
3881      composeCodeableConcept(t, "ClaimResponse", "productOrService", element.getProductOrService(), -1);
3882    for (int i = 0; i < element.getModifier().size(); i++)
3883      composeCodeableConcept(t, "ClaimResponse", "modifier", element.getModifier().get(i), i);
3884    if (element.hasQuantity())
3885      composeQuantity(t, "ClaimResponse", "quantity", element.getQuantity(), -1);
3886    if (element.hasUnitPrice())
3887      composeMoney(t, "ClaimResponse", "unitPrice", element.getUnitPrice(), -1);
3888    if (element.hasFactorElement())
3889      composeDecimal(t, "ClaimResponse", "factor", element.getFactorElement(), -1);
3890    if (element.hasNet())
3891      composeMoney(t, "ClaimResponse", "net", element.getNet(), -1);
3892    for (int i = 0; i < element.getNoteNumber().size(); i++)
3893      composePositiveInt(t, "ClaimResponse", "noteNumber", element.getNoteNumber().get(i), i);
3894    for (int i = 0; i < element.getAdjudication().size(); i++)
3895      composeClaimResponseAdjudicationComponent(t, "ClaimResponse", "adjudication", element.getAdjudication().get(i),
3896          i);
3897  }
3898
3899  protected void composeClaimResponseTotalComponent(Complex parent, String parentType, String name,
3900      ClaimResponse.TotalComponent element, int index) {
3901    if (element == null)
3902      return;
3903    Complex t;
3904    if (Utilities.noString(parentType))
3905      t = parent;
3906    else {
3907      t = parent.predicate("fhir:" + parentType + '.' + name);
3908    }
3909    composeBackboneElement(t, "total", name, element, index);
3910    if (element.hasCategory())
3911      composeCodeableConcept(t, "ClaimResponse", "category", element.getCategory(), -1);
3912    if (element.hasAmount())
3913      composeMoney(t, "ClaimResponse", "amount", element.getAmount(), -1);
3914  }
3915
3916  protected void composeClaimResponsePaymentComponent(Complex parent, String parentType, String name,
3917      ClaimResponse.PaymentComponent element, int index) {
3918    if (element == null)
3919      return;
3920    Complex t;
3921    if (Utilities.noString(parentType))
3922      t = parent;
3923    else {
3924      t = parent.predicate("fhir:" + parentType + '.' + name);
3925    }
3926    composeBackboneElement(t, "payment", name, element, index);
3927    if (element.hasType())
3928      composeCodeableConcept(t, "ClaimResponse", "type", element.getType(), -1);
3929    if (element.hasAdjustment())
3930      composeMoney(t, "ClaimResponse", "adjustment", element.getAdjustment(), -1);
3931    if (element.hasAdjustmentReason())
3932      composeCodeableConcept(t, "ClaimResponse", "adjustmentReason", element.getAdjustmentReason(), -1);
3933    if (element.hasDateElement())
3934      composeDate(t, "ClaimResponse", "date", element.getDateElement(), -1);
3935    if (element.hasAmount())
3936      composeMoney(t, "ClaimResponse", "amount", element.getAmount(), -1);
3937    if (element.hasIdentifier())
3938      composeIdentifier(t, "ClaimResponse", "identifier", element.getIdentifier(), -1);
3939  }
3940
3941  protected void composeClaimResponseNoteComponent(Complex parent, String parentType, String name,
3942      ClaimResponse.NoteComponent element, int index) {
3943    if (element == null)
3944      return;
3945    Complex t;
3946    if (Utilities.noString(parentType))
3947      t = parent;
3948    else {
3949      t = parent.predicate("fhir:" + parentType + '.' + name);
3950    }
3951    composeBackboneElement(t, "processNote", name, element, index);
3952    if (element.hasNumberElement())
3953      composePositiveInt(t, "ClaimResponse", "number", element.getNumberElement(), -1);
3954    if (element.hasTypeElement())
3955      composeEnum(t, "ClaimResponse", "type", element.getTypeElement(), -1);
3956    if (element.hasTextElement())
3957      composeString(t, "ClaimResponse", "text", element.getTextElement(), -1);
3958    if (element.hasLanguage())
3959      composeCodeableConcept(t, "ClaimResponse", "language", element.getLanguage(), -1);
3960  }
3961
3962  protected void composeClaimResponseInsuranceComponent(Complex parent, String parentType, String name,
3963      ClaimResponse.InsuranceComponent element, int index) {
3964    if (element == null)
3965      return;
3966    Complex t;
3967    if (Utilities.noString(parentType))
3968      t = parent;
3969    else {
3970      t = parent.predicate("fhir:" + parentType + '.' + name);
3971    }
3972    composeBackboneElement(t, "insurance", name, element, index);
3973    if (element.hasSequenceElement())
3974      composePositiveInt(t, "ClaimResponse", "sequence", element.getSequenceElement(), -1);
3975    if (element.hasFocalElement())
3976      composeBoolean(t, "ClaimResponse", "focal", element.getFocalElement(), -1);
3977    if (element.hasCoverage())
3978      composeReference(t, "ClaimResponse", "coverage", element.getCoverage(), -1);
3979    if (element.hasBusinessArrangementElement())
3980      composeString(t, "ClaimResponse", "businessArrangement", element.getBusinessArrangementElement(), -1);
3981    if (element.hasClaimResponse())
3982      composeReference(t, "ClaimResponse", "claimResponse", element.getClaimResponse(), -1);
3983  }
3984
3985  protected void composeClaimResponseErrorComponent(Complex parent, String parentType, String name,
3986      ClaimResponse.ErrorComponent element, int index) {
3987    if (element == null)
3988      return;
3989    Complex t;
3990    if (Utilities.noString(parentType))
3991      t = parent;
3992    else {
3993      t = parent.predicate("fhir:" + parentType + '.' + name);
3994    }
3995    composeBackboneElement(t, "error", name, element, index);
3996    if (element.hasItemSequenceElement())
3997      composePositiveInt(t, "ClaimResponse", "itemSequence", element.getItemSequenceElement(), -1);
3998    if (element.hasDetailSequenceElement())
3999      composePositiveInt(t, "ClaimResponse", "detailSequence", element.getDetailSequenceElement(), -1);
4000    if (element.hasSubDetailSequenceElement())
4001      composePositiveInt(t, "ClaimResponse", "subDetailSequence", element.getSubDetailSequenceElement(), -1);
4002    if (element.hasCode())
4003      composeCodeableConcept(t, "ClaimResponse", "code", element.getCode(), -1);
4004  }
4005
4006  protected void composeClinicalImpression(Complex parent, String parentType, String name, ClinicalImpression element,
4007      int index) {
4008    if (element == null)
4009      return;
4010    Complex t;
4011    if (Utilities.noString(parentType))
4012      t = parent;
4013    else {
4014      t = parent.predicate("fhir:" + parentType + '.' + name);
4015    }
4016    composeDomainResource(t, "ClinicalImpression", name, element, index);
4017    for (int i = 0; i < element.getIdentifier().size(); i++)
4018      composeIdentifier(t, "ClinicalImpression", "identifier", element.getIdentifier().get(i), i);
4019    if (element.hasStatusElement())
4020      composeEnum(t, "ClinicalImpression", "status", element.getStatusElement(), -1);
4021    if (element.hasStatusReason())
4022      composeCodeableConcept(t, "ClinicalImpression", "statusReason", element.getStatusReason(), -1);
4023    if (element.hasCode())
4024      composeCodeableConcept(t, "ClinicalImpression", "code", element.getCode(), -1);
4025    if (element.hasDescriptionElement())
4026      composeString(t, "ClinicalImpression", "description", element.getDescriptionElement(), -1);
4027    if (element.hasSubject())
4028      composeReference(t, "ClinicalImpression", "subject", element.getSubject(), -1);
4029    if (element.hasEncounter())
4030      composeReference(t, "ClinicalImpression", "encounter", element.getEncounter(), -1);
4031    if (element.hasEffective())
4032      composeType(t, "ClinicalImpression", "effective", element.getEffective(), -1);
4033    if (element.hasDateElement())
4034      composeDateTime(t, "ClinicalImpression", "date", element.getDateElement(), -1);
4035    if (element.hasAssessor())
4036      composeReference(t, "ClinicalImpression", "assessor", element.getAssessor(), -1);
4037    if (element.hasPrevious())
4038      composeReference(t, "ClinicalImpression", "previous", element.getPrevious(), -1);
4039    for (int i = 0; i < element.getProblem().size(); i++)
4040      composeReference(t, "ClinicalImpression", "problem", element.getProblem().get(i), i);
4041    for (int i = 0; i < element.getInvestigation().size(); i++)
4042      composeClinicalImpressionClinicalImpressionInvestigationComponent(t, "ClinicalImpression", "investigation",
4043          element.getInvestigation().get(i), i);
4044    for (int i = 0; i < element.getProtocol().size(); i++)
4045      composeUri(t, "ClinicalImpression", "protocol", element.getProtocol().get(i), i);
4046    if (element.hasSummaryElement())
4047      composeString(t, "ClinicalImpression", "summary", element.getSummaryElement(), -1);
4048    for (int i = 0; i < element.getFinding().size(); i++)
4049      composeClinicalImpressionClinicalImpressionFindingComponent(t, "ClinicalImpression", "finding",
4050          element.getFinding().get(i), i);
4051    for (int i = 0; i < element.getPrognosisCodeableConcept().size(); i++)
4052      composeCodeableConcept(t, "ClinicalImpression", "prognosisCodeableConcept",
4053          element.getPrognosisCodeableConcept().get(i), i);
4054    for (int i = 0; i < element.getPrognosisReference().size(); i++)
4055      composeReference(t, "ClinicalImpression", "prognosisReference", element.getPrognosisReference().get(i), i);
4056    for (int i = 0; i < element.getSupportingInfo().size(); i++)
4057      composeReference(t, "ClinicalImpression", "supportingInfo", element.getSupportingInfo().get(i), i);
4058    for (int i = 0; i < element.getNote().size(); i++)
4059      composeAnnotation(t, "ClinicalImpression", "note", element.getNote().get(i), i);
4060  }
4061
4062  protected void composeClinicalImpressionClinicalImpressionInvestigationComponent(Complex parent, String parentType,
4063      String name, ClinicalImpression.ClinicalImpressionInvestigationComponent element, int index) {
4064    if (element == null)
4065      return;
4066    Complex t;
4067    if (Utilities.noString(parentType))
4068      t = parent;
4069    else {
4070      t = parent.predicate("fhir:" + parentType + '.' + name);
4071    }
4072    composeBackboneElement(t, "investigation", name, element, index);
4073    if (element.hasCode())
4074      composeCodeableConcept(t, "ClinicalImpression", "code", element.getCode(), -1);
4075    for (int i = 0; i < element.getItem().size(); i++)
4076      composeReference(t, "ClinicalImpression", "item", element.getItem().get(i), i);
4077  }
4078
4079  protected void composeClinicalImpressionClinicalImpressionFindingComponent(Complex parent, String parentType,
4080      String name, ClinicalImpression.ClinicalImpressionFindingComponent element, int index) {
4081    if (element == null)
4082      return;
4083    Complex t;
4084    if (Utilities.noString(parentType))
4085      t = parent;
4086    else {
4087      t = parent.predicate("fhir:" + parentType + '.' + name);
4088    }
4089    composeBackboneElement(t, "finding", name, element, index);
4090    if (element.hasItemCodeableConcept())
4091      composeCodeableConcept(t, "ClinicalImpression", "itemCodeableConcept", element.getItemCodeableConcept(), -1);
4092    if (element.hasItemReference())
4093      composeReference(t, "ClinicalImpression", "itemReference", element.getItemReference(), -1);
4094    if (element.hasBasisElement())
4095      composeString(t, "ClinicalImpression", "basis", element.getBasisElement(), -1);
4096  }
4097
4098  protected void composeCodeSystem(Complex parent, String parentType, String name, CodeSystem element, int index) {
4099    if (element == null)
4100      return;
4101    Complex t;
4102    if (Utilities.noString(parentType))
4103      t = parent;
4104    else {
4105      t = parent.predicate("fhir:" + parentType + '.' + name);
4106    }
4107    composeDomainResource(t, "CodeSystem", name, element, index);
4108    if (element.hasUrlElement())
4109      composeUri(t, "CodeSystem", "url", element.getUrlElement(), -1);
4110    for (int i = 0; i < element.getIdentifier().size(); i++)
4111      composeIdentifier(t, "CodeSystem", "identifier", element.getIdentifier().get(i), i);
4112    if (element.hasVersionElement())
4113      composeString(t, "CodeSystem", "version", element.getVersionElement(), -1);
4114    if (element.hasNameElement())
4115      composeString(t, "CodeSystem", "name", element.getNameElement(), -1);
4116    if (element.hasTitleElement())
4117      composeString(t, "CodeSystem", "title", element.getTitleElement(), -1);
4118    if (element.hasStatusElement())
4119      composeEnum(t, "CodeSystem", "status", element.getStatusElement(), -1);
4120    if (element.hasExperimentalElement())
4121      composeBoolean(t, "CodeSystem", "experimental", element.getExperimentalElement(), -1);
4122    if (element.hasDateElement())
4123      composeDateTime(t, "CodeSystem", "date", element.getDateElement(), -1);
4124    if (element.hasPublisherElement())
4125      composeString(t, "CodeSystem", "publisher", element.getPublisherElement(), -1);
4126    for (int i = 0; i < element.getContact().size(); i++)
4127      composeContactDetail(t, "CodeSystem", "contact", element.getContact().get(i), i);
4128    if (element.hasDescriptionElement())
4129      composeMarkdown(t, "CodeSystem", "description", element.getDescriptionElement(), -1);
4130    for (int i = 0; i < element.getUseContext().size(); i++)
4131      composeUsageContext(t, "CodeSystem", "useContext", element.getUseContext().get(i), i);
4132    for (int i = 0; i < element.getJurisdiction().size(); i++)
4133      composeCodeableConcept(t, "CodeSystem", "jurisdiction", element.getJurisdiction().get(i), i);
4134    if (element.hasPurposeElement())
4135      composeMarkdown(t, "CodeSystem", "purpose", element.getPurposeElement(), -1);
4136    if (element.hasCopyrightElement())
4137      composeMarkdown(t, "CodeSystem", "copyright", element.getCopyrightElement(), -1);
4138    if (element.hasCaseSensitiveElement())
4139      composeBoolean(t, "CodeSystem", "caseSensitive", element.getCaseSensitiveElement(), -1);
4140    if (element.hasValueSetElement())
4141      composeCanonical(t, "CodeSystem", "valueSet", element.getValueSetElement(), -1);
4142    if (element.hasHierarchyMeaningElement())
4143      composeEnum(t, "CodeSystem", "hierarchyMeaning", element.getHierarchyMeaningElement(), -1);
4144    if (element.hasCompositionalElement())
4145      composeBoolean(t, "CodeSystem", "compositional", element.getCompositionalElement(), -1);
4146    if (element.hasVersionNeededElement())
4147      composeBoolean(t, "CodeSystem", "versionNeeded", element.getVersionNeededElement(), -1);
4148    if (element.hasContentElement())
4149      composeEnum(t, "CodeSystem", "content", element.getContentElement(), -1);
4150    if (element.hasSupplementsElement())
4151      composeCanonical(t, "CodeSystem", "supplements", element.getSupplementsElement(), -1);
4152    if (element.hasCountElement())
4153      composeUnsignedInt(t, "CodeSystem", "count", element.getCountElement(), -1);
4154    for (int i = 0; i < element.getFilter().size(); i++)
4155      composeCodeSystemCodeSystemFilterComponent(t, "CodeSystem", "filter", element.getFilter().get(i), i);
4156    for (int i = 0; i < element.getProperty().size(); i++)
4157      composeCodeSystemPropertyComponent(t, "CodeSystem", "property", element.getProperty().get(i), i);
4158    for (int i = 0; i < element.getConcept().size(); i++)
4159      composeCodeSystemConceptDefinitionComponent(t, "CodeSystem", "concept", element.getConcept().get(i), i);
4160  }
4161
4162  protected void composeCodeSystemCodeSystemFilterComponent(Complex parent, String parentType, String name,
4163      CodeSystem.CodeSystemFilterComponent element, int index) {
4164    if (element == null)
4165      return;
4166    Complex t;
4167    if (Utilities.noString(parentType))
4168      t = parent;
4169    else {
4170      t = parent.predicate("fhir:" + parentType + '.' + name);
4171    }
4172    composeBackboneElement(t, "filter", name, element, index);
4173    if (element.hasCodeElement())
4174      composeCode(t, "CodeSystem", "code", element.getCodeElement(), -1);
4175    if (element.hasDescriptionElement())
4176      composeString(t, "CodeSystem", "description", element.getDescriptionElement(), -1);
4177    for (int i = 0; i < element.getOperator().size(); i++)
4178      composeEnum(t, "CodeSystem", "operator", element.getOperator().get(i), i);
4179    if (element.hasValueElement())
4180      composeString(t, "CodeSystem", "value", element.getValueElement(), -1);
4181  }
4182
4183  protected void composeCodeSystemPropertyComponent(Complex parent, String parentType, String name,
4184      CodeSystem.PropertyComponent element, int index) {
4185    if (element == null)
4186      return;
4187    Complex t;
4188    if (Utilities.noString(parentType))
4189      t = parent;
4190    else {
4191      t = parent.predicate("fhir:" + parentType + '.' + name);
4192    }
4193    composeBackboneElement(t, "property", name, element, index);
4194    if (element.hasCodeElement())
4195      composeCode(t, "CodeSystem", "code", element.getCodeElement(), -1);
4196    if (element.hasUriElement())
4197      composeUri(t, "CodeSystem", "uri", element.getUriElement(), -1);
4198    if (element.hasDescriptionElement())
4199      composeString(t, "CodeSystem", "description", element.getDescriptionElement(), -1);
4200    if (element.hasTypeElement())
4201      composeEnum(t, "CodeSystem", "type", element.getTypeElement(), -1);
4202  }
4203
4204  protected void composeCodeSystemConceptDefinitionComponent(Complex parent, String parentType, String name,
4205      CodeSystem.ConceptDefinitionComponent element, int index) {
4206    if (element == null)
4207      return;
4208    Complex t;
4209    if (Utilities.noString(parentType))
4210      t = parent;
4211    else {
4212      t = parent.predicate("fhir:" + parentType + '.' + name);
4213    }
4214    composeBackboneElement(t, "concept", name, element, index);
4215    if (element.hasCodeElement())
4216      composeCode(t, "CodeSystem", "code", element.getCodeElement(), -1);
4217    if (element.hasDisplayElement())
4218      composeString(t, "CodeSystem", "display", element.getDisplayElement(), -1);
4219    if (element.hasDefinitionElement())
4220      composeString(t, "CodeSystem", "definition", element.getDefinitionElement(), -1);
4221    for (int i = 0; i < element.getDesignation().size(); i++)
4222      composeCodeSystemConceptDefinitionDesignationComponent(t, "CodeSystem", "designation",
4223          element.getDesignation().get(i), i);
4224    for (int i = 0; i < element.getProperty().size(); i++)
4225      composeCodeSystemConceptPropertyComponent(t, "CodeSystem", "property", element.getProperty().get(i), i);
4226    for (int i = 0; i < element.getConcept().size(); i++)
4227      composeCodeSystemConceptDefinitionComponent(t, "CodeSystem", "concept", element.getConcept().get(i), i);
4228  }
4229
4230  protected void composeCodeSystemConceptDefinitionDesignationComponent(Complex parent, String parentType, String name,
4231      CodeSystem.ConceptDefinitionDesignationComponent element, int index) {
4232    if (element == null)
4233      return;
4234    Complex t;
4235    if (Utilities.noString(parentType))
4236      t = parent;
4237    else {
4238      t = parent.predicate("fhir:" + parentType + '.' + name);
4239    }
4240    composeBackboneElement(t, "designation", name, element, index);
4241    if (element.hasLanguageElement())
4242      composeCode(t, "CodeSystem", "language", element.getLanguageElement(), -1);
4243    if (element.hasUse())
4244      composeCoding(t, "CodeSystem", "use", element.getUse(), -1);
4245    if (element.hasValueElement())
4246      composeString(t, "CodeSystem", "value", element.getValueElement(), -1);
4247  }
4248
4249  protected void composeCodeSystemConceptPropertyComponent(Complex parent, String parentType, String name,
4250      CodeSystem.ConceptPropertyComponent element, int index) {
4251    if (element == null)
4252      return;
4253    Complex t;
4254    if (Utilities.noString(parentType))
4255      t = parent;
4256    else {
4257      t = parent.predicate("fhir:" + parentType + '.' + name);
4258    }
4259    composeBackboneElement(t, "property", name, element, index);
4260    if (element.hasCodeElement())
4261      composeCode(t, "CodeSystem", "code", element.getCodeElement(), -1);
4262    if (element.hasValue())
4263      composeType(t, "CodeSystem", "value", element.getValue(), -1);
4264  }
4265
4266  protected void composeCommunication(Complex parent, String parentType, String name, Communication element,
4267      int index) {
4268    if (element == null)
4269      return;
4270    Complex t;
4271    if (Utilities.noString(parentType))
4272      t = parent;
4273    else {
4274      t = parent.predicate("fhir:" + parentType + '.' + name);
4275    }
4276    composeDomainResource(t, "Communication", name, element, index);
4277    for (int i = 0; i < element.getIdentifier().size(); i++)
4278      composeIdentifier(t, "Communication", "identifier", element.getIdentifier().get(i), i);
4279    for (int i = 0; i < element.getInstantiatesCanonical().size(); i++)
4280      composeCanonical(t, "Communication", "instantiatesCanonical", element.getInstantiatesCanonical().get(i), i);
4281    for (int i = 0; i < element.getInstantiatesUri().size(); i++)
4282      composeUri(t, "Communication", "instantiatesUri", element.getInstantiatesUri().get(i), i);
4283    for (int i = 0; i < element.getBasedOn().size(); i++)
4284      composeReference(t, "Communication", "basedOn", element.getBasedOn().get(i), i);
4285    for (int i = 0; i < element.getPartOf().size(); i++)
4286      composeReference(t, "Communication", "partOf", element.getPartOf().get(i), i);
4287    for (int i = 0; i < element.getInResponseTo().size(); i++)
4288      composeReference(t, "Communication", "inResponseTo", element.getInResponseTo().get(i), i);
4289    if (element.hasStatusElement())
4290      composeEnum(t, "Communication", "status", element.getStatusElement(), -1);
4291    if (element.hasStatusReason())
4292      composeCodeableConcept(t, "Communication", "statusReason", element.getStatusReason(), -1);
4293    for (int i = 0; i < element.getCategory().size(); i++)
4294      composeCodeableConcept(t, "Communication", "category", element.getCategory().get(i), i);
4295    if (element.hasPriorityElement())
4296      composeEnum(t, "Communication", "priority", element.getPriorityElement(), -1);
4297    for (int i = 0; i < element.getMedium().size(); i++)
4298      composeCodeableConcept(t, "Communication", "medium", element.getMedium().get(i), i);
4299    if (element.hasSubject())
4300      composeReference(t, "Communication", "subject", element.getSubject(), -1);
4301    if (element.hasTopic())
4302      composeCodeableConcept(t, "Communication", "topic", element.getTopic(), -1);
4303    for (int i = 0; i < element.getAbout().size(); i++)
4304      composeReference(t, "Communication", "about", element.getAbout().get(i), i);
4305    if (element.hasEncounter())
4306      composeReference(t, "Communication", "encounter", element.getEncounter(), -1);
4307    if (element.hasSentElement())
4308      composeDateTime(t, "Communication", "sent", element.getSentElement(), -1);
4309    if (element.hasReceivedElement())
4310      composeDateTime(t, "Communication", "received", element.getReceivedElement(), -1);
4311    for (int i = 0; i < element.getRecipient().size(); i++)
4312      composeReference(t, "Communication", "recipient", element.getRecipient().get(i), i);
4313    if (element.hasSender())
4314      composeReference(t, "Communication", "sender", element.getSender(), -1);
4315    for (int i = 0; i < element.getReasonCode().size(); i++)
4316      composeCodeableConcept(t, "Communication", "reasonCode", element.getReasonCode().get(i), i);
4317    for (int i = 0; i < element.getReasonReference().size(); i++)
4318      composeReference(t, "Communication", "reasonReference", element.getReasonReference().get(i), i);
4319    for (int i = 0; i < element.getPayload().size(); i++)
4320      composeCommunicationCommunicationPayloadComponent(t, "Communication", "payload", element.getPayload().get(i), i);
4321    for (int i = 0; i < element.getNote().size(); i++)
4322      composeAnnotation(t, "Communication", "note", element.getNote().get(i), i);
4323  }
4324
4325  protected void composeCommunicationCommunicationPayloadComponent(Complex parent, String parentType, String name,
4326      Communication.CommunicationPayloadComponent element, int index) {
4327    if (element == null)
4328      return;
4329    Complex t;
4330    if (Utilities.noString(parentType))
4331      t = parent;
4332    else {
4333      t = parent.predicate("fhir:" + parentType + '.' + name);
4334    }
4335    composeBackboneElement(t, "payload", name, element, index);
4336    if (element.hasContent())
4337      composeType(t, "Communication", "content", element.getContent(), -1);
4338  }
4339
4340  protected void composeCommunicationRequest(Complex parent, String parentType, String name,
4341      CommunicationRequest element, int index) {
4342    if (element == null)
4343      return;
4344    Complex t;
4345    if (Utilities.noString(parentType))
4346      t = parent;
4347    else {
4348      t = parent.predicate("fhir:" + parentType + '.' + name);
4349    }
4350    composeDomainResource(t, "CommunicationRequest", name, element, index);
4351    for (int i = 0; i < element.getIdentifier().size(); i++)
4352      composeIdentifier(t, "CommunicationRequest", "identifier", element.getIdentifier().get(i), i);
4353    for (int i = 0; i < element.getBasedOn().size(); i++)
4354      composeReference(t, "CommunicationRequest", "basedOn", element.getBasedOn().get(i), i);
4355    for (int i = 0; i < element.getReplaces().size(); i++)
4356      composeReference(t, "CommunicationRequest", "replaces", element.getReplaces().get(i), i);
4357    if (element.hasGroupIdentifier())
4358      composeIdentifier(t, "CommunicationRequest", "groupIdentifier", element.getGroupIdentifier(), -1);
4359    if (element.hasStatusElement())
4360      composeEnum(t, "CommunicationRequest", "status", element.getStatusElement(), -1);
4361    if (element.hasStatusReason())
4362      composeCodeableConcept(t, "CommunicationRequest", "statusReason", element.getStatusReason(), -1);
4363    for (int i = 0; i < element.getCategory().size(); i++)
4364      composeCodeableConcept(t, "CommunicationRequest", "category", element.getCategory().get(i), i);
4365    if (element.hasPriorityElement())
4366      composeEnum(t, "CommunicationRequest", "priority", element.getPriorityElement(), -1);
4367    if (element.hasDoNotPerformElement())
4368      composeBoolean(t, "CommunicationRequest", "doNotPerform", element.getDoNotPerformElement(), -1);
4369    for (int i = 0; i < element.getMedium().size(); i++)
4370      composeCodeableConcept(t, "CommunicationRequest", "medium", element.getMedium().get(i), i);
4371    if (element.hasSubject())
4372      composeReference(t, "CommunicationRequest", "subject", element.getSubject(), -1);
4373    for (int i = 0; i < element.getAbout().size(); i++)
4374      composeReference(t, "CommunicationRequest", "about", element.getAbout().get(i), i);
4375    if (element.hasEncounter())
4376      composeReference(t, "CommunicationRequest", "encounter", element.getEncounter(), -1);
4377    for (int i = 0; i < element.getPayload().size(); i++)
4378      composeCommunicationRequestCommunicationRequestPayloadComponent(t, "CommunicationRequest", "payload",
4379          element.getPayload().get(i), i);
4380    if (element.hasOccurrence())
4381      composeType(t, "CommunicationRequest", "occurrence", element.getOccurrence(), -1);
4382    if (element.hasAuthoredOnElement())
4383      composeDateTime(t, "CommunicationRequest", "authoredOn", element.getAuthoredOnElement(), -1);
4384    if (element.hasRequester())
4385      composeReference(t, "CommunicationRequest", "requester", element.getRequester(), -1);
4386    for (int i = 0; i < element.getRecipient().size(); i++)
4387      composeReference(t, "CommunicationRequest", "recipient", element.getRecipient().get(i), i);
4388    if (element.hasSender())
4389      composeReference(t, "CommunicationRequest", "sender", element.getSender(), -1);
4390    for (int i = 0; i < element.getReasonCode().size(); i++)
4391      composeCodeableConcept(t, "CommunicationRequest", "reasonCode", element.getReasonCode().get(i), i);
4392    for (int i = 0; i < element.getReasonReference().size(); i++)
4393      composeReference(t, "CommunicationRequest", "reasonReference", element.getReasonReference().get(i), i);
4394    for (int i = 0; i < element.getNote().size(); i++)
4395      composeAnnotation(t, "CommunicationRequest", "note", element.getNote().get(i), i);
4396  }
4397
4398  protected void composeCommunicationRequestCommunicationRequestPayloadComponent(Complex parent, String parentType,
4399      String name, CommunicationRequest.CommunicationRequestPayloadComponent element, int index) {
4400    if (element == null)
4401      return;
4402    Complex t;
4403    if (Utilities.noString(parentType))
4404      t = parent;
4405    else {
4406      t = parent.predicate("fhir:" + parentType + '.' + name);
4407    }
4408    composeBackboneElement(t, "payload", name, element, index);
4409    if (element.hasContent())
4410      composeType(t, "CommunicationRequest", "content", element.getContent(), -1);
4411  }
4412
4413  protected void composeCompartmentDefinition(Complex parent, String parentType, String name,
4414      CompartmentDefinition element, int index) {
4415    if (element == null)
4416      return;
4417    Complex t;
4418    if (Utilities.noString(parentType))
4419      t = parent;
4420    else {
4421      t = parent.predicate("fhir:" + parentType + '.' + name);
4422    }
4423    composeDomainResource(t, "CompartmentDefinition", name, element, index);
4424    if (element.hasUrlElement())
4425      composeUri(t, "CompartmentDefinition", "url", element.getUrlElement(), -1);
4426    if (element.hasVersionElement())
4427      composeString(t, "CompartmentDefinition", "version", element.getVersionElement(), -1);
4428    if (element.hasNameElement())
4429      composeString(t, "CompartmentDefinition", "name", element.getNameElement(), -1);
4430    if (element.hasStatusElement())
4431      composeEnum(t, "CompartmentDefinition", "status", element.getStatusElement(), -1);
4432    if (element.hasExperimentalElement())
4433      composeBoolean(t, "CompartmentDefinition", "experimental", element.getExperimentalElement(), -1);
4434    if (element.hasDateElement())
4435      composeDateTime(t, "CompartmentDefinition", "date", element.getDateElement(), -1);
4436    if (element.hasPublisherElement())
4437      composeString(t, "CompartmentDefinition", "publisher", element.getPublisherElement(), -1);
4438    for (int i = 0; i < element.getContact().size(); i++)
4439      composeContactDetail(t, "CompartmentDefinition", "contact", element.getContact().get(i), i);
4440    if (element.hasDescriptionElement())
4441      composeMarkdown(t, "CompartmentDefinition", "description", element.getDescriptionElement(), -1);
4442    for (int i = 0; i < element.getUseContext().size(); i++)
4443      composeUsageContext(t, "CompartmentDefinition", "useContext", element.getUseContext().get(i), i);
4444    if (element.hasPurposeElement())
4445      composeMarkdown(t, "CompartmentDefinition", "purpose", element.getPurposeElement(), -1);
4446    if (element.hasCodeElement())
4447      composeEnum(t, "CompartmentDefinition", "code", element.getCodeElement(), -1);
4448    if (element.hasSearchElement())
4449      composeBoolean(t, "CompartmentDefinition", "search", element.getSearchElement(), -1);
4450    for (int i = 0; i < element.getResource().size(); i++)
4451      composeCompartmentDefinitionCompartmentDefinitionResourceComponent(t, "CompartmentDefinition", "resource",
4452          element.getResource().get(i), i);
4453  }
4454
4455  protected void composeCompartmentDefinitionCompartmentDefinitionResourceComponent(Complex parent, String parentType,
4456      String name, CompartmentDefinition.CompartmentDefinitionResourceComponent element, int index) {
4457    if (element == null)
4458      return;
4459    Complex t;
4460    if (Utilities.noString(parentType))
4461      t = parent;
4462    else {
4463      t = parent.predicate("fhir:" + parentType + '.' + name);
4464    }
4465    composeBackboneElement(t, "resource", name, element, index);
4466    if (element.hasCodeElement())
4467      composeCode(t, "CompartmentDefinition", "code", element.getCodeElement(), -1);
4468    for (int i = 0; i < element.getParam().size(); i++)
4469      composeString(t, "CompartmentDefinition", "param", element.getParam().get(i), i);
4470    if (element.hasDocumentationElement())
4471      composeString(t, "CompartmentDefinition", "documentation", element.getDocumentationElement(), -1);
4472  }
4473
4474  protected void composeComposition(Complex parent, String parentType, String name, Composition element, int index) {
4475    if (element == null)
4476      return;
4477    Complex t;
4478    if (Utilities.noString(parentType))
4479      t = parent;
4480    else {
4481      t = parent.predicate("fhir:" + parentType + '.' + name);
4482    }
4483    composeDomainResource(t, "Composition", name, element, index);
4484    if (element.hasIdentifier())
4485      composeIdentifier(t, "Composition", "identifier", element.getIdentifier(), -1);
4486    if (element.hasStatusElement())
4487      composeEnum(t, "Composition", "status", element.getStatusElement(), -1);
4488    if (element.hasType())
4489      composeCodeableConcept(t, "Composition", "type", element.getType(), -1);
4490    for (int i = 0; i < element.getCategory().size(); i++)
4491      composeCodeableConcept(t, "Composition", "category", element.getCategory().get(i), i);
4492    if (element.hasSubject())
4493      composeReference(t, "Composition", "subject", element.getSubject(), -1);
4494    if (element.hasEncounter())
4495      composeReference(t, "Composition", "encounter", element.getEncounter(), -1);
4496    if (element.hasDateElement())
4497      composeDateTime(t, "Composition", "date", element.getDateElement(), -1);
4498    for (int i = 0; i < element.getAuthor().size(); i++)
4499      composeReference(t, "Composition", "author", element.getAuthor().get(i), i);
4500    if (element.hasTitleElement())
4501      composeString(t, "Composition", "title", element.getTitleElement(), -1);
4502    if (element.hasConfidentialityElement())
4503      composeEnum(t, "Composition", "confidentiality", element.getConfidentialityElement(), -1);
4504    for (int i = 0; i < element.getAttester().size(); i++)
4505      composeCompositionCompositionAttesterComponent(t, "Composition", "attester", element.getAttester().get(i), i);
4506    if (element.hasCustodian())
4507      composeReference(t, "Composition", "custodian", element.getCustodian(), -1);
4508    for (int i = 0; i < element.getRelatesTo().size(); i++)
4509      composeCompositionCompositionRelatesToComponent(t, "Composition", "relatesTo", element.getRelatesTo().get(i), i);
4510    for (int i = 0; i < element.getEvent().size(); i++)
4511      composeCompositionCompositionEventComponent(t, "Composition", "event", element.getEvent().get(i), i);
4512    for (int i = 0; i < element.getSection().size(); i++)
4513      composeCompositionSectionComponent(t, "Composition", "section", element.getSection().get(i), i);
4514  }
4515
4516  protected void composeCompositionCompositionAttesterComponent(Complex parent, String parentType, String name,
4517      Composition.CompositionAttesterComponent element, int index) {
4518    if (element == null)
4519      return;
4520    Complex t;
4521    if (Utilities.noString(parentType))
4522      t = parent;
4523    else {
4524      t = parent.predicate("fhir:" + parentType + '.' + name);
4525    }
4526    composeBackboneElement(t, "attester", name, element, index);
4527    if (element.hasModeElement())
4528      composeEnum(t, "Composition", "mode", element.getModeElement(), -1);
4529    if (element.hasTimeElement())
4530      composeDateTime(t, "Composition", "time", element.getTimeElement(), -1);
4531    if (element.hasParty())
4532      composeReference(t, "Composition", "party", element.getParty(), -1);
4533  }
4534
4535  protected void composeCompositionCompositionRelatesToComponent(Complex parent, String parentType, String name,
4536      Composition.CompositionRelatesToComponent element, int index) {
4537    if (element == null)
4538      return;
4539    Complex t;
4540    if (Utilities.noString(parentType))
4541      t = parent;
4542    else {
4543      t = parent.predicate("fhir:" + parentType + '.' + name);
4544    }
4545    composeBackboneElement(t, "relatesTo", name, element, index);
4546    if (element.hasCodeElement())
4547      composeEnum(t, "Composition", "code", element.getCodeElement(), -1);
4548    if (element.hasTarget())
4549      composeType(t, "Composition", "target", element.getTarget(), -1);
4550  }
4551
4552  protected void composeCompositionCompositionEventComponent(Complex parent, String parentType, String name,
4553      Composition.CompositionEventComponent element, int index) {
4554    if (element == null)
4555      return;
4556    Complex t;
4557    if (Utilities.noString(parentType))
4558      t = parent;
4559    else {
4560      t = parent.predicate("fhir:" + parentType + '.' + name);
4561    }
4562    composeBackboneElement(t, "event", name, element, index);
4563    for (int i = 0; i < element.getCode().size(); i++)
4564      composeCodeableConcept(t, "Composition", "code", element.getCode().get(i), i);
4565    if (element.hasPeriod())
4566      composePeriod(t, "Composition", "period", element.getPeriod(), -1);
4567    for (int i = 0; i < element.getDetail().size(); i++)
4568      composeReference(t, "Composition", "detail", element.getDetail().get(i), i);
4569  }
4570
4571  protected void composeCompositionSectionComponent(Complex parent, String parentType, String name,
4572      Composition.SectionComponent element, int index) {
4573    if (element == null)
4574      return;
4575    Complex t;
4576    if (Utilities.noString(parentType))
4577      t = parent;
4578    else {
4579      t = parent.predicate("fhir:" + parentType + '.' + name);
4580    }
4581    composeBackboneElement(t, "section", name, element, index);
4582    if (element.hasTitleElement())
4583      composeString(t, "Composition", "title", element.getTitleElement(), -1);
4584    if (element.hasCode())
4585      composeCodeableConcept(t, "Composition", "code", element.getCode(), -1);
4586    for (int i = 0; i < element.getAuthor().size(); i++)
4587      composeReference(t, "Composition", "author", element.getAuthor().get(i), i);
4588    if (element.hasFocus())
4589      composeReference(t, "Composition", "focus", element.getFocus(), -1);
4590    if (element.hasText())
4591      composeNarrative(t, "Composition", "text", element.getText(), -1);
4592    if (element.hasModeElement())
4593      composeEnum(t, "Composition", "mode", element.getModeElement(), -1);
4594    if (element.hasOrderedBy())
4595      composeCodeableConcept(t, "Composition", "orderedBy", element.getOrderedBy(), -1);
4596    for (int i = 0; i < element.getEntry().size(); i++)
4597      composeReference(t, "Composition", "entry", element.getEntry().get(i), i);
4598    if (element.hasEmptyReason())
4599      composeCodeableConcept(t, "Composition", "emptyReason", element.getEmptyReason(), -1);
4600    for (int i = 0; i < element.getSection().size(); i++)
4601      composeCompositionSectionComponent(t, "Composition", "section", element.getSection().get(i), i);
4602  }
4603
4604  protected void composeConceptMap(Complex parent, String parentType, String name, ConceptMap element, int index) {
4605    if (element == null)
4606      return;
4607    Complex t;
4608    if (Utilities.noString(parentType))
4609      t = parent;
4610    else {
4611      t = parent.predicate("fhir:" + parentType + '.' + name);
4612    }
4613    composeDomainResource(t, "ConceptMap", name, element, index);
4614    if (element.hasUrlElement())
4615      composeUri(t, "ConceptMap", "url", element.getUrlElement(), -1);
4616    if (element.hasIdentifier())
4617      composeIdentifier(t, "ConceptMap", "identifier", element.getIdentifier(), -1);
4618    if (element.hasVersionElement())
4619      composeString(t, "ConceptMap", "version", element.getVersionElement(), -1);
4620    if (element.hasNameElement())
4621      composeString(t, "ConceptMap", "name", element.getNameElement(), -1);
4622    if (element.hasTitleElement())
4623      composeString(t, "ConceptMap", "title", element.getTitleElement(), -1);
4624    if (element.hasStatusElement())
4625      composeEnum(t, "ConceptMap", "status", element.getStatusElement(), -1);
4626    if (element.hasExperimentalElement())
4627      composeBoolean(t, "ConceptMap", "experimental", element.getExperimentalElement(), -1);
4628    if (element.hasDateElement())
4629      composeDateTime(t, "ConceptMap", "date", element.getDateElement(), -1);
4630    if (element.hasPublisherElement())
4631      composeString(t, "ConceptMap", "publisher", element.getPublisherElement(), -1);
4632    for (int i = 0; i < element.getContact().size(); i++)
4633      composeContactDetail(t, "ConceptMap", "contact", element.getContact().get(i), i);
4634    if (element.hasDescriptionElement())
4635      composeMarkdown(t, "ConceptMap", "description", element.getDescriptionElement(), -1);
4636    for (int i = 0; i < element.getUseContext().size(); i++)
4637      composeUsageContext(t, "ConceptMap", "useContext", element.getUseContext().get(i), i);
4638    for (int i = 0; i < element.getJurisdiction().size(); i++)
4639      composeCodeableConcept(t, "ConceptMap", "jurisdiction", element.getJurisdiction().get(i), i);
4640    if (element.hasPurposeElement())
4641      composeMarkdown(t, "ConceptMap", "purpose", element.getPurposeElement(), -1);
4642    if (element.hasCopyrightElement())
4643      composeMarkdown(t, "ConceptMap", "copyright", element.getCopyrightElement(), -1);
4644    if (element.hasSource())
4645      composeType(t, "ConceptMap", "source", element.getSource(), -1);
4646    if (element.hasTarget())
4647      composeType(t, "ConceptMap", "target", element.getTarget(), -1);
4648    for (int i = 0; i < element.getGroup().size(); i++)
4649      composeConceptMapConceptMapGroupComponent(t, "ConceptMap", "group", element.getGroup().get(i), i);
4650  }
4651
4652  protected void composeConceptMapConceptMapGroupComponent(Complex parent, String parentType, String name,
4653      ConceptMap.ConceptMapGroupComponent element, int index) {
4654    if (element == null)
4655      return;
4656    Complex t;
4657    if (Utilities.noString(parentType))
4658      t = parent;
4659    else {
4660      t = parent.predicate("fhir:" + parentType + '.' + name);
4661    }
4662    composeBackboneElement(t, "group", name, element, index);
4663    if (element.hasSourceElement())
4664      composeUri(t, "ConceptMap", "source", element.getSourceElement(), -1);
4665    if (element.hasSourceVersionElement())
4666      composeString(t, "ConceptMap", "sourceVersion", element.getSourceVersionElement(), -1);
4667    if (element.hasTargetElement())
4668      composeUri(t, "ConceptMap", "target", element.getTargetElement(), -1);
4669    if (element.hasTargetVersionElement())
4670      composeString(t, "ConceptMap", "targetVersion", element.getTargetVersionElement(), -1);
4671    for (int i = 0; i < element.getElement().size(); i++)
4672      composeConceptMapSourceElementComponent(t, "ConceptMap", "element", element.getElement().get(i), i);
4673    if (element.hasUnmapped())
4674      composeConceptMapConceptMapGroupUnmappedComponent(t, "ConceptMap", "unmapped", element.getUnmapped(), -1);
4675  }
4676
4677  protected void composeConceptMapSourceElementComponent(Complex parent, String parentType, String name,
4678      ConceptMap.SourceElementComponent element, int index) {
4679    if (element == null)
4680      return;
4681    Complex t;
4682    if (Utilities.noString(parentType))
4683      t = parent;
4684    else {
4685      t = parent.predicate("fhir:" + parentType + '.' + name);
4686    }
4687    composeBackboneElement(t, "element", name, element, index);
4688    if (element.hasCodeElement())
4689      composeCode(t, "ConceptMap", "code", element.getCodeElement(), -1);
4690    if (element.hasDisplayElement())
4691      composeString(t, "ConceptMap", "display", element.getDisplayElement(), -1);
4692    for (int i = 0; i < element.getTarget().size(); i++)
4693      composeConceptMapTargetElementComponent(t, "ConceptMap", "target", element.getTarget().get(i), i);
4694  }
4695
4696  protected void composeConceptMapTargetElementComponent(Complex parent, String parentType, String name,
4697      ConceptMap.TargetElementComponent element, int index) {
4698    if (element == null)
4699      return;
4700    Complex t;
4701    if (Utilities.noString(parentType))
4702      t = parent;
4703    else {
4704      t = parent.predicate("fhir:" + parentType + '.' + name);
4705    }
4706    composeBackboneElement(t, "target", name, element, index);
4707    if (element.hasCodeElement())
4708      composeCode(t, "ConceptMap", "code", element.getCodeElement(), -1);
4709    if (element.hasDisplayElement())
4710      composeString(t, "ConceptMap", "display", element.getDisplayElement(), -1);
4711    if (element.hasEquivalenceElement())
4712      composeEnum(t, "ConceptMap", "equivalence", element.getEquivalenceElement(), -1);
4713    if (element.hasCommentElement())
4714      composeString(t, "ConceptMap", "comment", element.getCommentElement(), -1);
4715    for (int i = 0; i < element.getDependsOn().size(); i++)
4716      composeConceptMapOtherElementComponent(t, "ConceptMap", "dependsOn", element.getDependsOn().get(i), i);
4717    for (int i = 0; i < element.getProduct().size(); i++)
4718      composeConceptMapOtherElementComponent(t, "ConceptMap", "product", element.getProduct().get(i), i);
4719  }
4720
4721  protected void composeConceptMapOtherElementComponent(Complex parent, String parentType, String name,
4722      ConceptMap.OtherElementComponent element, int index) {
4723    if (element == null)
4724      return;
4725    Complex t;
4726    if (Utilities.noString(parentType))
4727      t = parent;
4728    else {
4729      t = parent.predicate("fhir:" + parentType + '.' + name);
4730    }
4731    composeBackboneElement(t, "dependsOn", name, element, index);
4732    if (element.hasPropertyElement())
4733      composeUri(t, "ConceptMap", "property", element.getPropertyElement(), -1);
4734    if (element.hasSystemElement())
4735      composeCanonical(t, "ConceptMap", "system", element.getSystemElement(), -1);
4736    if (element.hasValueElement())
4737      composeString(t, "ConceptMap", "value", element.getValueElement(), -1);
4738    if (element.hasDisplayElement())
4739      composeString(t, "ConceptMap", "display", element.getDisplayElement(), -1);
4740  }
4741
4742  protected void composeConceptMapConceptMapGroupUnmappedComponent(Complex parent, String parentType, String name,
4743      ConceptMap.ConceptMapGroupUnmappedComponent element, int index) {
4744    if (element == null)
4745      return;
4746    Complex t;
4747    if (Utilities.noString(parentType))
4748      t = parent;
4749    else {
4750      t = parent.predicate("fhir:" + parentType + '.' + name);
4751    }
4752    composeBackboneElement(t, "unmapped", name, element, index);
4753    if (element.hasModeElement())
4754      composeEnum(t, "ConceptMap", "mode", element.getModeElement(), -1);
4755    if (element.hasCodeElement())
4756      composeCode(t, "ConceptMap", "code", element.getCodeElement(), -1);
4757    if (element.hasDisplayElement())
4758      composeString(t, "ConceptMap", "display", element.getDisplayElement(), -1);
4759    if (element.hasUrlElement())
4760      composeCanonical(t, "ConceptMap", "url", element.getUrlElement(), -1);
4761  }
4762
4763  protected void composeCondition(Complex parent, String parentType, String name, Condition element, int index) {
4764    if (element == null)
4765      return;
4766    Complex t;
4767    if (Utilities.noString(parentType))
4768      t = parent;
4769    else {
4770      t = parent.predicate("fhir:" + parentType + '.' + name);
4771    }
4772    composeDomainResource(t, "Condition", name, element, index);
4773    for (int i = 0; i < element.getIdentifier().size(); i++)
4774      composeIdentifier(t, "Condition", "identifier", element.getIdentifier().get(i), i);
4775    if (element.hasClinicalStatus())
4776      composeCodeableConcept(t, "Condition", "clinicalStatus", element.getClinicalStatus(), -1);
4777    if (element.hasVerificationStatus())
4778      composeCodeableConcept(t, "Condition", "verificationStatus", element.getVerificationStatus(), -1);
4779    for (int i = 0; i < element.getCategory().size(); i++)
4780      composeCodeableConcept(t, "Condition", "category", element.getCategory().get(i), i);
4781    if (element.hasSeverity())
4782      composeCodeableConcept(t, "Condition", "severity", element.getSeverity(), -1);
4783    if (element.hasCode())
4784      composeCodeableConcept(t, "Condition", "code", element.getCode(), -1);
4785    for (int i = 0; i < element.getBodySite().size(); i++)
4786      composeCodeableConcept(t, "Condition", "bodySite", element.getBodySite().get(i), i);
4787    if (element.hasSubject())
4788      composeReference(t, "Condition", "subject", element.getSubject(), -1);
4789    if (element.hasEncounter())
4790      composeReference(t, "Condition", "encounter", element.getEncounter(), -1);
4791    if (element.hasOnset())
4792      composeType(t, "Condition", "onset", element.getOnset(), -1);
4793    if (element.hasAbatement())
4794      composeType(t, "Condition", "abatement", element.getAbatement(), -1);
4795    if (element.hasRecordedDateElement())
4796      composeDateTime(t, "Condition", "recordedDate", element.getRecordedDateElement(), -1);
4797    if (element.hasRecorder())
4798      composeReference(t, "Condition", "recorder", element.getRecorder(), -1);
4799    if (element.hasAsserter())
4800      composeReference(t, "Condition", "asserter", element.getAsserter(), -1);
4801    for (int i = 0; i < element.getStage().size(); i++)
4802      composeConditionConditionStageComponent(t, "Condition", "stage", element.getStage().get(i), i);
4803    for (int i = 0; i < element.getEvidence().size(); i++)
4804      composeConditionConditionEvidenceComponent(t, "Condition", "evidence", element.getEvidence().get(i), i);
4805    for (int i = 0; i < element.getNote().size(); i++)
4806      composeAnnotation(t, "Condition", "note", element.getNote().get(i), i);
4807  }
4808
4809  protected void composeConditionConditionStageComponent(Complex parent, String parentType, String name,
4810      Condition.ConditionStageComponent element, int index) {
4811    if (element == null)
4812      return;
4813    Complex t;
4814    if (Utilities.noString(parentType))
4815      t = parent;
4816    else {
4817      t = parent.predicate("fhir:" + parentType + '.' + name);
4818    }
4819    composeBackboneElement(t, "stage", name, element, index);
4820    if (element.hasSummary())
4821      composeCodeableConcept(t, "Condition", "summary", element.getSummary(), -1);
4822    for (int i = 0; i < element.getAssessment().size(); i++)
4823      composeReference(t, "Condition", "assessment", element.getAssessment().get(i), i);
4824    if (element.hasType())
4825      composeCodeableConcept(t, "Condition", "type", element.getType(), -1);
4826  }
4827
4828  protected void composeConditionConditionEvidenceComponent(Complex parent, String parentType, String name,
4829      Condition.ConditionEvidenceComponent element, int index) {
4830    if (element == null)
4831      return;
4832    Complex t;
4833    if (Utilities.noString(parentType))
4834      t = parent;
4835    else {
4836      t = parent.predicate("fhir:" + parentType + '.' + name);
4837    }
4838    composeBackboneElement(t, "evidence", name, element, index);
4839    for (int i = 0; i < element.getCode().size(); i++)
4840      composeCodeableConcept(t, "Condition", "code", element.getCode().get(i), i);
4841    for (int i = 0; i < element.getDetail().size(); i++)
4842      composeReference(t, "Condition", "detail", element.getDetail().get(i), i);
4843  }
4844
4845  protected void composeConsent(Complex parent, String parentType, String name, Consent element, int index) {
4846    if (element == null)
4847      return;
4848    Complex t;
4849    if (Utilities.noString(parentType))
4850      t = parent;
4851    else {
4852      t = parent.predicate("fhir:" + parentType + '.' + name);
4853    }
4854    composeDomainResource(t, "Consent", name, element, index);
4855    for (int i = 0; i < element.getIdentifier().size(); i++)
4856      composeIdentifier(t, "Consent", "identifier", element.getIdentifier().get(i), i);
4857    if (element.hasStatusElement())
4858      composeEnum(t, "Consent", "status", element.getStatusElement(), -1);
4859    if (element.hasScope())
4860      composeCodeableConcept(t, "Consent", "scope", element.getScope(), -1);
4861    for (int i = 0; i < element.getCategory().size(); i++)
4862      composeCodeableConcept(t, "Consent", "category", element.getCategory().get(i), i);
4863    if (element.hasPatient())
4864      composeReference(t, "Consent", "patient", element.getPatient(), -1);
4865    if (element.hasDateTimeElement())
4866      composeDateTime(t, "Consent", "dateTime", element.getDateTimeElement(), -1);
4867    for (int i = 0; i < element.getPerformer().size(); i++)
4868      composeReference(t, "Consent", "performer", element.getPerformer().get(i), i);
4869    for (int i = 0; i < element.getOrganization().size(); i++)
4870      composeReference(t, "Consent", "organization", element.getOrganization().get(i), i);
4871    if (element.hasSource())
4872      composeType(t, "Consent", "source", element.getSource(), -1);
4873    for (int i = 0; i < element.getPolicy().size(); i++)
4874      composeConsentConsentPolicyComponent(t, "Consent", "policy", element.getPolicy().get(i), i);
4875    if (element.hasPolicyRule())
4876      composeCodeableConcept(t, "Consent", "policyRule", element.getPolicyRule(), -1);
4877    for (int i = 0; i < element.getVerification().size(); i++)
4878      composeConsentConsentVerificationComponent(t, "Consent", "verification", element.getVerification().get(i), i);
4879    if (element.hasProvision())
4880      composeConsentprovisionComponent(t, "Consent", "provision", element.getProvision(), -1);
4881  }
4882
4883  protected void composeConsentConsentPolicyComponent(Complex parent, String parentType, String name,
4884      Consent.ConsentPolicyComponent element, int index) {
4885    if (element == null)
4886      return;
4887    Complex t;
4888    if (Utilities.noString(parentType))
4889      t = parent;
4890    else {
4891      t = parent.predicate("fhir:" + parentType + '.' + name);
4892    }
4893    composeBackboneElement(t, "policy", name, element, index);
4894    if (element.hasAuthorityElement())
4895      composeUri(t, "Consent", "authority", element.getAuthorityElement(), -1);
4896    if (element.hasUriElement())
4897      composeUri(t, "Consent", "uri", element.getUriElement(), -1);
4898  }
4899
4900  protected void composeConsentConsentVerificationComponent(Complex parent, String parentType, String name,
4901      Consent.ConsentVerificationComponent element, int index) {
4902    if (element == null)
4903      return;
4904    Complex t;
4905    if (Utilities.noString(parentType))
4906      t = parent;
4907    else {
4908      t = parent.predicate("fhir:" + parentType + '.' + name);
4909    }
4910    composeBackboneElement(t, "verification", name, element, index);
4911    if (element.hasVerifiedElement())
4912      composeBoolean(t, "Consent", "verified", element.getVerifiedElement(), -1);
4913    if (element.hasVerifiedWith())
4914      composeReference(t, "Consent", "verifiedWith", element.getVerifiedWith(), -1);
4915    if (element.hasVerificationDateElement())
4916      composeDateTime(t, "Consent", "verificationDate", element.getVerificationDateElement(), -1);
4917  }
4918
4919  protected void composeConsentprovisionComponent(Complex parent, String parentType, String name,
4920      Consent.provisionComponent element, int index) {
4921    if (element == null)
4922      return;
4923    Complex t;
4924    if (Utilities.noString(parentType))
4925      t = parent;
4926    else {
4927      t = parent.predicate("fhir:" + parentType + '.' + name);
4928    }
4929    composeBackboneElement(t, "provision", name, element, index);
4930    if (element.hasTypeElement())
4931      composeEnum(t, "Consent", "type", element.getTypeElement(), -1);
4932    if (element.hasPeriod())
4933      composePeriod(t, "Consent", "period", element.getPeriod(), -1);
4934    for (int i = 0; i < element.getActor().size(); i++)
4935      composeConsentprovisionActorComponent(t, "Consent", "actor", element.getActor().get(i), i);
4936    for (int i = 0; i < element.getAction().size(); i++)
4937      composeCodeableConcept(t, "Consent", "action", element.getAction().get(i), i);
4938    for (int i = 0; i < element.getSecurityLabel().size(); i++)
4939      composeCoding(t, "Consent", "securityLabel", element.getSecurityLabel().get(i), i);
4940    for (int i = 0; i < element.getPurpose().size(); i++)
4941      composeCoding(t, "Consent", "purpose", element.getPurpose().get(i), i);
4942    for (int i = 0; i < element.getClass_().size(); i++)
4943      composeCoding(t, "Consent", "class", element.getClass_().get(i), i);
4944    for (int i = 0; i < element.getCode().size(); i++)
4945      composeCodeableConcept(t, "Consent", "code", element.getCode().get(i), i);
4946    if (element.hasDataPeriod())
4947      composePeriod(t, "Consent", "dataPeriod", element.getDataPeriod(), -1);
4948    for (int i = 0; i < element.getData().size(); i++)
4949      composeConsentprovisionDataComponent(t, "Consent", "data", element.getData().get(i), i);
4950    for (int i = 0; i < element.getProvision().size(); i++)
4951      composeConsentprovisionComponent(t, "Consent", "provision", element.getProvision().get(i), i);
4952  }
4953
4954  protected void composeConsentprovisionActorComponent(Complex parent, String parentType, String name,
4955      Consent.provisionActorComponent element, int index) {
4956    if (element == null)
4957      return;
4958    Complex t;
4959    if (Utilities.noString(parentType))
4960      t = parent;
4961    else {
4962      t = parent.predicate("fhir:" + parentType + '.' + name);
4963    }
4964    composeBackboneElement(t, "actor", name, element, index);
4965    if (element.hasRole())
4966      composeCodeableConcept(t, "Consent", "role", element.getRole(), -1);
4967    if (element.hasReference())
4968      composeReference(t, "Consent", "reference", element.getReference(), -1);
4969  }
4970
4971  protected void composeConsentprovisionDataComponent(Complex parent, String parentType, String name,
4972      Consent.provisionDataComponent element, int index) {
4973    if (element == null)
4974      return;
4975    Complex t;
4976    if (Utilities.noString(parentType))
4977      t = parent;
4978    else {
4979      t = parent.predicate("fhir:" + parentType + '.' + name);
4980    }
4981    composeBackboneElement(t, "data", name, element, index);
4982    if (element.hasMeaningElement())
4983      composeEnum(t, "Consent", "meaning", element.getMeaningElement(), -1);
4984    if (element.hasReference())
4985      composeReference(t, "Consent", "reference", element.getReference(), -1);
4986  }
4987
4988  protected void composeContract(Complex parent, String parentType, String name, Contract element, int index) {
4989    if (element == null)
4990      return;
4991    Complex t;
4992    if (Utilities.noString(parentType))
4993      t = parent;
4994    else {
4995      t = parent.predicate("fhir:" + parentType + '.' + name);
4996    }
4997    composeDomainResource(t, "Contract", name, element, index);
4998    for (int i = 0; i < element.getIdentifier().size(); i++)
4999      composeIdentifier(t, "Contract", "identifier", element.getIdentifier().get(i), i);
5000    if (element.hasUrlElement())
5001      composeUri(t, "Contract", "url", element.getUrlElement(), -1);
5002    if (element.hasVersionElement())
5003      composeString(t, "Contract", "version", element.getVersionElement(), -1);
5004    if (element.hasStatusElement())
5005      composeEnum(t, "Contract", "status", element.getStatusElement(), -1);
5006    if (element.hasLegalState())
5007      composeCodeableConcept(t, "Contract", "legalState", element.getLegalState(), -1);
5008    if (element.hasInstantiatesCanonical())
5009      composeReference(t, "Contract", "instantiatesCanonical", element.getInstantiatesCanonical(), -1);
5010    if (element.hasInstantiatesUriElement())
5011      composeUri(t, "Contract", "instantiatesUri", element.getInstantiatesUriElement(), -1);
5012    if (element.hasContentDerivative())
5013      composeCodeableConcept(t, "Contract", "contentDerivative", element.getContentDerivative(), -1);
5014    if (element.hasIssuedElement())
5015      composeDateTime(t, "Contract", "issued", element.getIssuedElement(), -1);
5016    if (element.hasApplies())
5017      composePeriod(t, "Contract", "applies", element.getApplies(), -1);
5018    if (element.hasExpirationType())
5019      composeCodeableConcept(t, "Contract", "expirationType", element.getExpirationType(), -1);
5020    for (int i = 0; i < element.getSubject().size(); i++)
5021      composeReference(t, "Contract", "subject", element.getSubject().get(i), i);
5022    for (int i = 0; i < element.getAuthority().size(); i++)
5023      composeReference(t, "Contract", "authority", element.getAuthority().get(i), i);
5024    for (int i = 0; i < element.getDomain().size(); i++)
5025      composeReference(t, "Contract", "domain", element.getDomain().get(i), i);
5026    for (int i = 0; i < element.getSite().size(); i++)
5027      composeReference(t, "Contract", "site", element.getSite().get(i), i);
5028    if (element.hasNameElement())
5029      composeString(t, "Contract", "name", element.getNameElement(), -1);
5030    if (element.hasTitleElement())
5031      composeString(t, "Contract", "title", element.getTitleElement(), -1);
5032    if (element.hasSubtitleElement())
5033      composeString(t, "Contract", "subtitle", element.getSubtitleElement(), -1);
5034    for (int i = 0; i < element.getAlias().size(); i++)
5035      composeString(t, "Contract", "alias", element.getAlias().get(i), i);
5036    if (element.hasAuthor())
5037      composeReference(t, "Contract", "author", element.getAuthor(), -1);
5038    if (element.hasScope())
5039      composeCodeableConcept(t, "Contract", "scope", element.getScope(), -1);
5040    if (element.hasTopic())
5041      composeType(t, "Contract", "topic", element.getTopic(), -1);
5042    if (element.hasType())
5043      composeCodeableConcept(t, "Contract", "type", element.getType(), -1);
5044    for (int i = 0; i < element.getSubType().size(); i++)
5045      composeCodeableConcept(t, "Contract", "subType", element.getSubType().get(i), i);
5046    if (element.hasContentDefinition())
5047      composeContractContentDefinitionComponent(t, "Contract", "contentDefinition", element.getContentDefinition(), -1);
5048    for (int i = 0; i < element.getTerm().size(); i++)
5049      composeContractTermComponent(t, "Contract", "term", element.getTerm().get(i), i);
5050    for (int i = 0; i < element.getSupportingInfo().size(); i++)
5051      composeReference(t, "Contract", "supportingInfo", element.getSupportingInfo().get(i), i);
5052    for (int i = 0; i < element.getRelevantHistory().size(); i++)
5053      composeReference(t, "Contract", "relevantHistory", element.getRelevantHistory().get(i), i);
5054    for (int i = 0; i < element.getSigner().size(); i++)
5055      composeContractSignatoryComponent(t, "Contract", "signer", element.getSigner().get(i), i);
5056    for (int i = 0; i < element.getFriendly().size(); i++)
5057      composeContractFriendlyLanguageComponent(t, "Contract", "friendly", element.getFriendly().get(i), i);
5058    for (int i = 0; i < element.getLegal().size(); i++)
5059      composeContractLegalLanguageComponent(t, "Contract", "legal", element.getLegal().get(i), i);
5060    for (int i = 0; i < element.getRule().size(); i++)
5061      composeContractComputableLanguageComponent(t, "Contract", "rule", element.getRule().get(i), i);
5062    if (element.hasLegallyBinding())
5063      composeType(t, "Contract", "legallyBinding", element.getLegallyBinding(), -1);
5064  }
5065
5066  protected void composeContractContentDefinitionComponent(Complex parent, String parentType, String name,
5067      Contract.ContentDefinitionComponent element, int index) {
5068    if (element == null)
5069      return;
5070    Complex t;
5071    if (Utilities.noString(parentType))
5072      t = parent;
5073    else {
5074      t = parent.predicate("fhir:" + parentType + '.' + name);
5075    }
5076    composeBackboneElement(t, "contentDefinition", name, element, index);
5077    if (element.hasType())
5078      composeCodeableConcept(t, "Contract", "type", element.getType(), -1);
5079    if (element.hasSubType())
5080      composeCodeableConcept(t, "Contract", "subType", element.getSubType(), -1);
5081    if (element.hasPublisher())
5082      composeReference(t, "Contract", "publisher", element.getPublisher(), -1);
5083    if (element.hasPublicationDateElement())
5084      composeDateTime(t, "Contract", "publicationDate", element.getPublicationDateElement(), -1);
5085    if (element.hasPublicationStatusElement())
5086      composeEnum(t, "Contract", "publicationStatus", element.getPublicationStatusElement(), -1);
5087    if (element.hasCopyrightElement())
5088      composeMarkdown(t, "Contract", "copyright", element.getCopyrightElement(), -1);
5089  }
5090
5091  protected void composeContractTermComponent(Complex parent, String parentType, String name,
5092      Contract.TermComponent element, int index) {
5093    if (element == null)
5094      return;
5095    Complex t;
5096    if (Utilities.noString(parentType))
5097      t = parent;
5098    else {
5099      t = parent.predicate("fhir:" + parentType + '.' + name);
5100    }
5101    composeBackboneElement(t, "term", name, element, index);
5102    if (element.hasIdentifier())
5103      composeIdentifier(t, "Contract", "identifier", element.getIdentifier(), -1);
5104    if (element.hasIssuedElement())
5105      composeDateTime(t, "Contract", "issued", element.getIssuedElement(), -1);
5106    if (element.hasApplies())
5107      composePeriod(t, "Contract", "applies", element.getApplies(), -1);
5108    if (element.hasTopic())
5109      composeType(t, "Contract", "topic", element.getTopic(), -1);
5110    if (element.hasType())
5111      composeCodeableConcept(t, "Contract", "type", element.getType(), -1);
5112    if (element.hasSubType())
5113      composeCodeableConcept(t, "Contract", "subType", element.getSubType(), -1);
5114    if (element.hasTextElement())
5115      composeString(t, "Contract", "text", element.getTextElement(), -1);
5116    for (int i = 0; i < element.getSecurityLabel().size(); i++)
5117      composeContractSecurityLabelComponent(t, "Contract", "securityLabel", element.getSecurityLabel().get(i), i);
5118    if (element.hasOffer())
5119      composeContractContractOfferComponent(t, "Contract", "offer", element.getOffer(), -1);
5120    for (int i = 0; i < element.getAsset().size(); i++)
5121      composeContractContractAssetComponent(t, "Contract", "asset", element.getAsset().get(i), i);
5122    for (int i = 0; i < element.getAction().size(); i++)
5123      composeContractActionComponent(t, "Contract", "action", element.getAction().get(i), i);
5124    for (int i = 0; i < element.getGroup().size(); i++)
5125      composeContractTermComponent(t, "Contract", "group", element.getGroup().get(i), i);
5126  }
5127
5128  protected void composeContractSecurityLabelComponent(Complex parent, String parentType, String name,
5129      Contract.SecurityLabelComponent element, int index) {
5130    if (element == null)
5131      return;
5132    Complex t;
5133    if (Utilities.noString(parentType))
5134      t = parent;
5135    else {
5136      t = parent.predicate("fhir:" + parentType + '.' + name);
5137    }
5138    composeBackboneElement(t, "securityLabel", name, element, index);
5139    for (int i = 0; i < element.getNumber().size(); i++)
5140      composeUnsignedInt(t, "Contract", "number", element.getNumber().get(i), i);
5141    if (element.hasClassification())
5142      composeCoding(t, "Contract", "classification", element.getClassification(), -1);
5143    for (int i = 0; i < element.getCategory().size(); i++)
5144      composeCoding(t, "Contract", "category", element.getCategory().get(i), i);
5145    for (int i = 0; i < element.getControl().size(); i++)
5146      composeCoding(t, "Contract", "control", element.getControl().get(i), i);
5147  }
5148
5149  protected void composeContractContractOfferComponent(Complex parent, String parentType, String name,
5150      Contract.ContractOfferComponent element, int index) {
5151    if (element == null)
5152      return;
5153    Complex t;
5154    if (Utilities.noString(parentType))
5155      t = parent;
5156    else {
5157      t = parent.predicate("fhir:" + parentType + '.' + name);
5158    }
5159    composeBackboneElement(t, "offer", name, element, index);
5160    for (int i = 0; i < element.getIdentifier().size(); i++)
5161      composeIdentifier(t, "Contract", "identifier", element.getIdentifier().get(i), i);
5162    for (int i = 0; i < element.getParty().size(); i++)
5163      composeContractContractPartyComponent(t, "Contract", "party", element.getParty().get(i), i);
5164    if (element.hasTopic())
5165      composeReference(t, "Contract", "topic", element.getTopic(), -1);
5166    if (element.hasType())
5167      composeCodeableConcept(t, "Contract", "type", element.getType(), -1);
5168    if (element.hasDecision())
5169      composeCodeableConcept(t, "Contract", "decision", element.getDecision(), -1);
5170    for (int i = 0; i < element.getDecisionMode().size(); i++)
5171      composeCodeableConcept(t, "Contract", "decisionMode", element.getDecisionMode().get(i), i);
5172    for (int i = 0; i < element.getAnswer().size(); i++)
5173      composeContractAnswerComponent(t, "Contract", "answer", element.getAnswer().get(i), i);
5174    if (element.hasTextElement())
5175      composeString(t, "Contract", "text", element.getTextElement(), -1);
5176    for (int i = 0; i < element.getLinkId().size(); i++)
5177      composeString(t, "Contract", "linkId", element.getLinkId().get(i), i);
5178    for (int i = 0; i < element.getSecurityLabelNumber().size(); i++)
5179      composeUnsignedInt(t, "Contract", "securityLabelNumber", element.getSecurityLabelNumber().get(i), i);
5180  }
5181
5182  protected void composeContractContractPartyComponent(Complex parent, String parentType, String name,
5183      Contract.ContractPartyComponent element, int index) {
5184    if (element == null)
5185      return;
5186    Complex t;
5187    if (Utilities.noString(parentType))
5188      t = parent;
5189    else {
5190      t = parent.predicate("fhir:" + parentType + '.' + name);
5191    }
5192    composeBackboneElement(t, "party", name, element, index);
5193    for (int i = 0; i < element.getReference().size(); i++)
5194      composeReference(t, "Contract", "reference", element.getReference().get(i), i);
5195    if (element.hasRole())
5196      composeCodeableConcept(t, "Contract", "role", element.getRole(), -1);
5197  }
5198
5199  protected void composeContractAnswerComponent(Complex parent, String parentType, String name,
5200      Contract.AnswerComponent element, int index) {
5201    if (element == null)
5202      return;
5203    Complex t;
5204    if (Utilities.noString(parentType))
5205      t = parent;
5206    else {
5207      t = parent.predicate("fhir:" + parentType + '.' + name);
5208    }
5209    composeBackboneElement(t, "answer", name, element, index);
5210    if (element.hasValue())
5211      composeType(t, "Contract", "value", element.getValue(), -1);
5212  }
5213
5214  protected void composeContractContractAssetComponent(Complex parent, String parentType, String name,
5215      Contract.ContractAssetComponent element, int index) {
5216    if (element == null)
5217      return;
5218    Complex t;
5219    if (Utilities.noString(parentType))
5220      t = parent;
5221    else {
5222      t = parent.predicate("fhir:" + parentType + '.' + name);
5223    }
5224    composeBackboneElement(t, "asset", name, element, index);
5225    if (element.hasScope())
5226      composeCodeableConcept(t, "Contract", "scope", element.getScope(), -1);
5227    for (int i = 0; i < element.getType().size(); i++)
5228      composeCodeableConcept(t, "Contract", "type", element.getType().get(i), i);
5229    for (int i = 0; i < element.getTypeReference().size(); i++)
5230      composeReference(t, "Contract", "typeReference", element.getTypeReference().get(i), i);
5231    for (int i = 0; i < element.getSubtype().size(); i++)
5232      composeCodeableConcept(t, "Contract", "subtype", element.getSubtype().get(i), i);
5233    if (element.hasRelationship())
5234      composeCoding(t, "Contract", "relationship", element.getRelationship(), -1);
5235    for (int i = 0; i < element.getContext().size(); i++)
5236      composeContractAssetContextComponent(t, "Contract", "context", element.getContext().get(i), i);
5237    if (element.hasConditionElement())
5238      composeString(t, "Contract", "condition", element.getConditionElement(), -1);
5239    for (int i = 0; i < element.getPeriodType().size(); i++)
5240      composeCodeableConcept(t, "Contract", "periodType", element.getPeriodType().get(i), i);
5241    for (int i = 0; i < element.getPeriod().size(); i++)
5242      composePeriod(t, "Contract", "period", element.getPeriod().get(i), i);
5243    for (int i = 0; i < element.getUsePeriod().size(); i++)
5244      composePeriod(t, "Contract", "usePeriod", element.getUsePeriod().get(i), i);
5245    if (element.hasTextElement())
5246      composeString(t, "Contract", "text", element.getTextElement(), -1);
5247    for (int i = 0; i < element.getLinkId().size(); i++)
5248      composeString(t, "Contract", "linkId", element.getLinkId().get(i), i);
5249    for (int i = 0; i < element.getAnswer().size(); i++)
5250      composeContractAnswerComponent(t, "Contract", "answer", element.getAnswer().get(i), i);
5251    for (int i = 0; i < element.getSecurityLabelNumber().size(); i++)
5252      composeUnsignedInt(t, "Contract", "securityLabelNumber", element.getSecurityLabelNumber().get(i), i);
5253    for (int i = 0; i < element.getValuedItem().size(); i++)
5254      composeContractValuedItemComponent(t, "Contract", "valuedItem", element.getValuedItem().get(i), i);
5255  }
5256
5257  protected void composeContractAssetContextComponent(Complex parent, String parentType, String name,
5258      Contract.AssetContextComponent element, int index) {
5259    if (element == null)
5260      return;
5261    Complex t;
5262    if (Utilities.noString(parentType))
5263      t = parent;
5264    else {
5265      t = parent.predicate("fhir:" + parentType + '.' + name);
5266    }
5267    composeBackboneElement(t, "context", name, element, index);
5268    if (element.hasReference())
5269      composeReference(t, "Contract", "reference", element.getReference(), -1);
5270    for (int i = 0; i < element.getCode().size(); i++)
5271      composeCodeableConcept(t, "Contract", "code", element.getCode().get(i), i);
5272    if (element.hasTextElement())
5273      composeString(t, "Contract", "text", element.getTextElement(), -1);
5274  }
5275
5276  protected void composeContractValuedItemComponent(Complex parent, String parentType, String name,
5277      Contract.ValuedItemComponent element, int index) {
5278    if (element == null)
5279      return;
5280    Complex t;
5281    if (Utilities.noString(parentType))
5282      t = parent;
5283    else {
5284      t = parent.predicate("fhir:" + parentType + '.' + name);
5285    }
5286    composeBackboneElement(t, "valuedItem", name, element, index);
5287    if (element.hasEntity())
5288      composeType(t, "Contract", "entity", element.getEntity(), -1);
5289    if (element.hasIdentifier())
5290      composeIdentifier(t, "Contract", "identifier", element.getIdentifier(), -1);
5291    if (element.hasEffectiveTimeElement())
5292      composeDateTime(t, "Contract", "effectiveTime", element.getEffectiveTimeElement(), -1);
5293    if (element.hasQuantity())
5294      composeQuantity(t, "Contract", "quantity", element.getQuantity(), -1);
5295    if (element.hasUnitPrice())
5296      composeMoney(t, "Contract", "unitPrice", element.getUnitPrice(), -1);
5297    if (element.hasFactorElement())
5298      composeDecimal(t, "Contract", "factor", element.getFactorElement(), -1);
5299    if (element.hasPointsElement())
5300      composeDecimal(t, "Contract", "points", element.getPointsElement(), -1);
5301    if (element.hasNet())
5302      composeMoney(t, "Contract", "net", element.getNet(), -1);
5303    if (element.hasPaymentElement())
5304      composeString(t, "Contract", "payment", element.getPaymentElement(), -1);
5305    if (element.hasPaymentDateElement())
5306      composeDateTime(t, "Contract", "paymentDate", element.getPaymentDateElement(), -1);
5307    if (element.hasResponsible())
5308      composeReference(t, "Contract", "responsible", element.getResponsible(), -1);
5309    if (element.hasRecipient())
5310      composeReference(t, "Contract", "recipient", element.getRecipient(), -1);
5311    for (int i = 0; i < element.getLinkId().size(); i++)
5312      composeString(t, "Contract", "linkId", element.getLinkId().get(i), i);
5313    for (int i = 0; i < element.getSecurityLabelNumber().size(); i++)
5314      composeUnsignedInt(t, "Contract", "securityLabelNumber", element.getSecurityLabelNumber().get(i), i);
5315  }
5316
5317  protected void composeContractActionComponent(Complex parent, String parentType, String name,
5318      Contract.ActionComponent element, int index) {
5319    if (element == null)
5320      return;
5321    Complex t;
5322    if (Utilities.noString(parentType))
5323      t = parent;
5324    else {
5325      t = parent.predicate("fhir:" + parentType + '.' + name);
5326    }
5327    composeBackboneElement(t, "action", name, element, index);
5328    if (element.hasDoNotPerformElement())
5329      composeBoolean(t, "Contract", "doNotPerform", element.getDoNotPerformElement(), -1);
5330    if (element.hasType())
5331      composeCodeableConcept(t, "Contract", "type", element.getType(), -1);
5332    for (int i = 0; i < element.getSubject().size(); i++)
5333      composeContractActionSubjectComponent(t, "Contract", "subject", element.getSubject().get(i), i);
5334    if (element.hasIntent())
5335      composeCodeableConcept(t, "Contract", "intent", element.getIntent(), -1);
5336    for (int i = 0; i < element.getLinkId().size(); i++)
5337      composeString(t, "Contract", "linkId", element.getLinkId().get(i), i);
5338    if (element.hasStatus())
5339      composeCodeableConcept(t, "Contract", "status", element.getStatus(), -1);
5340    if (element.hasContext())
5341      composeReference(t, "Contract", "context", element.getContext(), -1);
5342    for (int i = 0; i < element.getContextLinkId().size(); i++)
5343      composeString(t, "Contract", "contextLinkId", element.getContextLinkId().get(i), i);
5344    if (element.hasOccurrence())
5345      composeType(t, "Contract", "occurrence", element.getOccurrence(), -1);
5346    for (int i = 0; i < element.getRequester().size(); i++)
5347      composeReference(t, "Contract", "requester", element.getRequester().get(i), i);
5348    for (int i = 0; i < element.getRequesterLinkId().size(); i++)
5349      composeString(t, "Contract", "requesterLinkId", element.getRequesterLinkId().get(i), i);
5350    for (int i = 0; i < element.getPerformerType().size(); i++)
5351      composeCodeableConcept(t, "Contract", "performerType", element.getPerformerType().get(i), i);
5352    if (element.hasPerformerRole())
5353      composeCodeableConcept(t, "Contract", "performerRole", element.getPerformerRole(), -1);
5354    if (element.hasPerformer())
5355      composeReference(t, "Contract", "performer", element.getPerformer(), -1);
5356    for (int i = 0; i < element.getPerformerLinkId().size(); i++)
5357      composeString(t, "Contract", "performerLinkId", element.getPerformerLinkId().get(i), i);
5358    for (int i = 0; i < element.getReasonCode().size(); i++)
5359      composeCodeableConcept(t, "Contract", "reasonCode", element.getReasonCode().get(i), i);
5360    for (int i = 0; i < element.getReasonReference().size(); i++)
5361      composeReference(t, "Contract", "reasonReference", element.getReasonReference().get(i), i);
5362    for (int i = 0; i < element.getReason().size(); i++)
5363      composeString(t, "Contract", "reason", element.getReason().get(i), i);
5364    for (int i = 0; i < element.getReasonLinkId().size(); i++)
5365      composeString(t, "Contract", "reasonLinkId", element.getReasonLinkId().get(i), i);
5366    for (int i = 0; i < element.getNote().size(); i++)
5367      composeAnnotation(t, "Contract", "note", element.getNote().get(i), i);
5368    for (int i = 0; i < element.getSecurityLabelNumber().size(); i++)
5369      composeUnsignedInt(t, "Contract", "securityLabelNumber", element.getSecurityLabelNumber().get(i), i);
5370  }
5371
5372  protected void composeContractActionSubjectComponent(Complex parent, String parentType, String name,
5373      Contract.ActionSubjectComponent element, int index) {
5374    if (element == null)
5375      return;
5376    Complex t;
5377    if (Utilities.noString(parentType))
5378      t = parent;
5379    else {
5380      t = parent.predicate("fhir:" + parentType + '.' + name);
5381    }
5382    composeBackboneElement(t, "subject", name, element, index);
5383    for (int i = 0; i < element.getReference().size(); i++)
5384      composeReference(t, "Contract", "reference", element.getReference().get(i), i);
5385    if (element.hasRole())
5386      composeCodeableConcept(t, "Contract", "role", element.getRole(), -1);
5387  }
5388
5389  protected void composeContractSignatoryComponent(Complex parent, String parentType, String name,
5390      Contract.SignatoryComponent element, int index) {
5391    if (element == null)
5392      return;
5393    Complex t;
5394    if (Utilities.noString(parentType))
5395      t = parent;
5396    else {
5397      t = parent.predicate("fhir:" + parentType + '.' + name);
5398    }
5399    composeBackboneElement(t, "signer", name, element, index);
5400    if (element.hasType())
5401      composeCoding(t, "Contract", "type", element.getType(), -1);
5402    if (element.hasParty())
5403      composeReference(t, "Contract", "party", element.getParty(), -1);
5404    for (int i = 0; i < element.getSignature().size(); i++)
5405      composeSignature(t, "Contract", "signature", element.getSignature().get(i), i);
5406  }
5407
5408  protected void composeContractFriendlyLanguageComponent(Complex parent, String parentType, String name,
5409      Contract.FriendlyLanguageComponent element, int index) {
5410    if (element == null)
5411      return;
5412    Complex t;
5413    if (Utilities.noString(parentType))
5414      t = parent;
5415    else {
5416      t = parent.predicate("fhir:" + parentType + '.' + name);
5417    }
5418    composeBackboneElement(t, "friendly", name, element, index);
5419    if (element.hasContent())
5420      composeType(t, "Contract", "content", element.getContent(), -1);
5421  }
5422
5423  protected void composeContractLegalLanguageComponent(Complex parent, String parentType, String name,
5424      Contract.LegalLanguageComponent element, int index) {
5425    if (element == null)
5426      return;
5427    Complex t;
5428    if (Utilities.noString(parentType))
5429      t = parent;
5430    else {
5431      t = parent.predicate("fhir:" + parentType + '.' + name);
5432    }
5433    composeBackboneElement(t, "legal", name, element, index);
5434    if (element.hasContent())
5435      composeType(t, "Contract", "content", element.getContent(), -1);
5436  }
5437
5438  protected void composeContractComputableLanguageComponent(Complex parent, String parentType, String name,
5439      Contract.ComputableLanguageComponent element, int index) {
5440    if (element == null)
5441      return;
5442    Complex t;
5443    if (Utilities.noString(parentType))
5444      t = parent;
5445    else {
5446      t = parent.predicate("fhir:" + parentType + '.' + name);
5447    }
5448    composeBackboneElement(t, "rule", name, element, index);
5449    if (element.hasContent())
5450      composeType(t, "Contract", "content", element.getContent(), -1);
5451  }
5452
5453  protected void composeCoverage(Complex parent, String parentType, String name, Coverage element, int index) {
5454    if (element == null)
5455      return;
5456    Complex t;
5457    if (Utilities.noString(parentType))
5458      t = parent;
5459    else {
5460      t = parent.predicate("fhir:" + parentType + '.' + name);
5461    }
5462    composeDomainResource(t, "Coverage", name, element, index);
5463    for (int i = 0; i < element.getIdentifier().size(); i++)
5464      composeIdentifier(t, "Coverage", "identifier", element.getIdentifier().get(i), i);
5465    if (element.hasStatusElement())
5466      composeEnum(t, "Coverage", "status", element.getStatusElement(), -1);
5467    if (element.hasType())
5468      composeCodeableConcept(t, "Coverage", "type", element.getType(), -1);
5469    if (element.hasPolicyHolder())
5470      composeReference(t, "Coverage", "policyHolder", element.getPolicyHolder(), -1);
5471    if (element.hasSubscriber())
5472      composeReference(t, "Coverage", "subscriber", element.getSubscriber(), -1);
5473    if (element.hasSubscriberIdElement())
5474      composeString(t, "Coverage", "subscriberId", element.getSubscriberIdElement(), -1);
5475    if (element.hasBeneficiary())
5476      composeReference(t, "Coverage", "beneficiary", element.getBeneficiary(), -1);
5477    if (element.hasDependentElement())
5478      composeString(t, "Coverage", "dependent", element.getDependentElement(), -1);
5479    if (element.hasRelationship())
5480      composeCodeableConcept(t, "Coverage", "relationship", element.getRelationship(), -1);
5481    if (element.hasPeriod())
5482      composePeriod(t, "Coverage", "period", element.getPeriod(), -1);
5483    for (int i = 0; i < element.getPayor().size(); i++)
5484      composeReference(t, "Coverage", "payor", element.getPayor().get(i), i);
5485    for (int i = 0; i < element.getClass_().size(); i++)
5486      composeCoverageClassComponent(t, "Coverage", "class", element.getClass_().get(i), i);
5487    if (element.hasOrderElement())
5488      composePositiveInt(t, "Coverage", "order", element.getOrderElement(), -1);
5489    if (element.hasNetworkElement())
5490      composeString(t, "Coverage", "network", element.getNetworkElement(), -1);
5491    for (int i = 0; i < element.getCostToBeneficiary().size(); i++)
5492      composeCoverageCostToBeneficiaryComponent(t, "Coverage", "costToBeneficiary",
5493          element.getCostToBeneficiary().get(i), i);
5494    if (element.hasSubrogationElement())
5495      composeBoolean(t, "Coverage", "subrogation", element.getSubrogationElement(), -1);
5496    for (int i = 0; i < element.getContract().size(); i++)
5497      composeReference(t, "Coverage", "contract", element.getContract().get(i), i);
5498  }
5499
5500  protected void composeCoverageClassComponent(Complex parent, String parentType, String name,
5501      Coverage.ClassComponent element, int index) {
5502    if (element == null)
5503      return;
5504    Complex t;
5505    if (Utilities.noString(parentType))
5506      t = parent;
5507    else {
5508      t = parent.predicate("fhir:" + parentType + '.' + name);
5509    }
5510    composeBackboneElement(t, "class", name, element, index);
5511    if (element.hasType())
5512      composeCodeableConcept(t, "Coverage", "type", element.getType(), -1);
5513    if (element.hasValueElement())
5514      composeString(t, "Coverage", "value", element.getValueElement(), -1);
5515    if (element.hasNameElement())
5516      composeString(t, "Coverage", "name", element.getNameElement(), -1);
5517  }
5518
5519  protected void composeCoverageCostToBeneficiaryComponent(Complex parent, String parentType, String name,
5520      Coverage.CostToBeneficiaryComponent element, int index) {
5521    if (element == null)
5522      return;
5523    Complex t;
5524    if (Utilities.noString(parentType))
5525      t = parent;
5526    else {
5527      t = parent.predicate("fhir:" + parentType + '.' + name);
5528    }
5529    composeBackboneElement(t, "costToBeneficiary", name, element, index);
5530    if (element.hasType())
5531      composeCodeableConcept(t, "Coverage", "type", element.getType(), -1);
5532    if (element.hasValue())
5533      composeType(t, "Coverage", "value", element.getValue(), -1);
5534    for (int i = 0; i < element.getException().size(); i++)
5535      composeCoverageExemptionComponent(t, "Coverage", "exception", element.getException().get(i), i);
5536  }
5537
5538  protected void composeCoverageExemptionComponent(Complex parent, String parentType, String name,
5539      Coverage.ExemptionComponent element, int index) {
5540    if (element == null)
5541      return;
5542    Complex t;
5543    if (Utilities.noString(parentType))
5544      t = parent;
5545    else {
5546      t = parent.predicate("fhir:" + parentType + '.' + name);
5547    }
5548    composeBackboneElement(t, "exception", name, element, index);
5549    if (element.hasType())
5550      composeCodeableConcept(t, "Coverage", "type", element.getType(), -1);
5551    if (element.hasPeriod())
5552      composePeriod(t, "Coverage", "period", element.getPeriod(), -1);
5553  }
5554
5555  protected void composeCoverageEligibilityRequest(Complex parent, String parentType, String name,
5556      CoverageEligibilityRequest element, int index) {
5557    if (element == null)
5558      return;
5559    Complex t;
5560    if (Utilities.noString(parentType))
5561      t = parent;
5562    else {
5563      t = parent.predicate("fhir:" + parentType + '.' + name);
5564    }
5565    composeDomainResource(t, "CoverageEligibilityRequest", name, element, index);
5566    for (int i = 0; i < element.getIdentifier().size(); i++)
5567      composeIdentifier(t, "CoverageEligibilityRequest", "identifier", element.getIdentifier().get(i), i);
5568    if (element.hasStatusElement())
5569      composeEnum(t, "CoverageEligibilityRequest", "status", element.getStatusElement(), -1);
5570    if (element.hasPriority())
5571      composeCodeableConcept(t, "CoverageEligibilityRequest", "priority", element.getPriority(), -1);
5572    for (int i = 0; i < element.getPurpose().size(); i++)
5573      composeEnum(t, "CoverageEligibilityRequest", "purpose", element.getPurpose().get(i), i);
5574    if (element.hasPatient())
5575      composeReference(t, "CoverageEligibilityRequest", "patient", element.getPatient(), -1);
5576    if (element.hasServiced())
5577      composeType(t, "CoverageEligibilityRequest", "serviced", element.getServiced(), -1);
5578    if (element.hasCreatedElement())
5579      composeDateTime(t, "CoverageEligibilityRequest", "created", element.getCreatedElement(), -1);
5580    if (element.hasEnterer())
5581      composeReference(t, "CoverageEligibilityRequest", "enterer", element.getEnterer(), -1);
5582    if (element.hasProvider())
5583      composeReference(t, "CoverageEligibilityRequest", "provider", element.getProvider(), -1);
5584    if (element.hasInsurer())
5585      composeReference(t, "CoverageEligibilityRequest", "insurer", element.getInsurer(), -1);
5586    if (element.hasFacility())
5587      composeReference(t, "CoverageEligibilityRequest", "facility", element.getFacility(), -1);
5588    for (int i = 0; i < element.getSupportingInfo().size(); i++)
5589      composeCoverageEligibilityRequestSupportingInformationComponent(t, "CoverageEligibilityRequest", "supportingInfo",
5590          element.getSupportingInfo().get(i), i);
5591    for (int i = 0; i < element.getInsurance().size(); i++)
5592      composeCoverageEligibilityRequestInsuranceComponent(t, "CoverageEligibilityRequest", "insurance",
5593          element.getInsurance().get(i), i);
5594    for (int i = 0; i < element.getItem().size(); i++)
5595      composeCoverageEligibilityRequestDetailsComponent(t, "CoverageEligibilityRequest", "item",
5596          element.getItem().get(i), i);
5597  }
5598
5599  protected void composeCoverageEligibilityRequestSupportingInformationComponent(Complex parent, String parentType,
5600      String name, CoverageEligibilityRequest.SupportingInformationComponent element, int index) {
5601    if (element == null)
5602      return;
5603    Complex t;
5604    if (Utilities.noString(parentType))
5605      t = parent;
5606    else {
5607      t = parent.predicate("fhir:" + parentType + '.' + name);
5608    }
5609    composeBackboneElement(t, "supportingInfo", name, element, index);
5610    if (element.hasSequenceElement())
5611      composePositiveInt(t, "CoverageEligibilityRequest", "sequence", element.getSequenceElement(), -1);
5612    if (element.hasInformation())
5613      composeReference(t, "CoverageEligibilityRequest", "information", element.getInformation(), -1);
5614    if (element.hasAppliesToAllElement())
5615      composeBoolean(t, "CoverageEligibilityRequest", "appliesToAll", element.getAppliesToAllElement(), -1);
5616  }
5617
5618  protected void composeCoverageEligibilityRequestInsuranceComponent(Complex parent, String parentType, String name,
5619      CoverageEligibilityRequest.InsuranceComponent element, int index) {
5620    if (element == null)
5621      return;
5622    Complex t;
5623    if (Utilities.noString(parentType))
5624      t = parent;
5625    else {
5626      t = parent.predicate("fhir:" + parentType + '.' + name);
5627    }
5628    composeBackboneElement(t, "insurance", name, element, index);
5629    if (element.hasFocalElement())
5630      composeBoolean(t, "CoverageEligibilityRequest", "focal", element.getFocalElement(), -1);
5631    if (element.hasCoverage())
5632      composeReference(t, "CoverageEligibilityRequest", "coverage", element.getCoverage(), -1);
5633    if (element.hasBusinessArrangementElement())
5634      composeString(t, "CoverageEligibilityRequest", "businessArrangement", element.getBusinessArrangementElement(),
5635          -1);
5636  }
5637
5638  protected void composeCoverageEligibilityRequestDetailsComponent(Complex parent, String parentType, String name,
5639      CoverageEligibilityRequest.DetailsComponent element, int index) {
5640    if (element == null)
5641      return;
5642    Complex t;
5643    if (Utilities.noString(parentType))
5644      t = parent;
5645    else {
5646      t = parent.predicate("fhir:" + parentType + '.' + name);
5647    }
5648    composeBackboneElement(t, "item", name, element, index);
5649    for (int i = 0; i < element.getSupportingInfoSequence().size(); i++)
5650      composePositiveInt(t, "CoverageEligibilityRequest", "supportingInfoSequence",
5651          element.getSupportingInfoSequence().get(i), i);
5652    if (element.hasCategory())
5653      composeCodeableConcept(t, "CoverageEligibilityRequest", "category", element.getCategory(), -1);
5654    if (element.hasProductOrService())
5655      composeCodeableConcept(t, "CoverageEligibilityRequest", "productOrService", element.getProductOrService(), -1);
5656    for (int i = 0; i < element.getModifier().size(); i++)
5657      composeCodeableConcept(t, "CoverageEligibilityRequest", "modifier", element.getModifier().get(i), i);
5658    if (element.hasProvider())
5659      composeReference(t, "CoverageEligibilityRequest", "provider", element.getProvider(), -1);
5660    if (element.hasQuantity())
5661      composeQuantity(t, "CoverageEligibilityRequest", "quantity", element.getQuantity(), -1);
5662    if (element.hasUnitPrice())
5663      composeMoney(t, "CoverageEligibilityRequest", "unitPrice", element.getUnitPrice(), -1);
5664    if (element.hasFacility())
5665      composeReference(t, "CoverageEligibilityRequest", "facility", element.getFacility(), -1);
5666    for (int i = 0; i < element.getDiagnosis().size(); i++)
5667      composeCoverageEligibilityRequestDiagnosisComponent(t, "CoverageEligibilityRequest", "diagnosis",
5668          element.getDiagnosis().get(i), i);
5669    for (int i = 0; i < element.getDetail().size(); i++)
5670      composeReference(t, "CoverageEligibilityRequest", "detail", element.getDetail().get(i), i);
5671  }
5672
5673  protected void composeCoverageEligibilityRequestDiagnosisComponent(Complex parent, String parentType, String name,
5674      CoverageEligibilityRequest.DiagnosisComponent element, int index) {
5675    if (element == null)
5676      return;
5677    Complex t;
5678    if (Utilities.noString(parentType))
5679      t = parent;
5680    else {
5681      t = parent.predicate("fhir:" + parentType + '.' + name);
5682    }
5683    composeBackboneElement(t, "diagnosis", name, element, index);
5684    if (element.hasDiagnosis())
5685      composeType(t, "CoverageEligibilityRequest", "diagnosis", element.getDiagnosis(), -1);
5686  }
5687
5688  protected void composeCoverageEligibilityResponse(Complex parent, String parentType, String name,
5689      CoverageEligibilityResponse element, int index) {
5690    if (element == null)
5691      return;
5692    Complex t;
5693    if (Utilities.noString(parentType))
5694      t = parent;
5695    else {
5696      t = parent.predicate("fhir:" + parentType + '.' + name);
5697    }
5698    composeDomainResource(t, "CoverageEligibilityResponse", name, element, index);
5699    for (int i = 0; i < element.getIdentifier().size(); i++)
5700      composeIdentifier(t, "CoverageEligibilityResponse", "identifier", element.getIdentifier().get(i), i);
5701    if (element.hasStatusElement())
5702      composeEnum(t, "CoverageEligibilityResponse", "status", element.getStatusElement(), -1);
5703    for (int i = 0; i < element.getPurpose().size(); i++)
5704      composeEnum(t, "CoverageEligibilityResponse", "purpose", element.getPurpose().get(i), i);
5705    if (element.hasPatient())
5706      composeReference(t, "CoverageEligibilityResponse", "patient", element.getPatient(), -1);
5707    if (element.hasServiced())
5708      composeType(t, "CoverageEligibilityResponse", "serviced", element.getServiced(), -1);
5709    if (element.hasCreatedElement())
5710      composeDateTime(t, "CoverageEligibilityResponse", "created", element.getCreatedElement(), -1);
5711    if (element.hasRequestor())
5712      composeReference(t, "CoverageEligibilityResponse", "requestor", element.getRequestor(), -1);
5713    if (element.hasRequest())
5714      composeReference(t, "CoverageEligibilityResponse", "request", element.getRequest(), -1);
5715    if (element.hasOutcomeElement())
5716      composeEnum(t, "CoverageEligibilityResponse", "outcome", element.getOutcomeElement(), -1);
5717    if (element.hasDispositionElement())
5718      composeString(t, "CoverageEligibilityResponse", "disposition", element.getDispositionElement(), -1);
5719    if (element.hasInsurer())
5720      composeReference(t, "CoverageEligibilityResponse", "insurer", element.getInsurer(), -1);
5721    for (int i = 0; i < element.getInsurance().size(); i++)
5722      composeCoverageEligibilityResponseInsuranceComponent(t, "CoverageEligibilityResponse", "insurance",
5723          element.getInsurance().get(i), i);
5724    if (element.hasPreAuthRefElement())
5725      composeString(t, "CoverageEligibilityResponse", "preAuthRef", element.getPreAuthRefElement(), -1);
5726    if (element.hasForm())
5727      composeCodeableConcept(t, "CoverageEligibilityResponse", "form", element.getForm(), -1);
5728    for (int i = 0; i < element.getError().size(); i++)
5729      composeCoverageEligibilityResponseErrorsComponent(t, "CoverageEligibilityResponse", "error",
5730          element.getError().get(i), i);
5731  }
5732
5733  protected void composeCoverageEligibilityResponseInsuranceComponent(Complex parent, String parentType, String name,
5734      CoverageEligibilityResponse.InsuranceComponent element, int index) {
5735    if (element == null)
5736      return;
5737    Complex t;
5738    if (Utilities.noString(parentType))
5739      t = parent;
5740    else {
5741      t = parent.predicate("fhir:" + parentType + '.' + name);
5742    }
5743    composeBackboneElement(t, "insurance", name, element, index);
5744    if (element.hasCoverage())
5745      composeReference(t, "CoverageEligibilityResponse", "coverage", element.getCoverage(), -1);
5746    if (element.hasInforceElement())
5747      composeBoolean(t, "CoverageEligibilityResponse", "inforce", element.getInforceElement(), -1);
5748    if (element.hasBenefitPeriod())
5749      composePeriod(t, "CoverageEligibilityResponse", "benefitPeriod", element.getBenefitPeriod(), -1);
5750    for (int i = 0; i < element.getItem().size(); i++)
5751      composeCoverageEligibilityResponseItemsComponent(t, "CoverageEligibilityResponse", "item",
5752          element.getItem().get(i), i);
5753  }
5754
5755  protected void composeCoverageEligibilityResponseItemsComponent(Complex parent, String parentType, String name,
5756      CoverageEligibilityResponse.ItemsComponent element, int index) {
5757    if (element == null)
5758      return;
5759    Complex t;
5760    if (Utilities.noString(parentType))
5761      t = parent;
5762    else {
5763      t = parent.predicate("fhir:" + parentType + '.' + name);
5764    }
5765    composeBackboneElement(t, "item", name, element, index);
5766    if (element.hasCategory())
5767      composeCodeableConcept(t, "CoverageEligibilityResponse", "category", element.getCategory(), -1);
5768    if (element.hasProductOrService())
5769      composeCodeableConcept(t, "CoverageEligibilityResponse", "productOrService", element.getProductOrService(), -1);
5770    for (int i = 0; i < element.getModifier().size(); i++)
5771      composeCodeableConcept(t, "CoverageEligibilityResponse", "modifier", element.getModifier().get(i), i);
5772    if (element.hasProvider())
5773      composeReference(t, "CoverageEligibilityResponse", "provider", element.getProvider(), -1);
5774    if (element.hasExcludedElement())
5775      composeBoolean(t, "CoverageEligibilityResponse", "excluded", element.getExcludedElement(), -1);
5776    if (element.hasNameElement())
5777      composeString(t, "CoverageEligibilityResponse", "name", element.getNameElement(), -1);
5778    if (element.hasDescriptionElement())
5779      composeString(t, "CoverageEligibilityResponse", "description", element.getDescriptionElement(), -1);
5780    if (element.hasNetwork())
5781      composeCodeableConcept(t, "CoverageEligibilityResponse", "network", element.getNetwork(), -1);
5782    if (element.hasUnit())
5783      composeCodeableConcept(t, "CoverageEligibilityResponse", "unit", element.getUnit(), -1);
5784    if (element.hasTerm())
5785      composeCodeableConcept(t, "CoverageEligibilityResponse", "term", element.getTerm(), -1);
5786    for (int i = 0; i < element.getBenefit().size(); i++)
5787      composeCoverageEligibilityResponseBenefitComponent(t, "CoverageEligibilityResponse", "benefit",
5788          element.getBenefit().get(i), i);
5789    if (element.hasAuthorizationRequiredElement())
5790      composeBoolean(t, "CoverageEligibilityResponse", "authorizationRequired",
5791          element.getAuthorizationRequiredElement(), -1);
5792    for (int i = 0; i < element.getAuthorizationSupporting().size(); i++)
5793      composeCodeableConcept(t, "CoverageEligibilityResponse", "authorizationSupporting",
5794          element.getAuthorizationSupporting().get(i), i);
5795    if (element.hasAuthorizationUrlElement())
5796      composeUri(t, "CoverageEligibilityResponse", "authorizationUrl", element.getAuthorizationUrlElement(), -1);
5797  }
5798
5799  protected void composeCoverageEligibilityResponseBenefitComponent(Complex parent, String parentType, String name,
5800      CoverageEligibilityResponse.BenefitComponent element, int index) {
5801    if (element == null)
5802      return;
5803    Complex t;
5804    if (Utilities.noString(parentType))
5805      t = parent;
5806    else {
5807      t = parent.predicate("fhir:" + parentType + '.' + name);
5808    }
5809    composeBackboneElement(t, "benefit", name, element, index);
5810    if (element.hasType())
5811      composeCodeableConcept(t, "CoverageEligibilityResponse", "type", element.getType(), -1);
5812    if (element.hasAllowed())
5813      composeType(t, "CoverageEligibilityResponse", "allowed", element.getAllowed(), -1);
5814    if (element.hasUsed())
5815      composeType(t, "CoverageEligibilityResponse", "used", element.getUsed(), -1);
5816  }
5817
5818  protected void composeCoverageEligibilityResponseErrorsComponent(Complex parent, String parentType, String name,
5819      CoverageEligibilityResponse.ErrorsComponent element, int index) {
5820    if (element == null)
5821      return;
5822    Complex t;
5823    if (Utilities.noString(parentType))
5824      t = parent;
5825    else {
5826      t = parent.predicate("fhir:" + parentType + '.' + name);
5827    }
5828    composeBackboneElement(t, "error", name, element, index);
5829    if (element.hasCode())
5830      composeCodeableConcept(t, "CoverageEligibilityResponse", "code", element.getCode(), -1);
5831  }
5832
5833  protected void composeDetectedIssue(Complex parent, String parentType, String name, DetectedIssue element,
5834      int index) {
5835    if (element == null)
5836      return;
5837    Complex t;
5838    if (Utilities.noString(parentType))
5839      t = parent;
5840    else {
5841      t = parent.predicate("fhir:" + parentType + '.' + name);
5842    }
5843    composeDomainResource(t, "DetectedIssue", name, element, index);
5844    for (int i = 0; i < element.getIdentifier().size(); i++)
5845      composeIdentifier(t, "DetectedIssue", "identifier", element.getIdentifier().get(i), i);
5846    if (element.hasStatusElement())
5847      composeEnum(t, "DetectedIssue", "status", element.getStatusElement(), -1);
5848    if (element.hasCode())
5849      composeCodeableConcept(t, "DetectedIssue", "code", element.getCode(), -1);
5850    if (element.hasSeverityElement())
5851      composeEnum(t, "DetectedIssue", "severity", element.getSeverityElement(), -1);
5852    if (element.hasPatient())
5853      composeReference(t, "DetectedIssue", "patient", element.getPatient(), -1);
5854    if (element.hasIdentified())
5855      composeType(t, "DetectedIssue", "identified", element.getIdentified(), -1);
5856    if (element.hasAuthor())
5857      composeReference(t, "DetectedIssue", "author", element.getAuthor(), -1);
5858    for (int i = 0; i < element.getImplicated().size(); i++)
5859      composeReference(t, "DetectedIssue", "implicated", element.getImplicated().get(i), i);
5860    for (int i = 0; i < element.getEvidence().size(); i++)
5861      composeDetectedIssueDetectedIssueEvidenceComponent(t, "DetectedIssue", "evidence", element.getEvidence().get(i),
5862          i);
5863    if (element.hasDetailElement())
5864      composeString(t, "DetectedIssue", "detail", element.getDetailElement(), -1);
5865    if (element.hasReferenceElement())
5866      composeUri(t, "DetectedIssue", "reference", element.getReferenceElement(), -1);
5867    for (int i = 0; i < element.getMitigation().size(); i++)
5868      composeDetectedIssueDetectedIssueMitigationComponent(t, "DetectedIssue", "mitigation",
5869          element.getMitigation().get(i), i);
5870  }
5871
5872  protected void composeDetectedIssueDetectedIssueEvidenceComponent(Complex parent, String parentType, String name,
5873      DetectedIssue.DetectedIssueEvidenceComponent element, int index) {
5874    if (element == null)
5875      return;
5876    Complex t;
5877    if (Utilities.noString(parentType))
5878      t = parent;
5879    else {
5880      t = parent.predicate("fhir:" + parentType + '.' + name);
5881    }
5882    composeBackboneElement(t, "evidence", name, element, index);
5883    for (int i = 0; i < element.getCode().size(); i++)
5884      composeCodeableConcept(t, "DetectedIssue", "code", element.getCode().get(i), i);
5885    for (int i = 0; i < element.getDetail().size(); i++)
5886      composeReference(t, "DetectedIssue", "detail", element.getDetail().get(i), i);
5887  }
5888
5889  protected void composeDetectedIssueDetectedIssueMitigationComponent(Complex parent, String parentType, String name,
5890      DetectedIssue.DetectedIssueMitigationComponent element, int index) {
5891    if (element == null)
5892      return;
5893    Complex t;
5894    if (Utilities.noString(parentType))
5895      t = parent;
5896    else {
5897      t = parent.predicate("fhir:" + parentType + '.' + name);
5898    }
5899    composeBackboneElement(t, "mitigation", name, element, index);
5900    if (element.hasAction())
5901      composeCodeableConcept(t, "DetectedIssue", "action", element.getAction(), -1);
5902    if (element.hasDateElement())
5903      composeDateTime(t, "DetectedIssue", "date", element.getDateElement(), -1);
5904    if (element.hasAuthor())
5905      composeReference(t, "DetectedIssue", "author", element.getAuthor(), -1);
5906  }
5907
5908  protected void composeDevice(Complex parent, String parentType, String name, Device element, int index) {
5909    if (element == null)
5910      return;
5911    Complex t;
5912    if (Utilities.noString(parentType))
5913      t = parent;
5914    else {
5915      t = parent.predicate("fhir:" + parentType + '.' + name);
5916    }
5917    composeDomainResource(t, "Device", name, element, index);
5918    for (int i = 0; i < element.getIdentifier().size(); i++)
5919      composeIdentifier(t, "Device", "identifier", element.getIdentifier().get(i), i);
5920    if (element.hasDefinition())
5921      composeReference(t, "Device", "definition", element.getDefinition(), -1);
5922    for (int i = 0; i < element.getUdiCarrier().size(); i++)
5923      composeDeviceDeviceUdiCarrierComponent(t, "Device", "udiCarrier", element.getUdiCarrier().get(i), i);
5924    if (element.hasStatusElement())
5925      composeEnum(t, "Device", "status", element.getStatusElement(), -1);
5926    for (int i = 0; i < element.getStatusReason().size(); i++)
5927      composeCodeableConcept(t, "Device", "statusReason", element.getStatusReason().get(i), i);
5928    if (element.hasDistinctIdentifierElement())
5929      composeString(t, "Device", "distinctIdentifier", element.getDistinctIdentifierElement(), -1);
5930    if (element.hasManufacturerElement())
5931      composeString(t, "Device", "manufacturer", element.getManufacturerElement(), -1);
5932    if (element.hasManufactureDateElement())
5933      composeDateTime(t, "Device", "manufactureDate", element.getManufactureDateElement(), -1);
5934    if (element.hasExpirationDateElement())
5935      composeDateTime(t, "Device", "expirationDate", element.getExpirationDateElement(), -1);
5936    if (element.hasLotNumberElement())
5937      composeString(t, "Device", "lotNumber", element.getLotNumberElement(), -1);
5938    if (element.hasSerialNumberElement())
5939      composeString(t, "Device", "serialNumber", element.getSerialNumberElement(), -1);
5940    for (int i = 0; i < element.getDeviceName().size(); i++)
5941      composeDeviceDeviceDeviceNameComponent(t, "Device", "deviceName", element.getDeviceName().get(i), i);
5942    if (element.hasModelNumberElement())
5943      composeString(t, "Device", "modelNumber", element.getModelNumberElement(), -1);
5944    if (element.hasPartNumberElement())
5945      composeString(t, "Device", "partNumber", element.getPartNumberElement(), -1);
5946    if (element.hasType())
5947      composeCodeableConcept(t, "Device", "type", element.getType(), -1);
5948    for (int i = 0; i < element.getSpecialization().size(); i++)
5949      composeDeviceDeviceSpecializationComponent(t, "Device", "specialization", element.getSpecialization().get(i), i);
5950    for (int i = 0; i < element.getVersion().size(); i++)
5951      composeDeviceDeviceVersionComponent(t, "Device", "version", element.getVersion().get(i), i);
5952    for (int i = 0; i < element.getProperty().size(); i++)
5953      composeDeviceDevicePropertyComponent(t, "Device", "property", element.getProperty().get(i), i);
5954    if (element.hasPatient())
5955      composeReference(t, "Device", "patient", element.getPatient(), -1);
5956    if (element.hasOwner())
5957      composeReference(t, "Device", "owner", element.getOwner(), -1);
5958    for (int i = 0; i < element.getContact().size(); i++)
5959      composeContactPoint(t, "Device", "contact", element.getContact().get(i), i);
5960    if (element.hasLocation())
5961      composeReference(t, "Device", "location", element.getLocation(), -1);
5962    if (element.hasUrlElement())
5963      composeUri(t, "Device", "url", element.getUrlElement(), -1);
5964    for (int i = 0; i < element.getNote().size(); i++)
5965      composeAnnotation(t, "Device", "note", element.getNote().get(i), i);
5966    for (int i = 0; i < element.getSafety().size(); i++)
5967      composeCodeableConcept(t, "Device", "safety", element.getSafety().get(i), i);
5968    if (element.hasParent())
5969      composeReference(t, "Device", "parent", element.getParent(), -1);
5970  }
5971
5972  protected void composeDeviceDeviceUdiCarrierComponent(Complex parent, String parentType, String name,
5973      Device.DeviceUdiCarrierComponent element, int index) {
5974    if (element == null)
5975      return;
5976    Complex t;
5977    if (Utilities.noString(parentType))
5978      t = parent;
5979    else {
5980      t = parent.predicate("fhir:" + parentType + '.' + name);
5981    }
5982    composeBackboneElement(t, "udiCarrier", name, element, index);
5983    if (element.hasDeviceIdentifierElement())
5984      composeString(t, "Device", "deviceIdentifier", element.getDeviceIdentifierElement(), -1);
5985    if (element.hasIssuerElement())
5986      composeUri(t, "Device", "issuer", element.getIssuerElement(), -1);
5987    if (element.hasJurisdictionElement())
5988      composeUri(t, "Device", "jurisdiction", element.getJurisdictionElement(), -1);
5989    if (element.hasCarrierAIDCElement())
5990      composeBase64Binary(t, "Device", "carrierAIDC", element.getCarrierAIDCElement(), -1);
5991    if (element.hasCarrierHRFElement())
5992      composeString(t, "Device", "carrierHRF", element.getCarrierHRFElement(), -1);
5993    if (element.hasEntryTypeElement())
5994      composeEnum(t, "Device", "entryType", element.getEntryTypeElement(), -1);
5995  }
5996
5997  protected void composeDeviceDeviceDeviceNameComponent(Complex parent, String parentType, String name,
5998      Device.DeviceDeviceNameComponent element, int index) {
5999    if (element == null)
6000      return;
6001    Complex t;
6002    if (Utilities.noString(parentType))
6003      t = parent;
6004    else {
6005      t = parent.predicate("fhir:" + parentType + '.' + name);
6006    }
6007    composeBackboneElement(t, "deviceName", name, element, index);
6008    if (element.hasNameElement())
6009      composeString(t, "Device", "name", element.getNameElement(), -1);
6010    if (element.hasTypeElement())
6011      composeEnum(t, "Device", "type", element.getTypeElement(), -1);
6012  }
6013
6014  protected void composeDeviceDeviceSpecializationComponent(Complex parent, String parentType, String name,
6015      Device.DeviceSpecializationComponent element, int index) {
6016    if (element == null)
6017      return;
6018    Complex t;
6019    if (Utilities.noString(parentType))
6020      t = parent;
6021    else {
6022      t = parent.predicate("fhir:" + parentType + '.' + name);
6023    }
6024    composeBackboneElement(t, "specialization", name, element, index);
6025    if (element.hasSystemType())
6026      composeCodeableConcept(t, "Device", "systemType", element.getSystemType(), -1);
6027    if (element.hasVersionElement())
6028      composeString(t, "Device", "version", element.getVersionElement(), -1);
6029  }
6030
6031  protected void composeDeviceDeviceVersionComponent(Complex parent, String parentType, String name,
6032      Device.DeviceVersionComponent element, int index) {
6033    if (element == null)
6034      return;
6035    Complex t;
6036    if (Utilities.noString(parentType))
6037      t = parent;
6038    else {
6039      t = parent.predicate("fhir:" + parentType + '.' + name);
6040    }
6041    composeBackboneElement(t, "version", name, element, index);
6042    if (element.hasType())
6043      composeCodeableConcept(t, "Device", "type", element.getType(), -1);
6044    if (element.hasComponent())
6045      composeIdentifier(t, "Device", "component", element.getComponent(), -1);
6046    if (element.hasValueElement())
6047      composeString(t, "Device", "value", element.getValueElement(), -1);
6048  }
6049
6050  protected void composeDeviceDevicePropertyComponent(Complex parent, String parentType, String name,
6051      Device.DevicePropertyComponent element, int index) {
6052    if (element == null)
6053      return;
6054    Complex t;
6055    if (Utilities.noString(parentType))
6056      t = parent;
6057    else {
6058      t = parent.predicate("fhir:" + parentType + '.' + name);
6059    }
6060    composeBackboneElement(t, "property", name, element, index);
6061    if (element.hasType())
6062      composeCodeableConcept(t, "Device", "type", element.getType(), -1);
6063    for (int i = 0; i < element.getValueQuantity().size(); i++)
6064      composeQuantity(t, "Device", "valueQuantity", element.getValueQuantity().get(i), i);
6065    for (int i = 0; i < element.getValueCode().size(); i++)
6066      composeCodeableConcept(t, "Device", "valueCode", element.getValueCode().get(i), i);
6067  }
6068
6069  protected void composeDeviceDefinition(Complex parent, String parentType, String name, DeviceDefinition element,
6070      int index) {
6071    if (element == null)
6072      return;
6073    Complex t;
6074    if (Utilities.noString(parentType))
6075      t = parent;
6076    else {
6077      t = parent.predicate("fhir:" + parentType + '.' + name);
6078    }
6079    composeDomainResource(t, "DeviceDefinition", name, element, index);
6080    for (int i = 0; i < element.getIdentifier().size(); i++)
6081      composeIdentifier(t, "DeviceDefinition", "identifier", element.getIdentifier().get(i), i);
6082    for (int i = 0; i < element.getUdiDeviceIdentifier().size(); i++)
6083      composeDeviceDefinitionDeviceDefinitionUdiDeviceIdentifierComponent(t, "DeviceDefinition", "udiDeviceIdentifier",
6084          element.getUdiDeviceIdentifier().get(i), i);
6085    if (element.hasManufacturer())
6086      composeType(t, "DeviceDefinition", "manufacturer", element.getManufacturer(), -1);
6087    for (int i = 0; i < element.getDeviceName().size(); i++)
6088      composeDeviceDefinitionDeviceDefinitionDeviceNameComponent(t, "DeviceDefinition", "deviceName",
6089          element.getDeviceName().get(i), i);
6090    if (element.hasModelNumberElement())
6091      composeString(t, "DeviceDefinition", "modelNumber", element.getModelNumberElement(), -1);
6092    if (element.hasType())
6093      composeCodeableConcept(t, "DeviceDefinition", "type", element.getType(), -1);
6094    for (int i = 0; i < element.getSpecialization().size(); i++)
6095      composeDeviceDefinitionDeviceDefinitionSpecializationComponent(t, "DeviceDefinition", "specialization",
6096          element.getSpecialization().get(i), i);
6097    for (int i = 0; i < element.getVersion().size(); i++)
6098      composeString(t, "DeviceDefinition", "version", element.getVersion().get(i), i);
6099    for (int i = 0; i < element.getSafety().size(); i++)
6100      composeCodeableConcept(t, "DeviceDefinition", "safety", element.getSafety().get(i), i);
6101    for (int i = 0; i < element.getShelfLifeStorage().size(); i++)
6102      composeProductShelfLife(t, "DeviceDefinition", "shelfLifeStorage", element.getShelfLifeStorage().get(i), i);
6103    if (element.hasPhysicalCharacteristics())
6104      composeProdCharacteristic(t, "DeviceDefinition", "physicalCharacteristics", element.getPhysicalCharacteristics(),
6105          -1);
6106    for (int i = 0; i < element.getLanguageCode().size(); i++)
6107      composeCodeableConcept(t, "DeviceDefinition", "languageCode", element.getLanguageCode().get(i), i);
6108    for (int i = 0; i < element.getCapability().size(); i++)
6109      composeDeviceDefinitionDeviceDefinitionCapabilityComponent(t, "DeviceDefinition", "capability",
6110          element.getCapability().get(i), i);
6111    for (int i = 0; i < element.getProperty().size(); i++)
6112      composeDeviceDefinitionDeviceDefinitionPropertyComponent(t, "DeviceDefinition", "property",
6113          element.getProperty().get(i), i);
6114    if (element.hasOwner())
6115      composeReference(t, "DeviceDefinition", "owner", element.getOwner(), -1);
6116    for (int i = 0; i < element.getContact().size(); i++)
6117      composeContactPoint(t, "DeviceDefinition", "contact", element.getContact().get(i), i);
6118    if (element.hasUrlElement())
6119      composeUri(t, "DeviceDefinition", "url", element.getUrlElement(), -1);
6120    if (element.hasOnlineInformationElement())
6121      composeUri(t, "DeviceDefinition", "onlineInformation", element.getOnlineInformationElement(), -1);
6122    for (int i = 0; i < element.getNote().size(); i++)
6123      composeAnnotation(t, "DeviceDefinition", "note", element.getNote().get(i), i);
6124    if (element.hasQuantity())
6125      composeQuantity(t, "DeviceDefinition", "quantity", element.getQuantity(), -1);
6126    if (element.hasParentDevice())
6127      composeReference(t, "DeviceDefinition", "parentDevice", element.getParentDevice(), -1);
6128    for (int i = 0; i < element.getMaterial().size(); i++)
6129      composeDeviceDefinitionDeviceDefinitionMaterialComponent(t, "DeviceDefinition", "material",
6130          element.getMaterial().get(i), i);
6131  }
6132
6133  protected void composeDeviceDefinitionDeviceDefinitionUdiDeviceIdentifierComponent(Complex parent, String parentType,
6134      String name, DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent element, int index) {
6135    if (element == null)
6136      return;
6137    Complex t;
6138    if (Utilities.noString(parentType))
6139      t = parent;
6140    else {
6141      t = parent.predicate("fhir:" + parentType + '.' + name);
6142    }
6143    composeBackboneElement(t, "udiDeviceIdentifier", name, element, index);
6144    if (element.hasDeviceIdentifierElement())
6145      composeString(t, "DeviceDefinition", "deviceIdentifier", element.getDeviceIdentifierElement(), -1);
6146    if (element.hasIssuerElement())
6147      composeUri(t, "DeviceDefinition", "issuer", element.getIssuerElement(), -1);
6148    if (element.hasJurisdictionElement())
6149      composeUri(t, "DeviceDefinition", "jurisdiction", element.getJurisdictionElement(), -1);
6150  }
6151
6152  protected void composeDeviceDefinitionDeviceDefinitionDeviceNameComponent(Complex parent, String parentType,
6153      String name, DeviceDefinition.DeviceDefinitionDeviceNameComponent element, int index) {
6154    if (element == null)
6155      return;
6156    Complex t;
6157    if (Utilities.noString(parentType))
6158      t = parent;
6159    else {
6160      t = parent.predicate("fhir:" + parentType + '.' + name);
6161    }
6162    composeBackboneElement(t, "deviceName", name, element, index);
6163    if (element.hasNameElement())
6164      composeString(t, "DeviceDefinition", "name", element.getNameElement(), -1);
6165    if (element.hasTypeElement())
6166      composeEnum(t, "DeviceDefinition", "type", element.getTypeElement(), -1);
6167  }
6168
6169  protected void composeDeviceDefinitionDeviceDefinitionSpecializationComponent(Complex parent, String parentType,
6170      String name, DeviceDefinition.DeviceDefinitionSpecializationComponent element, int index) {
6171    if (element == null)
6172      return;
6173    Complex t;
6174    if (Utilities.noString(parentType))
6175      t = parent;
6176    else {
6177      t = parent.predicate("fhir:" + parentType + '.' + name);
6178    }
6179    composeBackboneElement(t, "specialization", name, element, index);
6180    if (element.hasSystemTypeElement())
6181      composeString(t, "DeviceDefinition", "systemType", element.getSystemTypeElement(), -1);
6182    if (element.hasVersionElement())
6183      composeString(t, "DeviceDefinition", "version", element.getVersionElement(), -1);
6184  }
6185
6186  protected void composeDeviceDefinitionDeviceDefinitionCapabilityComponent(Complex parent, String parentType,
6187      String name, DeviceDefinition.DeviceDefinitionCapabilityComponent element, int index) {
6188    if (element == null)
6189      return;
6190    Complex t;
6191    if (Utilities.noString(parentType))
6192      t = parent;
6193    else {
6194      t = parent.predicate("fhir:" + parentType + '.' + name);
6195    }
6196    composeBackboneElement(t, "capability", name, element, index);
6197    if (element.hasType())
6198      composeCodeableConcept(t, "DeviceDefinition", "type", element.getType(), -1);
6199    for (int i = 0; i < element.getDescription().size(); i++)
6200      composeCodeableConcept(t, "DeviceDefinition", "description", element.getDescription().get(i), i);
6201  }
6202
6203  protected void composeDeviceDefinitionDeviceDefinitionPropertyComponent(Complex parent, String parentType,
6204      String name, DeviceDefinition.DeviceDefinitionPropertyComponent element, int index) {
6205    if (element == null)
6206      return;
6207    Complex t;
6208    if (Utilities.noString(parentType))
6209      t = parent;
6210    else {
6211      t = parent.predicate("fhir:" + parentType + '.' + name);
6212    }
6213    composeBackboneElement(t, "property", name, element, index);
6214    if (element.hasType())
6215      composeCodeableConcept(t, "DeviceDefinition", "type", element.getType(), -1);
6216    for (int i = 0; i < element.getValueQuantity().size(); i++)
6217      composeQuantity(t, "DeviceDefinition", "valueQuantity", element.getValueQuantity().get(i), i);
6218    for (int i = 0; i < element.getValueCode().size(); i++)
6219      composeCodeableConcept(t, "DeviceDefinition", "valueCode", element.getValueCode().get(i), i);
6220  }
6221
6222  protected void composeDeviceDefinitionDeviceDefinitionMaterialComponent(Complex parent, String parentType,
6223      String name, DeviceDefinition.DeviceDefinitionMaterialComponent element, int index) {
6224    if (element == null)
6225      return;
6226    Complex t;
6227    if (Utilities.noString(parentType))
6228      t = parent;
6229    else {
6230      t = parent.predicate("fhir:" + parentType + '.' + name);
6231    }
6232    composeBackboneElement(t, "material", name, element, index);
6233    if (element.hasSubstance())
6234      composeCodeableConcept(t, "DeviceDefinition", "substance", element.getSubstance(), -1);
6235    if (element.hasAlternateElement())
6236      composeBoolean(t, "DeviceDefinition", "alternate", element.getAlternateElement(), -1);
6237    if (element.hasAllergenicIndicatorElement())
6238      composeBoolean(t, "DeviceDefinition", "allergenicIndicator", element.getAllergenicIndicatorElement(), -1);
6239  }
6240
6241  protected void composeDeviceMetric(Complex parent, String parentType, String name, DeviceMetric element, int index) {
6242    if (element == null)
6243      return;
6244    Complex t;
6245    if (Utilities.noString(parentType))
6246      t = parent;
6247    else {
6248      t = parent.predicate("fhir:" + parentType + '.' + name);
6249    }
6250    composeDomainResource(t, "DeviceMetric", name, element, index);
6251    for (int i = 0; i < element.getIdentifier().size(); i++)
6252      composeIdentifier(t, "DeviceMetric", "identifier", element.getIdentifier().get(i), i);
6253    if (element.hasType())
6254      composeCodeableConcept(t, "DeviceMetric", "type", element.getType(), -1);
6255    if (element.hasUnit())
6256      composeCodeableConcept(t, "DeviceMetric", "unit", element.getUnit(), -1);
6257    if (element.hasSource())
6258      composeReference(t, "DeviceMetric", "source", element.getSource(), -1);
6259    if (element.hasParent())
6260      composeReference(t, "DeviceMetric", "parent", element.getParent(), -1);
6261    if (element.hasOperationalStatusElement())
6262      composeEnum(t, "DeviceMetric", "operationalStatus", element.getOperationalStatusElement(), -1);
6263    if (element.hasColorElement())
6264      composeEnum(t, "DeviceMetric", "color", element.getColorElement(), -1);
6265    if (element.hasCategoryElement())
6266      composeEnum(t, "DeviceMetric", "category", element.getCategoryElement(), -1);
6267    if (element.hasMeasurementPeriod())
6268      composeTiming(t, "DeviceMetric", "measurementPeriod", element.getMeasurementPeriod(), -1);
6269    for (int i = 0; i < element.getCalibration().size(); i++)
6270      composeDeviceMetricDeviceMetricCalibrationComponent(t, "DeviceMetric", "calibration",
6271          element.getCalibration().get(i), i);
6272  }
6273
6274  protected void composeDeviceMetricDeviceMetricCalibrationComponent(Complex parent, String parentType, String name,
6275      DeviceMetric.DeviceMetricCalibrationComponent element, int index) {
6276    if (element == null)
6277      return;
6278    Complex t;
6279    if (Utilities.noString(parentType))
6280      t = parent;
6281    else {
6282      t = parent.predicate("fhir:" + parentType + '.' + name);
6283    }
6284    composeBackboneElement(t, "calibration", name, element, index);
6285    if (element.hasTypeElement())
6286      composeEnum(t, "DeviceMetric", "type", element.getTypeElement(), -1);
6287    if (element.hasStateElement())
6288      composeEnum(t, "DeviceMetric", "state", element.getStateElement(), -1);
6289    if (element.hasTimeElement())
6290      composeInstant(t, "DeviceMetric", "time", element.getTimeElement(), -1);
6291  }
6292
6293  protected void composeDeviceRequest(Complex parent, String parentType, String name, DeviceRequest element,
6294      int index) {
6295    if (element == null)
6296      return;
6297    Complex t;
6298    if (Utilities.noString(parentType))
6299      t = parent;
6300    else {
6301      t = parent.predicate("fhir:" + parentType + '.' + name);
6302    }
6303    composeDomainResource(t, "DeviceRequest", name, element, index);
6304    for (int i = 0; i < element.getIdentifier().size(); i++)
6305      composeIdentifier(t, "DeviceRequest", "identifier", element.getIdentifier().get(i), i);
6306    for (int i = 0; i < element.getInstantiatesCanonical().size(); i++)
6307      composeCanonical(t, "DeviceRequest", "instantiatesCanonical", element.getInstantiatesCanonical().get(i), i);
6308    for (int i = 0; i < element.getInstantiatesUri().size(); i++)
6309      composeUri(t, "DeviceRequest", "instantiatesUri", element.getInstantiatesUri().get(i), i);
6310    for (int i = 0; i < element.getBasedOn().size(); i++)
6311      composeReference(t, "DeviceRequest", "basedOn", element.getBasedOn().get(i), i);
6312    for (int i = 0; i < element.getPriorRequest().size(); i++)
6313      composeReference(t, "DeviceRequest", "priorRequest", element.getPriorRequest().get(i), i);
6314    if (element.hasGroupIdentifier())
6315      composeIdentifier(t, "DeviceRequest", "groupIdentifier", element.getGroupIdentifier(), -1);
6316    if (element.hasStatusElement())
6317      composeEnum(t, "DeviceRequest", "status", element.getStatusElement(), -1);
6318    if (element.hasIntentElement())
6319      composeEnum(t, "DeviceRequest", "intent", element.getIntentElement(), -1);
6320    if (element.hasPriorityElement())
6321      composeEnum(t, "DeviceRequest", "priority", element.getPriorityElement(), -1);
6322    if (element.hasCode())
6323      composeType(t, "DeviceRequest", "code", element.getCode(), -1);
6324    for (int i = 0; i < element.getParameter().size(); i++)
6325      composeDeviceRequestDeviceRequestParameterComponent(t, "DeviceRequest", "parameter",
6326          element.getParameter().get(i), i);
6327    if (element.hasSubject())
6328      composeReference(t, "DeviceRequest", "subject", element.getSubject(), -1);
6329    if (element.hasEncounter())
6330      composeReference(t, "DeviceRequest", "encounter", element.getEncounter(), -1);
6331    if (element.hasOccurrence())
6332      composeType(t, "DeviceRequest", "occurrence", element.getOccurrence(), -1);
6333    if (element.hasAuthoredOnElement())
6334      composeDateTime(t, "DeviceRequest", "authoredOn", element.getAuthoredOnElement(), -1);
6335    if (element.hasRequester())
6336      composeReference(t, "DeviceRequest", "requester", element.getRequester(), -1);
6337    if (element.hasPerformerType())
6338      composeCodeableConcept(t, "DeviceRequest", "performerType", element.getPerformerType(), -1);
6339    if (element.hasPerformer())
6340      composeReference(t, "DeviceRequest", "performer", element.getPerformer(), -1);
6341    for (int i = 0; i < element.getReasonCode().size(); i++)
6342      composeCodeableConcept(t, "DeviceRequest", "reasonCode", element.getReasonCode().get(i), i);
6343    for (int i = 0; i < element.getReasonReference().size(); i++)
6344      composeReference(t, "DeviceRequest", "reasonReference", element.getReasonReference().get(i), i);
6345    for (int i = 0; i < element.getInsurance().size(); i++)
6346      composeReference(t, "DeviceRequest", "insurance", element.getInsurance().get(i), i);
6347    for (int i = 0; i < element.getSupportingInfo().size(); i++)
6348      composeReference(t, "DeviceRequest", "supportingInfo", element.getSupportingInfo().get(i), i);
6349    for (int i = 0; i < element.getNote().size(); i++)
6350      composeAnnotation(t, "DeviceRequest", "note", element.getNote().get(i), i);
6351    for (int i = 0; i < element.getRelevantHistory().size(); i++)
6352      composeReference(t, "DeviceRequest", "relevantHistory", element.getRelevantHistory().get(i), i);
6353  }
6354
6355  protected void composeDeviceRequestDeviceRequestParameterComponent(Complex parent, String parentType, String name,
6356      DeviceRequest.DeviceRequestParameterComponent element, int index) {
6357    if (element == null)
6358      return;
6359    Complex t;
6360    if (Utilities.noString(parentType))
6361      t = parent;
6362    else {
6363      t = parent.predicate("fhir:" + parentType + '.' + name);
6364    }
6365    composeBackboneElement(t, "parameter", name, element, index);
6366    if (element.hasCode())
6367      composeCodeableConcept(t, "DeviceRequest", "code", element.getCode(), -1);
6368    if (element.hasValue())
6369      composeType(t, "DeviceRequest", "value", element.getValue(), -1);
6370  }
6371
6372  protected void composeDeviceUseStatement(Complex parent, String parentType, String name, DeviceUseStatement element,
6373      int index) {
6374    if (element == null)
6375      return;
6376    Complex t;
6377    if (Utilities.noString(parentType))
6378      t = parent;
6379    else {
6380      t = parent.predicate("fhir:" + parentType + '.' + name);
6381    }
6382    composeDomainResource(t, "DeviceUseStatement", name, element, index);
6383    for (int i = 0; i < element.getIdentifier().size(); i++)
6384      composeIdentifier(t, "DeviceUseStatement", "identifier", element.getIdentifier().get(i), i);
6385    for (int i = 0; i < element.getBasedOn().size(); i++)
6386      composeReference(t, "DeviceUseStatement", "basedOn", element.getBasedOn().get(i), i);
6387    if (element.hasStatusElement())
6388      composeEnum(t, "DeviceUseStatement", "status", element.getStatusElement(), -1);
6389    if (element.hasSubject())
6390      composeReference(t, "DeviceUseStatement", "subject", element.getSubject(), -1);
6391    for (int i = 0; i < element.getDerivedFrom().size(); i++)
6392      composeReference(t, "DeviceUseStatement", "derivedFrom", element.getDerivedFrom().get(i), i);
6393    if (element.hasTiming())
6394      composeType(t, "DeviceUseStatement", "timing", element.getTiming(), -1);
6395    if (element.hasRecordedOnElement())
6396      composeDateTime(t, "DeviceUseStatement", "recordedOn", element.getRecordedOnElement(), -1);
6397    if (element.hasSource())
6398      composeReference(t, "DeviceUseStatement", "source", element.getSource(), -1);
6399    if (element.hasDevice())
6400      composeReference(t, "DeviceUseStatement", "device", element.getDevice(), -1);
6401    for (int i = 0; i < element.getReasonCode().size(); i++)
6402      composeCodeableConcept(t, "DeviceUseStatement", "reasonCode", element.getReasonCode().get(i), i);
6403    for (int i = 0; i < element.getReasonReference().size(); i++)
6404      composeReference(t, "DeviceUseStatement", "reasonReference", element.getReasonReference().get(i), i);
6405    if (element.hasBodySite())
6406      composeCodeableConcept(t, "DeviceUseStatement", "bodySite", element.getBodySite(), -1);
6407    for (int i = 0; i < element.getNote().size(); i++)
6408      composeAnnotation(t, "DeviceUseStatement", "note", element.getNote().get(i), i);
6409  }
6410
6411  protected void composeDiagnosticReport(Complex parent, String parentType, String name, DiagnosticReport element,
6412      int index) {
6413    if (element == null)
6414      return;
6415    Complex t;
6416    if (Utilities.noString(parentType))
6417      t = parent;
6418    else {
6419      t = parent.predicate("fhir:" + parentType + '.' + name);
6420    }
6421    composeDomainResource(t, "DiagnosticReport", name, element, index);
6422    for (int i = 0; i < element.getIdentifier().size(); i++)
6423      composeIdentifier(t, "DiagnosticReport", "identifier", element.getIdentifier().get(i), i);
6424    for (int i = 0; i < element.getBasedOn().size(); i++)
6425      composeReference(t, "DiagnosticReport", "basedOn", element.getBasedOn().get(i), i);
6426    if (element.hasStatusElement())
6427      composeEnum(t, "DiagnosticReport", "status", element.getStatusElement(), -1);
6428    for (int i = 0; i < element.getCategory().size(); i++)
6429      composeCodeableConcept(t, "DiagnosticReport", "category", element.getCategory().get(i), i);
6430    if (element.hasCode())
6431      composeCodeableConcept(t, "DiagnosticReport", "code", element.getCode(), -1);
6432    if (element.hasSubject())
6433      composeReference(t, "DiagnosticReport", "subject", element.getSubject(), -1);
6434    if (element.hasEncounter())
6435      composeReference(t, "DiagnosticReport", "encounter", element.getEncounter(), -1);
6436    if (element.hasEffective())
6437      composeType(t, "DiagnosticReport", "effective", element.getEffective(), -1);
6438    if (element.hasIssuedElement())
6439      composeInstant(t, "DiagnosticReport", "issued", element.getIssuedElement(), -1);
6440    for (int i = 0; i < element.getPerformer().size(); i++)
6441      composeReference(t, "DiagnosticReport", "performer", element.getPerformer().get(i), i);
6442    for (int i = 0; i < element.getResultsInterpreter().size(); i++)
6443      composeReference(t, "DiagnosticReport", "resultsInterpreter", element.getResultsInterpreter().get(i), i);
6444    for (int i = 0; i < element.getSpecimen().size(); i++)
6445      composeReference(t, "DiagnosticReport", "specimen", element.getSpecimen().get(i), i);
6446    for (int i = 0; i < element.getResult().size(); i++)
6447      composeReference(t, "DiagnosticReport", "result", element.getResult().get(i), i);
6448    for (int i = 0; i < element.getImagingStudy().size(); i++)
6449      composeReference(t, "DiagnosticReport", "imagingStudy", element.getImagingStudy().get(i), i);
6450    for (int i = 0; i < element.getMedia().size(); i++)
6451      composeDiagnosticReportDiagnosticReportMediaComponent(t, "DiagnosticReport", "media", element.getMedia().get(i),
6452          i);
6453    if (element.hasConclusionElement())
6454      composeString(t, "DiagnosticReport", "conclusion", element.getConclusionElement(), -1);
6455    for (int i = 0; i < element.getConclusionCode().size(); i++)
6456      composeCodeableConcept(t, "DiagnosticReport", "conclusionCode", element.getConclusionCode().get(i), i);
6457    for (int i = 0; i < element.getPresentedForm().size(); i++)
6458      composeAttachment(t, "DiagnosticReport", "presentedForm", element.getPresentedForm().get(i), i);
6459  }
6460
6461  protected void composeDiagnosticReportDiagnosticReportMediaComponent(Complex parent, String parentType, String name,
6462      DiagnosticReport.DiagnosticReportMediaComponent element, int index) {
6463    if (element == null)
6464      return;
6465    Complex t;
6466    if (Utilities.noString(parentType))
6467      t = parent;
6468    else {
6469      t = parent.predicate("fhir:" + parentType + '.' + name);
6470    }
6471    composeBackboneElement(t, "media", name, element, index);
6472    if (element.hasCommentElement())
6473      composeString(t, "DiagnosticReport", "comment", element.getCommentElement(), -1);
6474    if (element.hasLink())
6475      composeReference(t, "DiagnosticReport", "link", element.getLink(), -1);
6476  }
6477
6478  protected void composeDocumentManifest(Complex parent, String parentType, String name, DocumentManifest element,
6479      int index) {
6480    if (element == null)
6481      return;
6482    Complex t;
6483    if (Utilities.noString(parentType))
6484      t = parent;
6485    else {
6486      t = parent.predicate("fhir:" + parentType + '.' + name);
6487    }
6488    composeDomainResource(t, "DocumentManifest", name, element, index);
6489    if (element.hasMasterIdentifier())
6490      composeIdentifier(t, "DocumentManifest", "masterIdentifier", element.getMasterIdentifier(), -1);
6491    for (int i = 0; i < element.getIdentifier().size(); i++)
6492      composeIdentifier(t, "DocumentManifest", "identifier", element.getIdentifier().get(i), i);
6493    if (element.hasStatusElement())
6494      composeEnum(t, "DocumentManifest", "status", element.getStatusElement(), -1);
6495    if (element.hasType())
6496      composeCodeableConcept(t, "DocumentManifest", "type", element.getType(), -1);
6497    if (element.hasSubject())
6498      composeReference(t, "DocumentManifest", "subject", element.getSubject(), -1);
6499    if (element.hasCreatedElement())
6500      composeDateTime(t, "DocumentManifest", "created", element.getCreatedElement(), -1);
6501    for (int i = 0; i < element.getAuthor().size(); i++)
6502      composeReference(t, "DocumentManifest", "author", element.getAuthor().get(i), i);
6503    for (int i = 0; i < element.getRecipient().size(); i++)
6504      composeReference(t, "DocumentManifest", "recipient", element.getRecipient().get(i), i);
6505    if (element.hasSourceElement())
6506      composeUri(t, "DocumentManifest", "source", element.getSourceElement(), -1);
6507    if (element.hasDescriptionElement())
6508      composeString(t, "DocumentManifest", "description", element.getDescriptionElement(), -1);
6509    for (int i = 0; i < element.getContent().size(); i++)
6510      composeReference(t, "DocumentManifest", "content", element.getContent().get(i), i);
6511    for (int i = 0; i < element.getRelated().size(); i++)
6512      composeDocumentManifestDocumentManifestRelatedComponent(t, "DocumentManifest", "related",
6513          element.getRelated().get(i), i);
6514  }
6515
6516  protected void composeDocumentManifestDocumentManifestRelatedComponent(Complex parent, String parentType, String name,
6517      DocumentManifest.DocumentManifestRelatedComponent element, int index) {
6518    if (element == null)
6519      return;
6520    Complex t;
6521    if (Utilities.noString(parentType))
6522      t = parent;
6523    else {
6524      t = parent.predicate("fhir:" + parentType + '.' + name);
6525    }
6526    composeBackboneElement(t, "related", name, element, index);
6527    if (element.hasIdentifier())
6528      composeIdentifier(t, "DocumentManifest", "identifier", element.getIdentifier(), -1);
6529    if (element.hasRef())
6530      composeReference(t, "DocumentManifest", "ref", element.getRef(), -1);
6531  }
6532
6533  protected void composeDocumentReference(Complex parent, String parentType, String name, DocumentReference element,
6534      int index) {
6535    if (element == null)
6536      return;
6537    Complex t;
6538    if (Utilities.noString(parentType))
6539      t = parent;
6540    else {
6541      t = parent.predicate("fhir:" + parentType + '.' + name);
6542    }
6543    composeDomainResource(t, "DocumentReference", name, element, index);
6544    if (element.hasMasterIdentifier())
6545      composeIdentifier(t, "DocumentReference", "masterIdentifier", element.getMasterIdentifier(), -1);
6546    for (int i = 0; i < element.getIdentifier().size(); i++)
6547      composeIdentifier(t, "DocumentReference", "identifier", element.getIdentifier().get(i), i);
6548    if (element.hasStatusElement())
6549      composeEnum(t, "DocumentReference", "status", element.getStatusElement(), -1);
6550    if (element.hasDocStatusElement())
6551      composeEnum(t, "DocumentReference", "docStatus", element.getDocStatusElement(), -1);
6552    if (element.hasType())
6553      composeCodeableConcept(t, "DocumentReference", "type", element.getType(), -1);
6554    for (int i = 0; i < element.getCategory().size(); i++)
6555      composeCodeableConcept(t, "DocumentReference", "category", element.getCategory().get(i), i);
6556    if (element.hasSubject())
6557      composeReference(t, "DocumentReference", "subject", element.getSubject(), -1);
6558    if (element.hasDateElement())
6559      composeInstant(t, "DocumentReference", "date", element.getDateElement(), -1);
6560    for (int i = 0; i < element.getAuthor().size(); i++)
6561      composeReference(t, "DocumentReference", "author", element.getAuthor().get(i), i);
6562    if (element.hasAuthenticator())
6563      composeReference(t, "DocumentReference", "authenticator", element.getAuthenticator(), -1);
6564    if (element.hasCustodian())
6565      composeReference(t, "DocumentReference", "custodian", element.getCustodian(), -1);
6566    for (int i = 0; i < element.getRelatesTo().size(); i++)
6567      composeDocumentReferenceDocumentReferenceRelatesToComponent(t, "DocumentReference", "relatesTo",
6568          element.getRelatesTo().get(i), i);
6569    if (element.hasDescriptionElement())
6570      composeString(t, "DocumentReference", "description", element.getDescriptionElement(), -1);
6571    for (int i = 0; i < element.getSecurityLabel().size(); i++)
6572      composeCodeableConcept(t, "DocumentReference", "securityLabel", element.getSecurityLabel().get(i), i);
6573    for (int i = 0; i < element.getContent().size(); i++)
6574      composeDocumentReferenceDocumentReferenceContentComponent(t, "DocumentReference", "content",
6575          element.getContent().get(i), i);
6576    if (element.hasContext())
6577      composeDocumentReferenceDocumentReferenceContextComponent(t, "DocumentReference", "context", element.getContext(),
6578          -1);
6579  }
6580
6581  protected void composeDocumentReferenceDocumentReferenceRelatesToComponent(Complex parent, String parentType,
6582      String name, DocumentReference.DocumentReferenceRelatesToComponent element, int index) {
6583    if (element == null)
6584      return;
6585    Complex t;
6586    if (Utilities.noString(parentType))
6587      t = parent;
6588    else {
6589      t = parent.predicate("fhir:" + parentType + '.' + name);
6590    }
6591    composeBackboneElement(t, "relatesTo", name, element, index);
6592    if (element.hasCodeElement())
6593      composeEnum(t, "DocumentReference", "code", element.getCodeElement(), -1);
6594    if (element.hasTarget())
6595      composeReference(t, "DocumentReference", "target", element.getTarget(), -1);
6596  }
6597
6598  protected void composeDocumentReferenceDocumentReferenceContentComponent(Complex parent, String parentType,
6599      String name, DocumentReference.DocumentReferenceContentComponent element, int index) {
6600    if (element == null)
6601      return;
6602    Complex t;
6603    if (Utilities.noString(parentType))
6604      t = parent;
6605    else {
6606      t = parent.predicate("fhir:" + parentType + '.' + name);
6607    }
6608    composeBackboneElement(t, "content", name, element, index);
6609    if (element.hasAttachment())
6610      composeAttachment(t, "DocumentReference", "attachment", element.getAttachment(), -1);
6611    if (element.hasFormat())
6612      composeCoding(t, "DocumentReference", "format", element.getFormat(), -1);
6613  }
6614
6615  protected void composeDocumentReferenceDocumentReferenceContextComponent(Complex parent, String parentType,
6616      String name, DocumentReference.DocumentReferenceContextComponent element, int index) {
6617    if (element == null)
6618      return;
6619    Complex t;
6620    if (Utilities.noString(parentType))
6621      t = parent;
6622    else {
6623      t = parent.predicate("fhir:" + parentType + '.' + name);
6624    }
6625    composeBackboneElement(t, "context", name, element, index);
6626    for (int i = 0; i < element.getEncounter().size(); i++)
6627      composeReference(t, "DocumentReference", "encounter", element.getEncounter().get(i), i);
6628    for (int i = 0; i < element.getEvent().size(); i++)
6629      composeCodeableConcept(t, "DocumentReference", "event", element.getEvent().get(i), i);
6630    if (element.hasPeriod())
6631      composePeriod(t, "DocumentReference", "period", element.getPeriod(), -1);
6632    if (element.hasFacilityType())
6633      composeCodeableConcept(t, "DocumentReference", "facilityType", element.getFacilityType(), -1);
6634    if (element.hasPracticeSetting())
6635      composeCodeableConcept(t, "DocumentReference", "practiceSetting", element.getPracticeSetting(), -1);
6636    if (element.hasSourcePatientInfo())
6637      composeReference(t, "DocumentReference", "sourcePatientInfo", element.getSourcePatientInfo(), -1);
6638    for (int i = 0; i < element.getRelated().size(); i++)
6639      composeReference(t, "DocumentReference", "related", element.getRelated().get(i), i);
6640  }
6641
6642  protected void composeEffectEvidenceSynthesis(Complex parent, String parentType, String name,
6643      EffectEvidenceSynthesis element, int index) {
6644    if (element == null)
6645      return;
6646    Complex t;
6647    if (Utilities.noString(parentType))
6648      t = parent;
6649    else {
6650      t = parent.predicate("fhir:" + parentType + '.' + name);
6651    }
6652    composeDomainResource(t, "EffectEvidenceSynthesis", name, element, index);
6653    if (element.hasUrlElement())
6654      composeUri(t, "EffectEvidenceSynthesis", "url", element.getUrlElement(), -1);
6655    for (int i = 0; i < element.getIdentifier().size(); i++)
6656      composeIdentifier(t, "EffectEvidenceSynthesis", "identifier", element.getIdentifier().get(i), i);
6657    if (element.hasVersionElement())
6658      composeString(t, "EffectEvidenceSynthesis", "version", element.getVersionElement(), -1);
6659    if (element.hasNameElement())
6660      composeString(t, "EffectEvidenceSynthesis", "name", element.getNameElement(), -1);
6661    if (element.hasTitleElement())
6662      composeString(t, "EffectEvidenceSynthesis", "title", element.getTitleElement(), -1);
6663    if (element.hasStatusElement())
6664      composeEnum(t, "EffectEvidenceSynthesis", "status", element.getStatusElement(), -1);
6665    if (element.hasDateElement())
6666      composeDateTime(t, "EffectEvidenceSynthesis", "date", element.getDateElement(), -1);
6667    if (element.hasPublisherElement())
6668      composeString(t, "EffectEvidenceSynthesis", "publisher", element.getPublisherElement(), -1);
6669    for (int i = 0; i < element.getContact().size(); i++)
6670      composeContactDetail(t, "EffectEvidenceSynthesis", "contact", element.getContact().get(i), i);
6671    if (element.hasDescriptionElement())
6672      composeMarkdown(t, "EffectEvidenceSynthesis", "description", element.getDescriptionElement(), -1);
6673    for (int i = 0; i < element.getNote().size(); i++)
6674      composeAnnotation(t, "EffectEvidenceSynthesis", "note", element.getNote().get(i), i);
6675    for (int i = 0; i < element.getUseContext().size(); i++)
6676      composeUsageContext(t, "EffectEvidenceSynthesis", "useContext", element.getUseContext().get(i), i);
6677    for (int i = 0; i < element.getJurisdiction().size(); i++)
6678      composeCodeableConcept(t, "EffectEvidenceSynthesis", "jurisdiction", element.getJurisdiction().get(i), i);
6679    if (element.hasCopyrightElement())
6680      composeMarkdown(t, "EffectEvidenceSynthesis", "copyright", element.getCopyrightElement(), -1);
6681    if (element.hasApprovalDateElement())
6682      composeDate(t, "EffectEvidenceSynthesis", "approvalDate", element.getApprovalDateElement(), -1);
6683    if (element.hasLastReviewDateElement())
6684      composeDate(t, "EffectEvidenceSynthesis", "lastReviewDate", element.getLastReviewDateElement(), -1);
6685    if (element.hasEffectivePeriod())
6686      composePeriod(t, "EffectEvidenceSynthesis", "effectivePeriod", element.getEffectivePeriod(), -1);
6687    for (int i = 0; i < element.getTopic().size(); i++)
6688      composeCodeableConcept(t, "EffectEvidenceSynthesis", "topic", element.getTopic().get(i), i);
6689    for (int i = 0; i < element.getAuthor().size(); i++)
6690      composeContactDetail(t, "EffectEvidenceSynthesis", "author", element.getAuthor().get(i), i);
6691    for (int i = 0; i < element.getEditor().size(); i++)
6692      composeContactDetail(t, "EffectEvidenceSynthesis", "editor", element.getEditor().get(i), i);
6693    for (int i = 0; i < element.getReviewer().size(); i++)
6694      composeContactDetail(t, "EffectEvidenceSynthesis", "reviewer", element.getReviewer().get(i), i);
6695    for (int i = 0; i < element.getEndorser().size(); i++)
6696      composeContactDetail(t, "EffectEvidenceSynthesis", "endorser", element.getEndorser().get(i), i);
6697    for (int i = 0; i < element.getRelatedArtifact().size(); i++)
6698      composeRelatedArtifact(t, "EffectEvidenceSynthesis", "relatedArtifact", element.getRelatedArtifact().get(i), i);
6699    if (element.hasSynthesisType())
6700      composeCodeableConcept(t, "EffectEvidenceSynthesis", "synthesisType", element.getSynthesisType(), -1);
6701    if (element.hasStudyType())
6702      composeCodeableConcept(t, "EffectEvidenceSynthesis", "studyType", element.getStudyType(), -1);
6703    if (element.hasPopulation())
6704      composeReference(t, "EffectEvidenceSynthesis", "population", element.getPopulation(), -1);
6705    if (element.hasExposure())
6706      composeReference(t, "EffectEvidenceSynthesis", "exposure", element.getExposure(), -1);
6707    if (element.hasExposureAlternative())
6708      composeReference(t, "EffectEvidenceSynthesis", "exposureAlternative", element.getExposureAlternative(), -1);
6709    if (element.hasOutcome())
6710      composeReference(t, "EffectEvidenceSynthesis", "outcome", element.getOutcome(), -1);
6711    if (element.hasSampleSize())
6712      composeEffectEvidenceSynthesisEffectEvidenceSynthesisSampleSizeComponent(t, "EffectEvidenceSynthesis",
6713          "sampleSize", element.getSampleSize(), -1);
6714    for (int i = 0; i < element.getResultsByExposure().size(); i++)
6715      composeEffectEvidenceSynthesisEffectEvidenceSynthesisResultsByExposureComponent(t, "EffectEvidenceSynthesis",
6716          "resultsByExposure", element.getResultsByExposure().get(i), i);
6717    for (int i = 0; i < element.getEffectEstimate().size(); i++)
6718      composeEffectEvidenceSynthesisEffectEvidenceSynthesisEffectEstimateComponent(t, "EffectEvidenceSynthesis",
6719          "effectEstimate", element.getEffectEstimate().get(i), i);
6720    for (int i = 0; i < element.getCertainty().size(); i++)
6721      composeEffectEvidenceSynthesisEffectEvidenceSynthesisCertaintyComponent(t, "EffectEvidenceSynthesis", "certainty",
6722          element.getCertainty().get(i), i);
6723  }
6724
6725  protected void composeEffectEvidenceSynthesisEffectEvidenceSynthesisSampleSizeComponent(Complex parent,
6726      String parentType, String name, EffectEvidenceSynthesis.EffectEvidenceSynthesisSampleSizeComponent element,
6727      int index) {
6728    if (element == null)
6729      return;
6730    Complex t;
6731    if (Utilities.noString(parentType))
6732      t = parent;
6733    else {
6734      t = parent.predicate("fhir:" + parentType + '.' + name);
6735    }
6736    composeBackboneElement(t, "sampleSize", name, element, index);
6737    if (element.hasDescriptionElement())
6738      composeString(t, "EffectEvidenceSynthesis", "description", element.getDescriptionElement(), -1);
6739    if (element.hasNumberOfStudiesElement())
6740      composeInteger(t, "EffectEvidenceSynthesis", "numberOfStudies", element.getNumberOfStudiesElement(), -1);
6741    if (element.hasNumberOfParticipantsElement())
6742      composeInteger(t, "EffectEvidenceSynthesis", "numberOfParticipants", element.getNumberOfParticipantsElement(),
6743          -1);
6744  }
6745
6746  protected void composeEffectEvidenceSynthesisEffectEvidenceSynthesisResultsByExposureComponent(Complex parent,
6747      String parentType, String name, EffectEvidenceSynthesis.EffectEvidenceSynthesisResultsByExposureComponent element,
6748      int index) {
6749    if (element == null)
6750      return;
6751    Complex t;
6752    if (Utilities.noString(parentType))
6753      t = parent;
6754    else {
6755      t = parent.predicate("fhir:" + parentType + '.' + name);
6756    }
6757    composeBackboneElement(t, "resultsByExposure", name, element, index);
6758    if (element.hasDescriptionElement())
6759      composeString(t, "EffectEvidenceSynthesis", "description", element.getDescriptionElement(), -1);
6760    if (element.hasExposureStateElement())
6761      composeEnum(t, "EffectEvidenceSynthesis", "exposureState", element.getExposureStateElement(), -1);
6762    if (element.hasVariantState())
6763      composeCodeableConcept(t, "EffectEvidenceSynthesis", "variantState", element.getVariantState(), -1);
6764    if (element.hasRiskEvidenceSynthesis())
6765      composeReference(t, "EffectEvidenceSynthesis", "riskEvidenceSynthesis", element.getRiskEvidenceSynthesis(), -1);
6766  }
6767
6768  protected void composeEffectEvidenceSynthesisEffectEvidenceSynthesisEffectEstimateComponent(Complex parent,
6769      String parentType, String name, EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimateComponent element,
6770      int index) {
6771    if (element == null)
6772      return;
6773    Complex t;
6774    if (Utilities.noString(parentType))
6775      t = parent;
6776    else {
6777      t = parent.predicate("fhir:" + parentType + '.' + name);
6778    }
6779    composeBackboneElement(t, "effectEstimate", name, element, index);
6780    if (element.hasDescriptionElement())
6781      composeString(t, "EffectEvidenceSynthesis", "description", element.getDescriptionElement(), -1);
6782    if (element.hasType())
6783      composeCodeableConcept(t, "EffectEvidenceSynthesis", "type", element.getType(), -1);
6784    if (element.hasVariantState())
6785      composeCodeableConcept(t, "EffectEvidenceSynthesis", "variantState", element.getVariantState(), -1);
6786    if (element.hasValueElement())
6787      composeDecimal(t, "EffectEvidenceSynthesis", "value", element.getValueElement(), -1);
6788    if (element.hasUnitOfMeasure())
6789      composeCodeableConcept(t, "EffectEvidenceSynthesis", "unitOfMeasure", element.getUnitOfMeasure(), -1);
6790    for (int i = 0; i < element.getPrecisionEstimate().size(); i++)
6791      composeEffectEvidenceSynthesisEffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent(t,
6792          "EffectEvidenceSynthesis", "precisionEstimate", element.getPrecisionEstimate().get(i), i);
6793  }
6794
6795  protected void composeEffectEvidenceSynthesisEffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent(
6796      Complex parent, String parentType, String name,
6797      EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent element, int index) {
6798    if (element == null)
6799      return;
6800    Complex t;
6801    if (Utilities.noString(parentType))
6802      t = parent;
6803    else {
6804      t = parent.predicate("fhir:" + parentType + '.' + name);
6805    }
6806    composeBackboneElement(t, "precisionEstimate", name, element, index);
6807    if (element.hasType())
6808      composeCodeableConcept(t, "EffectEvidenceSynthesis", "type", element.getType(), -1);
6809    if (element.hasLevelElement())
6810      composeDecimal(t, "EffectEvidenceSynthesis", "level", element.getLevelElement(), -1);
6811    if (element.hasFromElement())
6812      composeDecimal(t, "EffectEvidenceSynthesis", "from", element.getFromElement(), -1);
6813    if (element.hasToElement())
6814      composeDecimal(t, "EffectEvidenceSynthesis", "to", element.getToElement(), -1);
6815  }
6816
6817  protected void composeEffectEvidenceSynthesisEffectEvidenceSynthesisCertaintyComponent(Complex parent,
6818      String parentType, String name, EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyComponent element,
6819      int index) {
6820    if (element == null)
6821      return;
6822    Complex t;
6823    if (Utilities.noString(parentType))
6824      t = parent;
6825    else {
6826      t = parent.predicate("fhir:" + parentType + '.' + name);
6827    }
6828    composeBackboneElement(t, "certainty", name, element, index);
6829    for (int i = 0; i < element.getRating().size(); i++)
6830      composeCodeableConcept(t, "EffectEvidenceSynthesis", "rating", element.getRating().get(i), i);
6831    for (int i = 0; i < element.getNote().size(); i++)
6832      composeAnnotation(t, "EffectEvidenceSynthesis", "note", element.getNote().get(i), i);
6833    for (int i = 0; i < element.getCertaintySubcomponent().size(); i++)
6834      composeEffectEvidenceSynthesisEffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent(t,
6835          "EffectEvidenceSynthesis", "certaintySubcomponent", element.getCertaintySubcomponent().get(i), i);
6836  }
6837
6838  protected void composeEffectEvidenceSynthesisEffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent(
6839      Complex parent, String parentType, String name,
6840      EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent element, int index) {
6841    if (element == null)
6842      return;
6843    Complex t;
6844    if (Utilities.noString(parentType))
6845      t = parent;
6846    else {
6847      t = parent.predicate("fhir:" + parentType + '.' + name);
6848    }
6849    composeBackboneElement(t, "certaintySubcomponent", name, element, index);
6850    if (element.hasType())
6851      composeCodeableConcept(t, "EffectEvidenceSynthesis", "type", element.getType(), -1);
6852    for (int i = 0; i < element.getRating().size(); i++)
6853      composeCodeableConcept(t, "EffectEvidenceSynthesis", "rating", element.getRating().get(i), i);
6854    for (int i = 0; i < element.getNote().size(); i++)
6855      composeAnnotation(t, "EffectEvidenceSynthesis", "note", element.getNote().get(i), i);
6856  }
6857
6858  protected void composeEncounter(Complex parent, String parentType, String name, Encounter element, int index) {
6859    if (element == null)
6860      return;
6861    Complex t;
6862    if (Utilities.noString(parentType))
6863      t = parent;
6864    else {
6865      t = parent.predicate("fhir:" + parentType + '.' + name);
6866    }
6867    composeDomainResource(t, "Encounter", name, element, index);
6868    for (int i = 0; i < element.getIdentifier().size(); i++)
6869      composeIdentifier(t, "Encounter", "identifier", element.getIdentifier().get(i), i);
6870    if (element.hasStatusElement())
6871      composeEnum(t, "Encounter", "status", element.getStatusElement(), -1);
6872    for (int i = 0; i < element.getStatusHistory().size(); i++)
6873      composeEncounterStatusHistoryComponent(t, "Encounter", "statusHistory", element.getStatusHistory().get(i), i);
6874    if (element.hasClass_())
6875      composeCoding(t, "Encounter", "class", element.getClass_(), -1);
6876    for (int i = 0; i < element.getClassHistory().size(); i++)
6877      composeEncounterClassHistoryComponent(t, "Encounter", "classHistory", element.getClassHistory().get(i), i);
6878    for (int i = 0; i < element.getType().size(); i++)
6879      composeCodeableConcept(t, "Encounter", "type", element.getType().get(i), i);
6880    if (element.hasServiceType())
6881      composeCodeableConcept(t, "Encounter", "serviceType", element.getServiceType(), -1);
6882    if (element.hasPriority())
6883      composeCodeableConcept(t, "Encounter", "priority", element.getPriority(), -1);
6884    if (element.hasSubject())
6885      composeReference(t, "Encounter", "subject", element.getSubject(), -1);
6886    for (int i = 0; i < element.getEpisodeOfCare().size(); i++)
6887      composeReference(t, "Encounter", "episodeOfCare", element.getEpisodeOfCare().get(i), i);
6888    for (int i = 0; i < element.getBasedOn().size(); i++)
6889      composeReference(t, "Encounter", "basedOn", element.getBasedOn().get(i), i);
6890    for (int i = 0; i < element.getParticipant().size(); i++)
6891      composeEncounterEncounterParticipantComponent(t, "Encounter", "participant", element.getParticipant().get(i), i);
6892    for (int i = 0; i < element.getAppointment().size(); i++)
6893      composeReference(t, "Encounter", "appointment", element.getAppointment().get(i), i);
6894    if (element.hasPeriod())
6895      composePeriod(t, "Encounter", "period", element.getPeriod(), -1);
6896    if (element.hasLength())
6897      composeDuration(t, "Encounter", "length", element.getLength(), -1);
6898    for (int i = 0; i < element.getReasonCode().size(); i++)
6899      composeCodeableConcept(t, "Encounter", "reasonCode", element.getReasonCode().get(i), i);
6900    for (int i = 0; i < element.getReasonReference().size(); i++)
6901      composeReference(t, "Encounter", "reasonReference", element.getReasonReference().get(i), i);
6902    for (int i = 0; i < element.getDiagnosis().size(); i++)
6903      composeEncounterDiagnosisComponent(t, "Encounter", "diagnosis", element.getDiagnosis().get(i), i);
6904    for (int i = 0; i < element.getAccount().size(); i++)
6905      composeReference(t, "Encounter", "account", element.getAccount().get(i), i);
6906    if (element.hasHospitalization())
6907      composeEncounterEncounterHospitalizationComponent(t, "Encounter", "hospitalization", element.getHospitalization(),
6908          -1);
6909    for (int i = 0; i < element.getLocation().size(); i++)
6910      composeEncounterEncounterLocationComponent(t, "Encounter", "location", element.getLocation().get(i), i);
6911    if (element.hasServiceProvider())
6912      composeReference(t, "Encounter", "serviceProvider", element.getServiceProvider(), -1);
6913    if (element.hasPartOf())
6914      composeReference(t, "Encounter", "partOf", element.getPartOf(), -1);
6915  }
6916
6917  protected void composeEncounterStatusHistoryComponent(Complex parent, String parentType, String name,
6918      Encounter.StatusHistoryComponent element, int index) {
6919    if (element == null)
6920      return;
6921    Complex t;
6922    if (Utilities.noString(parentType))
6923      t = parent;
6924    else {
6925      t = parent.predicate("fhir:" + parentType + '.' + name);
6926    }
6927    composeBackboneElement(t, "statusHistory", name, element, index);
6928    if (element.hasStatusElement())
6929      composeEnum(t, "Encounter", "status", element.getStatusElement(), -1);
6930    if (element.hasPeriod())
6931      composePeriod(t, "Encounter", "period", element.getPeriod(), -1);
6932  }
6933
6934  protected void composeEncounterClassHistoryComponent(Complex parent, String parentType, String name,
6935      Encounter.ClassHistoryComponent element, int index) {
6936    if (element == null)
6937      return;
6938    Complex t;
6939    if (Utilities.noString(parentType))
6940      t = parent;
6941    else {
6942      t = parent.predicate("fhir:" + parentType + '.' + name);
6943    }
6944    composeBackboneElement(t, "classHistory", name, element, index);
6945    if (element.hasClass_())
6946      composeCoding(t, "Encounter", "class", element.getClass_(), -1);
6947    if (element.hasPeriod())
6948      composePeriod(t, "Encounter", "period", element.getPeriod(), -1);
6949  }
6950
6951  protected void composeEncounterEncounterParticipantComponent(Complex parent, String parentType, String name,
6952      Encounter.EncounterParticipantComponent element, int index) {
6953    if (element == null)
6954      return;
6955    Complex t;
6956    if (Utilities.noString(parentType))
6957      t = parent;
6958    else {
6959      t = parent.predicate("fhir:" + parentType + '.' + name);
6960    }
6961    composeBackboneElement(t, "participant", name, element, index);
6962    for (int i = 0; i < element.getType().size(); i++)
6963      composeCodeableConcept(t, "Encounter", "type", element.getType().get(i), i);
6964    if (element.hasPeriod())
6965      composePeriod(t, "Encounter", "period", element.getPeriod(), -1);
6966    if (element.hasIndividual())
6967      composeReference(t, "Encounter", "individual", element.getIndividual(), -1);
6968  }
6969
6970  protected void composeEncounterDiagnosisComponent(Complex parent, String parentType, String name,
6971      Encounter.DiagnosisComponent element, int index) {
6972    if (element == null)
6973      return;
6974    Complex t;
6975    if (Utilities.noString(parentType))
6976      t = parent;
6977    else {
6978      t = parent.predicate("fhir:" + parentType + '.' + name);
6979    }
6980    composeBackboneElement(t, "diagnosis", name, element, index);
6981    if (element.hasCondition())
6982      composeReference(t, "Encounter", "condition", element.getCondition(), -1);
6983    if (element.hasUse())
6984      composeCodeableConcept(t, "Encounter", "use", element.getUse(), -1);
6985    if (element.hasRankElement())
6986      composePositiveInt(t, "Encounter", "rank", element.getRankElement(), -1);
6987  }
6988
6989  protected void composeEncounterEncounterHospitalizationComponent(Complex parent, String parentType, String name,
6990      Encounter.EncounterHospitalizationComponent element, int index) {
6991    if (element == null)
6992      return;
6993    Complex t;
6994    if (Utilities.noString(parentType))
6995      t = parent;
6996    else {
6997      t = parent.predicate("fhir:" + parentType + '.' + name);
6998    }
6999    composeBackboneElement(t, "hospitalization", name, element, index);
7000    if (element.hasPreAdmissionIdentifier())
7001      composeIdentifier(t, "Encounter", "preAdmissionIdentifier", element.getPreAdmissionIdentifier(), -1);
7002    if (element.hasOrigin())
7003      composeReference(t, "Encounter", "origin", element.getOrigin(), -1);
7004    if (element.hasAdmitSource())
7005      composeCodeableConcept(t, "Encounter", "admitSource", element.getAdmitSource(), -1);
7006    if (element.hasReAdmission())
7007      composeCodeableConcept(t, "Encounter", "reAdmission", element.getReAdmission(), -1);
7008    for (int i = 0; i < element.getDietPreference().size(); i++)
7009      composeCodeableConcept(t, "Encounter", "dietPreference", element.getDietPreference().get(i), i);
7010    for (int i = 0; i < element.getSpecialCourtesy().size(); i++)
7011      composeCodeableConcept(t, "Encounter", "specialCourtesy", element.getSpecialCourtesy().get(i), i);
7012    for (int i = 0; i < element.getSpecialArrangement().size(); i++)
7013      composeCodeableConcept(t, "Encounter", "specialArrangement", element.getSpecialArrangement().get(i), i);
7014    if (element.hasDestination())
7015      composeReference(t, "Encounter", "destination", element.getDestination(), -1);
7016    if (element.hasDischargeDisposition())
7017      composeCodeableConcept(t, "Encounter", "dischargeDisposition", element.getDischargeDisposition(), -1);
7018  }
7019
7020  protected void composeEncounterEncounterLocationComponent(Complex parent, String parentType, String name,
7021      Encounter.EncounterLocationComponent element, int index) {
7022    if (element == null)
7023      return;
7024    Complex t;
7025    if (Utilities.noString(parentType))
7026      t = parent;
7027    else {
7028      t = parent.predicate("fhir:" + parentType + '.' + name);
7029    }
7030    composeBackboneElement(t, "location", name, element, index);
7031    if (element.hasLocation())
7032      composeReference(t, "Encounter", "location", element.getLocation(), -1);
7033    if (element.hasStatusElement())
7034      composeEnum(t, "Encounter", "status", element.getStatusElement(), -1);
7035    if (element.hasPhysicalType())
7036      composeCodeableConcept(t, "Encounter", "physicalType", element.getPhysicalType(), -1);
7037    if (element.hasPeriod())
7038      composePeriod(t, "Encounter", "period", element.getPeriod(), -1);
7039  }
7040
7041  protected void composeEndpoint(Complex parent, String parentType, String name, Endpoint element, int index) {
7042    if (element == null)
7043      return;
7044    Complex t;
7045    if (Utilities.noString(parentType))
7046      t = parent;
7047    else {
7048      t = parent.predicate("fhir:" + parentType + '.' + name);
7049    }
7050    composeDomainResource(t, "Endpoint", name, element, index);
7051    for (int i = 0; i < element.getIdentifier().size(); i++)
7052      composeIdentifier(t, "Endpoint", "identifier", element.getIdentifier().get(i), i);
7053    if (element.hasStatusElement())
7054      composeEnum(t, "Endpoint", "status", element.getStatusElement(), -1);
7055    if (element.hasConnectionType())
7056      composeCoding(t, "Endpoint", "connectionType", element.getConnectionType(), -1);
7057    if (element.hasNameElement())
7058      composeString(t, "Endpoint", "name", element.getNameElement(), -1);
7059    if (element.hasManagingOrganization())
7060      composeReference(t, "Endpoint", "managingOrganization", element.getManagingOrganization(), -1);
7061    for (int i = 0; i < element.getContact().size(); i++)
7062      composeContactPoint(t, "Endpoint", "contact", element.getContact().get(i), i);
7063    if (element.hasPeriod())
7064      composePeriod(t, "Endpoint", "period", element.getPeriod(), -1);
7065    for (int i = 0; i < element.getPayloadType().size(); i++)
7066      composeCodeableConcept(t, "Endpoint", "payloadType", element.getPayloadType().get(i), i);
7067    for (int i = 0; i < element.getPayloadMimeType().size(); i++)
7068      composeCode(t, "Endpoint", "payloadMimeType", element.getPayloadMimeType().get(i), i);
7069    if (element.hasAddressElement())
7070      composeUrl(t, "Endpoint", "address", element.getAddressElement(), -1);
7071    for (int i = 0; i < element.getHeader().size(); i++)
7072      composeString(t, "Endpoint", "header", element.getHeader().get(i), i);
7073  }
7074
7075  protected void composeEnrollmentRequest(Complex parent, String parentType, String name, EnrollmentRequest element,
7076      int index) {
7077    if (element == null)
7078      return;
7079    Complex t;
7080    if (Utilities.noString(parentType))
7081      t = parent;
7082    else {
7083      t = parent.predicate("fhir:" + parentType + '.' + name);
7084    }
7085    composeDomainResource(t, "EnrollmentRequest", name, element, index);
7086    for (int i = 0; i < element.getIdentifier().size(); i++)
7087      composeIdentifier(t, "EnrollmentRequest", "identifier", element.getIdentifier().get(i), i);
7088    if (element.hasStatusElement())
7089      composeEnum(t, "EnrollmentRequest", "status", element.getStatusElement(), -1);
7090    if (element.hasCreatedElement())
7091      composeDateTime(t, "EnrollmentRequest", "created", element.getCreatedElement(), -1);
7092    if (element.hasInsurer())
7093      composeReference(t, "EnrollmentRequest", "insurer", element.getInsurer(), -1);
7094    if (element.hasProvider())
7095      composeReference(t, "EnrollmentRequest", "provider", element.getProvider(), -1);
7096    if (element.hasCandidate())
7097      composeReference(t, "EnrollmentRequest", "candidate", element.getCandidate(), -1);
7098    if (element.hasCoverage())
7099      composeReference(t, "EnrollmentRequest", "coverage", element.getCoverage(), -1);
7100  }
7101
7102  protected void composeEnrollmentResponse(Complex parent, String parentType, String name, EnrollmentResponse element,
7103      int index) {
7104    if (element == null)
7105      return;
7106    Complex t;
7107    if (Utilities.noString(parentType))
7108      t = parent;
7109    else {
7110      t = parent.predicate("fhir:" + parentType + '.' + name);
7111    }
7112    composeDomainResource(t, "EnrollmentResponse", name, element, index);
7113    for (int i = 0; i < element.getIdentifier().size(); i++)
7114      composeIdentifier(t, "EnrollmentResponse", "identifier", element.getIdentifier().get(i), i);
7115    if (element.hasStatusElement())
7116      composeEnum(t, "EnrollmentResponse", "status", element.getStatusElement(), -1);
7117    if (element.hasRequest())
7118      composeReference(t, "EnrollmentResponse", "request", element.getRequest(), -1);
7119    if (element.hasOutcomeElement())
7120      composeEnum(t, "EnrollmentResponse", "outcome", element.getOutcomeElement(), -1);
7121    if (element.hasDispositionElement())
7122      composeString(t, "EnrollmentResponse", "disposition", element.getDispositionElement(), -1);
7123    if (element.hasCreatedElement())
7124      composeDateTime(t, "EnrollmentResponse", "created", element.getCreatedElement(), -1);
7125    if (element.hasOrganization())
7126      composeReference(t, "EnrollmentResponse", "organization", element.getOrganization(), -1);
7127    if (element.hasRequestProvider())
7128      composeReference(t, "EnrollmentResponse", "requestProvider", element.getRequestProvider(), -1);
7129  }
7130
7131  protected void composeEpisodeOfCare(Complex parent, String parentType, String name, EpisodeOfCare element,
7132      int index) {
7133    if (element == null)
7134      return;
7135    Complex t;
7136    if (Utilities.noString(parentType))
7137      t = parent;
7138    else {
7139      t = parent.predicate("fhir:" + parentType + '.' + name);
7140    }
7141    composeDomainResource(t, "EpisodeOfCare", name, element, index);
7142    for (int i = 0; i < element.getIdentifier().size(); i++)
7143      composeIdentifier(t, "EpisodeOfCare", "identifier", element.getIdentifier().get(i), i);
7144    if (element.hasStatusElement())
7145      composeEnum(t, "EpisodeOfCare", "status", element.getStatusElement(), -1);
7146    for (int i = 0; i < element.getStatusHistory().size(); i++)
7147      composeEpisodeOfCareEpisodeOfCareStatusHistoryComponent(t, "EpisodeOfCare", "statusHistory",
7148          element.getStatusHistory().get(i), i);
7149    for (int i = 0; i < element.getType().size(); i++)
7150      composeCodeableConcept(t, "EpisodeOfCare", "type", element.getType().get(i), i);
7151    for (int i = 0; i < element.getDiagnosis().size(); i++)
7152      composeEpisodeOfCareDiagnosisComponent(t, "EpisodeOfCare", "diagnosis", element.getDiagnosis().get(i), i);
7153    if (element.hasPatient())
7154      composeReference(t, "EpisodeOfCare", "patient", element.getPatient(), -1);
7155    if (element.hasManagingOrganization())
7156      composeReference(t, "EpisodeOfCare", "managingOrganization", element.getManagingOrganization(), -1);
7157    if (element.hasPeriod())
7158      composePeriod(t, "EpisodeOfCare", "period", element.getPeriod(), -1);
7159    for (int i = 0; i < element.getReferralRequest().size(); i++)
7160      composeReference(t, "EpisodeOfCare", "referralRequest", element.getReferralRequest().get(i), i);
7161    if (element.hasCareManager())
7162      composeReference(t, "EpisodeOfCare", "careManager", element.getCareManager(), -1);
7163    for (int i = 0; i < element.getTeam().size(); i++)
7164      composeReference(t, "EpisodeOfCare", "team", element.getTeam().get(i), i);
7165    for (int i = 0; i < element.getAccount().size(); i++)
7166      composeReference(t, "EpisodeOfCare", "account", element.getAccount().get(i), i);
7167  }
7168
7169  protected void composeEpisodeOfCareEpisodeOfCareStatusHistoryComponent(Complex parent, String parentType, String name,
7170      EpisodeOfCare.EpisodeOfCareStatusHistoryComponent element, int index) {
7171    if (element == null)
7172      return;
7173    Complex t;
7174    if (Utilities.noString(parentType))
7175      t = parent;
7176    else {
7177      t = parent.predicate("fhir:" + parentType + '.' + name);
7178    }
7179    composeBackboneElement(t, "statusHistory", name, element, index);
7180    if (element.hasStatusElement())
7181      composeEnum(t, "EpisodeOfCare", "status", element.getStatusElement(), -1);
7182    if (element.hasPeriod())
7183      composePeriod(t, "EpisodeOfCare", "period", element.getPeriod(), -1);
7184  }
7185
7186  protected void composeEpisodeOfCareDiagnosisComponent(Complex parent, String parentType, String name,
7187      EpisodeOfCare.DiagnosisComponent element, int index) {
7188    if (element == null)
7189      return;
7190    Complex t;
7191    if (Utilities.noString(parentType))
7192      t = parent;
7193    else {
7194      t = parent.predicate("fhir:" + parentType + '.' + name);
7195    }
7196    composeBackboneElement(t, "diagnosis", name, element, index);
7197    if (element.hasCondition())
7198      composeReference(t, "EpisodeOfCare", "condition", element.getCondition(), -1);
7199    if (element.hasRole())
7200      composeCodeableConcept(t, "EpisodeOfCare", "role", element.getRole(), -1);
7201    if (element.hasRankElement())
7202      composePositiveInt(t, "EpisodeOfCare", "rank", element.getRankElement(), -1);
7203  }
7204
7205  protected void composeEventDefinition(Complex parent, String parentType, String name, EventDefinition element,
7206      int index) {
7207    if (element == null)
7208      return;
7209    Complex t;
7210    if (Utilities.noString(parentType))
7211      t = parent;
7212    else {
7213      t = parent.predicate("fhir:" + parentType + '.' + name);
7214    }
7215    composeDomainResource(t, "EventDefinition", name, element, index);
7216    if (element.hasUrlElement())
7217      composeUri(t, "EventDefinition", "url", element.getUrlElement(), -1);
7218    for (int i = 0; i < element.getIdentifier().size(); i++)
7219      composeIdentifier(t, "EventDefinition", "identifier", element.getIdentifier().get(i), i);
7220    if (element.hasVersionElement())
7221      composeString(t, "EventDefinition", "version", element.getVersionElement(), -1);
7222    if (element.hasNameElement())
7223      composeString(t, "EventDefinition", "name", element.getNameElement(), -1);
7224    if (element.hasTitleElement())
7225      composeString(t, "EventDefinition", "title", element.getTitleElement(), -1);
7226    if (element.hasSubtitleElement())
7227      composeString(t, "EventDefinition", "subtitle", element.getSubtitleElement(), -1);
7228    if (element.hasStatusElement())
7229      composeEnum(t, "EventDefinition", "status", element.getStatusElement(), -1);
7230    if (element.hasExperimentalElement())
7231      composeBoolean(t, "EventDefinition", "experimental", element.getExperimentalElement(), -1);
7232    if (element.hasSubject())
7233      composeType(t, "EventDefinition", "subject", element.getSubject(), -1);
7234    if (element.hasDateElement())
7235      composeDateTime(t, "EventDefinition", "date", element.getDateElement(), -1);
7236    if (element.hasPublisherElement())
7237      composeString(t, "EventDefinition", "publisher", element.getPublisherElement(), -1);
7238    for (int i = 0; i < element.getContact().size(); i++)
7239      composeContactDetail(t, "EventDefinition", "contact", element.getContact().get(i), i);
7240    if (element.hasDescriptionElement())
7241      composeMarkdown(t, "EventDefinition", "description", element.getDescriptionElement(), -1);
7242    for (int i = 0; i < element.getUseContext().size(); i++)
7243      composeUsageContext(t, "EventDefinition", "useContext", element.getUseContext().get(i), i);
7244    for (int i = 0; i < element.getJurisdiction().size(); i++)
7245      composeCodeableConcept(t, "EventDefinition", "jurisdiction", element.getJurisdiction().get(i), i);
7246    if (element.hasPurposeElement())
7247      composeMarkdown(t, "EventDefinition", "purpose", element.getPurposeElement(), -1);
7248    if (element.hasUsageElement())
7249      composeString(t, "EventDefinition", "usage", element.getUsageElement(), -1);
7250    if (element.hasCopyrightElement())
7251      composeMarkdown(t, "EventDefinition", "copyright", element.getCopyrightElement(), -1);
7252    if (element.hasApprovalDateElement())
7253      composeDate(t, "EventDefinition", "approvalDate", element.getApprovalDateElement(), -1);
7254    if (element.hasLastReviewDateElement())
7255      composeDate(t, "EventDefinition", "lastReviewDate", element.getLastReviewDateElement(), -1);
7256    if (element.hasEffectivePeriod())
7257      composePeriod(t, "EventDefinition", "effectivePeriod", element.getEffectivePeriod(), -1);
7258    for (int i = 0; i < element.getTopic().size(); i++)
7259      composeCodeableConcept(t, "EventDefinition", "topic", element.getTopic().get(i), i);
7260    for (int i = 0; i < element.getAuthor().size(); i++)
7261      composeContactDetail(t, "EventDefinition", "author", element.getAuthor().get(i), i);
7262    for (int i = 0; i < element.getEditor().size(); i++)
7263      composeContactDetail(t, "EventDefinition", "editor", element.getEditor().get(i), i);
7264    for (int i = 0; i < element.getReviewer().size(); i++)
7265      composeContactDetail(t, "EventDefinition", "reviewer", element.getReviewer().get(i), i);
7266    for (int i = 0; i < element.getEndorser().size(); i++)
7267      composeContactDetail(t, "EventDefinition", "endorser", element.getEndorser().get(i), i);
7268    for (int i = 0; i < element.getRelatedArtifact().size(); i++)
7269      composeRelatedArtifact(t, "EventDefinition", "relatedArtifact", element.getRelatedArtifact().get(i), i);
7270    for (int i = 0; i < element.getTrigger().size(); i++)
7271      composeTriggerDefinition(t, "EventDefinition", "trigger", element.getTrigger().get(i), i);
7272  }
7273
7274  protected void composeEvidence(Complex parent, String parentType, String name, Evidence element, int index) {
7275    if (element == null)
7276      return;
7277    Complex t;
7278    if (Utilities.noString(parentType))
7279      t = parent;
7280    else {
7281      t = parent.predicate("fhir:" + parentType + '.' + name);
7282    }
7283    composeDomainResource(t, "Evidence", name, element, index);
7284    if (element.hasUrlElement())
7285      composeUri(t, "Evidence", "url", element.getUrlElement(), -1);
7286    for (int i = 0; i < element.getIdentifier().size(); i++)
7287      composeIdentifier(t, "Evidence", "identifier", element.getIdentifier().get(i), i);
7288    if (element.hasVersionElement())
7289      composeString(t, "Evidence", "version", element.getVersionElement(), -1);
7290    if (element.hasNameElement())
7291      composeString(t, "Evidence", "name", element.getNameElement(), -1);
7292    if (element.hasTitleElement())
7293      composeString(t, "Evidence", "title", element.getTitleElement(), -1);
7294    if (element.hasShortTitleElement())
7295      composeString(t, "Evidence", "shortTitle", element.getShortTitleElement(), -1);
7296    if (element.hasSubtitleElement())
7297      composeString(t, "Evidence", "subtitle", element.getSubtitleElement(), -1);
7298    if (element.hasStatusElement())
7299      composeEnum(t, "Evidence", "status", element.getStatusElement(), -1);
7300    if (element.hasDateElement())
7301      composeDateTime(t, "Evidence", "date", element.getDateElement(), -1);
7302    if (element.hasPublisherElement())
7303      composeString(t, "Evidence", "publisher", element.getPublisherElement(), -1);
7304    for (int i = 0; i < element.getContact().size(); i++)
7305      composeContactDetail(t, "Evidence", "contact", element.getContact().get(i), i);
7306    if (element.hasDescriptionElement())
7307      composeMarkdown(t, "Evidence", "description", element.getDescriptionElement(), -1);
7308    for (int i = 0; i < element.getNote().size(); i++)
7309      composeAnnotation(t, "Evidence", "note", element.getNote().get(i), i);
7310    for (int i = 0; i < element.getUseContext().size(); i++)
7311      composeUsageContext(t, "Evidence", "useContext", element.getUseContext().get(i), i);
7312    for (int i = 0; i < element.getJurisdiction().size(); i++)
7313      composeCodeableConcept(t, "Evidence", "jurisdiction", element.getJurisdiction().get(i), i);
7314    if (element.hasCopyrightElement())
7315      composeMarkdown(t, "Evidence", "copyright", element.getCopyrightElement(), -1);
7316    if (element.hasApprovalDateElement())
7317      composeDate(t, "Evidence", "approvalDate", element.getApprovalDateElement(), -1);
7318    if (element.hasLastReviewDateElement())
7319      composeDate(t, "Evidence", "lastReviewDate", element.getLastReviewDateElement(), -1);
7320    if (element.hasEffectivePeriod())
7321      composePeriod(t, "Evidence", "effectivePeriod", element.getEffectivePeriod(), -1);
7322    for (int i = 0; i < element.getTopic().size(); i++)
7323      composeCodeableConcept(t, "Evidence", "topic", element.getTopic().get(i), i);
7324    for (int i = 0; i < element.getAuthor().size(); i++)
7325      composeContactDetail(t, "Evidence", "author", element.getAuthor().get(i), i);
7326    for (int i = 0; i < element.getEditor().size(); i++)
7327      composeContactDetail(t, "Evidence", "editor", element.getEditor().get(i), i);
7328    for (int i = 0; i < element.getReviewer().size(); i++)
7329      composeContactDetail(t, "Evidence", "reviewer", element.getReviewer().get(i), i);
7330    for (int i = 0; i < element.getEndorser().size(); i++)
7331      composeContactDetail(t, "Evidence", "endorser", element.getEndorser().get(i), i);
7332    for (int i = 0; i < element.getRelatedArtifact().size(); i++)
7333      composeRelatedArtifact(t, "Evidence", "relatedArtifact", element.getRelatedArtifact().get(i), i);
7334    if (element.hasExposureBackground())
7335      composeReference(t, "Evidence", "exposureBackground", element.getExposureBackground(), -1);
7336    for (int i = 0; i < element.getExposureVariant().size(); i++)
7337      composeReference(t, "Evidence", "exposureVariant", element.getExposureVariant().get(i), i);
7338    for (int i = 0; i < element.getOutcome().size(); i++)
7339      composeReference(t, "Evidence", "outcome", element.getOutcome().get(i), i);
7340  }
7341
7342  protected void composeEvidenceVariable(Complex parent, String parentType, String name, EvidenceVariable element,
7343      int index) {
7344    if (element == null)
7345      return;
7346    Complex t;
7347    if (Utilities.noString(parentType))
7348      t = parent;
7349    else {
7350      t = parent.predicate("fhir:" + parentType + '.' + name);
7351    }
7352    composeDomainResource(t, "EvidenceVariable", name, element, index);
7353    if (element.hasUrlElement())
7354      composeUri(t, "EvidenceVariable", "url", element.getUrlElement(), -1);
7355    for (int i = 0; i < element.getIdentifier().size(); i++)
7356      composeIdentifier(t, "EvidenceVariable", "identifier", element.getIdentifier().get(i), i);
7357    if (element.hasVersionElement())
7358      composeString(t, "EvidenceVariable", "version", element.getVersionElement(), -1);
7359    if (element.hasNameElement())
7360      composeString(t, "EvidenceVariable", "name", element.getNameElement(), -1);
7361    if (element.hasTitleElement())
7362      composeString(t, "EvidenceVariable", "title", element.getTitleElement(), -1);
7363    if (element.hasShortTitleElement())
7364      composeString(t, "EvidenceVariable", "shortTitle", element.getShortTitleElement(), -1);
7365    if (element.hasSubtitleElement())
7366      composeString(t, "EvidenceVariable", "subtitle", element.getSubtitleElement(), -1);
7367    if (element.hasStatusElement())
7368      composeEnum(t, "EvidenceVariable", "status", element.getStatusElement(), -1);
7369    if (element.hasDateElement())
7370      composeDateTime(t, "EvidenceVariable", "date", element.getDateElement(), -1);
7371    if (element.hasPublisherElement())
7372      composeString(t, "EvidenceVariable", "publisher", element.getPublisherElement(), -1);
7373    for (int i = 0; i < element.getContact().size(); i++)
7374      composeContactDetail(t, "EvidenceVariable", "contact", element.getContact().get(i), i);
7375    if (element.hasDescriptionElement())
7376      composeMarkdown(t, "EvidenceVariable", "description", element.getDescriptionElement(), -1);
7377    for (int i = 0; i < element.getNote().size(); i++)
7378      composeAnnotation(t, "EvidenceVariable", "note", element.getNote().get(i), i);
7379    for (int i = 0; i < element.getUseContext().size(); i++)
7380      composeUsageContext(t, "EvidenceVariable", "useContext", element.getUseContext().get(i), i);
7381    for (int i = 0; i < element.getJurisdiction().size(); i++)
7382      composeCodeableConcept(t, "EvidenceVariable", "jurisdiction", element.getJurisdiction().get(i), i);
7383    if (element.hasCopyrightElement())
7384      composeMarkdown(t, "EvidenceVariable", "copyright", element.getCopyrightElement(), -1);
7385    if (element.hasApprovalDateElement())
7386      composeDate(t, "EvidenceVariable", "approvalDate", element.getApprovalDateElement(), -1);
7387    if (element.hasLastReviewDateElement())
7388      composeDate(t, "EvidenceVariable", "lastReviewDate", element.getLastReviewDateElement(), -1);
7389    if (element.hasEffectivePeriod())
7390      composePeriod(t, "EvidenceVariable", "effectivePeriod", element.getEffectivePeriod(), -1);
7391    for (int i = 0; i < element.getTopic().size(); i++)
7392      composeCodeableConcept(t, "EvidenceVariable", "topic", element.getTopic().get(i), i);
7393    for (int i = 0; i < element.getAuthor().size(); i++)
7394      composeContactDetail(t, "EvidenceVariable", "author", element.getAuthor().get(i), i);
7395    for (int i = 0; i < element.getEditor().size(); i++)
7396      composeContactDetail(t, "EvidenceVariable", "editor", element.getEditor().get(i), i);
7397    for (int i = 0; i < element.getReviewer().size(); i++)
7398      composeContactDetail(t, "EvidenceVariable", "reviewer", element.getReviewer().get(i), i);
7399    for (int i = 0; i < element.getEndorser().size(); i++)
7400      composeContactDetail(t, "EvidenceVariable", "endorser", element.getEndorser().get(i), i);
7401    for (int i = 0; i < element.getRelatedArtifact().size(); i++)
7402      composeRelatedArtifact(t, "EvidenceVariable", "relatedArtifact", element.getRelatedArtifact().get(i), i);
7403    if (element.hasTypeElement())
7404      composeEnum(t, "EvidenceVariable", "type", element.getTypeElement(), -1);
7405    for (int i = 0; i < element.getCharacteristic().size(); i++)
7406      composeEvidenceVariableEvidenceVariableCharacteristicComponent(t, "EvidenceVariable", "characteristic",
7407          element.getCharacteristic().get(i), i);
7408  }
7409
7410  protected void composeEvidenceVariableEvidenceVariableCharacteristicComponent(Complex parent, String parentType,
7411      String name, EvidenceVariable.EvidenceVariableCharacteristicComponent element, int index) {
7412    if (element == null)
7413      return;
7414    Complex t;
7415    if (Utilities.noString(parentType))
7416      t = parent;
7417    else {
7418      t = parent.predicate("fhir:" + parentType + '.' + name);
7419    }
7420    composeBackboneElement(t, "characteristic", name, element, index);
7421    if (element.hasDescriptionElement())
7422      composeString(t, "EvidenceVariable", "description", element.getDescriptionElement(), -1);
7423    if (element.hasDefinition())
7424      composeType(t, "EvidenceVariable", "definition", element.getDefinition(), -1);
7425    for (int i = 0; i < element.getUsageContext().size(); i++)
7426      composeUsageContext(t, "EvidenceVariable", "usageContext", element.getUsageContext().get(i), i);
7427    if (element.hasExcludeElement())
7428      composeBoolean(t, "EvidenceVariable", "exclude", element.getExcludeElement(), -1);
7429    if (element.hasParticipantEffective())
7430      composeType(t, "EvidenceVariable", "participantEffective", element.getParticipantEffective(), -1);
7431    if (element.hasTimeFromStart())
7432      composeDuration(t, "EvidenceVariable", "timeFromStart", element.getTimeFromStart(), -1);
7433    if (element.hasGroupMeasureElement())
7434      composeEnum(t, "EvidenceVariable", "groupMeasure", element.getGroupMeasureElement(), -1);
7435  }
7436
7437  protected void composeExampleScenario(Complex parent, String parentType, String name, ExampleScenario element,
7438      int index) {
7439    if (element == null)
7440      return;
7441    Complex t;
7442    if (Utilities.noString(parentType))
7443      t = parent;
7444    else {
7445      t = parent.predicate("fhir:" + parentType + '.' + name);
7446    }
7447    composeDomainResource(t, "ExampleScenario", name, element, index);
7448    if (element.hasUrlElement())
7449      composeUri(t, "ExampleScenario", "url", element.getUrlElement(), -1);
7450    for (int i = 0; i < element.getIdentifier().size(); i++)
7451      composeIdentifier(t, "ExampleScenario", "identifier", element.getIdentifier().get(i), i);
7452    if (element.hasVersionElement())
7453      composeString(t, "ExampleScenario", "version", element.getVersionElement(), -1);
7454    if (element.hasNameElement())
7455      composeString(t, "ExampleScenario", "name", element.getNameElement(), -1);
7456    if (element.hasStatusElement())
7457      composeEnum(t, "ExampleScenario", "status", element.getStatusElement(), -1);
7458    if (element.hasExperimentalElement())
7459      composeBoolean(t, "ExampleScenario", "experimental", element.getExperimentalElement(), -1);
7460    if (element.hasDateElement())
7461      composeDateTime(t, "ExampleScenario", "date", element.getDateElement(), -1);
7462    if (element.hasPublisherElement())
7463      composeString(t, "ExampleScenario", "publisher", element.getPublisherElement(), -1);
7464    for (int i = 0; i < element.getContact().size(); i++)
7465      composeContactDetail(t, "ExampleScenario", "contact", element.getContact().get(i), i);
7466    for (int i = 0; i < element.getUseContext().size(); i++)
7467      composeUsageContext(t, "ExampleScenario", "useContext", element.getUseContext().get(i), i);
7468    for (int i = 0; i < element.getJurisdiction().size(); i++)
7469      composeCodeableConcept(t, "ExampleScenario", "jurisdiction", element.getJurisdiction().get(i), i);
7470    if (element.hasCopyrightElement())
7471      composeMarkdown(t, "ExampleScenario", "copyright", element.getCopyrightElement(), -1);
7472    if (element.hasPurposeElement())
7473      composeMarkdown(t, "ExampleScenario", "purpose", element.getPurposeElement(), -1);
7474    for (int i = 0; i < element.getActor().size(); i++)
7475      composeExampleScenarioExampleScenarioActorComponent(t, "ExampleScenario", "actor", element.getActor().get(i), i);
7476    for (int i = 0; i < element.getInstance().size(); i++)
7477      composeExampleScenarioExampleScenarioInstanceComponent(t, "ExampleScenario", "instance",
7478          element.getInstance().get(i), i);
7479    for (int i = 0; i < element.getProcess().size(); i++)
7480      composeExampleScenarioExampleScenarioProcessComponent(t, "ExampleScenario", "process",
7481          element.getProcess().get(i), i);
7482    for (int i = 0; i < element.getWorkflow().size(); i++)
7483      composeCanonical(t, "ExampleScenario", "workflow", element.getWorkflow().get(i), i);
7484  }
7485
7486  protected void composeExampleScenarioExampleScenarioActorComponent(Complex parent, String parentType, String name,
7487      ExampleScenario.ExampleScenarioActorComponent element, int index) {
7488    if (element == null)
7489      return;
7490    Complex t;
7491    if (Utilities.noString(parentType))
7492      t = parent;
7493    else {
7494      t = parent.predicate("fhir:" + parentType + '.' + name);
7495    }
7496    composeBackboneElement(t, "actor", name, element, index);
7497    if (element.hasActorIdElement())
7498      composeString(t, "ExampleScenario", "actorId", element.getActorIdElement(), -1);
7499    if (element.hasTypeElement())
7500      composeEnum(t, "ExampleScenario", "type", element.getTypeElement(), -1);
7501    if (element.hasNameElement())
7502      composeString(t, "ExampleScenario", "name", element.getNameElement(), -1);
7503    if (element.hasDescriptionElement())
7504      composeMarkdown(t, "ExampleScenario", "description", element.getDescriptionElement(), -1);
7505  }
7506
7507  protected void composeExampleScenarioExampleScenarioInstanceComponent(Complex parent, String parentType, String name,
7508      ExampleScenario.ExampleScenarioInstanceComponent element, int index) {
7509    if (element == null)
7510      return;
7511    Complex t;
7512    if (Utilities.noString(parentType))
7513      t = parent;
7514    else {
7515      t = parent.predicate("fhir:" + parentType + '.' + name);
7516    }
7517    composeBackboneElement(t, "instance", name, element, index);
7518    if (element.hasResourceIdElement())
7519      composeString(t, "ExampleScenario", "resourceId", element.getResourceIdElement(), -1);
7520    if (element.hasResourceTypeElement())
7521      composeEnum(t, "ExampleScenario", "resourceType", element.getResourceTypeElement(), -1);
7522    if (element.hasNameElement())
7523      composeString(t, "ExampleScenario", "name", element.getNameElement(), -1);
7524    if (element.hasDescriptionElement())
7525      composeMarkdown(t, "ExampleScenario", "description", element.getDescriptionElement(), -1);
7526    for (int i = 0; i < element.getVersion().size(); i++)
7527      composeExampleScenarioExampleScenarioInstanceVersionComponent(t, "ExampleScenario", "version",
7528          element.getVersion().get(i), i);
7529    for (int i = 0; i < element.getContainedInstance().size(); i++)
7530      composeExampleScenarioExampleScenarioInstanceContainedInstanceComponent(t, "ExampleScenario", "containedInstance",
7531          element.getContainedInstance().get(i), i);
7532  }
7533
7534  protected void composeExampleScenarioExampleScenarioInstanceVersionComponent(Complex parent, String parentType,
7535      String name, ExampleScenario.ExampleScenarioInstanceVersionComponent element, int index) {
7536    if (element == null)
7537      return;
7538    Complex t;
7539    if (Utilities.noString(parentType))
7540      t = parent;
7541    else {
7542      t = parent.predicate("fhir:" + parentType + '.' + name);
7543    }
7544    composeBackboneElement(t, "version", name, element, index);
7545    if (element.hasVersionIdElement())
7546      composeString(t, "ExampleScenario", "versionId", element.getVersionIdElement(), -1);
7547    if (element.hasDescriptionElement())
7548      composeMarkdown(t, "ExampleScenario", "description", element.getDescriptionElement(), -1);
7549  }
7550
7551  protected void composeExampleScenarioExampleScenarioInstanceContainedInstanceComponent(Complex parent,
7552      String parentType, String name, ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent element,
7553      int index) {
7554    if (element == null)
7555      return;
7556    Complex t;
7557    if (Utilities.noString(parentType))
7558      t = parent;
7559    else {
7560      t = parent.predicate("fhir:" + parentType + '.' + name);
7561    }
7562    composeBackboneElement(t, "containedInstance", name, element, index);
7563    if (element.hasResourceIdElement())
7564      composeString(t, "ExampleScenario", "resourceId", element.getResourceIdElement(), -1);
7565    if (element.hasVersionIdElement())
7566      composeString(t, "ExampleScenario", "versionId", element.getVersionIdElement(), -1);
7567  }
7568
7569  protected void composeExampleScenarioExampleScenarioProcessComponent(Complex parent, String parentType, String name,
7570      ExampleScenario.ExampleScenarioProcessComponent element, int index) {
7571    if (element == null)
7572      return;
7573    Complex t;
7574    if (Utilities.noString(parentType))
7575      t = parent;
7576    else {
7577      t = parent.predicate("fhir:" + parentType + '.' + name);
7578    }
7579    composeBackboneElement(t, "process", name, element, index);
7580    if (element.hasTitleElement())
7581      composeString(t, "ExampleScenario", "title", element.getTitleElement(), -1);
7582    if (element.hasDescriptionElement())
7583      composeMarkdown(t, "ExampleScenario", "description", element.getDescriptionElement(), -1);
7584    if (element.hasPreConditionsElement())
7585      composeMarkdown(t, "ExampleScenario", "preConditions", element.getPreConditionsElement(), -1);
7586    if (element.hasPostConditionsElement())
7587      composeMarkdown(t, "ExampleScenario", "postConditions", element.getPostConditionsElement(), -1);
7588    for (int i = 0; i < element.getStep().size(); i++)
7589      composeExampleScenarioExampleScenarioProcessStepComponent(t, "ExampleScenario", "step", element.getStep().get(i),
7590          i);
7591  }
7592
7593  protected void composeExampleScenarioExampleScenarioProcessStepComponent(Complex parent, String parentType,
7594      String name, ExampleScenario.ExampleScenarioProcessStepComponent element, int index) {
7595    if (element == null)
7596      return;
7597    Complex t;
7598    if (Utilities.noString(parentType))
7599      t = parent;
7600    else {
7601      t = parent.predicate("fhir:" + parentType + '.' + name);
7602    }
7603    composeBackboneElement(t, "step", name, element, index);
7604    for (int i = 0; i < element.getProcess().size(); i++)
7605      composeExampleScenarioExampleScenarioProcessComponent(t, "ExampleScenario", "process",
7606          element.getProcess().get(i), i);
7607    if (element.hasPauseElement())
7608      composeBoolean(t, "ExampleScenario", "pause", element.getPauseElement(), -1);
7609    if (element.hasOperation())
7610      composeExampleScenarioExampleScenarioProcessStepOperationComponent(t, "ExampleScenario", "operation",
7611          element.getOperation(), -1);
7612    for (int i = 0; i < element.getAlternative().size(); i++)
7613      composeExampleScenarioExampleScenarioProcessStepAlternativeComponent(t, "ExampleScenario", "alternative",
7614          element.getAlternative().get(i), i);
7615  }
7616
7617  protected void composeExampleScenarioExampleScenarioProcessStepOperationComponent(Complex parent, String parentType,
7618      String name, ExampleScenario.ExampleScenarioProcessStepOperationComponent element, int index) {
7619    if (element == null)
7620      return;
7621    Complex t;
7622    if (Utilities.noString(parentType))
7623      t = parent;
7624    else {
7625      t = parent.predicate("fhir:" + parentType + '.' + name);
7626    }
7627    composeBackboneElement(t, "operation", name, element, index);
7628    if (element.hasNumberElement())
7629      composeString(t, "ExampleScenario", "number", element.getNumberElement(), -1);
7630    if (element.hasTypeElement())
7631      composeString(t, "ExampleScenario", "type", element.getTypeElement(), -1);
7632    if (element.hasNameElement())
7633      composeString(t, "ExampleScenario", "name", element.getNameElement(), -1);
7634    if (element.hasInitiatorElement())
7635      composeString(t, "ExampleScenario", "initiator", element.getInitiatorElement(), -1);
7636    if (element.hasReceiverElement())
7637      composeString(t, "ExampleScenario", "receiver", element.getReceiverElement(), -1);
7638    if (element.hasDescriptionElement())
7639      composeMarkdown(t, "ExampleScenario", "description", element.getDescriptionElement(), -1);
7640    if (element.hasInitiatorActiveElement())
7641      composeBoolean(t, "ExampleScenario", "initiatorActive", element.getInitiatorActiveElement(), -1);
7642    if (element.hasReceiverActiveElement())
7643      composeBoolean(t, "ExampleScenario", "receiverActive", element.getReceiverActiveElement(), -1);
7644    if (element.hasRequest())
7645      composeExampleScenarioExampleScenarioInstanceContainedInstanceComponent(t, "ExampleScenario", "request",
7646          element.getRequest(), -1);
7647    if (element.hasResponse())
7648      composeExampleScenarioExampleScenarioInstanceContainedInstanceComponent(t, "ExampleScenario", "response",
7649          element.getResponse(), -1);
7650  }
7651
7652  protected void composeExampleScenarioExampleScenarioProcessStepAlternativeComponent(Complex parent, String parentType,
7653      String name, ExampleScenario.ExampleScenarioProcessStepAlternativeComponent element, int index) {
7654    if (element == null)
7655      return;
7656    Complex t;
7657    if (Utilities.noString(parentType))
7658      t = parent;
7659    else {
7660      t = parent.predicate("fhir:" + parentType + '.' + name);
7661    }
7662    composeBackboneElement(t, "alternative", name, element, index);
7663    if (element.hasTitleElement())
7664      composeString(t, "ExampleScenario", "title", element.getTitleElement(), -1);
7665    if (element.hasDescriptionElement())
7666      composeMarkdown(t, "ExampleScenario", "description", element.getDescriptionElement(), -1);
7667    for (int i = 0; i < element.getStep().size(); i++)
7668      composeExampleScenarioExampleScenarioProcessStepComponent(t, "ExampleScenario", "step", element.getStep().get(i),
7669          i);
7670  }
7671
7672  protected void composeExplanationOfBenefit(Complex parent, String parentType, String name,
7673      ExplanationOfBenefit element, int index) {
7674    if (element == null)
7675      return;
7676    Complex t;
7677    if (Utilities.noString(parentType))
7678      t = parent;
7679    else {
7680      t = parent.predicate("fhir:" + parentType + '.' + name);
7681    }
7682    composeDomainResource(t, "ExplanationOfBenefit", name, element, index);
7683    for (int i = 0; i < element.getIdentifier().size(); i++)
7684      composeIdentifier(t, "ExplanationOfBenefit", "identifier", element.getIdentifier().get(i), i);
7685    if (element.hasStatusElement())
7686      composeEnum(t, "ExplanationOfBenefit", "status", element.getStatusElement(), -1);
7687    if (element.hasType())
7688      composeCodeableConcept(t, "ExplanationOfBenefit", "type", element.getType(), -1);
7689    if (element.hasSubType())
7690      composeCodeableConcept(t, "ExplanationOfBenefit", "subType", element.getSubType(), -1);
7691    if (element.hasUseElement())
7692      composeEnum(t, "ExplanationOfBenefit", "use", element.getUseElement(), -1);
7693    if (element.hasPatient())
7694      composeReference(t, "ExplanationOfBenefit", "patient", element.getPatient(), -1);
7695    if (element.hasBillablePeriod())
7696      composePeriod(t, "ExplanationOfBenefit", "billablePeriod", element.getBillablePeriod(), -1);
7697    if (element.hasCreatedElement())
7698      composeDateTime(t, "ExplanationOfBenefit", "created", element.getCreatedElement(), -1);
7699    if (element.hasEnterer())
7700      composeReference(t, "ExplanationOfBenefit", "enterer", element.getEnterer(), -1);
7701    if (element.hasInsurer())
7702      composeReference(t, "ExplanationOfBenefit", "insurer", element.getInsurer(), -1);
7703    if (element.hasProvider())
7704      composeReference(t, "ExplanationOfBenefit", "provider", element.getProvider(), -1);
7705    if (element.hasPriority())
7706      composeCodeableConcept(t, "ExplanationOfBenefit", "priority", element.getPriority(), -1);
7707    if (element.hasFundsReserveRequested())
7708      composeCodeableConcept(t, "ExplanationOfBenefit", "fundsReserveRequested", element.getFundsReserveRequested(),
7709          -1);
7710    if (element.hasFundsReserve())
7711      composeCodeableConcept(t, "ExplanationOfBenefit", "fundsReserve", element.getFundsReserve(), -1);
7712    for (int i = 0; i < element.getRelated().size(); i++)
7713      composeExplanationOfBenefitRelatedClaimComponent(t, "ExplanationOfBenefit", "related",
7714          element.getRelated().get(i), i);
7715    if (element.hasPrescription())
7716      composeReference(t, "ExplanationOfBenefit", "prescription", element.getPrescription(), -1);
7717    if (element.hasOriginalPrescription())
7718      composeReference(t, "ExplanationOfBenefit", "originalPrescription", element.getOriginalPrescription(), -1);
7719    if (element.hasPayee())
7720      composeExplanationOfBenefitPayeeComponent(t, "ExplanationOfBenefit", "payee", element.getPayee(), -1);
7721    if (element.hasReferral())
7722      composeReference(t, "ExplanationOfBenefit", "referral", element.getReferral(), -1);
7723    if (element.hasFacility())
7724      composeReference(t, "ExplanationOfBenefit", "facility", element.getFacility(), -1);
7725    if (element.hasClaim())
7726      composeReference(t, "ExplanationOfBenefit", "claim", element.getClaim(), -1);
7727    if (element.hasClaimResponse())
7728      composeReference(t, "ExplanationOfBenefit", "claimResponse", element.getClaimResponse(), -1);
7729    if (element.hasOutcomeElement())
7730      composeEnum(t, "ExplanationOfBenefit", "outcome", element.getOutcomeElement(), -1);
7731    if (element.hasDispositionElement())
7732      composeString(t, "ExplanationOfBenefit", "disposition", element.getDispositionElement(), -1);
7733    for (int i = 0; i < element.getPreAuthRef().size(); i++)
7734      composeString(t, "ExplanationOfBenefit", "preAuthRef", element.getPreAuthRef().get(i), i);
7735    for (int i = 0; i < element.getPreAuthRefPeriod().size(); i++)
7736      composePeriod(t, "ExplanationOfBenefit", "preAuthRefPeriod", element.getPreAuthRefPeriod().get(i), i);
7737    for (int i = 0; i < element.getCareTeam().size(); i++)
7738      composeExplanationOfBenefitCareTeamComponent(t, "ExplanationOfBenefit", "careTeam", element.getCareTeam().get(i),
7739          i);
7740    for (int i = 0; i < element.getSupportingInfo().size(); i++)
7741      composeExplanationOfBenefitSupportingInformationComponent(t, "ExplanationOfBenefit", "supportingInfo",
7742          element.getSupportingInfo().get(i), i);
7743    for (int i = 0; i < element.getDiagnosis().size(); i++)
7744      composeExplanationOfBenefitDiagnosisComponent(t, "ExplanationOfBenefit", "diagnosis",
7745          element.getDiagnosis().get(i), i);
7746    for (int i = 0; i < element.getProcedure().size(); i++)
7747      composeExplanationOfBenefitProcedureComponent(t, "ExplanationOfBenefit", "procedure",
7748          element.getProcedure().get(i), i);
7749    if (element.hasPrecedenceElement())
7750      composePositiveInt(t, "ExplanationOfBenefit", "precedence", element.getPrecedenceElement(), -1);
7751    for (int i = 0; i < element.getInsurance().size(); i++)
7752      composeExplanationOfBenefitInsuranceComponent(t, "ExplanationOfBenefit", "insurance",
7753          element.getInsurance().get(i), i);
7754    if (element.hasAccident())
7755      composeExplanationOfBenefitAccidentComponent(t, "ExplanationOfBenefit", "accident", element.getAccident(), -1);
7756    for (int i = 0; i < element.getItem().size(); i++)
7757      composeExplanationOfBenefitItemComponent(t, "ExplanationOfBenefit", "item", element.getItem().get(i), i);
7758    for (int i = 0; i < element.getAddItem().size(); i++)
7759      composeExplanationOfBenefitAddedItemComponent(t, "ExplanationOfBenefit", "addItem", element.getAddItem().get(i),
7760          i);
7761    for (int i = 0; i < element.getAdjudication().size(); i++)
7762      composeExplanationOfBenefitAdjudicationComponent(t, "ExplanationOfBenefit", "adjudication",
7763          element.getAdjudication().get(i), i);
7764    for (int i = 0; i < element.getTotal().size(); i++)
7765      composeExplanationOfBenefitTotalComponent(t, "ExplanationOfBenefit", "total", element.getTotal().get(i), i);
7766    if (element.hasPayment())
7767      composeExplanationOfBenefitPaymentComponent(t, "ExplanationOfBenefit", "payment", element.getPayment(), -1);
7768    if (element.hasFormCode())
7769      composeCodeableConcept(t, "ExplanationOfBenefit", "formCode", element.getFormCode(), -1);
7770    if (element.hasForm())
7771      composeAttachment(t, "ExplanationOfBenefit", "form", element.getForm(), -1);
7772    for (int i = 0; i < element.getProcessNote().size(); i++)
7773      composeExplanationOfBenefitNoteComponent(t, "ExplanationOfBenefit", "processNote",
7774          element.getProcessNote().get(i), i);
7775    if (element.hasBenefitPeriod())
7776      composePeriod(t, "ExplanationOfBenefit", "benefitPeriod", element.getBenefitPeriod(), -1);
7777    for (int i = 0; i < element.getBenefitBalance().size(); i++)
7778      composeExplanationOfBenefitBenefitBalanceComponent(t, "ExplanationOfBenefit", "benefitBalance",
7779          element.getBenefitBalance().get(i), i);
7780  }
7781
7782  protected void composeExplanationOfBenefitRelatedClaimComponent(Complex parent, String parentType, String name,
7783      ExplanationOfBenefit.RelatedClaimComponent element, int index) {
7784    if (element == null)
7785      return;
7786    Complex t;
7787    if (Utilities.noString(parentType))
7788      t = parent;
7789    else {
7790      t = parent.predicate("fhir:" + parentType + '.' + name);
7791    }
7792    composeBackboneElement(t, "related", name, element, index);
7793    if (element.hasClaim())
7794      composeReference(t, "ExplanationOfBenefit", "claim", element.getClaim(), -1);
7795    if (element.hasRelationship())
7796      composeCodeableConcept(t, "ExplanationOfBenefit", "relationship", element.getRelationship(), -1);
7797    if (element.hasReference())
7798      composeIdentifier(t, "ExplanationOfBenefit", "reference", element.getReference(), -1);
7799  }
7800
7801  protected void composeExplanationOfBenefitPayeeComponent(Complex parent, String parentType, String name,
7802      ExplanationOfBenefit.PayeeComponent element, int index) {
7803    if (element == null)
7804      return;
7805    Complex t;
7806    if (Utilities.noString(parentType))
7807      t = parent;
7808    else {
7809      t = parent.predicate("fhir:" + parentType + '.' + name);
7810    }
7811    composeBackboneElement(t, "payee", name, element, index);
7812    if (element.hasType())
7813      composeCodeableConcept(t, "ExplanationOfBenefit", "type", element.getType(), -1);
7814    if (element.hasParty())
7815      composeReference(t, "ExplanationOfBenefit", "party", element.getParty(), -1);
7816  }
7817
7818  protected void composeExplanationOfBenefitCareTeamComponent(Complex parent, String parentType, String name,
7819      ExplanationOfBenefit.CareTeamComponent element, int index) {
7820    if (element == null)
7821      return;
7822    Complex t;
7823    if (Utilities.noString(parentType))
7824      t = parent;
7825    else {
7826      t = parent.predicate("fhir:" + parentType + '.' + name);
7827    }
7828    composeBackboneElement(t, "careTeam", name, element, index);
7829    if (element.hasSequenceElement())
7830      composePositiveInt(t, "ExplanationOfBenefit", "sequence", element.getSequenceElement(), -1);
7831    if (element.hasProvider())
7832      composeReference(t, "ExplanationOfBenefit", "provider", element.getProvider(), -1);
7833    if (element.hasResponsibleElement())
7834      composeBoolean(t, "ExplanationOfBenefit", "responsible", element.getResponsibleElement(), -1);
7835    if (element.hasRole())
7836      composeCodeableConcept(t, "ExplanationOfBenefit", "role", element.getRole(), -1);
7837    if (element.hasQualification())
7838      composeCodeableConcept(t, "ExplanationOfBenefit", "qualification", element.getQualification(), -1);
7839  }
7840
7841  protected void composeExplanationOfBenefitSupportingInformationComponent(Complex parent, String parentType,
7842      String name, ExplanationOfBenefit.SupportingInformationComponent element, int index) {
7843    if (element == null)
7844      return;
7845    Complex t;
7846    if (Utilities.noString(parentType))
7847      t = parent;
7848    else {
7849      t = parent.predicate("fhir:" + parentType + '.' + name);
7850    }
7851    composeBackboneElement(t, "supportingInfo", name, element, index);
7852    if (element.hasSequenceElement())
7853      composePositiveInt(t, "ExplanationOfBenefit", "sequence", element.getSequenceElement(), -1);
7854    if (element.hasCategory())
7855      composeCodeableConcept(t, "ExplanationOfBenefit", "category", element.getCategory(), -1);
7856    if (element.hasCode())
7857      composeCodeableConcept(t, "ExplanationOfBenefit", "code", element.getCode(), -1);
7858    if (element.hasTiming())
7859      composeType(t, "ExplanationOfBenefit", "timing", element.getTiming(), -1);
7860    if (element.hasValue())
7861      composeType(t, "ExplanationOfBenefit", "value", element.getValue(), -1);
7862    if (element.hasReason())
7863      composeCoding(t, "ExplanationOfBenefit", "reason", element.getReason(), -1);
7864  }
7865
7866  protected void composeExplanationOfBenefitDiagnosisComponent(Complex parent, String parentType, String name,
7867      ExplanationOfBenefit.DiagnosisComponent element, int index) {
7868    if (element == null)
7869      return;
7870    Complex t;
7871    if (Utilities.noString(parentType))
7872      t = parent;
7873    else {
7874      t = parent.predicate("fhir:" + parentType + '.' + name);
7875    }
7876    composeBackboneElement(t, "diagnosis", name, element, index);
7877    if (element.hasSequenceElement())
7878      composePositiveInt(t, "ExplanationOfBenefit", "sequence", element.getSequenceElement(), -1);
7879    if (element.hasDiagnosis())
7880      composeType(t, "ExplanationOfBenefit", "diagnosis", element.getDiagnosis(), -1);
7881    for (int i = 0; i < element.getType().size(); i++)
7882      composeCodeableConcept(t, "ExplanationOfBenefit", "type", element.getType().get(i), i);
7883    if (element.hasOnAdmission())
7884      composeCodeableConcept(t, "ExplanationOfBenefit", "onAdmission", element.getOnAdmission(), -1);
7885    if (element.hasPackageCode())
7886      composeCodeableConcept(t, "ExplanationOfBenefit", "packageCode", element.getPackageCode(), -1);
7887  }
7888
7889  protected void composeExplanationOfBenefitProcedureComponent(Complex parent, String parentType, String name,
7890      ExplanationOfBenefit.ProcedureComponent element, int index) {
7891    if (element == null)
7892      return;
7893    Complex t;
7894    if (Utilities.noString(parentType))
7895      t = parent;
7896    else {
7897      t = parent.predicate("fhir:" + parentType + '.' + name);
7898    }
7899    composeBackboneElement(t, "procedure", name, element, index);
7900    if (element.hasSequenceElement())
7901      composePositiveInt(t, "ExplanationOfBenefit", "sequence", element.getSequenceElement(), -1);
7902    for (int i = 0; i < element.getType().size(); i++)
7903      composeCodeableConcept(t, "ExplanationOfBenefit", "type", element.getType().get(i), i);
7904    if (element.hasDateElement())
7905      composeDateTime(t, "ExplanationOfBenefit", "date", element.getDateElement(), -1);
7906    if (element.hasProcedure())
7907      composeType(t, "ExplanationOfBenefit", "procedure", element.getProcedure(), -1);
7908    for (int i = 0; i < element.getUdi().size(); i++)
7909      composeReference(t, "ExplanationOfBenefit", "udi", element.getUdi().get(i), i);
7910  }
7911
7912  protected void composeExplanationOfBenefitInsuranceComponent(Complex parent, String parentType, String name,
7913      ExplanationOfBenefit.InsuranceComponent element, int index) {
7914    if (element == null)
7915      return;
7916    Complex t;
7917    if (Utilities.noString(parentType))
7918      t = parent;
7919    else {
7920      t = parent.predicate("fhir:" + parentType + '.' + name);
7921    }
7922    composeBackboneElement(t, "insurance", name, element, index);
7923    if (element.hasFocalElement())
7924      composeBoolean(t, "ExplanationOfBenefit", "focal", element.getFocalElement(), -1);
7925    if (element.hasCoverage())
7926      composeReference(t, "ExplanationOfBenefit", "coverage", element.getCoverage(), -1);
7927    for (int i = 0; i < element.getPreAuthRef().size(); i++)
7928      composeString(t, "ExplanationOfBenefit", "preAuthRef", element.getPreAuthRef().get(i), i);
7929  }
7930
7931  protected void composeExplanationOfBenefitAccidentComponent(Complex parent, String parentType, String name,
7932      ExplanationOfBenefit.AccidentComponent element, int index) {
7933    if (element == null)
7934      return;
7935    Complex t;
7936    if (Utilities.noString(parentType))
7937      t = parent;
7938    else {
7939      t = parent.predicate("fhir:" + parentType + '.' + name);
7940    }
7941    composeBackboneElement(t, "accident", name, element, index);
7942    if (element.hasDateElement())
7943      composeDate(t, "ExplanationOfBenefit", "date", element.getDateElement(), -1);
7944    if (element.hasType())
7945      composeCodeableConcept(t, "ExplanationOfBenefit", "type", element.getType(), -1);
7946    if (element.hasLocation())
7947      composeType(t, "ExplanationOfBenefit", "location", element.getLocation(), -1);
7948  }
7949
7950  protected void composeExplanationOfBenefitItemComponent(Complex parent, String parentType, String name,
7951      ExplanationOfBenefit.ItemComponent element, int index) {
7952    if (element == null)
7953      return;
7954    Complex t;
7955    if (Utilities.noString(parentType))
7956      t = parent;
7957    else {
7958      t = parent.predicate("fhir:" + parentType + '.' + name);
7959    }
7960    composeBackboneElement(t, "item", name, element, index);
7961    if (element.hasSequenceElement())
7962      composePositiveInt(t, "ExplanationOfBenefit", "sequence", element.getSequenceElement(), -1);
7963    for (int i = 0; i < element.getCareTeamSequence().size(); i++)
7964      composePositiveInt(t, "ExplanationOfBenefit", "careTeamSequence", element.getCareTeamSequence().get(i), i);
7965    for (int i = 0; i < element.getDiagnosisSequence().size(); i++)
7966      composePositiveInt(t, "ExplanationOfBenefit", "diagnosisSequence", element.getDiagnosisSequence().get(i), i);
7967    for (int i = 0; i < element.getProcedureSequence().size(); i++)
7968      composePositiveInt(t, "ExplanationOfBenefit", "procedureSequence", element.getProcedureSequence().get(i), i);
7969    for (int i = 0; i < element.getInformationSequence().size(); i++)
7970      composePositiveInt(t, "ExplanationOfBenefit", "informationSequence", element.getInformationSequence().get(i), i);
7971    if (element.hasRevenue())
7972      composeCodeableConcept(t, "ExplanationOfBenefit", "revenue", element.getRevenue(), -1);
7973    if (element.hasCategory())
7974      composeCodeableConcept(t, "ExplanationOfBenefit", "category", element.getCategory(), -1);
7975    if (element.hasProductOrService())
7976      composeCodeableConcept(t, "ExplanationOfBenefit", "productOrService", element.getProductOrService(), -1);
7977    for (int i = 0; i < element.getModifier().size(); i++)
7978      composeCodeableConcept(t, "ExplanationOfBenefit", "modifier", element.getModifier().get(i), i);
7979    for (int i = 0; i < element.getProgramCode().size(); i++)
7980      composeCodeableConcept(t, "ExplanationOfBenefit", "programCode", element.getProgramCode().get(i), i);
7981    if (element.hasServiced())
7982      composeType(t, "ExplanationOfBenefit", "serviced", element.getServiced(), -1);
7983    if (element.hasLocation())
7984      composeType(t, "ExplanationOfBenefit", "location", element.getLocation(), -1);
7985    if (element.hasQuantity())
7986      composeQuantity(t, "ExplanationOfBenefit", "quantity", element.getQuantity(), -1);
7987    if (element.hasUnitPrice())
7988      composeMoney(t, "ExplanationOfBenefit", "unitPrice", element.getUnitPrice(), -1);
7989    if (element.hasFactorElement())
7990      composeDecimal(t, "ExplanationOfBenefit", "factor", element.getFactorElement(), -1);
7991    if (element.hasNet())
7992      composeMoney(t, "ExplanationOfBenefit", "net", element.getNet(), -1);
7993    for (int i = 0; i < element.getUdi().size(); i++)
7994      composeReference(t, "ExplanationOfBenefit", "udi", element.getUdi().get(i), i);
7995    if (element.hasBodySite())
7996      composeCodeableConcept(t, "ExplanationOfBenefit", "bodySite", element.getBodySite(), -1);
7997    for (int i = 0; i < element.getSubSite().size(); i++)
7998      composeCodeableConcept(t, "ExplanationOfBenefit", "subSite", element.getSubSite().get(i), i);
7999    for (int i = 0; i < element.getEncounter().size(); i++)
8000      composeReference(t, "ExplanationOfBenefit", "encounter", element.getEncounter().get(i), i);
8001    for (int i = 0; i < element.getNoteNumber().size(); i++)
8002      composePositiveInt(t, "ExplanationOfBenefit", "noteNumber", element.getNoteNumber().get(i), i);
8003    for (int i = 0; i < element.getAdjudication().size(); i++)
8004      composeExplanationOfBenefitAdjudicationComponent(t, "ExplanationOfBenefit", "adjudication",
8005          element.getAdjudication().get(i), i);
8006    for (int i = 0; i < element.getDetail().size(); i++)
8007      composeExplanationOfBenefitDetailComponent(t, "ExplanationOfBenefit", "detail", element.getDetail().get(i), i);
8008  }
8009
8010  protected void composeExplanationOfBenefitAdjudicationComponent(Complex parent, String parentType, String name,
8011      ExplanationOfBenefit.AdjudicationComponent element, int index) {
8012    if (element == null)
8013      return;
8014    Complex t;
8015    if (Utilities.noString(parentType))
8016      t = parent;
8017    else {
8018      t = parent.predicate("fhir:" + parentType + '.' + name);
8019    }
8020    composeBackboneElement(t, "adjudication", name, element, index);
8021    if (element.hasCategory())
8022      composeCodeableConcept(t, "ExplanationOfBenefit", "category", element.getCategory(), -1);
8023    if (element.hasReason())
8024      composeCodeableConcept(t, "ExplanationOfBenefit", "reason", element.getReason(), -1);
8025    if (element.hasAmount())
8026      composeMoney(t, "ExplanationOfBenefit", "amount", element.getAmount(), -1);
8027    if (element.hasValueElement())
8028      composeDecimal(t, "ExplanationOfBenefit", "value", element.getValueElement(), -1);
8029  }
8030
8031  protected void composeExplanationOfBenefitDetailComponent(Complex parent, String parentType, String name,
8032      ExplanationOfBenefit.DetailComponent element, int index) {
8033    if (element == null)
8034      return;
8035    Complex t;
8036    if (Utilities.noString(parentType))
8037      t = parent;
8038    else {
8039      t = parent.predicate("fhir:" + parentType + '.' + name);
8040    }
8041    composeBackboneElement(t, "detail", name, element, index);
8042    if (element.hasSequenceElement())
8043      composePositiveInt(t, "ExplanationOfBenefit", "sequence", element.getSequenceElement(), -1);
8044    if (element.hasRevenue())
8045      composeCodeableConcept(t, "ExplanationOfBenefit", "revenue", element.getRevenue(), -1);
8046    if (element.hasCategory())
8047      composeCodeableConcept(t, "ExplanationOfBenefit", "category", element.getCategory(), -1);
8048    if (element.hasProductOrService())
8049      composeCodeableConcept(t, "ExplanationOfBenefit", "productOrService", element.getProductOrService(), -1);
8050    for (int i = 0; i < element.getModifier().size(); i++)
8051      composeCodeableConcept(t, "ExplanationOfBenefit", "modifier", element.getModifier().get(i), i);
8052    for (int i = 0; i < element.getProgramCode().size(); i++)
8053      composeCodeableConcept(t, "ExplanationOfBenefit", "programCode", element.getProgramCode().get(i), i);
8054    if (element.hasQuantity())
8055      composeQuantity(t, "ExplanationOfBenefit", "quantity", element.getQuantity(), -1);
8056    if (element.hasUnitPrice())
8057      composeMoney(t, "ExplanationOfBenefit", "unitPrice", element.getUnitPrice(), -1);
8058    if (element.hasFactorElement())
8059      composeDecimal(t, "ExplanationOfBenefit", "factor", element.getFactorElement(), -1);
8060    if (element.hasNet())
8061      composeMoney(t, "ExplanationOfBenefit", "net", element.getNet(), -1);
8062    for (int i = 0; i < element.getUdi().size(); i++)
8063      composeReference(t, "ExplanationOfBenefit", "udi", element.getUdi().get(i), i);
8064    for (int i = 0; i < element.getNoteNumber().size(); i++)
8065      composePositiveInt(t, "ExplanationOfBenefit", "noteNumber", element.getNoteNumber().get(i), i);
8066    for (int i = 0; i < element.getAdjudication().size(); i++)
8067      composeExplanationOfBenefitAdjudicationComponent(t, "ExplanationOfBenefit", "adjudication",
8068          element.getAdjudication().get(i), i);
8069    for (int i = 0; i < element.getSubDetail().size(); i++)
8070      composeExplanationOfBenefitSubDetailComponent(t, "ExplanationOfBenefit", "subDetail",
8071          element.getSubDetail().get(i), i);
8072  }
8073
8074  protected void composeExplanationOfBenefitSubDetailComponent(Complex parent, String parentType, String name,
8075      ExplanationOfBenefit.SubDetailComponent element, int index) {
8076    if (element == null)
8077      return;
8078    Complex t;
8079    if (Utilities.noString(parentType))
8080      t = parent;
8081    else {
8082      t = parent.predicate("fhir:" + parentType + '.' + name);
8083    }
8084    composeBackboneElement(t, "subDetail", name, element, index);
8085    if (element.hasSequenceElement())
8086      composePositiveInt(t, "ExplanationOfBenefit", "sequence", element.getSequenceElement(), -1);
8087    if (element.hasRevenue())
8088      composeCodeableConcept(t, "ExplanationOfBenefit", "revenue", element.getRevenue(), -1);
8089    if (element.hasCategory())
8090      composeCodeableConcept(t, "ExplanationOfBenefit", "category", element.getCategory(), -1);
8091    if (element.hasProductOrService())
8092      composeCodeableConcept(t, "ExplanationOfBenefit", "productOrService", element.getProductOrService(), -1);
8093    for (int i = 0; i < element.getModifier().size(); i++)
8094      composeCodeableConcept(t, "ExplanationOfBenefit", "modifier", element.getModifier().get(i), i);
8095    for (int i = 0; i < element.getProgramCode().size(); i++)
8096      composeCodeableConcept(t, "ExplanationOfBenefit", "programCode", element.getProgramCode().get(i), i);
8097    if (element.hasQuantity())
8098      composeQuantity(t, "ExplanationOfBenefit", "quantity", element.getQuantity(), -1);
8099    if (element.hasUnitPrice())
8100      composeMoney(t, "ExplanationOfBenefit", "unitPrice", element.getUnitPrice(), -1);
8101    if (element.hasFactorElement())
8102      composeDecimal(t, "ExplanationOfBenefit", "factor", element.getFactorElement(), -1);
8103    if (element.hasNet())
8104      composeMoney(t, "ExplanationOfBenefit", "net", element.getNet(), -1);
8105    for (int i = 0; i < element.getUdi().size(); i++)
8106      composeReference(t, "ExplanationOfBenefit", "udi", element.getUdi().get(i), i);
8107    for (int i = 0; i < element.getNoteNumber().size(); i++)
8108      composePositiveInt(t, "ExplanationOfBenefit", "noteNumber", element.getNoteNumber().get(i), i);
8109    for (int i = 0; i < element.getAdjudication().size(); i++)
8110      composeExplanationOfBenefitAdjudicationComponent(t, "ExplanationOfBenefit", "adjudication",
8111          element.getAdjudication().get(i), i);
8112  }
8113
8114  protected void composeExplanationOfBenefitAddedItemComponent(Complex parent, String parentType, String name,
8115      ExplanationOfBenefit.AddedItemComponent element, int index) {
8116    if (element == null)
8117      return;
8118    Complex t;
8119    if (Utilities.noString(parentType))
8120      t = parent;
8121    else {
8122      t = parent.predicate("fhir:" + parentType + '.' + name);
8123    }
8124    composeBackboneElement(t, "addItem", name, element, index);
8125    for (int i = 0; i < element.getItemSequence().size(); i++)
8126      composePositiveInt(t, "ExplanationOfBenefit", "itemSequence", element.getItemSequence().get(i), i);
8127    for (int i = 0; i < element.getDetailSequence().size(); i++)
8128      composePositiveInt(t, "ExplanationOfBenefit", "detailSequence", element.getDetailSequence().get(i), i);
8129    for (int i = 0; i < element.getSubDetailSequence().size(); i++)
8130      composePositiveInt(t, "ExplanationOfBenefit", "subDetailSequence", element.getSubDetailSequence().get(i), i);
8131    for (int i = 0; i < element.getProvider().size(); i++)
8132      composeReference(t, "ExplanationOfBenefit", "provider", element.getProvider().get(i), i);
8133    if (element.hasProductOrService())
8134      composeCodeableConcept(t, "ExplanationOfBenefit", "productOrService", element.getProductOrService(), -1);
8135    for (int i = 0; i < element.getModifier().size(); i++)
8136      composeCodeableConcept(t, "ExplanationOfBenefit", "modifier", element.getModifier().get(i), i);
8137    for (int i = 0; i < element.getProgramCode().size(); i++)
8138      composeCodeableConcept(t, "ExplanationOfBenefit", "programCode", element.getProgramCode().get(i), i);
8139    if (element.hasServiced())
8140      composeType(t, "ExplanationOfBenefit", "serviced", element.getServiced(), -1);
8141    if (element.hasLocation())
8142      composeType(t, "ExplanationOfBenefit", "location", element.getLocation(), -1);
8143    if (element.hasQuantity())
8144      composeQuantity(t, "ExplanationOfBenefit", "quantity", element.getQuantity(), -1);
8145    if (element.hasUnitPrice())
8146      composeMoney(t, "ExplanationOfBenefit", "unitPrice", element.getUnitPrice(), -1);
8147    if (element.hasFactorElement())
8148      composeDecimal(t, "ExplanationOfBenefit", "factor", element.getFactorElement(), -1);
8149    if (element.hasNet())
8150      composeMoney(t, "ExplanationOfBenefit", "net", element.getNet(), -1);
8151    if (element.hasBodySite())
8152      composeCodeableConcept(t, "ExplanationOfBenefit", "bodySite", element.getBodySite(), -1);
8153    for (int i = 0; i < element.getSubSite().size(); i++)
8154      composeCodeableConcept(t, "ExplanationOfBenefit", "subSite", element.getSubSite().get(i), i);
8155    for (int i = 0; i < element.getNoteNumber().size(); i++)
8156      composePositiveInt(t, "ExplanationOfBenefit", "noteNumber", element.getNoteNumber().get(i), i);
8157    for (int i = 0; i < element.getAdjudication().size(); i++)
8158      composeExplanationOfBenefitAdjudicationComponent(t, "ExplanationOfBenefit", "adjudication",
8159          element.getAdjudication().get(i), i);
8160    for (int i = 0; i < element.getDetail().size(); i++)
8161      composeExplanationOfBenefitAddedItemDetailComponent(t, "ExplanationOfBenefit", "detail",
8162          element.getDetail().get(i), i);
8163  }
8164
8165  protected void composeExplanationOfBenefitAddedItemDetailComponent(Complex parent, String parentType, String name,
8166      ExplanationOfBenefit.AddedItemDetailComponent element, int index) {
8167    if (element == null)
8168      return;
8169    Complex t;
8170    if (Utilities.noString(parentType))
8171      t = parent;
8172    else {
8173      t = parent.predicate("fhir:" + parentType + '.' + name);
8174    }
8175    composeBackboneElement(t, "detail", name, element, index);
8176    if (element.hasProductOrService())
8177      composeCodeableConcept(t, "ExplanationOfBenefit", "productOrService", element.getProductOrService(), -1);
8178    for (int i = 0; i < element.getModifier().size(); i++)
8179      composeCodeableConcept(t, "ExplanationOfBenefit", "modifier", element.getModifier().get(i), i);
8180    if (element.hasQuantity())
8181      composeQuantity(t, "ExplanationOfBenefit", "quantity", element.getQuantity(), -1);
8182    if (element.hasUnitPrice())
8183      composeMoney(t, "ExplanationOfBenefit", "unitPrice", element.getUnitPrice(), -1);
8184    if (element.hasFactorElement())
8185      composeDecimal(t, "ExplanationOfBenefit", "factor", element.getFactorElement(), -1);
8186    if (element.hasNet())
8187      composeMoney(t, "ExplanationOfBenefit", "net", element.getNet(), -1);
8188    for (int i = 0; i < element.getNoteNumber().size(); i++)
8189      composePositiveInt(t, "ExplanationOfBenefit", "noteNumber", element.getNoteNumber().get(i), i);
8190    for (int i = 0; i < element.getAdjudication().size(); i++)
8191      composeExplanationOfBenefitAdjudicationComponent(t, "ExplanationOfBenefit", "adjudication",
8192          element.getAdjudication().get(i), i);
8193    for (int i = 0; i < element.getSubDetail().size(); i++)
8194      composeExplanationOfBenefitAddedItemDetailSubDetailComponent(t, "ExplanationOfBenefit", "subDetail",
8195          element.getSubDetail().get(i), i);
8196  }
8197
8198  protected void composeExplanationOfBenefitAddedItemDetailSubDetailComponent(Complex parent, String parentType,
8199      String name, ExplanationOfBenefit.AddedItemDetailSubDetailComponent element, int index) {
8200    if (element == null)
8201      return;
8202    Complex t;
8203    if (Utilities.noString(parentType))
8204      t = parent;
8205    else {
8206      t = parent.predicate("fhir:" + parentType + '.' + name);
8207    }
8208    composeBackboneElement(t, "subDetail", name, element, index);
8209    if (element.hasProductOrService())
8210      composeCodeableConcept(t, "ExplanationOfBenefit", "productOrService", element.getProductOrService(), -1);
8211    for (int i = 0; i < element.getModifier().size(); i++)
8212      composeCodeableConcept(t, "ExplanationOfBenefit", "modifier", element.getModifier().get(i), i);
8213    if (element.hasQuantity())
8214      composeQuantity(t, "ExplanationOfBenefit", "quantity", element.getQuantity(), -1);
8215    if (element.hasUnitPrice())
8216      composeMoney(t, "ExplanationOfBenefit", "unitPrice", element.getUnitPrice(), -1);
8217    if (element.hasFactorElement())
8218      composeDecimal(t, "ExplanationOfBenefit", "factor", element.getFactorElement(), -1);
8219    if (element.hasNet())
8220      composeMoney(t, "ExplanationOfBenefit", "net", element.getNet(), -1);
8221    for (int i = 0; i < element.getNoteNumber().size(); i++)
8222      composePositiveInt(t, "ExplanationOfBenefit", "noteNumber", element.getNoteNumber().get(i), i);
8223    for (int i = 0; i < element.getAdjudication().size(); i++)
8224      composeExplanationOfBenefitAdjudicationComponent(t, "ExplanationOfBenefit", "adjudication",
8225          element.getAdjudication().get(i), i);
8226  }
8227
8228  protected void composeExplanationOfBenefitTotalComponent(Complex parent, String parentType, String name,
8229      ExplanationOfBenefit.TotalComponent element, int index) {
8230    if (element == null)
8231      return;
8232    Complex t;
8233    if (Utilities.noString(parentType))
8234      t = parent;
8235    else {
8236      t = parent.predicate("fhir:" + parentType + '.' + name);
8237    }
8238    composeBackboneElement(t, "total", name, element, index);
8239    if (element.hasCategory())
8240      composeCodeableConcept(t, "ExplanationOfBenefit", "category", element.getCategory(), -1);
8241    if (element.hasAmount())
8242      composeMoney(t, "ExplanationOfBenefit", "amount", element.getAmount(), -1);
8243  }
8244
8245  protected void composeExplanationOfBenefitPaymentComponent(Complex parent, String parentType, String name,
8246      ExplanationOfBenefit.PaymentComponent element, int index) {
8247    if (element == null)
8248      return;
8249    Complex t;
8250    if (Utilities.noString(parentType))
8251      t = parent;
8252    else {
8253      t = parent.predicate("fhir:" + parentType + '.' + name);
8254    }
8255    composeBackboneElement(t, "payment", name, element, index);
8256    if (element.hasType())
8257      composeCodeableConcept(t, "ExplanationOfBenefit", "type", element.getType(), -1);
8258    if (element.hasAdjustment())
8259      composeMoney(t, "ExplanationOfBenefit", "adjustment", element.getAdjustment(), -1);
8260    if (element.hasAdjustmentReason())
8261      composeCodeableConcept(t, "ExplanationOfBenefit", "adjustmentReason", element.getAdjustmentReason(), -1);
8262    if (element.hasDateElement())
8263      composeDate(t, "ExplanationOfBenefit", "date", element.getDateElement(), -1);
8264    if (element.hasAmount())
8265      composeMoney(t, "ExplanationOfBenefit", "amount", element.getAmount(), -1);
8266    if (element.hasIdentifier())
8267      composeIdentifier(t, "ExplanationOfBenefit", "identifier", element.getIdentifier(), -1);
8268  }
8269
8270  protected void composeExplanationOfBenefitNoteComponent(Complex parent, String parentType, String name,
8271      ExplanationOfBenefit.NoteComponent element, int index) {
8272    if (element == null)
8273      return;
8274    Complex t;
8275    if (Utilities.noString(parentType))
8276      t = parent;
8277    else {
8278      t = parent.predicate("fhir:" + parentType + '.' + name);
8279    }
8280    composeBackboneElement(t, "processNote", name, element, index);
8281    if (element.hasNumberElement())
8282      composePositiveInt(t, "ExplanationOfBenefit", "number", element.getNumberElement(), -1);
8283    if (element.hasTypeElement())
8284      composeEnum(t, "ExplanationOfBenefit", "type", element.getTypeElement(), -1);
8285    if (element.hasTextElement())
8286      composeString(t, "ExplanationOfBenefit", "text", element.getTextElement(), -1);
8287    if (element.hasLanguage())
8288      composeCodeableConcept(t, "ExplanationOfBenefit", "language", element.getLanguage(), -1);
8289  }
8290
8291  protected void composeExplanationOfBenefitBenefitBalanceComponent(Complex parent, String parentType, String name,
8292      ExplanationOfBenefit.BenefitBalanceComponent element, int index) {
8293    if (element == null)
8294      return;
8295    Complex t;
8296    if (Utilities.noString(parentType))
8297      t = parent;
8298    else {
8299      t = parent.predicate("fhir:" + parentType + '.' + name);
8300    }
8301    composeBackboneElement(t, "benefitBalance", name, element, index);
8302    if (element.hasCategory())
8303      composeCodeableConcept(t, "ExplanationOfBenefit", "category", element.getCategory(), -1);
8304    if (element.hasExcludedElement())
8305      composeBoolean(t, "ExplanationOfBenefit", "excluded", element.getExcludedElement(), -1);
8306    if (element.hasNameElement())
8307      composeString(t, "ExplanationOfBenefit", "name", element.getNameElement(), -1);
8308    if (element.hasDescriptionElement())
8309      composeString(t, "ExplanationOfBenefit", "description", element.getDescriptionElement(), -1);
8310    if (element.hasNetwork())
8311      composeCodeableConcept(t, "ExplanationOfBenefit", "network", element.getNetwork(), -1);
8312    if (element.hasUnit())
8313      composeCodeableConcept(t, "ExplanationOfBenefit", "unit", element.getUnit(), -1);
8314    if (element.hasTerm())
8315      composeCodeableConcept(t, "ExplanationOfBenefit", "term", element.getTerm(), -1);
8316    for (int i = 0; i < element.getFinancial().size(); i++)
8317      composeExplanationOfBenefitBenefitComponent(t, "ExplanationOfBenefit", "financial", element.getFinancial().get(i),
8318          i);
8319  }
8320
8321  protected void composeExplanationOfBenefitBenefitComponent(Complex parent, String parentType, String name,
8322      ExplanationOfBenefit.BenefitComponent element, int index) {
8323    if (element == null)
8324      return;
8325    Complex t;
8326    if (Utilities.noString(parentType))
8327      t = parent;
8328    else {
8329      t = parent.predicate("fhir:" + parentType + '.' + name);
8330    }
8331    composeBackboneElement(t, "financial", name, element, index);
8332    if (element.hasType())
8333      composeCodeableConcept(t, "ExplanationOfBenefit", "type", element.getType(), -1);
8334    if (element.hasAllowed())
8335      composeType(t, "ExplanationOfBenefit", "allowed", element.getAllowed(), -1);
8336    if (element.hasUsed())
8337      composeType(t, "ExplanationOfBenefit", "used", element.getUsed(), -1);
8338  }
8339
8340  protected void composeFamilyMemberHistory(Complex parent, String parentType, String name, FamilyMemberHistory element,
8341      int index) {
8342    if (element == null)
8343      return;
8344    Complex t;
8345    if (Utilities.noString(parentType))
8346      t = parent;
8347    else {
8348      t = parent.predicate("fhir:" + parentType + '.' + name);
8349    }
8350    composeDomainResource(t, "FamilyMemberHistory", name, element, index);
8351    for (int i = 0; i < element.getIdentifier().size(); i++)
8352      composeIdentifier(t, "FamilyMemberHistory", "identifier", element.getIdentifier().get(i), i);
8353    for (int i = 0; i < element.getInstantiatesCanonical().size(); i++)
8354      composeCanonical(t, "FamilyMemberHistory", "instantiatesCanonical", element.getInstantiatesCanonical().get(i), i);
8355    for (int i = 0; i < element.getInstantiatesUri().size(); i++)
8356      composeUri(t, "FamilyMemberHistory", "instantiatesUri", element.getInstantiatesUri().get(i), i);
8357    if (element.hasStatusElement())
8358      composeEnum(t, "FamilyMemberHistory", "status", element.getStatusElement(), -1);
8359    if (element.hasDataAbsentReason())
8360      composeCodeableConcept(t, "FamilyMemberHistory", "dataAbsentReason", element.getDataAbsentReason(), -1);
8361    if (element.hasPatient())
8362      composeReference(t, "FamilyMemberHistory", "patient", element.getPatient(), -1);
8363    if (element.hasDateElement())
8364      composeDateTime(t, "FamilyMemberHistory", "date", element.getDateElement(), -1);
8365    if (element.hasNameElement())
8366      composeString(t, "FamilyMemberHistory", "name", element.getNameElement(), -1);
8367    if (element.hasRelationship())
8368      composeCodeableConcept(t, "FamilyMemberHistory", "relationship", element.getRelationship(), -1);
8369    if (element.hasSex())
8370      composeCodeableConcept(t, "FamilyMemberHistory", "sex", element.getSex(), -1);
8371    if (element.hasBorn())
8372      composeType(t, "FamilyMemberHistory", "born", element.getBorn(), -1);
8373    if (element.hasAge())
8374      composeType(t, "FamilyMemberHistory", "age", element.getAge(), -1);
8375    if (element.hasEstimatedAgeElement())
8376      composeBoolean(t, "FamilyMemberHistory", "estimatedAge", element.getEstimatedAgeElement(), -1);
8377    if (element.hasDeceased())
8378      composeType(t, "FamilyMemberHistory", "deceased", element.getDeceased(), -1);
8379    for (int i = 0; i < element.getReasonCode().size(); i++)
8380      composeCodeableConcept(t, "FamilyMemberHistory", "reasonCode", element.getReasonCode().get(i), i);
8381    for (int i = 0; i < element.getReasonReference().size(); i++)
8382      composeReference(t, "FamilyMemberHistory", "reasonReference", element.getReasonReference().get(i), i);
8383    for (int i = 0; i < element.getNote().size(); i++)
8384      composeAnnotation(t, "FamilyMemberHistory", "note", element.getNote().get(i), i);
8385    for (int i = 0; i < element.getCondition().size(); i++)
8386      composeFamilyMemberHistoryFamilyMemberHistoryConditionComponent(t, "FamilyMemberHistory", "condition",
8387          element.getCondition().get(i), i);
8388  }
8389
8390  protected void composeFamilyMemberHistoryFamilyMemberHistoryConditionComponent(Complex parent, String parentType,
8391      String name, FamilyMemberHistory.FamilyMemberHistoryConditionComponent element, int index) {
8392    if (element == null)
8393      return;
8394    Complex t;
8395    if (Utilities.noString(parentType))
8396      t = parent;
8397    else {
8398      t = parent.predicate("fhir:" + parentType + '.' + name);
8399    }
8400    composeBackboneElement(t, "condition", name, element, index);
8401    if (element.hasCode())
8402      composeCodeableConcept(t, "FamilyMemberHistory", "code", element.getCode(), -1);
8403    if (element.hasOutcome())
8404      composeCodeableConcept(t, "FamilyMemberHistory", "outcome", element.getOutcome(), -1);
8405    if (element.hasContributedToDeathElement())
8406      composeBoolean(t, "FamilyMemberHistory", "contributedToDeath", element.getContributedToDeathElement(), -1);
8407    if (element.hasOnset())
8408      composeType(t, "FamilyMemberHistory", "onset", element.getOnset(), -1);
8409    for (int i = 0; i < element.getNote().size(); i++)
8410      composeAnnotation(t, "FamilyMemberHistory", "note", element.getNote().get(i), i);
8411  }
8412
8413  protected void composeFlag(Complex parent, String parentType, String name, Flag element, int index) {
8414    if (element == null)
8415      return;
8416    Complex t;
8417    if (Utilities.noString(parentType))
8418      t = parent;
8419    else {
8420      t = parent.predicate("fhir:" + parentType + '.' + name);
8421    }
8422    composeDomainResource(t, "Flag", name, element, index);
8423    for (int i = 0; i < element.getIdentifier().size(); i++)
8424      composeIdentifier(t, "Flag", "identifier", element.getIdentifier().get(i), i);
8425    if (element.hasStatusElement())
8426      composeEnum(t, "Flag", "status", element.getStatusElement(), -1);
8427    for (int i = 0; i < element.getCategory().size(); i++)
8428      composeCodeableConcept(t, "Flag", "category", element.getCategory().get(i), i);
8429    if (element.hasCode())
8430      composeCodeableConcept(t, "Flag", "code", element.getCode(), -1);
8431    if (element.hasSubject())
8432      composeReference(t, "Flag", "subject", element.getSubject(), -1);
8433    if (element.hasPeriod())
8434      composePeriod(t, "Flag", "period", element.getPeriod(), -1);
8435    if (element.hasEncounter())
8436      composeReference(t, "Flag", "encounter", element.getEncounter(), -1);
8437    if (element.hasAuthor())
8438      composeReference(t, "Flag", "author", element.getAuthor(), -1);
8439  }
8440
8441  protected void composeGoal(Complex parent, String parentType, String name, Goal element, int index) {
8442    if (element == null)
8443      return;
8444    Complex t;
8445    if (Utilities.noString(parentType))
8446      t = parent;
8447    else {
8448      t = parent.predicate("fhir:" + parentType + '.' + name);
8449    }
8450    composeDomainResource(t, "Goal", name, element, index);
8451    for (int i = 0; i < element.getIdentifier().size(); i++)
8452      composeIdentifier(t, "Goal", "identifier", element.getIdentifier().get(i), i);
8453    if (element.hasLifecycleStatusElement())
8454      composeEnum(t, "Goal", "lifecycleStatus", element.getLifecycleStatusElement(), -1);
8455    if (element.hasAchievementStatus())
8456      composeCodeableConcept(t, "Goal", "achievementStatus", element.getAchievementStatus(), -1);
8457    for (int i = 0; i < element.getCategory().size(); i++)
8458      composeCodeableConcept(t, "Goal", "category", element.getCategory().get(i), i);
8459    if (element.hasPriority())
8460      composeCodeableConcept(t, "Goal", "priority", element.getPriority(), -1);
8461    if (element.hasDescription())
8462      composeCodeableConcept(t, "Goal", "description", element.getDescription(), -1);
8463    if (element.hasSubject())
8464      composeReference(t, "Goal", "subject", element.getSubject(), -1);
8465    if (element.hasStart())
8466      composeType(t, "Goal", "start", element.getStart(), -1);
8467    for (int i = 0; i < element.getTarget().size(); i++)
8468      composeGoalGoalTargetComponent(t, "Goal", "target", element.getTarget().get(i), i);
8469    if (element.hasStatusDateElement())
8470      composeDate(t, "Goal", "statusDate", element.getStatusDateElement(), -1);
8471    if (element.hasStatusReasonElement())
8472      composeString(t, "Goal", "statusReason", element.getStatusReasonElement(), -1);
8473    if (element.hasExpressedBy())
8474      composeReference(t, "Goal", "expressedBy", element.getExpressedBy(), -1);
8475    for (int i = 0; i < element.getAddresses().size(); i++)
8476      composeReference(t, "Goal", "addresses", element.getAddresses().get(i), i);
8477    for (int i = 0; i < element.getNote().size(); i++)
8478      composeAnnotation(t, "Goal", "note", element.getNote().get(i), i);
8479    for (int i = 0; i < element.getOutcomeCode().size(); i++)
8480      composeCodeableConcept(t, "Goal", "outcomeCode", element.getOutcomeCode().get(i), i);
8481    for (int i = 0; i < element.getOutcomeReference().size(); i++)
8482      composeReference(t, "Goal", "outcomeReference", element.getOutcomeReference().get(i), i);
8483  }
8484
8485  protected void composeGoalGoalTargetComponent(Complex parent, String parentType, String name,
8486      Goal.GoalTargetComponent element, int index) {
8487    if (element == null)
8488      return;
8489    Complex t;
8490    if (Utilities.noString(parentType))
8491      t = parent;
8492    else {
8493      t = parent.predicate("fhir:" + parentType + '.' + name);
8494    }
8495    composeBackboneElement(t, "target", name, element, index);
8496    if (element.hasMeasure())
8497      composeCodeableConcept(t, "Goal", "measure", element.getMeasure(), -1);
8498    if (element.hasDetail())
8499      composeType(t, "Goal", "detail", element.getDetail(), -1);
8500    if (element.hasDue())
8501      composeType(t, "Goal", "due", element.getDue(), -1);
8502  }
8503
8504  protected void composeGraphDefinition(Complex parent, String parentType, String name, GraphDefinition element,
8505      int index) {
8506    if (element == null)
8507      return;
8508    Complex t;
8509    if (Utilities.noString(parentType))
8510      t = parent;
8511    else {
8512      t = parent.predicate("fhir:" + parentType + '.' + name);
8513    }
8514    composeDomainResource(t, "GraphDefinition", name, element, index);
8515    if (element.hasUrlElement())
8516      composeUri(t, "GraphDefinition", "url", element.getUrlElement(), -1);
8517    if (element.hasVersionElement())
8518      composeString(t, "GraphDefinition", "version", element.getVersionElement(), -1);
8519    if (element.hasNameElement())
8520      composeString(t, "GraphDefinition", "name", element.getNameElement(), -1);
8521    if (element.hasStatusElement())
8522      composeEnum(t, "GraphDefinition", "status", element.getStatusElement(), -1);
8523    if (element.hasExperimentalElement())
8524      composeBoolean(t, "GraphDefinition", "experimental", element.getExperimentalElement(), -1);
8525    if (element.hasDateElement())
8526      composeDateTime(t, "GraphDefinition", "date", element.getDateElement(), -1);
8527    if (element.hasPublisherElement())
8528      composeString(t, "GraphDefinition", "publisher", element.getPublisherElement(), -1);
8529    for (int i = 0; i < element.getContact().size(); i++)
8530      composeContactDetail(t, "GraphDefinition", "contact", element.getContact().get(i), i);
8531    if (element.hasDescriptionElement())
8532      composeMarkdown(t, "GraphDefinition", "description", element.getDescriptionElement(), -1);
8533    for (int i = 0; i < element.getUseContext().size(); i++)
8534      composeUsageContext(t, "GraphDefinition", "useContext", element.getUseContext().get(i), i);
8535    for (int i = 0; i < element.getJurisdiction().size(); i++)
8536      composeCodeableConcept(t, "GraphDefinition", "jurisdiction", element.getJurisdiction().get(i), i);
8537    if (element.hasPurposeElement())
8538      composeMarkdown(t, "GraphDefinition", "purpose", element.getPurposeElement(), -1);
8539    if (element.hasStartElement())
8540      composeCode(t, "GraphDefinition", "start", element.getStartElement(), -1);
8541    if (element.hasProfileElement())
8542      composeCanonical(t, "GraphDefinition", "profile", element.getProfileElement(), -1);
8543    for (int i = 0; i < element.getLink().size(); i++)
8544      composeGraphDefinitionGraphDefinitionLinkComponent(t, "GraphDefinition", "link", element.getLink().get(i), i);
8545  }
8546
8547  protected void composeGraphDefinitionGraphDefinitionLinkComponent(Complex parent, String parentType, String name,
8548      GraphDefinition.GraphDefinitionLinkComponent element, int index) {
8549    if (element == null)
8550      return;
8551    Complex t;
8552    if (Utilities.noString(parentType))
8553      t = parent;
8554    else {
8555      t = parent.predicate("fhir:" + parentType + '.' + name);
8556    }
8557    composeBackboneElement(t, "link", name, element, index);
8558    if (element.hasPathElement())
8559      composeString(t, "GraphDefinition", "path", element.getPathElement(), -1);
8560    if (element.hasSliceNameElement())
8561      composeString(t, "GraphDefinition", "sliceName", element.getSliceNameElement(), -1);
8562    if (element.hasMinElement())
8563      composeInteger(t, "GraphDefinition", "min", element.getMinElement(), -1);
8564    if (element.hasMaxElement())
8565      composeString(t, "GraphDefinition", "max", element.getMaxElement(), -1);
8566    if (element.hasDescriptionElement())
8567      composeString(t, "GraphDefinition", "description", element.getDescriptionElement(), -1);
8568    for (int i = 0; i < element.getTarget().size(); i++)
8569      composeGraphDefinitionGraphDefinitionLinkTargetComponent(t, "GraphDefinition", "target",
8570          element.getTarget().get(i), i);
8571  }
8572
8573  protected void composeGraphDefinitionGraphDefinitionLinkTargetComponent(Complex parent, String parentType,
8574      String name, GraphDefinition.GraphDefinitionLinkTargetComponent element, int index) {
8575    if (element == null)
8576      return;
8577    Complex t;
8578    if (Utilities.noString(parentType))
8579      t = parent;
8580    else {
8581      t = parent.predicate("fhir:" + parentType + '.' + name);
8582    }
8583    composeBackboneElement(t, "target", name, element, index);
8584    if (element.hasTypeElement())
8585      composeCode(t, "GraphDefinition", "type", element.getTypeElement(), -1);
8586    if (element.hasParamsElement())
8587      composeString(t, "GraphDefinition", "params", element.getParamsElement(), -1);
8588    if (element.hasProfileElement())
8589      composeCanonical(t, "GraphDefinition", "profile", element.getProfileElement(), -1);
8590    for (int i = 0; i < element.getCompartment().size(); i++)
8591      composeGraphDefinitionGraphDefinitionLinkTargetCompartmentComponent(t, "GraphDefinition", "compartment",
8592          element.getCompartment().get(i), i);
8593    for (int i = 0; i < element.getLink().size(); i++)
8594      composeGraphDefinitionGraphDefinitionLinkComponent(t, "GraphDefinition", "link", element.getLink().get(i), i);
8595  }
8596
8597  protected void composeGraphDefinitionGraphDefinitionLinkTargetCompartmentComponent(Complex parent, String parentType,
8598      String name, GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent element, int index) {
8599    if (element == null)
8600      return;
8601    Complex t;
8602    if (Utilities.noString(parentType))
8603      t = parent;
8604    else {
8605      t = parent.predicate("fhir:" + parentType + '.' + name);
8606    }
8607    composeBackboneElement(t, "compartment", name, element, index);
8608    if (element.hasUseElement())
8609      composeEnum(t, "GraphDefinition", "use", element.getUseElement(), -1);
8610    if (element.hasCodeElement())
8611      composeEnum(t, "GraphDefinition", "code", element.getCodeElement(), -1);
8612    if (element.hasRuleElement())
8613      composeEnum(t, "GraphDefinition", "rule", element.getRuleElement(), -1);
8614    if (element.hasExpressionElement())
8615      composeString(t, "GraphDefinition", "expression", element.getExpressionElement(), -1);
8616    if (element.hasDescriptionElement())
8617      composeString(t, "GraphDefinition", "description", element.getDescriptionElement(), -1);
8618  }
8619
8620  protected void composeGroup(Complex parent, String parentType, String name, Group element, int index) {
8621    if (element == null)
8622      return;
8623    Complex t;
8624    if (Utilities.noString(parentType))
8625      t = parent;
8626    else {
8627      t = parent.predicate("fhir:" + parentType + '.' + name);
8628    }
8629    composeDomainResource(t, "Group", name, element, index);
8630    for (int i = 0; i < element.getIdentifier().size(); i++)
8631      composeIdentifier(t, "Group", "identifier", element.getIdentifier().get(i), i);
8632    if (element.hasActiveElement())
8633      composeBoolean(t, "Group", "active", element.getActiveElement(), -1);
8634    if (element.hasTypeElement())
8635      composeEnum(t, "Group", "type", element.getTypeElement(), -1);
8636    if (element.hasActualElement())
8637      composeBoolean(t, "Group", "actual", element.getActualElement(), -1);
8638    if (element.hasCode())
8639      composeCodeableConcept(t, "Group", "code", element.getCode(), -1);
8640    if (element.hasNameElement())
8641      composeString(t, "Group", "name", element.getNameElement(), -1);
8642    if (element.hasQuantityElement())
8643      composeUnsignedInt(t, "Group", "quantity", element.getQuantityElement(), -1);
8644    if (element.hasManagingEntity())
8645      composeReference(t, "Group", "managingEntity", element.getManagingEntity(), -1);
8646    for (int i = 0; i < element.getCharacteristic().size(); i++)
8647      composeGroupGroupCharacteristicComponent(t, "Group", "characteristic", element.getCharacteristic().get(i), i);
8648    for (int i = 0; i < element.getMember().size(); i++)
8649      composeGroupGroupMemberComponent(t, "Group", "member", element.getMember().get(i), i);
8650  }
8651
8652  protected void composeGroupGroupCharacteristicComponent(Complex parent, String parentType, String name,
8653      Group.GroupCharacteristicComponent element, int index) {
8654    if (element == null)
8655      return;
8656    Complex t;
8657    if (Utilities.noString(parentType))
8658      t = parent;
8659    else {
8660      t = parent.predicate("fhir:" + parentType + '.' + name);
8661    }
8662    composeBackboneElement(t, "characteristic", name, element, index);
8663    if (element.hasCode())
8664      composeCodeableConcept(t, "Group", "code", element.getCode(), -1);
8665    if (element.hasValue())
8666      composeType(t, "Group", "value", element.getValue(), -1);
8667    if (element.hasExcludeElement())
8668      composeBoolean(t, "Group", "exclude", element.getExcludeElement(), -1);
8669    if (element.hasPeriod())
8670      composePeriod(t, "Group", "period", element.getPeriod(), -1);
8671  }
8672
8673  protected void composeGroupGroupMemberComponent(Complex parent, String parentType, String name,
8674      Group.GroupMemberComponent element, int index) {
8675    if (element == null)
8676      return;
8677    Complex t;
8678    if (Utilities.noString(parentType))
8679      t = parent;
8680    else {
8681      t = parent.predicate("fhir:" + parentType + '.' + name);
8682    }
8683    composeBackboneElement(t, "member", name, element, index);
8684    if (element.hasEntity())
8685      composeReference(t, "Group", "entity", element.getEntity(), -1);
8686    if (element.hasPeriod())
8687      composePeriod(t, "Group", "period", element.getPeriod(), -1);
8688    if (element.hasInactiveElement())
8689      composeBoolean(t, "Group", "inactive", element.getInactiveElement(), -1);
8690  }
8691
8692  protected void composeGuidanceResponse(Complex parent, String parentType, String name, GuidanceResponse element,
8693      int index) {
8694    if (element == null)
8695      return;
8696    Complex t;
8697    if (Utilities.noString(parentType))
8698      t = parent;
8699    else {
8700      t = parent.predicate("fhir:" + parentType + '.' + name);
8701    }
8702    composeDomainResource(t, "GuidanceResponse", name, element, index);
8703    if (element.hasRequestIdentifier())
8704      composeIdentifier(t, "GuidanceResponse", "requestIdentifier", element.getRequestIdentifier(), -1);
8705    for (int i = 0; i < element.getIdentifier().size(); i++)
8706      composeIdentifier(t, "GuidanceResponse", "identifier", element.getIdentifier().get(i), i);
8707    if (element.hasModule())
8708      composeType(t, "GuidanceResponse", "module", element.getModule(), -1);
8709    if (element.hasStatusElement())
8710      composeEnum(t, "GuidanceResponse", "status", element.getStatusElement(), -1);
8711    if (element.hasSubject())
8712      composeReference(t, "GuidanceResponse", "subject", element.getSubject(), -1);
8713    if (element.hasEncounter())
8714      composeReference(t, "GuidanceResponse", "encounter", element.getEncounter(), -1);
8715    if (element.hasOccurrenceDateTimeElement())
8716      composeDateTime(t, "GuidanceResponse", "occurrenceDateTime", element.getOccurrenceDateTimeElement(), -1);
8717    if (element.hasPerformer())
8718      composeReference(t, "GuidanceResponse", "performer", element.getPerformer(), -1);
8719    for (int i = 0; i < element.getReasonCode().size(); i++)
8720      composeCodeableConcept(t, "GuidanceResponse", "reasonCode", element.getReasonCode().get(i), i);
8721    for (int i = 0; i < element.getReasonReference().size(); i++)
8722      composeReference(t, "GuidanceResponse", "reasonReference", element.getReasonReference().get(i), i);
8723    for (int i = 0; i < element.getNote().size(); i++)
8724      composeAnnotation(t, "GuidanceResponse", "note", element.getNote().get(i), i);
8725    for (int i = 0; i < element.getEvaluationMessage().size(); i++)
8726      composeReference(t, "GuidanceResponse", "evaluationMessage", element.getEvaluationMessage().get(i), i);
8727    if (element.hasOutputParameters())
8728      composeReference(t, "GuidanceResponse", "outputParameters", element.getOutputParameters(), -1);
8729    if (element.hasResult())
8730      composeReference(t, "GuidanceResponse", "result", element.getResult(), -1);
8731    for (int i = 0; i < element.getDataRequirement().size(); i++)
8732      composeDataRequirement(t, "GuidanceResponse", "dataRequirement", element.getDataRequirement().get(i), i);
8733  }
8734
8735  protected void composeHealthcareService(Complex parent, String parentType, String name, HealthcareService element,
8736      int index) {
8737    if (element == null)
8738      return;
8739    Complex t;
8740    if (Utilities.noString(parentType))
8741      t = parent;
8742    else {
8743      t = parent.predicate("fhir:" + parentType + '.' + name);
8744    }
8745    composeDomainResource(t, "HealthcareService", name, element, index);
8746    for (int i = 0; i < element.getIdentifier().size(); i++)
8747      composeIdentifier(t, "HealthcareService", "identifier", element.getIdentifier().get(i), i);
8748    if (element.hasActiveElement())
8749      composeBoolean(t, "HealthcareService", "active", element.getActiveElement(), -1);
8750    if (element.hasProvidedBy())
8751      composeReference(t, "HealthcareService", "providedBy", element.getProvidedBy(), -1);
8752    for (int i = 0; i < element.getCategory().size(); i++)
8753      composeCodeableConcept(t, "HealthcareService", "category", element.getCategory().get(i), i);
8754    for (int i = 0; i < element.getType().size(); i++)
8755      composeCodeableConcept(t, "HealthcareService", "type", element.getType().get(i), i);
8756    for (int i = 0; i < element.getSpecialty().size(); i++)
8757      composeCodeableConcept(t, "HealthcareService", "specialty", element.getSpecialty().get(i), i);
8758    for (int i = 0; i < element.getLocation().size(); i++)
8759      composeReference(t, "HealthcareService", "location", element.getLocation().get(i), i);
8760    if (element.hasNameElement())
8761      composeString(t, "HealthcareService", "name", element.getNameElement(), -1);
8762    if (element.hasCommentElement())
8763      composeString(t, "HealthcareService", "comment", element.getCommentElement(), -1);
8764    if (element.hasExtraDetailsElement())
8765      composeMarkdown(t, "HealthcareService", "extraDetails", element.getExtraDetailsElement(), -1);
8766    if (element.hasPhoto())
8767      composeAttachment(t, "HealthcareService", "photo", element.getPhoto(), -1);
8768    for (int i = 0; i < element.getTelecom().size(); i++)
8769      composeContactPoint(t, "HealthcareService", "telecom", element.getTelecom().get(i), i);
8770    for (int i = 0; i < element.getCoverageArea().size(); i++)
8771      composeReference(t, "HealthcareService", "coverageArea", element.getCoverageArea().get(i), i);
8772    for (int i = 0; i < element.getServiceProvisionCode().size(); i++)
8773      composeCodeableConcept(t, "HealthcareService", "serviceProvisionCode", element.getServiceProvisionCode().get(i),
8774          i);
8775    for (int i = 0; i < element.getEligibility().size(); i++)
8776      composeHealthcareServiceHealthcareServiceEligibilityComponent(t, "HealthcareService", "eligibility",
8777          element.getEligibility().get(i), i);
8778    for (int i = 0; i < element.getProgram().size(); i++)
8779      composeCodeableConcept(t, "HealthcareService", "program", element.getProgram().get(i), i);
8780    for (int i = 0; i < element.getCharacteristic().size(); i++)
8781      composeCodeableConcept(t, "HealthcareService", "characteristic", element.getCharacteristic().get(i), i);
8782    for (int i = 0; i < element.getCommunication().size(); i++)
8783      composeCodeableConcept(t, "HealthcareService", "communication", element.getCommunication().get(i), i);
8784    for (int i = 0; i < element.getReferralMethod().size(); i++)
8785      composeCodeableConcept(t, "HealthcareService", "referralMethod", element.getReferralMethod().get(i), i);
8786    if (element.hasAppointmentRequiredElement())
8787      composeBoolean(t, "HealthcareService", "appointmentRequired", element.getAppointmentRequiredElement(), -1);
8788    for (int i = 0; i < element.getAvailableTime().size(); i++)
8789      composeHealthcareServiceHealthcareServiceAvailableTimeComponent(t, "HealthcareService", "availableTime",
8790          element.getAvailableTime().get(i), i);
8791    for (int i = 0; i < element.getNotAvailable().size(); i++)
8792      composeHealthcareServiceHealthcareServiceNotAvailableComponent(t, "HealthcareService", "notAvailable",
8793          element.getNotAvailable().get(i), i);
8794    if (element.hasAvailabilityExceptionsElement())
8795      composeString(t, "HealthcareService", "availabilityExceptions", element.getAvailabilityExceptionsElement(), -1);
8796    for (int i = 0; i < element.getEndpoint().size(); i++)
8797      composeReference(t, "HealthcareService", "endpoint", element.getEndpoint().get(i), i);
8798  }
8799
8800  protected void composeHealthcareServiceHealthcareServiceEligibilityComponent(Complex parent, String parentType,
8801      String name, HealthcareService.HealthcareServiceEligibilityComponent element, int index) {
8802    if (element == null)
8803      return;
8804    Complex t;
8805    if (Utilities.noString(parentType))
8806      t = parent;
8807    else {
8808      t = parent.predicate("fhir:" + parentType + '.' + name);
8809    }
8810    composeBackboneElement(t, "eligibility", name, element, index);
8811    if (element.hasCode())
8812      composeCodeableConcept(t, "HealthcareService", "code", element.getCode(), -1);
8813    if (element.hasCommentElement())
8814      composeMarkdown(t, "HealthcareService", "comment", element.getCommentElement(), -1);
8815  }
8816
8817  protected void composeHealthcareServiceHealthcareServiceAvailableTimeComponent(Complex parent, String parentType,
8818      String name, HealthcareService.HealthcareServiceAvailableTimeComponent element, int index) {
8819    if (element == null)
8820      return;
8821    Complex t;
8822    if (Utilities.noString(parentType))
8823      t = parent;
8824    else {
8825      t = parent.predicate("fhir:" + parentType + '.' + name);
8826    }
8827    composeBackboneElement(t, "availableTime", name, element, index);
8828    for (int i = 0; i < element.getDaysOfWeek().size(); i++)
8829      composeEnum(t, "HealthcareService", "daysOfWeek", element.getDaysOfWeek().get(i), i);
8830    if (element.hasAllDayElement())
8831      composeBoolean(t, "HealthcareService", "allDay", element.getAllDayElement(), -1);
8832    if (element.hasAvailableStartTimeElement())
8833      composeTime(t, "HealthcareService", "availableStartTime", element.getAvailableStartTimeElement(), -1);
8834    if (element.hasAvailableEndTimeElement())
8835      composeTime(t, "HealthcareService", "availableEndTime", element.getAvailableEndTimeElement(), -1);
8836  }
8837
8838  protected void composeHealthcareServiceHealthcareServiceNotAvailableComponent(Complex parent, String parentType,
8839      String name, HealthcareService.HealthcareServiceNotAvailableComponent element, int index) {
8840    if (element == null)
8841      return;
8842    Complex t;
8843    if (Utilities.noString(parentType))
8844      t = parent;
8845    else {
8846      t = parent.predicate("fhir:" + parentType + '.' + name);
8847    }
8848    composeBackboneElement(t, "notAvailable", name, element, index);
8849    if (element.hasDescriptionElement())
8850      composeString(t, "HealthcareService", "description", element.getDescriptionElement(), -1);
8851    if (element.hasDuring())
8852      composePeriod(t, "HealthcareService", "during", element.getDuring(), -1);
8853  }
8854
8855  protected void composeImagingStudy(Complex parent, String parentType, String name, ImagingStudy element, int index) {
8856    if (element == null)
8857      return;
8858    Complex t;
8859    if (Utilities.noString(parentType))
8860      t = parent;
8861    else {
8862      t = parent.predicate("fhir:" + parentType + '.' + name);
8863    }
8864    composeDomainResource(t, "ImagingStudy", name, element, index);
8865    for (int i = 0; i < element.getIdentifier().size(); i++)
8866      composeIdentifier(t, "ImagingStudy", "identifier", element.getIdentifier().get(i), i);
8867    if (element.hasStatusElement())
8868      composeEnum(t, "ImagingStudy", "status", element.getStatusElement(), -1);
8869    for (int i = 0; i < element.getModality().size(); i++)
8870      composeCoding(t, "ImagingStudy", "modality", element.getModality().get(i), i);
8871    if (element.hasSubject())
8872      composeReference(t, "ImagingStudy", "subject", element.getSubject(), -1);
8873    if (element.hasEncounter())
8874      composeReference(t, "ImagingStudy", "encounter", element.getEncounter(), -1);
8875    if (element.hasStartedElement())
8876      composeDateTime(t, "ImagingStudy", "started", element.getStartedElement(), -1);
8877    for (int i = 0; i < element.getBasedOn().size(); i++)
8878      composeReference(t, "ImagingStudy", "basedOn", element.getBasedOn().get(i), i);
8879    if (element.hasReferrer())
8880      composeReference(t, "ImagingStudy", "referrer", element.getReferrer(), -1);
8881    for (int i = 0; i < element.getInterpreter().size(); i++)
8882      composeReference(t, "ImagingStudy", "interpreter", element.getInterpreter().get(i), i);
8883    for (int i = 0; i < element.getEndpoint().size(); i++)
8884      composeReference(t, "ImagingStudy", "endpoint", element.getEndpoint().get(i), i);
8885    if (element.hasNumberOfSeriesElement())
8886      composeUnsignedInt(t, "ImagingStudy", "numberOfSeries", element.getNumberOfSeriesElement(), -1);
8887    if (element.hasNumberOfInstancesElement())
8888      composeUnsignedInt(t, "ImagingStudy", "numberOfInstances", element.getNumberOfInstancesElement(), -1);
8889    if (element.hasProcedureReference())
8890      composeReference(t, "ImagingStudy", "procedureReference", element.getProcedureReference(), -1);
8891    for (int i = 0; i < element.getProcedureCode().size(); i++)
8892      composeCodeableConcept(t, "ImagingStudy", "procedureCode", element.getProcedureCode().get(i), i);
8893    if (element.hasLocation())
8894      composeReference(t, "ImagingStudy", "location", element.getLocation(), -1);
8895    for (int i = 0; i < element.getReasonCode().size(); i++)
8896      composeCodeableConcept(t, "ImagingStudy", "reasonCode", element.getReasonCode().get(i), i);
8897    for (int i = 0; i < element.getReasonReference().size(); i++)
8898      composeReference(t, "ImagingStudy", "reasonReference", element.getReasonReference().get(i), i);
8899    for (int i = 0; i < element.getNote().size(); i++)
8900      composeAnnotation(t, "ImagingStudy", "note", element.getNote().get(i), i);
8901    if (element.hasDescriptionElement())
8902      composeString(t, "ImagingStudy", "description", element.getDescriptionElement(), -1);
8903    for (int i = 0; i < element.getSeries().size(); i++)
8904      composeImagingStudyImagingStudySeriesComponent(t, "ImagingStudy", "series", element.getSeries().get(i), i);
8905  }
8906
8907  protected void composeImagingStudyImagingStudySeriesComponent(Complex parent, String parentType, String name,
8908      ImagingStudy.ImagingStudySeriesComponent element, int index) {
8909    if (element == null)
8910      return;
8911    Complex t;
8912    if (Utilities.noString(parentType))
8913      t = parent;
8914    else {
8915      t = parent.predicate("fhir:" + parentType + '.' + name);
8916    }
8917    composeBackboneElement(t, "series", name, element, index);
8918    if (element.hasUidElement())
8919      composeId(t, "ImagingStudy", "uid", element.getUidElement(), -1);
8920    if (element.hasNumberElement())
8921      composeUnsignedInt(t, "ImagingStudy", "number", element.getNumberElement(), -1);
8922    if (element.hasModality())
8923      composeCoding(t, "ImagingStudy", "modality", element.getModality(), -1);
8924    if (element.hasDescriptionElement())
8925      composeString(t, "ImagingStudy", "description", element.getDescriptionElement(), -1);
8926    if (element.hasNumberOfInstancesElement())
8927      composeUnsignedInt(t, "ImagingStudy", "numberOfInstances", element.getNumberOfInstancesElement(), -1);
8928    for (int i = 0; i < element.getEndpoint().size(); i++)
8929      composeReference(t, "ImagingStudy", "endpoint", element.getEndpoint().get(i), i);
8930    if (element.hasBodySite())
8931      composeCoding(t, "ImagingStudy", "bodySite", element.getBodySite(), -1);
8932    if (element.hasLaterality())
8933      composeCoding(t, "ImagingStudy", "laterality", element.getLaterality(), -1);
8934    for (int i = 0; i < element.getSpecimen().size(); i++)
8935      composeReference(t, "ImagingStudy", "specimen", element.getSpecimen().get(i), i);
8936    if (element.hasStartedElement())
8937      composeDateTime(t, "ImagingStudy", "started", element.getStartedElement(), -1);
8938    for (int i = 0; i < element.getPerformer().size(); i++)
8939      composeImagingStudyImagingStudySeriesPerformerComponent(t, "ImagingStudy", "performer",
8940          element.getPerformer().get(i), i);
8941    for (int i = 0; i < element.getInstance().size(); i++)
8942      composeImagingStudyImagingStudySeriesInstanceComponent(t, "ImagingStudy", "instance",
8943          element.getInstance().get(i), i);
8944  }
8945
8946  protected void composeImagingStudyImagingStudySeriesPerformerComponent(Complex parent, String parentType, String name,
8947      ImagingStudy.ImagingStudySeriesPerformerComponent element, int index) {
8948    if (element == null)
8949      return;
8950    Complex t;
8951    if (Utilities.noString(parentType))
8952      t = parent;
8953    else {
8954      t = parent.predicate("fhir:" + parentType + '.' + name);
8955    }
8956    composeBackboneElement(t, "performer", name, element, index);
8957    if (element.hasFunction())
8958      composeCodeableConcept(t, "ImagingStudy", "function", element.getFunction(), -1);
8959    if (element.hasActor())
8960      composeReference(t, "ImagingStudy", "actor", element.getActor(), -1);
8961  }
8962
8963  protected void composeImagingStudyImagingStudySeriesInstanceComponent(Complex parent, String parentType, String name,
8964      ImagingStudy.ImagingStudySeriesInstanceComponent element, int index) {
8965    if (element == null)
8966      return;
8967    Complex t;
8968    if (Utilities.noString(parentType))
8969      t = parent;
8970    else {
8971      t = parent.predicate("fhir:" + parentType + '.' + name);
8972    }
8973    composeBackboneElement(t, "instance", name, element, index);
8974    if (element.hasUidElement())
8975      composeId(t, "ImagingStudy", "uid", element.getUidElement(), -1);
8976    if (element.hasSopClass())
8977      composeCoding(t, "ImagingStudy", "sopClass", element.getSopClass(), -1);
8978    if (element.hasNumberElement())
8979      composeUnsignedInt(t, "ImagingStudy", "number", element.getNumberElement(), -1);
8980    if (element.hasTitleElement())
8981      composeString(t, "ImagingStudy", "title", element.getTitleElement(), -1);
8982  }
8983
8984  protected void composeImmunization(Complex parent, String parentType, String name, Immunization element, int index) {
8985    if (element == null)
8986      return;
8987    Complex t;
8988    if (Utilities.noString(parentType))
8989      t = parent;
8990    else {
8991      t = parent.predicate("fhir:" + parentType + '.' + name);
8992    }
8993    composeDomainResource(t, "Immunization", name, element, index);
8994    for (int i = 0; i < element.getIdentifier().size(); i++)
8995      composeIdentifier(t, "Immunization", "identifier", element.getIdentifier().get(i), i);
8996    if (element.hasStatusElement())
8997      composeEnum(t, "Immunization", "status", element.getStatusElement(), -1);
8998    if (element.hasStatusReason())
8999      composeCodeableConcept(t, "Immunization", "statusReason", element.getStatusReason(), -1);
9000    if (element.hasVaccineCode())
9001      composeCodeableConcept(t, "Immunization", "vaccineCode", element.getVaccineCode(), -1);
9002    if (element.hasPatient())
9003      composeReference(t, "Immunization", "patient", element.getPatient(), -1);
9004    if (element.hasEncounter())
9005      composeReference(t, "Immunization", "encounter", element.getEncounter(), -1);
9006    if (element.hasOccurrence())
9007      composeType(t, "Immunization", "occurrence", element.getOccurrence(), -1);
9008    if (element.hasRecordedElement())
9009      composeDateTime(t, "Immunization", "recorded", element.getRecordedElement(), -1);
9010    if (element.hasPrimarySourceElement())
9011      composeBoolean(t, "Immunization", "primarySource", element.getPrimarySourceElement(), -1);
9012    if (element.hasReportOrigin())
9013      composeCodeableConcept(t, "Immunization", "reportOrigin", element.getReportOrigin(), -1);
9014    if (element.hasLocation())
9015      composeReference(t, "Immunization", "location", element.getLocation(), -1);
9016    if (element.hasManufacturer())
9017      composeReference(t, "Immunization", "manufacturer", element.getManufacturer(), -1);
9018    if (element.hasLotNumberElement())
9019      composeString(t, "Immunization", "lotNumber", element.getLotNumberElement(), -1);
9020    if (element.hasExpirationDateElement())
9021      composeDate(t, "Immunization", "expirationDate", element.getExpirationDateElement(), -1);
9022    if (element.hasSite())
9023      composeCodeableConcept(t, "Immunization", "site", element.getSite(), -1);
9024    if (element.hasRoute())
9025      composeCodeableConcept(t, "Immunization", "route", element.getRoute(), -1);
9026    if (element.hasDoseQuantity())
9027      composeQuantity(t, "Immunization", "doseQuantity", element.getDoseQuantity(), -1);
9028    for (int i = 0; i < element.getPerformer().size(); i++)
9029      composeImmunizationImmunizationPerformerComponent(t, "Immunization", "performer", element.getPerformer().get(i),
9030          i);
9031    for (int i = 0; i < element.getNote().size(); i++)
9032      composeAnnotation(t, "Immunization", "note", element.getNote().get(i), i);
9033    for (int i = 0; i < element.getReasonCode().size(); i++)
9034      composeCodeableConcept(t, "Immunization", "reasonCode", element.getReasonCode().get(i), i);
9035    for (int i = 0; i < element.getReasonReference().size(); i++)
9036      composeReference(t, "Immunization", "reasonReference", element.getReasonReference().get(i), i);
9037    if (element.hasIsSubpotentElement())
9038      composeBoolean(t, "Immunization", "isSubpotent", element.getIsSubpotentElement(), -1);
9039    for (int i = 0; i < element.getSubpotentReason().size(); i++)
9040      composeCodeableConcept(t, "Immunization", "subpotentReason", element.getSubpotentReason().get(i), i);
9041    for (int i = 0; i < element.getEducation().size(); i++)
9042      composeImmunizationImmunizationEducationComponent(t, "Immunization", "education", element.getEducation().get(i),
9043          i);
9044    for (int i = 0; i < element.getProgramEligibility().size(); i++)
9045      composeCodeableConcept(t, "Immunization", "programEligibility", element.getProgramEligibility().get(i), i);
9046    if (element.hasFundingSource())
9047      composeCodeableConcept(t, "Immunization", "fundingSource", element.getFundingSource(), -1);
9048    for (int i = 0; i < element.getReaction().size(); i++)
9049      composeImmunizationImmunizationReactionComponent(t, "Immunization", "reaction", element.getReaction().get(i), i);
9050    for (int i = 0; i < element.getProtocolApplied().size(); i++)
9051      composeImmunizationImmunizationProtocolAppliedComponent(t, "Immunization", "protocolApplied",
9052          element.getProtocolApplied().get(i), i);
9053  }
9054
9055  protected void composeImmunizationImmunizationPerformerComponent(Complex parent, String parentType, String name,
9056      Immunization.ImmunizationPerformerComponent element, int index) {
9057    if (element == null)
9058      return;
9059    Complex t;
9060    if (Utilities.noString(parentType))
9061      t = parent;
9062    else {
9063      t = parent.predicate("fhir:" + parentType + '.' + name);
9064    }
9065    composeBackboneElement(t, "performer", name, element, index);
9066    if (element.hasFunction())
9067      composeCodeableConcept(t, "Immunization", "function", element.getFunction(), -1);
9068    if (element.hasActor())
9069      composeReference(t, "Immunization", "actor", element.getActor(), -1);
9070  }
9071
9072  protected void composeImmunizationImmunizationEducationComponent(Complex parent, String parentType, String name,
9073      Immunization.ImmunizationEducationComponent element, int index) {
9074    if (element == null)
9075      return;
9076    Complex t;
9077    if (Utilities.noString(parentType))
9078      t = parent;
9079    else {
9080      t = parent.predicate("fhir:" + parentType + '.' + name);
9081    }
9082    composeBackboneElement(t, "education", name, element, index);
9083    if (element.hasDocumentTypeElement())
9084      composeString(t, "Immunization", "documentType", element.getDocumentTypeElement(), -1);
9085    if (element.hasReferenceElement())
9086      composeUri(t, "Immunization", "reference", element.getReferenceElement(), -1);
9087    if (element.hasPublicationDateElement())
9088      composeDateTime(t, "Immunization", "publicationDate", element.getPublicationDateElement(), -1);
9089    if (element.hasPresentationDateElement())
9090      composeDateTime(t, "Immunization", "presentationDate", element.getPresentationDateElement(), -1);
9091  }
9092
9093  protected void composeImmunizationImmunizationReactionComponent(Complex parent, String parentType, String name,
9094      Immunization.ImmunizationReactionComponent element, int index) {
9095    if (element == null)
9096      return;
9097    Complex t;
9098    if (Utilities.noString(parentType))
9099      t = parent;
9100    else {
9101      t = parent.predicate("fhir:" + parentType + '.' + name);
9102    }
9103    composeBackboneElement(t, "reaction", name, element, index);
9104    if (element.hasDateElement())
9105      composeDateTime(t, "Immunization", "date", element.getDateElement(), -1);
9106    if (element.hasDetail())
9107      composeReference(t, "Immunization", "detail", element.getDetail(), -1);
9108    if (element.hasReportedElement())
9109      composeBoolean(t, "Immunization", "reported", element.getReportedElement(), -1);
9110  }
9111
9112  protected void composeImmunizationImmunizationProtocolAppliedComponent(Complex parent, String parentType, String name,
9113      Immunization.ImmunizationProtocolAppliedComponent element, int index) {
9114    if (element == null)
9115      return;
9116    Complex t;
9117    if (Utilities.noString(parentType))
9118      t = parent;
9119    else {
9120      t = parent.predicate("fhir:" + parentType + '.' + name);
9121    }
9122    composeBackboneElement(t, "protocolApplied", name, element, index);
9123    if (element.hasSeriesElement())
9124      composeString(t, "Immunization", "series", element.getSeriesElement(), -1);
9125    if (element.hasAuthority())
9126      composeReference(t, "Immunization", "authority", element.getAuthority(), -1);
9127    for (int i = 0; i < element.getTargetDisease().size(); i++)
9128      composeCodeableConcept(t, "Immunization", "targetDisease", element.getTargetDisease().get(i), i);
9129    if (element.hasDoseNumber())
9130      composeType(t, "Immunization", "doseNumber", element.getDoseNumber(), -1);
9131    if (element.hasSeriesDoses())
9132      composeType(t, "Immunization", "seriesDoses", element.getSeriesDoses(), -1);
9133  }
9134
9135  protected void composeImmunizationEvaluation(Complex parent, String parentType, String name,
9136      ImmunizationEvaluation element, int index) {
9137    if (element == null)
9138      return;
9139    Complex t;
9140    if (Utilities.noString(parentType))
9141      t = parent;
9142    else {
9143      t = parent.predicate("fhir:" + parentType + '.' + name);
9144    }
9145    composeDomainResource(t, "ImmunizationEvaluation", name, element, index);
9146    for (int i = 0; i < element.getIdentifier().size(); i++)
9147      composeIdentifier(t, "ImmunizationEvaluation", "identifier", element.getIdentifier().get(i), i);
9148    if (element.hasStatusElement())
9149      composeEnum(t, "ImmunizationEvaluation", "status", element.getStatusElement(), -1);
9150    if (element.hasPatient())
9151      composeReference(t, "ImmunizationEvaluation", "patient", element.getPatient(), -1);
9152    if (element.hasDateElement())
9153      composeDateTime(t, "ImmunizationEvaluation", "date", element.getDateElement(), -1);
9154    if (element.hasAuthority())
9155      composeReference(t, "ImmunizationEvaluation", "authority", element.getAuthority(), -1);
9156    if (element.hasTargetDisease())
9157      composeCodeableConcept(t, "ImmunizationEvaluation", "targetDisease", element.getTargetDisease(), -1);
9158    if (element.hasImmunizationEvent())
9159      composeReference(t, "ImmunizationEvaluation", "immunizationEvent", element.getImmunizationEvent(), -1);
9160    if (element.hasDoseStatus())
9161      composeCodeableConcept(t, "ImmunizationEvaluation", "doseStatus", element.getDoseStatus(), -1);
9162    for (int i = 0; i < element.getDoseStatusReason().size(); i++)
9163      composeCodeableConcept(t, "ImmunizationEvaluation", "doseStatusReason", element.getDoseStatusReason().get(i), i);
9164    if (element.hasDescriptionElement())
9165      composeString(t, "ImmunizationEvaluation", "description", element.getDescriptionElement(), -1);
9166    if (element.hasSeriesElement())
9167      composeString(t, "ImmunizationEvaluation", "series", element.getSeriesElement(), -1);
9168    if (element.hasDoseNumber())
9169      composeType(t, "ImmunizationEvaluation", "doseNumber", element.getDoseNumber(), -1);
9170    if (element.hasSeriesDoses())
9171      composeType(t, "ImmunizationEvaluation", "seriesDoses", element.getSeriesDoses(), -1);
9172  }
9173
9174  protected void composeImmunizationRecommendation(Complex parent, String parentType, String name,
9175      ImmunizationRecommendation element, int index) {
9176    if (element == null)
9177      return;
9178    Complex t;
9179    if (Utilities.noString(parentType))
9180      t = parent;
9181    else {
9182      t = parent.predicate("fhir:" + parentType + '.' + name);
9183    }
9184    composeDomainResource(t, "ImmunizationRecommendation", name, element, index);
9185    for (int i = 0; i < element.getIdentifier().size(); i++)
9186      composeIdentifier(t, "ImmunizationRecommendation", "identifier", element.getIdentifier().get(i), i);
9187    if (element.hasPatient())
9188      composeReference(t, "ImmunizationRecommendation", "patient", element.getPatient(), -1);
9189    if (element.hasDateElement())
9190      composeDateTime(t, "ImmunizationRecommendation", "date", element.getDateElement(), -1);
9191    if (element.hasAuthority())
9192      composeReference(t, "ImmunizationRecommendation", "authority", element.getAuthority(), -1);
9193    for (int i = 0; i < element.getRecommendation().size(); i++)
9194      composeImmunizationRecommendationImmunizationRecommendationRecommendationComponent(t,
9195          "ImmunizationRecommendation", "recommendation", element.getRecommendation().get(i), i);
9196  }
9197
9198  protected void composeImmunizationRecommendationImmunizationRecommendationRecommendationComponent(Complex parent,
9199      String parentType, String name,
9200      ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent element, int index) {
9201    if (element == null)
9202      return;
9203    Complex t;
9204    if (Utilities.noString(parentType))
9205      t = parent;
9206    else {
9207      t = parent.predicate("fhir:" + parentType + '.' + name);
9208    }
9209    composeBackboneElement(t, "recommendation", name, element, index);
9210    for (int i = 0; i < element.getVaccineCode().size(); i++)
9211      composeCodeableConcept(t, "ImmunizationRecommendation", "vaccineCode", element.getVaccineCode().get(i), i);
9212    if (element.hasTargetDisease())
9213      composeCodeableConcept(t, "ImmunizationRecommendation", "targetDisease", element.getTargetDisease(), -1);
9214    for (int i = 0; i < element.getContraindicatedVaccineCode().size(); i++)
9215      composeCodeableConcept(t, "ImmunizationRecommendation", "contraindicatedVaccineCode",
9216          element.getContraindicatedVaccineCode().get(i), i);
9217    if (element.hasForecastStatus())
9218      composeCodeableConcept(t, "ImmunizationRecommendation", "forecastStatus", element.getForecastStatus(), -1);
9219    for (int i = 0; i < element.getForecastReason().size(); i++)
9220      composeCodeableConcept(t, "ImmunizationRecommendation", "forecastReason", element.getForecastReason().get(i), i);
9221    for (int i = 0; i < element.getDateCriterion().size(); i++)
9222      composeImmunizationRecommendationImmunizationRecommendationRecommendationDateCriterionComponent(t,
9223          "ImmunizationRecommendation", "dateCriterion", element.getDateCriterion().get(i), i);
9224    if (element.hasDescriptionElement())
9225      composeString(t, "ImmunizationRecommendation", "description", element.getDescriptionElement(), -1);
9226    if (element.hasSeriesElement())
9227      composeString(t, "ImmunizationRecommendation", "series", element.getSeriesElement(), -1);
9228    if (element.hasDoseNumber())
9229      composeType(t, "ImmunizationRecommendation", "doseNumber", element.getDoseNumber(), -1);
9230    if (element.hasSeriesDoses())
9231      composeType(t, "ImmunizationRecommendation", "seriesDoses", element.getSeriesDoses(), -1);
9232    for (int i = 0; i < element.getSupportingImmunization().size(); i++)
9233      composeReference(t, "ImmunizationRecommendation", "supportingImmunization",
9234          element.getSupportingImmunization().get(i), i);
9235    for (int i = 0; i < element.getSupportingPatientInformation().size(); i++)
9236      composeReference(t, "ImmunizationRecommendation", "supportingPatientInformation",
9237          element.getSupportingPatientInformation().get(i), i);
9238  }
9239
9240  protected void composeImmunizationRecommendationImmunizationRecommendationRecommendationDateCriterionComponent(
9241      Complex parent, String parentType, String name,
9242      ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent element, int index) {
9243    if (element == null)
9244      return;
9245    Complex t;
9246    if (Utilities.noString(parentType))
9247      t = parent;
9248    else {
9249      t = parent.predicate("fhir:" + parentType + '.' + name);
9250    }
9251    composeBackboneElement(t, "dateCriterion", name, element, index);
9252    if (element.hasCode())
9253      composeCodeableConcept(t, "ImmunizationRecommendation", "code", element.getCode(), -1);
9254    if (element.hasValueElement())
9255      composeDateTime(t, "ImmunizationRecommendation", "value", element.getValueElement(), -1);
9256  }
9257
9258  protected void composeImplementationGuide(Complex parent, String parentType, String name, ImplementationGuide element,
9259      int index) {
9260    if (element == null)
9261      return;
9262    Complex t;
9263    if (Utilities.noString(parentType))
9264      t = parent;
9265    else {
9266      t = parent.predicate("fhir:" + parentType + '.' + name);
9267    }
9268    composeDomainResource(t, "ImplementationGuide", name, element, index);
9269    if (element.hasUrlElement())
9270      composeUri(t, "ImplementationGuide", "url", element.getUrlElement(), -1);
9271    if (element.hasVersionElement())
9272      composeString(t, "ImplementationGuide", "version", element.getVersionElement(), -1);
9273    if (element.hasNameElement())
9274      composeString(t, "ImplementationGuide", "name", element.getNameElement(), -1);
9275    if (element.hasTitleElement())
9276      composeString(t, "ImplementationGuide", "title", element.getTitleElement(), -1);
9277    if (element.hasStatusElement())
9278      composeEnum(t, "ImplementationGuide", "status", element.getStatusElement(), -1);
9279    if (element.hasExperimentalElement())
9280      composeBoolean(t, "ImplementationGuide", "experimental", element.getExperimentalElement(), -1);
9281    if (element.hasDateElement())
9282      composeDateTime(t, "ImplementationGuide", "date", element.getDateElement(), -1);
9283    if (element.hasPublisherElement())
9284      composeString(t, "ImplementationGuide", "publisher", element.getPublisherElement(), -1);
9285    for (int i = 0; i < element.getContact().size(); i++)
9286      composeContactDetail(t, "ImplementationGuide", "contact", element.getContact().get(i), i);
9287    if (element.hasDescriptionElement())
9288      composeMarkdown(t, "ImplementationGuide", "description", element.getDescriptionElement(), -1);
9289    for (int i = 0; i < element.getUseContext().size(); i++)
9290      composeUsageContext(t, "ImplementationGuide", "useContext", element.getUseContext().get(i), i);
9291    for (int i = 0; i < element.getJurisdiction().size(); i++)
9292      composeCodeableConcept(t, "ImplementationGuide", "jurisdiction", element.getJurisdiction().get(i), i);
9293    if (element.hasCopyrightElement())
9294      composeMarkdown(t, "ImplementationGuide", "copyright", element.getCopyrightElement(), -1);
9295    if (element.hasPackageIdElement())
9296      composeId(t, "ImplementationGuide", "packageId", element.getPackageIdElement(), -1);
9297    if (element.hasLicenseElement())
9298      composeEnum(t, "ImplementationGuide", "license", element.getLicenseElement(), -1);
9299    for (int i = 0; i < element.getFhirVersion().size(); i++)
9300      composeEnum(t, "ImplementationGuide", "fhirVersion", element.getFhirVersion().get(i), i);
9301    for (int i = 0; i < element.getDependsOn().size(); i++)
9302      composeImplementationGuideImplementationGuideDependsOnComponent(t, "ImplementationGuide", "dependsOn",
9303          element.getDependsOn().get(i), i);
9304    for (int i = 0; i < element.getGlobal().size(); i++)
9305      composeImplementationGuideImplementationGuideGlobalComponent(t, "ImplementationGuide", "global",
9306          element.getGlobal().get(i), i);
9307    if (element.hasDefinition())
9308      composeImplementationGuideImplementationGuideDefinitionComponent(t, "ImplementationGuide", "definition",
9309          element.getDefinition(), -1);
9310    if (element.hasManifest())
9311      composeImplementationGuideImplementationGuideManifestComponent(t, "ImplementationGuide", "manifest",
9312          element.getManifest(), -1);
9313  }
9314
9315  protected void composeImplementationGuideImplementationGuideDependsOnComponent(Complex parent, String parentType,
9316      String name, ImplementationGuide.ImplementationGuideDependsOnComponent element, int index) {
9317    if (element == null)
9318      return;
9319    Complex t;
9320    if (Utilities.noString(parentType))
9321      t = parent;
9322    else {
9323      t = parent.predicate("fhir:" + parentType + '.' + name);
9324    }
9325    composeBackboneElement(t, "dependsOn", name, element, index);
9326    if (element.hasUriElement())
9327      composeCanonical(t, "ImplementationGuide", "uri", element.getUriElement(), -1);
9328    if (element.hasPackageIdElement())
9329      composeId(t, "ImplementationGuide", "packageId", element.getPackageIdElement(), -1);
9330    if (element.hasVersionElement())
9331      composeString(t, "ImplementationGuide", "version", element.getVersionElement(), -1);
9332  }
9333
9334  protected void composeImplementationGuideImplementationGuideGlobalComponent(Complex parent, String parentType,
9335      String name, ImplementationGuide.ImplementationGuideGlobalComponent element, int index) {
9336    if (element == null)
9337      return;
9338    Complex t;
9339    if (Utilities.noString(parentType))
9340      t = parent;
9341    else {
9342      t = parent.predicate("fhir:" + parentType + '.' + name);
9343    }
9344    composeBackboneElement(t, "global", name, element, index);
9345    if (element.hasTypeElement())
9346      composeCode(t, "ImplementationGuide", "type", element.getTypeElement(), -1);
9347    if (element.hasProfileElement())
9348      composeCanonical(t, "ImplementationGuide", "profile", element.getProfileElement(), -1);
9349  }
9350
9351  protected void composeImplementationGuideImplementationGuideDefinitionComponent(Complex parent, String parentType,
9352      String name, ImplementationGuide.ImplementationGuideDefinitionComponent element, int index) {
9353    if (element == null)
9354      return;
9355    Complex t;
9356    if (Utilities.noString(parentType))
9357      t = parent;
9358    else {
9359      t = parent.predicate("fhir:" + parentType + '.' + name);
9360    }
9361    composeBackboneElement(t, "definition", name, element, index);
9362    for (int i = 0; i < element.getGrouping().size(); i++)
9363      composeImplementationGuideImplementationGuideDefinitionGroupingComponent(t, "ImplementationGuide", "grouping",
9364          element.getGrouping().get(i), i);
9365    for (int i = 0; i < element.getResource().size(); i++)
9366      composeImplementationGuideImplementationGuideDefinitionResourceComponent(t, "ImplementationGuide", "resource",
9367          element.getResource().get(i), i);
9368    if (element.hasPage())
9369      composeImplementationGuideImplementationGuideDefinitionPageComponent(t, "ImplementationGuide", "page",
9370          element.getPage(), -1);
9371    for (int i = 0; i < element.getParameter().size(); i++)
9372      composeImplementationGuideImplementationGuideDefinitionParameterComponent(t, "ImplementationGuide", "parameter",
9373          element.getParameter().get(i), i);
9374    for (int i = 0; i < element.getTemplate().size(); i++)
9375      composeImplementationGuideImplementationGuideDefinitionTemplateComponent(t, "ImplementationGuide", "template",
9376          element.getTemplate().get(i), i);
9377  }
9378
9379  protected void composeImplementationGuideImplementationGuideDefinitionGroupingComponent(Complex parent,
9380      String parentType, String name, ImplementationGuide.ImplementationGuideDefinitionGroupingComponent element,
9381      int index) {
9382    if (element == null)
9383      return;
9384    Complex t;
9385    if (Utilities.noString(parentType))
9386      t = parent;
9387    else {
9388      t = parent.predicate("fhir:" + parentType + '.' + name);
9389    }
9390    composeBackboneElement(t, "grouping", name, element, index);
9391    if (element.hasNameElement())
9392      composeString(t, "ImplementationGuide", "name", element.getNameElement(), -1);
9393    if (element.hasDescriptionElement())
9394      composeString(t, "ImplementationGuide", "description", element.getDescriptionElement(), -1);
9395  }
9396
9397  protected void composeImplementationGuideImplementationGuideDefinitionResourceComponent(Complex parent,
9398      String parentType, String name, ImplementationGuide.ImplementationGuideDefinitionResourceComponent element,
9399      int index) {
9400    if (element == null)
9401      return;
9402    Complex t;
9403    if (Utilities.noString(parentType))
9404      t = parent;
9405    else {
9406      t = parent.predicate("fhir:" + parentType + '.' + name);
9407    }
9408    composeBackboneElement(t, "resource", name, element, index);
9409    if (element.hasReference())
9410      composeReference(t, "ImplementationGuide", "reference", element.getReference(), -1);
9411    for (int i = 0; i < element.getFhirVersion().size(); i++)
9412      composeEnum(t, "ImplementationGuide", "fhirVersion", element.getFhirVersion().get(i), i);
9413    if (element.hasNameElement())
9414      composeString(t, "ImplementationGuide", "name", element.getNameElement(), -1);
9415    if (element.hasDescriptionElement())
9416      composeString(t, "ImplementationGuide", "description", element.getDescriptionElement(), -1);
9417    if (element.hasExample())
9418      composeType(t, "ImplementationGuide", "example", element.getExample(), -1);
9419    if (element.hasGroupingIdElement())
9420      composeId(t, "ImplementationGuide", "groupingId", element.getGroupingIdElement(), -1);
9421  }
9422
9423  protected void composeImplementationGuideImplementationGuideDefinitionPageComponent(Complex parent, String parentType,
9424      String name, ImplementationGuide.ImplementationGuideDefinitionPageComponent element, int index) {
9425    if (element == null)
9426      return;
9427    Complex t;
9428    if (Utilities.noString(parentType))
9429      t = parent;
9430    else {
9431      t = parent.predicate("fhir:" + parentType + '.' + name);
9432    }
9433    composeBackboneElement(t, "page", name, element, index);
9434    if (element.hasName())
9435      composeType(t, "ImplementationGuide", "name", element.getName(), -1);
9436    if (element.hasTitleElement())
9437      composeString(t, "ImplementationGuide", "title", element.getTitleElement(), -1);
9438    if (element.hasGenerationElement())
9439      composeEnum(t, "ImplementationGuide", "generation", element.getGenerationElement(), -1);
9440    for (int i = 0; i < element.getPage().size(); i++)
9441      composeImplementationGuideImplementationGuideDefinitionPageComponent(t, "ImplementationGuide", "page",
9442          element.getPage().get(i), i);
9443  }
9444
9445  protected void composeImplementationGuideImplementationGuideDefinitionParameterComponent(Complex parent,
9446      String parentType, String name, ImplementationGuide.ImplementationGuideDefinitionParameterComponent element,
9447      int index) {
9448    if (element == null)
9449      return;
9450    Complex t;
9451    if (Utilities.noString(parentType))
9452      t = parent;
9453    else {
9454      t = parent.predicate("fhir:" + parentType + '.' + name);
9455    }
9456    composeBackboneElement(t, "parameter", name, element, index);
9457    if (element.hasCodeElement())
9458      composeString(t, "ImplementationGuide", "code", element.getCodeElement(), -1);
9459    if (element.hasValueElement())
9460      composeString(t, "ImplementationGuide", "value", element.getValueElement(), -1);
9461  }
9462
9463  protected void composeImplementationGuideImplementationGuideDefinitionTemplateComponent(Complex parent,
9464      String parentType, String name, ImplementationGuide.ImplementationGuideDefinitionTemplateComponent element,
9465      int index) {
9466    if (element == null)
9467      return;
9468    Complex t;
9469    if (Utilities.noString(parentType))
9470      t = parent;
9471    else {
9472      t = parent.predicate("fhir:" + parentType + '.' + name);
9473    }
9474    composeBackboneElement(t, "template", name, element, index);
9475    if (element.hasCodeElement())
9476      composeCode(t, "ImplementationGuide", "code", element.getCodeElement(), -1);
9477    if (element.hasSourceElement())
9478      composeString(t, "ImplementationGuide", "source", element.getSourceElement(), -1);
9479    if (element.hasScopeElement())
9480      composeString(t, "ImplementationGuide", "scope", element.getScopeElement(), -1);
9481  }
9482
9483  protected void composeImplementationGuideImplementationGuideManifestComponent(Complex parent, String parentType,
9484      String name, ImplementationGuide.ImplementationGuideManifestComponent element, int index) {
9485    if (element == null)
9486      return;
9487    Complex t;
9488    if (Utilities.noString(parentType))
9489      t = parent;
9490    else {
9491      t = parent.predicate("fhir:" + parentType + '.' + name);
9492    }
9493    composeBackboneElement(t, "manifest", name, element, index);
9494    if (element.hasRenderingElement())
9495      composeUrl(t, "ImplementationGuide", "rendering", element.getRenderingElement(), -1);
9496    for (int i = 0; i < element.getResource().size(); i++)
9497      composeImplementationGuideManifestResourceComponent(t, "ImplementationGuide", "resource",
9498          element.getResource().get(i), i);
9499    for (int i = 0; i < element.getPage().size(); i++)
9500      composeImplementationGuideManifestPageComponent(t, "ImplementationGuide", "page", element.getPage().get(i), i);
9501    for (int i = 0; i < element.getImage().size(); i++)
9502      composeString(t, "ImplementationGuide", "image", element.getImage().get(i), i);
9503    for (int i = 0; i < element.getOther().size(); i++)
9504      composeString(t, "ImplementationGuide", "other", element.getOther().get(i), i);
9505  }
9506
9507  protected void composeImplementationGuideManifestResourceComponent(Complex parent, String parentType, String name,
9508      ImplementationGuide.ManifestResourceComponent element, int index) {
9509    if (element == null)
9510      return;
9511    Complex t;
9512    if (Utilities.noString(parentType))
9513      t = parent;
9514    else {
9515      t = parent.predicate("fhir:" + parentType + '.' + name);
9516    }
9517    composeBackboneElement(t, "resource", name, element, index);
9518    if (element.hasReference())
9519      composeReference(t, "ImplementationGuide", "reference", element.getReference(), -1);
9520    if (element.hasExample())
9521      composeType(t, "ImplementationGuide", "example", element.getExample(), -1);
9522    if (element.hasRelativePathElement())
9523      composeUrl(t, "ImplementationGuide", "relativePath", element.getRelativePathElement(), -1);
9524  }
9525
9526  protected void composeImplementationGuideManifestPageComponent(Complex parent, String parentType, String name,
9527      ImplementationGuide.ManifestPageComponent element, int index) {
9528    if (element == null)
9529      return;
9530    Complex t;
9531    if (Utilities.noString(parentType))
9532      t = parent;
9533    else {
9534      t = parent.predicate("fhir:" + parentType + '.' + name);
9535    }
9536    composeBackboneElement(t, "page", name, element, index);
9537    if (element.hasNameElement())
9538      composeString(t, "ImplementationGuide", "name", element.getNameElement(), -1);
9539    if (element.hasTitleElement())
9540      composeString(t, "ImplementationGuide", "title", element.getTitleElement(), -1);
9541    for (int i = 0; i < element.getAnchor().size(); i++)
9542      composeString(t, "ImplementationGuide", "anchor", element.getAnchor().get(i), i);
9543  }
9544
9545  protected void composeInsurancePlan(Complex parent, String parentType, String name, InsurancePlan element,
9546      int index) {
9547    if (element == null)
9548      return;
9549    Complex t;
9550    if (Utilities.noString(parentType))
9551      t = parent;
9552    else {
9553      t = parent.predicate("fhir:" + parentType + '.' + name);
9554    }
9555    composeDomainResource(t, "InsurancePlan", name, element, index);
9556    for (int i = 0; i < element.getIdentifier().size(); i++)
9557      composeIdentifier(t, "InsurancePlan", "identifier", element.getIdentifier().get(i), i);
9558    if (element.hasStatusElement())
9559      composeEnum(t, "InsurancePlan", "status", element.getStatusElement(), -1);
9560    for (int i = 0; i < element.getType().size(); i++)
9561      composeCodeableConcept(t, "InsurancePlan", "type", element.getType().get(i), i);
9562    if (element.hasNameElement())
9563      composeString(t, "InsurancePlan", "name", element.getNameElement(), -1);
9564    for (int i = 0; i < element.getAlias().size(); i++)
9565      composeString(t, "InsurancePlan", "alias", element.getAlias().get(i), i);
9566    if (element.hasPeriod())
9567      composePeriod(t, "InsurancePlan", "period", element.getPeriod(), -1);
9568    if (element.hasOwnedBy())
9569      composeReference(t, "InsurancePlan", "ownedBy", element.getOwnedBy(), -1);
9570    if (element.hasAdministeredBy())
9571      composeReference(t, "InsurancePlan", "administeredBy", element.getAdministeredBy(), -1);
9572    for (int i = 0; i < element.getCoverageArea().size(); i++)
9573      composeReference(t, "InsurancePlan", "coverageArea", element.getCoverageArea().get(i), i);
9574    for (int i = 0; i < element.getContact().size(); i++)
9575      composeInsurancePlanInsurancePlanContactComponent(t, "InsurancePlan", "contact", element.getContact().get(i), i);
9576    for (int i = 0; i < element.getEndpoint().size(); i++)
9577      composeReference(t, "InsurancePlan", "endpoint", element.getEndpoint().get(i), i);
9578    for (int i = 0; i < element.getNetwork().size(); i++)
9579      composeReference(t, "InsurancePlan", "network", element.getNetwork().get(i), i);
9580    for (int i = 0; i < element.getCoverage().size(); i++)
9581      composeInsurancePlanInsurancePlanCoverageComponent(t, "InsurancePlan", "coverage", element.getCoverage().get(i),
9582          i);
9583    for (int i = 0; i < element.getPlan().size(); i++)
9584      composeInsurancePlanInsurancePlanPlanComponent(t, "InsurancePlan", "plan", element.getPlan().get(i), i);
9585  }
9586
9587  protected void composeInsurancePlanInsurancePlanContactComponent(Complex parent, String parentType, String name,
9588      InsurancePlan.InsurancePlanContactComponent element, int index) {
9589    if (element == null)
9590      return;
9591    Complex t;
9592    if (Utilities.noString(parentType))
9593      t = parent;
9594    else {
9595      t = parent.predicate("fhir:" + parentType + '.' + name);
9596    }
9597    composeBackboneElement(t, "contact", name, element, index);
9598    if (element.hasPurpose())
9599      composeCodeableConcept(t, "InsurancePlan", "purpose", element.getPurpose(), -1);
9600    if (element.hasName())
9601      composeHumanName(t, "InsurancePlan", "name", element.getName(), -1);
9602    for (int i = 0; i < element.getTelecom().size(); i++)
9603      composeContactPoint(t, "InsurancePlan", "telecom", element.getTelecom().get(i), i);
9604    if (element.hasAddress())
9605      composeAddress(t, "InsurancePlan", "address", element.getAddress(), -1);
9606  }
9607
9608  protected void composeInsurancePlanInsurancePlanCoverageComponent(Complex parent, String parentType, String name,
9609      InsurancePlan.InsurancePlanCoverageComponent element, int index) {
9610    if (element == null)
9611      return;
9612    Complex t;
9613    if (Utilities.noString(parentType))
9614      t = parent;
9615    else {
9616      t = parent.predicate("fhir:" + parentType + '.' + name);
9617    }
9618    composeBackboneElement(t, "coverage", name, element, index);
9619    if (element.hasType())
9620      composeCodeableConcept(t, "InsurancePlan", "type", element.getType(), -1);
9621    for (int i = 0; i < element.getNetwork().size(); i++)
9622      composeReference(t, "InsurancePlan", "network", element.getNetwork().get(i), i);
9623    for (int i = 0; i < element.getBenefit().size(); i++)
9624      composeInsurancePlanCoverageBenefitComponent(t, "InsurancePlan", "benefit", element.getBenefit().get(i), i);
9625  }
9626
9627  protected void composeInsurancePlanCoverageBenefitComponent(Complex parent, String parentType, String name,
9628      InsurancePlan.CoverageBenefitComponent element, int index) {
9629    if (element == null)
9630      return;
9631    Complex t;
9632    if (Utilities.noString(parentType))
9633      t = parent;
9634    else {
9635      t = parent.predicate("fhir:" + parentType + '.' + name);
9636    }
9637    composeBackboneElement(t, "benefit", name, element, index);
9638    if (element.hasType())
9639      composeCodeableConcept(t, "InsurancePlan", "type", element.getType(), -1);
9640    if (element.hasRequirementElement())
9641      composeString(t, "InsurancePlan", "requirement", element.getRequirementElement(), -1);
9642    for (int i = 0; i < element.getLimit().size(); i++)
9643      composeInsurancePlanCoverageBenefitLimitComponent(t, "InsurancePlan", "limit", element.getLimit().get(i), i);
9644  }
9645
9646  protected void composeInsurancePlanCoverageBenefitLimitComponent(Complex parent, String parentType, String name,
9647      InsurancePlan.CoverageBenefitLimitComponent element, int index) {
9648    if (element == null)
9649      return;
9650    Complex t;
9651    if (Utilities.noString(parentType))
9652      t = parent;
9653    else {
9654      t = parent.predicate("fhir:" + parentType + '.' + name);
9655    }
9656    composeBackboneElement(t, "limit", name, element, index);
9657    if (element.hasValue())
9658      composeQuantity(t, "InsurancePlan", "value", element.getValue(), -1);
9659    if (element.hasCode())
9660      composeCodeableConcept(t, "InsurancePlan", "code", element.getCode(), -1);
9661  }
9662
9663  protected void composeInsurancePlanInsurancePlanPlanComponent(Complex parent, String parentType, String name,
9664      InsurancePlan.InsurancePlanPlanComponent element, int index) {
9665    if (element == null)
9666      return;
9667    Complex t;
9668    if (Utilities.noString(parentType))
9669      t = parent;
9670    else {
9671      t = parent.predicate("fhir:" + parentType + '.' + name);
9672    }
9673    composeBackboneElement(t, "plan", name, element, index);
9674    for (int i = 0; i < element.getIdentifier().size(); i++)
9675      composeIdentifier(t, "InsurancePlan", "identifier", element.getIdentifier().get(i), i);
9676    if (element.hasType())
9677      composeCodeableConcept(t, "InsurancePlan", "type", element.getType(), -1);
9678    for (int i = 0; i < element.getCoverageArea().size(); i++)
9679      composeReference(t, "InsurancePlan", "coverageArea", element.getCoverageArea().get(i), i);
9680    for (int i = 0; i < element.getNetwork().size(); i++)
9681      composeReference(t, "InsurancePlan", "network", element.getNetwork().get(i), i);
9682    for (int i = 0; i < element.getGeneralCost().size(); i++)
9683      composeInsurancePlanInsurancePlanPlanGeneralCostComponent(t, "InsurancePlan", "generalCost",
9684          element.getGeneralCost().get(i), i);
9685    for (int i = 0; i < element.getSpecificCost().size(); i++)
9686      composeInsurancePlanInsurancePlanPlanSpecificCostComponent(t, "InsurancePlan", "specificCost",
9687          element.getSpecificCost().get(i), i);
9688  }
9689
9690  protected void composeInsurancePlanInsurancePlanPlanGeneralCostComponent(Complex parent, String parentType,
9691      String name, InsurancePlan.InsurancePlanPlanGeneralCostComponent element, int index) {
9692    if (element == null)
9693      return;
9694    Complex t;
9695    if (Utilities.noString(parentType))
9696      t = parent;
9697    else {
9698      t = parent.predicate("fhir:" + parentType + '.' + name);
9699    }
9700    composeBackboneElement(t, "generalCost", name, element, index);
9701    if (element.hasType())
9702      composeCodeableConcept(t, "InsurancePlan", "type", element.getType(), -1);
9703    if (element.hasGroupSizeElement())
9704      composePositiveInt(t, "InsurancePlan", "groupSize", element.getGroupSizeElement(), -1);
9705    if (element.hasCost())
9706      composeMoney(t, "InsurancePlan", "cost", element.getCost(), -1);
9707    if (element.hasCommentElement())
9708      composeString(t, "InsurancePlan", "comment", element.getCommentElement(), -1);
9709  }
9710
9711  protected void composeInsurancePlanInsurancePlanPlanSpecificCostComponent(Complex parent, String parentType,
9712      String name, InsurancePlan.InsurancePlanPlanSpecificCostComponent element, int index) {
9713    if (element == null)
9714      return;
9715    Complex t;
9716    if (Utilities.noString(parentType))
9717      t = parent;
9718    else {
9719      t = parent.predicate("fhir:" + parentType + '.' + name);
9720    }
9721    composeBackboneElement(t, "specificCost", name, element, index);
9722    if (element.hasCategory())
9723      composeCodeableConcept(t, "InsurancePlan", "category", element.getCategory(), -1);
9724    for (int i = 0; i < element.getBenefit().size(); i++)
9725      composeInsurancePlanPlanBenefitComponent(t, "InsurancePlan", "benefit", element.getBenefit().get(i), i);
9726  }
9727
9728  protected void composeInsurancePlanPlanBenefitComponent(Complex parent, String parentType, String name,
9729      InsurancePlan.PlanBenefitComponent element, int index) {
9730    if (element == null)
9731      return;
9732    Complex t;
9733    if (Utilities.noString(parentType))
9734      t = parent;
9735    else {
9736      t = parent.predicate("fhir:" + parentType + '.' + name);
9737    }
9738    composeBackboneElement(t, "benefit", name, element, index);
9739    if (element.hasType())
9740      composeCodeableConcept(t, "InsurancePlan", "type", element.getType(), -1);
9741    for (int i = 0; i < element.getCost().size(); i++)
9742      composeInsurancePlanPlanBenefitCostComponent(t, "InsurancePlan", "cost", element.getCost().get(i), i);
9743  }
9744
9745  protected void composeInsurancePlanPlanBenefitCostComponent(Complex parent, String parentType, String name,
9746      InsurancePlan.PlanBenefitCostComponent element, int index) {
9747    if (element == null)
9748      return;
9749    Complex t;
9750    if (Utilities.noString(parentType))
9751      t = parent;
9752    else {
9753      t = parent.predicate("fhir:" + parentType + '.' + name);
9754    }
9755    composeBackboneElement(t, "cost", name, element, index);
9756    if (element.hasType())
9757      composeCodeableConcept(t, "InsurancePlan", "type", element.getType(), -1);
9758    if (element.hasApplicability())
9759      composeCodeableConcept(t, "InsurancePlan", "applicability", element.getApplicability(), -1);
9760    for (int i = 0; i < element.getQualifiers().size(); i++)
9761      composeCodeableConcept(t, "InsurancePlan", "qualifiers", element.getQualifiers().get(i), i);
9762    if (element.hasValue())
9763      composeQuantity(t, "InsurancePlan", "value", element.getValue(), -1);
9764  }
9765
9766  protected void composeInvoice(Complex parent, String parentType, String name, Invoice element, int index) {
9767    if (element == null)
9768      return;
9769    Complex t;
9770    if (Utilities.noString(parentType))
9771      t = parent;
9772    else {
9773      t = parent.predicate("fhir:" + parentType + '.' + name);
9774    }
9775    composeDomainResource(t, "Invoice", name, element, index);
9776    for (int i = 0; i < element.getIdentifier().size(); i++)
9777      composeIdentifier(t, "Invoice", "identifier", element.getIdentifier().get(i), i);
9778    if (element.hasStatusElement())
9779      composeEnum(t, "Invoice", "status", element.getStatusElement(), -1);
9780    if (element.hasCancelledReasonElement())
9781      composeString(t, "Invoice", "cancelledReason", element.getCancelledReasonElement(), -1);
9782    if (element.hasType())
9783      composeCodeableConcept(t, "Invoice", "type", element.getType(), -1);
9784    if (element.hasSubject())
9785      composeReference(t, "Invoice", "subject", element.getSubject(), -1);
9786    if (element.hasRecipient())
9787      composeReference(t, "Invoice", "recipient", element.getRecipient(), -1);
9788    if (element.hasDateElement())
9789      composeDateTime(t, "Invoice", "date", element.getDateElement(), -1);
9790    for (int i = 0; i < element.getParticipant().size(); i++)
9791      composeInvoiceInvoiceParticipantComponent(t, "Invoice", "participant", element.getParticipant().get(i), i);
9792    if (element.hasIssuer())
9793      composeReference(t, "Invoice", "issuer", element.getIssuer(), -1);
9794    if (element.hasAccount())
9795      composeReference(t, "Invoice", "account", element.getAccount(), -1);
9796    for (int i = 0; i < element.getLineItem().size(); i++)
9797      composeInvoiceInvoiceLineItemComponent(t, "Invoice", "lineItem", element.getLineItem().get(i), i);
9798    for (int i = 0; i < element.getTotalPriceComponent().size(); i++)
9799      composeInvoiceInvoiceLineItemPriceComponentComponent(t, "Invoice", "totalPriceComponent",
9800          element.getTotalPriceComponent().get(i), i);
9801    if (element.hasTotalNet())
9802      composeMoney(t, "Invoice", "totalNet", element.getTotalNet(), -1);
9803    if (element.hasTotalGross())
9804      composeMoney(t, "Invoice", "totalGross", element.getTotalGross(), -1);
9805    if (element.hasPaymentTermsElement())
9806      composeMarkdown(t, "Invoice", "paymentTerms", element.getPaymentTermsElement(), -1);
9807    for (int i = 0; i < element.getNote().size(); i++)
9808      composeAnnotation(t, "Invoice", "note", element.getNote().get(i), i);
9809  }
9810
9811  protected void composeInvoiceInvoiceParticipantComponent(Complex parent, String parentType, String name,
9812      Invoice.InvoiceParticipantComponent element, int index) {
9813    if (element == null)
9814      return;
9815    Complex t;
9816    if (Utilities.noString(parentType))
9817      t = parent;
9818    else {
9819      t = parent.predicate("fhir:" + parentType + '.' + name);
9820    }
9821    composeBackboneElement(t, "participant", name, element, index);
9822    if (element.hasRole())
9823      composeCodeableConcept(t, "Invoice", "role", element.getRole(), -1);
9824    if (element.hasActor())
9825      composeReference(t, "Invoice", "actor", element.getActor(), -1);
9826  }
9827
9828  protected void composeInvoiceInvoiceLineItemComponent(Complex parent, String parentType, String name,
9829      Invoice.InvoiceLineItemComponent element, int index) {
9830    if (element == null)
9831      return;
9832    Complex t;
9833    if (Utilities.noString(parentType))
9834      t = parent;
9835    else {
9836      t = parent.predicate("fhir:" + parentType + '.' + name);
9837    }
9838    composeBackboneElement(t, "lineItem", name, element, index);
9839    if (element.hasSequenceElement())
9840      composePositiveInt(t, "Invoice", "sequence", element.getSequenceElement(), -1);
9841    if (element.hasChargeItem())
9842      composeType(t, "Invoice", "chargeItem", element.getChargeItem(), -1);
9843    for (int i = 0; i < element.getPriceComponent().size(); i++)
9844      composeInvoiceInvoiceLineItemPriceComponentComponent(t, "Invoice", "priceComponent",
9845          element.getPriceComponent().get(i), i);
9846  }
9847
9848  protected void composeInvoiceInvoiceLineItemPriceComponentComponent(Complex parent, String parentType, String name,
9849      Invoice.InvoiceLineItemPriceComponentComponent element, int index) {
9850    if (element == null)
9851      return;
9852    Complex t;
9853    if (Utilities.noString(parentType))
9854      t = parent;
9855    else {
9856      t = parent.predicate("fhir:" + parentType + '.' + name);
9857    }
9858    composeBackboneElement(t, "priceComponent", name, element, index);
9859    if (element.hasTypeElement())
9860      composeEnum(t, "Invoice", "type", element.getTypeElement(), -1);
9861    if (element.hasCode())
9862      composeCodeableConcept(t, "Invoice", "code", element.getCode(), -1);
9863    if (element.hasFactorElement())
9864      composeDecimal(t, "Invoice", "factor", element.getFactorElement(), -1);
9865    if (element.hasAmount())
9866      composeMoney(t, "Invoice", "amount", element.getAmount(), -1);
9867  }
9868
9869  protected void composeLibrary(Complex parent, String parentType, String name, Library element, int index) {
9870    if (element == null)
9871      return;
9872    Complex t;
9873    if (Utilities.noString(parentType))
9874      t = parent;
9875    else {
9876      t = parent.predicate("fhir:" + parentType + '.' + name);
9877    }
9878    composeDomainResource(t, "Library", name, element, index);
9879    if (element.hasUrlElement())
9880      composeUri(t, "Library", "url", element.getUrlElement(), -1);
9881    for (int i = 0; i < element.getIdentifier().size(); i++)
9882      composeIdentifier(t, "Library", "identifier", element.getIdentifier().get(i), i);
9883    if (element.hasVersionElement())
9884      composeString(t, "Library", "version", element.getVersionElement(), -1);
9885    if (element.hasNameElement())
9886      composeString(t, "Library", "name", element.getNameElement(), -1);
9887    if (element.hasTitleElement())
9888      composeString(t, "Library", "title", element.getTitleElement(), -1);
9889    if (element.hasSubtitleElement())
9890      composeString(t, "Library", "subtitle", element.getSubtitleElement(), -1);
9891    if (element.hasStatusElement())
9892      composeEnum(t, "Library", "status", element.getStatusElement(), -1);
9893    if (element.hasExperimentalElement())
9894      composeBoolean(t, "Library", "experimental", element.getExperimentalElement(), -1);
9895    if (element.hasType())
9896      composeCodeableConcept(t, "Library", "type", element.getType(), -1);
9897    if (element.hasSubject())
9898      composeType(t, "Library", "subject", element.getSubject(), -1);
9899    if (element.hasDateElement())
9900      composeDateTime(t, "Library", "date", element.getDateElement(), -1);
9901    if (element.hasPublisherElement())
9902      composeString(t, "Library", "publisher", element.getPublisherElement(), -1);
9903    for (int i = 0; i < element.getContact().size(); i++)
9904      composeContactDetail(t, "Library", "contact", element.getContact().get(i), i);
9905    if (element.hasDescriptionElement())
9906      composeMarkdown(t, "Library", "description", element.getDescriptionElement(), -1);
9907    for (int i = 0; i < element.getUseContext().size(); i++)
9908      composeUsageContext(t, "Library", "useContext", element.getUseContext().get(i), i);
9909    for (int i = 0; i < element.getJurisdiction().size(); i++)
9910      composeCodeableConcept(t, "Library", "jurisdiction", element.getJurisdiction().get(i), i);
9911    if (element.hasPurposeElement())
9912      composeMarkdown(t, "Library", "purpose", element.getPurposeElement(), -1);
9913    if (element.hasUsageElement())
9914      composeString(t, "Library", "usage", element.getUsageElement(), -1);
9915    if (element.hasCopyrightElement())
9916      composeMarkdown(t, "Library", "copyright", element.getCopyrightElement(), -1);
9917    if (element.hasApprovalDateElement())
9918      composeDate(t, "Library", "approvalDate", element.getApprovalDateElement(), -1);
9919    if (element.hasLastReviewDateElement())
9920      composeDate(t, "Library", "lastReviewDate", element.getLastReviewDateElement(), -1);
9921    if (element.hasEffectivePeriod())
9922      composePeriod(t, "Library", "effectivePeriod", element.getEffectivePeriod(), -1);
9923    for (int i = 0; i < element.getTopic().size(); i++)
9924      composeCodeableConcept(t, "Library", "topic", element.getTopic().get(i), i);
9925    for (int i = 0; i < element.getAuthor().size(); i++)
9926      composeContactDetail(t, "Library", "author", element.getAuthor().get(i), i);
9927    for (int i = 0; i < element.getEditor().size(); i++)
9928      composeContactDetail(t, "Library", "editor", element.getEditor().get(i), i);
9929    for (int i = 0; i < element.getReviewer().size(); i++)
9930      composeContactDetail(t, "Library", "reviewer", element.getReviewer().get(i), i);
9931    for (int i = 0; i < element.getEndorser().size(); i++)
9932      composeContactDetail(t, "Library", "endorser", element.getEndorser().get(i), i);
9933    for (int i = 0; i < element.getRelatedArtifact().size(); i++)
9934      composeRelatedArtifact(t, "Library", "relatedArtifact", element.getRelatedArtifact().get(i), i);
9935    for (int i = 0; i < element.getParameter().size(); i++)
9936      composeParameterDefinition(t, "Library", "parameter", element.getParameter().get(i), i);
9937    for (int i = 0; i < element.getDataRequirement().size(); i++)
9938      composeDataRequirement(t, "Library", "dataRequirement", element.getDataRequirement().get(i), i);
9939    for (int i = 0; i < element.getContent().size(); i++)
9940      composeAttachment(t, "Library", "content", element.getContent().get(i), i);
9941  }
9942
9943  protected void composeLinkage(Complex parent, String parentType, String name, Linkage element, int index) {
9944    if (element == null)
9945      return;
9946    Complex t;
9947    if (Utilities.noString(parentType))
9948      t = parent;
9949    else {
9950      t = parent.predicate("fhir:" + parentType + '.' + name);
9951    }
9952    composeDomainResource(t, "Linkage", name, element, index);
9953    if (element.hasActiveElement())
9954      composeBoolean(t, "Linkage", "active", element.getActiveElement(), -1);
9955    if (element.hasAuthor())
9956      composeReference(t, "Linkage", "author", element.getAuthor(), -1);
9957    for (int i = 0; i < element.getItem().size(); i++)
9958      composeLinkageLinkageItemComponent(t, "Linkage", "item", element.getItem().get(i), i);
9959  }
9960
9961  protected void composeLinkageLinkageItemComponent(Complex parent, String parentType, String name,
9962      Linkage.LinkageItemComponent element, int index) {
9963    if (element == null)
9964      return;
9965    Complex t;
9966    if (Utilities.noString(parentType))
9967      t = parent;
9968    else {
9969      t = parent.predicate("fhir:" + parentType + '.' + name);
9970    }
9971    composeBackboneElement(t, "item", name, element, index);
9972    if (element.hasTypeElement())
9973      composeEnum(t, "Linkage", "type", element.getTypeElement(), -1);
9974    if (element.hasResource())
9975      composeReference(t, "Linkage", "resource", element.getResource(), -1);
9976  }
9977
9978  protected void composeListResource(Complex parent, String parentType, String name, ListResource element, int index) {
9979    if (element == null)
9980      return;
9981    Complex t;
9982    if (Utilities.noString(parentType))
9983      t = parent;
9984    else {
9985      t = parent.predicate("fhir:" + parentType + '.' + name);
9986    }
9987    composeDomainResource(t, "List", name, element, index);
9988    for (int i = 0; i < element.getIdentifier().size(); i++)
9989      composeIdentifier(t, "List", "identifier", element.getIdentifier().get(i), i);
9990    if (element.hasStatusElement())
9991      composeEnum(t, "List", "status", element.getStatusElement(), -1);
9992    if (element.hasModeElement())
9993      composeEnum(t, "List", "mode", element.getModeElement(), -1);
9994    if (element.hasTitleElement())
9995      composeString(t, "List", "title", element.getTitleElement(), -1);
9996    if (element.hasCode())
9997      composeCodeableConcept(t, "List", "code", element.getCode(), -1);
9998    if (element.hasSubject())
9999      composeReference(t, "List", "subject", element.getSubject(), -1);
10000    if (element.hasEncounter())
10001      composeReference(t, "List", "encounter", element.getEncounter(), -1);
10002    if (element.hasDateElement())
10003      composeDateTime(t, "List", "date", element.getDateElement(), -1);
10004    if (element.hasSource())
10005      composeReference(t, "List", "source", element.getSource(), -1);
10006    if (element.hasOrderedBy())
10007      composeCodeableConcept(t, "List", "orderedBy", element.getOrderedBy(), -1);
10008    for (int i = 0; i < element.getNote().size(); i++)
10009      composeAnnotation(t, "List", "note", element.getNote().get(i), i);
10010    for (int i = 0; i < element.getEntry().size(); i++)
10011      composeListResourceListEntryComponent(t, "List", "entry", element.getEntry().get(i), i);
10012    if (element.hasEmptyReason())
10013      composeCodeableConcept(t, "List", "emptyReason", element.getEmptyReason(), -1);
10014  }
10015
10016  protected void composeListResourceListEntryComponent(Complex parent, String parentType, String name,
10017      ListResource.ListEntryComponent element, int index) {
10018    if (element == null)
10019      return;
10020    Complex t;
10021    if (Utilities.noString(parentType))
10022      t = parent;
10023    else {
10024      t = parent.predicate("fhir:" + parentType + '.' + name);
10025    }
10026    composeBackboneElement(t, "entry", name, element, index);
10027    if (element.hasFlag())
10028      composeCodeableConcept(t, "List", "flag", element.getFlag(), -1);
10029    if (element.hasDeletedElement())
10030      composeBoolean(t, "List", "deleted", element.getDeletedElement(), -1);
10031    if (element.hasDateElement())
10032      composeDateTime(t, "List", "date", element.getDateElement(), -1);
10033    if (element.hasItem())
10034      composeReference(t, "List", "item", element.getItem(), -1);
10035  }
10036
10037  protected void composeLocation(Complex parent, String parentType, String name, Location element, int index) {
10038    if (element == null)
10039      return;
10040    Complex t;
10041    if (Utilities.noString(parentType))
10042      t = parent;
10043    else {
10044      t = parent.predicate("fhir:" + parentType + '.' + name);
10045    }
10046    composeDomainResource(t, "Location", name, element, index);
10047    for (int i = 0; i < element.getIdentifier().size(); i++)
10048      composeIdentifier(t, "Location", "identifier", element.getIdentifier().get(i), i);
10049    if (element.hasStatusElement())
10050      composeEnum(t, "Location", "status", element.getStatusElement(), -1);
10051    if (element.hasOperationalStatus())
10052      composeCoding(t, "Location", "operationalStatus", element.getOperationalStatus(), -1);
10053    if (element.hasNameElement())
10054      composeString(t, "Location", "name", element.getNameElement(), -1);
10055    for (int i = 0; i < element.getAlias().size(); i++)
10056      composeString(t, "Location", "alias", element.getAlias().get(i), i);
10057    if (element.hasDescriptionElement())
10058      composeString(t, "Location", "description", element.getDescriptionElement(), -1);
10059    if (element.hasModeElement())
10060      composeEnum(t, "Location", "mode", element.getModeElement(), -1);
10061    for (int i = 0; i < element.getType().size(); i++)
10062      composeCodeableConcept(t, "Location", "type", element.getType().get(i), i);
10063    for (int i = 0; i < element.getTelecom().size(); i++)
10064      composeContactPoint(t, "Location", "telecom", element.getTelecom().get(i), i);
10065    if (element.hasAddress())
10066      composeAddress(t, "Location", "address", element.getAddress(), -1);
10067    if (element.hasPhysicalType())
10068      composeCodeableConcept(t, "Location", "physicalType", element.getPhysicalType(), -1);
10069    if (element.hasPosition())
10070      composeLocationLocationPositionComponent(t, "Location", "position", element.getPosition(), -1);
10071    if (element.hasManagingOrganization())
10072      composeReference(t, "Location", "managingOrganization", element.getManagingOrganization(), -1);
10073    if (element.hasPartOf())
10074      composeReference(t, "Location", "partOf", element.getPartOf(), -1);
10075    for (int i = 0; i < element.getHoursOfOperation().size(); i++)
10076      composeLocationLocationHoursOfOperationComponent(t, "Location", "hoursOfOperation",
10077          element.getHoursOfOperation().get(i), i);
10078    if (element.hasAvailabilityExceptionsElement())
10079      composeString(t, "Location", "availabilityExceptions", element.getAvailabilityExceptionsElement(), -1);
10080    for (int i = 0; i < element.getEndpoint().size(); i++)
10081      composeReference(t, "Location", "endpoint", element.getEndpoint().get(i), i);
10082  }
10083
10084  protected void composeLocationLocationPositionComponent(Complex parent, String parentType, String name,
10085      Location.LocationPositionComponent element, int index) {
10086    if (element == null)
10087      return;
10088    Complex t;
10089    if (Utilities.noString(parentType))
10090      t = parent;
10091    else {
10092      t = parent.predicate("fhir:" + parentType + '.' + name);
10093    }
10094    composeBackboneElement(t, "position", name, element, index);
10095    if (element.hasLongitudeElement())
10096      composeDecimal(t, "Location", "longitude", element.getLongitudeElement(), -1);
10097    if (element.hasLatitudeElement())
10098      composeDecimal(t, "Location", "latitude", element.getLatitudeElement(), -1);
10099    if (element.hasAltitudeElement())
10100      composeDecimal(t, "Location", "altitude", element.getAltitudeElement(), -1);
10101  }
10102
10103  protected void composeLocationLocationHoursOfOperationComponent(Complex parent, String parentType, String name,
10104      Location.LocationHoursOfOperationComponent element, int index) {
10105    if (element == null)
10106      return;
10107    Complex t;
10108    if (Utilities.noString(parentType))
10109      t = parent;
10110    else {
10111      t = parent.predicate("fhir:" + parentType + '.' + name);
10112    }
10113    composeBackboneElement(t, "hoursOfOperation", name, element, index);
10114    for (int i = 0; i < element.getDaysOfWeek().size(); i++)
10115      composeEnum(t, "Location", "daysOfWeek", element.getDaysOfWeek().get(i), i);
10116    if (element.hasAllDayElement())
10117      composeBoolean(t, "Location", "allDay", element.getAllDayElement(), -1);
10118    if (element.hasOpeningTimeElement())
10119      composeTime(t, "Location", "openingTime", element.getOpeningTimeElement(), -1);
10120    if (element.hasClosingTimeElement())
10121      composeTime(t, "Location", "closingTime", element.getClosingTimeElement(), -1);
10122  }
10123
10124  protected void composeMeasure(Complex parent, String parentType, String name, Measure element, int index) {
10125    if (element == null)
10126      return;
10127    Complex t;
10128    if (Utilities.noString(parentType))
10129      t = parent;
10130    else {
10131      t = parent.predicate("fhir:" + parentType + '.' + name);
10132    }
10133    composeDomainResource(t, "Measure", name, element, index);
10134    if (element.hasUrlElement())
10135      composeUri(t, "Measure", "url", element.getUrlElement(), -1);
10136    for (int i = 0; i < element.getIdentifier().size(); i++)
10137      composeIdentifier(t, "Measure", "identifier", element.getIdentifier().get(i), i);
10138    if (element.hasVersionElement())
10139      composeString(t, "Measure", "version", element.getVersionElement(), -1);
10140    if (element.hasNameElement())
10141      composeString(t, "Measure", "name", element.getNameElement(), -1);
10142    if (element.hasTitleElement())
10143      composeString(t, "Measure", "title", element.getTitleElement(), -1);
10144    if (element.hasSubtitleElement())
10145      composeString(t, "Measure", "subtitle", element.getSubtitleElement(), -1);
10146    if (element.hasStatusElement())
10147      composeEnum(t, "Measure", "status", element.getStatusElement(), -1);
10148    if (element.hasExperimentalElement())
10149      composeBoolean(t, "Measure", "experimental", element.getExperimentalElement(), -1);
10150    if (element.hasSubject())
10151      composeType(t, "Measure", "subject", element.getSubject(), -1);
10152    if (element.hasDateElement())
10153      composeDateTime(t, "Measure", "date", element.getDateElement(), -1);
10154    if (element.hasPublisherElement())
10155      composeString(t, "Measure", "publisher", element.getPublisherElement(), -1);
10156    for (int i = 0; i < element.getContact().size(); i++)
10157      composeContactDetail(t, "Measure", "contact", element.getContact().get(i), i);
10158    if (element.hasDescriptionElement())
10159      composeMarkdown(t, "Measure", "description", element.getDescriptionElement(), -1);
10160    for (int i = 0; i < element.getUseContext().size(); i++)
10161      composeUsageContext(t, "Measure", "useContext", element.getUseContext().get(i), i);
10162    for (int i = 0; i < element.getJurisdiction().size(); i++)
10163      composeCodeableConcept(t, "Measure", "jurisdiction", element.getJurisdiction().get(i), i);
10164    if (element.hasPurposeElement())
10165      composeMarkdown(t, "Measure", "purpose", element.getPurposeElement(), -1);
10166    if (element.hasUsageElement())
10167      composeString(t, "Measure", "usage", element.getUsageElement(), -1);
10168    if (element.hasCopyrightElement())
10169      composeMarkdown(t, "Measure", "copyright", element.getCopyrightElement(), -1);
10170    if (element.hasApprovalDateElement())
10171      composeDate(t, "Measure", "approvalDate", element.getApprovalDateElement(), -1);
10172    if (element.hasLastReviewDateElement())
10173      composeDate(t, "Measure", "lastReviewDate", element.getLastReviewDateElement(), -1);
10174    if (element.hasEffectivePeriod())
10175      composePeriod(t, "Measure", "effectivePeriod", element.getEffectivePeriod(), -1);
10176    for (int i = 0; i < element.getTopic().size(); i++)
10177      composeCodeableConcept(t, "Measure", "topic", element.getTopic().get(i), i);
10178    for (int i = 0; i < element.getAuthor().size(); i++)
10179      composeContactDetail(t, "Measure", "author", element.getAuthor().get(i), i);
10180    for (int i = 0; i < element.getEditor().size(); i++)
10181      composeContactDetail(t, "Measure", "editor", element.getEditor().get(i), i);
10182    for (int i = 0; i < element.getReviewer().size(); i++)
10183      composeContactDetail(t, "Measure", "reviewer", element.getReviewer().get(i), i);
10184    for (int i = 0; i < element.getEndorser().size(); i++)
10185      composeContactDetail(t, "Measure", "endorser", element.getEndorser().get(i), i);
10186    for (int i = 0; i < element.getRelatedArtifact().size(); i++)
10187      composeRelatedArtifact(t, "Measure", "relatedArtifact", element.getRelatedArtifact().get(i), i);
10188    for (int i = 0; i < element.getLibrary().size(); i++)
10189      composeCanonical(t, "Measure", "library", element.getLibrary().get(i), i);
10190    if (element.hasDisclaimerElement())
10191      composeMarkdown(t, "Measure", "disclaimer", element.getDisclaimerElement(), -1);
10192    if (element.hasScoring())
10193      composeCodeableConcept(t, "Measure", "scoring", element.getScoring(), -1);
10194    if (element.hasCompositeScoring())
10195      composeCodeableConcept(t, "Measure", "compositeScoring", element.getCompositeScoring(), -1);
10196    for (int i = 0; i < element.getType().size(); i++)
10197      composeCodeableConcept(t, "Measure", "type", element.getType().get(i), i);
10198    if (element.hasRiskAdjustmentElement())
10199      composeString(t, "Measure", "riskAdjustment", element.getRiskAdjustmentElement(), -1);
10200    if (element.hasRateAggregationElement())
10201      composeString(t, "Measure", "rateAggregation", element.getRateAggregationElement(), -1);
10202    if (element.hasRationaleElement())
10203      composeMarkdown(t, "Measure", "rationale", element.getRationaleElement(), -1);
10204    if (element.hasClinicalRecommendationStatementElement())
10205      composeMarkdown(t, "Measure", "clinicalRecommendationStatement",
10206          element.getClinicalRecommendationStatementElement(), -1);
10207    if (element.hasImprovementNotation())
10208      composeCodeableConcept(t, "Measure", "improvementNotation", element.getImprovementNotation(), -1);
10209    for (int i = 0; i < element.getDefinition().size(); i++)
10210      composeMarkdown(t, "Measure", "definition", element.getDefinition().get(i), i);
10211    if (element.hasGuidanceElement())
10212      composeMarkdown(t, "Measure", "guidance", element.getGuidanceElement(), -1);
10213    for (int i = 0; i < element.getGroup().size(); i++)
10214      composeMeasureMeasureGroupComponent(t, "Measure", "group", element.getGroup().get(i), i);
10215    for (int i = 0; i < element.getSupplementalData().size(); i++)
10216      composeMeasureMeasureSupplementalDataComponent(t, "Measure", "supplementalData",
10217          element.getSupplementalData().get(i), i);
10218  }
10219
10220  protected void composeMeasureMeasureGroupComponent(Complex parent, String parentType, String name,
10221      Measure.MeasureGroupComponent element, int index) {
10222    if (element == null)
10223      return;
10224    Complex t;
10225    if (Utilities.noString(parentType))
10226      t = parent;
10227    else {
10228      t = parent.predicate("fhir:" + parentType + '.' + name);
10229    }
10230    composeBackboneElement(t, "group", name, element, index);
10231    if (element.hasCode())
10232      composeCodeableConcept(t, "Measure", "code", element.getCode(), -1);
10233    if (element.hasDescriptionElement())
10234      composeString(t, "Measure", "description", element.getDescriptionElement(), -1);
10235    for (int i = 0; i < element.getPopulation().size(); i++)
10236      composeMeasureMeasureGroupPopulationComponent(t, "Measure", "population", element.getPopulation().get(i), i);
10237    for (int i = 0; i < element.getStratifier().size(); i++)
10238      composeMeasureMeasureGroupStratifierComponent(t, "Measure", "stratifier", element.getStratifier().get(i), i);
10239  }
10240
10241  protected void composeMeasureMeasureGroupPopulationComponent(Complex parent, String parentType, String name,
10242      Measure.MeasureGroupPopulationComponent element, int index) {
10243    if (element == null)
10244      return;
10245    Complex t;
10246    if (Utilities.noString(parentType))
10247      t = parent;
10248    else {
10249      t = parent.predicate("fhir:" + parentType + '.' + name);
10250    }
10251    composeBackboneElement(t, "population", name, element, index);
10252    if (element.hasCode())
10253      composeCodeableConcept(t, "Measure", "code", element.getCode(), -1);
10254    if (element.hasDescriptionElement())
10255      composeString(t, "Measure", "description", element.getDescriptionElement(), -1);
10256    if (element.hasCriteria())
10257      composeExpression(t, "Measure", "criteria", element.getCriteria(), -1);
10258  }
10259
10260  protected void composeMeasureMeasureGroupStratifierComponent(Complex parent, String parentType, String name,
10261      Measure.MeasureGroupStratifierComponent element, int index) {
10262    if (element == null)
10263      return;
10264    Complex t;
10265    if (Utilities.noString(parentType))
10266      t = parent;
10267    else {
10268      t = parent.predicate("fhir:" + parentType + '.' + name);
10269    }
10270    composeBackboneElement(t, "stratifier", name, element, index);
10271    if (element.hasCode())
10272      composeCodeableConcept(t, "Measure", "code", element.getCode(), -1);
10273    if (element.hasDescriptionElement())
10274      composeString(t, "Measure", "description", element.getDescriptionElement(), -1);
10275    if (element.hasCriteria())
10276      composeExpression(t, "Measure", "criteria", element.getCriteria(), -1);
10277    for (int i = 0; i < element.getComponent().size(); i++)
10278      composeMeasureMeasureGroupStratifierComponentComponent(t, "Measure", "component", element.getComponent().get(i),
10279          i);
10280  }
10281
10282  protected void composeMeasureMeasureGroupStratifierComponentComponent(Complex parent, String parentType, String name,
10283      Measure.MeasureGroupStratifierComponentComponent element, int index) {
10284    if (element == null)
10285      return;
10286    Complex t;
10287    if (Utilities.noString(parentType))
10288      t = parent;
10289    else {
10290      t = parent.predicate("fhir:" + parentType + '.' + name);
10291    }
10292    composeBackboneElement(t, "component", name, element, index);
10293    if (element.hasCode())
10294      composeCodeableConcept(t, "Measure", "code", element.getCode(), -1);
10295    if (element.hasDescriptionElement())
10296      composeString(t, "Measure", "description", element.getDescriptionElement(), -1);
10297    if (element.hasCriteria())
10298      composeExpression(t, "Measure", "criteria", element.getCriteria(), -1);
10299  }
10300
10301  protected void composeMeasureMeasureSupplementalDataComponent(Complex parent, String parentType, String name,
10302      Measure.MeasureSupplementalDataComponent element, int index) {
10303    if (element == null)
10304      return;
10305    Complex t;
10306    if (Utilities.noString(parentType))
10307      t = parent;
10308    else {
10309      t = parent.predicate("fhir:" + parentType + '.' + name);
10310    }
10311    composeBackboneElement(t, "supplementalData", name, element, index);
10312    if (element.hasCode())
10313      composeCodeableConcept(t, "Measure", "code", element.getCode(), -1);
10314    for (int i = 0; i < element.getUsage().size(); i++)
10315      composeCodeableConcept(t, "Measure", "usage", element.getUsage().get(i), i);
10316    if (element.hasDescriptionElement())
10317      composeString(t, "Measure", "description", element.getDescriptionElement(), -1);
10318    if (element.hasCriteria())
10319      composeExpression(t, "Measure", "criteria", element.getCriteria(), -1);
10320  }
10321
10322  protected void composeMeasureReport(Complex parent, String parentType, String name, MeasureReport element,
10323      int index) {
10324    if (element == null)
10325      return;
10326    Complex t;
10327    if (Utilities.noString(parentType))
10328      t = parent;
10329    else {
10330      t = parent.predicate("fhir:" + parentType + '.' + name);
10331    }
10332    composeDomainResource(t, "MeasureReport", name, element, index);
10333    for (int i = 0; i < element.getIdentifier().size(); i++)
10334      composeIdentifier(t, "MeasureReport", "identifier", element.getIdentifier().get(i), i);
10335    if (element.hasStatusElement())
10336      composeEnum(t, "MeasureReport", "status", element.getStatusElement(), -1);
10337    if (element.hasTypeElement())
10338      composeEnum(t, "MeasureReport", "type", element.getTypeElement(), -1);
10339    if (element.hasMeasureElement())
10340      composeCanonical(t, "MeasureReport", "measure", element.getMeasureElement(), -1);
10341    if (element.hasSubject())
10342      composeReference(t, "MeasureReport", "subject", element.getSubject(), -1);
10343    if (element.hasDateElement())
10344      composeDateTime(t, "MeasureReport", "date", element.getDateElement(), -1);
10345    if (element.hasReporter())
10346      composeReference(t, "MeasureReport", "reporter", element.getReporter(), -1);
10347    if (element.hasPeriod())
10348      composePeriod(t, "MeasureReport", "period", element.getPeriod(), -1);
10349    if (element.hasImprovementNotation())
10350      composeCodeableConcept(t, "MeasureReport", "improvementNotation", element.getImprovementNotation(), -1);
10351    for (int i = 0; i < element.getGroup().size(); i++)
10352      composeMeasureReportMeasureReportGroupComponent(t, "MeasureReport", "group", element.getGroup().get(i), i);
10353    for (int i = 0; i < element.getEvaluatedResource().size(); i++)
10354      composeReference(t, "MeasureReport", "evaluatedResource", element.getEvaluatedResource().get(i), i);
10355  }
10356
10357  protected void composeMeasureReportMeasureReportGroupComponent(Complex parent, String parentType, String name,
10358      MeasureReport.MeasureReportGroupComponent element, int index) {
10359    if (element == null)
10360      return;
10361    Complex t;
10362    if (Utilities.noString(parentType))
10363      t = parent;
10364    else {
10365      t = parent.predicate("fhir:" + parentType + '.' + name);
10366    }
10367    composeBackboneElement(t, "group", name, element, index);
10368    if (element.hasCode())
10369      composeCodeableConcept(t, "MeasureReport", "code", element.getCode(), -1);
10370    for (int i = 0; i < element.getPopulation().size(); i++)
10371      composeMeasureReportMeasureReportGroupPopulationComponent(t, "MeasureReport", "population",
10372          element.getPopulation().get(i), i);
10373    if (element.hasMeasureScore())
10374      composeQuantity(t, "MeasureReport", "measureScore", element.getMeasureScore(), -1);
10375    for (int i = 0; i < element.getStratifier().size(); i++)
10376      composeMeasureReportMeasureReportGroupStratifierComponent(t, "MeasureReport", "stratifier",
10377          element.getStratifier().get(i), i);
10378  }
10379
10380  protected void composeMeasureReportMeasureReportGroupPopulationComponent(Complex parent, String parentType,
10381      String name, MeasureReport.MeasureReportGroupPopulationComponent element, int index) {
10382    if (element == null)
10383      return;
10384    Complex t;
10385    if (Utilities.noString(parentType))
10386      t = parent;
10387    else {
10388      t = parent.predicate("fhir:" + parentType + '.' + name);
10389    }
10390    composeBackboneElement(t, "population", name, element, index);
10391    if (element.hasCode())
10392      composeCodeableConcept(t, "MeasureReport", "code", element.getCode(), -1);
10393    if (element.hasCountElement())
10394      composeInteger(t, "MeasureReport", "count", element.getCountElement(), -1);
10395    if (element.hasSubjectResults())
10396      composeReference(t, "MeasureReport", "subjectResults", element.getSubjectResults(), -1);
10397  }
10398
10399  protected void composeMeasureReportMeasureReportGroupStratifierComponent(Complex parent, String parentType,
10400      String name, MeasureReport.MeasureReportGroupStratifierComponent element, int index) {
10401    if (element == null)
10402      return;
10403    Complex t;
10404    if (Utilities.noString(parentType))
10405      t = parent;
10406    else {
10407      t = parent.predicate("fhir:" + parentType + '.' + name);
10408    }
10409    composeBackboneElement(t, "stratifier", name, element, index);
10410    for (int i = 0; i < element.getCode().size(); i++)
10411      composeCodeableConcept(t, "MeasureReport", "code", element.getCode().get(i), i);
10412    for (int i = 0; i < element.getStratum().size(); i++)
10413      composeMeasureReportStratifierGroupComponent(t, "MeasureReport", "stratum", element.getStratum().get(i), i);
10414  }
10415
10416  protected void composeMeasureReportStratifierGroupComponent(Complex parent, String parentType, String name,
10417      MeasureReport.StratifierGroupComponent element, int index) {
10418    if (element == null)
10419      return;
10420    Complex t;
10421    if (Utilities.noString(parentType))
10422      t = parent;
10423    else {
10424      t = parent.predicate("fhir:" + parentType + '.' + name);
10425    }
10426    composeBackboneElement(t, "stratum", name, element, index);
10427    if (element.hasValue())
10428      composeCodeableConcept(t, "MeasureReport", "value", element.getValue(), -1);
10429    for (int i = 0; i < element.getComponent().size(); i++)
10430      composeMeasureReportStratifierGroupComponentComponent(t, "MeasureReport", "component",
10431          element.getComponent().get(i), i);
10432    for (int i = 0; i < element.getPopulation().size(); i++)
10433      composeMeasureReportStratifierGroupPopulationComponent(t, "MeasureReport", "population",
10434          element.getPopulation().get(i), i);
10435    if (element.hasMeasureScore())
10436      composeQuantity(t, "MeasureReport", "measureScore", element.getMeasureScore(), -1);
10437  }
10438
10439  protected void composeMeasureReportStratifierGroupComponentComponent(Complex parent, String parentType, String name,
10440      MeasureReport.StratifierGroupComponentComponent element, int index) {
10441    if (element == null)
10442      return;
10443    Complex t;
10444    if (Utilities.noString(parentType))
10445      t = parent;
10446    else {
10447      t = parent.predicate("fhir:" + parentType + '.' + name);
10448    }
10449    composeBackboneElement(t, "component", name, element, index);
10450    if (element.hasCode())
10451      composeCodeableConcept(t, "MeasureReport", "code", element.getCode(), -1);
10452    if (element.hasValue())
10453      composeCodeableConcept(t, "MeasureReport", "value", element.getValue(), -1);
10454  }
10455
10456  protected void composeMeasureReportStratifierGroupPopulationComponent(Complex parent, String parentType, String name,
10457      MeasureReport.StratifierGroupPopulationComponent element, int index) {
10458    if (element == null)
10459      return;
10460    Complex t;
10461    if (Utilities.noString(parentType))
10462      t = parent;
10463    else {
10464      t = parent.predicate("fhir:" + parentType + '.' + name);
10465    }
10466    composeBackboneElement(t, "population", name, element, index);
10467    if (element.hasCode())
10468      composeCodeableConcept(t, "MeasureReport", "code", element.getCode(), -1);
10469    if (element.hasCountElement())
10470      composeInteger(t, "MeasureReport", "count", element.getCountElement(), -1);
10471    if (element.hasSubjectResults())
10472      composeReference(t, "MeasureReport", "subjectResults", element.getSubjectResults(), -1);
10473  }
10474
10475  protected void composeMedia(Complex parent, String parentType, String name, Media element, int index) {
10476    if (element == null)
10477      return;
10478    Complex t;
10479    if (Utilities.noString(parentType))
10480      t = parent;
10481    else {
10482      t = parent.predicate("fhir:" + parentType + '.' + name);
10483    }
10484    composeDomainResource(t, "Media", name, element, index);
10485    for (int i = 0; i < element.getIdentifier().size(); i++)
10486      composeIdentifier(t, "Media", "identifier", element.getIdentifier().get(i), i);
10487    for (int i = 0; i < element.getBasedOn().size(); i++)
10488      composeReference(t, "Media", "basedOn", element.getBasedOn().get(i), i);
10489    for (int i = 0; i < element.getPartOf().size(); i++)
10490      composeReference(t, "Media", "partOf", element.getPartOf().get(i), i);
10491    if (element.hasStatusElement())
10492      composeEnum(t, "Media", "status", element.getStatusElement(), -1);
10493    if (element.hasType())
10494      composeCodeableConcept(t, "Media", "type", element.getType(), -1);
10495    if (element.hasModality())
10496      composeCodeableConcept(t, "Media", "modality", element.getModality(), -1);
10497    if (element.hasView())
10498      composeCodeableConcept(t, "Media", "view", element.getView(), -1);
10499    if (element.hasSubject())
10500      composeReference(t, "Media", "subject", element.getSubject(), -1);
10501    if (element.hasEncounter())
10502      composeReference(t, "Media", "encounter", element.getEncounter(), -1);
10503    if (element.hasCreated())
10504      composeType(t, "Media", "created", element.getCreated(), -1);
10505    if (element.hasIssuedElement())
10506      composeInstant(t, "Media", "issued", element.getIssuedElement(), -1);
10507    if (element.hasOperator())
10508      composeReference(t, "Media", "operator", element.getOperator(), -1);
10509    for (int i = 0; i < element.getReasonCode().size(); i++)
10510      composeCodeableConcept(t, "Media", "reasonCode", element.getReasonCode().get(i), i);
10511    if (element.hasBodySite())
10512      composeCodeableConcept(t, "Media", "bodySite", element.getBodySite(), -1);
10513    if (element.hasDeviceNameElement())
10514      composeString(t, "Media", "deviceName", element.getDeviceNameElement(), -1);
10515    if (element.hasDevice())
10516      composeReference(t, "Media", "device", element.getDevice(), -1);
10517    if (element.hasHeightElement())
10518      composePositiveInt(t, "Media", "height", element.getHeightElement(), -1);
10519    if (element.hasWidthElement())
10520      composePositiveInt(t, "Media", "width", element.getWidthElement(), -1);
10521    if (element.hasFramesElement())
10522      composePositiveInt(t, "Media", "frames", element.getFramesElement(), -1);
10523    if (element.hasDurationElement())
10524      composeDecimal(t, "Media", "duration", element.getDurationElement(), -1);
10525    if (element.hasContent())
10526      composeAttachment(t, "Media", "content", element.getContent(), -1);
10527    for (int i = 0; i < element.getNote().size(); i++)
10528      composeAnnotation(t, "Media", "note", element.getNote().get(i), i);
10529  }
10530
10531  protected void composeMedication(Complex parent, String parentType, String name, Medication element, int index) {
10532    if (element == null)
10533      return;
10534    Complex t;
10535    if (Utilities.noString(parentType))
10536      t = parent;
10537    else {
10538      t = parent.predicate("fhir:" + parentType + '.' + name);
10539    }
10540    composeDomainResource(t, "Medication", name, element, index);
10541    for (int i = 0; i < element.getIdentifier().size(); i++)
10542      composeIdentifier(t, "Medication", "identifier", element.getIdentifier().get(i), i);
10543    if (element.hasCode())
10544      composeCodeableConcept(t, "Medication", "code", element.getCode(), -1);
10545    if (element.hasStatusElement())
10546      composeEnum(t, "Medication", "status", element.getStatusElement(), -1);
10547    if (element.hasManufacturer())
10548      composeReference(t, "Medication", "manufacturer", element.getManufacturer(), -1);
10549    if (element.hasForm())
10550      composeCodeableConcept(t, "Medication", "form", element.getForm(), -1);
10551    if (element.hasAmount())
10552      composeRatio(t, "Medication", "amount", element.getAmount(), -1);
10553    for (int i = 0; i < element.getIngredient().size(); i++)
10554      composeMedicationMedicationIngredientComponent(t, "Medication", "ingredient", element.getIngredient().get(i), i);
10555    if (element.hasBatch())
10556      composeMedicationMedicationBatchComponent(t, "Medication", "batch", element.getBatch(), -1);
10557  }
10558
10559  protected void composeMedicationMedicationIngredientComponent(Complex parent, String parentType, String name,
10560      Medication.MedicationIngredientComponent element, int index) {
10561    if (element == null)
10562      return;
10563    Complex t;
10564    if (Utilities.noString(parentType))
10565      t = parent;
10566    else {
10567      t = parent.predicate("fhir:" + parentType + '.' + name);
10568    }
10569    composeBackboneElement(t, "ingredient", name, element, index);
10570    if (element.hasItem())
10571      composeType(t, "Medication", "item", element.getItem(), -1);
10572    if (element.hasIsActiveElement())
10573      composeBoolean(t, "Medication", "isActive", element.getIsActiveElement(), -1);
10574    if (element.hasStrength())
10575      composeRatio(t, "Medication", "strength", element.getStrength(), -1);
10576  }
10577
10578  protected void composeMedicationMedicationBatchComponent(Complex parent, String parentType, String name,
10579      Medication.MedicationBatchComponent element, int index) {
10580    if (element == null)
10581      return;
10582    Complex t;
10583    if (Utilities.noString(parentType))
10584      t = parent;
10585    else {
10586      t = parent.predicate("fhir:" + parentType + '.' + name);
10587    }
10588    composeBackboneElement(t, "batch", name, element, index);
10589    if (element.hasLotNumberElement())
10590      composeString(t, "Medication", "lotNumber", element.getLotNumberElement(), -1);
10591    if (element.hasExpirationDateElement())
10592      composeDateTime(t, "Medication", "expirationDate", element.getExpirationDateElement(), -1);
10593  }
10594
10595  protected void composeMedicationAdministration(Complex parent, String parentType, String name,
10596      MedicationAdministration element, int index) {
10597    if (element == null)
10598      return;
10599    Complex t;
10600    if (Utilities.noString(parentType))
10601      t = parent;
10602    else {
10603      t = parent.predicate("fhir:" + parentType + '.' + name);
10604    }
10605    composeDomainResource(t, "MedicationAdministration", name, element, index);
10606    for (int i = 0; i < element.getIdentifier().size(); i++)
10607      composeIdentifier(t, "MedicationAdministration", "identifier", element.getIdentifier().get(i), i);
10608    for (int i = 0; i < element.getInstantiates().size(); i++)
10609      composeUri(t, "MedicationAdministration", "instantiates", element.getInstantiates().get(i), i);
10610    for (int i = 0; i < element.getPartOf().size(); i++)
10611      composeReference(t, "MedicationAdministration", "partOf", element.getPartOf().get(i), i);
10612    if (element.hasStatusElement())
10613      composeEnum(t, "MedicationAdministration", "status", element.getStatusElement(), -1);
10614    for (int i = 0; i < element.getStatusReason().size(); i++)
10615      composeCodeableConcept(t, "MedicationAdministration", "statusReason", element.getStatusReason().get(i), i);
10616    if (element.hasCategory())
10617      composeCodeableConcept(t, "MedicationAdministration", "category", element.getCategory(), -1);
10618    if (element.hasMedication())
10619      composeType(t, "MedicationAdministration", "medication", element.getMedication(), -1);
10620    if (element.hasSubject())
10621      composeReference(t, "MedicationAdministration", "subject", element.getSubject(), -1);
10622    if (element.hasContext())
10623      composeReference(t, "MedicationAdministration", "context", element.getContext(), -1);
10624    for (int i = 0; i < element.getSupportingInformation().size(); i++)
10625      composeReference(t, "MedicationAdministration", "supportingInformation",
10626          element.getSupportingInformation().get(i), i);
10627    if (element.hasEffective())
10628      composeType(t, "MedicationAdministration", "effective", element.getEffective(), -1);
10629    for (int i = 0; i < element.getPerformer().size(); i++)
10630      composeMedicationAdministrationMedicationAdministrationPerformerComponent(t, "MedicationAdministration",
10631          "performer", element.getPerformer().get(i), i);
10632    for (int i = 0; i < element.getReasonCode().size(); i++)
10633      composeCodeableConcept(t, "MedicationAdministration", "reasonCode", element.getReasonCode().get(i), i);
10634    for (int i = 0; i < element.getReasonReference().size(); i++)
10635      composeReference(t, "MedicationAdministration", "reasonReference", element.getReasonReference().get(i), i);
10636    if (element.hasRequest())
10637      composeReference(t, "MedicationAdministration", "request", element.getRequest(), -1);
10638    for (int i = 0; i < element.getDevice().size(); i++)
10639      composeReference(t, "MedicationAdministration", "device", element.getDevice().get(i), i);
10640    for (int i = 0; i < element.getNote().size(); i++)
10641      composeAnnotation(t, "MedicationAdministration", "note", element.getNote().get(i), i);
10642    if (element.hasDosage())
10643      composeMedicationAdministrationMedicationAdministrationDosageComponent(t, "MedicationAdministration", "dosage",
10644          element.getDosage(), -1);
10645    for (int i = 0; i < element.getEventHistory().size(); i++)
10646      composeReference(t, "MedicationAdministration", "eventHistory", element.getEventHistory().get(i), i);
10647  }
10648
10649  protected void composeMedicationAdministrationMedicationAdministrationPerformerComponent(Complex parent,
10650      String parentType, String name, MedicationAdministration.MedicationAdministrationPerformerComponent element,
10651      int index) {
10652    if (element == null)
10653      return;
10654    Complex t;
10655    if (Utilities.noString(parentType))
10656      t = parent;
10657    else {
10658      t = parent.predicate("fhir:" + parentType + '.' + name);
10659    }
10660    composeBackboneElement(t, "performer", name, element, index);
10661    if (element.hasFunction())
10662      composeCodeableConcept(t, "MedicationAdministration", "function", element.getFunction(), -1);
10663    if (element.hasActor())
10664      composeReference(t, "MedicationAdministration", "actor", element.getActor(), -1);
10665  }
10666
10667  protected void composeMedicationAdministrationMedicationAdministrationDosageComponent(Complex parent,
10668      String parentType, String name, MedicationAdministration.MedicationAdministrationDosageComponent element,
10669      int index) {
10670    if (element == null)
10671      return;
10672    Complex t;
10673    if (Utilities.noString(parentType))
10674      t = parent;
10675    else {
10676      t = parent.predicate("fhir:" + parentType + '.' + name);
10677    }
10678    composeBackboneElement(t, "dosage", name, element, index);
10679    if (element.hasTextElement())
10680      composeString(t, "MedicationAdministration", "text", element.getTextElement(), -1);
10681    if (element.hasSite())
10682      composeCodeableConcept(t, "MedicationAdministration", "site", element.getSite(), -1);
10683    if (element.hasRoute())
10684      composeCodeableConcept(t, "MedicationAdministration", "route", element.getRoute(), -1);
10685    if (element.hasMethod())
10686      composeCodeableConcept(t, "MedicationAdministration", "method", element.getMethod(), -1);
10687    if (element.hasDose())
10688      composeQuantity(t, "MedicationAdministration", "dose", element.getDose(), -1);
10689    if (element.hasRate())
10690      composeType(t, "MedicationAdministration", "rate", element.getRate(), -1);
10691  }
10692
10693  protected void composeMedicationDispense(Complex parent, String parentType, String name, MedicationDispense element,
10694      int index) {
10695    if (element == null)
10696      return;
10697    Complex t;
10698    if (Utilities.noString(parentType))
10699      t = parent;
10700    else {
10701      t = parent.predicate("fhir:" + parentType + '.' + name);
10702    }
10703    composeDomainResource(t, "MedicationDispense", name, element, index);
10704    for (int i = 0; i < element.getIdentifier().size(); i++)
10705      composeIdentifier(t, "MedicationDispense", "identifier", element.getIdentifier().get(i), i);
10706    for (int i = 0; i < element.getPartOf().size(); i++)
10707      composeReference(t, "MedicationDispense", "partOf", element.getPartOf().get(i), i);
10708    if (element.hasStatusElement())
10709      composeEnum(t, "MedicationDispense", "status", element.getStatusElement(), -1);
10710    if (element.hasStatusReason())
10711      composeType(t, "MedicationDispense", "statusReason", element.getStatusReason(), -1);
10712    if (element.hasCategory())
10713      composeCodeableConcept(t, "MedicationDispense", "category", element.getCategory(), -1);
10714    if (element.hasMedication())
10715      composeType(t, "MedicationDispense", "medication", element.getMedication(), -1);
10716    if (element.hasSubject())
10717      composeReference(t, "MedicationDispense", "subject", element.getSubject(), -1);
10718    if (element.hasContext())
10719      composeReference(t, "MedicationDispense", "context", element.getContext(), -1);
10720    for (int i = 0; i < element.getSupportingInformation().size(); i++)
10721      composeReference(t, "MedicationDispense", "supportingInformation", element.getSupportingInformation().get(i), i);
10722    for (int i = 0; i < element.getPerformer().size(); i++)
10723      composeMedicationDispenseMedicationDispensePerformerComponent(t, "MedicationDispense", "performer",
10724          element.getPerformer().get(i), i);
10725    if (element.hasLocation())
10726      composeReference(t, "MedicationDispense", "location", element.getLocation(), -1);
10727    for (int i = 0; i < element.getAuthorizingPrescription().size(); i++)
10728      composeReference(t, "MedicationDispense", "authorizingPrescription", element.getAuthorizingPrescription().get(i),
10729          i);
10730    if (element.hasType())
10731      composeCodeableConcept(t, "MedicationDispense", "type", element.getType(), -1);
10732    if (element.hasQuantity())
10733      composeQuantity(t, "MedicationDispense", "quantity", element.getQuantity(), -1);
10734    if (element.hasDaysSupply())
10735      composeQuantity(t, "MedicationDispense", "daysSupply", element.getDaysSupply(), -1);
10736    if (element.hasWhenPreparedElement())
10737      composeDateTime(t, "MedicationDispense", "whenPrepared", element.getWhenPreparedElement(), -1);
10738    if (element.hasWhenHandedOverElement())
10739      composeDateTime(t, "MedicationDispense", "whenHandedOver", element.getWhenHandedOverElement(), -1);
10740    if (element.hasDestination())
10741      composeReference(t, "MedicationDispense", "destination", element.getDestination(), -1);
10742    for (int i = 0; i < element.getReceiver().size(); i++)
10743      composeReference(t, "MedicationDispense", "receiver", element.getReceiver().get(i), i);
10744    for (int i = 0; i < element.getNote().size(); i++)
10745      composeAnnotation(t, "MedicationDispense", "note", element.getNote().get(i), i);
10746    for (int i = 0; i < element.getDosageInstruction().size(); i++)
10747      composeDosage(t, "MedicationDispense", "dosageInstruction", element.getDosageInstruction().get(i), i);
10748    if (element.hasSubstitution())
10749      composeMedicationDispenseMedicationDispenseSubstitutionComponent(t, "MedicationDispense", "substitution",
10750          element.getSubstitution(), -1);
10751    for (int i = 0; i < element.getDetectedIssue().size(); i++)
10752      composeReference(t, "MedicationDispense", "detectedIssue", element.getDetectedIssue().get(i), i);
10753    for (int i = 0; i < element.getEventHistory().size(); i++)
10754      composeReference(t, "MedicationDispense", "eventHistory", element.getEventHistory().get(i), i);
10755  }
10756
10757  protected void composeMedicationDispenseMedicationDispensePerformerComponent(Complex parent, String parentType,
10758      String name, MedicationDispense.MedicationDispensePerformerComponent element, int index) {
10759    if (element == null)
10760      return;
10761    Complex t;
10762    if (Utilities.noString(parentType))
10763      t = parent;
10764    else {
10765      t = parent.predicate("fhir:" + parentType + '.' + name);
10766    }
10767    composeBackboneElement(t, "performer", name, element, index);
10768    if (element.hasFunction())
10769      composeCodeableConcept(t, "MedicationDispense", "function", element.getFunction(), -1);
10770    if (element.hasActor())
10771      composeReference(t, "MedicationDispense", "actor", element.getActor(), -1);
10772  }
10773
10774  protected void composeMedicationDispenseMedicationDispenseSubstitutionComponent(Complex parent, String parentType,
10775      String name, MedicationDispense.MedicationDispenseSubstitutionComponent element, int index) {
10776    if (element == null)
10777      return;
10778    Complex t;
10779    if (Utilities.noString(parentType))
10780      t = parent;
10781    else {
10782      t = parent.predicate("fhir:" + parentType + '.' + name);
10783    }
10784    composeBackboneElement(t, "substitution", name, element, index);
10785    if (element.hasWasSubstitutedElement())
10786      composeBoolean(t, "MedicationDispense", "wasSubstituted", element.getWasSubstitutedElement(), -1);
10787    if (element.hasType())
10788      composeCodeableConcept(t, "MedicationDispense", "type", element.getType(), -1);
10789    for (int i = 0; i < element.getReason().size(); i++)
10790      composeCodeableConcept(t, "MedicationDispense", "reason", element.getReason().get(i), i);
10791    for (int i = 0; i < element.getResponsibleParty().size(); i++)
10792      composeReference(t, "MedicationDispense", "responsibleParty", element.getResponsibleParty().get(i), i);
10793  }
10794
10795  protected void composeMedicationKnowledge(Complex parent, String parentType, String name, MedicationKnowledge element,
10796      int index) {
10797    if (element == null)
10798      return;
10799    Complex t;
10800    if (Utilities.noString(parentType))
10801      t = parent;
10802    else {
10803      t = parent.predicate("fhir:" + parentType + '.' + name);
10804    }
10805    composeDomainResource(t, "MedicationKnowledge", name, element, index);
10806    if (element.hasCode())
10807      composeCodeableConcept(t, "MedicationKnowledge", "code", element.getCode(), -1);
10808    if (element.hasStatusElement())
10809      composeEnum(t, "MedicationKnowledge", "status", element.getStatusElement(), -1);
10810    if (element.hasManufacturer())
10811      composeReference(t, "MedicationKnowledge", "manufacturer", element.getManufacturer(), -1);
10812    if (element.hasDoseForm())
10813      composeCodeableConcept(t, "MedicationKnowledge", "doseForm", element.getDoseForm(), -1);
10814    if (element.hasAmount())
10815      composeQuantity(t, "MedicationKnowledge", "amount", element.getAmount(), -1);
10816    for (int i = 0; i < element.getSynonym().size(); i++)
10817      composeString(t, "MedicationKnowledge", "synonym", element.getSynonym().get(i), i);
10818    for (int i = 0; i < element.getRelatedMedicationKnowledge().size(); i++)
10819      composeMedicationKnowledgeMedicationKnowledgeRelatedMedicationKnowledgeComponent(t, "MedicationKnowledge",
10820          "relatedMedicationKnowledge", element.getRelatedMedicationKnowledge().get(i), i);
10821    for (int i = 0; i < element.getAssociatedMedication().size(); i++)
10822      composeReference(t, "MedicationKnowledge", "associatedMedication", element.getAssociatedMedication().get(i), i);
10823    for (int i = 0; i < element.getProductType().size(); i++)
10824      composeCodeableConcept(t, "MedicationKnowledge", "productType", element.getProductType().get(i), i);
10825    for (int i = 0; i < element.getMonograph().size(); i++)
10826      composeMedicationKnowledgeMedicationKnowledgeMonographComponent(t, "MedicationKnowledge", "monograph",
10827          element.getMonograph().get(i), i);
10828    for (int i = 0; i < element.getIngredient().size(); i++)
10829      composeMedicationKnowledgeMedicationKnowledgeIngredientComponent(t, "MedicationKnowledge", "ingredient",
10830          element.getIngredient().get(i), i);
10831    if (element.hasPreparationInstructionElement())
10832      composeMarkdown(t, "MedicationKnowledge", "preparationInstruction", element.getPreparationInstructionElement(),
10833          -1);
10834    for (int i = 0; i < element.getIntendedRoute().size(); i++)
10835      composeCodeableConcept(t, "MedicationKnowledge", "intendedRoute", element.getIntendedRoute().get(i), i);
10836    for (int i = 0; i < element.getCost().size(); i++)
10837      composeMedicationKnowledgeMedicationKnowledgeCostComponent(t, "MedicationKnowledge", "cost",
10838          element.getCost().get(i), i);
10839    for (int i = 0; i < element.getMonitoringProgram().size(); i++)
10840      composeMedicationKnowledgeMedicationKnowledgeMonitoringProgramComponent(t, "MedicationKnowledge",
10841          "monitoringProgram", element.getMonitoringProgram().get(i), i);
10842    for (int i = 0; i < element.getAdministrationGuidelines().size(); i++)
10843      composeMedicationKnowledgeMedicationKnowledgeAdministrationGuidelinesComponent(t, "MedicationKnowledge",
10844          "administrationGuidelines", element.getAdministrationGuidelines().get(i), i);
10845    for (int i = 0; i < element.getMedicineClassification().size(); i++)
10846      composeMedicationKnowledgeMedicationKnowledgeMedicineClassificationComponent(t, "MedicationKnowledge",
10847          "medicineClassification", element.getMedicineClassification().get(i), i);
10848    if (element.hasPackaging())
10849      composeMedicationKnowledgeMedicationKnowledgePackagingComponent(t, "MedicationKnowledge", "packaging",
10850          element.getPackaging(), -1);
10851    for (int i = 0; i < element.getDrugCharacteristic().size(); i++)
10852      composeMedicationKnowledgeMedicationKnowledgeDrugCharacteristicComponent(t, "MedicationKnowledge",
10853          "drugCharacteristic", element.getDrugCharacteristic().get(i), i);
10854    for (int i = 0; i < element.getContraindication().size(); i++)
10855      composeReference(t, "MedicationKnowledge", "contraindication", element.getContraindication().get(i), i);
10856    for (int i = 0; i < element.getRegulatory().size(); i++)
10857      composeMedicationKnowledgeMedicationKnowledgeRegulatoryComponent(t, "MedicationKnowledge", "regulatory",
10858          element.getRegulatory().get(i), i);
10859    for (int i = 0; i < element.getKinetics().size(); i++)
10860      composeMedicationKnowledgeMedicationKnowledgeKineticsComponent(t, "MedicationKnowledge", "kinetics",
10861          element.getKinetics().get(i), i);
10862  }
10863
10864  protected void composeMedicationKnowledgeMedicationKnowledgeRelatedMedicationKnowledgeComponent(Complex parent,
10865      String parentType, String name,
10866      MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent element, int index) {
10867    if (element == null)
10868      return;
10869    Complex t;
10870    if (Utilities.noString(parentType))
10871      t = parent;
10872    else {
10873      t = parent.predicate("fhir:" + parentType + '.' + name);
10874    }
10875    composeBackboneElement(t, "relatedMedicationKnowledge", name, element, index);
10876    if (element.hasType())
10877      composeCodeableConcept(t, "MedicationKnowledge", "type", element.getType(), -1);
10878    for (int i = 0; i < element.getReference().size(); i++)
10879      composeReference(t, "MedicationKnowledge", "reference", element.getReference().get(i), i);
10880  }
10881
10882  protected void composeMedicationKnowledgeMedicationKnowledgeMonographComponent(Complex parent, String parentType,
10883      String name, MedicationKnowledge.MedicationKnowledgeMonographComponent element, int index) {
10884    if (element == null)
10885      return;
10886    Complex t;
10887    if (Utilities.noString(parentType))
10888      t = parent;
10889    else {
10890      t = parent.predicate("fhir:" + parentType + '.' + name);
10891    }
10892    composeBackboneElement(t, "monograph", name, element, index);
10893    if (element.hasType())
10894      composeCodeableConcept(t, "MedicationKnowledge", "type", element.getType(), -1);
10895    if (element.hasSource())
10896      composeReference(t, "MedicationKnowledge", "source", element.getSource(), -1);
10897  }
10898
10899  protected void composeMedicationKnowledgeMedicationKnowledgeIngredientComponent(Complex parent, String parentType,
10900      String name, MedicationKnowledge.MedicationKnowledgeIngredientComponent element, int index) {
10901    if (element == null)
10902      return;
10903    Complex t;
10904    if (Utilities.noString(parentType))
10905      t = parent;
10906    else {
10907      t = parent.predicate("fhir:" + parentType + '.' + name);
10908    }
10909    composeBackboneElement(t, "ingredient", name, element, index);
10910    if (element.hasItem())
10911      composeType(t, "MedicationKnowledge", "item", element.getItem(), -1);
10912    if (element.hasIsActiveElement())
10913      composeBoolean(t, "MedicationKnowledge", "isActive", element.getIsActiveElement(), -1);
10914    if (element.hasStrength())
10915      composeRatio(t, "MedicationKnowledge", "strength", element.getStrength(), -1);
10916  }
10917
10918  protected void composeMedicationKnowledgeMedicationKnowledgeCostComponent(Complex parent, String parentType,
10919      String name, MedicationKnowledge.MedicationKnowledgeCostComponent element, int index) {
10920    if (element == null)
10921      return;
10922    Complex t;
10923    if (Utilities.noString(parentType))
10924      t = parent;
10925    else {
10926      t = parent.predicate("fhir:" + parentType + '.' + name);
10927    }
10928    composeBackboneElement(t, "cost", name, element, index);
10929    if (element.hasType())
10930      composeCodeableConcept(t, "MedicationKnowledge", "type", element.getType(), -1);
10931    if (element.hasSourceElement())
10932      composeString(t, "MedicationKnowledge", "source", element.getSourceElement(), -1);
10933    if (element.hasCost())
10934      composeMoney(t, "MedicationKnowledge", "cost", element.getCost(), -1);
10935  }
10936
10937  protected void composeMedicationKnowledgeMedicationKnowledgeMonitoringProgramComponent(Complex parent,
10938      String parentType, String name, MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent element,
10939      int index) {
10940    if (element == null)
10941      return;
10942    Complex t;
10943    if (Utilities.noString(parentType))
10944      t = parent;
10945    else {
10946      t = parent.predicate("fhir:" + parentType + '.' + name);
10947    }
10948    composeBackboneElement(t, "monitoringProgram", name, element, index);
10949    if (element.hasType())
10950      composeCodeableConcept(t, "MedicationKnowledge", "type", element.getType(), -1);
10951    if (element.hasNameElement())
10952      composeString(t, "MedicationKnowledge", "name", element.getNameElement(), -1);
10953  }
10954
10955  protected void composeMedicationKnowledgeMedicationKnowledgeAdministrationGuidelinesComponent(Complex parent,
10956      String parentType, String name, MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent element,
10957      int index) {
10958    if (element == null)
10959      return;
10960    Complex t;
10961    if (Utilities.noString(parentType))
10962      t = parent;
10963    else {
10964      t = parent.predicate("fhir:" + parentType + '.' + name);
10965    }
10966    composeBackboneElement(t, "administrationGuidelines", name, element, index);
10967    for (int i = 0; i < element.getDosage().size(); i++)
10968      composeMedicationKnowledgeMedicationKnowledgeAdministrationGuidelinesDosageComponent(t, "MedicationKnowledge",
10969          "dosage", element.getDosage().get(i), i);
10970    if (element.hasIndication())
10971      composeType(t, "MedicationKnowledge", "indication", element.getIndication(), -1);
10972    for (int i = 0; i < element.getPatientCharacteristics().size(); i++)
10973      composeMedicationKnowledgeMedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent(t,
10974          "MedicationKnowledge", "patientCharacteristics", element.getPatientCharacteristics().get(i), i);
10975  }
10976
10977  protected void composeMedicationKnowledgeMedicationKnowledgeAdministrationGuidelinesDosageComponent(Complex parent,
10978      String parentType, String name,
10979      MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent element, int index) {
10980    if (element == null)
10981      return;
10982    Complex t;
10983    if (Utilities.noString(parentType))
10984      t = parent;
10985    else {
10986      t = parent.predicate("fhir:" + parentType + '.' + name);
10987    }
10988    composeBackboneElement(t, "dosage", name, element, index);
10989    if (element.hasType())
10990      composeCodeableConcept(t, "MedicationKnowledge", "type", element.getType(), -1);
10991    for (int i = 0; i < element.getDosage().size(); i++)
10992      composeDosage(t, "MedicationKnowledge", "dosage", element.getDosage().get(i), i);
10993  }
10994
10995  protected void composeMedicationKnowledgeMedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent(
10996      Complex parent, String parentType, String name,
10997      MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent element,
10998      int index) {
10999    if (element == null)
11000      return;
11001    Complex t;
11002    if (Utilities.noString(parentType))
11003      t = parent;
11004    else {
11005      t = parent.predicate("fhir:" + parentType + '.' + name);
11006    }
11007    composeBackboneElement(t, "patientCharacteristics", name, element, index);
11008    if (element.hasCharacteristic())
11009      composeType(t, "MedicationKnowledge", "characteristic", element.getCharacteristic(), -1);
11010    for (int i = 0; i < element.getValue().size(); i++)
11011      composeString(t, "MedicationKnowledge", "value", element.getValue().get(i), i);
11012  }
11013
11014  protected void composeMedicationKnowledgeMedicationKnowledgeMedicineClassificationComponent(Complex parent,
11015      String parentType, String name, MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent element,
11016      int index) {
11017    if (element == null)
11018      return;
11019    Complex t;
11020    if (Utilities.noString(parentType))
11021      t = parent;
11022    else {
11023      t = parent.predicate("fhir:" + parentType + '.' + name);
11024    }
11025    composeBackboneElement(t, "medicineClassification", name, element, index);
11026    if (element.hasType())
11027      composeCodeableConcept(t, "MedicationKnowledge", "type", element.getType(), -1);
11028    for (int i = 0; i < element.getClassification().size(); i++)
11029      composeCodeableConcept(t, "MedicationKnowledge", "classification", element.getClassification().get(i), i);
11030  }
11031
11032  protected void composeMedicationKnowledgeMedicationKnowledgePackagingComponent(Complex parent, String parentType,
11033      String name, MedicationKnowledge.MedicationKnowledgePackagingComponent element, int index) {
11034    if (element == null)
11035      return;
11036    Complex t;
11037    if (Utilities.noString(parentType))
11038      t = parent;
11039    else {
11040      t = parent.predicate("fhir:" + parentType + '.' + name);
11041    }
11042    composeBackboneElement(t, "packaging", name, element, index);
11043    if (element.hasType())
11044      composeCodeableConcept(t, "MedicationKnowledge", "type", element.getType(), -1);
11045    if (element.hasQuantity())
11046      composeQuantity(t, "MedicationKnowledge", "quantity", element.getQuantity(), -1);
11047  }
11048
11049  protected void composeMedicationKnowledgeMedicationKnowledgeDrugCharacteristicComponent(Complex parent,
11050      String parentType, String name, MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent element,
11051      int index) {
11052    if (element == null)
11053      return;
11054    Complex t;
11055    if (Utilities.noString(parentType))
11056      t = parent;
11057    else {
11058      t = parent.predicate("fhir:" + parentType + '.' + name);
11059    }
11060    composeBackboneElement(t, "drugCharacteristic", name, element, index);
11061    if (element.hasType())
11062      composeCodeableConcept(t, "MedicationKnowledge", "type", element.getType(), -1);
11063    if (element.hasValue())
11064      composeType(t, "MedicationKnowledge", "value", element.getValue(), -1);
11065  }
11066
11067  protected void composeMedicationKnowledgeMedicationKnowledgeRegulatoryComponent(Complex parent, String parentType,
11068      String name, MedicationKnowledge.MedicationKnowledgeRegulatoryComponent element, int index) {
11069    if (element == null)
11070      return;
11071    Complex t;
11072    if (Utilities.noString(parentType))
11073      t = parent;
11074    else {
11075      t = parent.predicate("fhir:" + parentType + '.' + name);
11076    }
11077    composeBackboneElement(t, "regulatory", name, element, index);
11078    if (element.hasRegulatoryAuthority())
11079      composeReference(t, "MedicationKnowledge", "regulatoryAuthority", element.getRegulatoryAuthority(), -1);
11080    for (int i = 0; i < element.getSubstitution().size(); i++)
11081      composeMedicationKnowledgeMedicationKnowledgeRegulatorySubstitutionComponent(t, "MedicationKnowledge",
11082          "substitution", element.getSubstitution().get(i), i);
11083    for (int i = 0; i < element.getSchedule().size(); i++)
11084      composeMedicationKnowledgeMedicationKnowledgeRegulatoryScheduleComponent(t, "MedicationKnowledge", "schedule",
11085          element.getSchedule().get(i), i);
11086    if (element.hasMaxDispense())
11087      composeMedicationKnowledgeMedicationKnowledgeRegulatoryMaxDispenseComponent(t, "MedicationKnowledge",
11088          "maxDispense", element.getMaxDispense(), -1);
11089  }
11090
11091  protected void composeMedicationKnowledgeMedicationKnowledgeRegulatorySubstitutionComponent(Complex parent,
11092      String parentType, String name, MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent element,
11093      int index) {
11094    if (element == null)
11095      return;
11096    Complex t;
11097    if (Utilities.noString(parentType))
11098      t = parent;
11099    else {
11100      t = parent.predicate("fhir:" + parentType + '.' + name);
11101    }
11102    composeBackboneElement(t, "substitution", name, element, index);
11103    if (element.hasType())
11104      composeCodeableConcept(t, "MedicationKnowledge", "type", element.getType(), -1);
11105    if (element.hasAllowedElement())
11106      composeBoolean(t, "MedicationKnowledge", "allowed", element.getAllowedElement(), -1);
11107  }
11108
11109  protected void composeMedicationKnowledgeMedicationKnowledgeRegulatoryScheduleComponent(Complex parent,
11110      String parentType, String name, MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent element,
11111      int index) {
11112    if (element == null)
11113      return;
11114    Complex t;
11115    if (Utilities.noString(parentType))
11116      t = parent;
11117    else {
11118      t = parent.predicate("fhir:" + parentType + '.' + name);
11119    }
11120    composeBackboneElement(t, "schedule", name, element, index);
11121    if (element.hasSchedule())
11122      composeCodeableConcept(t, "MedicationKnowledge", "schedule", element.getSchedule(), -1);
11123  }
11124
11125  protected void composeMedicationKnowledgeMedicationKnowledgeRegulatoryMaxDispenseComponent(Complex parent,
11126      String parentType, String name, MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent element,
11127      int index) {
11128    if (element == null)
11129      return;
11130    Complex t;
11131    if (Utilities.noString(parentType))
11132      t = parent;
11133    else {
11134      t = parent.predicate("fhir:" + parentType + '.' + name);
11135    }
11136    composeBackboneElement(t, "maxDispense", name, element, index);
11137    if (element.hasQuantity())
11138      composeQuantity(t, "MedicationKnowledge", "quantity", element.getQuantity(), -1);
11139    if (element.hasPeriod())
11140      composeDuration(t, "MedicationKnowledge", "period", element.getPeriod(), -1);
11141  }
11142
11143  protected void composeMedicationKnowledgeMedicationKnowledgeKineticsComponent(Complex parent, String parentType,
11144      String name, MedicationKnowledge.MedicationKnowledgeKineticsComponent element, int index) {
11145    if (element == null)
11146      return;
11147    Complex t;
11148    if (Utilities.noString(parentType))
11149      t = parent;
11150    else {
11151      t = parent.predicate("fhir:" + parentType + '.' + name);
11152    }
11153    composeBackboneElement(t, "kinetics", name, element, index);
11154    for (int i = 0; i < element.getAreaUnderCurve().size(); i++)
11155      composeQuantity(t, "MedicationKnowledge", "areaUnderCurve", element.getAreaUnderCurve().get(i), i);
11156    for (int i = 0; i < element.getLethalDose50().size(); i++)
11157      composeQuantity(t, "MedicationKnowledge", "lethalDose50", element.getLethalDose50().get(i), i);
11158    if (element.hasHalfLifePeriod())
11159      composeDuration(t, "MedicationKnowledge", "halfLifePeriod", element.getHalfLifePeriod(), -1);
11160  }
11161
11162  protected void composeMedicationRequest(Complex parent, String parentType, String name, MedicationRequest element,
11163      int index) {
11164    if (element == null)
11165      return;
11166    Complex t;
11167    if (Utilities.noString(parentType))
11168      t = parent;
11169    else {
11170      t = parent.predicate("fhir:" + parentType + '.' + name);
11171    }
11172    composeDomainResource(t, "MedicationRequest", name, element, index);
11173    for (int i = 0; i < element.getIdentifier().size(); i++)
11174      composeIdentifier(t, "MedicationRequest", "identifier", element.getIdentifier().get(i), i);
11175    if (element.hasStatusElement())
11176      composeEnum(t, "MedicationRequest", "status", element.getStatusElement(), -1);
11177    if (element.hasStatusReason())
11178      composeCodeableConcept(t, "MedicationRequest", "statusReason", element.getStatusReason(), -1);
11179    if (element.hasIntentElement())
11180      composeEnum(t, "MedicationRequest", "intent", element.getIntentElement(), -1);
11181    for (int i = 0; i < element.getCategory().size(); i++)
11182      composeCodeableConcept(t, "MedicationRequest", "category", element.getCategory().get(i), i);
11183    if (element.hasPriorityElement())
11184      composeEnum(t, "MedicationRequest", "priority", element.getPriorityElement(), -1);
11185    if (element.hasDoNotPerformElement())
11186      composeBoolean(t, "MedicationRequest", "doNotPerform", element.getDoNotPerformElement(), -1);
11187    if (element.hasReported())
11188      composeType(t, "MedicationRequest", "reported", element.getReported(), -1);
11189    if (element.hasMedication())
11190      composeType(t, "MedicationRequest", "medication", element.getMedication(), -1);
11191    if (element.hasSubject())
11192      composeReference(t, "MedicationRequest", "subject", element.getSubject(), -1);
11193    if (element.hasEncounter())
11194      composeReference(t, "MedicationRequest", "encounter", element.getEncounter(), -1);
11195    for (int i = 0; i < element.getSupportingInformation().size(); i++)
11196      composeReference(t, "MedicationRequest", "supportingInformation", element.getSupportingInformation().get(i), i);
11197    if (element.hasAuthoredOnElement())
11198      composeDateTime(t, "MedicationRequest", "authoredOn", element.getAuthoredOnElement(), -1);
11199    if (element.hasRequester())
11200      composeReference(t, "MedicationRequest", "requester", element.getRequester(), -1);
11201    if (element.hasPerformer())
11202      composeReference(t, "MedicationRequest", "performer", element.getPerformer(), -1);
11203    if (element.hasPerformerType())
11204      composeCodeableConcept(t, "MedicationRequest", "performerType", element.getPerformerType(), -1);
11205    if (element.hasRecorder())
11206      composeReference(t, "MedicationRequest", "recorder", element.getRecorder(), -1);
11207    for (int i = 0; i < element.getReasonCode().size(); i++)
11208      composeCodeableConcept(t, "MedicationRequest", "reasonCode", element.getReasonCode().get(i), i);
11209    for (int i = 0; i < element.getReasonReference().size(); i++)
11210      composeReference(t, "MedicationRequest", "reasonReference", element.getReasonReference().get(i), i);
11211    for (int i = 0; i < element.getInstantiatesCanonical().size(); i++)
11212      composeCanonical(t, "MedicationRequest", "instantiatesCanonical", element.getInstantiatesCanonical().get(i), i);
11213    for (int i = 0; i < element.getInstantiatesUri().size(); i++)
11214      composeUri(t, "MedicationRequest", "instantiatesUri", element.getInstantiatesUri().get(i), i);
11215    for (int i = 0; i < element.getBasedOn().size(); i++)
11216      composeReference(t, "MedicationRequest", "basedOn", element.getBasedOn().get(i), i);
11217    if (element.hasGroupIdentifier())
11218      composeIdentifier(t, "MedicationRequest", "groupIdentifier", element.getGroupIdentifier(), -1);
11219    if (element.hasCourseOfTherapyType())
11220      composeCodeableConcept(t, "MedicationRequest", "courseOfTherapyType", element.getCourseOfTherapyType(), -1);
11221    for (int i = 0; i < element.getInsurance().size(); i++)
11222      composeReference(t, "MedicationRequest", "insurance", element.getInsurance().get(i), i);
11223    for (int i = 0; i < element.getNote().size(); i++)
11224      composeAnnotation(t, "MedicationRequest", "note", element.getNote().get(i), i);
11225    for (int i = 0; i < element.getDosageInstruction().size(); i++)
11226      composeDosage(t, "MedicationRequest", "dosageInstruction", element.getDosageInstruction().get(i), i);
11227    if (element.hasDispenseRequest())
11228      composeMedicationRequestMedicationRequestDispenseRequestComponent(t, "MedicationRequest", "dispenseRequest",
11229          element.getDispenseRequest(), -1);
11230    if (element.hasSubstitution())
11231      composeMedicationRequestMedicationRequestSubstitutionComponent(t, "MedicationRequest", "substitution",
11232          element.getSubstitution(), -1);
11233    if (element.hasPriorPrescription())
11234      composeReference(t, "MedicationRequest", "priorPrescription", element.getPriorPrescription(), -1);
11235    for (int i = 0; i < element.getDetectedIssue().size(); i++)
11236      composeReference(t, "MedicationRequest", "detectedIssue", element.getDetectedIssue().get(i), i);
11237    for (int i = 0; i < element.getEventHistory().size(); i++)
11238      composeReference(t, "MedicationRequest", "eventHistory", element.getEventHistory().get(i), i);
11239  }
11240
11241  protected void composeMedicationRequestMedicationRequestDispenseRequestComponent(Complex parent, String parentType,
11242      String name, MedicationRequest.MedicationRequestDispenseRequestComponent element, int index) {
11243    if (element == null)
11244      return;
11245    Complex t;
11246    if (Utilities.noString(parentType))
11247      t = parent;
11248    else {
11249      t = parent.predicate("fhir:" + parentType + '.' + name);
11250    }
11251    composeBackboneElement(t, "dispenseRequest", name, element, index);
11252    if (element.hasInitialFill())
11253      composeMedicationRequestMedicationRequestDispenseRequestInitialFillComponent(t, "MedicationRequest",
11254          "initialFill", element.getInitialFill(), -1);
11255    if (element.hasDispenseInterval())
11256      composeDuration(t, "MedicationRequest", "dispenseInterval", element.getDispenseInterval(), -1);
11257    if (element.hasValidityPeriod())
11258      composePeriod(t, "MedicationRequest", "validityPeriod", element.getValidityPeriod(), -1);
11259    if (element.hasNumberOfRepeatsAllowedElement())
11260      composeUnsignedInt(t, "MedicationRequest", "numberOfRepeatsAllowed", element.getNumberOfRepeatsAllowedElement(),
11261          -1);
11262    if (element.hasQuantity())
11263      composeQuantity(t, "MedicationRequest", "quantity", element.getQuantity(), -1);
11264    if (element.hasExpectedSupplyDuration())
11265      composeDuration(t, "MedicationRequest", "expectedSupplyDuration", element.getExpectedSupplyDuration(), -1);
11266    if (element.hasPerformer())
11267      composeReference(t, "MedicationRequest", "performer", element.getPerformer(), -1);
11268  }
11269
11270  protected void composeMedicationRequestMedicationRequestDispenseRequestInitialFillComponent(Complex parent,
11271      String parentType, String name, MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent element,
11272      int index) {
11273    if (element == null)
11274      return;
11275    Complex t;
11276    if (Utilities.noString(parentType))
11277      t = parent;
11278    else {
11279      t = parent.predicate("fhir:" + parentType + '.' + name);
11280    }
11281    composeBackboneElement(t, "initialFill", name, element, index);
11282    if (element.hasQuantity())
11283      composeQuantity(t, "MedicationRequest", "quantity", element.getQuantity(), -1);
11284    if (element.hasDuration())
11285      composeDuration(t, "MedicationRequest", "duration", element.getDuration(), -1);
11286  }
11287
11288  protected void composeMedicationRequestMedicationRequestSubstitutionComponent(Complex parent, String parentType,
11289      String name, MedicationRequest.MedicationRequestSubstitutionComponent element, int index) {
11290    if (element == null)
11291      return;
11292    Complex t;
11293    if (Utilities.noString(parentType))
11294      t = parent;
11295    else {
11296      t = parent.predicate("fhir:" + parentType + '.' + name);
11297    }
11298    composeBackboneElement(t, "substitution", name, element, index);
11299    if (element.hasAllowed())
11300      composeType(t, "MedicationRequest", "allowed", element.getAllowed(), -1);
11301    if (element.hasReason())
11302      composeCodeableConcept(t, "MedicationRequest", "reason", element.getReason(), -1);
11303  }
11304
11305  protected void composeMedicationStatement(Complex parent, String parentType, String name, MedicationStatement element,
11306      int index) {
11307    if (element == null)
11308      return;
11309    Complex t;
11310    if (Utilities.noString(parentType))
11311      t = parent;
11312    else {
11313      t = parent.predicate("fhir:" + parentType + '.' + name);
11314    }
11315    composeDomainResource(t, "MedicationStatement", name, element, index);
11316    for (int i = 0; i < element.getIdentifier().size(); i++)
11317      composeIdentifier(t, "MedicationStatement", "identifier", element.getIdentifier().get(i), i);
11318    for (int i = 0; i < element.getBasedOn().size(); i++)
11319      composeReference(t, "MedicationStatement", "basedOn", element.getBasedOn().get(i), i);
11320    for (int i = 0; i < element.getPartOf().size(); i++)
11321      composeReference(t, "MedicationStatement", "partOf", element.getPartOf().get(i), i);
11322    if (element.hasStatusElement())
11323      composeEnum(t, "MedicationStatement", "status", element.getStatusElement(), -1);
11324    for (int i = 0; i < element.getStatusReason().size(); i++)
11325      composeCodeableConcept(t, "MedicationStatement", "statusReason", element.getStatusReason().get(i), i);
11326    if (element.hasCategory())
11327      composeCodeableConcept(t, "MedicationStatement", "category", element.getCategory(), -1);
11328    if (element.hasMedication())
11329      composeType(t, "MedicationStatement", "medication", element.getMedication(), -1);
11330    if (element.hasSubject())
11331      composeReference(t, "MedicationStatement", "subject", element.getSubject(), -1);
11332    if (element.hasContext())
11333      composeReference(t, "MedicationStatement", "context", element.getContext(), -1);
11334    if (element.hasEffective())
11335      composeType(t, "MedicationStatement", "effective", element.getEffective(), -1);
11336    if (element.hasDateAssertedElement())
11337      composeDateTime(t, "MedicationStatement", "dateAsserted", element.getDateAssertedElement(), -1);
11338    if (element.hasInformationSource())
11339      composeReference(t, "MedicationStatement", "informationSource", element.getInformationSource(), -1);
11340    for (int i = 0; i < element.getDerivedFrom().size(); i++)
11341      composeReference(t, "MedicationStatement", "derivedFrom", element.getDerivedFrom().get(i), i);
11342    for (int i = 0; i < element.getReasonCode().size(); i++)
11343      composeCodeableConcept(t, "MedicationStatement", "reasonCode", element.getReasonCode().get(i), i);
11344    for (int i = 0; i < element.getReasonReference().size(); i++)
11345      composeReference(t, "MedicationStatement", "reasonReference", element.getReasonReference().get(i), i);
11346    for (int i = 0; i < element.getNote().size(); i++)
11347      composeAnnotation(t, "MedicationStatement", "note", element.getNote().get(i), i);
11348    for (int i = 0; i < element.getDosage().size(); i++)
11349      composeDosage(t, "MedicationStatement", "dosage", element.getDosage().get(i), i);
11350  }
11351
11352  protected void composeMedicinalProduct(Complex parent, String parentType, String name, MedicinalProduct element,
11353      int index) {
11354    if (element == null)
11355      return;
11356    Complex t;
11357    if (Utilities.noString(parentType))
11358      t = parent;
11359    else {
11360      t = parent.predicate("fhir:" + parentType + '.' + name);
11361    }
11362    composeDomainResource(t, "MedicinalProduct", name, element, index);
11363    for (int i = 0; i < element.getIdentifier().size(); i++)
11364      composeIdentifier(t, "MedicinalProduct", "identifier", element.getIdentifier().get(i), i);
11365    if (element.hasType())
11366      composeCodeableConcept(t, "MedicinalProduct", "type", element.getType(), -1);
11367    if (element.hasDomain())
11368      composeCoding(t, "MedicinalProduct", "domain", element.getDomain(), -1);
11369    if (element.hasCombinedPharmaceuticalDoseForm())
11370      composeCodeableConcept(t, "MedicinalProduct", "combinedPharmaceuticalDoseForm",
11371          element.getCombinedPharmaceuticalDoseForm(), -1);
11372    if (element.hasLegalStatusOfSupply())
11373      composeCodeableConcept(t, "MedicinalProduct", "legalStatusOfSupply", element.getLegalStatusOfSupply(), -1);
11374    if (element.hasAdditionalMonitoringIndicator())
11375      composeCodeableConcept(t, "MedicinalProduct", "additionalMonitoringIndicator",
11376          element.getAdditionalMonitoringIndicator(), -1);
11377    for (int i = 0; i < element.getSpecialMeasures().size(); i++)
11378      composeString(t, "MedicinalProduct", "specialMeasures", element.getSpecialMeasures().get(i), i);
11379    if (element.hasPaediatricUseIndicator())
11380      composeCodeableConcept(t, "MedicinalProduct", "paediatricUseIndicator", element.getPaediatricUseIndicator(), -1);
11381    for (int i = 0; i < element.getProductClassification().size(); i++)
11382      composeCodeableConcept(t, "MedicinalProduct", "productClassification", element.getProductClassification().get(i),
11383          i);
11384    for (int i = 0; i < element.getMarketingStatus().size(); i++)
11385      composeMarketingStatus(t, "MedicinalProduct", "marketingStatus", element.getMarketingStatus().get(i), i);
11386    for (int i = 0; i < element.getPharmaceuticalProduct().size(); i++)
11387      composeReference(t, "MedicinalProduct", "pharmaceuticalProduct", element.getPharmaceuticalProduct().get(i), i);
11388    for (int i = 0; i < element.getPackagedMedicinalProduct().size(); i++)
11389      composeReference(t, "MedicinalProduct", "packagedMedicinalProduct", element.getPackagedMedicinalProduct().get(i),
11390          i);
11391    for (int i = 0; i < element.getAttachedDocument().size(); i++)
11392      composeReference(t, "MedicinalProduct", "attachedDocument", element.getAttachedDocument().get(i), i);
11393    for (int i = 0; i < element.getMasterFile().size(); i++)
11394      composeReference(t, "MedicinalProduct", "masterFile", element.getMasterFile().get(i), i);
11395    for (int i = 0; i < element.getContact().size(); i++)
11396      composeReference(t, "MedicinalProduct", "contact", element.getContact().get(i), i);
11397    for (int i = 0; i < element.getClinicalTrial().size(); i++)
11398      composeReference(t, "MedicinalProduct", "clinicalTrial", element.getClinicalTrial().get(i), i);
11399    for (int i = 0; i < element.getName().size(); i++)
11400      composeMedicinalProductMedicinalProductNameComponent(t, "MedicinalProduct", "name", element.getName().get(i), i);
11401    for (int i = 0; i < element.getCrossReference().size(); i++)
11402      composeIdentifier(t, "MedicinalProduct", "crossReference", element.getCrossReference().get(i), i);
11403    for (int i = 0; i < element.getManufacturingBusinessOperation().size(); i++)
11404      composeMedicinalProductMedicinalProductManufacturingBusinessOperationComponent(t, "MedicinalProduct",
11405          "manufacturingBusinessOperation", element.getManufacturingBusinessOperation().get(i), i);
11406    for (int i = 0; i < element.getSpecialDesignation().size(); i++)
11407      composeMedicinalProductMedicinalProductSpecialDesignationComponent(t, "MedicinalProduct", "specialDesignation",
11408          element.getSpecialDesignation().get(i), i);
11409  }
11410
11411  protected void composeMedicinalProductMedicinalProductNameComponent(Complex parent, String parentType, String name,
11412      MedicinalProduct.MedicinalProductNameComponent element, int index) {
11413    if (element == null)
11414      return;
11415    Complex t;
11416    if (Utilities.noString(parentType))
11417      t = parent;
11418    else {
11419      t = parent.predicate("fhir:" + parentType + '.' + name);
11420    }
11421    composeBackboneElement(t, "name", name, element, index);
11422    if (element.hasProductNameElement())
11423      composeString(t, "MedicinalProduct", "productName", element.getProductNameElement(), -1);
11424    for (int i = 0; i < element.getNamePart().size(); i++)
11425      composeMedicinalProductMedicinalProductNameNamePartComponent(t, "MedicinalProduct", "namePart",
11426          element.getNamePart().get(i), i);
11427    for (int i = 0; i < element.getCountryLanguage().size(); i++)
11428      composeMedicinalProductMedicinalProductNameCountryLanguageComponent(t, "MedicinalProduct", "countryLanguage",
11429          element.getCountryLanguage().get(i), i);
11430  }
11431
11432  protected void composeMedicinalProductMedicinalProductNameNamePartComponent(Complex parent, String parentType,
11433      String name, MedicinalProduct.MedicinalProductNameNamePartComponent element, int index) {
11434    if (element == null)
11435      return;
11436    Complex t;
11437    if (Utilities.noString(parentType))
11438      t = parent;
11439    else {
11440      t = parent.predicate("fhir:" + parentType + '.' + name);
11441    }
11442    composeBackboneElement(t, "namePart", name, element, index);
11443    if (element.hasPartElement())
11444      composeString(t, "MedicinalProduct", "part", element.getPartElement(), -1);
11445    if (element.hasType())
11446      composeCoding(t, "MedicinalProduct", "type", element.getType(), -1);
11447  }
11448
11449  protected void composeMedicinalProductMedicinalProductNameCountryLanguageComponent(Complex parent, String parentType,
11450      String name, MedicinalProduct.MedicinalProductNameCountryLanguageComponent element, int index) {
11451    if (element == null)
11452      return;
11453    Complex t;
11454    if (Utilities.noString(parentType))
11455      t = parent;
11456    else {
11457      t = parent.predicate("fhir:" + parentType + '.' + name);
11458    }
11459    composeBackboneElement(t, "countryLanguage", name, element, index);
11460    if (element.hasCountry())
11461      composeCodeableConcept(t, "MedicinalProduct", "country", element.getCountry(), -1);
11462    if (element.hasJurisdiction())
11463      composeCodeableConcept(t, "MedicinalProduct", "jurisdiction", element.getJurisdiction(), -1);
11464    if (element.hasLanguage())
11465      composeCodeableConcept(t, "MedicinalProduct", "language", element.getLanguage(), -1);
11466  }
11467
11468  protected void composeMedicinalProductMedicinalProductManufacturingBusinessOperationComponent(Complex parent,
11469      String parentType, String name, MedicinalProduct.MedicinalProductManufacturingBusinessOperationComponent element,
11470      int index) {
11471    if (element == null)
11472      return;
11473    Complex t;
11474    if (Utilities.noString(parentType))
11475      t = parent;
11476    else {
11477      t = parent.predicate("fhir:" + parentType + '.' + name);
11478    }
11479    composeBackboneElement(t, "manufacturingBusinessOperation", name, element, index);
11480    if (element.hasOperationType())
11481      composeCodeableConcept(t, "MedicinalProduct", "operationType", element.getOperationType(), -1);
11482    if (element.hasAuthorisationReferenceNumber())
11483      composeIdentifier(t, "MedicinalProduct", "authorisationReferenceNumber",
11484          element.getAuthorisationReferenceNumber(), -1);
11485    if (element.hasEffectiveDateElement())
11486      composeDateTime(t, "MedicinalProduct", "effectiveDate", element.getEffectiveDateElement(), -1);
11487    if (element.hasConfidentialityIndicator())
11488      composeCodeableConcept(t, "MedicinalProduct", "confidentialityIndicator", element.getConfidentialityIndicator(),
11489          -1);
11490    for (int i = 0; i < element.getManufacturer().size(); i++)
11491      composeReference(t, "MedicinalProduct", "manufacturer", element.getManufacturer().get(i), i);
11492    if (element.hasRegulator())
11493      composeReference(t, "MedicinalProduct", "regulator", element.getRegulator(), -1);
11494  }
11495
11496  protected void composeMedicinalProductMedicinalProductSpecialDesignationComponent(Complex parent, String parentType,
11497      String name, MedicinalProduct.MedicinalProductSpecialDesignationComponent element, int index) {
11498    if (element == null)
11499      return;
11500    Complex t;
11501    if (Utilities.noString(parentType))
11502      t = parent;
11503    else {
11504      t = parent.predicate("fhir:" + parentType + '.' + name);
11505    }
11506    composeBackboneElement(t, "specialDesignation", name, element, index);
11507    for (int i = 0; i < element.getIdentifier().size(); i++)
11508      composeIdentifier(t, "MedicinalProduct", "identifier", element.getIdentifier().get(i), i);
11509    if (element.hasType())
11510      composeCodeableConcept(t, "MedicinalProduct", "type", element.getType(), -1);
11511    if (element.hasIntendedUse())
11512      composeCodeableConcept(t, "MedicinalProduct", "intendedUse", element.getIntendedUse(), -1);
11513    if (element.hasIndication())
11514      composeType(t, "MedicinalProduct", "indication", element.getIndication(), -1);
11515    if (element.hasStatus())
11516      composeCodeableConcept(t, "MedicinalProduct", "status", element.getStatus(), -1);
11517    if (element.hasDateElement())
11518      composeDateTime(t, "MedicinalProduct", "date", element.getDateElement(), -1);
11519    if (element.hasSpecies())
11520      composeCodeableConcept(t, "MedicinalProduct", "species", element.getSpecies(), -1);
11521  }
11522
11523  protected void composeMedicinalProductAuthorization(Complex parent, String parentType, String name,
11524      MedicinalProductAuthorization element, int index) {
11525    if (element == null)
11526      return;
11527    Complex t;
11528    if (Utilities.noString(parentType))
11529      t = parent;
11530    else {
11531      t = parent.predicate("fhir:" + parentType + '.' + name);
11532    }
11533    composeDomainResource(t, "MedicinalProductAuthorization", name, element, index);
11534    for (int i = 0; i < element.getIdentifier().size(); i++)
11535      composeIdentifier(t, "MedicinalProductAuthorization", "identifier", element.getIdentifier().get(i), i);
11536    if (element.hasSubject())
11537      composeReference(t, "MedicinalProductAuthorization", "subject", element.getSubject(), -1);
11538    for (int i = 0; i < element.getCountry().size(); i++)
11539      composeCodeableConcept(t, "MedicinalProductAuthorization", "country", element.getCountry().get(i), i);
11540    for (int i = 0; i < element.getJurisdiction().size(); i++)
11541      composeCodeableConcept(t, "MedicinalProductAuthorization", "jurisdiction", element.getJurisdiction().get(i), i);
11542    if (element.hasStatus())
11543      composeCodeableConcept(t, "MedicinalProductAuthorization", "status", element.getStatus(), -1);
11544    if (element.hasStatusDateElement())
11545      composeDateTime(t, "MedicinalProductAuthorization", "statusDate", element.getStatusDateElement(), -1);
11546    if (element.hasRestoreDateElement())
11547      composeDateTime(t, "MedicinalProductAuthorization", "restoreDate", element.getRestoreDateElement(), -1);
11548    if (element.hasValidityPeriod())
11549      composePeriod(t, "MedicinalProductAuthorization", "validityPeriod", element.getValidityPeriod(), -1);
11550    if (element.hasDataExclusivityPeriod())
11551      composePeriod(t, "MedicinalProductAuthorization", "dataExclusivityPeriod", element.getDataExclusivityPeriod(),
11552          -1);
11553    if (element.hasDateOfFirstAuthorizationElement())
11554      composeDateTime(t, "MedicinalProductAuthorization", "dateOfFirstAuthorization",
11555          element.getDateOfFirstAuthorizationElement(), -1);
11556    if (element.hasInternationalBirthDateElement())
11557      composeDateTime(t, "MedicinalProductAuthorization", "internationalBirthDate",
11558          element.getInternationalBirthDateElement(), -1);
11559    if (element.hasLegalBasis())
11560      composeCodeableConcept(t, "MedicinalProductAuthorization", "legalBasis", element.getLegalBasis(), -1);
11561    for (int i = 0; i < element.getJurisdictionalAuthorization().size(); i++)
11562      composeMedicinalProductAuthorizationMedicinalProductAuthorizationJurisdictionalAuthorizationComponent(t,
11563          "MedicinalProductAuthorization", "jurisdictionalAuthorization",
11564          element.getJurisdictionalAuthorization().get(i), i);
11565    if (element.hasHolder())
11566      composeReference(t, "MedicinalProductAuthorization", "holder", element.getHolder(), -1);
11567    if (element.hasRegulator())
11568      composeReference(t, "MedicinalProductAuthorization", "regulator", element.getRegulator(), -1);
11569    if (element.hasProcedure())
11570      composeMedicinalProductAuthorizationMedicinalProductAuthorizationProcedureComponent(t,
11571          "MedicinalProductAuthorization", "procedure", element.getProcedure(), -1);
11572  }
11573
11574  protected void composeMedicinalProductAuthorizationMedicinalProductAuthorizationJurisdictionalAuthorizationComponent(
11575      Complex parent, String parentType, String name,
11576      MedicinalProductAuthorization.MedicinalProductAuthorizationJurisdictionalAuthorizationComponent element,
11577      int index) {
11578    if (element == null)
11579      return;
11580    Complex t;
11581    if (Utilities.noString(parentType))
11582      t = parent;
11583    else {
11584      t = parent.predicate("fhir:" + parentType + '.' + name);
11585    }
11586    composeBackboneElement(t, "jurisdictionalAuthorization", name, element, index);
11587    for (int i = 0; i < element.getIdentifier().size(); i++)
11588      composeIdentifier(t, "MedicinalProductAuthorization", "identifier", element.getIdentifier().get(i), i);
11589    if (element.hasCountry())
11590      composeCodeableConcept(t, "MedicinalProductAuthorization", "country", element.getCountry(), -1);
11591    for (int i = 0; i < element.getJurisdiction().size(); i++)
11592      composeCodeableConcept(t, "MedicinalProductAuthorization", "jurisdiction", element.getJurisdiction().get(i), i);
11593    if (element.hasLegalStatusOfSupply())
11594      composeCodeableConcept(t, "MedicinalProductAuthorization", "legalStatusOfSupply",
11595          element.getLegalStatusOfSupply(), -1);
11596    if (element.hasValidityPeriod())
11597      composePeriod(t, "MedicinalProductAuthorization", "validityPeriod", element.getValidityPeriod(), -1);
11598  }
11599
11600  protected void composeMedicinalProductAuthorizationMedicinalProductAuthorizationProcedureComponent(Complex parent,
11601      String parentType, String name,
11602      MedicinalProductAuthorization.MedicinalProductAuthorizationProcedureComponent element, int index) {
11603    if (element == null)
11604      return;
11605    Complex t;
11606    if (Utilities.noString(parentType))
11607      t = parent;
11608    else {
11609      t = parent.predicate("fhir:" + parentType + '.' + name);
11610    }
11611    composeBackboneElement(t, "procedure", name, element, index);
11612    if (element.hasIdentifier())
11613      composeIdentifier(t, "MedicinalProductAuthorization", "identifier", element.getIdentifier(), -1);
11614    if (element.hasType())
11615      composeCodeableConcept(t, "MedicinalProductAuthorization", "type", element.getType(), -1);
11616    if (element.hasDate())
11617      composeType(t, "MedicinalProductAuthorization", "date", element.getDate(), -1);
11618    for (int i = 0; i < element.getApplication().size(); i++)
11619      composeMedicinalProductAuthorizationMedicinalProductAuthorizationProcedureComponent(t,
11620          "MedicinalProductAuthorization", "application", element.getApplication().get(i), i);
11621  }
11622
11623  protected void composeMedicinalProductContraindication(Complex parent, String parentType, String name,
11624      MedicinalProductContraindication element, int index) {
11625    if (element == null)
11626      return;
11627    Complex t;
11628    if (Utilities.noString(parentType))
11629      t = parent;
11630    else {
11631      t = parent.predicate("fhir:" + parentType + '.' + name);
11632    }
11633    composeDomainResource(t, "MedicinalProductContraindication", name, element, index);
11634    for (int i = 0; i < element.getSubject().size(); i++)
11635      composeReference(t, "MedicinalProductContraindication", "subject", element.getSubject().get(i), i);
11636    if (element.hasDisease())
11637      composeCodeableConcept(t, "MedicinalProductContraindication", "disease", element.getDisease(), -1);
11638    if (element.hasDiseaseStatus())
11639      composeCodeableConcept(t, "MedicinalProductContraindication", "diseaseStatus", element.getDiseaseStatus(), -1);
11640    for (int i = 0; i < element.getComorbidity().size(); i++)
11641      composeCodeableConcept(t, "MedicinalProductContraindication", "comorbidity", element.getComorbidity().get(i), i);
11642    for (int i = 0; i < element.getTherapeuticIndication().size(); i++)
11643      composeReference(t, "MedicinalProductContraindication", "therapeuticIndication",
11644          element.getTherapeuticIndication().get(i), i);
11645    for (int i = 0; i < element.getOtherTherapy().size(); i++)
11646      composeMedicinalProductContraindicationMedicinalProductContraindicationOtherTherapyComponent(t,
11647          "MedicinalProductContraindication", "otherTherapy", element.getOtherTherapy().get(i), i);
11648    for (int i = 0; i < element.getPopulation().size(); i++)
11649      composePopulation(t, "MedicinalProductContraindication", "population", element.getPopulation().get(i), i);
11650  }
11651
11652  protected void composeMedicinalProductContraindicationMedicinalProductContraindicationOtherTherapyComponent(
11653      Complex parent, String parentType, String name,
11654      MedicinalProductContraindication.MedicinalProductContraindicationOtherTherapyComponent element, int index) {
11655    if (element == null)
11656      return;
11657    Complex t;
11658    if (Utilities.noString(parentType))
11659      t = parent;
11660    else {
11661      t = parent.predicate("fhir:" + parentType + '.' + name);
11662    }
11663    composeBackboneElement(t, "otherTherapy", name, element, index);
11664    if (element.hasTherapyRelationshipType())
11665      composeCodeableConcept(t, "MedicinalProductContraindication", "therapyRelationshipType",
11666          element.getTherapyRelationshipType(), -1);
11667    if (element.hasMedication())
11668      composeType(t, "MedicinalProductContraindication", "medication", element.getMedication(), -1);
11669  }
11670
11671  protected void composeMedicinalProductIndication(Complex parent, String parentType, String name,
11672      MedicinalProductIndication element, int index) {
11673    if (element == null)
11674      return;
11675    Complex t;
11676    if (Utilities.noString(parentType))
11677      t = parent;
11678    else {
11679      t = parent.predicate("fhir:" + parentType + '.' + name);
11680    }
11681    composeDomainResource(t, "MedicinalProductIndication", name, element, index);
11682    for (int i = 0; i < element.getSubject().size(); i++)
11683      composeReference(t, "MedicinalProductIndication", "subject", element.getSubject().get(i), i);
11684    if (element.hasDiseaseSymptomProcedure())
11685      composeCodeableConcept(t, "MedicinalProductIndication", "diseaseSymptomProcedure",
11686          element.getDiseaseSymptomProcedure(), -1);
11687    if (element.hasDiseaseStatus())
11688      composeCodeableConcept(t, "MedicinalProductIndication", "diseaseStatus", element.getDiseaseStatus(), -1);
11689    for (int i = 0; i < element.getComorbidity().size(); i++)
11690      composeCodeableConcept(t, "MedicinalProductIndication", "comorbidity", element.getComorbidity().get(i), i);
11691    if (element.hasIntendedEffect())
11692      composeCodeableConcept(t, "MedicinalProductIndication", "intendedEffect", element.getIntendedEffect(), -1);
11693    if (element.hasDuration())
11694      composeQuantity(t, "MedicinalProductIndication", "duration", element.getDuration(), -1);
11695    for (int i = 0; i < element.getOtherTherapy().size(); i++)
11696      composeMedicinalProductIndicationMedicinalProductIndicationOtherTherapyComponent(t, "MedicinalProductIndication",
11697          "otherTherapy", element.getOtherTherapy().get(i), i);
11698    for (int i = 0; i < element.getUndesirableEffect().size(); i++)
11699      composeReference(t, "MedicinalProductIndication", "undesirableEffect", element.getUndesirableEffect().get(i), i);
11700    for (int i = 0; i < element.getPopulation().size(); i++)
11701      composePopulation(t, "MedicinalProductIndication", "population", element.getPopulation().get(i), i);
11702  }
11703
11704  protected void composeMedicinalProductIndicationMedicinalProductIndicationOtherTherapyComponent(Complex parent,
11705      String parentType, String name,
11706      MedicinalProductIndication.MedicinalProductIndicationOtherTherapyComponent element, int index) {
11707    if (element == null)
11708      return;
11709    Complex t;
11710    if (Utilities.noString(parentType))
11711      t = parent;
11712    else {
11713      t = parent.predicate("fhir:" + parentType + '.' + name);
11714    }
11715    composeBackboneElement(t, "otherTherapy", name, element, index);
11716    if (element.hasTherapyRelationshipType())
11717      composeCodeableConcept(t, "MedicinalProductIndication", "therapyRelationshipType",
11718          element.getTherapyRelationshipType(), -1);
11719    if (element.hasMedication())
11720      composeType(t, "MedicinalProductIndication", "medication", element.getMedication(), -1);
11721  }
11722
11723  protected void composeMedicinalProductIngredient(Complex parent, String parentType, String name,
11724      MedicinalProductIngredient element, int index) {
11725    if (element == null)
11726      return;
11727    Complex t;
11728    if (Utilities.noString(parentType))
11729      t = parent;
11730    else {
11731      t = parent.predicate("fhir:" + parentType + '.' + name);
11732    }
11733    composeDomainResource(t, "MedicinalProductIngredient", name, element, index);
11734    if (element.hasIdentifier())
11735      composeIdentifier(t, "MedicinalProductIngredient", "identifier", element.getIdentifier(), -1);
11736    if (element.hasRole())
11737      composeCodeableConcept(t, "MedicinalProductIngredient", "role", element.getRole(), -1);
11738    if (element.hasAllergenicIndicatorElement())
11739      composeBoolean(t, "MedicinalProductIngredient", "allergenicIndicator", element.getAllergenicIndicatorElement(),
11740          -1);
11741    for (int i = 0; i < element.getManufacturer().size(); i++)
11742      composeReference(t, "MedicinalProductIngredient", "manufacturer", element.getManufacturer().get(i), i);
11743    for (int i = 0; i < element.getSpecifiedSubstance().size(); i++)
11744      composeMedicinalProductIngredientMedicinalProductIngredientSpecifiedSubstanceComponent(t,
11745          "MedicinalProductIngredient", "specifiedSubstance", element.getSpecifiedSubstance().get(i), i);
11746    if (element.hasSubstance())
11747      composeMedicinalProductIngredientMedicinalProductIngredientSubstanceComponent(t, "MedicinalProductIngredient",
11748          "substance", element.getSubstance(), -1);
11749  }
11750
11751  protected void composeMedicinalProductIngredientMedicinalProductIngredientSpecifiedSubstanceComponent(Complex parent,
11752      String parentType, String name,
11753      MedicinalProductIngredient.MedicinalProductIngredientSpecifiedSubstanceComponent element, int index) {
11754    if (element == null)
11755      return;
11756    Complex t;
11757    if (Utilities.noString(parentType))
11758      t = parent;
11759    else {
11760      t = parent.predicate("fhir:" + parentType + '.' + name);
11761    }
11762    composeBackboneElement(t, "specifiedSubstance", name, element, index);
11763    if (element.hasCode())
11764      composeCodeableConcept(t, "MedicinalProductIngredient", "code", element.getCode(), -1);
11765    if (element.hasGroup())
11766      composeCodeableConcept(t, "MedicinalProductIngredient", "group", element.getGroup(), -1);
11767    if (element.hasConfidentiality())
11768      composeCodeableConcept(t, "MedicinalProductIngredient", "confidentiality", element.getConfidentiality(), -1);
11769    for (int i = 0; i < element.getStrength().size(); i++)
11770      composeMedicinalProductIngredientMedicinalProductIngredientSpecifiedSubstanceStrengthComponent(t,
11771          "MedicinalProductIngredient", "strength", element.getStrength().get(i), i);
11772  }
11773
11774  protected void composeMedicinalProductIngredientMedicinalProductIngredientSpecifiedSubstanceStrengthComponent(
11775      Complex parent, String parentType, String name,
11776      MedicinalProductIngredient.MedicinalProductIngredientSpecifiedSubstanceStrengthComponent element, int index) {
11777    if (element == null)
11778      return;
11779    Complex t;
11780    if (Utilities.noString(parentType))
11781      t = parent;
11782    else {
11783      t = parent.predicate("fhir:" + parentType + '.' + name);
11784    }
11785    composeBackboneElement(t, "strength", name, element, index);
11786    if (element.hasPresentation())
11787      composeRatio(t, "MedicinalProductIngredient", "presentation", element.getPresentation(), -1);
11788    if (element.hasPresentationLowLimit())
11789      composeRatio(t, "MedicinalProductIngredient", "presentationLowLimit", element.getPresentationLowLimit(), -1);
11790    if (element.hasConcentration())
11791      composeRatio(t, "MedicinalProductIngredient", "concentration", element.getConcentration(), -1);
11792    if (element.hasConcentrationLowLimit())
11793      composeRatio(t, "MedicinalProductIngredient", "concentrationLowLimit", element.getConcentrationLowLimit(), -1);
11794    if (element.hasMeasurementPointElement())
11795      composeString(t, "MedicinalProductIngredient", "measurementPoint", element.getMeasurementPointElement(), -1);
11796    for (int i = 0; i < element.getCountry().size(); i++)
11797      composeCodeableConcept(t, "MedicinalProductIngredient", "country", element.getCountry().get(i), i);
11798    for (int i = 0; i < element.getReferenceStrength().size(); i++)
11799      composeMedicinalProductIngredientMedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent(t,
11800          "MedicinalProductIngredient", "referenceStrength", element.getReferenceStrength().get(i), i);
11801  }
11802
11803  protected void composeMedicinalProductIngredientMedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent(
11804      Complex parent, String parentType, String name,
11805      MedicinalProductIngredient.MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent element,
11806      int index) {
11807    if (element == null)
11808      return;
11809    Complex t;
11810    if (Utilities.noString(parentType))
11811      t = parent;
11812    else {
11813      t = parent.predicate("fhir:" + parentType + '.' + name);
11814    }
11815    composeBackboneElement(t, "referenceStrength", name, element, index);
11816    if (element.hasSubstance())
11817      composeCodeableConcept(t, "MedicinalProductIngredient", "substance", element.getSubstance(), -1);
11818    if (element.hasStrength())
11819      composeRatio(t, "MedicinalProductIngredient", "strength", element.getStrength(), -1);
11820    if (element.hasStrengthLowLimit())
11821      composeRatio(t, "MedicinalProductIngredient", "strengthLowLimit", element.getStrengthLowLimit(), -1);
11822    if (element.hasMeasurementPointElement())
11823      composeString(t, "MedicinalProductIngredient", "measurementPoint", element.getMeasurementPointElement(), -1);
11824    for (int i = 0; i < element.getCountry().size(); i++)
11825      composeCodeableConcept(t, "MedicinalProductIngredient", "country", element.getCountry().get(i), i);
11826  }
11827
11828  protected void composeMedicinalProductIngredientMedicinalProductIngredientSubstanceComponent(Complex parent,
11829      String parentType, String name, MedicinalProductIngredient.MedicinalProductIngredientSubstanceComponent element,
11830      int index) {
11831    if (element == null)
11832      return;
11833    Complex t;
11834    if (Utilities.noString(parentType))
11835      t = parent;
11836    else {
11837      t = parent.predicate("fhir:" + parentType + '.' + name);
11838    }
11839    composeBackboneElement(t, "substance", name, element, index);
11840    if (element.hasCode())
11841      composeCodeableConcept(t, "MedicinalProductIngredient", "code", element.getCode(), -1);
11842    for (int i = 0; i < element.getStrength().size(); i++)
11843      composeMedicinalProductIngredientMedicinalProductIngredientSpecifiedSubstanceStrengthComponent(t,
11844          "MedicinalProductIngredient", "strength", element.getStrength().get(i), i);
11845  }
11846
11847  protected void composeMedicinalProductInteraction(Complex parent, String parentType, String name,
11848      MedicinalProductInteraction element, int index) {
11849    if (element == null)
11850      return;
11851    Complex t;
11852    if (Utilities.noString(parentType))
11853      t = parent;
11854    else {
11855      t = parent.predicate("fhir:" + parentType + '.' + name);
11856    }
11857    composeDomainResource(t, "MedicinalProductInteraction", name, element, index);
11858    for (int i = 0; i < element.getSubject().size(); i++)
11859      composeReference(t, "MedicinalProductInteraction", "subject", element.getSubject().get(i), i);
11860    if (element.hasDescriptionElement())
11861      composeString(t, "MedicinalProductInteraction", "description", element.getDescriptionElement(), -1);
11862    for (int i = 0; i < element.getInteractant().size(); i++)
11863      composeMedicinalProductInteractionMedicinalProductInteractionInteractantComponent(t,
11864          "MedicinalProductInteraction", "interactant", element.getInteractant().get(i), i);
11865    if (element.hasType())
11866      composeCodeableConcept(t, "MedicinalProductInteraction", "type", element.getType(), -1);
11867    if (element.hasEffect())
11868      composeCodeableConcept(t, "MedicinalProductInteraction", "effect", element.getEffect(), -1);
11869    if (element.hasIncidence())
11870      composeCodeableConcept(t, "MedicinalProductInteraction", "incidence", element.getIncidence(), -1);
11871    if (element.hasManagement())
11872      composeCodeableConcept(t, "MedicinalProductInteraction", "management", element.getManagement(), -1);
11873  }
11874
11875  protected void composeMedicinalProductInteractionMedicinalProductInteractionInteractantComponent(Complex parent,
11876      String parentType, String name,
11877      MedicinalProductInteraction.MedicinalProductInteractionInteractantComponent element, int index) {
11878    if (element == null)
11879      return;
11880    Complex t;
11881    if (Utilities.noString(parentType))
11882      t = parent;
11883    else {
11884      t = parent.predicate("fhir:" + parentType + '.' + name);
11885    }
11886    composeBackboneElement(t, "interactant", name, element, index);
11887    if (element.hasItem())
11888      composeType(t, "MedicinalProductInteraction", "item", element.getItem(), -1);
11889  }
11890
11891  protected void composeMedicinalProductManufactured(Complex parent, String parentType, String name,
11892      MedicinalProductManufactured element, int index) {
11893    if (element == null)
11894      return;
11895    Complex t;
11896    if (Utilities.noString(parentType))
11897      t = parent;
11898    else {
11899      t = parent.predicate("fhir:" + parentType + '.' + name);
11900    }
11901    composeDomainResource(t, "MedicinalProductManufactured", name, element, index);
11902    if (element.hasManufacturedDoseForm())
11903      composeCodeableConcept(t, "MedicinalProductManufactured", "manufacturedDoseForm",
11904          element.getManufacturedDoseForm(), -1);
11905    if (element.hasUnitOfPresentation())
11906      composeCodeableConcept(t, "MedicinalProductManufactured", "unitOfPresentation", element.getUnitOfPresentation(),
11907          -1);
11908    if (element.hasQuantity())
11909      composeQuantity(t, "MedicinalProductManufactured", "quantity", element.getQuantity(), -1);
11910    for (int i = 0; i < element.getManufacturer().size(); i++)
11911      composeReference(t, "MedicinalProductManufactured", "manufacturer", element.getManufacturer().get(i), i);
11912    for (int i = 0; i < element.getIngredient().size(); i++)
11913      composeReference(t, "MedicinalProductManufactured", "ingredient", element.getIngredient().get(i), i);
11914    if (element.hasPhysicalCharacteristics())
11915      composeProdCharacteristic(t, "MedicinalProductManufactured", "physicalCharacteristics",
11916          element.getPhysicalCharacteristics(), -1);
11917    for (int i = 0; i < element.getOtherCharacteristics().size(); i++)
11918      composeCodeableConcept(t, "MedicinalProductManufactured", "otherCharacteristics",
11919          element.getOtherCharacteristics().get(i), i);
11920  }
11921
11922  protected void composeMedicinalProductPackaged(Complex parent, String parentType, String name,
11923      MedicinalProductPackaged element, int index) {
11924    if (element == null)
11925      return;
11926    Complex t;
11927    if (Utilities.noString(parentType))
11928      t = parent;
11929    else {
11930      t = parent.predicate("fhir:" + parentType + '.' + name);
11931    }
11932    composeDomainResource(t, "MedicinalProductPackaged", name, element, index);
11933    for (int i = 0; i < element.getIdentifier().size(); i++)
11934      composeIdentifier(t, "MedicinalProductPackaged", "identifier", element.getIdentifier().get(i), i);
11935    for (int i = 0; i < element.getSubject().size(); i++)
11936      composeReference(t, "MedicinalProductPackaged", "subject", element.getSubject().get(i), i);
11937    if (element.hasDescriptionElement())
11938      composeString(t, "MedicinalProductPackaged", "description", element.getDescriptionElement(), -1);
11939    if (element.hasLegalStatusOfSupply())
11940      composeCodeableConcept(t, "MedicinalProductPackaged", "legalStatusOfSupply", element.getLegalStatusOfSupply(),
11941          -1);
11942    for (int i = 0; i < element.getMarketingStatus().size(); i++)
11943      composeMarketingStatus(t, "MedicinalProductPackaged", "marketingStatus", element.getMarketingStatus().get(i), i);
11944    if (element.hasMarketingAuthorization())
11945      composeReference(t, "MedicinalProductPackaged", "marketingAuthorization", element.getMarketingAuthorization(),
11946          -1);
11947    for (int i = 0; i < element.getManufacturer().size(); i++)
11948      composeReference(t, "MedicinalProductPackaged", "manufacturer", element.getManufacturer().get(i), i);
11949    for (int i = 0; i < element.getBatchIdentifier().size(); i++)
11950      composeMedicinalProductPackagedMedicinalProductPackagedBatchIdentifierComponent(t, "MedicinalProductPackaged",
11951          "batchIdentifier", element.getBatchIdentifier().get(i), i);
11952    for (int i = 0; i < element.getPackageItem().size(); i++)
11953      composeMedicinalProductPackagedMedicinalProductPackagedPackageItemComponent(t, "MedicinalProductPackaged",
11954          "packageItem", element.getPackageItem().get(i), i);
11955  }
11956
11957  protected void composeMedicinalProductPackagedMedicinalProductPackagedBatchIdentifierComponent(Complex parent,
11958      String parentType, String name, MedicinalProductPackaged.MedicinalProductPackagedBatchIdentifierComponent element,
11959      int index) {
11960    if (element == null)
11961      return;
11962    Complex t;
11963    if (Utilities.noString(parentType))
11964      t = parent;
11965    else {
11966      t = parent.predicate("fhir:" + parentType + '.' + name);
11967    }
11968    composeBackboneElement(t, "batchIdentifier", name, element, index);
11969    if (element.hasOuterPackaging())
11970      composeIdentifier(t, "MedicinalProductPackaged", "outerPackaging", element.getOuterPackaging(), -1);
11971    if (element.hasImmediatePackaging())
11972      composeIdentifier(t, "MedicinalProductPackaged", "immediatePackaging", element.getImmediatePackaging(), -1);
11973  }
11974
11975  protected void composeMedicinalProductPackagedMedicinalProductPackagedPackageItemComponent(Complex parent,
11976      String parentType, String name, MedicinalProductPackaged.MedicinalProductPackagedPackageItemComponent element,
11977      int index) {
11978    if (element == null)
11979      return;
11980    Complex t;
11981    if (Utilities.noString(parentType))
11982      t = parent;
11983    else {
11984      t = parent.predicate("fhir:" + parentType + '.' + name);
11985    }
11986    composeBackboneElement(t, "packageItem", name, element, index);
11987    for (int i = 0; i < element.getIdentifier().size(); i++)
11988      composeIdentifier(t, "MedicinalProductPackaged", "identifier", element.getIdentifier().get(i), i);
11989    if (element.hasType())
11990      composeCodeableConcept(t, "MedicinalProductPackaged", "type", element.getType(), -1);
11991    if (element.hasQuantity())
11992      composeQuantity(t, "MedicinalProductPackaged", "quantity", element.getQuantity(), -1);
11993    for (int i = 0; i < element.getMaterial().size(); i++)
11994      composeCodeableConcept(t, "MedicinalProductPackaged", "material", element.getMaterial().get(i), i);
11995    for (int i = 0; i < element.getAlternateMaterial().size(); i++)
11996      composeCodeableConcept(t, "MedicinalProductPackaged", "alternateMaterial", element.getAlternateMaterial().get(i),
11997          i);
11998    for (int i = 0; i < element.getDevice().size(); i++)
11999      composeReference(t, "MedicinalProductPackaged", "device", element.getDevice().get(i), i);
12000    for (int i = 0; i < element.getManufacturedItem().size(); i++)
12001      composeReference(t, "MedicinalProductPackaged", "manufacturedItem", element.getManufacturedItem().get(i), i);
12002    for (int i = 0; i < element.getPackageItem().size(); i++)
12003      composeMedicinalProductPackagedMedicinalProductPackagedPackageItemComponent(t, "MedicinalProductPackaged",
12004          "packageItem", element.getPackageItem().get(i), i);
12005    if (element.hasPhysicalCharacteristics())
12006      composeProdCharacteristic(t, "MedicinalProductPackaged", "physicalCharacteristics",
12007          element.getPhysicalCharacteristics(), -1);
12008    for (int i = 0; i < element.getOtherCharacteristics().size(); i++)
12009      composeCodeableConcept(t, "MedicinalProductPackaged", "otherCharacteristics",
12010          element.getOtherCharacteristics().get(i), i);
12011    for (int i = 0; i < element.getShelfLifeStorage().size(); i++)
12012      composeProductShelfLife(t, "MedicinalProductPackaged", "shelfLifeStorage", element.getShelfLifeStorage().get(i),
12013          i);
12014    for (int i = 0; i < element.getManufacturer().size(); i++)
12015      composeReference(t, "MedicinalProductPackaged", "manufacturer", element.getManufacturer().get(i), i);
12016  }
12017
12018  protected void composeMedicinalProductPharmaceutical(Complex parent, String parentType, String name,
12019      MedicinalProductPharmaceutical element, int index) {
12020    if (element == null)
12021      return;
12022    Complex t;
12023    if (Utilities.noString(parentType))
12024      t = parent;
12025    else {
12026      t = parent.predicate("fhir:" + parentType + '.' + name);
12027    }
12028    composeDomainResource(t, "MedicinalProductPharmaceutical", name, element, index);
12029    for (int i = 0; i < element.getIdentifier().size(); i++)
12030      composeIdentifier(t, "MedicinalProductPharmaceutical", "identifier", element.getIdentifier().get(i), i);
12031    if (element.hasAdministrableDoseForm())
12032      composeCodeableConcept(t, "MedicinalProductPharmaceutical", "administrableDoseForm",
12033          element.getAdministrableDoseForm(), -1);
12034    if (element.hasUnitOfPresentation())
12035      composeCodeableConcept(t, "MedicinalProductPharmaceutical", "unitOfPresentation", element.getUnitOfPresentation(),
12036          -1);
12037    for (int i = 0; i < element.getIngredient().size(); i++)
12038      composeReference(t, "MedicinalProductPharmaceutical", "ingredient", element.getIngredient().get(i), i);
12039    for (int i = 0; i < element.getDevice().size(); i++)
12040      composeReference(t, "MedicinalProductPharmaceutical", "device", element.getDevice().get(i), i);
12041    for (int i = 0; i < element.getCharacteristics().size(); i++)
12042      composeMedicinalProductPharmaceuticalMedicinalProductPharmaceuticalCharacteristicsComponent(t,
12043          "MedicinalProductPharmaceutical", "characteristics", element.getCharacteristics().get(i), i);
12044    for (int i = 0; i < element.getRouteOfAdministration().size(); i++)
12045      composeMedicinalProductPharmaceuticalMedicinalProductPharmaceuticalRouteOfAdministrationComponent(t,
12046          "MedicinalProductPharmaceutical", "routeOfAdministration", element.getRouteOfAdministration().get(i), i);
12047  }
12048
12049  protected void composeMedicinalProductPharmaceuticalMedicinalProductPharmaceuticalCharacteristicsComponent(
12050      Complex parent, String parentType, String name,
12051      MedicinalProductPharmaceutical.MedicinalProductPharmaceuticalCharacteristicsComponent element, int index) {
12052    if (element == null)
12053      return;
12054    Complex t;
12055    if (Utilities.noString(parentType))
12056      t = parent;
12057    else {
12058      t = parent.predicate("fhir:" + parentType + '.' + name);
12059    }
12060    composeBackboneElement(t, "characteristics", name, element, index);
12061    if (element.hasCode())
12062      composeCodeableConcept(t, "MedicinalProductPharmaceutical", "code", element.getCode(), -1);
12063    if (element.hasStatus())
12064      composeCodeableConcept(t, "MedicinalProductPharmaceutical", "status", element.getStatus(), -1);
12065  }
12066
12067  protected void composeMedicinalProductPharmaceuticalMedicinalProductPharmaceuticalRouteOfAdministrationComponent(
12068      Complex parent, String parentType, String name,
12069      MedicinalProductPharmaceutical.MedicinalProductPharmaceuticalRouteOfAdministrationComponent element, int index) {
12070    if (element == null)
12071      return;
12072    Complex t;
12073    if (Utilities.noString(parentType))
12074      t = parent;
12075    else {
12076      t = parent.predicate("fhir:" + parentType + '.' + name);
12077    }
12078    composeBackboneElement(t, "routeOfAdministration", name, element, index);
12079    if (element.hasCode())
12080      composeCodeableConcept(t, "MedicinalProductPharmaceutical", "code", element.getCode(), -1);
12081    if (element.hasFirstDose())
12082      composeQuantity(t, "MedicinalProductPharmaceutical", "firstDose", element.getFirstDose(), -1);
12083    if (element.hasMaxSingleDose())
12084      composeQuantity(t, "MedicinalProductPharmaceutical", "maxSingleDose", element.getMaxSingleDose(), -1);
12085    if (element.hasMaxDosePerDay())
12086      composeQuantity(t, "MedicinalProductPharmaceutical", "maxDosePerDay", element.getMaxDosePerDay(), -1);
12087    if (element.hasMaxDosePerTreatmentPeriod())
12088      composeRatio(t, "MedicinalProductPharmaceutical", "maxDosePerTreatmentPeriod",
12089          element.getMaxDosePerTreatmentPeriod(), -1);
12090    if (element.hasMaxTreatmentPeriod())
12091      composeDuration(t, "MedicinalProductPharmaceutical", "maxTreatmentPeriod", element.getMaxTreatmentPeriod(), -1);
12092    for (int i = 0; i < element.getTargetSpecies().size(); i++)
12093      composeMedicinalProductPharmaceuticalMedicinalProductPharmaceuticalRouteOfAdministrationTargetSpeciesComponent(t,
12094          "MedicinalProductPharmaceutical", "targetSpecies", element.getTargetSpecies().get(i), i);
12095  }
12096
12097  protected void composeMedicinalProductPharmaceuticalMedicinalProductPharmaceuticalRouteOfAdministrationTargetSpeciesComponent(
12098      Complex parent, String parentType, String name,
12099      MedicinalProductPharmaceutical.MedicinalProductPharmaceuticalRouteOfAdministrationTargetSpeciesComponent element,
12100      int index) {
12101    if (element == null)
12102      return;
12103    Complex t;
12104    if (Utilities.noString(parentType))
12105      t = parent;
12106    else {
12107      t = parent.predicate("fhir:" + parentType + '.' + name);
12108    }
12109    composeBackboneElement(t, "targetSpecies", name, element, index);
12110    if (element.hasCode())
12111      composeCodeableConcept(t, "MedicinalProductPharmaceutical", "code", element.getCode(), -1);
12112    for (int i = 0; i < element.getWithdrawalPeriod().size(); i++)
12113      composeMedicinalProductPharmaceuticalMedicinalProductPharmaceuticalRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent(
12114          t, "MedicinalProductPharmaceutical", "withdrawalPeriod", element.getWithdrawalPeriod().get(i), i);
12115  }
12116
12117  protected void composeMedicinalProductPharmaceuticalMedicinalProductPharmaceuticalRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent(
12118      Complex parent, String parentType, String name,
12119      MedicinalProductPharmaceutical.MedicinalProductPharmaceuticalRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent element,
12120      int index) {
12121    if (element == null)
12122      return;
12123    Complex t;
12124    if (Utilities.noString(parentType))
12125      t = parent;
12126    else {
12127      t = parent.predicate("fhir:" + parentType + '.' + name);
12128    }
12129    composeBackboneElement(t, "withdrawalPeriod", name, element, index);
12130    if (element.hasTissue())
12131      composeCodeableConcept(t, "MedicinalProductPharmaceutical", "tissue", element.getTissue(), -1);
12132    if (element.hasValue())
12133      composeQuantity(t, "MedicinalProductPharmaceutical", "value", element.getValue(), -1);
12134    if (element.hasSupportingInformationElement())
12135      composeString(t, "MedicinalProductPharmaceutical", "supportingInformation",
12136          element.getSupportingInformationElement(), -1);
12137  }
12138
12139  protected void composeMedicinalProductUndesirableEffect(Complex parent, String parentType, String name,
12140      MedicinalProductUndesirableEffect element, int index) {
12141    if (element == null)
12142      return;
12143    Complex t;
12144    if (Utilities.noString(parentType))
12145      t = parent;
12146    else {
12147      t = parent.predicate("fhir:" + parentType + '.' + name);
12148    }
12149    composeDomainResource(t, "MedicinalProductUndesirableEffect", name, element, index);
12150    for (int i = 0; i < element.getSubject().size(); i++)
12151      composeReference(t, "MedicinalProductUndesirableEffect", "subject", element.getSubject().get(i), i);
12152    if (element.hasSymptomConditionEffect())
12153      composeCodeableConcept(t, "MedicinalProductUndesirableEffect", "symptomConditionEffect",
12154          element.getSymptomConditionEffect(), -1);
12155    if (element.hasClassification())
12156      composeCodeableConcept(t, "MedicinalProductUndesirableEffect", "classification", element.getClassification(), -1);
12157    if (element.hasFrequencyOfOccurrence())
12158      composeCodeableConcept(t, "MedicinalProductUndesirableEffect", "frequencyOfOccurrence",
12159          element.getFrequencyOfOccurrence(), -1);
12160    for (int i = 0; i < element.getPopulation().size(); i++)
12161      composePopulation(t, "MedicinalProductUndesirableEffect", "population", element.getPopulation().get(i), i);
12162  }
12163
12164  protected void composeMessageDefinition(Complex parent, String parentType, String name, MessageDefinition element,
12165      int index) {
12166    if (element == null)
12167      return;
12168    Complex t;
12169    if (Utilities.noString(parentType))
12170      t = parent;
12171    else {
12172      t = parent.predicate("fhir:" + parentType + '.' + name);
12173    }
12174    composeDomainResource(t, "MessageDefinition", name, element, index);
12175    if (element.hasUrlElement())
12176      composeUri(t, "MessageDefinition", "url", element.getUrlElement(), -1);
12177    for (int i = 0; i < element.getIdentifier().size(); i++)
12178      composeIdentifier(t, "MessageDefinition", "identifier", element.getIdentifier().get(i), i);
12179    if (element.hasVersionElement())
12180      composeString(t, "MessageDefinition", "version", element.getVersionElement(), -1);
12181    if (element.hasNameElement())
12182      composeString(t, "MessageDefinition", "name", element.getNameElement(), -1);
12183    if (element.hasTitleElement())
12184      composeString(t, "MessageDefinition", "title", element.getTitleElement(), -1);
12185    for (int i = 0; i < element.getReplaces().size(); i++)
12186      composeCanonical(t, "MessageDefinition", "replaces", element.getReplaces().get(i), i);
12187    if (element.hasStatusElement())
12188      composeEnum(t, "MessageDefinition", "status", element.getStatusElement(), -1);
12189    if (element.hasExperimentalElement())
12190      composeBoolean(t, "MessageDefinition", "experimental", element.getExperimentalElement(), -1);
12191    if (element.hasDateElement())
12192      composeDateTime(t, "MessageDefinition", "date", element.getDateElement(), -1);
12193    if (element.hasPublisherElement())
12194      composeString(t, "MessageDefinition", "publisher", element.getPublisherElement(), -1);
12195    for (int i = 0; i < element.getContact().size(); i++)
12196      composeContactDetail(t, "MessageDefinition", "contact", element.getContact().get(i), i);
12197    if (element.hasDescriptionElement())
12198      composeMarkdown(t, "MessageDefinition", "description", element.getDescriptionElement(), -1);
12199    for (int i = 0; i < element.getUseContext().size(); i++)
12200      composeUsageContext(t, "MessageDefinition", "useContext", element.getUseContext().get(i), i);
12201    for (int i = 0; i < element.getJurisdiction().size(); i++)
12202      composeCodeableConcept(t, "MessageDefinition", "jurisdiction", element.getJurisdiction().get(i), i);
12203    if (element.hasPurposeElement())
12204      composeMarkdown(t, "MessageDefinition", "purpose", element.getPurposeElement(), -1);
12205    if (element.hasCopyrightElement())
12206      composeMarkdown(t, "MessageDefinition", "copyright", element.getCopyrightElement(), -1);
12207    if (element.hasBaseElement())
12208      composeCanonical(t, "MessageDefinition", "base", element.getBaseElement(), -1);
12209    for (int i = 0; i < element.getParent().size(); i++)
12210      composeCanonical(t, "MessageDefinition", "parent", element.getParent().get(i), i);
12211    if (element.hasEvent())
12212      composeType(t, "MessageDefinition", "event", element.getEvent(), -1);
12213    if (element.hasCategoryElement())
12214      composeEnum(t, "MessageDefinition", "category", element.getCategoryElement(), -1);
12215    for (int i = 0; i < element.getFocus().size(); i++)
12216      composeMessageDefinitionMessageDefinitionFocusComponent(t, "MessageDefinition", "focus",
12217          element.getFocus().get(i), i);
12218    if (element.hasResponseRequiredElement())
12219      composeEnum(t, "MessageDefinition", "responseRequired", element.getResponseRequiredElement(), -1);
12220    for (int i = 0; i < element.getAllowedResponse().size(); i++)
12221      composeMessageDefinitionMessageDefinitionAllowedResponseComponent(t, "MessageDefinition", "allowedResponse",
12222          element.getAllowedResponse().get(i), i);
12223    for (int i = 0; i < element.getGraph().size(); i++)
12224      composeCanonical(t, "MessageDefinition", "graph", element.getGraph().get(i), i);
12225  }
12226
12227  protected void composeMessageDefinitionMessageDefinitionFocusComponent(Complex parent, String parentType, String name,
12228      MessageDefinition.MessageDefinitionFocusComponent element, int index) {
12229    if (element == null)
12230      return;
12231    Complex t;
12232    if (Utilities.noString(parentType))
12233      t = parent;
12234    else {
12235      t = parent.predicate("fhir:" + parentType + '.' + name);
12236    }
12237    composeBackboneElement(t, "focus", name, element, index);
12238    if (element.hasCodeElement())
12239      composeCode(t, "MessageDefinition", "code", element.getCodeElement(), -1);
12240    if (element.hasProfileElement())
12241      composeCanonical(t, "MessageDefinition", "profile", element.getProfileElement(), -1);
12242    if (element.hasMinElement())
12243      composeUnsignedInt(t, "MessageDefinition", "min", element.getMinElement(), -1);
12244    if (element.hasMaxElement())
12245      composeString(t, "MessageDefinition", "max", element.getMaxElement(), -1);
12246  }
12247
12248  protected void composeMessageDefinitionMessageDefinitionAllowedResponseComponent(Complex parent, String parentType,
12249      String name, MessageDefinition.MessageDefinitionAllowedResponseComponent element, int index) {
12250    if (element == null)
12251      return;
12252    Complex t;
12253    if (Utilities.noString(parentType))
12254      t = parent;
12255    else {
12256      t = parent.predicate("fhir:" + parentType + '.' + name);
12257    }
12258    composeBackboneElement(t, "allowedResponse", name, element, index);
12259    if (element.hasMessageElement())
12260      composeCanonical(t, "MessageDefinition", "message", element.getMessageElement(), -1);
12261    if (element.hasSituationElement())
12262      composeMarkdown(t, "MessageDefinition", "situation", element.getSituationElement(), -1);
12263  }
12264
12265  protected void composeMessageHeader(Complex parent, String parentType, String name, MessageHeader element,
12266      int index) {
12267    if (element == null)
12268      return;
12269    Complex t;
12270    if (Utilities.noString(parentType))
12271      t = parent;
12272    else {
12273      t = parent.predicate("fhir:" + parentType + '.' + name);
12274    }
12275    composeDomainResource(t, "MessageHeader", name, element, index);
12276    if (element.hasEvent())
12277      composeType(t, "MessageHeader", "event", element.getEvent(), -1);
12278    for (int i = 0; i < element.getDestination().size(); i++)
12279      composeMessageHeaderMessageDestinationComponent(t, "MessageHeader", "destination",
12280          element.getDestination().get(i), i);
12281    if (element.hasSender())
12282      composeReference(t, "MessageHeader", "sender", element.getSender(), -1);
12283    if (element.hasEnterer())
12284      composeReference(t, "MessageHeader", "enterer", element.getEnterer(), -1);
12285    if (element.hasAuthor())
12286      composeReference(t, "MessageHeader", "author", element.getAuthor(), -1);
12287    if (element.hasSource())
12288      composeMessageHeaderMessageSourceComponent(t, "MessageHeader", "source", element.getSource(), -1);
12289    if (element.hasResponsible())
12290      composeReference(t, "MessageHeader", "responsible", element.getResponsible(), -1);
12291    if (element.hasReason())
12292      composeCodeableConcept(t, "MessageHeader", "reason", element.getReason(), -1);
12293    if (element.hasResponse())
12294      composeMessageHeaderMessageHeaderResponseComponent(t, "MessageHeader", "response", element.getResponse(), -1);
12295    for (int i = 0; i < element.getFocus().size(); i++)
12296      composeReference(t, "MessageHeader", "focus", element.getFocus().get(i), i);
12297    if (element.hasDefinitionElement())
12298      composeCanonical(t, "MessageHeader", "definition", element.getDefinitionElement(), -1);
12299  }
12300
12301  protected void composeMessageHeaderMessageDestinationComponent(Complex parent, String parentType, String name,
12302      MessageHeader.MessageDestinationComponent element, int index) {
12303    if (element == null)
12304      return;
12305    Complex t;
12306    if (Utilities.noString(parentType))
12307      t = parent;
12308    else {
12309      t = parent.predicate("fhir:" + parentType + '.' + name);
12310    }
12311    composeBackboneElement(t, "destination", name, element, index);
12312    if (element.hasNameElement())
12313      composeString(t, "MessageHeader", "name", element.getNameElement(), -1);
12314    if (element.hasTarget())
12315      composeReference(t, "MessageHeader", "target", element.getTarget(), -1);
12316    if (element.hasEndpointElement())
12317      composeUrl(t, "MessageHeader", "endpoint", element.getEndpointElement(), -1);
12318    if (element.hasReceiver())
12319      composeReference(t, "MessageHeader", "receiver", element.getReceiver(), -1);
12320  }
12321
12322  protected void composeMessageHeaderMessageSourceComponent(Complex parent, String parentType, String name,
12323      MessageHeader.MessageSourceComponent element, int index) {
12324    if (element == null)
12325      return;
12326    Complex t;
12327    if (Utilities.noString(parentType))
12328      t = parent;
12329    else {
12330      t = parent.predicate("fhir:" + parentType + '.' + name);
12331    }
12332    composeBackboneElement(t, "source", name, element, index);
12333    if (element.hasNameElement())
12334      composeString(t, "MessageHeader", "name", element.getNameElement(), -1);
12335    if (element.hasSoftwareElement())
12336      composeString(t, "MessageHeader", "software", element.getSoftwareElement(), -1);
12337    if (element.hasVersionElement())
12338      composeString(t, "MessageHeader", "version", element.getVersionElement(), -1);
12339    if (element.hasContact())
12340      composeContactPoint(t, "MessageHeader", "contact", element.getContact(), -1);
12341    if (element.hasEndpointElement())
12342      composeUrl(t, "MessageHeader", "endpoint", element.getEndpointElement(), -1);
12343  }
12344
12345  protected void composeMessageHeaderMessageHeaderResponseComponent(Complex parent, String parentType, String name,
12346      MessageHeader.MessageHeaderResponseComponent element, int index) {
12347    if (element == null)
12348      return;
12349    Complex t;
12350    if (Utilities.noString(parentType))
12351      t = parent;
12352    else {
12353      t = parent.predicate("fhir:" + parentType + '.' + name);
12354    }
12355    composeBackboneElement(t, "response", name, element, index);
12356    if (element.hasIdentifierElement())
12357      composeId(t, "MessageHeader", "identifier", element.getIdentifierElement(), -1);
12358    if (element.hasCodeElement())
12359      composeEnum(t, "MessageHeader", "code", element.getCodeElement(), -1);
12360    if (element.hasDetails())
12361      composeReference(t, "MessageHeader", "details", element.getDetails(), -1);
12362  }
12363
12364  protected void composeMolecularSequence(Complex parent, String parentType, String name, MolecularSequence element,
12365      int index) {
12366    if (element == null)
12367      return;
12368    Complex t;
12369    if (Utilities.noString(parentType))
12370      t = parent;
12371    else {
12372      t = parent.predicate("fhir:" + parentType + '.' + name);
12373    }
12374    composeDomainResource(t, "MolecularSequence", name, element, index);
12375    for (int i = 0; i < element.getIdentifier().size(); i++)
12376      composeIdentifier(t, "MolecularSequence", "identifier", element.getIdentifier().get(i), i);
12377    if (element.hasTypeElement())
12378      composeEnum(t, "MolecularSequence", "type", element.getTypeElement(), -1);
12379    if (element.hasCoordinateSystemElement())
12380      composeInteger(t, "MolecularSequence", "coordinateSystem", element.getCoordinateSystemElement(), -1);
12381    if (element.hasPatient())
12382      composeReference(t, "MolecularSequence", "patient", element.getPatient(), -1);
12383    if (element.hasSpecimen())
12384      composeReference(t, "MolecularSequence", "specimen", element.getSpecimen(), -1);
12385    if (element.hasDevice())
12386      composeReference(t, "MolecularSequence", "device", element.getDevice(), -1);
12387    if (element.hasPerformer())
12388      composeReference(t, "MolecularSequence", "performer", element.getPerformer(), -1);
12389    if (element.hasQuantity())
12390      composeQuantity(t, "MolecularSequence", "quantity", element.getQuantity(), -1);
12391    if (element.hasReferenceSeq())
12392      composeMolecularSequenceMolecularSequenceReferenceSeqComponent(t, "MolecularSequence", "referenceSeq",
12393          element.getReferenceSeq(), -1);
12394    for (int i = 0; i < element.getVariant().size(); i++)
12395      composeMolecularSequenceMolecularSequenceVariantComponent(t, "MolecularSequence", "variant",
12396          element.getVariant().get(i), i);
12397    if (element.hasObservedSeqElement())
12398      composeString(t, "MolecularSequence", "observedSeq", element.getObservedSeqElement(), -1);
12399    for (int i = 0; i < element.getQuality().size(); i++)
12400      composeMolecularSequenceMolecularSequenceQualityComponent(t, "MolecularSequence", "quality",
12401          element.getQuality().get(i), i);
12402    if (element.hasReadCoverageElement())
12403      composeInteger(t, "MolecularSequence", "readCoverage", element.getReadCoverageElement(), -1);
12404    for (int i = 0; i < element.getRepository().size(); i++)
12405      composeMolecularSequenceMolecularSequenceRepositoryComponent(t, "MolecularSequence", "repository",
12406          element.getRepository().get(i), i);
12407    for (int i = 0; i < element.getPointer().size(); i++)
12408      composeReference(t, "MolecularSequence", "pointer", element.getPointer().get(i), i);
12409    for (int i = 0; i < element.getStructureVariant().size(); i++)
12410      composeMolecularSequenceMolecularSequenceStructureVariantComponent(t, "MolecularSequence", "structureVariant",
12411          element.getStructureVariant().get(i), i);
12412  }
12413
12414  protected void composeMolecularSequenceMolecularSequenceReferenceSeqComponent(Complex parent, String parentType,
12415      String name, MolecularSequence.MolecularSequenceReferenceSeqComponent element, int index) {
12416    if (element == null)
12417      return;
12418    Complex t;
12419    if (Utilities.noString(parentType))
12420      t = parent;
12421    else {
12422      t = parent.predicate("fhir:" + parentType + '.' + name);
12423    }
12424    composeBackboneElement(t, "referenceSeq", name, element, index);
12425    if (element.hasChromosome())
12426      composeCodeableConcept(t, "MolecularSequence", "chromosome", element.getChromosome(), -1);
12427    if (element.hasGenomeBuildElement())
12428      composeString(t, "MolecularSequence", "genomeBuild", element.getGenomeBuildElement(), -1);
12429    if (element.hasOrientationElement())
12430      composeEnum(t, "MolecularSequence", "orientation", element.getOrientationElement(), -1);
12431    if (element.hasReferenceSeqId())
12432      composeCodeableConcept(t, "MolecularSequence", "referenceSeqId", element.getReferenceSeqId(), -1);
12433    if (element.hasReferenceSeqPointer())
12434      composeReference(t, "MolecularSequence", "referenceSeqPointer", element.getReferenceSeqPointer(), -1);
12435    if (element.hasReferenceSeqStringElement())
12436      composeString(t, "MolecularSequence", "referenceSeqString", element.getReferenceSeqStringElement(), -1);
12437    if (element.hasStrandElement())
12438      composeEnum(t, "MolecularSequence", "strand", element.getStrandElement(), -1);
12439    if (element.hasWindowStartElement())
12440      composeInteger(t, "MolecularSequence", "windowStart", element.getWindowStartElement(), -1);
12441    if (element.hasWindowEndElement())
12442      composeInteger(t, "MolecularSequence", "windowEnd", element.getWindowEndElement(), -1);
12443  }
12444
12445  protected void composeMolecularSequenceMolecularSequenceVariantComponent(Complex parent, String parentType,
12446      String name, MolecularSequence.MolecularSequenceVariantComponent element, int index) {
12447    if (element == null)
12448      return;
12449    Complex t;
12450    if (Utilities.noString(parentType))
12451      t = parent;
12452    else {
12453      t = parent.predicate("fhir:" + parentType + '.' + name);
12454    }
12455    composeBackboneElement(t, "variant", name, element, index);
12456    if (element.hasStartElement())
12457      composeInteger(t, "MolecularSequence", "start", element.getStartElement(), -1);
12458    if (element.hasEndElement())
12459      composeInteger(t, "MolecularSequence", "end", element.getEndElement(), -1);
12460    if (element.hasObservedAlleleElement())
12461      composeString(t, "MolecularSequence", "observedAllele", element.getObservedAlleleElement(), -1);
12462    if (element.hasReferenceAlleleElement())
12463      composeString(t, "MolecularSequence", "referenceAllele", element.getReferenceAlleleElement(), -1);
12464    if (element.hasCigarElement())
12465      composeString(t, "MolecularSequence", "cigar", element.getCigarElement(), -1);
12466    if (element.hasVariantPointer())
12467      composeReference(t, "MolecularSequence", "variantPointer", element.getVariantPointer(), -1);
12468  }
12469
12470  protected void composeMolecularSequenceMolecularSequenceQualityComponent(Complex parent, String parentType,
12471      String name, MolecularSequence.MolecularSequenceQualityComponent element, int index) {
12472    if (element == null)
12473      return;
12474    Complex t;
12475    if (Utilities.noString(parentType))
12476      t = parent;
12477    else {
12478      t = parent.predicate("fhir:" + parentType + '.' + name);
12479    }
12480    composeBackboneElement(t, "quality", name, element, index);
12481    if (element.hasTypeElement())
12482      composeEnum(t, "MolecularSequence", "type", element.getTypeElement(), -1);
12483    if (element.hasStandardSequence())
12484      composeCodeableConcept(t, "MolecularSequence", "standardSequence", element.getStandardSequence(), -1);
12485    if (element.hasStartElement())
12486      composeInteger(t, "MolecularSequence", "start", element.getStartElement(), -1);
12487    if (element.hasEndElement())
12488      composeInteger(t, "MolecularSequence", "end", element.getEndElement(), -1);
12489    if (element.hasScore())
12490      composeQuantity(t, "MolecularSequence", "score", element.getScore(), -1);
12491    if (element.hasMethod())
12492      composeCodeableConcept(t, "MolecularSequence", "method", element.getMethod(), -1);
12493    if (element.hasTruthTPElement())
12494      composeDecimal(t, "MolecularSequence", "truthTP", element.getTruthTPElement(), -1);
12495    if (element.hasQueryTPElement())
12496      composeDecimal(t, "MolecularSequence", "queryTP", element.getQueryTPElement(), -1);
12497    if (element.hasTruthFNElement())
12498      composeDecimal(t, "MolecularSequence", "truthFN", element.getTruthFNElement(), -1);
12499    if (element.hasQueryFPElement())
12500      composeDecimal(t, "MolecularSequence", "queryFP", element.getQueryFPElement(), -1);
12501    if (element.hasGtFPElement())
12502      composeDecimal(t, "MolecularSequence", "gtFP", element.getGtFPElement(), -1);
12503    if (element.hasPrecisionElement())
12504      composeDecimal(t, "MolecularSequence", "precision", element.getPrecisionElement(), -1);
12505    if (element.hasRecallElement())
12506      composeDecimal(t, "MolecularSequence", "recall", element.getRecallElement(), -1);
12507    if (element.hasFScoreElement())
12508      composeDecimal(t, "MolecularSequence", "fScore", element.getFScoreElement(), -1);
12509    if (element.hasRoc())
12510      composeMolecularSequenceMolecularSequenceQualityRocComponent(t, "MolecularSequence", "roc", element.getRoc(), -1);
12511  }
12512
12513  protected void composeMolecularSequenceMolecularSequenceQualityRocComponent(Complex parent, String parentType,
12514      String name, MolecularSequence.MolecularSequenceQualityRocComponent element, int index) {
12515    if (element == null)
12516      return;
12517    Complex t;
12518    if (Utilities.noString(parentType))
12519      t = parent;
12520    else {
12521      t = parent.predicate("fhir:" + parentType + '.' + name);
12522    }
12523    composeBackboneElement(t, "roc", name, element, index);
12524    for (int i = 0; i < element.getScore().size(); i++)
12525      composeInteger(t, "MolecularSequence", "score", element.getScore().get(i), i);
12526    for (int i = 0; i < element.getNumTP().size(); i++)
12527      composeInteger(t, "MolecularSequence", "numTP", element.getNumTP().get(i), i);
12528    for (int i = 0; i < element.getNumFP().size(); i++)
12529      composeInteger(t, "MolecularSequence", "numFP", element.getNumFP().get(i), i);
12530    for (int i = 0; i < element.getNumFN().size(); i++)
12531      composeInteger(t, "MolecularSequence", "numFN", element.getNumFN().get(i), i);
12532    for (int i = 0; i < element.getPrecision().size(); i++)
12533      composeDecimal(t, "MolecularSequence", "precision", element.getPrecision().get(i), i);
12534    for (int i = 0; i < element.getSensitivity().size(); i++)
12535      composeDecimal(t, "MolecularSequence", "sensitivity", element.getSensitivity().get(i), i);
12536    for (int i = 0; i < element.getFMeasure().size(); i++)
12537      composeDecimal(t, "MolecularSequence", "fMeasure", element.getFMeasure().get(i), i);
12538  }
12539
12540  protected void composeMolecularSequenceMolecularSequenceRepositoryComponent(Complex parent, String parentType,
12541      String name, MolecularSequence.MolecularSequenceRepositoryComponent element, int index) {
12542    if (element == null)
12543      return;
12544    Complex t;
12545    if (Utilities.noString(parentType))
12546      t = parent;
12547    else {
12548      t = parent.predicate("fhir:" + parentType + '.' + name);
12549    }
12550    composeBackboneElement(t, "repository", name, element, index);
12551    if (element.hasTypeElement())
12552      composeEnum(t, "MolecularSequence", "type", element.getTypeElement(), -1);
12553    if (element.hasUrlElement())
12554      composeUri(t, "MolecularSequence", "url", element.getUrlElement(), -1);
12555    if (element.hasNameElement())
12556      composeString(t, "MolecularSequence", "name", element.getNameElement(), -1);
12557    if (element.hasDatasetIdElement())
12558      composeString(t, "MolecularSequence", "datasetId", element.getDatasetIdElement(), -1);
12559    if (element.hasVariantsetIdElement())
12560      composeString(t, "MolecularSequence", "variantsetId", element.getVariantsetIdElement(), -1);
12561    if (element.hasReadsetIdElement())
12562      composeString(t, "MolecularSequence", "readsetId", element.getReadsetIdElement(), -1);
12563  }
12564
12565  protected void composeMolecularSequenceMolecularSequenceStructureVariantComponent(Complex parent, String parentType,
12566      String name, MolecularSequence.MolecularSequenceStructureVariantComponent element, int index) {
12567    if (element == null)
12568      return;
12569    Complex t;
12570    if (Utilities.noString(parentType))
12571      t = parent;
12572    else {
12573      t = parent.predicate("fhir:" + parentType + '.' + name);
12574    }
12575    composeBackboneElement(t, "structureVariant", name, element, index);
12576    if (element.hasVariantType())
12577      composeCodeableConcept(t, "MolecularSequence", "variantType", element.getVariantType(), -1);
12578    if (element.hasExactElement())
12579      composeBoolean(t, "MolecularSequence", "exact", element.getExactElement(), -1);
12580    if (element.hasLengthElement())
12581      composeInteger(t, "MolecularSequence", "length", element.getLengthElement(), -1);
12582    if (element.hasOuter())
12583      composeMolecularSequenceMolecularSequenceStructureVariantOuterComponent(t, "MolecularSequence", "outer",
12584          element.getOuter(), -1);
12585    if (element.hasInner())
12586      composeMolecularSequenceMolecularSequenceStructureVariantInnerComponent(t, "MolecularSequence", "inner",
12587          element.getInner(), -1);
12588  }
12589
12590  protected void composeMolecularSequenceMolecularSequenceStructureVariantOuterComponent(Complex parent,
12591      String parentType, String name, MolecularSequence.MolecularSequenceStructureVariantOuterComponent element,
12592      int index) {
12593    if (element == null)
12594      return;
12595    Complex t;
12596    if (Utilities.noString(parentType))
12597      t = parent;
12598    else {
12599      t = parent.predicate("fhir:" + parentType + '.' + name);
12600    }
12601    composeBackboneElement(t, "outer", name, element, index);
12602    if (element.hasStartElement())
12603      composeInteger(t, "MolecularSequence", "start", element.getStartElement(), -1);
12604    if (element.hasEndElement())
12605      composeInteger(t, "MolecularSequence", "end", element.getEndElement(), -1);
12606  }
12607
12608  protected void composeMolecularSequenceMolecularSequenceStructureVariantInnerComponent(Complex parent,
12609      String parentType, String name, MolecularSequence.MolecularSequenceStructureVariantInnerComponent element,
12610      int index) {
12611    if (element == null)
12612      return;
12613    Complex t;
12614    if (Utilities.noString(parentType))
12615      t = parent;
12616    else {
12617      t = parent.predicate("fhir:" + parentType + '.' + name);
12618    }
12619    composeBackboneElement(t, "inner", name, element, index);
12620    if (element.hasStartElement())
12621      composeInteger(t, "MolecularSequence", "start", element.getStartElement(), -1);
12622    if (element.hasEndElement())
12623      composeInteger(t, "MolecularSequence", "end", element.getEndElement(), -1);
12624  }
12625
12626  protected void composeNamingSystem(Complex parent, String parentType, String name, NamingSystem element, int index) {
12627    if (element == null)
12628      return;
12629    Complex t;
12630    if (Utilities.noString(parentType))
12631      t = parent;
12632    else {
12633      t = parent.predicate("fhir:" + parentType + '.' + name);
12634    }
12635    composeDomainResource(t, "NamingSystem", name, element, index);
12636    if (element.hasNameElement())
12637      composeString(t, "NamingSystem", "name", element.getNameElement(), -1);
12638    if (element.hasStatusElement())
12639      composeEnum(t, "NamingSystem", "status", element.getStatusElement(), -1);
12640    if (element.hasKindElement())
12641      composeEnum(t, "NamingSystem", "kind", element.getKindElement(), -1);
12642    if (element.hasDateElement())
12643      composeDateTime(t, "NamingSystem", "date", element.getDateElement(), -1);
12644    if (element.hasPublisherElement())
12645      composeString(t, "NamingSystem", "publisher", element.getPublisherElement(), -1);
12646    for (int i = 0; i < element.getContact().size(); i++)
12647      composeContactDetail(t, "NamingSystem", "contact", element.getContact().get(i), i);
12648    if (element.hasResponsibleElement())
12649      composeString(t, "NamingSystem", "responsible", element.getResponsibleElement(), -1);
12650    if (element.hasType())
12651      composeCodeableConcept(t, "NamingSystem", "type", element.getType(), -1);
12652    if (element.hasDescriptionElement())
12653      composeMarkdown(t, "NamingSystem", "description", element.getDescriptionElement(), -1);
12654    for (int i = 0; i < element.getUseContext().size(); i++)
12655      composeUsageContext(t, "NamingSystem", "useContext", element.getUseContext().get(i), i);
12656    for (int i = 0; i < element.getJurisdiction().size(); i++)
12657      composeCodeableConcept(t, "NamingSystem", "jurisdiction", element.getJurisdiction().get(i), i);
12658    if (element.hasUsageElement())
12659      composeString(t, "NamingSystem", "usage", element.getUsageElement(), -1);
12660    for (int i = 0; i < element.getUniqueId().size(); i++)
12661      composeNamingSystemNamingSystemUniqueIdComponent(t, "NamingSystem", "uniqueId", element.getUniqueId().get(i), i);
12662  }
12663
12664  protected void composeNamingSystemNamingSystemUniqueIdComponent(Complex parent, String parentType, String name,
12665      NamingSystem.NamingSystemUniqueIdComponent element, int index) {
12666    if (element == null)
12667      return;
12668    Complex t;
12669    if (Utilities.noString(parentType))
12670      t = parent;
12671    else {
12672      t = parent.predicate("fhir:" + parentType + '.' + name);
12673    }
12674    composeBackboneElement(t, "uniqueId", name, element, index);
12675    if (element.hasTypeElement())
12676      composeEnum(t, "NamingSystem", "type", element.getTypeElement(), -1);
12677    if (element.hasValueElement())
12678      composeString(t, "NamingSystem", "value", element.getValueElement(), -1);
12679    if (element.hasPreferredElement())
12680      composeBoolean(t, "NamingSystem", "preferred", element.getPreferredElement(), -1);
12681    if (element.hasCommentElement())
12682      composeString(t, "NamingSystem", "comment", element.getCommentElement(), -1);
12683    if (element.hasPeriod())
12684      composePeriod(t, "NamingSystem", "period", element.getPeriod(), -1);
12685  }
12686
12687  protected void composeNutritionOrder(Complex parent, String parentType, String name, NutritionOrder element,
12688      int index) {
12689    if (element == null)
12690      return;
12691    Complex t;
12692    if (Utilities.noString(parentType))
12693      t = parent;
12694    else {
12695      t = parent.predicate("fhir:" + parentType + '.' + name);
12696    }
12697    composeDomainResource(t, "NutritionOrder", name, element, index);
12698    for (int i = 0; i < element.getIdentifier().size(); i++)
12699      composeIdentifier(t, "NutritionOrder", "identifier", element.getIdentifier().get(i), i);
12700    for (int i = 0; i < element.getInstantiatesCanonical().size(); i++)
12701      composeCanonical(t, "NutritionOrder", "instantiatesCanonical", element.getInstantiatesCanonical().get(i), i);
12702    for (int i = 0; i < element.getInstantiatesUri().size(); i++)
12703      composeUri(t, "NutritionOrder", "instantiatesUri", element.getInstantiatesUri().get(i), i);
12704    for (int i = 0; i < element.getInstantiates().size(); i++)
12705      composeUri(t, "NutritionOrder", "instantiates", element.getInstantiates().get(i), i);
12706    if (element.hasStatusElement())
12707      composeEnum(t, "NutritionOrder", "status", element.getStatusElement(), -1);
12708    if (element.hasIntentElement())
12709      composeEnum(t, "NutritionOrder", "intent", element.getIntentElement(), -1);
12710    if (element.hasPatient())
12711      composeReference(t, "NutritionOrder", "patient", element.getPatient(), -1);
12712    if (element.hasEncounter())
12713      composeReference(t, "NutritionOrder", "encounter", element.getEncounter(), -1);
12714    if (element.hasDateTimeElement())
12715      composeDateTime(t, "NutritionOrder", "dateTime", element.getDateTimeElement(), -1);
12716    if (element.hasOrderer())
12717      composeReference(t, "NutritionOrder", "orderer", element.getOrderer(), -1);
12718    for (int i = 0; i < element.getAllergyIntolerance().size(); i++)
12719      composeReference(t, "NutritionOrder", "allergyIntolerance", element.getAllergyIntolerance().get(i), i);
12720    for (int i = 0; i < element.getFoodPreferenceModifier().size(); i++)
12721      composeCodeableConcept(t, "NutritionOrder", "foodPreferenceModifier", element.getFoodPreferenceModifier().get(i),
12722          i);
12723    for (int i = 0; i < element.getExcludeFoodModifier().size(); i++)
12724      composeCodeableConcept(t, "NutritionOrder", "excludeFoodModifier", element.getExcludeFoodModifier().get(i), i);
12725    if (element.hasOralDiet())
12726      composeNutritionOrderNutritionOrderOralDietComponent(t, "NutritionOrder", "oralDiet", element.getOralDiet(), -1);
12727    for (int i = 0; i < element.getSupplement().size(); i++)
12728      composeNutritionOrderNutritionOrderSupplementComponent(t, "NutritionOrder", "supplement",
12729          element.getSupplement().get(i), i);
12730    if (element.hasEnteralFormula())
12731      composeNutritionOrderNutritionOrderEnteralFormulaComponent(t, "NutritionOrder", "enteralFormula",
12732          element.getEnteralFormula(), -1);
12733    for (int i = 0; i < element.getNote().size(); i++)
12734      composeAnnotation(t, "NutritionOrder", "note", element.getNote().get(i), i);
12735  }
12736
12737  protected void composeNutritionOrderNutritionOrderOralDietComponent(Complex parent, String parentType, String name,
12738      NutritionOrder.NutritionOrderOralDietComponent element, int index) {
12739    if (element == null)
12740      return;
12741    Complex t;
12742    if (Utilities.noString(parentType))
12743      t = parent;
12744    else {
12745      t = parent.predicate("fhir:" + parentType + '.' + name);
12746    }
12747    composeBackboneElement(t, "oralDiet", name, element, index);
12748    for (int i = 0; i < element.getType().size(); i++)
12749      composeCodeableConcept(t, "NutritionOrder", "type", element.getType().get(i), i);
12750    for (int i = 0; i < element.getSchedule().size(); i++)
12751      composeTiming(t, "NutritionOrder", "schedule", element.getSchedule().get(i), i);
12752    for (int i = 0; i < element.getNutrient().size(); i++)
12753      composeNutritionOrderNutritionOrderOralDietNutrientComponent(t, "NutritionOrder", "nutrient",
12754          element.getNutrient().get(i), i);
12755    for (int i = 0; i < element.getTexture().size(); i++)
12756      composeNutritionOrderNutritionOrderOralDietTextureComponent(t, "NutritionOrder", "texture",
12757          element.getTexture().get(i), i);
12758    for (int i = 0; i < element.getFluidConsistencyType().size(); i++)
12759      composeCodeableConcept(t, "NutritionOrder", "fluidConsistencyType", element.getFluidConsistencyType().get(i), i);
12760    if (element.hasInstructionElement())
12761      composeString(t, "NutritionOrder", "instruction", element.getInstructionElement(), -1);
12762  }
12763
12764  protected void composeNutritionOrderNutritionOrderOralDietNutrientComponent(Complex parent, String parentType,
12765      String name, NutritionOrder.NutritionOrderOralDietNutrientComponent element, int index) {
12766    if (element == null)
12767      return;
12768    Complex t;
12769    if (Utilities.noString(parentType))
12770      t = parent;
12771    else {
12772      t = parent.predicate("fhir:" + parentType + '.' + name);
12773    }
12774    composeBackboneElement(t, "nutrient", name, element, index);
12775    if (element.hasModifier())
12776      composeCodeableConcept(t, "NutritionOrder", "modifier", element.getModifier(), -1);
12777    if (element.hasAmount())
12778      composeQuantity(t, "NutritionOrder", "amount", element.getAmount(), -1);
12779  }
12780
12781  protected void composeNutritionOrderNutritionOrderOralDietTextureComponent(Complex parent, String parentType,
12782      String name, NutritionOrder.NutritionOrderOralDietTextureComponent element, int index) {
12783    if (element == null)
12784      return;
12785    Complex t;
12786    if (Utilities.noString(parentType))
12787      t = parent;
12788    else {
12789      t = parent.predicate("fhir:" + parentType + '.' + name);
12790    }
12791    composeBackboneElement(t, "texture", name, element, index);
12792    if (element.hasModifier())
12793      composeCodeableConcept(t, "NutritionOrder", "modifier", element.getModifier(), -1);
12794    if (element.hasFoodType())
12795      composeCodeableConcept(t, "NutritionOrder", "foodType", element.getFoodType(), -1);
12796  }
12797
12798  protected void composeNutritionOrderNutritionOrderSupplementComponent(Complex parent, String parentType, String name,
12799      NutritionOrder.NutritionOrderSupplementComponent element, int index) {
12800    if (element == null)
12801      return;
12802    Complex t;
12803    if (Utilities.noString(parentType))
12804      t = parent;
12805    else {
12806      t = parent.predicate("fhir:" + parentType + '.' + name);
12807    }
12808    composeBackboneElement(t, "supplement", name, element, index);
12809    if (element.hasType())
12810      composeCodeableConcept(t, "NutritionOrder", "type", element.getType(), -1);
12811    if (element.hasProductNameElement())
12812      composeString(t, "NutritionOrder", "productName", element.getProductNameElement(), -1);
12813    for (int i = 0; i < element.getSchedule().size(); i++)
12814      composeTiming(t, "NutritionOrder", "schedule", element.getSchedule().get(i), i);
12815    if (element.hasQuantity())
12816      composeQuantity(t, "NutritionOrder", "quantity", element.getQuantity(), -1);
12817    if (element.hasInstructionElement())
12818      composeString(t, "NutritionOrder", "instruction", element.getInstructionElement(), -1);
12819  }
12820
12821  protected void composeNutritionOrderNutritionOrderEnteralFormulaComponent(Complex parent, String parentType,
12822      String name, NutritionOrder.NutritionOrderEnteralFormulaComponent element, int index) {
12823    if (element == null)
12824      return;
12825    Complex t;
12826    if (Utilities.noString(parentType))
12827      t = parent;
12828    else {
12829      t = parent.predicate("fhir:" + parentType + '.' + name);
12830    }
12831    composeBackboneElement(t, "enteralFormula", name, element, index);
12832    if (element.hasBaseFormulaType())
12833      composeCodeableConcept(t, "NutritionOrder", "baseFormulaType", element.getBaseFormulaType(), -1);
12834    if (element.hasBaseFormulaProductNameElement())
12835      composeString(t, "NutritionOrder", "baseFormulaProductName", element.getBaseFormulaProductNameElement(), -1);
12836    if (element.hasAdditiveType())
12837      composeCodeableConcept(t, "NutritionOrder", "additiveType", element.getAdditiveType(), -1);
12838    if (element.hasAdditiveProductNameElement())
12839      composeString(t, "NutritionOrder", "additiveProductName", element.getAdditiveProductNameElement(), -1);
12840    if (element.hasCaloricDensity())
12841      composeQuantity(t, "NutritionOrder", "caloricDensity", element.getCaloricDensity(), -1);
12842    if (element.hasRouteofAdministration())
12843      composeCodeableConcept(t, "NutritionOrder", "routeofAdministration", element.getRouteofAdministration(), -1);
12844    for (int i = 0; i < element.getAdministration().size(); i++)
12845      composeNutritionOrderNutritionOrderEnteralFormulaAdministrationComponent(t, "NutritionOrder", "administration",
12846          element.getAdministration().get(i), i);
12847    if (element.hasMaxVolumeToDeliver())
12848      composeQuantity(t, "NutritionOrder", "maxVolumeToDeliver", element.getMaxVolumeToDeliver(), -1);
12849    if (element.hasAdministrationInstructionElement())
12850      composeString(t, "NutritionOrder", "administrationInstruction", element.getAdministrationInstructionElement(),
12851          -1);
12852  }
12853
12854  protected void composeNutritionOrderNutritionOrderEnteralFormulaAdministrationComponent(Complex parent,
12855      String parentType, String name, NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent element,
12856      int index) {
12857    if (element == null)
12858      return;
12859    Complex t;
12860    if (Utilities.noString(parentType))
12861      t = parent;
12862    else {
12863      t = parent.predicate("fhir:" + parentType + '.' + name);
12864    }
12865    composeBackboneElement(t, "administration", name, element, index);
12866    if (element.hasSchedule())
12867      composeTiming(t, "NutritionOrder", "schedule", element.getSchedule(), -1);
12868    if (element.hasQuantity())
12869      composeQuantity(t, "NutritionOrder", "quantity", element.getQuantity(), -1);
12870    if (element.hasRate())
12871      composeType(t, "NutritionOrder", "rate", element.getRate(), -1);
12872  }
12873
12874  protected void composeObservation(Complex parent, String parentType, String name, Observation element, int index) {
12875    if (element == null)
12876      return;
12877    Complex t;
12878    if (Utilities.noString(parentType))
12879      t = parent;
12880    else {
12881      t = parent.predicate("fhir:" + parentType + '.' + name);
12882    }
12883    composeDomainResource(t, "Observation", name, element, index);
12884    for (int i = 0; i < element.getIdentifier().size(); i++)
12885      composeIdentifier(t, "Observation", "identifier", element.getIdentifier().get(i), i);
12886    for (int i = 0; i < element.getBasedOn().size(); i++)
12887      composeReference(t, "Observation", "basedOn", element.getBasedOn().get(i), i);
12888    for (int i = 0; i < element.getPartOf().size(); i++)
12889      composeReference(t, "Observation", "partOf", element.getPartOf().get(i), i);
12890    if (element.hasStatusElement())
12891      composeEnum(t, "Observation", "status", element.getStatusElement(), -1);
12892    for (int i = 0; i < element.getCategory().size(); i++)
12893      composeCodeableConcept(t, "Observation", "category", element.getCategory().get(i), i);
12894    if (element.hasCode())
12895      composeCodeableConcept(t, "Observation", "code", element.getCode(), -1);
12896    if (element.hasSubject())
12897      composeReference(t, "Observation", "subject", element.getSubject(), -1);
12898    for (int i = 0; i < element.getFocus().size(); i++)
12899      composeReference(t, "Observation", "focus", element.getFocus().get(i), i);
12900    if (element.hasEncounter())
12901      composeReference(t, "Observation", "encounter", element.getEncounter(), -1);
12902    if (element.hasEffective())
12903      composeType(t, "Observation", "effective", element.getEffective(), -1);
12904    if (element.hasIssuedElement())
12905      composeInstant(t, "Observation", "issued", element.getIssuedElement(), -1);
12906    for (int i = 0; i < element.getPerformer().size(); i++)
12907      composeReference(t, "Observation", "performer", element.getPerformer().get(i), i);
12908    if (element.hasValue())
12909      composeType(t, "Observation", "value", element.getValue(), -1);
12910    if (element.hasDataAbsentReason())
12911      composeCodeableConcept(t, "Observation", "dataAbsentReason", element.getDataAbsentReason(), -1);
12912    for (int i = 0; i < element.getInterpretation().size(); i++)
12913      composeCodeableConcept(t, "Observation", "interpretation", element.getInterpretation().get(i), i);
12914    for (int i = 0; i < element.getNote().size(); i++)
12915      composeAnnotation(t, "Observation", "note", element.getNote().get(i), i);
12916    if (element.hasBodySite())
12917      composeCodeableConcept(t, "Observation", "bodySite", element.getBodySite(), -1);
12918    if (element.hasMethod())
12919      composeCodeableConcept(t, "Observation", "method", element.getMethod(), -1);
12920    if (element.hasSpecimen())
12921      composeReference(t, "Observation", "specimen", element.getSpecimen(), -1);
12922    if (element.hasDevice())
12923      composeReference(t, "Observation", "device", element.getDevice(), -1);
12924    for (int i = 0; i < element.getReferenceRange().size(); i++)
12925      composeObservationObservationReferenceRangeComponent(t, "Observation", "referenceRange",
12926          element.getReferenceRange().get(i), i);
12927    for (int i = 0; i < element.getHasMember().size(); i++)
12928      composeReference(t, "Observation", "hasMember", element.getHasMember().get(i), i);
12929    for (int i = 0; i < element.getDerivedFrom().size(); i++)
12930      composeReference(t, "Observation", "derivedFrom", element.getDerivedFrom().get(i), i);
12931    for (int i = 0; i < element.getComponent().size(); i++)
12932      composeObservationObservationComponentComponent(t, "Observation", "component", element.getComponent().get(i), i);
12933  }
12934
12935  protected void composeObservationObservationReferenceRangeComponent(Complex parent, String parentType, String name,
12936      Observation.ObservationReferenceRangeComponent element, int index) {
12937    if (element == null)
12938      return;
12939    Complex t;
12940    if (Utilities.noString(parentType))
12941      t = parent;
12942    else {
12943      t = parent.predicate("fhir:" + parentType + '.' + name);
12944    }
12945    composeBackboneElement(t, "referenceRange", name, element, index);
12946    if (element.hasLow())
12947      composeQuantity(t, "Observation", "low", element.getLow(), -1);
12948    if (element.hasHigh())
12949      composeQuantity(t, "Observation", "high", element.getHigh(), -1);
12950    if (element.hasType())
12951      composeCodeableConcept(t, "Observation", "type", element.getType(), -1);
12952    for (int i = 0; i < element.getAppliesTo().size(); i++)
12953      composeCodeableConcept(t, "Observation", "appliesTo", element.getAppliesTo().get(i), i);
12954    if (element.hasAge())
12955      composeRange(t, "Observation", "age", element.getAge(), -1);
12956    if (element.hasTextElement())
12957      composeString(t, "Observation", "text", element.getTextElement(), -1);
12958  }
12959
12960  protected void composeObservationObservationComponentComponent(Complex parent, String parentType, String name,
12961      Observation.ObservationComponentComponent element, int index) {
12962    if (element == null)
12963      return;
12964    Complex t;
12965    if (Utilities.noString(parentType))
12966      t = parent;
12967    else {
12968      t = parent.predicate("fhir:" + parentType + '.' + name);
12969    }
12970    composeBackboneElement(t, "component", name, element, index);
12971    if (element.hasCode())
12972      composeCodeableConcept(t, "Observation", "code", element.getCode(), -1);
12973    if (element.hasValue())
12974      composeType(t, "Observation", "value", element.getValue(), -1);
12975    if (element.hasDataAbsentReason())
12976      composeCodeableConcept(t, "Observation", "dataAbsentReason", element.getDataAbsentReason(), -1);
12977    for (int i = 0; i < element.getInterpretation().size(); i++)
12978      composeCodeableConcept(t, "Observation", "interpretation", element.getInterpretation().get(i), i);
12979    for (int i = 0; i < element.getReferenceRange().size(); i++)
12980      composeObservationObservationReferenceRangeComponent(t, "Observation", "referenceRange",
12981          element.getReferenceRange().get(i), i);
12982  }
12983
12984  protected void composeObservationDefinition(Complex parent, String parentType, String name,
12985      ObservationDefinition element, int index) {
12986    if (element == null)
12987      return;
12988    Complex t;
12989    if (Utilities.noString(parentType))
12990      t = parent;
12991    else {
12992      t = parent.predicate("fhir:" + parentType + '.' + name);
12993    }
12994    composeDomainResource(t, "ObservationDefinition", name, element, index);
12995    for (int i = 0; i < element.getCategory().size(); i++)
12996      composeCodeableConcept(t, "ObservationDefinition", "category", element.getCategory().get(i), i);
12997    if (element.hasCode())
12998      composeCodeableConcept(t, "ObservationDefinition", "code", element.getCode(), -1);
12999    for (int i = 0; i < element.getIdentifier().size(); i++)
13000      composeIdentifier(t, "ObservationDefinition", "identifier", element.getIdentifier().get(i), i);
13001    for (int i = 0; i < element.getPermittedDataType().size(); i++)
13002      composeEnum(t, "ObservationDefinition", "permittedDataType", element.getPermittedDataType().get(i), i);
13003    if (element.hasMultipleResultsAllowedElement())
13004      composeBoolean(t, "ObservationDefinition", "multipleResultsAllowed", element.getMultipleResultsAllowedElement(),
13005          -1);
13006    if (element.hasMethod())
13007      composeCodeableConcept(t, "ObservationDefinition", "method", element.getMethod(), -1);
13008    if (element.hasPreferredReportNameElement())
13009      composeString(t, "ObservationDefinition", "preferredReportName", element.getPreferredReportNameElement(), -1);
13010    if (element.hasQuantitativeDetails())
13011      composeObservationDefinitionObservationDefinitionQuantitativeDetailsComponent(t, "ObservationDefinition",
13012          "quantitativeDetails", element.getQuantitativeDetails(), -1);
13013    for (int i = 0; i < element.getQualifiedInterval().size(); i++)
13014      composeObservationDefinitionObservationDefinitionQualifiedIntervalComponent(t, "ObservationDefinition",
13015          "qualifiedInterval", element.getQualifiedInterval().get(i), i);
13016    if (element.hasValidCodedValueSet())
13017      composeReference(t, "ObservationDefinition", "validCodedValueSet", element.getValidCodedValueSet(), -1);
13018    if (element.hasNormalCodedValueSet())
13019      composeReference(t, "ObservationDefinition", "normalCodedValueSet", element.getNormalCodedValueSet(), -1);
13020    if (element.hasAbnormalCodedValueSet())
13021      composeReference(t, "ObservationDefinition", "abnormalCodedValueSet", element.getAbnormalCodedValueSet(), -1);
13022    if (element.hasCriticalCodedValueSet())
13023      composeReference(t, "ObservationDefinition", "criticalCodedValueSet", element.getCriticalCodedValueSet(), -1);
13024  }
13025
13026  protected void composeObservationDefinitionObservationDefinitionQuantitativeDetailsComponent(Complex parent,
13027      String parentType, String name, ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent element,
13028      int index) {
13029    if (element == null)
13030      return;
13031    Complex t;
13032    if (Utilities.noString(parentType))
13033      t = parent;
13034    else {
13035      t = parent.predicate("fhir:" + parentType + '.' + name);
13036    }
13037    composeBackboneElement(t, "quantitativeDetails", name, element, index);
13038    if (element.hasCustomaryUnit())
13039      composeCodeableConcept(t, "ObservationDefinition", "customaryUnit", element.getCustomaryUnit(), -1);
13040    if (element.hasUnit())
13041      composeCodeableConcept(t, "ObservationDefinition", "unit", element.getUnit(), -1);
13042    if (element.hasConversionFactorElement())
13043      composeDecimal(t, "ObservationDefinition", "conversionFactor", element.getConversionFactorElement(), -1);
13044    if (element.hasDecimalPrecisionElement())
13045      composeInteger(t, "ObservationDefinition", "decimalPrecision", element.getDecimalPrecisionElement(), -1);
13046  }
13047
13048  protected void composeObservationDefinitionObservationDefinitionQualifiedIntervalComponent(Complex parent,
13049      String parentType, String name, ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent element,
13050      int index) {
13051    if (element == null)
13052      return;
13053    Complex t;
13054    if (Utilities.noString(parentType))
13055      t = parent;
13056    else {
13057      t = parent.predicate("fhir:" + parentType + '.' + name);
13058    }
13059    composeBackboneElement(t, "qualifiedInterval", name, element, index);
13060    if (element.hasCategoryElement())
13061      composeEnum(t, "ObservationDefinition", "category", element.getCategoryElement(), -1);
13062    if (element.hasRange())
13063      composeRange(t, "ObservationDefinition", "range", element.getRange(), -1);
13064    if (element.hasContext())
13065      composeCodeableConcept(t, "ObservationDefinition", "context", element.getContext(), -1);
13066    for (int i = 0; i < element.getAppliesTo().size(); i++)
13067      composeCodeableConcept(t, "ObservationDefinition", "appliesTo", element.getAppliesTo().get(i), i);
13068    if (element.hasGenderElement())
13069      composeEnum(t, "ObservationDefinition", "gender", element.getGenderElement(), -1);
13070    if (element.hasAge())
13071      composeRange(t, "ObservationDefinition", "age", element.getAge(), -1);
13072    if (element.hasGestationalAge())
13073      composeRange(t, "ObservationDefinition", "gestationalAge", element.getGestationalAge(), -1);
13074    if (element.hasConditionElement())
13075      composeString(t, "ObservationDefinition", "condition", element.getConditionElement(), -1);
13076  }
13077
13078  protected void composeOperationDefinition(Complex parent, String parentType, String name, OperationDefinition element,
13079      int index) {
13080    if (element == null)
13081      return;
13082    Complex t;
13083    if (Utilities.noString(parentType))
13084      t = parent;
13085    else {
13086      t = parent.predicate("fhir:" + parentType + '.' + name);
13087    }
13088    composeDomainResource(t, "OperationDefinition", name, element, index);
13089    if (element.hasUrlElement())
13090      composeUri(t, "OperationDefinition", "url", element.getUrlElement(), -1);
13091    if (element.hasVersionElement())
13092      composeString(t, "OperationDefinition", "version", element.getVersionElement(), -1);
13093    if (element.hasNameElement())
13094      composeString(t, "OperationDefinition", "name", element.getNameElement(), -1);
13095    if (element.hasTitleElement())
13096      composeString(t, "OperationDefinition", "title", element.getTitleElement(), -1);
13097    if (element.hasStatusElement())
13098      composeEnum(t, "OperationDefinition", "status", element.getStatusElement(), -1);
13099    if (element.hasKindElement())
13100      composeEnum(t, "OperationDefinition", "kind", element.getKindElement(), -1);
13101    if (element.hasExperimentalElement())
13102      composeBoolean(t, "OperationDefinition", "experimental", element.getExperimentalElement(), -1);
13103    if (element.hasDateElement())
13104      composeDateTime(t, "OperationDefinition", "date", element.getDateElement(), -1);
13105    if (element.hasPublisherElement())
13106      composeString(t, "OperationDefinition", "publisher", element.getPublisherElement(), -1);
13107    for (int i = 0; i < element.getContact().size(); i++)
13108      composeContactDetail(t, "OperationDefinition", "contact", element.getContact().get(i), i);
13109    if (element.hasDescriptionElement())
13110      composeMarkdown(t, "OperationDefinition", "description", element.getDescriptionElement(), -1);
13111    for (int i = 0; i < element.getUseContext().size(); i++)
13112      composeUsageContext(t, "OperationDefinition", "useContext", element.getUseContext().get(i), i);
13113    for (int i = 0; i < element.getJurisdiction().size(); i++)
13114      composeCodeableConcept(t, "OperationDefinition", "jurisdiction", element.getJurisdiction().get(i), i);
13115    if (element.hasPurposeElement())
13116      composeMarkdown(t, "OperationDefinition", "purpose", element.getPurposeElement(), -1);
13117    if (element.hasAffectsStateElement())
13118      composeBoolean(t, "OperationDefinition", "affectsState", element.getAffectsStateElement(), -1);
13119    if (element.hasCodeElement())
13120      composeCode(t, "OperationDefinition", "code", element.getCodeElement(), -1);
13121    if (element.hasCommentElement())
13122      composeMarkdown(t, "OperationDefinition", "comment", element.getCommentElement(), -1);
13123    if (element.hasBaseElement())
13124      composeCanonical(t, "OperationDefinition", "base", element.getBaseElement(), -1);
13125    for (int i = 0; i < element.getResource().size(); i++)
13126      composeCode(t, "OperationDefinition", "resource", element.getResource().get(i), i);
13127    if (element.hasSystemElement())
13128      composeBoolean(t, "OperationDefinition", "system", element.getSystemElement(), -1);
13129    if (element.hasTypeElement())
13130      composeBoolean(t, "OperationDefinition", "type", element.getTypeElement(), -1);
13131    if (element.hasInstanceElement())
13132      composeBoolean(t, "OperationDefinition", "instance", element.getInstanceElement(), -1);
13133    if (element.hasInputProfileElement())
13134      composeCanonical(t, "OperationDefinition", "inputProfile", element.getInputProfileElement(), -1);
13135    if (element.hasOutputProfileElement())
13136      composeCanonical(t, "OperationDefinition", "outputProfile", element.getOutputProfileElement(), -1);
13137    for (int i = 0; i < element.getParameter().size(); i++)
13138      composeOperationDefinitionOperationDefinitionParameterComponent(t, "OperationDefinition", "parameter",
13139          element.getParameter().get(i), i);
13140    for (int i = 0; i < element.getOverload().size(); i++)
13141      composeOperationDefinitionOperationDefinitionOverloadComponent(t, "OperationDefinition", "overload",
13142          element.getOverload().get(i), i);
13143  }
13144
13145  protected void composeOperationDefinitionOperationDefinitionParameterComponent(Complex parent, String parentType,
13146      String name, OperationDefinition.OperationDefinitionParameterComponent element, int index) {
13147    if (element == null)
13148      return;
13149    Complex t;
13150    if (Utilities.noString(parentType))
13151      t = parent;
13152    else {
13153      t = parent.predicate("fhir:" + parentType + '.' + name);
13154    }
13155    composeBackboneElement(t, "parameter", name, element, index);
13156    if (element.hasNameElement())
13157      composeCode(t, "OperationDefinition", "name", element.getNameElement(), -1);
13158    if (element.hasUseElement())
13159      composeEnum(t, "OperationDefinition", "use", element.getUseElement(), -1);
13160    if (element.hasMinElement())
13161      composeInteger(t, "OperationDefinition", "min", element.getMinElement(), -1);
13162    if (element.hasMaxElement())
13163      composeString(t, "OperationDefinition", "max", element.getMaxElement(), -1);
13164    if (element.hasDocumentationElement())
13165      composeString(t, "OperationDefinition", "documentation", element.getDocumentationElement(), -1);
13166    if (element.hasTypeElement())
13167      composeCode(t, "OperationDefinition", "type", element.getTypeElement(), -1);
13168    for (int i = 0; i < element.getTargetProfile().size(); i++)
13169      composeCanonical(t, "OperationDefinition", "targetProfile", element.getTargetProfile().get(i), i);
13170    if (element.hasSearchTypeElement())
13171      composeEnum(t, "OperationDefinition", "searchType", element.getSearchTypeElement(), -1);
13172    if (element.hasBinding())
13173      composeOperationDefinitionOperationDefinitionParameterBindingComponent(t, "OperationDefinition", "binding",
13174          element.getBinding(), -1);
13175    for (int i = 0; i < element.getReferencedFrom().size(); i++)
13176      composeOperationDefinitionOperationDefinitionParameterReferencedFromComponent(t, "OperationDefinition",
13177          "referencedFrom", element.getReferencedFrom().get(i), i);
13178    for (int i = 0; i < element.getPart().size(); i++)
13179      composeOperationDefinitionOperationDefinitionParameterComponent(t, "OperationDefinition", "part",
13180          element.getPart().get(i), i);
13181  }
13182
13183  protected void composeOperationDefinitionOperationDefinitionParameterBindingComponent(Complex parent,
13184      String parentType, String name, OperationDefinition.OperationDefinitionParameterBindingComponent element,
13185      int index) {
13186    if (element == null)
13187      return;
13188    Complex t;
13189    if (Utilities.noString(parentType))
13190      t = parent;
13191    else {
13192      t = parent.predicate("fhir:" + parentType + '.' + name);
13193    }
13194    composeBackboneElement(t, "binding", name, element, index);
13195    if (element.hasStrengthElement())
13196      composeEnum(t, "OperationDefinition", "strength", element.getStrengthElement(), -1);
13197    if (element.hasValueSetElement())
13198      composeCanonical(t, "OperationDefinition", "valueSet", element.getValueSetElement(), -1);
13199  }
13200
13201  protected void composeOperationDefinitionOperationDefinitionParameterReferencedFromComponent(Complex parent,
13202      String parentType, String name, OperationDefinition.OperationDefinitionParameterReferencedFromComponent element,
13203      int index) {
13204    if (element == null)
13205      return;
13206    Complex t;
13207    if (Utilities.noString(parentType))
13208      t = parent;
13209    else {
13210      t = parent.predicate("fhir:" + parentType + '.' + name);
13211    }
13212    composeBackboneElement(t, "referencedFrom", name, element, index);
13213    if (element.hasSourceElement())
13214      composeString(t, "OperationDefinition", "source", element.getSourceElement(), -1);
13215    if (element.hasSourceIdElement())
13216      composeString(t, "OperationDefinition", "sourceId", element.getSourceIdElement(), -1);
13217  }
13218
13219  protected void composeOperationDefinitionOperationDefinitionOverloadComponent(Complex parent, String parentType,
13220      String name, OperationDefinition.OperationDefinitionOverloadComponent element, int index) {
13221    if (element == null)
13222      return;
13223    Complex t;
13224    if (Utilities.noString(parentType))
13225      t = parent;
13226    else {
13227      t = parent.predicate("fhir:" + parentType + '.' + name);
13228    }
13229    composeBackboneElement(t, "overload", name, element, index);
13230    for (int i = 0; i < element.getParameterName().size(); i++)
13231      composeString(t, "OperationDefinition", "parameterName", element.getParameterName().get(i), i);
13232    if (element.hasCommentElement())
13233      composeString(t, "OperationDefinition", "comment", element.getCommentElement(), -1);
13234  }
13235
13236  protected void composeOperationOutcome(Complex parent, String parentType, String name, OperationOutcome element,
13237      int index) {
13238    if (element == null)
13239      return;
13240    Complex t;
13241    if (Utilities.noString(parentType))
13242      t = parent;
13243    else {
13244      t = parent.predicate("fhir:" + parentType + '.' + name);
13245    }
13246    composeDomainResource(t, "OperationOutcome", name, element, index);
13247    for (int i = 0; i < element.getIssue().size(); i++)
13248      composeOperationOutcomeOperationOutcomeIssueComponent(t, "OperationOutcome", "issue", element.getIssue().get(i),
13249          i);
13250  }
13251
13252  protected void composeOperationOutcomeOperationOutcomeIssueComponent(Complex parent, String parentType, String name,
13253      OperationOutcome.OperationOutcomeIssueComponent element, int index) {
13254    if (element == null)
13255      return;
13256    Complex t;
13257    if (Utilities.noString(parentType))
13258      t = parent;
13259    else {
13260      t = parent.predicate("fhir:" + parentType + '.' + name);
13261    }
13262    composeBackboneElement(t, "issue", name, element, index);
13263    if (element.hasSeverityElement())
13264      composeEnum(t, "OperationOutcome", "severity", element.getSeverityElement(), -1);
13265    if (element.hasCodeElement())
13266      composeEnum(t, "OperationOutcome", "code", element.getCodeElement(), -1);
13267    if (element.hasDetails())
13268      composeCodeableConcept(t, "OperationOutcome", "details", element.getDetails(), -1);
13269    if (element.hasDiagnosticsElement())
13270      composeString(t, "OperationOutcome", "diagnostics", element.getDiagnosticsElement(), -1);
13271    for (int i = 0; i < element.getLocation().size(); i++)
13272      composeString(t, "OperationOutcome", "location", element.getLocation().get(i), i);
13273    for (int i = 0; i < element.getExpression().size(); i++)
13274      composeString(t, "OperationOutcome", "expression", element.getExpression().get(i), i);
13275  }
13276
13277  protected void composeOrganization(Complex parent, String parentType, String name, Organization element, int index) {
13278    if (element == null)
13279      return;
13280    Complex t;
13281    if (Utilities.noString(parentType))
13282      t = parent;
13283    else {
13284      t = parent.predicate("fhir:" + parentType + '.' + name);
13285    }
13286    composeDomainResource(t, "Organization", name, element, index);
13287    for (int i = 0; i < element.getIdentifier().size(); i++)
13288      composeIdentifier(t, "Organization", "identifier", element.getIdentifier().get(i), i);
13289    if (element.hasActiveElement())
13290      composeBoolean(t, "Organization", "active", element.getActiveElement(), -1);
13291    for (int i = 0; i < element.getType().size(); i++)
13292      composeCodeableConcept(t, "Organization", "type", element.getType().get(i), i);
13293    if (element.hasNameElement())
13294      composeString(t, "Organization", "name", element.getNameElement(), -1);
13295    for (int i = 0; i < element.getAlias().size(); i++)
13296      composeString(t, "Organization", "alias", element.getAlias().get(i), i);
13297    for (int i = 0; i < element.getTelecom().size(); i++)
13298      composeContactPoint(t, "Organization", "telecom", element.getTelecom().get(i), i);
13299    for (int i = 0; i < element.getAddress().size(); i++)
13300      composeAddress(t, "Organization", "address", element.getAddress().get(i), i);
13301    if (element.hasPartOf())
13302      composeReference(t, "Organization", "partOf", element.getPartOf(), -1);
13303    for (int i = 0; i < element.getContact().size(); i++)
13304      composeOrganizationOrganizationContactComponent(t, "Organization", "contact", element.getContact().get(i), i);
13305    for (int i = 0; i < element.getEndpoint().size(); i++)
13306      composeReference(t, "Organization", "endpoint", element.getEndpoint().get(i), i);
13307  }
13308
13309  protected void composeOrganizationOrganizationContactComponent(Complex parent, String parentType, String name,
13310      Organization.OrganizationContactComponent element, int index) {
13311    if (element == null)
13312      return;
13313    Complex t;
13314    if (Utilities.noString(parentType))
13315      t = parent;
13316    else {
13317      t = parent.predicate("fhir:" + parentType + '.' + name);
13318    }
13319    composeBackboneElement(t, "contact", name, element, index);
13320    if (element.hasPurpose())
13321      composeCodeableConcept(t, "Organization", "purpose", element.getPurpose(), -1);
13322    if (element.hasName())
13323      composeHumanName(t, "Organization", "name", element.getName(), -1);
13324    for (int i = 0; i < element.getTelecom().size(); i++)
13325      composeContactPoint(t, "Organization", "telecom", element.getTelecom().get(i), i);
13326    if (element.hasAddress())
13327      composeAddress(t, "Organization", "address", element.getAddress(), -1);
13328  }
13329
13330  protected void composeOrganizationAffiliation(Complex parent, String parentType, String name,
13331      OrganizationAffiliation element, int index) {
13332    if (element == null)
13333      return;
13334    Complex t;
13335    if (Utilities.noString(parentType))
13336      t = parent;
13337    else {
13338      t = parent.predicate("fhir:" + parentType + '.' + name);
13339    }
13340    composeDomainResource(t, "OrganizationAffiliation", name, element, index);
13341    for (int i = 0; i < element.getIdentifier().size(); i++)
13342      composeIdentifier(t, "OrganizationAffiliation", "identifier", element.getIdentifier().get(i), i);
13343    if (element.hasActiveElement())
13344      composeBoolean(t, "OrganizationAffiliation", "active", element.getActiveElement(), -1);
13345    if (element.hasPeriod())
13346      composePeriod(t, "OrganizationAffiliation", "period", element.getPeriod(), -1);
13347    if (element.hasOrganization())
13348      composeReference(t, "OrganizationAffiliation", "organization", element.getOrganization(), -1);
13349    if (element.hasParticipatingOrganization())
13350      composeReference(t, "OrganizationAffiliation", "participatingOrganization",
13351          element.getParticipatingOrganization(), -1);
13352    for (int i = 0; i < element.getNetwork().size(); i++)
13353      composeReference(t, "OrganizationAffiliation", "network", element.getNetwork().get(i), i);
13354    for (int i = 0; i < element.getCode().size(); i++)
13355      composeCodeableConcept(t, "OrganizationAffiliation", "code", element.getCode().get(i), i);
13356    for (int i = 0; i < element.getSpecialty().size(); i++)
13357      composeCodeableConcept(t, "OrganizationAffiliation", "specialty", element.getSpecialty().get(i), i);
13358    for (int i = 0; i < element.getLocation().size(); i++)
13359      composeReference(t, "OrganizationAffiliation", "location", element.getLocation().get(i), i);
13360    for (int i = 0; i < element.getHealthcareService().size(); i++)
13361      composeReference(t, "OrganizationAffiliation", "healthcareService", element.getHealthcareService().get(i), i);
13362    for (int i = 0; i < element.getTelecom().size(); i++)
13363      composeContactPoint(t, "OrganizationAffiliation", "telecom", element.getTelecom().get(i), i);
13364    for (int i = 0; i < element.getEndpoint().size(); i++)
13365      composeReference(t, "OrganizationAffiliation", "endpoint", element.getEndpoint().get(i), i);
13366  }
13367
13368  protected void composePatient(Complex parent, String parentType, String name, Patient element, int index) {
13369    if (element == null)
13370      return;
13371    Complex t;
13372    if (Utilities.noString(parentType))
13373      t = parent;
13374    else {
13375      t = parent.predicate("fhir:" + parentType + '.' + name);
13376    }
13377    composeDomainResource(t, "Patient", name, element, index);
13378    for (int i = 0; i < element.getIdentifier().size(); i++)
13379      composeIdentifier(t, "Patient", "identifier", element.getIdentifier().get(i), i);
13380    if (element.hasActiveElement())
13381      composeBoolean(t, "Patient", "active", element.getActiveElement(), -1);
13382    for (int i = 0; i < element.getName().size(); i++)
13383      composeHumanName(t, "Patient", "name", element.getName().get(i), i);
13384    for (int i = 0; i < element.getTelecom().size(); i++)
13385      composeContactPoint(t, "Patient", "telecom", element.getTelecom().get(i), i);
13386    if (element.hasGenderElement())
13387      composeEnum(t, "Patient", "gender", element.getGenderElement(), -1);
13388    if (element.hasBirthDateElement())
13389      composeDate(t, "Patient", "birthDate", element.getBirthDateElement(), -1);
13390    if (element.hasDeceased())
13391      composeType(t, "Patient", "deceased", element.getDeceased(), -1);
13392    for (int i = 0; i < element.getAddress().size(); i++)
13393      composeAddress(t, "Patient", "address", element.getAddress().get(i), i);
13394    if (element.hasMaritalStatus())
13395      composeCodeableConcept(t, "Patient", "maritalStatus", element.getMaritalStatus(), -1);
13396    if (element.hasMultipleBirth())
13397      composeType(t, "Patient", "multipleBirth", element.getMultipleBirth(), -1);
13398    for (int i = 0; i < element.getPhoto().size(); i++)
13399      composeAttachment(t, "Patient", "photo", element.getPhoto().get(i), i);
13400    for (int i = 0; i < element.getContact().size(); i++)
13401      composePatientContactComponent(t, "Patient", "contact", element.getContact().get(i), i);
13402    for (int i = 0; i < element.getCommunication().size(); i++)
13403      composePatientPatientCommunicationComponent(t, "Patient", "communication", element.getCommunication().get(i), i);
13404    for (int i = 0; i < element.getGeneralPractitioner().size(); i++)
13405      composeReference(t, "Patient", "generalPractitioner", element.getGeneralPractitioner().get(i), i);
13406    if (element.hasManagingOrganization())
13407      composeReference(t, "Patient", "managingOrganization", element.getManagingOrganization(), -1);
13408    for (int i = 0; i < element.getLink().size(); i++)
13409      composePatientPatientLinkComponent(t, "Patient", "link", element.getLink().get(i), i);
13410  }
13411
13412  protected void composePatientContactComponent(Complex parent, String parentType, String name,
13413      Patient.ContactComponent element, int index) {
13414    if (element == null)
13415      return;
13416    Complex t;
13417    if (Utilities.noString(parentType))
13418      t = parent;
13419    else {
13420      t = parent.predicate("fhir:" + parentType + '.' + name);
13421    }
13422    composeBackboneElement(t, "contact", name, element, index);
13423    for (int i = 0; i < element.getRelationship().size(); i++)
13424      composeCodeableConcept(t, "Patient", "relationship", element.getRelationship().get(i), i);
13425    if (element.hasName())
13426      composeHumanName(t, "Patient", "name", element.getName(), -1);
13427    for (int i = 0; i < element.getTelecom().size(); i++)
13428      composeContactPoint(t, "Patient", "telecom", element.getTelecom().get(i), i);
13429    if (element.hasAddress())
13430      composeAddress(t, "Patient", "address", element.getAddress(), -1);
13431    if (element.hasGenderElement())
13432      composeEnum(t, "Patient", "gender", element.getGenderElement(), -1);
13433    if (element.hasOrganization())
13434      composeReference(t, "Patient", "organization", element.getOrganization(), -1);
13435    if (element.hasPeriod())
13436      composePeriod(t, "Patient", "period", element.getPeriod(), -1);
13437  }
13438
13439  protected void composePatientPatientCommunicationComponent(Complex parent, String parentType, String name,
13440      Patient.PatientCommunicationComponent element, int index) {
13441    if (element == null)
13442      return;
13443    Complex t;
13444    if (Utilities.noString(parentType))
13445      t = parent;
13446    else {
13447      t = parent.predicate("fhir:" + parentType + '.' + name);
13448    }
13449    composeBackboneElement(t, "communication", name, element, index);
13450    if (element.hasLanguage())
13451      composeCodeableConcept(t, "Patient", "language", element.getLanguage(), -1);
13452    if (element.hasPreferredElement())
13453      composeBoolean(t, "Patient", "preferred", element.getPreferredElement(), -1);
13454  }
13455
13456  protected void composePatientPatientLinkComponent(Complex parent, String parentType, String name,
13457      Patient.PatientLinkComponent element, int index) {
13458    if (element == null)
13459      return;
13460    Complex t;
13461    if (Utilities.noString(parentType))
13462      t = parent;
13463    else {
13464      t = parent.predicate("fhir:" + parentType + '.' + name);
13465    }
13466    composeBackboneElement(t, "link", name, element, index);
13467    if (element.hasOther())
13468      composeReference(t, "Patient", "other", element.getOther(), -1);
13469    if (element.hasTypeElement())
13470      composeEnum(t, "Patient", "type", element.getTypeElement(), -1);
13471  }
13472
13473  protected void composePaymentNotice(Complex parent, String parentType, String name, PaymentNotice element,
13474      int index) {
13475    if (element == null)
13476      return;
13477    Complex t;
13478    if (Utilities.noString(parentType))
13479      t = parent;
13480    else {
13481      t = parent.predicate("fhir:" + parentType + '.' + name);
13482    }
13483    composeDomainResource(t, "PaymentNotice", name, element, index);
13484    for (int i = 0; i < element.getIdentifier().size(); i++)
13485      composeIdentifier(t, "PaymentNotice", "identifier", element.getIdentifier().get(i), i);
13486    if (element.hasStatusElement())
13487      composeEnum(t, "PaymentNotice", "status", element.getStatusElement(), -1);
13488    if (element.hasRequest())
13489      composeReference(t, "PaymentNotice", "request", element.getRequest(), -1);
13490    if (element.hasResponse())
13491      composeReference(t, "PaymentNotice", "response", element.getResponse(), -1);
13492    if (element.hasCreatedElement())
13493      composeDateTime(t, "PaymentNotice", "created", element.getCreatedElement(), -1);
13494    if (element.hasProvider())
13495      composeReference(t, "PaymentNotice", "provider", element.getProvider(), -1);
13496    if (element.hasPayment())
13497      composeReference(t, "PaymentNotice", "payment", element.getPayment(), -1);
13498    if (element.hasPaymentDateElement())
13499      composeDate(t, "PaymentNotice", "paymentDate", element.getPaymentDateElement(), -1);
13500    if (element.hasPayee())
13501      composeReference(t, "PaymentNotice", "payee", element.getPayee(), -1);
13502    if (element.hasRecipient())
13503      composeReference(t, "PaymentNotice", "recipient", element.getRecipient(), -1);
13504    if (element.hasAmount())
13505      composeMoney(t, "PaymentNotice", "amount", element.getAmount(), -1);
13506    if (element.hasPaymentStatus())
13507      composeCodeableConcept(t, "PaymentNotice", "paymentStatus", element.getPaymentStatus(), -1);
13508  }
13509
13510  protected void composePaymentReconciliation(Complex parent, String parentType, String name,
13511      PaymentReconciliation element, int index) {
13512    if (element == null)
13513      return;
13514    Complex t;
13515    if (Utilities.noString(parentType))
13516      t = parent;
13517    else {
13518      t = parent.predicate("fhir:" + parentType + '.' + name);
13519    }
13520    composeDomainResource(t, "PaymentReconciliation", name, element, index);
13521    for (int i = 0; i < element.getIdentifier().size(); i++)
13522      composeIdentifier(t, "PaymentReconciliation", "identifier", element.getIdentifier().get(i), i);
13523    if (element.hasStatusElement())
13524      composeEnum(t, "PaymentReconciliation", "status", element.getStatusElement(), -1);
13525    if (element.hasPeriod())
13526      composePeriod(t, "PaymentReconciliation", "period", element.getPeriod(), -1);
13527    if (element.hasCreatedElement())
13528      composeDateTime(t, "PaymentReconciliation", "created", element.getCreatedElement(), -1);
13529    if (element.hasPaymentIssuer())
13530      composeReference(t, "PaymentReconciliation", "paymentIssuer", element.getPaymentIssuer(), -1);
13531    if (element.hasRequest())
13532      composeReference(t, "PaymentReconciliation", "request", element.getRequest(), -1);
13533    if (element.hasRequestor())
13534      composeReference(t, "PaymentReconciliation", "requestor", element.getRequestor(), -1);
13535    if (element.hasOutcomeElement())
13536      composeEnum(t, "PaymentReconciliation", "outcome", element.getOutcomeElement(), -1);
13537    if (element.hasDispositionElement())
13538      composeString(t, "PaymentReconciliation", "disposition", element.getDispositionElement(), -1);
13539    if (element.hasPaymentDateElement())
13540      composeDate(t, "PaymentReconciliation", "paymentDate", element.getPaymentDateElement(), -1);
13541    if (element.hasPaymentAmount())
13542      composeMoney(t, "PaymentReconciliation", "paymentAmount", element.getPaymentAmount(), -1);
13543    if (element.hasPaymentIdentifier())
13544      composeIdentifier(t, "PaymentReconciliation", "paymentIdentifier", element.getPaymentIdentifier(), -1);
13545    for (int i = 0; i < element.getDetail().size(); i++)
13546      composePaymentReconciliationDetailsComponent(t, "PaymentReconciliation", "detail", element.getDetail().get(i), i);
13547    if (element.hasFormCode())
13548      composeCodeableConcept(t, "PaymentReconciliation", "formCode", element.getFormCode(), -1);
13549    for (int i = 0; i < element.getProcessNote().size(); i++)
13550      composePaymentReconciliationNotesComponent(t, "PaymentReconciliation", "processNote",
13551          element.getProcessNote().get(i), i);
13552  }
13553
13554  protected void composePaymentReconciliationDetailsComponent(Complex parent, String parentType, String name,
13555      PaymentReconciliation.DetailsComponent element, int index) {
13556    if (element == null)
13557      return;
13558    Complex t;
13559    if (Utilities.noString(parentType))
13560      t = parent;
13561    else {
13562      t = parent.predicate("fhir:" + parentType + '.' + name);
13563    }
13564    composeBackboneElement(t, "detail", name, element, index);
13565    if (element.hasIdentifier())
13566      composeIdentifier(t, "PaymentReconciliation", "identifier", element.getIdentifier(), -1);
13567    if (element.hasPredecessor())
13568      composeIdentifier(t, "PaymentReconciliation", "predecessor", element.getPredecessor(), -1);
13569    if (element.hasType())
13570      composeCodeableConcept(t, "PaymentReconciliation", "type", element.getType(), -1);
13571    if (element.hasRequest())
13572      composeReference(t, "PaymentReconciliation", "request", element.getRequest(), -1);
13573    if (element.hasSubmitter())
13574      composeReference(t, "PaymentReconciliation", "submitter", element.getSubmitter(), -1);
13575    if (element.hasResponse())
13576      composeReference(t, "PaymentReconciliation", "response", element.getResponse(), -1);
13577    if (element.hasDateElement())
13578      composeDate(t, "PaymentReconciliation", "date", element.getDateElement(), -1);
13579    if (element.hasResponsible())
13580      composeReference(t, "PaymentReconciliation", "responsible", element.getResponsible(), -1);
13581    if (element.hasPayee())
13582      composeReference(t, "PaymentReconciliation", "payee", element.getPayee(), -1);
13583    if (element.hasAmount())
13584      composeMoney(t, "PaymentReconciliation", "amount", element.getAmount(), -1);
13585  }
13586
13587  protected void composePaymentReconciliationNotesComponent(Complex parent, String parentType, String name,
13588      PaymentReconciliation.NotesComponent element, int index) {
13589    if (element == null)
13590      return;
13591    Complex t;
13592    if (Utilities.noString(parentType))
13593      t = parent;
13594    else {
13595      t = parent.predicate("fhir:" + parentType + '.' + name);
13596    }
13597    composeBackboneElement(t, "processNote", name, element, index);
13598    if (element.hasTypeElement())
13599      composeEnum(t, "PaymentReconciliation", "type", element.getTypeElement(), -1);
13600    if (element.hasTextElement())
13601      composeString(t, "PaymentReconciliation", "text", element.getTextElement(), -1);
13602  }
13603
13604  protected void composePerson(Complex parent, String parentType, String name, Person element, int index) {
13605    if (element == null)
13606      return;
13607    Complex t;
13608    if (Utilities.noString(parentType))
13609      t = parent;
13610    else {
13611      t = parent.predicate("fhir:" + parentType + '.' + name);
13612    }
13613    composeDomainResource(t, "Person", name, element, index);
13614    for (int i = 0; i < element.getIdentifier().size(); i++)
13615      composeIdentifier(t, "Person", "identifier", element.getIdentifier().get(i), i);
13616    for (int i = 0; i < element.getName().size(); i++)
13617      composeHumanName(t, "Person", "name", element.getName().get(i), i);
13618    for (int i = 0; i < element.getTelecom().size(); i++)
13619      composeContactPoint(t, "Person", "telecom", element.getTelecom().get(i), i);
13620    if (element.hasGenderElement())
13621      composeEnum(t, "Person", "gender", element.getGenderElement(), -1);
13622    if (element.hasBirthDateElement())
13623      composeDate(t, "Person", "birthDate", element.getBirthDateElement(), -1);
13624    for (int i = 0; i < element.getAddress().size(); i++)
13625      composeAddress(t, "Person", "address", element.getAddress().get(i), i);
13626    if (element.hasPhoto())
13627      composeAttachment(t, "Person", "photo", element.getPhoto(), -1);
13628    if (element.hasManagingOrganization())
13629      composeReference(t, "Person", "managingOrganization", element.getManagingOrganization(), -1);
13630    if (element.hasActiveElement())
13631      composeBoolean(t, "Person", "active", element.getActiveElement(), -1);
13632    for (int i = 0; i < element.getLink().size(); i++)
13633      composePersonPersonLinkComponent(t, "Person", "link", element.getLink().get(i), i);
13634  }
13635
13636  protected void composePersonPersonLinkComponent(Complex parent, String parentType, String name,
13637      Person.PersonLinkComponent element, int index) {
13638    if (element == null)
13639      return;
13640    Complex t;
13641    if (Utilities.noString(parentType))
13642      t = parent;
13643    else {
13644      t = parent.predicate("fhir:" + parentType + '.' + name);
13645    }
13646    composeBackboneElement(t, "link", name, element, index);
13647    if (element.hasTarget())
13648      composeReference(t, "Person", "target", element.getTarget(), -1);
13649    if (element.hasAssuranceElement())
13650      composeEnum(t, "Person", "assurance", element.getAssuranceElement(), -1);
13651  }
13652
13653  protected void composePlanDefinition(Complex parent, String parentType, String name, PlanDefinition element,
13654      int index) {
13655    if (element == null)
13656      return;
13657    Complex t;
13658    if (Utilities.noString(parentType))
13659      t = parent;
13660    else {
13661      t = parent.predicate("fhir:" + parentType + '.' + name);
13662    }
13663    composeDomainResource(t, "PlanDefinition", name, element, index);
13664    if (element.hasUrlElement())
13665      composeUri(t, "PlanDefinition", "url", element.getUrlElement(), -1);
13666    for (int i = 0; i < element.getIdentifier().size(); i++)
13667      composeIdentifier(t, "PlanDefinition", "identifier", element.getIdentifier().get(i), i);
13668    if (element.hasVersionElement())
13669      composeString(t, "PlanDefinition", "version", element.getVersionElement(), -1);
13670    if (element.hasNameElement())
13671      composeString(t, "PlanDefinition", "name", element.getNameElement(), -1);
13672    if (element.hasTitleElement())
13673      composeString(t, "PlanDefinition", "title", element.getTitleElement(), -1);
13674    if (element.hasSubtitleElement())
13675      composeString(t, "PlanDefinition", "subtitle", element.getSubtitleElement(), -1);
13676    if (element.hasType())
13677      composeCodeableConcept(t, "PlanDefinition", "type", element.getType(), -1);
13678    if (element.hasStatusElement())
13679      composeEnum(t, "PlanDefinition", "status", element.getStatusElement(), -1);
13680    if (element.hasExperimentalElement())
13681      composeBoolean(t, "PlanDefinition", "experimental", element.getExperimentalElement(), -1);
13682    if (element.hasSubject())
13683      composeType(t, "PlanDefinition", "subject", element.getSubject(), -1);
13684    if (element.hasDateElement())
13685      composeDateTime(t, "PlanDefinition", "date", element.getDateElement(), -1);
13686    if (element.hasPublisherElement())
13687      composeString(t, "PlanDefinition", "publisher", element.getPublisherElement(), -1);
13688    for (int i = 0; i < element.getContact().size(); i++)
13689      composeContactDetail(t, "PlanDefinition", "contact", element.getContact().get(i), i);
13690    if (element.hasDescriptionElement())
13691      composeMarkdown(t, "PlanDefinition", "description", element.getDescriptionElement(), -1);
13692    for (int i = 0; i < element.getUseContext().size(); i++)
13693      composeUsageContext(t, "PlanDefinition", "useContext", element.getUseContext().get(i), i);
13694    for (int i = 0; i < element.getJurisdiction().size(); i++)
13695      composeCodeableConcept(t, "PlanDefinition", "jurisdiction", element.getJurisdiction().get(i), i);
13696    if (element.hasPurposeElement())
13697      composeMarkdown(t, "PlanDefinition", "purpose", element.getPurposeElement(), -1);
13698    if (element.hasUsageElement())
13699      composeString(t, "PlanDefinition", "usage", element.getUsageElement(), -1);
13700    if (element.hasCopyrightElement())
13701      composeMarkdown(t, "PlanDefinition", "copyright", element.getCopyrightElement(), -1);
13702    if (element.hasApprovalDateElement())
13703      composeDate(t, "PlanDefinition", "approvalDate", element.getApprovalDateElement(), -1);
13704    if (element.hasLastReviewDateElement())
13705      composeDate(t, "PlanDefinition", "lastReviewDate", element.getLastReviewDateElement(), -1);
13706    if (element.hasEffectivePeriod())
13707      composePeriod(t, "PlanDefinition", "effectivePeriod", element.getEffectivePeriod(), -1);
13708    for (int i = 0; i < element.getTopic().size(); i++)
13709      composeCodeableConcept(t, "PlanDefinition", "topic", element.getTopic().get(i), i);
13710    for (int i = 0; i < element.getAuthor().size(); i++)
13711      composeContactDetail(t, "PlanDefinition", "author", element.getAuthor().get(i), i);
13712    for (int i = 0; i < element.getEditor().size(); i++)
13713      composeContactDetail(t, "PlanDefinition", "editor", element.getEditor().get(i), i);
13714    for (int i = 0; i < element.getReviewer().size(); i++)
13715      composeContactDetail(t, "PlanDefinition", "reviewer", element.getReviewer().get(i), i);
13716    for (int i = 0; i < element.getEndorser().size(); i++)
13717      composeContactDetail(t, "PlanDefinition", "endorser", element.getEndorser().get(i), i);
13718    for (int i = 0; i < element.getRelatedArtifact().size(); i++)
13719      composeRelatedArtifact(t, "PlanDefinition", "relatedArtifact", element.getRelatedArtifact().get(i), i);
13720    for (int i = 0; i < element.getLibrary().size(); i++)
13721      composeCanonical(t, "PlanDefinition", "library", element.getLibrary().get(i), i);
13722    for (int i = 0; i < element.getGoal().size(); i++)
13723      composePlanDefinitionPlanDefinitionGoalComponent(t, "PlanDefinition", "goal", element.getGoal().get(i), i);
13724    for (int i = 0; i < element.getAction().size(); i++)
13725      composePlanDefinitionPlanDefinitionActionComponent(t, "PlanDefinition", "action", element.getAction().get(i), i);
13726  }
13727
13728  protected void composePlanDefinitionPlanDefinitionGoalComponent(Complex parent, String parentType, String name,
13729      PlanDefinition.PlanDefinitionGoalComponent element, int index) {
13730    if (element == null)
13731      return;
13732    Complex t;
13733    if (Utilities.noString(parentType))
13734      t = parent;
13735    else {
13736      t = parent.predicate("fhir:" + parentType + '.' + name);
13737    }
13738    composeBackboneElement(t, "goal", name, element, index);
13739    if (element.hasCategory())
13740      composeCodeableConcept(t, "PlanDefinition", "category", element.getCategory(), -1);
13741    if (element.hasDescription())
13742      composeCodeableConcept(t, "PlanDefinition", "description", element.getDescription(), -1);
13743    if (element.hasPriority())
13744      composeCodeableConcept(t, "PlanDefinition", "priority", element.getPriority(), -1);
13745    if (element.hasStart())
13746      composeCodeableConcept(t, "PlanDefinition", "start", element.getStart(), -1);
13747    for (int i = 0; i < element.getAddresses().size(); i++)
13748      composeCodeableConcept(t, "PlanDefinition", "addresses", element.getAddresses().get(i), i);
13749    for (int i = 0; i < element.getDocumentation().size(); i++)
13750      composeRelatedArtifact(t, "PlanDefinition", "documentation", element.getDocumentation().get(i), i);
13751    for (int i = 0; i < element.getTarget().size(); i++)
13752      composePlanDefinitionPlanDefinitionGoalTargetComponent(t, "PlanDefinition", "target", element.getTarget().get(i),
13753          i);
13754  }
13755
13756  protected void composePlanDefinitionPlanDefinitionGoalTargetComponent(Complex parent, String parentType, String name,
13757      PlanDefinition.PlanDefinitionGoalTargetComponent element, int index) {
13758    if (element == null)
13759      return;
13760    Complex t;
13761    if (Utilities.noString(parentType))
13762      t = parent;
13763    else {
13764      t = parent.predicate("fhir:" + parentType + '.' + name);
13765    }
13766    composeBackboneElement(t, "target", name, element, index);
13767    if (element.hasMeasure())
13768      composeCodeableConcept(t, "PlanDefinition", "measure", element.getMeasure(), -1);
13769    if (element.hasDetail())
13770      composeType(t, "PlanDefinition", "detail", element.getDetail(), -1);
13771    if (element.hasDue())
13772      composeDuration(t, "PlanDefinition", "due", element.getDue(), -1);
13773  }
13774
13775  protected void composePlanDefinitionPlanDefinitionActionComponent(Complex parent, String parentType, String name,
13776      PlanDefinition.PlanDefinitionActionComponent element, int index) {
13777    if (element == null)
13778      return;
13779    Complex t;
13780    if (Utilities.noString(parentType))
13781      t = parent;
13782    else {
13783      t = parent.predicate("fhir:" + parentType + '.' + name);
13784    }
13785    composeBackboneElement(t, "action", name, element, index);
13786    if (element.hasPrefixElement())
13787      composeString(t, "PlanDefinition", "prefix", element.getPrefixElement(), -1);
13788    if (element.hasTitleElement())
13789      composeString(t, "PlanDefinition", "title", element.getTitleElement(), -1);
13790    if (element.hasDescriptionElement())
13791      composeString(t, "PlanDefinition", "description", element.getDescriptionElement(), -1);
13792    if (element.hasTextEquivalentElement())
13793      composeString(t, "PlanDefinition", "textEquivalent", element.getTextEquivalentElement(), -1);
13794    if (element.hasPriorityElement())
13795      composeEnum(t, "PlanDefinition", "priority", element.getPriorityElement(), -1);
13796    for (int i = 0; i < element.getCode().size(); i++)
13797      composeCodeableConcept(t, "PlanDefinition", "code", element.getCode().get(i), i);
13798    for (int i = 0; i < element.getReason().size(); i++)
13799      composeCodeableConcept(t, "PlanDefinition", "reason", element.getReason().get(i), i);
13800    for (int i = 0; i < element.getDocumentation().size(); i++)
13801      composeRelatedArtifact(t, "PlanDefinition", "documentation", element.getDocumentation().get(i), i);
13802    for (int i = 0; i < element.getGoalId().size(); i++)
13803      composeId(t, "PlanDefinition", "goalId", element.getGoalId().get(i), i);
13804    if (element.hasSubject())
13805      composeType(t, "PlanDefinition", "subject", element.getSubject(), -1);
13806    for (int i = 0; i < element.getTrigger().size(); i++)
13807      composeTriggerDefinition(t, "PlanDefinition", "trigger", element.getTrigger().get(i), i);
13808    for (int i = 0; i < element.getCondition().size(); i++)
13809      composePlanDefinitionPlanDefinitionActionConditionComponent(t, "PlanDefinition", "condition",
13810          element.getCondition().get(i), i);
13811    for (int i = 0; i < element.getInput().size(); i++)
13812      composeDataRequirement(t, "PlanDefinition", "input", element.getInput().get(i), i);
13813    for (int i = 0; i < element.getOutput().size(); i++)
13814      composeDataRequirement(t, "PlanDefinition", "output", element.getOutput().get(i), i);
13815    for (int i = 0; i < element.getRelatedAction().size(); i++)
13816      composePlanDefinitionPlanDefinitionActionRelatedActionComponent(t, "PlanDefinition", "relatedAction",
13817          element.getRelatedAction().get(i), i);
13818    if (element.hasTiming())
13819      composeType(t, "PlanDefinition", "timing", element.getTiming(), -1);
13820    for (int i = 0; i < element.getParticipant().size(); i++)
13821      composePlanDefinitionPlanDefinitionActionParticipantComponent(t, "PlanDefinition", "participant",
13822          element.getParticipant().get(i), i);
13823    if (element.hasType())
13824      composeCodeableConcept(t, "PlanDefinition", "type", element.getType(), -1);
13825    if (element.hasGroupingBehaviorElement())
13826      composeEnum(t, "PlanDefinition", "groupingBehavior", element.getGroupingBehaviorElement(), -1);
13827    if (element.hasSelectionBehaviorElement())
13828      composeEnum(t, "PlanDefinition", "selectionBehavior", element.getSelectionBehaviorElement(), -1);
13829    if (element.hasRequiredBehaviorElement())
13830      composeEnum(t, "PlanDefinition", "requiredBehavior", element.getRequiredBehaviorElement(), -1);
13831    if (element.hasPrecheckBehaviorElement())
13832      composeEnum(t, "PlanDefinition", "precheckBehavior", element.getPrecheckBehaviorElement(), -1);
13833    if (element.hasCardinalityBehaviorElement())
13834      composeEnum(t, "PlanDefinition", "cardinalityBehavior", element.getCardinalityBehaviorElement(), -1);
13835    if (element.hasDefinition())
13836      composeType(t, "PlanDefinition", "definition", element.getDefinition(), -1);
13837    if (element.hasTransformElement())
13838      composeCanonical(t, "PlanDefinition", "transform", element.getTransformElement(), -1);
13839    for (int i = 0; i < element.getDynamicValue().size(); i++)
13840      composePlanDefinitionPlanDefinitionActionDynamicValueComponent(t, "PlanDefinition", "dynamicValue",
13841          element.getDynamicValue().get(i), i);
13842    for (int i = 0; i < element.getAction().size(); i++)
13843      composePlanDefinitionPlanDefinitionActionComponent(t, "PlanDefinition", "action", element.getAction().get(i), i);
13844  }
13845
13846  protected void composePlanDefinitionPlanDefinitionActionConditionComponent(Complex parent, String parentType,
13847      String name, PlanDefinition.PlanDefinitionActionConditionComponent element, int index) {
13848    if (element == null)
13849      return;
13850    Complex t;
13851    if (Utilities.noString(parentType))
13852      t = parent;
13853    else {
13854      t = parent.predicate("fhir:" + parentType + '.' + name);
13855    }
13856    composeBackboneElement(t, "condition", name, element, index);
13857    if (element.hasKindElement())
13858      composeEnum(t, "PlanDefinition", "kind", element.getKindElement(), -1);
13859    if (element.hasExpression())
13860      composeExpression(t, "PlanDefinition", "expression", element.getExpression(), -1);
13861  }
13862
13863  protected void composePlanDefinitionPlanDefinitionActionRelatedActionComponent(Complex parent, String parentType,
13864      String name, PlanDefinition.PlanDefinitionActionRelatedActionComponent element, int index) {
13865    if (element == null)
13866      return;
13867    Complex t;
13868    if (Utilities.noString(parentType))
13869      t = parent;
13870    else {
13871      t = parent.predicate("fhir:" + parentType + '.' + name);
13872    }
13873    composeBackboneElement(t, "relatedAction", name, element, index);
13874    if (element.hasActionIdElement())
13875      composeId(t, "PlanDefinition", "actionId", element.getActionIdElement(), -1);
13876    if (element.hasRelationshipElement())
13877      composeEnum(t, "PlanDefinition", "relationship", element.getRelationshipElement(), -1);
13878    if (element.hasOffset())
13879      composeType(t, "PlanDefinition", "offset", element.getOffset(), -1);
13880  }
13881
13882  protected void composePlanDefinitionPlanDefinitionActionParticipantComponent(Complex parent, String parentType,
13883      String name, PlanDefinition.PlanDefinitionActionParticipantComponent element, int index) {
13884    if (element == null)
13885      return;
13886    Complex t;
13887    if (Utilities.noString(parentType))
13888      t = parent;
13889    else {
13890      t = parent.predicate("fhir:" + parentType + '.' + name);
13891    }
13892    composeBackboneElement(t, "participant", name, element, index);
13893    if (element.hasTypeElement())
13894      composeEnum(t, "PlanDefinition", "type", element.getTypeElement(), -1);
13895    if (element.hasRole())
13896      composeCodeableConcept(t, "PlanDefinition", "role", element.getRole(), -1);
13897  }
13898
13899  protected void composePlanDefinitionPlanDefinitionActionDynamicValueComponent(Complex parent, String parentType,
13900      String name, PlanDefinition.PlanDefinitionActionDynamicValueComponent element, int index) {
13901    if (element == null)
13902      return;
13903    Complex t;
13904    if (Utilities.noString(parentType))
13905      t = parent;
13906    else {
13907      t = parent.predicate("fhir:" + parentType + '.' + name);
13908    }
13909    composeBackboneElement(t, "dynamicValue", name, element, index);
13910    if (element.hasPathElement())
13911      composeString(t, "PlanDefinition", "path", element.getPathElement(), -1);
13912    if (element.hasExpression())
13913      composeExpression(t, "PlanDefinition", "expression", element.getExpression(), -1);
13914  }
13915
13916  protected void composePractitioner(Complex parent, String parentType, String name, Practitioner element, int index) {
13917    if (element == null)
13918      return;
13919    Complex t;
13920    if (Utilities.noString(parentType))
13921      t = parent;
13922    else {
13923      t = parent.predicate("fhir:" + parentType + '.' + name);
13924    }
13925    composeDomainResource(t, "Practitioner", name, element, index);
13926    for (int i = 0; i < element.getIdentifier().size(); i++)
13927      composeIdentifier(t, "Practitioner", "identifier", element.getIdentifier().get(i), i);
13928    if (element.hasActiveElement())
13929      composeBoolean(t, "Practitioner", "active", element.getActiveElement(), -1);
13930    for (int i = 0; i < element.getName().size(); i++)
13931      composeHumanName(t, "Practitioner", "name", element.getName().get(i), i);
13932    for (int i = 0; i < element.getTelecom().size(); i++)
13933      composeContactPoint(t, "Practitioner", "telecom", element.getTelecom().get(i), i);
13934    for (int i = 0; i < element.getAddress().size(); i++)
13935      composeAddress(t, "Practitioner", "address", element.getAddress().get(i), i);
13936    if (element.hasGenderElement())
13937      composeEnum(t, "Practitioner", "gender", element.getGenderElement(), -1);
13938    if (element.hasBirthDateElement())
13939      composeDate(t, "Practitioner", "birthDate", element.getBirthDateElement(), -1);
13940    for (int i = 0; i < element.getPhoto().size(); i++)
13941      composeAttachment(t, "Practitioner", "photo", element.getPhoto().get(i), i);
13942    for (int i = 0; i < element.getQualification().size(); i++)
13943      composePractitionerPractitionerQualificationComponent(t, "Practitioner", "qualification",
13944          element.getQualification().get(i), i);
13945    for (int i = 0; i < element.getCommunication().size(); i++)
13946      composeCodeableConcept(t, "Practitioner", "communication", element.getCommunication().get(i), i);
13947  }
13948
13949  protected void composePractitionerPractitionerQualificationComponent(Complex parent, String parentType, String name,
13950      Practitioner.PractitionerQualificationComponent element, int index) {
13951    if (element == null)
13952      return;
13953    Complex t;
13954    if (Utilities.noString(parentType))
13955      t = parent;
13956    else {
13957      t = parent.predicate("fhir:" + parentType + '.' + name);
13958    }
13959    composeBackboneElement(t, "qualification", name, element, index);
13960    for (int i = 0; i < element.getIdentifier().size(); i++)
13961      composeIdentifier(t, "Practitioner", "identifier", element.getIdentifier().get(i), i);
13962    if (element.hasCode())
13963      composeCodeableConcept(t, "Practitioner", "code", element.getCode(), -1);
13964    if (element.hasPeriod())
13965      composePeriod(t, "Practitioner", "period", element.getPeriod(), -1);
13966    if (element.hasIssuer())
13967      composeReference(t, "Practitioner", "issuer", element.getIssuer(), -1);
13968  }
13969
13970  protected void composePractitionerRole(Complex parent, String parentType, String name, PractitionerRole element,
13971      int index) {
13972    if (element == null)
13973      return;
13974    Complex t;
13975    if (Utilities.noString(parentType))
13976      t = parent;
13977    else {
13978      t = parent.predicate("fhir:" + parentType + '.' + name);
13979    }
13980    composeDomainResource(t, "PractitionerRole", name, element, index);
13981    for (int i = 0; i < element.getIdentifier().size(); i++)
13982      composeIdentifier(t, "PractitionerRole", "identifier", element.getIdentifier().get(i), i);
13983    if (element.hasActiveElement())
13984      composeBoolean(t, "PractitionerRole", "active", element.getActiveElement(), -1);
13985    if (element.hasPeriod())
13986      composePeriod(t, "PractitionerRole", "period", element.getPeriod(), -1);
13987    if (element.hasPractitioner())
13988      composeReference(t, "PractitionerRole", "practitioner", element.getPractitioner(), -1);
13989    if (element.hasOrganization())
13990      composeReference(t, "PractitionerRole", "organization", element.getOrganization(), -1);
13991    for (int i = 0; i < element.getCode().size(); i++)
13992      composeCodeableConcept(t, "PractitionerRole", "code", element.getCode().get(i), i);
13993    for (int i = 0; i < element.getSpecialty().size(); i++)
13994      composeCodeableConcept(t, "PractitionerRole", "specialty", element.getSpecialty().get(i), i);
13995    for (int i = 0; i < element.getLocation().size(); i++)
13996      composeReference(t, "PractitionerRole", "location", element.getLocation().get(i), i);
13997    for (int i = 0; i < element.getHealthcareService().size(); i++)
13998      composeReference(t, "PractitionerRole", "healthcareService", element.getHealthcareService().get(i), i);
13999    for (int i = 0; i < element.getTelecom().size(); i++)
14000      composeContactPoint(t, "PractitionerRole", "telecom", element.getTelecom().get(i), i);
14001    for (int i = 0; i < element.getAvailableTime().size(); i++)
14002      composePractitionerRolePractitionerRoleAvailableTimeComponent(t, "PractitionerRole", "availableTime",
14003          element.getAvailableTime().get(i), i);
14004    for (int i = 0; i < element.getNotAvailable().size(); i++)
14005      composePractitionerRolePractitionerRoleNotAvailableComponent(t, "PractitionerRole", "notAvailable",
14006          element.getNotAvailable().get(i), i);
14007    if (element.hasAvailabilityExceptionsElement())
14008      composeString(t, "PractitionerRole", "availabilityExceptions", element.getAvailabilityExceptionsElement(), -1);
14009    for (int i = 0; i < element.getEndpoint().size(); i++)
14010      composeReference(t, "PractitionerRole", "endpoint", element.getEndpoint().get(i), i);
14011  }
14012
14013  protected void composePractitionerRolePractitionerRoleAvailableTimeComponent(Complex parent, String parentType,
14014      String name, PractitionerRole.PractitionerRoleAvailableTimeComponent element, int index) {
14015    if (element == null)
14016      return;
14017    Complex t;
14018    if (Utilities.noString(parentType))
14019      t = parent;
14020    else {
14021      t = parent.predicate("fhir:" + parentType + '.' + name);
14022    }
14023    composeBackboneElement(t, "availableTime", name, element, index);
14024    for (int i = 0; i < element.getDaysOfWeek().size(); i++)
14025      composeEnum(t, "PractitionerRole", "daysOfWeek", element.getDaysOfWeek().get(i), i);
14026    if (element.hasAllDayElement())
14027      composeBoolean(t, "PractitionerRole", "allDay", element.getAllDayElement(), -1);
14028    if (element.hasAvailableStartTimeElement())
14029      composeTime(t, "PractitionerRole", "availableStartTime", element.getAvailableStartTimeElement(), -1);
14030    if (element.hasAvailableEndTimeElement())
14031      composeTime(t, "PractitionerRole", "availableEndTime", element.getAvailableEndTimeElement(), -1);
14032  }
14033
14034  protected void composePractitionerRolePractitionerRoleNotAvailableComponent(Complex parent, String parentType,
14035      String name, PractitionerRole.PractitionerRoleNotAvailableComponent element, int index) {
14036    if (element == null)
14037      return;
14038    Complex t;
14039    if (Utilities.noString(parentType))
14040      t = parent;
14041    else {
14042      t = parent.predicate("fhir:" + parentType + '.' + name);
14043    }
14044    composeBackboneElement(t, "notAvailable", name, element, index);
14045    if (element.hasDescriptionElement())
14046      composeString(t, "PractitionerRole", "description", element.getDescriptionElement(), -1);
14047    if (element.hasDuring())
14048      composePeriod(t, "PractitionerRole", "during", element.getDuring(), -1);
14049  }
14050
14051  protected void composeProcedure(Complex parent, String parentType, String name, Procedure element, int index) {
14052    if (element == null)
14053      return;
14054    Complex t;
14055    if (Utilities.noString(parentType))
14056      t = parent;
14057    else {
14058      t = parent.predicate("fhir:" + parentType + '.' + name);
14059    }
14060    composeDomainResource(t, "Procedure", name, element, index);
14061    for (int i = 0; i < element.getIdentifier().size(); i++)
14062      composeIdentifier(t, "Procedure", "identifier", element.getIdentifier().get(i), i);
14063    for (int i = 0; i < element.getInstantiatesCanonical().size(); i++)
14064      composeCanonical(t, "Procedure", "instantiatesCanonical", element.getInstantiatesCanonical().get(i), i);
14065    for (int i = 0; i < element.getInstantiatesUri().size(); i++)
14066      composeUri(t, "Procedure", "instantiatesUri", element.getInstantiatesUri().get(i), i);
14067    for (int i = 0; i < element.getBasedOn().size(); i++)
14068      composeReference(t, "Procedure", "basedOn", element.getBasedOn().get(i), i);
14069    for (int i = 0; i < element.getPartOf().size(); i++)
14070      composeReference(t, "Procedure", "partOf", element.getPartOf().get(i), i);
14071    if (element.hasStatusElement())
14072      composeEnum(t, "Procedure", "status", element.getStatusElement(), -1);
14073    if (element.hasStatusReason())
14074      composeCodeableConcept(t, "Procedure", "statusReason", element.getStatusReason(), -1);
14075    if (element.hasCategory())
14076      composeCodeableConcept(t, "Procedure", "category", element.getCategory(), -1);
14077    if (element.hasCode())
14078      composeCodeableConcept(t, "Procedure", "code", element.getCode(), -1);
14079    if (element.hasSubject())
14080      composeReference(t, "Procedure", "subject", element.getSubject(), -1);
14081    if (element.hasEncounter())
14082      composeReference(t, "Procedure", "encounter", element.getEncounter(), -1);
14083    if (element.hasPerformed())
14084      composeType(t, "Procedure", "performed", element.getPerformed(), -1);
14085    if (element.hasRecorder())
14086      composeReference(t, "Procedure", "recorder", element.getRecorder(), -1);
14087    if (element.hasAsserter())
14088      composeReference(t, "Procedure", "asserter", element.getAsserter(), -1);
14089    for (int i = 0; i < element.getPerformer().size(); i++)
14090      composeProcedureProcedurePerformerComponent(t, "Procedure", "performer", element.getPerformer().get(i), i);
14091    if (element.hasLocation())
14092      composeReference(t, "Procedure", "location", element.getLocation(), -1);
14093    for (int i = 0; i < element.getReasonCode().size(); i++)
14094      composeCodeableConcept(t, "Procedure", "reasonCode", element.getReasonCode().get(i), i);
14095    for (int i = 0; i < element.getReasonReference().size(); i++)
14096      composeReference(t, "Procedure", "reasonReference", element.getReasonReference().get(i), i);
14097    for (int i = 0; i < element.getBodySite().size(); i++)
14098      composeCodeableConcept(t, "Procedure", "bodySite", element.getBodySite().get(i), i);
14099    if (element.hasOutcome())
14100      composeCodeableConcept(t, "Procedure", "outcome", element.getOutcome(), -1);
14101    for (int i = 0; i < element.getReport().size(); i++)
14102      composeReference(t, "Procedure", "report", element.getReport().get(i), i);
14103    for (int i = 0; i < element.getComplication().size(); i++)
14104      composeCodeableConcept(t, "Procedure", "complication", element.getComplication().get(i), i);
14105    for (int i = 0; i < element.getComplicationDetail().size(); i++)
14106      composeReference(t, "Procedure", "complicationDetail", element.getComplicationDetail().get(i), i);
14107    for (int i = 0; i < element.getFollowUp().size(); i++)
14108      composeCodeableConcept(t, "Procedure", "followUp", element.getFollowUp().get(i), i);
14109    for (int i = 0; i < element.getNote().size(); i++)
14110      composeAnnotation(t, "Procedure", "note", element.getNote().get(i), i);
14111    for (int i = 0; i < element.getFocalDevice().size(); i++)
14112      composeProcedureProcedureFocalDeviceComponent(t, "Procedure", "focalDevice", element.getFocalDevice().get(i), i);
14113    for (int i = 0; i < element.getUsedReference().size(); i++)
14114      composeReference(t, "Procedure", "usedReference", element.getUsedReference().get(i), i);
14115    for (int i = 0; i < element.getUsedCode().size(); i++)
14116      composeCodeableConcept(t, "Procedure", "usedCode", element.getUsedCode().get(i), i);
14117  }
14118
14119  protected void composeProcedureProcedurePerformerComponent(Complex parent, String parentType, String name,
14120      Procedure.ProcedurePerformerComponent element, int index) {
14121    if (element == null)
14122      return;
14123    Complex t;
14124    if (Utilities.noString(parentType))
14125      t = parent;
14126    else {
14127      t = parent.predicate("fhir:" + parentType + '.' + name);
14128    }
14129    composeBackboneElement(t, "performer", name, element, index);
14130    if (element.hasFunction())
14131      composeCodeableConcept(t, "Procedure", "function", element.getFunction(), -1);
14132    if (element.hasActor())
14133      composeReference(t, "Procedure", "actor", element.getActor(), -1);
14134    if (element.hasOnBehalfOf())
14135      composeReference(t, "Procedure", "onBehalfOf", element.getOnBehalfOf(), -1);
14136  }
14137
14138  protected void composeProcedureProcedureFocalDeviceComponent(Complex parent, String parentType, String name,
14139      Procedure.ProcedureFocalDeviceComponent element, int index) {
14140    if (element == null)
14141      return;
14142    Complex t;
14143    if (Utilities.noString(parentType))
14144      t = parent;
14145    else {
14146      t = parent.predicate("fhir:" + parentType + '.' + name);
14147    }
14148    composeBackboneElement(t, "focalDevice", name, element, index);
14149    if (element.hasAction())
14150      composeCodeableConcept(t, "Procedure", "action", element.getAction(), -1);
14151    if (element.hasManipulated())
14152      composeReference(t, "Procedure", "manipulated", element.getManipulated(), -1);
14153  }
14154
14155  protected void composeProvenance(Complex parent, String parentType, String name, Provenance element, int index) {
14156    if (element == null)
14157      return;
14158    Complex t;
14159    if (Utilities.noString(parentType))
14160      t = parent;
14161    else {
14162      t = parent.predicate("fhir:" + parentType + '.' + name);
14163    }
14164    composeDomainResource(t, "Provenance", name, element, index);
14165    for (int i = 0; i < element.getTarget().size(); i++)
14166      composeReference(t, "Provenance", "target", element.getTarget().get(i), i);
14167    if (element.hasOccurred())
14168      composeType(t, "Provenance", "occurred", element.getOccurred(), -1);
14169    if (element.hasRecordedElement())
14170      composeInstant(t, "Provenance", "recorded", element.getRecordedElement(), -1);
14171    for (int i = 0; i < element.getPolicy().size(); i++)
14172      composeUri(t, "Provenance", "policy", element.getPolicy().get(i), i);
14173    if (element.hasLocation())
14174      composeReference(t, "Provenance", "location", element.getLocation(), -1);
14175    for (int i = 0; i < element.getReason().size(); i++)
14176      composeCodeableConcept(t, "Provenance", "reason", element.getReason().get(i), i);
14177    if (element.hasActivity())
14178      composeCodeableConcept(t, "Provenance", "activity", element.getActivity(), -1);
14179    for (int i = 0; i < element.getAgent().size(); i++)
14180      composeProvenanceProvenanceAgentComponent(t, "Provenance", "agent", element.getAgent().get(i), i);
14181    for (int i = 0; i < element.getEntity().size(); i++)
14182      composeProvenanceProvenanceEntityComponent(t, "Provenance", "entity", element.getEntity().get(i), i);
14183    for (int i = 0; i < element.getSignature().size(); i++)
14184      composeSignature(t, "Provenance", "signature", element.getSignature().get(i), i);
14185  }
14186
14187  protected void composeProvenanceProvenanceAgentComponent(Complex parent, String parentType, String name,
14188      Provenance.ProvenanceAgentComponent element, int index) {
14189    if (element == null)
14190      return;
14191    Complex t;
14192    if (Utilities.noString(parentType))
14193      t = parent;
14194    else {
14195      t = parent.predicate("fhir:" + parentType + '.' + name);
14196    }
14197    composeBackboneElement(t, "agent", name, element, index);
14198    if (element.hasType())
14199      composeCodeableConcept(t, "Provenance", "type", element.getType(), -1);
14200    for (int i = 0; i < element.getRole().size(); i++)
14201      composeCodeableConcept(t, "Provenance", "role", element.getRole().get(i), i);
14202    if (element.hasWho())
14203      composeReference(t, "Provenance", "who", element.getWho(), -1);
14204    if (element.hasOnBehalfOf())
14205      composeReference(t, "Provenance", "onBehalfOf", element.getOnBehalfOf(), -1);
14206  }
14207
14208  protected void composeProvenanceProvenanceEntityComponent(Complex parent, String parentType, String name,
14209      Provenance.ProvenanceEntityComponent element, int index) {
14210    if (element == null)
14211      return;
14212    Complex t;
14213    if (Utilities.noString(parentType))
14214      t = parent;
14215    else {
14216      t = parent.predicate("fhir:" + parentType + '.' + name);
14217    }
14218    composeBackboneElement(t, "entity", name, element, index);
14219    if (element.hasRoleElement())
14220      composeEnum(t, "Provenance", "role", element.getRoleElement(), -1);
14221    if (element.hasWhat())
14222      composeReference(t, "Provenance", "what", element.getWhat(), -1);
14223    for (int i = 0; i < element.getAgent().size(); i++)
14224      composeProvenanceProvenanceAgentComponent(t, "Provenance", "agent", element.getAgent().get(i), i);
14225  }
14226
14227  protected void composeQuestionnaire(Complex parent, String parentType, String name, Questionnaire element,
14228      int index) {
14229    if (element == null)
14230      return;
14231    Complex t;
14232    if (Utilities.noString(parentType))
14233      t = parent;
14234    else {
14235      t = parent.predicate("fhir:" + parentType + '.' + name);
14236    }
14237    composeDomainResource(t, "Questionnaire", name, element, index);
14238    if (element.hasUrlElement())
14239      composeUri(t, "Questionnaire", "url", element.getUrlElement(), -1);
14240    for (int i = 0; i < element.getIdentifier().size(); i++)
14241      composeIdentifier(t, "Questionnaire", "identifier", element.getIdentifier().get(i), i);
14242    if (element.hasVersionElement())
14243      composeString(t, "Questionnaire", "version", element.getVersionElement(), -1);
14244    if (element.hasNameElement())
14245      composeString(t, "Questionnaire", "name", element.getNameElement(), -1);
14246    if (element.hasTitleElement())
14247      composeString(t, "Questionnaire", "title", element.getTitleElement(), -1);
14248    for (int i = 0; i < element.getDerivedFrom().size(); i++)
14249      composeCanonical(t, "Questionnaire", "derivedFrom", element.getDerivedFrom().get(i), i);
14250    if (element.hasStatusElement())
14251      composeEnum(t, "Questionnaire", "status", element.getStatusElement(), -1);
14252    if (element.hasExperimentalElement())
14253      composeBoolean(t, "Questionnaire", "experimental", element.getExperimentalElement(), -1);
14254    for (int i = 0; i < element.getSubjectType().size(); i++)
14255      composeCode(t, "Questionnaire", "subjectType", element.getSubjectType().get(i), i);
14256    if (element.hasDateElement())
14257      composeDateTime(t, "Questionnaire", "date", element.getDateElement(), -1);
14258    if (element.hasPublisherElement())
14259      composeString(t, "Questionnaire", "publisher", element.getPublisherElement(), -1);
14260    for (int i = 0; i < element.getContact().size(); i++)
14261      composeContactDetail(t, "Questionnaire", "contact", element.getContact().get(i), i);
14262    if (element.hasDescriptionElement())
14263      composeMarkdown(t, "Questionnaire", "description", element.getDescriptionElement(), -1);
14264    for (int i = 0; i < element.getUseContext().size(); i++)
14265      composeUsageContext(t, "Questionnaire", "useContext", element.getUseContext().get(i), i);
14266    for (int i = 0; i < element.getJurisdiction().size(); i++)
14267      composeCodeableConcept(t, "Questionnaire", "jurisdiction", element.getJurisdiction().get(i), i);
14268    if (element.hasPurposeElement())
14269      composeMarkdown(t, "Questionnaire", "purpose", element.getPurposeElement(), -1);
14270    if (element.hasCopyrightElement())
14271      composeMarkdown(t, "Questionnaire", "copyright", element.getCopyrightElement(), -1);
14272    if (element.hasApprovalDateElement())
14273      composeDate(t, "Questionnaire", "approvalDate", element.getApprovalDateElement(), -1);
14274    if (element.hasLastReviewDateElement())
14275      composeDate(t, "Questionnaire", "lastReviewDate", element.getLastReviewDateElement(), -1);
14276    if (element.hasEffectivePeriod())
14277      composePeriod(t, "Questionnaire", "effectivePeriod", element.getEffectivePeriod(), -1);
14278    for (int i = 0; i < element.getCode().size(); i++)
14279      composeCoding(t, "Questionnaire", "code", element.getCode().get(i), i);
14280    for (int i = 0; i < element.getItem().size(); i++)
14281      composeQuestionnaireQuestionnaireItemComponent(t, "Questionnaire", "item", element.getItem().get(i), i);
14282  }
14283
14284  protected void composeQuestionnaireQuestionnaireItemComponent(Complex parent, String parentType, String name,
14285      Questionnaire.QuestionnaireItemComponent element, int index) {
14286    if (element == null)
14287      return;
14288    Complex t;
14289    if (Utilities.noString(parentType))
14290      t = parent;
14291    else {
14292      t = parent.predicate("fhir:" + parentType + '.' + name);
14293    }
14294    composeBackboneElement(t, "item", name, element, index);
14295    if (element.hasLinkIdElement())
14296      composeString(t, "Questionnaire", "linkId", element.getLinkIdElement(), -1);
14297    if (element.hasDefinitionElement())
14298      composeUri(t, "Questionnaire", "definition", element.getDefinitionElement(), -1);
14299    for (int i = 0; i < element.getCode().size(); i++)
14300      composeCoding(t, "Questionnaire", "code", element.getCode().get(i), i);
14301    if (element.hasPrefixElement())
14302      composeString(t, "Questionnaire", "prefix", element.getPrefixElement(), -1);
14303    if (element.hasTextElement())
14304      composeString(t, "Questionnaire", "text", element.getTextElement(), -1);
14305    if (element.hasTypeElement())
14306      composeEnum(t, "Questionnaire", "type", element.getTypeElement(), -1);
14307    for (int i = 0; i < element.getEnableWhen().size(); i++)
14308      composeQuestionnaireQuestionnaireItemEnableWhenComponent(t, "Questionnaire", "enableWhen",
14309          element.getEnableWhen().get(i), i);
14310    if (element.hasEnableBehaviorElement())
14311      composeEnum(t, "Questionnaire", "enableBehavior", element.getEnableBehaviorElement(), -1);
14312    if (element.hasRequiredElement())
14313      composeBoolean(t, "Questionnaire", "required", element.getRequiredElement(), -1);
14314    if (element.hasRepeatsElement())
14315      composeBoolean(t, "Questionnaire", "repeats", element.getRepeatsElement(), -1);
14316    if (element.hasReadOnlyElement())
14317      composeBoolean(t, "Questionnaire", "readOnly", element.getReadOnlyElement(), -1);
14318    if (element.hasMaxLengthElement())
14319      composeInteger(t, "Questionnaire", "maxLength", element.getMaxLengthElement(), -1);
14320    if (element.hasAnswerValueSetElement())
14321      composeCanonical(t, "Questionnaire", "answerValueSet", element.getAnswerValueSetElement(), -1);
14322    for (int i = 0; i < element.getAnswerOption().size(); i++)
14323      composeQuestionnaireQuestionnaireItemAnswerOptionComponent(t, "Questionnaire", "answerOption",
14324          element.getAnswerOption().get(i), i);
14325    for (int i = 0; i < element.getInitial().size(); i++)
14326      composeQuestionnaireQuestionnaireItemInitialComponent(t, "Questionnaire", "initial", element.getInitial().get(i),
14327          i);
14328    for (int i = 0; i < element.getItem().size(); i++)
14329      composeQuestionnaireQuestionnaireItemComponent(t, "Questionnaire", "item", element.getItem().get(i), i);
14330  }
14331
14332  protected void composeQuestionnaireQuestionnaireItemEnableWhenComponent(Complex parent, String parentType,
14333      String name, Questionnaire.QuestionnaireItemEnableWhenComponent element, int index) {
14334    if (element == null)
14335      return;
14336    Complex t;
14337    if (Utilities.noString(parentType))
14338      t = parent;
14339    else {
14340      t = parent.predicate("fhir:" + parentType + '.' + name);
14341    }
14342    composeBackboneElement(t, "enableWhen", name, element, index);
14343    if (element.hasQuestionElement())
14344      composeString(t, "Questionnaire", "question", element.getQuestionElement(), -1);
14345    if (element.hasOperatorElement())
14346      composeEnum(t, "Questionnaire", "operator", element.getOperatorElement(), -1);
14347    if (element.hasAnswer())
14348      composeType(t, "Questionnaire", "answer", element.getAnswer(), -1);
14349  }
14350
14351  protected void composeQuestionnaireQuestionnaireItemAnswerOptionComponent(Complex parent, String parentType,
14352      String name, Questionnaire.QuestionnaireItemAnswerOptionComponent element, int index) {
14353    if (element == null)
14354      return;
14355    Complex t;
14356    if (Utilities.noString(parentType))
14357      t = parent;
14358    else {
14359      t = parent.predicate("fhir:" + parentType + '.' + name);
14360    }
14361    composeBackboneElement(t, "answerOption", name, element, index);
14362    if (element.hasValue())
14363      composeType(t, "Questionnaire", "value", element.getValue(), -1);
14364    if (element.hasInitialSelectedElement())
14365      composeBoolean(t, "Questionnaire", "initialSelected", element.getInitialSelectedElement(), -1);
14366  }
14367
14368  protected void composeQuestionnaireQuestionnaireItemInitialComponent(Complex parent, String parentType, String name,
14369      Questionnaire.QuestionnaireItemInitialComponent element, int index) {
14370    if (element == null)
14371      return;
14372    Complex t;
14373    if (Utilities.noString(parentType))
14374      t = parent;
14375    else {
14376      t = parent.predicate("fhir:" + parentType + '.' + name);
14377    }
14378    composeBackboneElement(t, "initial", name, element, index);
14379    if (element.hasValue())
14380      composeType(t, "Questionnaire", "value", element.getValue(), -1);
14381  }
14382
14383  protected void composeQuestionnaireResponse(Complex parent, String parentType, String name,
14384      QuestionnaireResponse element, int index) {
14385    if (element == null)
14386      return;
14387    Complex t;
14388    if (Utilities.noString(parentType))
14389      t = parent;
14390    else {
14391      t = parent.predicate("fhir:" + parentType + '.' + name);
14392    }
14393    composeDomainResource(t, "QuestionnaireResponse", name, element, index);
14394    if (element.hasIdentifier())
14395      composeIdentifier(t, "QuestionnaireResponse", "identifier", element.getIdentifier(), -1);
14396    for (int i = 0; i < element.getBasedOn().size(); i++)
14397      composeReference(t, "QuestionnaireResponse", "basedOn", element.getBasedOn().get(i), i);
14398    for (int i = 0; i < element.getPartOf().size(); i++)
14399      composeReference(t, "QuestionnaireResponse", "partOf", element.getPartOf().get(i), i);
14400    if (element.hasQuestionnaireElement())
14401      composeCanonical(t, "QuestionnaireResponse", "questionnaire", element.getQuestionnaireElement(), -1);
14402    if (element.hasStatusElement())
14403      composeEnum(t, "QuestionnaireResponse", "status", element.getStatusElement(), -1);
14404    if (element.hasSubject())
14405      composeReference(t, "QuestionnaireResponse", "subject", element.getSubject(), -1);
14406    if (element.hasEncounter())
14407      composeReference(t, "QuestionnaireResponse", "encounter", element.getEncounter(), -1);
14408    if (element.hasAuthoredElement())
14409      composeDateTime(t, "QuestionnaireResponse", "authored", element.getAuthoredElement(), -1);
14410    if (element.hasAuthor())
14411      composeReference(t, "QuestionnaireResponse", "author", element.getAuthor(), -1);
14412    if (element.hasSource())
14413      composeReference(t, "QuestionnaireResponse", "source", element.getSource(), -1);
14414    for (int i = 0; i < element.getItem().size(); i++)
14415      composeQuestionnaireResponseQuestionnaireResponseItemComponent(t, "QuestionnaireResponse", "item",
14416          element.getItem().get(i), i);
14417  }
14418
14419  protected void composeQuestionnaireResponseQuestionnaireResponseItemComponent(Complex parent, String parentType,
14420      String name, QuestionnaireResponse.QuestionnaireResponseItemComponent element, int index) {
14421    if (element == null)
14422      return;
14423    Complex t;
14424    if (Utilities.noString(parentType))
14425      t = parent;
14426    else {
14427      t = parent.predicate("fhir:" + parentType + '.' + name);
14428    }
14429    composeBackboneElement(t, "item", name, element, index);
14430    if (element.hasLinkIdElement())
14431      composeString(t, "QuestionnaireResponse", "linkId", element.getLinkIdElement(), -1);
14432    if (element.hasDefinitionElement())
14433      composeUri(t, "QuestionnaireResponse", "definition", element.getDefinitionElement(), -1);
14434    if (element.hasTextElement())
14435      composeString(t, "QuestionnaireResponse", "text", element.getTextElement(), -1);
14436    for (int i = 0; i < element.getAnswer().size(); i++)
14437      composeQuestionnaireResponseQuestionnaireResponseItemAnswerComponent(t, "QuestionnaireResponse", "answer",
14438          element.getAnswer().get(i), i);
14439    for (int i = 0; i < element.getItem().size(); i++)
14440      composeQuestionnaireResponseQuestionnaireResponseItemComponent(t, "QuestionnaireResponse", "item",
14441          element.getItem().get(i), i);
14442  }
14443
14444  protected void composeQuestionnaireResponseQuestionnaireResponseItemAnswerComponent(Complex parent, String parentType,
14445      String name, QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent element, int index) {
14446    if (element == null)
14447      return;
14448    Complex t;
14449    if (Utilities.noString(parentType))
14450      t = parent;
14451    else {
14452      t = parent.predicate("fhir:" + parentType + '.' + name);
14453    }
14454    composeBackboneElement(t, "answer", name, element, index);
14455    if (element.hasValue())
14456      composeType(t, "QuestionnaireResponse", "value", element.getValue(), -1);
14457    for (int i = 0; i < element.getItem().size(); i++)
14458      composeQuestionnaireResponseQuestionnaireResponseItemComponent(t, "QuestionnaireResponse", "item",
14459          element.getItem().get(i), i);
14460  }
14461
14462  protected void composeRelatedPerson(Complex parent, String parentType, String name, RelatedPerson element,
14463      int index) {
14464    if (element == null)
14465      return;
14466    Complex t;
14467    if (Utilities.noString(parentType))
14468      t = parent;
14469    else {
14470      t = parent.predicate("fhir:" + parentType + '.' + name);
14471    }
14472    composeDomainResource(t, "RelatedPerson", name, element, index);
14473    for (int i = 0; i < element.getIdentifier().size(); i++)
14474      composeIdentifier(t, "RelatedPerson", "identifier", element.getIdentifier().get(i), i);
14475    if (element.hasActiveElement())
14476      composeBoolean(t, "RelatedPerson", "active", element.getActiveElement(), -1);
14477    if (element.hasPatient())
14478      composeReference(t, "RelatedPerson", "patient", element.getPatient(), -1);
14479    for (int i = 0; i < element.getRelationship().size(); i++)
14480      composeCodeableConcept(t, "RelatedPerson", "relationship", element.getRelationship().get(i), i);
14481    for (int i = 0; i < element.getName().size(); i++)
14482      composeHumanName(t, "RelatedPerson", "name", element.getName().get(i), i);
14483    for (int i = 0; i < element.getTelecom().size(); i++)
14484      composeContactPoint(t, "RelatedPerson", "telecom", element.getTelecom().get(i), i);
14485    if (element.hasGenderElement())
14486      composeEnum(t, "RelatedPerson", "gender", element.getGenderElement(), -1);
14487    if (element.hasBirthDateElement())
14488      composeDate(t, "RelatedPerson", "birthDate", element.getBirthDateElement(), -1);
14489    for (int i = 0; i < element.getAddress().size(); i++)
14490      composeAddress(t, "RelatedPerson", "address", element.getAddress().get(i), i);
14491    for (int i = 0; i < element.getPhoto().size(); i++)
14492      composeAttachment(t, "RelatedPerson", "photo", element.getPhoto().get(i), i);
14493    if (element.hasPeriod())
14494      composePeriod(t, "RelatedPerson", "period", element.getPeriod(), -1);
14495    for (int i = 0; i < element.getCommunication().size(); i++)
14496      composeRelatedPersonRelatedPersonCommunicationComponent(t, "RelatedPerson", "communication",
14497          element.getCommunication().get(i), i);
14498  }
14499
14500  protected void composeRelatedPersonRelatedPersonCommunicationComponent(Complex parent, String parentType, String name,
14501      RelatedPerson.RelatedPersonCommunicationComponent element, int index) {
14502    if (element == null)
14503      return;
14504    Complex t;
14505    if (Utilities.noString(parentType))
14506      t = parent;
14507    else {
14508      t = parent.predicate("fhir:" + parentType + '.' + name);
14509    }
14510    composeBackboneElement(t, "communication", name, element, index);
14511    if (element.hasLanguage())
14512      composeCodeableConcept(t, "RelatedPerson", "language", element.getLanguage(), -1);
14513    if (element.hasPreferredElement())
14514      composeBoolean(t, "RelatedPerson", "preferred", element.getPreferredElement(), -1);
14515  }
14516
14517  protected void composeRequestGroup(Complex parent, String parentType, String name, RequestGroup element, int index) {
14518    if (element == null)
14519      return;
14520    Complex t;
14521    if (Utilities.noString(parentType))
14522      t = parent;
14523    else {
14524      t = parent.predicate("fhir:" + parentType + '.' + name);
14525    }
14526    composeDomainResource(t, "RequestGroup", name, element, index);
14527    for (int i = 0; i < element.getIdentifier().size(); i++)
14528      composeIdentifier(t, "RequestGroup", "identifier", element.getIdentifier().get(i), i);
14529    for (int i = 0; i < element.getInstantiatesCanonical().size(); i++)
14530      composeCanonical(t, "RequestGroup", "instantiatesCanonical", element.getInstantiatesCanonical().get(i), i);
14531    for (int i = 0; i < element.getInstantiatesUri().size(); i++)
14532      composeUri(t, "RequestGroup", "instantiatesUri", element.getInstantiatesUri().get(i), i);
14533    for (int i = 0; i < element.getBasedOn().size(); i++)
14534      composeReference(t, "RequestGroup", "basedOn", element.getBasedOn().get(i), i);
14535    for (int i = 0; i < element.getReplaces().size(); i++)
14536      composeReference(t, "RequestGroup", "replaces", element.getReplaces().get(i), i);
14537    if (element.hasGroupIdentifier())
14538      composeIdentifier(t, "RequestGroup", "groupIdentifier", element.getGroupIdentifier(), -1);
14539    if (element.hasStatusElement())
14540      composeEnum(t, "RequestGroup", "status", element.getStatusElement(), -1);
14541    if (element.hasIntentElement())
14542      composeEnum(t, "RequestGroup", "intent", element.getIntentElement(), -1);
14543    if (element.hasPriorityElement())
14544      composeEnum(t, "RequestGroup", "priority", element.getPriorityElement(), -1);
14545    if (element.hasCode())
14546      composeCodeableConcept(t, "RequestGroup", "code", element.getCode(), -1);
14547    if (element.hasSubject())
14548      composeReference(t, "RequestGroup", "subject", element.getSubject(), -1);
14549    if (element.hasEncounter())
14550      composeReference(t, "RequestGroup", "encounter", element.getEncounter(), -1);
14551    if (element.hasAuthoredOnElement())
14552      composeDateTime(t, "RequestGroup", "authoredOn", element.getAuthoredOnElement(), -1);
14553    if (element.hasAuthor())
14554      composeReference(t, "RequestGroup", "author", element.getAuthor(), -1);
14555    for (int i = 0; i < element.getReasonCode().size(); i++)
14556      composeCodeableConcept(t, "RequestGroup", "reasonCode", element.getReasonCode().get(i), i);
14557    for (int i = 0; i < element.getReasonReference().size(); i++)
14558      composeReference(t, "RequestGroup", "reasonReference", element.getReasonReference().get(i), i);
14559    for (int i = 0; i < element.getNote().size(); i++)
14560      composeAnnotation(t, "RequestGroup", "note", element.getNote().get(i), i);
14561    for (int i = 0; i < element.getAction().size(); i++)
14562      composeRequestGroupRequestGroupActionComponent(t, "RequestGroup", "action", element.getAction().get(i), i);
14563  }
14564
14565  protected void composeRequestGroupRequestGroupActionComponent(Complex parent, String parentType, String name,
14566      RequestGroup.RequestGroupActionComponent element, int index) {
14567    if (element == null)
14568      return;
14569    Complex t;
14570    if (Utilities.noString(parentType))
14571      t = parent;
14572    else {
14573      t = parent.predicate("fhir:" + parentType + '.' + name);
14574    }
14575    composeBackboneElement(t, "action", name, element, index);
14576    if (element.hasPrefixElement())
14577      composeString(t, "RequestGroup", "prefix", element.getPrefixElement(), -1);
14578    if (element.hasTitleElement())
14579      composeString(t, "RequestGroup", "title", element.getTitleElement(), -1);
14580    if (element.hasDescriptionElement())
14581      composeString(t, "RequestGroup", "description", element.getDescriptionElement(), -1);
14582    if (element.hasTextEquivalentElement())
14583      composeString(t, "RequestGroup", "textEquivalent", element.getTextEquivalentElement(), -1);
14584    if (element.hasPriorityElement())
14585      composeEnum(t, "RequestGroup", "priority", element.getPriorityElement(), -1);
14586    for (int i = 0; i < element.getCode().size(); i++)
14587      composeCodeableConcept(t, "RequestGroup", "code", element.getCode().get(i), i);
14588    for (int i = 0; i < element.getDocumentation().size(); i++)
14589      composeRelatedArtifact(t, "RequestGroup", "documentation", element.getDocumentation().get(i), i);
14590    for (int i = 0; i < element.getCondition().size(); i++)
14591      composeRequestGroupRequestGroupActionConditionComponent(t, "RequestGroup", "condition",
14592          element.getCondition().get(i), i);
14593    for (int i = 0; i < element.getRelatedAction().size(); i++)
14594      composeRequestGroupRequestGroupActionRelatedActionComponent(t, "RequestGroup", "relatedAction",
14595          element.getRelatedAction().get(i), i);
14596    if (element.hasTiming())
14597      composeType(t, "RequestGroup", "timing", element.getTiming(), -1);
14598    for (int i = 0; i < element.getParticipant().size(); i++)
14599      composeReference(t, "RequestGroup", "participant", element.getParticipant().get(i), i);
14600    if (element.hasType())
14601      composeCodeableConcept(t, "RequestGroup", "type", element.getType(), -1);
14602    if (element.hasGroupingBehaviorElement())
14603      composeEnum(t, "RequestGroup", "groupingBehavior", element.getGroupingBehaviorElement(), -1);
14604    if (element.hasSelectionBehaviorElement())
14605      composeEnum(t, "RequestGroup", "selectionBehavior", element.getSelectionBehaviorElement(), -1);
14606    if (element.hasRequiredBehaviorElement())
14607      composeEnum(t, "RequestGroup", "requiredBehavior", element.getRequiredBehaviorElement(), -1);
14608    if (element.hasPrecheckBehaviorElement())
14609      composeEnum(t, "RequestGroup", "precheckBehavior", element.getPrecheckBehaviorElement(), -1);
14610    if (element.hasCardinalityBehaviorElement())
14611      composeEnum(t, "RequestGroup", "cardinalityBehavior", element.getCardinalityBehaviorElement(), -1);
14612    if (element.hasResource())
14613      composeReference(t, "RequestGroup", "resource", element.getResource(), -1);
14614    for (int i = 0; i < element.getAction().size(); i++)
14615      composeRequestGroupRequestGroupActionComponent(t, "RequestGroup", "action", element.getAction().get(i), i);
14616  }
14617
14618  protected void composeRequestGroupRequestGroupActionConditionComponent(Complex parent, String parentType, String name,
14619      RequestGroup.RequestGroupActionConditionComponent element, int index) {
14620    if (element == null)
14621      return;
14622    Complex t;
14623    if (Utilities.noString(parentType))
14624      t = parent;
14625    else {
14626      t = parent.predicate("fhir:" + parentType + '.' + name);
14627    }
14628    composeBackboneElement(t, "condition", name, element, index);
14629    if (element.hasKindElement())
14630      composeEnum(t, "RequestGroup", "kind", element.getKindElement(), -1);
14631    if (element.hasExpression())
14632      composeExpression(t, "RequestGroup", "expression", element.getExpression(), -1);
14633  }
14634
14635  protected void composeRequestGroupRequestGroupActionRelatedActionComponent(Complex parent, String parentType,
14636      String name, RequestGroup.RequestGroupActionRelatedActionComponent element, int index) {
14637    if (element == null)
14638      return;
14639    Complex t;
14640    if (Utilities.noString(parentType))
14641      t = parent;
14642    else {
14643      t = parent.predicate("fhir:" + parentType + '.' + name);
14644    }
14645    composeBackboneElement(t, "relatedAction", name, element, index);
14646    if (element.hasActionIdElement())
14647      composeId(t, "RequestGroup", "actionId", element.getActionIdElement(), -1);
14648    if (element.hasRelationshipElement())
14649      composeEnum(t, "RequestGroup", "relationship", element.getRelationshipElement(), -1);
14650    if (element.hasOffset())
14651      composeType(t, "RequestGroup", "offset", element.getOffset(), -1);
14652  }
14653
14654  protected void composeResearchDefinition(Complex parent, String parentType, String name, ResearchDefinition element,
14655      int index) {
14656    if (element == null)
14657      return;
14658    Complex t;
14659    if (Utilities.noString(parentType))
14660      t = parent;
14661    else {
14662      t = parent.predicate("fhir:" + parentType + '.' + name);
14663    }
14664    composeDomainResource(t, "ResearchDefinition", name, element, index);
14665    if (element.hasUrlElement())
14666      composeUri(t, "ResearchDefinition", "url", element.getUrlElement(), -1);
14667    for (int i = 0; i < element.getIdentifier().size(); i++)
14668      composeIdentifier(t, "ResearchDefinition", "identifier", element.getIdentifier().get(i), i);
14669    if (element.hasVersionElement())
14670      composeString(t, "ResearchDefinition", "version", element.getVersionElement(), -1);
14671    if (element.hasNameElement())
14672      composeString(t, "ResearchDefinition", "name", element.getNameElement(), -1);
14673    if (element.hasTitleElement())
14674      composeString(t, "ResearchDefinition", "title", element.getTitleElement(), -1);
14675    if (element.hasShortTitleElement())
14676      composeString(t, "ResearchDefinition", "shortTitle", element.getShortTitleElement(), -1);
14677    if (element.hasSubtitleElement())
14678      composeString(t, "ResearchDefinition", "subtitle", element.getSubtitleElement(), -1);
14679    if (element.hasStatusElement())
14680      composeEnum(t, "ResearchDefinition", "status", element.getStatusElement(), -1);
14681    if (element.hasExperimentalElement())
14682      composeBoolean(t, "ResearchDefinition", "experimental", element.getExperimentalElement(), -1);
14683    if (element.hasSubject())
14684      composeType(t, "ResearchDefinition", "subject", element.getSubject(), -1);
14685    if (element.hasDateElement())
14686      composeDateTime(t, "ResearchDefinition", "date", element.getDateElement(), -1);
14687    if (element.hasPublisherElement())
14688      composeString(t, "ResearchDefinition", "publisher", element.getPublisherElement(), -1);
14689    for (int i = 0; i < element.getContact().size(); i++)
14690      composeContactDetail(t, "ResearchDefinition", "contact", element.getContact().get(i), i);
14691    if (element.hasDescriptionElement())
14692      composeMarkdown(t, "ResearchDefinition", "description", element.getDescriptionElement(), -1);
14693    for (int i = 0; i < element.getComment().size(); i++)
14694      composeString(t, "ResearchDefinition", "comment", element.getComment().get(i), i);
14695    for (int i = 0; i < element.getUseContext().size(); i++)
14696      composeUsageContext(t, "ResearchDefinition", "useContext", element.getUseContext().get(i), i);
14697    for (int i = 0; i < element.getJurisdiction().size(); i++)
14698      composeCodeableConcept(t, "ResearchDefinition", "jurisdiction", element.getJurisdiction().get(i), i);
14699    if (element.hasPurposeElement())
14700      composeMarkdown(t, "ResearchDefinition", "purpose", element.getPurposeElement(), -1);
14701    if (element.hasUsageElement())
14702      composeString(t, "ResearchDefinition", "usage", element.getUsageElement(), -1);
14703    if (element.hasCopyrightElement())
14704      composeMarkdown(t, "ResearchDefinition", "copyright", element.getCopyrightElement(), -1);
14705    if (element.hasApprovalDateElement())
14706      composeDate(t, "ResearchDefinition", "approvalDate", element.getApprovalDateElement(), -1);
14707    if (element.hasLastReviewDateElement())
14708      composeDate(t, "ResearchDefinition", "lastReviewDate", element.getLastReviewDateElement(), -1);
14709    if (element.hasEffectivePeriod())
14710      composePeriod(t, "ResearchDefinition", "effectivePeriod", element.getEffectivePeriod(), -1);
14711    for (int i = 0; i < element.getTopic().size(); i++)
14712      composeCodeableConcept(t, "ResearchDefinition", "topic", element.getTopic().get(i), i);
14713    for (int i = 0; i < element.getAuthor().size(); i++)
14714      composeContactDetail(t, "ResearchDefinition", "author", element.getAuthor().get(i), i);
14715    for (int i = 0; i < element.getEditor().size(); i++)
14716      composeContactDetail(t, "ResearchDefinition", "editor", element.getEditor().get(i), i);
14717    for (int i = 0; i < element.getReviewer().size(); i++)
14718      composeContactDetail(t, "ResearchDefinition", "reviewer", element.getReviewer().get(i), i);
14719    for (int i = 0; i < element.getEndorser().size(); i++)
14720      composeContactDetail(t, "ResearchDefinition", "endorser", element.getEndorser().get(i), i);
14721    for (int i = 0; i < element.getRelatedArtifact().size(); i++)
14722      composeRelatedArtifact(t, "ResearchDefinition", "relatedArtifact", element.getRelatedArtifact().get(i), i);
14723    for (int i = 0; i < element.getLibrary().size(); i++)
14724      composeCanonical(t, "ResearchDefinition", "library", element.getLibrary().get(i), i);
14725    if (element.hasPopulation())
14726      composeReference(t, "ResearchDefinition", "population", element.getPopulation(), -1);
14727    if (element.hasExposure())
14728      composeReference(t, "ResearchDefinition", "exposure", element.getExposure(), -1);
14729    if (element.hasExposureAlternative())
14730      composeReference(t, "ResearchDefinition", "exposureAlternative", element.getExposureAlternative(), -1);
14731    if (element.hasOutcome())
14732      composeReference(t, "ResearchDefinition", "outcome", element.getOutcome(), -1);
14733  }
14734
14735  protected void composeResearchElementDefinition(Complex parent, String parentType, String name,
14736      ResearchElementDefinition element, int index) {
14737    if (element == null)
14738      return;
14739    Complex t;
14740    if (Utilities.noString(parentType))
14741      t = parent;
14742    else {
14743      t = parent.predicate("fhir:" + parentType + '.' + name);
14744    }
14745    composeDomainResource(t, "ResearchElementDefinition", name, element, index);
14746    if (element.hasUrlElement())
14747      composeUri(t, "ResearchElementDefinition", "url", element.getUrlElement(), -1);
14748    for (int i = 0; i < element.getIdentifier().size(); i++)
14749      composeIdentifier(t, "ResearchElementDefinition", "identifier", element.getIdentifier().get(i), i);
14750    if (element.hasVersionElement())
14751      composeString(t, "ResearchElementDefinition", "version", element.getVersionElement(), -1);
14752    if (element.hasNameElement())
14753      composeString(t, "ResearchElementDefinition", "name", element.getNameElement(), -1);
14754    if (element.hasTitleElement())
14755      composeString(t, "ResearchElementDefinition", "title", element.getTitleElement(), -1);
14756    if (element.hasShortTitleElement())
14757      composeString(t, "ResearchElementDefinition", "shortTitle", element.getShortTitleElement(), -1);
14758    if (element.hasSubtitleElement())
14759      composeString(t, "ResearchElementDefinition", "subtitle", element.getSubtitleElement(), -1);
14760    if (element.hasStatusElement())
14761      composeEnum(t, "ResearchElementDefinition", "status", element.getStatusElement(), -1);
14762    if (element.hasExperimentalElement())
14763      composeBoolean(t, "ResearchElementDefinition", "experimental", element.getExperimentalElement(), -1);
14764    if (element.hasSubject())
14765      composeType(t, "ResearchElementDefinition", "subject", element.getSubject(), -1);
14766    if (element.hasDateElement())
14767      composeDateTime(t, "ResearchElementDefinition", "date", element.getDateElement(), -1);
14768    if (element.hasPublisherElement())
14769      composeString(t, "ResearchElementDefinition", "publisher", element.getPublisherElement(), -1);
14770    for (int i = 0; i < element.getContact().size(); i++)
14771      composeContactDetail(t, "ResearchElementDefinition", "contact", element.getContact().get(i), i);
14772    if (element.hasDescriptionElement())
14773      composeMarkdown(t, "ResearchElementDefinition", "description", element.getDescriptionElement(), -1);
14774    for (int i = 0; i < element.getComment().size(); i++)
14775      composeString(t, "ResearchElementDefinition", "comment", element.getComment().get(i), i);
14776    for (int i = 0; i < element.getUseContext().size(); i++)
14777      composeUsageContext(t, "ResearchElementDefinition", "useContext", element.getUseContext().get(i), i);
14778    for (int i = 0; i < element.getJurisdiction().size(); i++)
14779      composeCodeableConcept(t, "ResearchElementDefinition", "jurisdiction", element.getJurisdiction().get(i), i);
14780    if (element.hasPurposeElement())
14781      composeMarkdown(t, "ResearchElementDefinition", "purpose", element.getPurposeElement(), -1);
14782    if (element.hasUsageElement())
14783      composeString(t, "ResearchElementDefinition", "usage", element.getUsageElement(), -1);
14784    if (element.hasCopyrightElement())
14785      composeMarkdown(t, "ResearchElementDefinition", "copyright", element.getCopyrightElement(), -1);
14786    if (element.hasApprovalDateElement())
14787      composeDate(t, "ResearchElementDefinition", "approvalDate", element.getApprovalDateElement(), -1);
14788    if (element.hasLastReviewDateElement())
14789      composeDate(t, "ResearchElementDefinition", "lastReviewDate", element.getLastReviewDateElement(), -1);
14790    if (element.hasEffectivePeriod())
14791      composePeriod(t, "ResearchElementDefinition", "effectivePeriod", element.getEffectivePeriod(), -1);
14792    for (int i = 0; i < element.getTopic().size(); i++)
14793      composeCodeableConcept(t, "ResearchElementDefinition", "topic", element.getTopic().get(i), i);
14794    for (int i = 0; i < element.getAuthor().size(); i++)
14795      composeContactDetail(t, "ResearchElementDefinition", "author", element.getAuthor().get(i), i);
14796    for (int i = 0; i < element.getEditor().size(); i++)
14797      composeContactDetail(t, "ResearchElementDefinition", "editor", element.getEditor().get(i), i);
14798    for (int i = 0; i < element.getReviewer().size(); i++)
14799      composeContactDetail(t, "ResearchElementDefinition", "reviewer", element.getReviewer().get(i), i);
14800    for (int i = 0; i < element.getEndorser().size(); i++)
14801      composeContactDetail(t, "ResearchElementDefinition", "endorser", element.getEndorser().get(i), i);
14802    for (int i = 0; i < element.getRelatedArtifact().size(); i++)
14803      composeRelatedArtifact(t, "ResearchElementDefinition", "relatedArtifact", element.getRelatedArtifact().get(i), i);
14804    for (int i = 0; i < element.getLibrary().size(); i++)
14805      composeCanonical(t, "ResearchElementDefinition", "library", element.getLibrary().get(i), i);
14806    if (element.hasTypeElement())
14807      composeEnum(t, "ResearchElementDefinition", "type", element.getTypeElement(), -1);
14808    if (element.hasVariableTypeElement())
14809      composeEnum(t, "ResearchElementDefinition", "variableType", element.getVariableTypeElement(), -1);
14810    for (int i = 0; i < element.getCharacteristic().size(); i++)
14811      composeResearchElementDefinitionResearchElementDefinitionCharacteristicComponent(t, "ResearchElementDefinition",
14812          "characteristic", element.getCharacteristic().get(i), i);
14813  }
14814
14815  protected void composeResearchElementDefinitionResearchElementDefinitionCharacteristicComponent(Complex parent,
14816      String parentType, String name,
14817      ResearchElementDefinition.ResearchElementDefinitionCharacteristicComponent element, int index) {
14818    if (element == null)
14819      return;
14820    Complex t;
14821    if (Utilities.noString(parentType))
14822      t = parent;
14823    else {
14824      t = parent.predicate("fhir:" + parentType + '.' + name);
14825    }
14826    composeBackboneElement(t, "characteristic", name, element, index);
14827    if (element.hasDefinition())
14828      composeType(t, "ResearchElementDefinition", "definition", element.getDefinition(), -1);
14829    for (int i = 0; i < element.getUsageContext().size(); i++)
14830      composeUsageContext(t, "ResearchElementDefinition", "usageContext", element.getUsageContext().get(i), i);
14831    if (element.hasExcludeElement())
14832      composeBoolean(t, "ResearchElementDefinition", "exclude", element.getExcludeElement(), -1);
14833    if (element.hasUnitOfMeasure())
14834      composeCodeableConcept(t, "ResearchElementDefinition", "unitOfMeasure", element.getUnitOfMeasure(), -1);
14835    if (element.hasStudyEffectiveDescriptionElement())
14836      composeString(t, "ResearchElementDefinition", "studyEffectiveDescription",
14837          element.getStudyEffectiveDescriptionElement(), -1);
14838    if (element.hasStudyEffective())
14839      composeType(t, "ResearchElementDefinition", "studyEffective", element.getStudyEffective(), -1);
14840    if (element.hasStudyEffectiveTimeFromStart())
14841      composeDuration(t, "ResearchElementDefinition", "studyEffectiveTimeFromStart",
14842          element.getStudyEffectiveTimeFromStart(), -1);
14843    if (element.hasStudyEffectiveGroupMeasureElement())
14844      composeEnum(t, "ResearchElementDefinition", "studyEffectiveGroupMeasure",
14845          element.getStudyEffectiveGroupMeasureElement(), -1);
14846    if (element.hasParticipantEffectiveDescriptionElement())
14847      composeString(t, "ResearchElementDefinition", "participantEffectiveDescription",
14848          element.getParticipantEffectiveDescriptionElement(), -1);
14849    if (element.hasParticipantEffective())
14850      composeType(t, "ResearchElementDefinition", "participantEffective", element.getParticipantEffective(), -1);
14851    if (element.hasParticipantEffectiveTimeFromStart())
14852      composeDuration(t, "ResearchElementDefinition", "participantEffectiveTimeFromStart",
14853          element.getParticipantEffectiveTimeFromStart(), -1);
14854    if (element.hasParticipantEffectiveGroupMeasureElement())
14855      composeEnum(t, "ResearchElementDefinition", "participantEffectiveGroupMeasure",
14856          element.getParticipantEffectiveGroupMeasureElement(), -1);
14857  }
14858
14859  protected void composeResearchStudy(Complex parent, String parentType, String name, ResearchStudy element,
14860      int index) {
14861    if (element == null)
14862      return;
14863    Complex t;
14864    if (Utilities.noString(parentType))
14865      t = parent;
14866    else {
14867      t = parent.predicate("fhir:" + parentType + '.' + name);
14868    }
14869    composeDomainResource(t, "ResearchStudy", name, element, index);
14870    for (int i = 0; i < element.getIdentifier().size(); i++)
14871      composeIdentifier(t, "ResearchStudy", "identifier", element.getIdentifier().get(i), i);
14872    if (element.hasTitleElement())
14873      composeString(t, "ResearchStudy", "title", element.getTitleElement(), -1);
14874    for (int i = 0; i < element.getProtocol().size(); i++)
14875      composeReference(t, "ResearchStudy", "protocol", element.getProtocol().get(i), i);
14876    for (int i = 0; i < element.getPartOf().size(); i++)
14877      composeReference(t, "ResearchStudy", "partOf", element.getPartOf().get(i), i);
14878    if (element.hasStatusElement())
14879      composeEnum(t, "ResearchStudy", "status", element.getStatusElement(), -1);
14880    if (element.hasPrimaryPurposeType())
14881      composeCodeableConcept(t, "ResearchStudy", "primaryPurposeType", element.getPrimaryPurposeType(), -1);
14882    if (element.hasPhase())
14883      composeCodeableConcept(t, "ResearchStudy", "phase", element.getPhase(), -1);
14884    for (int i = 0; i < element.getCategory().size(); i++)
14885      composeCodeableConcept(t, "ResearchStudy", "category", element.getCategory().get(i), i);
14886    for (int i = 0; i < element.getFocus().size(); i++)
14887      composeCodeableConcept(t, "ResearchStudy", "focus", element.getFocus().get(i), i);
14888    for (int i = 0; i < element.getCondition().size(); i++)
14889      composeCodeableConcept(t, "ResearchStudy", "condition", element.getCondition().get(i), i);
14890    for (int i = 0; i < element.getContact().size(); i++)
14891      composeContactDetail(t, "ResearchStudy", "contact", element.getContact().get(i), i);
14892    for (int i = 0; i < element.getRelatedArtifact().size(); i++)
14893      composeRelatedArtifact(t, "ResearchStudy", "relatedArtifact", element.getRelatedArtifact().get(i), i);
14894    for (int i = 0; i < element.getKeyword().size(); i++)
14895      composeCodeableConcept(t, "ResearchStudy", "keyword", element.getKeyword().get(i), i);
14896    for (int i = 0; i < element.getLocation().size(); i++)
14897      composeCodeableConcept(t, "ResearchStudy", "location", element.getLocation().get(i), i);
14898    if (element.hasDescriptionElement())
14899      composeMarkdown(t, "ResearchStudy", "description", element.getDescriptionElement(), -1);
14900    for (int i = 0; i < element.getEnrollment().size(); i++)
14901      composeReference(t, "ResearchStudy", "enrollment", element.getEnrollment().get(i), i);
14902    if (element.hasPeriod())
14903      composePeriod(t, "ResearchStudy", "period", element.getPeriod(), -1);
14904    if (element.hasSponsor())
14905      composeReference(t, "ResearchStudy", "sponsor", element.getSponsor(), -1);
14906    if (element.hasPrincipalInvestigator())
14907      composeReference(t, "ResearchStudy", "principalInvestigator", element.getPrincipalInvestigator(), -1);
14908    for (int i = 0; i < element.getSite().size(); i++)
14909      composeReference(t, "ResearchStudy", "site", element.getSite().get(i), i);
14910    if (element.hasReasonStopped())
14911      composeCodeableConcept(t, "ResearchStudy", "reasonStopped", element.getReasonStopped(), -1);
14912    for (int i = 0; i < element.getNote().size(); i++)
14913      composeAnnotation(t, "ResearchStudy", "note", element.getNote().get(i), i);
14914    for (int i = 0; i < element.getArm().size(); i++)
14915      composeResearchStudyResearchStudyArmComponent(t, "ResearchStudy", "arm", element.getArm().get(i), i);
14916    for (int i = 0; i < element.getObjective().size(); i++)
14917      composeResearchStudyResearchStudyObjectiveComponent(t, "ResearchStudy", "objective",
14918          element.getObjective().get(i), i);
14919  }
14920
14921  protected void composeResearchStudyResearchStudyArmComponent(Complex parent, String parentType, String name,
14922      ResearchStudy.ResearchStudyArmComponent element, int index) {
14923    if (element == null)
14924      return;
14925    Complex t;
14926    if (Utilities.noString(parentType))
14927      t = parent;
14928    else {
14929      t = parent.predicate("fhir:" + parentType + '.' + name);
14930    }
14931    composeBackboneElement(t, "arm", name, element, index);
14932    if (element.hasNameElement())
14933      composeString(t, "ResearchStudy", "name", element.getNameElement(), -1);
14934    if (element.hasType())
14935      composeCodeableConcept(t, "ResearchStudy", "type", element.getType(), -1);
14936    if (element.hasDescriptionElement())
14937      composeString(t, "ResearchStudy", "description", element.getDescriptionElement(), -1);
14938  }
14939
14940  protected void composeResearchStudyResearchStudyObjectiveComponent(Complex parent, String parentType, String name,
14941      ResearchStudy.ResearchStudyObjectiveComponent element, int index) {
14942    if (element == null)
14943      return;
14944    Complex t;
14945    if (Utilities.noString(parentType))
14946      t = parent;
14947    else {
14948      t = parent.predicate("fhir:" + parentType + '.' + name);
14949    }
14950    composeBackboneElement(t, "objective", name, element, index);
14951    if (element.hasNameElement())
14952      composeString(t, "ResearchStudy", "name", element.getNameElement(), -1);
14953    if (element.hasType())
14954      composeCodeableConcept(t, "ResearchStudy", "type", element.getType(), -1);
14955  }
14956
14957  protected void composeResearchSubject(Complex parent, String parentType, String name, ResearchSubject element,
14958      int index) {
14959    if (element == null)
14960      return;
14961    Complex t;
14962    if (Utilities.noString(parentType))
14963      t = parent;
14964    else {
14965      t = parent.predicate("fhir:" + parentType + '.' + name);
14966    }
14967    composeDomainResource(t, "ResearchSubject", name, element, index);
14968    for (int i = 0; i < element.getIdentifier().size(); i++)
14969      composeIdentifier(t, "ResearchSubject", "identifier", element.getIdentifier().get(i), i);
14970    if (element.hasStatusElement())
14971      composeEnum(t, "ResearchSubject", "status", element.getStatusElement(), -1);
14972    if (element.hasPeriod())
14973      composePeriod(t, "ResearchSubject", "period", element.getPeriod(), -1);
14974    if (element.hasStudy())
14975      composeReference(t, "ResearchSubject", "study", element.getStudy(), -1);
14976    if (element.hasIndividual())
14977      composeReference(t, "ResearchSubject", "individual", element.getIndividual(), -1);
14978    if (element.hasAssignedArmElement())
14979      composeString(t, "ResearchSubject", "assignedArm", element.getAssignedArmElement(), -1);
14980    if (element.hasActualArmElement())
14981      composeString(t, "ResearchSubject", "actualArm", element.getActualArmElement(), -1);
14982    if (element.hasConsent())
14983      composeReference(t, "ResearchSubject", "consent", element.getConsent(), -1);
14984  }
14985
14986  protected void composeRiskAssessment(Complex parent, String parentType, String name, RiskAssessment element,
14987      int index) {
14988    if (element == null)
14989      return;
14990    Complex t;
14991    if (Utilities.noString(parentType))
14992      t = parent;
14993    else {
14994      t = parent.predicate("fhir:" + parentType + '.' + name);
14995    }
14996    composeDomainResource(t, "RiskAssessment", name, element, index);
14997    for (int i = 0; i < element.getIdentifier().size(); i++)
14998      composeIdentifier(t, "RiskAssessment", "identifier", element.getIdentifier().get(i), i);
14999    if (element.hasBasedOn())
15000      composeReference(t, "RiskAssessment", "basedOn", element.getBasedOn(), -1);
15001    if (element.hasParent())
15002      composeReference(t, "RiskAssessment", "parent", element.getParent(), -1);
15003    if (element.hasStatusElement())
15004      composeEnum(t, "RiskAssessment", "status", element.getStatusElement(), -1);
15005    if (element.hasMethod())
15006      composeCodeableConcept(t, "RiskAssessment", "method", element.getMethod(), -1);
15007    if (element.hasCode())
15008      composeCodeableConcept(t, "RiskAssessment", "code", element.getCode(), -1);
15009    if (element.hasSubject())
15010      composeReference(t, "RiskAssessment", "subject", element.getSubject(), -1);
15011    if (element.hasEncounter())
15012      composeReference(t, "RiskAssessment", "encounter", element.getEncounter(), -1);
15013    if (element.hasOccurrence())
15014      composeType(t, "RiskAssessment", "occurrence", element.getOccurrence(), -1);
15015    if (element.hasCondition())
15016      composeReference(t, "RiskAssessment", "condition", element.getCondition(), -1);
15017    if (element.hasPerformer())
15018      composeReference(t, "RiskAssessment", "performer", element.getPerformer(), -1);
15019    for (int i = 0; i < element.getReasonCode().size(); i++)
15020      composeCodeableConcept(t, "RiskAssessment", "reasonCode", element.getReasonCode().get(i), i);
15021    for (int i = 0; i < element.getReasonReference().size(); i++)
15022      composeReference(t, "RiskAssessment", "reasonReference", element.getReasonReference().get(i), i);
15023    for (int i = 0; i < element.getBasis().size(); i++)
15024      composeReference(t, "RiskAssessment", "basis", element.getBasis().get(i), i);
15025    for (int i = 0; i < element.getPrediction().size(); i++)
15026      composeRiskAssessmentRiskAssessmentPredictionComponent(t, "RiskAssessment", "prediction",
15027          element.getPrediction().get(i), i);
15028    if (element.hasMitigationElement())
15029      composeString(t, "RiskAssessment", "mitigation", element.getMitigationElement(), -1);
15030    for (int i = 0; i < element.getNote().size(); i++)
15031      composeAnnotation(t, "RiskAssessment", "note", element.getNote().get(i), i);
15032  }
15033
15034  protected void composeRiskAssessmentRiskAssessmentPredictionComponent(Complex parent, String parentType, String name,
15035      RiskAssessment.RiskAssessmentPredictionComponent element, int index) {
15036    if (element == null)
15037      return;
15038    Complex t;
15039    if (Utilities.noString(parentType))
15040      t = parent;
15041    else {
15042      t = parent.predicate("fhir:" + parentType + '.' + name);
15043    }
15044    composeBackboneElement(t, "prediction", name, element, index);
15045    if (element.hasOutcome())
15046      composeCodeableConcept(t, "RiskAssessment", "outcome", element.getOutcome(), -1);
15047    if (element.hasProbability())
15048      composeType(t, "RiskAssessment", "probability", element.getProbability(), -1);
15049    if (element.hasQualitativeRisk())
15050      composeCodeableConcept(t, "RiskAssessment", "qualitativeRisk", element.getQualitativeRisk(), -1);
15051    if (element.hasRelativeRiskElement())
15052      composeDecimal(t, "RiskAssessment", "relativeRisk", element.getRelativeRiskElement(), -1);
15053    if (element.hasWhen())
15054      composeType(t, "RiskAssessment", "when", element.getWhen(), -1);
15055    if (element.hasRationaleElement())
15056      composeString(t, "RiskAssessment", "rationale", element.getRationaleElement(), -1);
15057  }
15058
15059  protected void composeRiskEvidenceSynthesis(Complex parent, String parentType, String name,
15060      RiskEvidenceSynthesis element, int index) {
15061    if (element == null)
15062      return;
15063    Complex t;
15064    if (Utilities.noString(parentType))
15065      t = parent;
15066    else {
15067      t = parent.predicate("fhir:" + parentType + '.' + name);
15068    }
15069    composeDomainResource(t, "RiskEvidenceSynthesis", name, element, index);
15070    if (element.hasUrlElement())
15071      composeUri(t, "RiskEvidenceSynthesis", "url", element.getUrlElement(), -1);
15072    for (int i = 0; i < element.getIdentifier().size(); i++)
15073      composeIdentifier(t, "RiskEvidenceSynthesis", "identifier", element.getIdentifier().get(i), i);
15074    if (element.hasVersionElement())
15075      composeString(t, "RiskEvidenceSynthesis", "version", element.getVersionElement(), -1);
15076    if (element.hasNameElement())
15077      composeString(t, "RiskEvidenceSynthesis", "name", element.getNameElement(), -1);
15078    if (element.hasTitleElement())
15079      composeString(t, "RiskEvidenceSynthesis", "title", element.getTitleElement(), -1);
15080    if (element.hasStatusElement())
15081      composeEnum(t, "RiskEvidenceSynthesis", "status", element.getStatusElement(), -1);
15082    if (element.hasDateElement())
15083      composeDateTime(t, "RiskEvidenceSynthesis", "date", element.getDateElement(), -1);
15084    if (element.hasPublisherElement())
15085      composeString(t, "RiskEvidenceSynthesis", "publisher", element.getPublisherElement(), -1);
15086    for (int i = 0; i < element.getContact().size(); i++)
15087      composeContactDetail(t, "RiskEvidenceSynthesis", "contact", element.getContact().get(i), i);
15088    if (element.hasDescriptionElement())
15089      composeMarkdown(t, "RiskEvidenceSynthesis", "description", element.getDescriptionElement(), -1);
15090    for (int i = 0; i < element.getNote().size(); i++)
15091      composeAnnotation(t, "RiskEvidenceSynthesis", "note", element.getNote().get(i), i);
15092    for (int i = 0; i < element.getUseContext().size(); i++)
15093      composeUsageContext(t, "RiskEvidenceSynthesis", "useContext", element.getUseContext().get(i), i);
15094    for (int i = 0; i < element.getJurisdiction().size(); i++)
15095      composeCodeableConcept(t, "RiskEvidenceSynthesis", "jurisdiction", element.getJurisdiction().get(i), i);
15096    if (element.hasCopyrightElement())
15097      composeMarkdown(t, "RiskEvidenceSynthesis", "copyright", element.getCopyrightElement(), -1);
15098    if (element.hasApprovalDateElement())
15099      composeDate(t, "RiskEvidenceSynthesis", "approvalDate", element.getApprovalDateElement(), -1);
15100    if (element.hasLastReviewDateElement())
15101      composeDate(t, "RiskEvidenceSynthesis", "lastReviewDate", element.getLastReviewDateElement(), -1);
15102    if (element.hasEffectivePeriod())
15103      composePeriod(t, "RiskEvidenceSynthesis", "effectivePeriod", element.getEffectivePeriod(), -1);
15104    for (int i = 0; i < element.getTopic().size(); i++)
15105      composeCodeableConcept(t, "RiskEvidenceSynthesis", "topic", element.getTopic().get(i), i);
15106    for (int i = 0; i < element.getAuthor().size(); i++)
15107      composeContactDetail(t, "RiskEvidenceSynthesis", "author", element.getAuthor().get(i), i);
15108    for (int i = 0; i < element.getEditor().size(); i++)
15109      composeContactDetail(t, "RiskEvidenceSynthesis", "editor", element.getEditor().get(i), i);
15110    for (int i = 0; i < element.getReviewer().size(); i++)
15111      composeContactDetail(t, "RiskEvidenceSynthesis", "reviewer", element.getReviewer().get(i), i);
15112    for (int i = 0; i < element.getEndorser().size(); i++)
15113      composeContactDetail(t, "RiskEvidenceSynthesis", "endorser", element.getEndorser().get(i), i);
15114    for (int i = 0; i < element.getRelatedArtifact().size(); i++)
15115      composeRelatedArtifact(t, "RiskEvidenceSynthesis", "relatedArtifact", element.getRelatedArtifact().get(i), i);
15116    if (element.hasSynthesisType())
15117      composeCodeableConcept(t, "RiskEvidenceSynthesis", "synthesisType", element.getSynthesisType(), -1);
15118    if (element.hasStudyType())
15119      composeCodeableConcept(t, "RiskEvidenceSynthesis", "studyType", element.getStudyType(), -1);
15120    if (element.hasPopulation())
15121      composeReference(t, "RiskEvidenceSynthesis", "population", element.getPopulation(), -1);
15122    if (element.hasExposure())
15123      composeReference(t, "RiskEvidenceSynthesis", "exposure", element.getExposure(), -1);
15124    if (element.hasOutcome())
15125      composeReference(t, "RiskEvidenceSynthesis", "outcome", element.getOutcome(), -1);
15126    if (element.hasSampleSize())
15127      composeRiskEvidenceSynthesisRiskEvidenceSynthesisSampleSizeComponent(t, "RiskEvidenceSynthesis", "sampleSize",
15128          element.getSampleSize(), -1);
15129    if (element.hasRiskEstimate())
15130      composeRiskEvidenceSynthesisRiskEvidenceSynthesisRiskEstimateComponent(t, "RiskEvidenceSynthesis", "riskEstimate",
15131          element.getRiskEstimate(), -1);
15132    for (int i = 0; i < element.getCertainty().size(); i++)
15133      composeRiskEvidenceSynthesisRiskEvidenceSynthesisCertaintyComponent(t, "RiskEvidenceSynthesis", "certainty",
15134          element.getCertainty().get(i), i);
15135  }
15136
15137  protected void composeRiskEvidenceSynthesisRiskEvidenceSynthesisSampleSizeComponent(Complex parent, String parentType,
15138      String name, RiskEvidenceSynthesis.RiskEvidenceSynthesisSampleSizeComponent element, int index) {
15139    if (element == null)
15140      return;
15141    Complex t;
15142    if (Utilities.noString(parentType))
15143      t = parent;
15144    else {
15145      t = parent.predicate("fhir:" + parentType + '.' + name);
15146    }
15147    composeBackboneElement(t, "sampleSize", name, element, index);
15148    if (element.hasDescriptionElement())
15149      composeString(t, "RiskEvidenceSynthesis", "description", element.getDescriptionElement(), -1);
15150    if (element.hasNumberOfStudiesElement())
15151      composeInteger(t, "RiskEvidenceSynthesis", "numberOfStudies", element.getNumberOfStudiesElement(), -1);
15152    if (element.hasNumberOfParticipantsElement())
15153      composeInteger(t, "RiskEvidenceSynthesis", "numberOfParticipants", element.getNumberOfParticipantsElement(), -1);
15154  }
15155
15156  protected void composeRiskEvidenceSynthesisRiskEvidenceSynthesisRiskEstimateComponent(Complex parent,
15157      String parentType, String name, RiskEvidenceSynthesis.RiskEvidenceSynthesisRiskEstimateComponent element,
15158      int index) {
15159    if (element == null)
15160      return;
15161    Complex t;
15162    if (Utilities.noString(parentType))
15163      t = parent;
15164    else {
15165      t = parent.predicate("fhir:" + parentType + '.' + name);
15166    }
15167    composeBackboneElement(t, "riskEstimate", name, element, index);
15168    if (element.hasDescriptionElement())
15169      composeString(t, "RiskEvidenceSynthesis", "description", element.getDescriptionElement(), -1);
15170    if (element.hasType())
15171      composeCodeableConcept(t, "RiskEvidenceSynthesis", "type", element.getType(), -1);
15172    if (element.hasValueElement())
15173      composeDecimal(t, "RiskEvidenceSynthesis", "value", element.getValueElement(), -1);
15174    if (element.hasUnitOfMeasure())
15175      composeCodeableConcept(t, "RiskEvidenceSynthesis", "unitOfMeasure", element.getUnitOfMeasure(), -1);
15176    if (element.hasDenominatorCountElement())
15177      composeInteger(t, "RiskEvidenceSynthesis", "denominatorCount", element.getDenominatorCountElement(), -1);
15178    if (element.hasNumeratorCountElement())
15179      composeInteger(t, "RiskEvidenceSynthesis", "numeratorCount", element.getNumeratorCountElement(), -1);
15180    for (int i = 0; i < element.getPrecisionEstimate().size(); i++)
15181      composeRiskEvidenceSynthesisRiskEvidenceSynthesisRiskEstimatePrecisionEstimateComponent(t,
15182          "RiskEvidenceSynthesis", "precisionEstimate", element.getPrecisionEstimate().get(i), i);
15183  }
15184
15185  protected void composeRiskEvidenceSynthesisRiskEvidenceSynthesisRiskEstimatePrecisionEstimateComponent(Complex parent,
15186      String parentType, String name,
15187      RiskEvidenceSynthesis.RiskEvidenceSynthesisRiskEstimatePrecisionEstimateComponent element, int index) {
15188    if (element == null)
15189      return;
15190    Complex t;
15191    if (Utilities.noString(parentType))
15192      t = parent;
15193    else {
15194      t = parent.predicate("fhir:" + parentType + '.' + name);
15195    }
15196    composeBackboneElement(t, "precisionEstimate", name, element, index);
15197    if (element.hasType())
15198      composeCodeableConcept(t, "RiskEvidenceSynthesis", "type", element.getType(), -1);
15199    if (element.hasLevelElement())
15200      composeDecimal(t, "RiskEvidenceSynthesis", "level", element.getLevelElement(), -1);
15201    if (element.hasFromElement())
15202      composeDecimal(t, "RiskEvidenceSynthesis", "from", element.getFromElement(), -1);
15203    if (element.hasToElement())
15204      composeDecimal(t, "RiskEvidenceSynthesis", "to", element.getToElement(), -1);
15205  }
15206
15207  protected void composeRiskEvidenceSynthesisRiskEvidenceSynthesisCertaintyComponent(Complex parent, String parentType,
15208      String name, RiskEvidenceSynthesis.RiskEvidenceSynthesisCertaintyComponent element, int index) {
15209    if (element == null)
15210      return;
15211    Complex t;
15212    if (Utilities.noString(parentType))
15213      t = parent;
15214    else {
15215      t = parent.predicate("fhir:" + parentType + '.' + name);
15216    }
15217    composeBackboneElement(t, "certainty", name, element, index);
15218    for (int i = 0; i < element.getRating().size(); i++)
15219      composeCodeableConcept(t, "RiskEvidenceSynthesis", "rating", element.getRating().get(i), i);
15220    for (int i = 0; i < element.getNote().size(); i++)
15221      composeAnnotation(t, "RiskEvidenceSynthesis", "note", element.getNote().get(i), i);
15222    for (int i = 0; i < element.getCertaintySubcomponent().size(); i++)
15223      composeRiskEvidenceSynthesisRiskEvidenceSynthesisCertaintyCertaintySubcomponentComponent(t,
15224          "RiskEvidenceSynthesis", "certaintySubcomponent", element.getCertaintySubcomponent().get(i), i);
15225  }
15226
15227  protected void composeRiskEvidenceSynthesisRiskEvidenceSynthesisCertaintyCertaintySubcomponentComponent(
15228      Complex parent, String parentType, String name,
15229      RiskEvidenceSynthesis.RiskEvidenceSynthesisCertaintyCertaintySubcomponentComponent element, int index) {
15230    if (element == null)
15231      return;
15232    Complex t;
15233    if (Utilities.noString(parentType))
15234      t = parent;
15235    else {
15236      t = parent.predicate("fhir:" + parentType + '.' + name);
15237    }
15238    composeBackboneElement(t, "certaintySubcomponent", name, element, index);
15239    if (element.hasType())
15240      composeCodeableConcept(t, "RiskEvidenceSynthesis", "type", element.getType(), -1);
15241    for (int i = 0; i < element.getRating().size(); i++)
15242      composeCodeableConcept(t, "RiskEvidenceSynthesis", "rating", element.getRating().get(i), i);
15243    for (int i = 0; i < element.getNote().size(); i++)
15244      composeAnnotation(t, "RiskEvidenceSynthesis", "note", element.getNote().get(i), i);
15245  }
15246
15247  protected void composeSchedule(Complex parent, String parentType, String name, Schedule element, int index) {
15248    if (element == null)
15249      return;
15250    Complex t;
15251    if (Utilities.noString(parentType))
15252      t = parent;
15253    else {
15254      t = parent.predicate("fhir:" + parentType + '.' + name);
15255    }
15256    composeDomainResource(t, "Schedule", name, element, index);
15257    for (int i = 0; i < element.getIdentifier().size(); i++)
15258      composeIdentifier(t, "Schedule", "identifier", element.getIdentifier().get(i), i);
15259    if (element.hasActiveElement())
15260      composeBoolean(t, "Schedule", "active", element.getActiveElement(), -1);
15261    for (int i = 0; i < element.getServiceCategory().size(); i++)
15262      composeCodeableConcept(t, "Schedule", "serviceCategory", element.getServiceCategory().get(i), i);
15263    for (int i = 0; i < element.getServiceType().size(); i++)
15264      composeCodeableConcept(t, "Schedule", "serviceType", element.getServiceType().get(i), i);
15265    for (int i = 0; i < element.getSpecialty().size(); i++)
15266      composeCodeableConcept(t, "Schedule", "specialty", element.getSpecialty().get(i), i);
15267    for (int i = 0; i < element.getActor().size(); i++)
15268      composeReference(t, "Schedule", "actor", element.getActor().get(i), i);
15269    if (element.hasPlanningHorizon())
15270      composePeriod(t, "Schedule", "planningHorizon", element.getPlanningHorizon(), -1);
15271    if (element.hasCommentElement())
15272      composeString(t, "Schedule", "comment", element.getCommentElement(), -1);
15273  }
15274
15275  protected void composeSearchParameter(Complex parent, String parentType, String name, SearchParameter element,
15276      int index) {
15277    if (element == null)
15278      return;
15279    Complex t;
15280    if (Utilities.noString(parentType))
15281      t = parent;
15282    else {
15283      t = parent.predicate("fhir:" + parentType + '.' + name);
15284    }
15285    composeDomainResource(t, "SearchParameter", name, element, index);
15286    if (element.hasUrlElement())
15287      composeUri(t, "SearchParameter", "url", element.getUrlElement(), -1);
15288    if (element.hasVersionElement())
15289      composeString(t, "SearchParameter", "version", element.getVersionElement(), -1);
15290    if (element.hasNameElement())
15291      composeString(t, "SearchParameter", "name", element.getNameElement(), -1);
15292    if (element.hasDerivedFromElement())
15293      composeCanonical(t, "SearchParameter", "derivedFrom", element.getDerivedFromElement(), -1);
15294    if (element.hasStatusElement())
15295      composeEnum(t, "SearchParameter", "status", element.getStatusElement(), -1);
15296    if (element.hasExperimentalElement())
15297      composeBoolean(t, "SearchParameter", "experimental", element.getExperimentalElement(), -1);
15298    if (element.hasDateElement())
15299      composeDateTime(t, "SearchParameter", "date", element.getDateElement(), -1);
15300    if (element.hasPublisherElement())
15301      composeString(t, "SearchParameter", "publisher", element.getPublisherElement(), -1);
15302    for (int i = 0; i < element.getContact().size(); i++)
15303      composeContactDetail(t, "SearchParameter", "contact", element.getContact().get(i), i);
15304    if (element.hasDescriptionElement())
15305      composeMarkdown(t, "SearchParameter", "description", element.getDescriptionElement(), -1);
15306    for (int i = 0; i < element.getUseContext().size(); i++)
15307      composeUsageContext(t, "SearchParameter", "useContext", element.getUseContext().get(i), i);
15308    for (int i = 0; i < element.getJurisdiction().size(); i++)
15309      composeCodeableConcept(t, "SearchParameter", "jurisdiction", element.getJurisdiction().get(i), i);
15310    if (element.hasPurposeElement())
15311      composeMarkdown(t, "SearchParameter", "purpose", element.getPurposeElement(), -1);
15312    if (element.hasCodeElement())
15313      composeCode(t, "SearchParameter", "code", element.getCodeElement(), -1);
15314    for (int i = 0; i < element.getBase().size(); i++)
15315      composeCode(t, "SearchParameter", "base", element.getBase().get(i), i);
15316    if (element.hasTypeElement())
15317      composeEnum(t, "SearchParameter", "type", element.getTypeElement(), -1);
15318    if (element.hasExpressionElement())
15319      composeString(t, "SearchParameter", "expression", element.getExpressionElement(), -1);
15320    if (element.hasXpathElement())
15321      composeString(t, "SearchParameter", "xpath", element.getXpathElement(), -1);
15322    if (element.hasXpathUsageElement())
15323      composeEnum(t, "SearchParameter", "xpathUsage", element.getXpathUsageElement(), -1);
15324    for (int i = 0; i < element.getTarget().size(); i++)
15325      composeCode(t, "SearchParameter", "target", element.getTarget().get(i), i);
15326    if (element.hasMultipleOrElement())
15327      composeBoolean(t, "SearchParameter", "multipleOr", element.getMultipleOrElement(), -1);
15328    if (element.hasMultipleAndElement())
15329      composeBoolean(t, "SearchParameter", "multipleAnd", element.getMultipleAndElement(), -1);
15330    for (int i = 0; i < element.getComparator().size(); i++)
15331      composeEnum(t, "SearchParameter", "comparator", element.getComparator().get(i), i);
15332    for (int i = 0; i < element.getModifier().size(); i++)
15333      composeEnum(t, "SearchParameter", "modifier", element.getModifier().get(i), i);
15334    for (int i = 0; i < element.getChain().size(); i++)
15335      composeString(t, "SearchParameter", "chain", element.getChain().get(i), i);
15336    for (int i = 0; i < element.getComponent().size(); i++)
15337      composeSearchParameterSearchParameterComponentComponent(t, "SearchParameter", "component",
15338          element.getComponent().get(i), i);
15339  }
15340
15341  protected void composeSearchParameterSearchParameterComponentComponent(Complex parent, String parentType, String name,
15342      SearchParameter.SearchParameterComponentComponent element, int index) {
15343    if (element == null)
15344      return;
15345    Complex t;
15346    if (Utilities.noString(parentType))
15347      t = parent;
15348    else {
15349      t = parent.predicate("fhir:" + parentType + '.' + name);
15350    }
15351    composeBackboneElement(t, "component", name, element, index);
15352    if (element.hasDefinitionElement())
15353      composeCanonical(t, "SearchParameter", "definition", element.getDefinitionElement(), -1);
15354    if (element.hasExpressionElement())
15355      composeString(t, "SearchParameter", "expression", element.getExpressionElement(), -1);
15356  }
15357
15358  protected void composeServiceRequest(Complex parent, String parentType, String name, ServiceRequest element,
15359      int index) {
15360    if (element == null)
15361      return;
15362    Complex t;
15363    if (Utilities.noString(parentType))
15364      t = parent;
15365    else {
15366      t = parent.predicate("fhir:" + parentType + '.' + name);
15367    }
15368    composeDomainResource(t, "ServiceRequest", name, element, index);
15369    for (int i = 0; i < element.getIdentifier().size(); i++)
15370      composeIdentifier(t, "ServiceRequest", "identifier", element.getIdentifier().get(i), i);
15371    for (int i = 0; i < element.getInstantiatesCanonical().size(); i++)
15372      composeCanonical(t, "ServiceRequest", "instantiatesCanonical", element.getInstantiatesCanonical().get(i), i);
15373    for (int i = 0; i < element.getInstantiatesUri().size(); i++)
15374      composeUri(t, "ServiceRequest", "instantiatesUri", element.getInstantiatesUri().get(i), i);
15375    for (int i = 0; i < element.getBasedOn().size(); i++)
15376      composeReference(t, "ServiceRequest", "basedOn", element.getBasedOn().get(i), i);
15377    for (int i = 0; i < element.getReplaces().size(); i++)
15378      composeReference(t, "ServiceRequest", "replaces", element.getReplaces().get(i), i);
15379    if (element.hasRequisition())
15380      composeIdentifier(t, "ServiceRequest", "requisition", element.getRequisition(), -1);
15381    if (element.hasStatusElement())
15382      composeEnum(t, "ServiceRequest", "status", element.getStatusElement(), -1);
15383    if (element.hasIntentElement())
15384      composeEnum(t, "ServiceRequest", "intent", element.getIntentElement(), -1);
15385    for (int i = 0; i < element.getCategory().size(); i++)
15386      composeCodeableConcept(t, "ServiceRequest", "category", element.getCategory().get(i), i);
15387    if (element.hasPriorityElement())
15388      composeEnum(t, "ServiceRequest", "priority", element.getPriorityElement(), -1);
15389    if (element.hasDoNotPerformElement())
15390      composeBoolean(t, "ServiceRequest", "doNotPerform", element.getDoNotPerformElement(), -1);
15391    if (element.hasCode())
15392      composeCodeableConcept(t, "ServiceRequest", "code", element.getCode(), -1);
15393    for (int i = 0; i < element.getOrderDetail().size(); i++)
15394      composeCodeableConcept(t, "ServiceRequest", "orderDetail", element.getOrderDetail().get(i), i);
15395    if (element.hasQuantity())
15396      composeType(t, "ServiceRequest", "quantity", element.getQuantity(), -1);
15397    if (element.hasSubject())
15398      composeReference(t, "ServiceRequest", "subject", element.getSubject(), -1);
15399    if (element.hasEncounter())
15400      composeReference(t, "ServiceRequest", "encounter", element.getEncounter(), -1);
15401    if (element.hasOccurrence())
15402      composeType(t, "ServiceRequest", "occurrence", element.getOccurrence(), -1);
15403    if (element.hasAsNeeded())
15404      composeType(t, "ServiceRequest", "asNeeded", element.getAsNeeded(), -1);
15405    if (element.hasAuthoredOnElement())
15406      composeDateTime(t, "ServiceRequest", "authoredOn", element.getAuthoredOnElement(), -1);
15407    if (element.hasRequester())
15408      composeReference(t, "ServiceRequest", "requester", element.getRequester(), -1);
15409    if (element.hasPerformerType())
15410      composeCodeableConcept(t, "ServiceRequest", "performerType", element.getPerformerType(), -1);
15411    for (int i = 0; i < element.getPerformer().size(); i++)
15412      composeReference(t, "ServiceRequest", "performer", element.getPerformer().get(i), i);
15413    for (int i = 0; i < element.getLocationCode().size(); i++)
15414      composeCodeableConcept(t, "ServiceRequest", "locationCode", element.getLocationCode().get(i), i);
15415    for (int i = 0; i < element.getLocationReference().size(); i++)
15416      composeReference(t, "ServiceRequest", "locationReference", element.getLocationReference().get(i), i);
15417    for (int i = 0; i < element.getReasonCode().size(); i++)
15418      composeCodeableConcept(t, "ServiceRequest", "reasonCode", element.getReasonCode().get(i), i);
15419    for (int i = 0; i < element.getReasonReference().size(); i++)
15420      composeReference(t, "ServiceRequest", "reasonReference", element.getReasonReference().get(i), i);
15421    for (int i = 0; i < element.getInsurance().size(); i++)
15422      composeReference(t, "ServiceRequest", "insurance", element.getInsurance().get(i), i);
15423    for (int i = 0; i < element.getSupportingInfo().size(); i++)
15424      composeReference(t, "ServiceRequest", "supportingInfo", element.getSupportingInfo().get(i), i);
15425    for (int i = 0; i < element.getSpecimen().size(); i++)
15426      composeReference(t, "ServiceRequest", "specimen", element.getSpecimen().get(i), i);
15427    for (int i = 0; i < element.getBodySite().size(); i++)
15428      composeCodeableConcept(t, "ServiceRequest", "bodySite", element.getBodySite().get(i), i);
15429    for (int i = 0; i < element.getNote().size(); i++)
15430      composeAnnotation(t, "ServiceRequest", "note", element.getNote().get(i), i);
15431    if (element.hasPatientInstructionElement())
15432      composeString(t, "ServiceRequest", "patientInstruction", element.getPatientInstructionElement(), -1);
15433    for (int i = 0; i < element.getRelevantHistory().size(); i++)
15434      composeReference(t, "ServiceRequest", "relevantHistory", element.getRelevantHistory().get(i), i);
15435  }
15436
15437  protected void composeSlot(Complex parent, String parentType, String name, Slot element, int index) {
15438    if (element == null)
15439      return;
15440    Complex t;
15441    if (Utilities.noString(parentType))
15442      t = parent;
15443    else {
15444      t = parent.predicate("fhir:" + parentType + '.' + name);
15445    }
15446    composeDomainResource(t, "Slot", name, element, index);
15447    for (int i = 0; i < element.getIdentifier().size(); i++)
15448      composeIdentifier(t, "Slot", "identifier", element.getIdentifier().get(i), i);
15449    for (int i = 0; i < element.getServiceCategory().size(); i++)
15450      composeCodeableConcept(t, "Slot", "serviceCategory", element.getServiceCategory().get(i), i);
15451    for (int i = 0; i < element.getServiceType().size(); i++)
15452      composeCodeableConcept(t, "Slot", "serviceType", element.getServiceType().get(i), i);
15453    for (int i = 0; i < element.getSpecialty().size(); i++)
15454      composeCodeableConcept(t, "Slot", "specialty", element.getSpecialty().get(i), i);
15455    if (element.hasAppointmentType())
15456      composeCodeableConcept(t, "Slot", "appointmentType", element.getAppointmentType(), -1);
15457    if (element.hasSchedule())
15458      composeReference(t, "Slot", "schedule", element.getSchedule(), -1);
15459    if (element.hasStatusElement())
15460      composeEnum(t, "Slot", "status", element.getStatusElement(), -1);
15461    if (element.hasStartElement())
15462      composeInstant(t, "Slot", "start", element.getStartElement(), -1);
15463    if (element.hasEndElement())
15464      composeInstant(t, "Slot", "end", element.getEndElement(), -1);
15465    if (element.hasOverbookedElement())
15466      composeBoolean(t, "Slot", "overbooked", element.getOverbookedElement(), -1);
15467    if (element.hasCommentElement())
15468      composeString(t, "Slot", "comment", element.getCommentElement(), -1);
15469  }
15470
15471  protected void composeSpecimen(Complex parent, String parentType, String name, Specimen element, int index) {
15472    if (element == null)
15473      return;
15474    Complex t;
15475    if (Utilities.noString(parentType))
15476      t = parent;
15477    else {
15478      t = parent.predicate("fhir:" + parentType + '.' + name);
15479    }
15480    composeDomainResource(t, "Specimen", name, element, index);
15481    for (int i = 0; i < element.getIdentifier().size(); i++)
15482      composeIdentifier(t, "Specimen", "identifier", element.getIdentifier().get(i), i);
15483    if (element.hasAccessionIdentifier())
15484      composeIdentifier(t, "Specimen", "accessionIdentifier", element.getAccessionIdentifier(), -1);
15485    if (element.hasStatusElement())
15486      composeEnum(t, "Specimen", "status", element.getStatusElement(), -1);
15487    if (element.hasType())
15488      composeCodeableConcept(t, "Specimen", "type", element.getType(), -1);
15489    if (element.hasSubject())
15490      composeReference(t, "Specimen", "subject", element.getSubject(), -1);
15491    if (element.hasReceivedTimeElement())
15492      composeDateTime(t, "Specimen", "receivedTime", element.getReceivedTimeElement(), -1);
15493    for (int i = 0; i < element.getParent().size(); i++)
15494      composeReference(t, "Specimen", "parent", element.getParent().get(i), i);
15495    for (int i = 0; i < element.getRequest().size(); i++)
15496      composeReference(t, "Specimen", "request", element.getRequest().get(i), i);
15497    if (element.hasCollection())
15498      composeSpecimenSpecimenCollectionComponent(t, "Specimen", "collection", element.getCollection(), -1);
15499    for (int i = 0; i < element.getProcessing().size(); i++)
15500      composeSpecimenSpecimenProcessingComponent(t, "Specimen", "processing", element.getProcessing().get(i), i);
15501    for (int i = 0; i < element.getContainer().size(); i++)
15502      composeSpecimenSpecimenContainerComponent(t, "Specimen", "container", element.getContainer().get(i), i);
15503    for (int i = 0; i < element.getCondition().size(); i++)
15504      composeCodeableConcept(t, "Specimen", "condition", element.getCondition().get(i), i);
15505    for (int i = 0; i < element.getNote().size(); i++)
15506      composeAnnotation(t, "Specimen", "note", element.getNote().get(i), i);
15507  }
15508
15509  protected void composeSpecimenSpecimenCollectionComponent(Complex parent, String parentType, String name,
15510      Specimen.SpecimenCollectionComponent element, int index) {
15511    if (element == null)
15512      return;
15513    Complex t;
15514    if (Utilities.noString(parentType))
15515      t = parent;
15516    else {
15517      t = parent.predicate("fhir:" + parentType + '.' + name);
15518    }
15519    composeBackboneElement(t, "collection", name, element, index);
15520    if (element.hasCollector())
15521      composeReference(t, "Specimen", "collector", element.getCollector(), -1);
15522    if (element.hasCollected())
15523      composeType(t, "Specimen", "collected", element.getCollected(), -1);
15524    if (element.hasDuration())
15525      composeDuration(t, "Specimen", "duration", element.getDuration(), -1);
15526    if (element.hasQuantity())
15527      composeQuantity(t, "Specimen", "quantity", element.getQuantity(), -1);
15528    if (element.hasMethod())
15529      composeCodeableConcept(t, "Specimen", "method", element.getMethod(), -1);
15530    if (element.hasBodySite())
15531      composeCodeableConcept(t, "Specimen", "bodySite", element.getBodySite(), -1);
15532    if (element.hasFastingStatus())
15533      composeType(t, "Specimen", "fastingStatus", element.getFastingStatus(), -1);
15534  }
15535
15536  protected void composeSpecimenSpecimenProcessingComponent(Complex parent, String parentType, String name,
15537      Specimen.SpecimenProcessingComponent element, int index) {
15538    if (element == null)
15539      return;
15540    Complex t;
15541    if (Utilities.noString(parentType))
15542      t = parent;
15543    else {
15544      t = parent.predicate("fhir:" + parentType + '.' + name);
15545    }
15546    composeBackboneElement(t, "processing", name, element, index);
15547    if (element.hasDescriptionElement())
15548      composeString(t, "Specimen", "description", element.getDescriptionElement(), -1);
15549    if (element.hasProcedure())
15550      composeCodeableConcept(t, "Specimen", "procedure", element.getProcedure(), -1);
15551    for (int i = 0; i < element.getAdditive().size(); i++)
15552      composeReference(t, "Specimen", "additive", element.getAdditive().get(i), i);
15553    if (element.hasTime())
15554      composeType(t, "Specimen", "time", element.getTime(), -1);
15555  }
15556
15557  protected void composeSpecimenSpecimenContainerComponent(Complex parent, String parentType, String name,
15558      Specimen.SpecimenContainerComponent element, int index) {
15559    if (element == null)
15560      return;
15561    Complex t;
15562    if (Utilities.noString(parentType))
15563      t = parent;
15564    else {
15565      t = parent.predicate("fhir:" + parentType + '.' + name);
15566    }
15567    composeBackboneElement(t, "container", name, element, index);
15568    for (int i = 0; i < element.getIdentifier().size(); i++)
15569      composeIdentifier(t, "Specimen", "identifier", element.getIdentifier().get(i), i);
15570    if (element.hasDescriptionElement())
15571      composeString(t, "Specimen", "description", element.getDescriptionElement(), -1);
15572    if (element.hasType())
15573      composeCodeableConcept(t, "Specimen", "type", element.getType(), -1);
15574    if (element.hasCapacity())
15575      composeQuantity(t, "Specimen", "capacity", element.getCapacity(), -1);
15576    if (element.hasSpecimenQuantity())
15577      composeQuantity(t, "Specimen", "specimenQuantity", element.getSpecimenQuantity(), -1);
15578    if (element.hasAdditive())
15579      composeType(t, "Specimen", "additive", element.getAdditive(), -1);
15580  }
15581
15582  protected void composeSpecimenDefinition(Complex parent, String parentType, String name, SpecimenDefinition element,
15583      int index) {
15584    if (element == null)
15585      return;
15586    Complex t;
15587    if (Utilities.noString(parentType))
15588      t = parent;
15589    else {
15590      t = parent.predicate("fhir:" + parentType + '.' + name);
15591    }
15592    composeDomainResource(t, "SpecimenDefinition", name, element, index);
15593    if (element.hasIdentifier())
15594      composeIdentifier(t, "SpecimenDefinition", "identifier", element.getIdentifier(), -1);
15595    if (element.hasTypeCollected())
15596      composeCodeableConcept(t, "SpecimenDefinition", "typeCollected", element.getTypeCollected(), -1);
15597    for (int i = 0; i < element.getPatientPreparation().size(); i++)
15598      composeCodeableConcept(t, "SpecimenDefinition", "patientPreparation", element.getPatientPreparation().get(i), i);
15599    if (element.hasTimeAspectElement())
15600      composeString(t, "SpecimenDefinition", "timeAspect", element.getTimeAspectElement(), -1);
15601    for (int i = 0; i < element.getCollection().size(); i++)
15602      composeCodeableConcept(t, "SpecimenDefinition", "collection", element.getCollection().get(i), i);
15603    for (int i = 0; i < element.getTypeTested().size(); i++)
15604      composeSpecimenDefinitionSpecimenDefinitionTypeTestedComponent(t, "SpecimenDefinition", "typeTested",
15605          element.getTypeTested().get(i), i);
15606  }
15607
15608  protected void composeSpecimenDefinitionSpecimenDefinitionTypeTestedComponent(Complex parent, String parentType,
15609      String name, SpecimenDefinition.SpecimenDefinitionTypeTestedComponent element, int index) {
15610    if (element == null)
15611      return;
15612    Complex t;
15613    if (Utilities.noString(parentType))
15614      t = parent;
15615    else {
15616      t = parent.predicate("fhir:" + parentType + '.' + name);
15617    }
15618    composeBackboneElement(t, "typeTested", name, element, index);
15619    if (element.hasIsDerivedElement())
15620      composeBoolean(t, "SpecimenDefinition", "isDerived", element.getIsDerivedElement(), -1);
15621    if (element.hasType())
15622      composeCodeableConcept(t, "SpecimenDefinition", "type", element.getType(), -1);
15623    if (element.hasPreferenceElement())
15624      composeEnum(t, "SpecimenDefinition", "preference", element.getPreferenceElement(), -1);
15625    if (element.hasContainer())
15626      composeSpecimenDefinitionSpecimenDefinitionTypeTestedContainerComponent(t, "SpecimenDefinition", "container",
15627          element.getContainer(), -1);
15628    if (element.hasRequirementElement())
15629      composeString(t, "SpecimenDefinition", "requirement", element.getRequirementElement(), -1);
15630    if (element.hasRetentionTime())
15631      composeDuration(t, "SpecimenDefinition", "retentionTime", element.getRetentionTime(), -1);
15632    for (int i = 0; i < element.getRejectionCriterion().size(); i++)
15633      composeCodeableConcept(t, "SpecimenDefinition", "rejectionCriterion", element.getRejectionCriterion().get(i), i);
15634    for (int i = 0; i < element.getHandling().size(); i++)
15635      composeSpecimenDefinitionSpecimenDefinitionTypeTestedHandlingComponent(t, "SpecimenDefinition", "handling",
15636          element.getHandling().get(i), i);
15637  }
15638
15639  protected void composeSpecimenDefinitionSpecimenDefinitionTypeTestedContainerComponent(Complex parent,
15640      String parentType, String name, SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent element,
15641      int index) {
15642    if (element == null)
15643      return;
15644    Complex t;
15645    if (Utilities.noString(parentType))
15646      t = parent;
15647    else {
15648      t = parent.predicate("fhir:" + parentType + '.' + name);
15649    }
15650    composeBackboneElement(t, "container", name, element, index);
15651    if (element.hasMaterial())
15652      composeCodeableConcept(t, "SpecimenDefinition", "material", element.getMaterial(), -1);
15653    if (element.hasType())
15654      composeCodeableConcept(t, "SpecimenDefinition", "type", element.getType(), -1);
15655    if (element.hasCap())
15656      composeCodeableConcept(t, "SpecimenDefinition", "cap", element.getCap(), -1);
15657    if (element.hasDescriptionElement())
15658      composeString(t, "SpecimenDefinition", "description", element.getDescriptionElement(), -1);
15659    if (element.hasCapacity())
15660      composeQuantity(t, "SpecimenDefinition", "capacity", element.getCapacity(), -1);
15661    if (element.hasMinimumVolume())
15662      composeType(t, "SpecimenDefinition", "minimumVolume", element.getMinimumVolume(), -1);
15663    for (int i = 0; i < element.getAdditive().size(); i++)
15664      composeSpecimenDefinitionSpecimenDefinitionTypeTestedContainerAdditiveComponent(t, "SpecimenDefinition",
15665          "additive", element.getAdditive().get(i), i);
15666    if (element.hasPreparationElement())
15667      composeString(t, "SpecimenDefinition", "preparation", element.getPreparationElement(), -1);
15668  }
15669
15670  protected void composeSpecimenDefinitionSpecimenDefinitionTypeTestedContainerAdditiveComponent(Complex parent,
15671      String parentType, String name, SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent element,
15672      int index) {
15673    if (element == null)
15674      return;
15675    Complex t;
15676    if (Utilities.noString(parentType))
15677      t = parent;
15678    else {
15679      t = parent.predicate("fhir:" + parentType + '.' + name);
15680    }
15681    composeBackboneElement(t, "additive", name, element, index);
15682    if (element.hasAdditive())
15683      composeType(t, "SpecimenDefinition", "additive", element.getAdditive(), -1);
15684  }
15685
15686  protected void composeSpecimenDefinitionSpecimenDefinitionTypeTestedHandlingComponent(Complex parent,
15687      String parentType, String name, SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent element,
15688      int index) {
15689    if (element == null)
15690      return;
15691    Complex t;
15692    if (Utilities.noString(parentType))
15693      t = parent;
15694    else {
15695      t = parent.predicate("fhir:" + parentType + '.' + name);
15696    }
15697    composeBackboneElement(t, "handling", name, element, index);
15698    if (element.hasTemperatureQualifier())
15699      composeCodeableConcept(t, "SpecimenDefinition", "temperatureQualifier", element.getTemperatureQualifier(), -1);
15700    if (element.hasTemperatureRange())
15701      composeRange(t, "SpecimenDefinition", "temperatureRange", element.getTemperatureRange(), -1);
15702    if (element.hasMaxDuration())
15703      composeDuration(t, "SpecimenDefinition", "maxDuration", element.getMaxDuration(), -1);
15704    if (element.hasInstructionElement())
15705      composeString(t, "SpecimenDefinition", "instruction", element.getInstructionElement(), -1);
15706  }
15707
15708  protected void composeStructureDefinition(Complex parent, String parentType, String name, StructureDefinition element,
15709      int index) {
15710    if (element == null)
15711      return;
15712    Complex t;
15713    if (Utilities.noString(parentType))
15714      t = parent;
15715    else {
15716      t = parent.predicate("fhir:" + parentType + '.' + name);
15717    }
15718    composeDomainResource(t, "StructureDefinition", name, element, index);
15719    if (element.hasUrlElement())
15720      composeUri(t, "StructureDefinition", "url", element.getUrlElement(), -1);
15721    for (int i = 0; i < element.getIdentifier().size(); i++)
15722      composeIdentifier(t, "StructureDefinition", "identifier", element.getIdentifier().get(i), i);
15723    if (element.hasVersionElement())
15724      composeString(t, "StructureDefinition", "version", element.getVersionElement(), -1);
15725    if (element.hasNameElement())
15726      composeString(t, "StructureDefinition", "name", element.getNameElement(), -1);
15727    if (element.hasTitleElement())
15728      composeString(t, "StructureDefinition", "title", element.getTitleElement(), -1);
15729    if (element.hasStatusElement())
15730      composeEnum(t, "StructureDefinition", "status", element.getStatusElement(), -1);
15731    if (element.hasExperimentalElement())
15732      composeBoolean(t, "StructureDefinition", "experimental", element.getExperimentalElement(), -1);
15733    if (element.hasDateElement())
15734      composeDateTime(t, "StructureDefinition", "date", element.getDateElement(), -1);
15735    if (element.hasPublisherElement())
15736      composeString(t, "StructureDefinition", "publisher", element.getPublisherElement(), -1);
15737    for (int i = 0; i < element.getContact().size(); i++)
15738      composeContactDetail(t, "StructureDefinition", "contact", element.getContact().get(i), i);
15739    if (element.hasDescriptionElement())
15740      composeMarkdown(t, "StructureDefinition", "description", element.getDescriptionElement(), -1);
15741    for (int i = 0; i < element.getUseContext().size(); i++)
15742      composeUsageContext(t, "StructureDefinition", "useContext", element.getUseContext().get(i), i);
15743    for (int i = 0; i < element.getJurisdiction().size(); i++)
15744      composeCodeableConcept(t, "StructureDefinition", "jurisdiction", element.getJurisdiction().get(i), i);
15745    if (element.hasPurposeElement())
15746      composeMarkdown(t, "StructureDefinition", "purpose", element.getPurposeElement(), -1);
15747    if (element.hasCopyrightElement())
15748      composeMarkdown(t, "StructureDefinition", "copyright", element.getCopyrightElement(), -1);
15749    for (int i = 0; i < element.getKeyword().size(); i++)
15750      composeCoding(t, "StructureDefinition", "keyword", element.getKeyword().get(i), i);
15751    if (element.hasFhirVersionElement())
15752      composeEnum(t, "StructureDefinition", "fhirVersion", element.getFhirVersionElement(), -1);
15753    for (int i = 0; i < element.getMapping().size(); i++)
15754      composeStructureDefinitionStructureDefinitionMappingComponent(t, "StructureDefinition", "mapping",
15755          element.getMapping().get(i), i);
15756    if (element.hasKindElement())
15757      composeEnum(t, "StructureDefinition", "kind", element.getKindElement(), -1);
15758    if (element.hasAbstractElement())
15759      composeBoolean(t, "StructureDefinition", "abstract", element.getAbstractElement(), -1);
15760    for (int i = 0; i < element.getContext().size(); i++)
15761      composeStructureDefinitionStructureDefinitionContextComponent(t, "StructureDefinition", "context",
15762          element.getContext().get(i), i);
15763    for (int i = 0; i < element.getContextInvariant().size(); i++)
15764      composeString(t, "StructureDefinition", "contextInvariant", element.getContextInvariant().get(i), i);
15765    if (element.hasTypeElement())
15766      composeUri(t, "StructureDefinition", "type", element.getTypeElement(), -1);
15767    if (element.hasBaseDefinitionElement())
15768      composeCanonical(t, "StructureDefinition", "baseDefinition", element.getBaseDefinitionElement(), -1);
15769    if (element.hasDerivationElement())
15770      composeEnum(t, "StructureDefinition", "derivation", element.getDerivationElement(), -1);
15771    if (element.hasSnapshot())
15772      composeStructureDefinitionStructureDefinitionSnapshotComponent(t, "StructureDefinition", "snapshot",
15773          element.getSnapshot(), -1);
15774    if (element.hasDifferential())
15775      composeStructureDefinitionStructureDefinitionDifferentialComponent(t, "StructureDefinition", "differential",
15776          element.getDifferential(), -1);
15777  }
15778
15779  protected void composeStructureDefinitionStructureDefinitionMappingComponent(Complex parent, String parentType,
15780      String name, StructureDefinition.StructureDefinitionMappingComponent element, int index) {
15781    if (element == null)
15782      return;
15783    Complex t;
15784    if (Utilities.noString(parentType))
15785      t = parent;
15786    else {
15787      t = parent.predicate("fhir:" + parentType + '.' + name);
15788    }
15789    composeBackboneElement(t, "mapping", name, element, index);
15790    if (element.hasIdentityElement())
15791      composeId(t, "StructureDefinition", "identity", element.getIdentityElement(), -1);
15792    if (element.hasUriElement())
15793      composeUri(t, "StructureDefinition", "uri", element.getUriElement(), -1);
15794    if (element.hasNameElement())
15795      composeString(t, "StructureDefinition", "name", element.getNameElement(), -1);
15796    if (element.hasCommentElement())
15797      composeString(t, "StructureDefinition", "comment", element.getCommentElement(), -1);
15798  }
15799
15800  protected void composeStructureDefinitionStructureDefinitionContextComponent(Complex parent, String parentType,
15801      String name, StructureDefinition.StructureDefinitionContextComponent element, int index) {
15802    if (element == null)
15803      return;
15804    Complex t;
15805    if (Utilities.noString(parentType))
15806      t = parent;
15807    else {
15808      t = parent.predicate("fhir:" + parentType + '.' + name);
15809    }
15810    composeBackboneElement(t, "context", name, element, index);
15811    if (element.hasTypeElement())
15812      composeEnum(t, "StructureDefinition", "type", element.getTypeElement(), -1);
15813    if (element.hasExpressionElement())
15814      composeString(t, "StructureDefinition", "expression", element.getExpressionElement(), -1);
15815  }
15816
15817  protected void composeStructureDefinitionStructureDefinitionSnapshotComponent(Complex parent, String parentType,
15818      String name, StructureDefinition.StructureDefinitionSnapshotComponent element, int index) {
15819    if (element == null)
15820      return;
15821    Complex t;
15822    if (Utilities.noString(parentType))
15823      t = parent;
15824    else {
15825      t = parent.predicate("fhir:" + parentType + '.' + name);
15826    }
15827    composeBackboneElement(t, "snapshot", name, element, index);
15828    for (int i = 0; i < element.getElement().size(); i++)
15829      composeElementDefinition(t, "StructureDefinition", "element", element.getElement().get(i), i);
15830  }
15831
15832  protected void composeStructureDefinitionStructureDefinitionDifferentialComponent(Complex parent, String parentType,
15833      String name, StructureDefinition.StructureDefinitionDifferentialComponent element, int index) {
15834    if (element == null)
15835      return;
15836    Complex t;
15837    if (Utilities.noString(parentType))
15838      t = parent;
15839    else {
15840      t = parent.predicate("fhir:" + parentType + '.' + name);
15841    }
15842    composeBackboneElement(t, "differential", name, element, index);
15843    for (int i = 0; i < element.getElement().size(); i++)
15844      composeElementDefinition(t, "StructureDefinition", "element", element.getElement().get(i), i);
15845  }
15846
15847  protected void composeStructureMap(Complex parent, String parentType, String name, StructureMap element, int index) {
15848    if (element == null)
15849      return;
15850    Complex t;
15851    if (Utilities.noString(parentType))
15852      t = parent;
15853    else {
15854      t = parent.predicate("fhir:" + parentType + '.' + name);
15855    }
15856    composeDomainResource(t, "StructureMap", name, element, index);
15857    if (element.hasUrlElement())
15858      composeUri(t, "StructureMap", "url", element.getUrlElement(), -1);
15859    for (int i = 0; i < element.getIdentifier().size(); i++)
15860      composeIdentifier(t, "StructureMap", "identifier", element.getIdentifier().get(i), i);
15861    if (element.hasVersionElement())
15862      composeString(t, "StructureMap", "version", element.getVersionElement(), -1);
15863    if (element.hasNameElement())
15864      composeString(t, "StructureMap", "name", element.getNameElement(), -1);
15865    if (element.hasTitleElement())
15866      composeString(t, "StructureMap", "title", element.getTitleElement(), -1);
15867    if (element.hasStatusElement())
15868      composeEnum(t, "StructureMap", "status", element.getStatusElement(), -1);
15869    if (element.hasExperimentalElement())
15870      composeBoolean(t, "StructureMap", "experimental", element.getExperimentalElement(), -1);
15871    if (element.hasDateElement())
15872      composeDateTime(t, "StructureMap", "date", element.getDateElement(), -1);
15873    if (element.hasPublisherElement())
15874      composeString(t, "StructureMap", "publisher", element.getPublisherElement(), -1);
15875    for (int i = 0; i < element.getContact().size(); i++)
15876      composeContactDetail(t, "StructureMap", "contact", element.getContact().get(i), i);
15877    if (element.hasDescriptionElement())
15878      composeMarkdown(t, "StructureMap", "description", element.getDescriptionElement(), -1);
15879    for (int i = 0; i < element.getUseContext().size(); i++)
15880      composeUsageContext(t, "StructureMap", "useContext", element.getUseContext().get(i), i);
15881    for (int i = 0; i < element.getJurisdiction().size(); i++)
15882      composeCodeableConcept(t, "StructureMap", "jurisdiction", element.getJurisdiction().get(i), i);
15883    if (element.hasPurposeElement())
15884      composeMarkdown(t, "StructureMap", "purpose", element.getPurposeElement(), -1);
15885    if (element.hasCopyrightElement())
15886      composeMarkdown(t, "StructureMap", "copyright", element.getCopyrightElement(), -1);
15887    for (int i = 0; i < element.getStructure().size(); i++)
15888      composeStructureMapStructureMapStructureComponent(t, "StructureMap", "structure", element.getStructure().get(i),
15889          i);
15890    for (int i = 0; i < element.getImport().size(); i++)
15891      composeCanonical(t, "StructureMap", "import", element.getImport().get(i), i);
15892    for (int i = 0; i < element.getGroup().size(); i++)
15893      composeStructureMapStructureMapGroupComponent(t, "StructureMap", "group", element.getGroup().get(i), i);
15894  }
15895
15896  protected void composeStructureMapStructureMapStructureComponent(Complex parent, String parentType, String name,
15897      StructureMap.StructureMapStructureComponent element, int index) {
15898    if (element == null)
15899      return;
15900    Complex t;
15901    if (Utilities.noString(parentType))
15902      t = parent;
15903    else {
15904      t = parent.predicate("fhir:" + parentType + '.' + name);
15905    }
15906    composeBackboneElement(t, "structure", name, element, index);
15907    if (element.hasUrlElement())
15908      composeCanonical(t, "StructureMap", "url", element.getUrlElement(), -1);
15909    if (element.hasModeElement())
15910      composeEnum(t, "StructureMap", "mode", element.getModeElement(), -1);
15911    if (element.hasAliasElement())
15912      composeString(t, "StructureMap", "alias", element.getAliasElement(), -1);
15913    if (element.hasDocumentationElement())
15914      composeString(t, "StructureMap", "documentation", element.getDocumentationElement(), -1);
15915  }
15916
15917  protected void composeStructureMapStructureMapGroupComponent(Complex parent, String parentType, String name,
15918      StructureMap.StructureMapGroupComponent element, int index) {
15919    if (element == null)
15920      return;
15921    Complex t;
15922    if (Utilities.noString(parentType))
15923      t = parent;
15924    else {
15925      t = parent.predicate("fhir:" + parentType + '.' + name);
15926    }
15927    composeBackboneElement(t, "group", name, element, index);
15928    if (element.hasNameElement())
15929      composeId(t, "StructureMap", "name", element.getNameElement(), -1);
15930    if (element.hasExtendsElement())
15931      composeId(t, "StructureMap", "extends", element.getExtendsElement(), -1);
15932    if (element.hasTypeModeElement())
15933      composeEnum(t, "StructureMap", "typeMode", element.getTypeModeElement(), -1);
15934    if (element.hasDocumentationElement())
15935      composeString(t, "StructureMap", "documentation", element.getDocumentationElement(), -1);
15936    for (int i = 0; i < element.getInput().size(); i++)
15937      composeStructureMapStructureMapGroupInputComponent(t, "StructureMap", "input", element.getInput().get(i), i);
15938    for (int i = 0; i < element.getRule().size(); i++)
15939      composeStructureMapStructureMapGroupRuleComponent(t, "StructureMap", "rule", element.getRule().get(i), i);
15940  }
15941
15942  protected void composeStructureMapStructureMapGroupInputComponent(Complex parent, String parentType, String name,
15943      StructureMap.StructureMapGroupInputComponent element, int index) {
15944    if (element == null)
15945      return;
15946    Complex t;
15947    if (Utilities.noString(parentType))
15948      t = parent;
15949    else {
15950      t = parent.predicate("fhir:" + parentType + '.' + name);
15951    }
15952    composeBackboneElement(t, "input", name, element, index);
15953    if (element.hasNameElement())
15954      composeId(t, "StructureMap", "name", element.getNameElement(), -1);
15955    if (element.hasTypeElement())
15956      composeString(t, "StructureMap", "type", element.getTypeElement(), -1);
15957    if (element.hasModeElement())
15958      composeEnum(t, "StructureMap", "mode", element.getModeElement(), -1);
15959    if (element.hasDocumentationElement())
15960      composeString(t, "StructureMap", "documentation", element.getDocumentationElement(), -1);
15961  }
15962
15963  protected void composeStructureMapStructureMapGroupRuleComponent(Complex parent, String parentType, String name,
15964      StructureMap.StructureMapGroupRuleComponent element, int index) {
15965    if (element == null)
15966      return;
15967    Complex t;
15968    if (Utilities.noString(parentType))
15969      t = parent;
15970    else {
15971      t = parent.predicate("fhir:" + parentType + '.' + name);
15972    }
15973    composeBackboneElement(t, "rule", name, element, index);
15974    if (element.hasNameElement())
15975      composeId(t, "StructureMap", "name", element.getNameElement(), -1);
15976    for (int i = 0; i < element.getSource().size(); i++)
15977      composeStructureMapStructureMapGroupRuleSourceComponent(t, "StructureMap", "source", element.getSource().get(i),
15978          i);
15979    for (int i = 0; i < element.getTarget().size(); i++)
15980      composeStructureMapStructureMapGroupRuleTargetComponent(t, "StructureMap", "target", element.getTarget().get(i),
15981          i);
15982    for (int i = 0; i < element.getRule().size(); i++)
15983      composeStructureMapStructureMapGroupRuleComponent(t, "StructureMap", "rule", element.getRule().get(i), i);
15984    for (int i = 0; i < element.getDependent().size(); i++)
15985      composeStructureMapStructureMapGroupRuleDependentComponent(t, "StructureMap", "dependent",
15986          element.getDependent().get(i), i);
15987    if (element.hasDocumentationElement())
15988      composeString(t, "StructureMap", "documentation", element.getDocumentationElement(), -1);
15989  }
15990
15991  protected void composeStructureMapStructureMapGroupRuleSourceComponent(Complex parent, String parentType, String name,
15992      StructureMap.StructureMapGroupRuleSourceComponent element, int index) {
15993    if (element == null)
15994      return;
15995    Complex t;
15996    if (Utilities.noString(parentType))
15997      t = parent;
15998    else {
15999      t = parent.predicate("fhir:" + parentType + '.' + name);
16000    }
16001    composeBackboneElement(t, "source", name, element, index);
16002    if (element.hasContextElement())
16003      composeId(t, "StructureMap", "context", element.getContextElement(), -1);
16004    if (element.hasMinElement())
16005      composeInteger(t, "StructureMap", "min", element.getMinElement(), -1);
16006    if (element.hasMaxElement())
16007      composeString(t, "StructureMap", "max", element.getMaxElement(), -1);
16008    if (element.hasTypeElement())
16009      composeString(t, "StructureMap", "type", element.getTypeElement(), -1);
16010    if (element.hasDefaultValue())
16011      composeType(t, "StructureMap", "defaultValue", element.getDefaultValue(), -1);
16012    if (element.hasElementElement())
16013      composeString(t, "StructureMap", "element", element.getElementElement(), -1);
16014    if (element.hasListModeElement())
16015      composeEnum(t, "StructureMap", "listMode", element.getListModeElement(), -1);
16016    if (element.hasVariableElement())
16017      composeId(t, "StructureMap", "variable", element.getVariableElement(), -1);
16018    if (element.hasConditionElement())
16019      composeString(t, "StructureMap", "condition", element.getConditionElement(), -1);
16020    if (element.hasCheckElement())
16021      composeString(t, "StructureMap", "check", element.getCheckElement(), -1);
16022    if (element.hasLogMessageElement())
16023      composeString(t, "StructureMap", "logMessage", element.getLogMessageElement(), -1);
16024  }
16025
16026  protected void composeStructureMapStructureMapGroupRuleTargetComponent(Complex parent, String parentType, String name,
16027      StructureMap.StructureMapGroupRuleTargetComponent element, int index) {
16028    if (element == null)
16029      return;
16030    Complex t;
16031    if (Utilities.noString(parentType))
16032      t = parent;
16033    else {
16034      t = parent.predicate("fhir:" + parentType + '.' + name);
16035    }
16036    composeBackboneElement(t, "target", name, element, index);
16037    if (element.hasContextElement())
16038      composeId(t, "StructureMap", "context", element.getContextElement(), -1);
16039    if (element.hasContextTypeElement())
16040      composeEnum(t, "StructureMap", "contextType", element.getContextTypeElement(), -1);
16041    if (element.hasElementElement())
16042      composeString(t, "StructureMap", "element", element.getElementElement(), -1);
16043    if (element.hasVariableElement())
16044      composeId(t, "StructureMap", "variable", element.getVariableElement(), -1);
16045    for (int i = 0; i < element.getListMode().size(); i++)
16046      composeEnum(t, "StructureMap", "listMode", element.getListMode().get(i), i);
16047    if (element.hasListRuleIdElement())
16048      composeId(t, "StructureMap", "listRuleId", element.getListRuleIdElement(), -1);
16049    if (element.hasTransformElement())
16050      composeEnum(t, "StructureMap", "transform", element.getTransformElement(), -1);
16051    for (int i = 0; i < element.getParameter().size(); i++)
16052      composeStructureMapStructureMapGroupRuleTargetParameterComponent(t, "StructureMap", "parameter",
16053          element.getParameter().get(i), i);
16054  }
16055
16056  protected void composeStructureMapStructureMapGroupRuleTargetParameterComponent(Complex parent, String parentType,
16057      String name, StructureMap.StructureMapGroupRuleTargetParameterComponent element, int index) {
16058    if (element == null)
16059      return;
16060    Complex t;
16061    if (Utilities.noString(parentType))
16062      t = parent;
16063    else {
16064      t = parent.predicate("fhir:" + parentType + '.' + name);
16065    }
16066    composeBackboneElement(t, "parameter", name, element, index);
16067    if (element.hasValue())
16068      composeType(t, "StructureMap", "value", element.getValue(), -1);
16069  }
16070
16071  protected void composeStructureMapStructureMapGroupRuleDependentComponent(Complex parent, String parentType,
16072      String name, StructureMap.StructureMapGroupRuleDependentComponent element, int index) {
16073    if (element == null)
16074      return;
16075    Complex t;
16076    if (Utilities.noString(parentType))
16077      t = parent;
16078    else {
16079      t = parent.predicate("fhir:" + parentType + '.' + name);
16080    }
16081    composeBackboneElement(t, "dependent", name, element, index);
16082    if (element.hasNameElement())
16083      composeId(t, "StructureMap", "name", element.getNameElement(), -1);
16084    for (int i = 0; i < element.getVariable().size(); i++)
16085      composeString(t, "StructureMap", "variable", element.getVariable().get(i), i);
16086  }
16087
16088  protected void composeSubscription(Complex parent, String parentType, String name, Subscription element, int index) {
16089    if (element == null)
16090      return;
16091    Complex t;
16092    if (Utilities.noString(parentType))
16093      t = parent;
16094    else {
16095      t = parent.predicate("fhir:" + parentType + '.' + name);
16096    }
16097    composeDomainResource(t, "Subscription", name, element, index);
16098    if (element.hasStatusElement())
16099      composeEnum(t, "Subscription", "status", element.getStatusElement(), -1);
16100    for (int i = 0; i < element.getContact().size(); i++)
16101      composeContactPoint(t, "Subscription", "contact", element.getContact().get(i), i);
16102    if (element.hasEndElement())
16103      composeInstant(t, "Subscription", "end", element.getEndElement(), -1);
16104    if (element.hasReasonElement())
16105      composeString(t, "Subscription", "reason", element.getReasonElement(), -1);
16106    if (element.hasCriteriaElement())
16107      composeString(t, "Subscription", "criteria", element.getCriteriaElement(), -1);
16108    if (element.hasErrorElement())
16109      composeString(t, "Subscription", "error", element.getErrorElement(), -1);
16110    if (element.hasChannel())
16111      composeSubscriptionSubscriptionChannelComponent(t, "Subscription", "channel", element.getChannel(), -1);
16112  }
16113
16114  protected void composeSubscriptionSubscriptionChannelComponent(Complex parent, String parentType, String name,
16115      Subscription.SubscriptionChannelComponent element, int index) {
16116    if (element == null)
16117      return;
16118    Complex t;
16119    if (Utilities.noString(parentType))
16120      t = parent;
16121    else {
16122      t = parent.predicate("fhir:" + parentType + '.' + name);
16123    }
16124    composeBackboneElement(t, "channel", name, element, index);
16125    if (element.hasTypeElement())
16126      composeEnum(t, "Subscription", "type", element.getTypeElement(), -1);
16127    if (element.hasEndpointElement())
16128      composeUrl(t, "Subscription", "endpoint", element.getEndpointElement(), -1);
16129    if (element.hasPayloadElement())
16130      composeCode(t, "Subscription", "payload", element.getPayloadElement(), -1);
16131    for (int i = 0; i < element.getHeader().size(); i++)
16132      composeString(t, "Subscription", "header", element.getHeader().get(i), i);
16133  }
16134
16135  protected void composeSubstance(Complex parent, String parentType, String name, Substance element, int index) {
16136    if (element == null)
16137      return;
16138    Complex t;
16139    if (Utilities.noString(parentType))
16140      t = parent;
16141    else {
16142      t = parent.predicate("fhir:" + parentType + '.' + name);
16143    }
16144    composeDomainResource(t, "Substance", name, element, index);
16145    for (int i = 0; i < element.getIdentifier().size(); i++)
16146      composeIdentifier(t, "Substance", "identifier", element.getIdentifier().get(i), i);
16147    if (element.hasStatusElement())
16148      composeEnum(t, "Substance", "status", element.getStatusElement(), -1);
16149    for (int i = 0; i < element.getCategory().size(); i++)
16150      composeCodeableConcept(t, "Substance", "category", element.getCategory().get(i), i);
16151    if (element.hasCode())
16152      composeCodeableConcept(t, "Substance", "code", element.getCode(), -1);
16153    if (element.hasDescriptionElement())
16154      composeString(t, "Substance", "description", element.getDescriptionElement(), -1);
16155    for (int i = 0; i < element.getInstance().size(); i++)
16156      composeSubstanceSubstanceInstanceComponent(t, "Substance", "instance", element.getInstance().get(i), i);
16157    for (int i = 0; i < element.getIngredient().size(); i++)
16158      composeSubstanceSubstanceIngredientComponent(t, "Substance", "ingredient", element.getIngredient().get(i), i);
16159  }
16160
16161  protected void composeSubstanceSubstanceInstanceComponent(Complex parent, String parentType, String name,
16162      Substance.SubstanceInstanceComponent element, int index) {
16163    if (element == null)
16164      return;
16165    Complex t;
16166    if (Utilities.noString(parentType))
16167      t = parent;
16168    else {
16169      t = parent.predicate("fhir:" + parentType + '.' + name);
16170    }
16171    composeBackboneElement(t, "instance", name, element, index);
16172    if (element.hasIdentifier())
16173      composeIdentifier(t, "Substance", "identifier", element.getIdentifier(), -1);
16174    if (element.hasExpiryElement())
16175      composeDateTime(t, "Substance", "expiry", element.getExpiryElement(), -1);
16176    if (element.hasQuantity())
16177      composeQuantity(t, "Substance", "quantity", element.getQuantity(), -1);
16178  }
16179
16180  protected void composeSubstanceSubstanceIngredientComponent(Complex parent, String parentType, String name,
16181      Substance.SubstanceIngredientComponent element, int index) {
16182    if (element == null)
16183      return;
16184    Complex t;
16185    if (Utilities.noString(parentType))
16186      t = parent;
16187    else {
16188      t = parent.predicate("fhir:" + parentType + '.' + name);
16189    }
16190    composeBackboneElement(t, "ingredient", name, element, index);
16191    if (element.hasQuantity())
16192      composeRatio(t, "Substance", "quantity", element.getQuantity(), -1);
16193    if (element.hasSubstance())
16194      composeType(t, "Substance", "substance", element.getSubstance(), -1);
16195  }
16196
16197  protected void composeSubstanceNucleicAcid(Complex parent, String parentType, String name,
16198      SubstanceNucleicAcid element, int index) {
16199    if (element == null)
16200      return;
16201    Complex t;
16202    if (Utilities.noString(parentType))
16203      t = parent;
16204    else {
16205      t = parent.predicate("fhir:" + parentType + '.' + name);
16206    }
16207    composeDomainResource(t, "SubstanceNucleicAcid", name, element, index);
16208    if (element.hasSequenceType())
16209      composeCodeableConcept(t, "SubstanceNucleicAcid", "sequenceType", element.getSequenceType(), -1);
16210    if (element.hasNumberOfSubunitsElement())
16211      composeInteger(t, "SubstanceNucleicAcid", "numberOfSubunits", element.getNumberOfSubunitsElement(), -1);
16212    if (element.hasAreaOfHybridisationElement())
16213      composeString(t, "SubstanceNucleicAcid", "areaOfHybridisation", element.getAreaOfHybridisationElement(), -1);
16214    if (element.hasOligoNucleotideType())
16215      composeCodeableConcept(t, "SubstanceNucleicAcid", "oligoNucleotideType", element.getOligoNucleotideType(), -1);
16216    for (int i = 0; i < element.getSubunit().size(); i++)
16217      composeSubstanceNucleicAcidSubstanceNucleicAcidSubunitComponent(t, "SubstanceNucleicAcid", "subunit",
16218          element.getSubunit().get(i), i);
16219  }
16220
16221  protected void composeSubstanceNucleicAcidSubstanceNucleicAcidSubunitComponent(Complex parent, String parentType,
16222      String name, SubstanceNucleicAcid.SubstanceNucleicAcidSubunitComponent element, int index) {
16223    if (element == null)
16224      return;
16225    Complex t;
16226    if (Utilities.noString(parentType))
16227      t = parent;
16228    else {
16229      t = parent.predicate("fhir:" + parentType + '.' + name);
16230    }
16231    composeBackboneElement(t, "subunit", name, element, index);
16232    if (element.hasSubunitElement())
16233      composeInteger(t, "SubstanceNucleicAcid", "subunit", element.getSubunitElement(), -1);
16234    if (element.hasSequenceElement())
16235      composeString(t, "SubstanceNucleicAcid", "sequence", element.getSequenceElement(), -1);
16236    if (element.hasLengthElement())
16237      composeInteger(t, "SubstanceNucleicAcid", "length", element.getLengthElement(), -1);
16238    if (element.hasSequenceAttachment())
16239      composeAttachment(t, "SubstanceNucleicAcid", "sequenceAttachment", element.getSequenceAttachment(), -1);
16240    if (element.hasFivePrime())
16241      composeCodeableConcept(t, "SubstanceNucleicAcid", "fivePrime", element.getFivePrime(), -1);
16242    if (element.hasThreePrime())
16243      composeCodeableConcept(t, "SubstanceNucleicAcid", "threePrime", element.getThreePrime(), -1);
16244    for (int i = 0; i < element.getLinkage().size(); i++)
16245      composeSubstanceNucleicAcidSubstanceNucleicAcidSubunitLinkageComponent(t, "SubstanceNucleicAcid", "linkage",
16246          element.getLinkage().get(i), i);
16247    for (int i = 0; i < element.getSugar().size(); i++)
16248      composeSubstanceNucleicAcidSubstanceNucleicAcidSubunitSugarComponent(t, "SubstanceNucleicAcid", "sugar",
16249          element.getSugar().get(i), i);
16250  }
16251
16252  protected void composeSubstanceNucleicAcidSubstanceNucleicAcidSubunitLinkageComponent(Complex parent,
16253      String parentType, String name, SubstanceNucleicAcid.SubstanceNucleicAcidSubunitLinkageComponent element,
16254      int index) {
16255    if (element == null)
16256      return;
16257    Complex t;
16258    if (Utilities.noString(parentType))
16259      t = parent;
16260    else {
16261      t = parent.predicate("fhir:" + parentType + '.' + name);
16262    }
16263    composeBackboneElement(t, "linkage", name, element, index);
16264    if (element.hasConnectivityElement())
16265      composeString(t, "SubstanceNucleicAcid", "connectivity", element.getConnectivityElement(), -1);
16266    if (element.hasIdentifier())
16267      composeIdentifier(t, "SubstanceNucleicAcid", "identifier", element.getIdentifier(), -1);
16268    if (element.hasNameElement())
16269      composeString(t, "SubstanceNucleicAcid", "name", element.getNameElement(), -1);
16270    if (element.hasResidueSiteElement())
16271      composeString(t, "SubstanceNucleicAcid", "residueSite", element.getResidueSiteElement(), -1);
16272  }
16273
16274  protected void composeSubstanceNucleicAcidSubstanceNucleicAcidSubunitSugarComponent(Complex parent, String parentType,
16275      String name, SubstanceNucleicAcid.SubstanceNucleicAcidSubunitSugarComponent element, int index) {
16276    if (element == null)
16277      return;
16278    Complex t;
16279    if (Utilities.noString(parentType))
16280      t = parent;
16281    else {
16282      t = parent.predicate("fhir:" + parentType + '.' + name);
16283    }
16284    composeBackboneElement(t, "sugar", name, element, index);
16285    if (element.hasIdentifier())
16286      composeIdentifier(t, "SubstanceNucleicAcid", "identifier", element.getIdentifier(), -1);
16287    if (element.hasNameElement())
16288      composeString(t, "SubstanceNucleicAcid", "name", element.getNameElement(), -1);
16289    if (element.hasResidueSiteElement())
16290      composeString(t, "SubstanceNucleicAcid", "residueSite", element.getResidueSiteElement(), -1);
16291  }
16292
16293  protected void composeSubstancePolymer(Complex parent, String parentType, String name, SubstancePolymer element,
16294      int index) {
16295    if (element == null)
16296      return;
16297    Complex t;
16298    if (Utilities.noString(parentType))
16299      t = parent;
16300    else {
16301      t = parent.predicate("fhir:" + parentType + '.' + name);
16302    }
16303    composeDomainResource(t, "SubstancePolymer", name, element, index);
16304    if (element.hasClass_())
16305      composeCodeableConcept(t, "SubstancePolymer", "class", element.getClass_(), -1);
16306    if (element.hasGeometry())
16307      composeCodeableConcept(t, "SubstancePolymer", "geometry", element.getGeometry(), -1);
16308    for (int i = 0; i < element.getCopolymerConnectivity().size(); i++)
16309      composeCodeableConcept(t, "SubstancePolymer", "copolymerConnectivity", element.getCopolymerConnectivity().get(i),
16310          i);
16311    for (int i = 0; i < element.getModification().size(); i++)
16312      composeString(t, "SubstancePolymer", "modification", element.getModification().get(i), i);
16313    for (int i = 0; i < element.getMonomerSet().size(); i++)
16314      composeSubstancePolymerSubstancePolymerMonomerSetComponent(t, "SubstancePolymer", "monomerSet",
16315          element.getMonomerSet().get(i), i);
16316    for (int i = 0; i < element.getRepeat().size(); i++)
16317      composeSubstancePolymerSubstancePolymerRepeatComponent(t, "SubstancePolymer", "repeat",
16318          element.getRepeat().get(i), i);
16319  }
16320
16321  protected void composeSubstancePolymerSubstancePolymerMonomerSetComponent(Complex parent, String parentType,
16322      String name, SubstancePolymer.SubstancePolymerMonomerSetComponent element, int index) {
16323    if (element == null)
16324      return;
16325    Complex t;
16326    if (Utilities.noString(parentType))
16327      t = parent;
16328    else {
16329      t = parent.predicate("fhir:" + parentType + '.' + name);
16330    }
16331    composeBackboneElement(t, "monomerSet", name, element, index);
16332    if (element.hasRatioType())
16333      composeCodeableConcept(t, "SubstancePolymer", "ratioType", element.getRatioType(), -1);
16334    for (int i = 0; i < element.getStartingMaterial().size(); i++)
16335      composeSubstancePolymerSubstancePolymerMonomerSetStartingMaterialComponent(t, "SubstancePolymer",
16336          "startingMaterial", element.getStartingMaterial().get(i), i);
16337  }
16338
16339  protected void composeSubstancePolymerSubstancePolymerMonomerSetStartingMaterialComponent(Complex parent,
16340      String parentType, String name, SubstancePolymer.SubstancePolymerMonomerSetStartingMaterialComponent element,
16341      int index) {
16342    if (element == null)
16343      return;
16344    Complex t;
16345    if (Utilities.noString(parentType))
16346      t = parent;
16347    else {
16348      t = parent.predicate("fhir:" + parentType + '.' + name);
16349    }
16350    composeBackboneElement(t, "startingMaterial", name, element, index);
16351    if (element.hasMaterial())
16352      composeCodeableConcept(t, "SubstancePolymer", "material", element.getMaterial(), -1);
16353    if (element.hasType())
16354      composeCodeableConcept(t, "SubstancePolymer", "type", element.getType(), -1);
16355    if (element.hasIsDefiningElement())
16356      composeBoolean(t, "SubstancePolymer", "isDefining", element.getIsDefiningElement(), -1);
16357    if (element.hasAmount())
16358      composeSubstanceAmount(t, "SubstancePolymer", "amount", element.getAmount(), -1);
16359  }
16360
16361  protected void composeSubstancePolymerSubstancePolymerRepeatComponent(Complex parent, String parentType, String name,
16362      SubstancePolymer.SubstancePolymerRepeatComponent element, int index) {
16363    if (element == null)
16364      return;
16365    Complex t;
16366    if (Utilities.noString(parentType))
16367      t = parent;
16368    else {
16369      t = parent.predicate("fhir:" + parentType + '.' + name);
16370    }
16371    composeBackboneElement(t, "repeat", name, element, index);
16372    if (element.hasNumberOfUnitsElement())
16373      composeInteger(t, "SubstancePolymer", "numberOfUnits", element.getNumberOfUnitsElement(), -1);
16374    if (element.hasAverageMolecularFormulaElement())
16375      composeString(t, "SubstancePolymer", "averageMolecularFormula", element.getAverageMolecularFormulaElement(), -1);
16376    if (element.hasRepeatUnitAmountType())
16377      composeCodeableConcept(t, "SubstancePolymer", "repeatUnitAmountType", element.getRepeatUnitAmountType(), -1);
16378    for (int i = 0; i < element.getRepeatUnit().size(); i++)
16379      composeSubstancePolymerSubstancePolymerRepeatRepeatUnitComponent(t, "SubstancePolymer", "repeatUnit",
16380          element.getRepeatUnit().get(i), i);
16381  }
16382
16383  protected void composeSubstancePolymerSubstancePolymerRepeatRepeatUnitComponent(Complex parent, String parentType,
16384      String name, SubstancePolymer.SubstancePolymerRepeatRepeatUnitComponent element, int index) {
16385    if (element == null)
16386      return;
16387    Complex t;
16388    if (Utilities.noString(parentType))
16389      t = parent;
16390    else {
16391      t = parent.predicate("fhir:" + parentType + '.' + name);
16392    }
16393    composeBackboneElement(t, "repeatUnit", name, element, index);
16394    if (element.hasOrientationOfPolymerisation())
16395      composeCodeableConcept(t, "SubstancePolymer", "orientationOfPolymerisation",
16396          element.getOrientationOfPolymerisation(), -1);
16397    if (element.hasRepeatUnitElement())
16398      composeString(t, "SubstancePolymer", "repeatUnit", element.getRepeatUnitElement(), -1);
16399    if (element.hasAmount())
16400      composeSubstanceAmount(t, "SubstancePolymer", "amount", element.getAmount(), -1);
16401    for (int i = 0; i < element.getDegreeOfPolymerisation().size(); i++)
16402      composeSubstancePolymerSubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent(t, "SubstancePolymer",
16403          "degreeOfPolymerisation", element.getDegreeOfPolymerisation().get(i), i);
16404    for (int i = 0; i < element.getStructuralRepresentation().size(); i++)
16405      composeSubstancePolymerSubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent(t, "SubstancePolymer",
16406          "structuralRepresentation", element.getStructuralRepresentation().get(i), i);
16407  }
16408
16409  protected void composeSubstancePolymerSubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent(Complex parent,
16410      String parentType, String name,
16411      SubstancePolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent element, int index) {
16412    if (element == null)
16413      return;
16414    Complex t;
16415    if (Utilities.noString(parentType))
16416      t = parent;
16417    else {
16418      t = parent.predicate("fhir:" + parentType + '.' + name);
16419    }
16420    composeBackboneElement(t, "degreeOfPolymerisation", name, element, index);
16421    if (element.hasDegree())
16422      composeCodeableConcept(t, "SubstancePolymer", "degree", element.getDegree(), -1);
16423    if (element.hasAmount())
16424      composeSubstanceAmount(t, "SubstancePolymer", "amount", element.getAmount(), -1);
16425  }
16426
16427  protected void composeSubstancePolymerSubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent(
16428      Complex parent, String parentType, String name,
16429      SubstancePolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent element, int index) {
16430    if (element == null)
16431      return;
16432    Complex t;
16433    if (Utilities.noString(parentType))
16434      t = parent;
16435    else {
16436      t = parent.predicate("fhir:" + parentType + '.' + name);
16437    }
16438    composeBackboneElement(t, "structuralRepresentation", name, element, index);
16439    if (element.hasType())
16440      composeCodeableConcept(t, "SubstancePolymer", "type", element.getType(), -1);
16441    if (element.hasRepresentationElement())
16442      composeString(t, "SubstancePolymer", "representation", element.getRepresentationElement(), -1);
16443    if (element.hasAttachment())
16444      composeAttachment(t, "SubstancePolymer", "attachment", element.getAttachment(), -1);
16445  }
16446
16447  protected void composeSubstanceProtein(Complex parent, String parentType, String name, SubstanceProtein element,
16448      int index) {
16449    if (element == null)
16450      return;
16451    Complex t;
16452    if (Utilities.noString(parentType))
16453      t = parent;
16454    else {
16455      t = parent.predicate("fhir:" + parentType + '.' + name);
16456    }
16457    composeDomainResource(t, "SubstanceProtein", name, element, index);
16458    if (element.hasSequenceType())
16459      composeCodeableConcept(t, "SubstanceProtein", "sequenceType", element.getSequenceType(), -1);
16460    if (element.hasNumberOfSubunitsElement())
16461      composeInteger(t, "SubstanceProtein", "numberOfSubunits", element.getNumberOfSubunitsElement(), -1);
16462    for (int i = 0; i < element.getDisulfideLinkage().size(); i++)
16463      composeString(t, "SubstanceProtein", "disulfideLinkage", element.getDisulfideLinkage().get(i), i);
16464    for (int i = 0; i < element.getSubunit().size(); i++)
16465      composeSubstanceProteinSubstanceProteinSubunitComponent(t, "SubstanceProtein", "subunit",
16466          element.getSubunit().get(i), i);
16467  }
16468
16469  protected void composeSubstanceProteinSubstanceProteinSubunitComponent(Complex parent, String parentType, String name,
16470      SubstanceProtein.SubstanceProteinSubunitComponent element, int index) {
16471    if (element == null)
16472      return;
16473    Complex t;
16474    if (Utilities.noString(parentType))
16475      t = parent;
16476    else {
16477      t = parent.predicate("fhir:" + parentType + '.' + name);
16478    }
16479    composeBackboneElement(t, "subunit", name, element, index);
16480    if (element.hasSubunitElement())
16481      composeInteger(t, "SubstanceProtein", "subunit", element.getSubunitElement(), -1);
16482    if (element.hasSequenceElement())
16483      composeString(t, "SubstanceProtein", "sequence", element.getSequenceElement(), -1);
16484    if (element.hasLengthElement())
16485      composeInteger(t, "SubstanceProtein", "length", element.getLengthElement(), -1);
16486    if (element.hasSequenceAttachment())
16487      composeAttachment(t, "SubstanceProtein", "sequenceAttachment", element.getSequenceAttachment(), -1);
16488    if (element.hasNTerminalModificationId())
16489      composeIdentifier(t, "SubstanceProtein", "nTerminalModificationId", element.getNTerminalModificationId(), -1);
16490    if (element.hasNTerminalModificationElement())
16491      composeString(t, "SubstanceProtein", "nTerminalModification", element.getNTerminalModificationElement(), -1);
16492    if (element.hasCTerminalModificationId())
16493      composeIdentifier(t, "SubstanceProtein", "cTerminalModificationId", element.getCTerminalModificationId(), -1);
16494    if (element.hasCTerminalModificationElement())
16495      composeString(t, "SubstanceProtein", "cTerminalModification", element.getCTerminalModificationElement(), -1);
16496  }
16497
16498  protected void composeSubstanceReferenceInformation(Complex parent, String parentType, String name,
16499      SubstanceReferenceInformation element, int index) {
16500    if (element == null)
16501      return;
16502    Complex t;
16503    if (Utilities.noString(parentType))
16504      t = parent;
16505    else {
16506      t = parent.predicate("fhir:" + parentType + '.' + name);
16507    }
16508    composeDomainResource(t, "SubstanceReferenceInformation", name, element, index);
16509    if (element.hasCommentElement())
16510      composeString(t, "SubstanceReferenceInformation", "comment", element.getCommentElement(), -1);
16511    for (int i = 0; i < element.getGene().size(); i++)
16512      composeSubstanceReferenceInformationSubstanceReferenceInformationGeneComponent(t, "SubstanceReferenceInformation",
16513          "gene", element.getGene().get(i), i);
16514    for (int i = 0; i < element.getClassification().size(); i++)
16515      composeSubstanceReferenceInformationSubstanceReferenceInformationClassificationComponent(t,
16516          "SubstanceReferenceInformation", "classification", element.getClassification().get(i), i);
16517    for (int i = 0; i < element.getTarget().size(); i++)
16518      composeSubstanceReferenceInformationSubstanceReferenceInformationTargetComponent(t,
16519          "SubstanceReferenceInformation", "target", element.getTarget().get(i), i);
16520  }
16521
16522  protected void composeSubstanceReferenceInformationSubstanceReferenceInformationGeneComponent(Complex parent,
16523      String parentType, String name, SubstanceReferenceInformation.SubstanceReferenceInformationGeneComponent element,
16524      int index) {
16525    if (element == null)
16526      return;
16527    Complex t;
16528    if (Utilities.noString(parentType))
16529      t = parent;
16530    else {
16531      t = parent.predicate("fhir:" + parentType + '.' + name);
16532    }
16533    composeBackboneElement(t, "gene", name, element, index);
16534    if (element.hasGeneSequenceOrigin())
16535      composeCodeableConcept(t, "SubstanceReferenceInformation", "geneSequenceOrigin", element.getGeneSequenceOrigin(),
16536          -1);
16537    if (element.hasGene())
16538      composeCodeableConcept(t, "SubstanceReferenceInformation", "gene", element.getGene(), -1);
16539    for (int i = 0; i < element.getSource().size(); i++)
16540      composeReference(t, "SubstanceReferenceInformation", "source", element.getSource().get(i), i);
16541  }
16542
16543  protected void composeSubstanceReferenceInformationSubstanceReferenceInformationGeneElementComponent(Complex parent,
16544      String parentType, String name,
16545      SubstanceReferenceInformation.SubstanceReferenceInformationGeneElementComponent element, int index) {
16546    if (element == null)
16547      return;
16548    Complex t;
16549    if (Utilities.noString(parentType))
16550      t = parent;
16551    else {
16552      t = parent.predicate("fhir:" + parentType + '.' + name);
16553    }
16554    composeBackboneElement(t, "geneElement", name, element, index);
16555    if (element.hasType())
16556      composeCodeableConcept(t, "SubstanceReferenceInformation", "type", element.getType(), -1);
16557    if (element.hasElement())
16558      composeIdentifier(t, "SubstanceReferenceInformation", "element", element.getElement(), -1);
16559    for (int i = 0; i < element.getSource().size(); i++)
16560      composeReference(t, "SubstanceReferenceInformation", "source", element.getSource().get(i), i);
16561  }
16562
16563  protected void composeSubstanceReferenceInformationSubstanceReferenceInformationClassificationComponent(
16564      Complex parent, String parentType, String name,
16565      SubstanceReferenceInformation.SubstanceReferenceInformationClassificationComponent element, int index) {
16566    if (element == null)
16567      return;
16568    Complex t;
16569    if (Utilities.noString(parentType))
16570      t = parent;
16571    else {
16572      t = parent.predicate("fhir:" + parentType + '.' + name);
16573    }
16574    composeBackboneElement(t, "classification", name, element, index);
16575    if (element.hasDomain())
16576      composeCodeableConcept(t, "SubstanceReferenceInformation", "domain", element.getDomain(), -1);
16577    if (element.hasClassification())
16578      composeCodeableConcept(t, "SubstanceReferenceInformation", "classification", element.getClassification(), -1);
16579    for (int i = 0; i < element.getSubtype().size(); i++)
16580      composeCodeableConcept(t, "SubstanceReferenceInformation", "subtype", element.getSubtype().get(i), i);
16581    for (int i = 0; i < element.getSource().size(); i++)
16582      composeReference(t, "SubstanceReferenceInformation", "source", element.getSource().get(i), i);
16583  }
16584
16585  protected void composeSubstanceReferenceInformationSubstanceReferenceInformationTargetComponent(Complex parent,
16586      String parentType, String name,
16587      SubstanceReferenceInformation.SubstanceReferenceInformationTargetComponent element, int index) {
16588    if (element == null)
16589      return;
16590    Complex t;
16591    if (Utilities.noString(parentType))
16592      t = parent;
16593    else {
16594      t = parent.predicate("fhir:" + parentType + '.' + name);
16595    }
16596    composeBackboneElement(t, "target", name, element, index);
16597    if (element.hasTarget())
16598      composeIdentifier(t, "SubstanceReferenceInformation", "target", element.getTarget(), -1);
16599    if (element.hasType())
16600      composeCodeableConcept(t, "SubstanceReferenceInformation", "type", element.getType(), -1);
16601    if (element.hasInteraction())
16602      composeCodeableConcept(t, "SubstanceReferenceInformation", "interaction", element.getInteraction(), -1);
16603    if (element.hasOrganism())
16604      composeCodeableConcept(t, "SubstanceReferenceInformation", "organism", element.getOrganism(), -1);
16605    if (element.hasOrganismType())
16606      composeCodeableConcept(t, "SubstanceReferenceInformation", "organismType", element.getOrganismType(), -1);
16607    if (element.hasAmount())
16608      composeType(t, "SubstanceReferenceInformation", "amount", element.getAmount(), -1);
16609    if (element.hasAmountType())
16610      composeCodeableConcept(t, "SubstanceReferenceInformation", "amountType", element.getAmountType(), -1);
16611    for (int i = 0; i < element.getSource().size(); i++)
16612      composeReference(t, "SubstanceReferenceInformation", "source", element.getSource().get(i), i);
16613  }
16614
16615  protected void composeSubstanceSourceMaterial(Complex parent, String parentType, String name,
16616      SubstanceSourceMaterial element, int index) {
16617    if (element == null)
16618      return;
16619    Complex t;
16620    if (Utilities.noString(parentType))
16621      t = parent;
16622    else {
16623      t = parent.predicate("fhir:" + parentType + '.' + name);
16624    }
16625    composeDomainResource(t, "SubstanceSourceMaterial", name, element, index);
16626    if (element.hasSourceMaterialClass())
16627      composeCodeableConcept(t, "SubstanceSourceMaterial", "sourceMaterialClass", element.getSourceMaterialClass(), -1);
16628    if (element.hasSourceMaterialType())
16629      composeCodeableConcept(t, "SubstanceSourceMaterial", "sourceMaterialType", element.getSourceMaterialType(), -1);
16630    if (element.hasSourceMaterialState())
16631      composeCodeableConcept(t, "SubstanceSourceMaterial", "sourceMaterialState", element.getSourceMaterialState(), -1);
16632    if (element.hasOrganismId())
16633      composeIdentifier(t, "SubstanceSourceMaterial", "organismId", element.getOrganismId(), -1);
16634    if (element.hasOrganismNameElement())
16635      composeString(t, "SubstanceSourceMaterial", "organismName", element.getOrganismNameElement(), -1);
16636    for (int i = 0; i < element.getParentSubstanceId().size(); i++)
16637      composeIdentifier(t, "SubstanceSourceMaterial", "parentSubstanceId", element.getParentSubstanceId().get(i), i);
16638    for (int i = 0; i < element.getParentSubstanceName().size(); i++)
16639      composeString(t, "SubstanceSourceMaterial", "parentSubstanceName", element.getParentSubstanceName().get(i), i);
16640    for (int i = 0; i < element.getCountryOfOrigin().size(); i++)
16641      composeCodeableConcept(t, "SubstanceSourceMaterial", "countryOfOrigin", element.getCountryOfOrigin().get(i), i);
16642    for (int i = 0; i < element.getGeographicalLocation().size(); i++)
16643      composeString(t, "SubstanceSourceMaterial", "geographicalLocation", element.getGeographicalLocation().get(i), i);
16644    if (element.hasDevelopmentStage())
16645      composeCodeableConcept(t, "SubstanceSourceMaterial", "developmentStage", element.getDevelopmentStage(), -1);
16646    for (int i = 0; i < element.getFractionDescription().size(); i++)
16647      composeSubstanceSourceMaterialSubstanceSourceMaterialFractionDescriptionComponent(t, "SubstanceSourceMaterial",
16648          "fractionDescription", element.getFractionDescription().get(i), i);
16649    if (element.hasOrganism())
16650      composeSubstanceSourceMaterialSubstanceSourceMaterialOrganismComponent(t, "SubstanceSourceMaterial", "organism",
16651          element.getOrganism(), -1);
16652    for (int i = 0; i < element.getPartDescription().size(); i++)
16653      composeSubstanceSourceMaterialSubstanceSourceMaterialPartDescriptionComponent(t, "SubstanceSourceMaterial",
16654          "partDescription", element.getPartDescription().get(i), i);
16655  }
16656
16657  protected void composeSubstanceSourceMaterialSubstanceSourceMaterialFractionDescriptionComponent(Complex parent,
16658      String parentType, String name,
16659      SubstanceSourceMaterial.SubstanceSourceMaterialFractionDescriptionComponent element, int index) {
16660    if (element == null)
16661      return;
16662    Complex t;
16663    if (Utilities.noString(parentType))
16664      t = parent;
16665    else {
16666      t = parent.predicate("fhir:" + parentType + '.' + name);
16667    }
16668    composeBackboneElement(t, "fractionDescription", name, element, index);
16669    if (element.hasFractionElement())
16670      composeString(t, "SubstanceSourceMaterial", "fraction", element.getFractionElement(), -1);
16671    if (element.hasMaterialType())
16672      composeCodeableConcept(t, "SubstanceSourceMaterial", "materialType", element.getMaterialType(), -1);
16673  }
16674
16675  protected void composeSubstanceSourceMaterialSubstanceSourceMaterialOrganismComponent(Complex parent,
16676      String parentType, String name, SubstanceSourceMaterial.SubstanceSourceMaterialOrganismComponent element,
16677      int index) {
16678    if (element == null)
16679      return;
16680    Complex t;
16681    if (Utilities.noString(parentType))
16682      t = parent;
16683    else {
16684      t = parent.predicate("fhir:" + parentType + '.' + name);
16685    }
16686    composeBackboneElement(t, "organism", name, element, index);
16687    if (element.hasFamily())
16688      composeCodeableConcept(t, "SubstanceSourceMaterial", "family", element.getFamily(), -1);
16689    if (element.hasGenus())
16690      composeCodeableConcept(t, "SubstanceSourceMaterial", "genus", element.getGenus(), -1);
16691    if (element.hasSpecies())
16692      composeCodeableConcept(t, "SubstanceSourceMaterial", "species", element.getSpecies(), -1);
16693    if (element.hasIntraspecificType())
16694      composeCodeableConcept(t, "SubstanceSourceMaterial", "intraspecificType", element.getIntraspecificType(), -1);
16695    if (element.hasIntraspecificDescriptionElement())
16696      composeString(t, "SubstanceSourceMaterial", "intraspecificDescription",
16697          element.getIntraspecificDescriptionElement(), -1);
16698    for (int i = 0; i < element.getAuthor().size(); i++)
16699      composeSubstanceSourceMaterialSubstanceSourceMaterialOrganismAuthorComponent(t, "SubstanceSourceMaterial",
16700          "author", element.getAuthor().get(i), i);
16701    if (element.hasHybrid())
16702      composeSubstanceSourceMaterialSubstanceSourceMaterialOrganismHybridComponent(t, "SubstanceSourceMaterial",
16703          "hybrid", element.getHybrid(), -1);
16704    if (element.hasOrganismGeneral())
16705      composeSubstanceSourceMaterialSubstanceSourceMaterialOrganismOrganismGeneralComponent(t,
16706          "SubstanceSourceMaterial", "organismGeneral", element.getOrganismGeneral(), -1);
16707  }
16708
16709  protected void composeSubstanceSourceMaterialSubstanceSourceMaterialOrganismAuthorComponent(Complex parent,
16710      String parentType, String name, SubstanceSourceMaterial.SubstanceSourceMaterialOrganismAuthorComponent element,
16711      int index) {
16712    if (element == null)
16713      return;
16714    Complex t;
16715    if (Utilities.noString(parentType))
16716      t = parent;
16717    else {
16718      t = parent.predicate("fhir:" + parentType + '.' + name);
16719    }
16720    composeBackboneElement(t, "author", name, element, index);
16721    if (element.hasAuthorType())
16722      composeCodeableConcept(t, "SubstanceSourceMaterial", "authorType", element.getAuthorType(), -1);
16723    if (element.hasAuthorDescriptionElement())
16724      composeString(t, "SubstanceSourceMaterial", "authorDescription", element.getAuthorDescriptionElement(), -1);
16725  }
16726
16727  protected void composeSubstanceSourceMaterialSubstanceSourceMaterialOrganismHybridComponent(Complex parent,
16728      String parentType, String name, SubstanceSourceMaterial.SubstanceSourceMaterialOrganismHybridComponent element,
16729      int index) {
16730    if (element == null)
16731      return;
16732    Complex t;
16733    if (Utilities.noString(parentType))
16734      t = parent;
16735    else {
16736      t = parent.predicate("fhir:" + parentType + '.' + name);
16737    }
16738    composeBackboneElement(t, "hybrid", name, element, index);
16739    if (element.hasMaternalOrganismIdElement())
16740      composeString(t, "SubstanceSourceMaterial", "maternalOrganismId", element.getMaternalOrganismIdElement(), -1);
16741    if (element.hasMaternalOrganismNameElement())
16742      composeString(t, "SubstanceSourceMaterial", "maternalOrganismName", element.getMaternalOrganismNameElement(), -1);
16743    if (element.hasPaternalOrganismIdElement())
16744      composeString(t, "SubstanceSourceMaterial", "paternalOrganismId", element.getPaternalOrganismIdElement(), -1);
16745    if (element.hasPaternalOrganismNameElement())
16746      composeString(t, "SubstanceSourceMaterial", "paternalOrganismName", element.getPaternalOrganismNameElement(), -1);
16747    if (element.hasHybridType())
16748      composeCodeableConcept(t, "SubstanceSourceMaterial", "hybridType", element.getHybridType(), -1);
16749  }
16750
16751  protected void composeSubstanceSourceMaterialSubstanceSourceMaterialOrganismOrganismGeneralComponent(Complex parent,
16752      String parentType, String name,
16753      SubstanceSourceMaterial.SubstanceSourceMaterialOrganismOrganismGeneralComponent element, int index) {
16754    if (element == null)
16755      return;
16756    Complex t;
16757    if (Utilities.noString(parentType))
16758      t = parent;
16759    else {
16760      t = parent.predicate("fhir:" + parentType + '.' + name);
16761    }
16762    composeBackboneElement(t, "organismGeneral", name, element, index);
16763    if (element.hasKingdom())
16764      composeCodeableConcept(t, "SubstanceSourceMaterial", "kingdom", element.getKingdom(), -1);
16765    if (element.hasPhylum())
16766      composeCodeableConcept(t, "SubstanceSourceMaterial", "phylum", element.getPhylum(), -1);
16767    if (element.hasClass_())
16768      composeCodeableConcept(t, "SubstanceSourceMaterial", "class", element.getClass_(), -1);
16769    if (element.hasOrder())
16770      composeCodeableConcept(t, "SubstanceSourceMaterial", "order", element.getOrder(), -1);
16771  }
16772
16773  protected void composeSubstanceSourceMaterialSubstanceSourceMaterialPartDescriptionComponent(Complex parent,
16774      String parentType, String name, SubstanceSourceMaterial.SubstanceSourceMaterialPartDescriptionComponent element,
16775      int index) {
16776    if (element == null)
16777      return;
16778    Complex t;
16779    if (Utilities.noString(parentType))
16780      t = parent;
16781    else {
16782      t = parent.predicate("fhir:" + parentType + '.' + name);
16783    }
16784    composeBackboneElement(t, "partDescription", name, element, index);
16785    if (element.hasPart())
16786      composeCodeableConcept(t, "SubstanceSourceMaterial", "part", element.getPart(), -1);
16787    if (element.hasPartLocation())
16788      composeCodeableConcept(t, "SubstanceSourceMaterial", "partLocation", element.getPartLocation(), -1);
16789  }
16790
16791  protected void composeSubstanceSpecification(Complex parent, String parentType, String name,
16792      SubstanceSpecification element, int index) {
16793    if (element == null)
16794      return;
16795    Complex t;
16796    if (Utilities.noString(parentType))
16797      t = parent;
16798    else {
16799      t = parent.predicate("fhir:" + parentType + '.' + name);
16800    }
16801    composeDomainResource(t, "SubstanceSpecification", name, element, index);
16802    if (element.hasIdentifier())
16803      composeIdentifier(t, "SubstanceSpecification", "identifier", element.getIdentifier(), -1);
16804    if (element.hasType())
16805      composeCodeableConcept(t, "SubstanceSpecification", "type", element.getType(), -1);
16806    if (element.hasStatus())
16807      composeCodeableConcept(t, "SubstanceSpecification", "status", element.getStatus(), -1);
16808    if (element.hasDomain())
16809      composeCodeableConcept(t, "SubstanceSpecification", "domain", element.getDomain(), -1);
16810    if (element.hasDescriptionElement())
16811      composeString(t, "SubstanceSpecification", "description", element.getDescriptionElement(), -1);
16812    for (int i = 0; i < element.getSource().size(); i++)
16813      composeReference(t, "SubstanceSpecification", "source", element.getSource().get(i), i);
16814    if (element.hasCommentElement())
16815      composeString(t, "SubstanceSpecification", "comment", element.getCommentElement(), -1);
16816    for (int i = 0; i < element.getMoiety().size(); i++)
16817      composeSubstanceSpecificationSubstanceSpecificationMoietyComponent(t, "SubstanceSpecification", "moiety",
16818          element.getMoiety().get(i), i);
16819    for (int i = 0; i < element.getProperty().size(); i++)
16820      composeSubstanceSpecificationSubstanceSpecificationPropertyComponent(t, "SubstanceSpecification", "property",
16821          element.getProperty().get(i), i);
16822    if (element.hasReferenceInformation())
16823      composeReference(t, "SubstanceSpecification", "referenceInformation", element.getReferenceInformation(), -1);
16824    if (element.hasStructure())
16825      composeSubstanceSpecificationSubstanceSpecificationStructureComponent(t, "SubstanceSpecification", "structure",
16826          element.getStructure(), -1);
16827    for (int i = 0; i < element.getCode().size(); i++)
16828      composeSubstanceSpecificationSubstanceSpecificationCodeComponent(t, "SubstanceSpecification", "code",
16829          element.getCode().get(i), i);
16830    for (int i = 0; i < element.getName().size(); i++)
16831      composeSubstanceSpecificationSubstanceSpecificationNameComponent(t, "SubstanceSpecification", "name",
16832          element.getName().get(i), i);
16833    for (int i = 0; i < element.getMolecularWeight().size(); i++)
16834      composeSubstanceSpecificationSubstanceSpecificationStructureIsotopeMolecularWeightComponent(t,
16835          "SubstanceSpecification", "molecularWeight", element.getMolecularWeight().get(i), i);
16836    for (int i = 0; i < element.getRelationship().size(); i++)
16837      composeSubstanceSpecificationSubstanceSpecificationRelationshipComponent(t, "SubstanceSpecification",
16838          "relationship", element.getRelationship().get(i), i);
16839    if (element.hasNucleicAcid())
16840      composeReference(t, "SubstanceSpecification", "nucleicAcid", element.getNucleicAcid(), -1);
16841    if (element.hasPolymer())
16842      composeReference(t, "SubstanceSpecification", "polymer", element.getPolymer(), -1);
16843    if (element.hasProtein())
16844      composeReference(t, "SubstanceSpecification", "protein", element.getProtein(), -1);
16845    if (element.hasSourceMaterial())
16846      composeReference(t, "SubstanceSpecification", "sourceMaterial", element.getSourceMaterial(), -1);
16847  }
16848
16849  protected void composeSubstanceSpecificationSubstanceSpecificationMoietyComponent(Complex parent, String parentType,
16850      String name, SubstanceSpecification.SubstanceSpecificationMoietyComponent element, int index) {
16851    if (element == null)
16852      return;
16853    Complex t;
16854    if (Utilities.noString(parentType))
16855      t = parent;
16856    else {
16857      t = parent.predicate("fhir:" + parentType + '.' + name);
16858    }
16859    composeBackboneElement(t, "moiety", name, element, index);
16860    if (element.hasRole())
16861      composeCodeableConcept(t, "SubstanceSpecification", "role", element.getRole(), -1);
16862    if (element.hasIdentifier())
16863      composeIdentifier(t, "SubstanceSpecification", "identifier", element.getIdentifier(), -1);
16864    if (element.hasNameElement())
16865      composeString(t, "SubstanceSpecification", "name", element.getNameElement(), -1);
16866    if (element.hasStereochemistry())
16867      composeCodeableConcept(t, "SubstanceSpecification", "stereochemistry", element.getStereochemistry(), -1);
16868    if (element.hasOpticalActivity())
16869      composeCodeableConcept(t, "SubstanceSpecification", "opticalActivity", element.getOpticalActivity(), -1);
16870    if (element.hasMolecularFormulaElement())
16871      composeString(t, "SubstanceSpecification", "molecularFormula", element.getMolecularFormulaElement(), -1);
16872    if (element.hasAmount())
16873      composeType(t, "SubstanceSpecification", "amount", element.getAmount(), -1);
16874  }
16875
16876  protected void composeSubstanceSpecificationSubstanceSpecificationPropertyComponent(Complex parent, String parentType,
16877      String name, SubstanceSpecification.SubstanceSpecificationPropertyComponent element, int index) {
16878    if (element == null)
16879      return;
16880    Complex t;
16881    if (Utilities.noString(parentType))
16882      t = parent;
16883    else {
16884      t = parent.predicate("fhir:" + parentType + '.' + name);
16885    }
16886    composeBackboneElement(t, "property", name, element, index);
16887    if (element.hasCategory())
16888      composeCodeableConcept(t, "SubstanceSpecification", "category", element.getCategory(), -1);
16889    if (element.hasCode())
16890      composeCodeableConcept(t, "SubstanceSpecification", "code", element.getCode(), -1);
16891    if (element.hasParametersElement())
16892      composeString(t, "SubstanceSpecification", "parameters", element.getParametersElement(), -1);
16893    if (element.hasDefiningSubstance())
16894      composeType(t, "SubstanceSpecification", "definingSubstance", element.getDefiningSubstance(), -1);
16895    if (element.hasAmount())
16896      composeType(t, "SubstanceSpecification", "amount", element.getAmount(), -1);
16897  }
16898
16899  protected void composeSubstanceSpecificationSubstanceSpecificationStructureComponent(Complex parent,
16900      String parentType, String name, SubstanceSpecification.SubstanceSpecificationStructureComponent element,
16901      int index) {
16902    if (element == null)
16903      return;
16904    Complex t;
16905    if (Utilities.noString(parentType))
16906      t = parent;
16907    else {
16908      t = parent.predicate("fhir:" + parentType + '.' + name);
16909    }
16910    composeBackboneElement(t, "structure", name, element, index);
16911    if (element.hasStereochemistry())
16912      composeCodeableConcept(t, "SubstanceSpecification", "stereochemistry", element.getStereochemistry(), -1);
16913    if (element.hasOpticalActivity())
16914      composeCodeableConcept(t, "SubstanceSpecification", "opticalActivity", element.getOpticalActivity(), -1);
16915    if (element.hasMolecularFormulaElement())
16916      composeString(t, "SubstanceSpecification", "molecularFormula", element.getMolecularFormulaElement(), -1);
16917    if (element.hasMolecularFormulaByMoietyElement())
16918      composeString(t, "SubstanceSpecification", "molecularFormulaByMoiety",
16919          element.getMolecularFormulaByMoietyElement(), -1);
16920    for (int i = 0; i < element.getIsotope().size(); i++)
16921      composeSubstanceSpecificationSubstanceSpecificationStructureIsotopeComponent(t, "SubstanceSpecification",
16922          "isotope", element.getIsotope().get(i), i);
16923    if (element.hasMolecularWeight())
16924      composeSubstanceSpecificationSubstanceSpecificationStructureIsotopeMolecularWeightComponent(t,
16925          "SubstanceSpecification", "molecularWeight", element.getMolecularWeight(), -1);
16926    for (int i = 0; i < element.getSource().size(); i++)
16927      composeReference(t, "SubstanceSpecification", "source", element.getSource().get(i), i);
16928    for (int i = 0; i < element.getRepresentation().size(); i++)
16929      composeSubstanceSpecificationSubstanceSpecificationStructureRepresentationComponent(t, "SubstanceSpecification",
16930          "representation", element.getRepresentation().get(i), i);
16931  }
16932
16933  protected void composeSubstanceSpecificationSubstanceSpecificationStructureIsotopeComponent(Complex parent,
16934      String parentType, String name, SubstanceSpecification.SubstanceSpecificationStructureIsotopeComponent element,
16935      int index) {
16936    if (element == null)
16937      return;
16938    Complex t;
16939    if (Utilities.noString(parentType))
16940      t = parent;
16941    else {
16942      t = parent.predicate("fhir:" + parentType + '.' + name);
16943    }
16944    composeBackboneElement(t, "isotope", name, element, index);
16945    if (element.hasIdentifier())
16946      composeIdentifier(t, "SubstanceSpecification", "identifier", element.getIdentifier(), -1);
16947    if (element.hasName())
16948      composeCodeableConcept(t, "SubstanceSpecification", "name", element.getName(), -1);
16949    if (element.hasSubstitution())
16950      composeCodeableConcept(t, "SubstanceSpecification", "substitution", element.getSubstitution(), -1);
16951    if (element.hasHalfLife())
16952      composeQuantity(t, "SubstanceSpecification", "halfLife", element.getHalfLife(), -1);
16953    if (element.hasMolecularWeight())
16954      composeSubstanceSpecificationSubstanceSpecificationStructureIsotopeMolecularWeightComponent(t,
16955          "SubstanceSpecification", "molecularWeight", element.getMolecularWeight(), -1);
16956  }
16957
16958  protected void composeSubstanceSpecificationSubstanceSpecificationStructureIsotopeMolecularWeightComponent(
16959      Complex parent, String parentType, String name,
16960      SubstanceSpecification.SubstanceSpecificationStructureIsotopeMolecularWeightComponent element, int index) {
16961    if (element == null)
16962      return;
16963    Complex t;
16964    if (Utilities.noString(parentType))
16965      t = parent;
16966    else {
16967      t = parent.predicate("fhir:" + parentType + '.' + name);
16968    }
16969    composeBackboneElement(t, "molecularWeight", name, element, index);
16970    if (element.hasMethod())
16971      composeCodeableConcept(t, "SubstanceSpecification", "method", element.getMethod(), -1);
16972    if (element.hasType())
16973      composeCodeableConcept(t, "SubstanceSpecification", "type", element.getType(), -1);
16974    if (element.hasAmount())
16975      composeQuantity(t, "SubstanceSpecification", "amount", element.getAmount(), -1);
16976  }
16977
16978  protected void composeSubstanceSpecificationSubstanceSpecificationStructureRepresentationComponent(Complex parent,
16979      String parentType, String name,
16980      SubstanceSpecification.SubstanceSpecificationStructureRepresentationComponent element, int index) {
16981    if (element == null)
16982      return;
16983    Complex t;
16984    if (Utilities.noString(parentType))
16985      t = parent;
16986    else {
16987      t = parent.predicate("fhir:" + parentType + '.' + name);
16988    }
16989    composeBackboneElement(t, "representation", name, element, index);
16990    if (element.hasType())
16991      composeCodeableConcept(t, "SubstanceSpecification", "type", element.getType(), -1);
16992    if (element.hasRepresentationElement())
16993      composeString(t, "SubstanceSpecification", "representation", element.getRepresentationElement(), -1);
16994    if (element.hasAttachment())
16995      composeAttachment(t, "SubstanceSpecification", "attachment", element.getAttachment(), -1);
16996  }
16997
16998  protected void composeSubstanceSpecificationSubstanceSpecificationCodeComponent(Complex parent, String parentType,
16999      String name, SubstanceSpecification.SubstanceSpecificationCodeComponent element, int index) {
17000    if (element == null)
17001      return;
17002    Complex t;
17003    if (Utilities.noString(parentType))
17004      t = parent;
17005    else {
17006      t = parent.predicate("fhir:" + parentType + '.' + name);
17007    }
17008    composeBackboneElement(t, "code", name, element, index);
17009    if (element.hasCode())
17010      composeCodeableConcept(t, "SubstanceSpecification", "code", element.getCode(), -1);
17011    if (element.hasStatus())
17012      composeCodeableConcept(t, "SubstanceSpecification", "status", element.getStatus(), -1);
17013    if (element.hasStatusDateElement())
17014      composeDateTime(t, "SubstanceSpecification", "statusDate", element.getStatusDateElement(), -1);
17015    if (element.hasCommentElement())
17016      composeString(t, "SubstanceSpecification", "comment", element.getCommentElement(), -1);
17017    for (int i = 0; i < element.getSource().size(); i++)
17018      composeReference(t, "SubstanceSpecification", "source", element.getSource().get(i), i);
17019  }
17020
17021  protected void composeSubstanceSpecificationSubstanceSpecificationNameComponent(Complex parent, String parentType,
17022      String name, SubstanceSpecification.SubstanceSpecificationNameComponent element, int index) {
17023    if (element == null)
17024      return;
17025    Complex t;
17026    if (Utilities.noString(parentType))
17027      t = parent;
17028    else {
17029      t = parent.predicate("fhir:" + parentType + '.' + name);
17030    }
17031    composeBackboneElement(t, "name", name, element, index);
17032    if (element.hasNameElement())
17033      composeString(t, "SubstanceSpecification", "name", element.getNameElement(), -1);
17034    if (element.hasType())
17035      composeCodeableConcept(t, "SubstanceSpecification", "type", element.getType(), -1);
17036    if (element.hasStatus())
17037      composeCodeableConcept(t, "SubstanceSpecification", "status", element.getStatus(), -1);
17038    if (element.hasPreferredElement())
17039      composeBoolean(t, "SubstanceSpecification", "preferred", element.getPreferredElement(), -1);
17040    for (int i = 0; i < element.getLanguage().size(); i++)
17041      composeCodeableConcept(t, "SubstanceSpecification", "language", element.getLanguage().get(i), i);
17042    for (int i = 0; i < element.getDomain().size(); i++)
17043      composeCodeableConcept(t, "SubstanceSpecification", "domain", element.getDomain().get(i), i);
17044    for (int i = 0; i < element.getJurisdiction().size(); i++)
17045      composeCodeableConcept(t, "SubstanceSpecification", "jurisdiction", element.getJurisdiction().get(i), i);
17046    for (int i = 0; i < element.getSynonym().size(); i++)
17047      composeSubstanceSpecificationSubstanceSpecificationNameComponent(t, "SubstanceSpecification", "synonym",
17048          element.getSynonym().get(i), i);
17049    for (int i = 0; i < element.getTranslation().size(); i++)
17050      composeSubstanceSpecificationSubstanceSpecificationNameComponent(t, "SubstanceSpecification", "translation",
17051          element.getTranslation().get(i), i);
17052    for (int i = 0; i < element.getOfficial().size(); i++)
17053      composeSubstanceSpecificationSubstanceSpecificationNameOfficialComponent(t, "SubstanceSpecification", "official",
17054          element.getOfficial().get(i), i);
17055    for (int i = 0; i < element.getSource().size(); i++)
17056      composeReference(t, "SubstanceSpecification", "source", element.getSource().get(i), i);
17057  }
17058
17059  protected void composeSubstanceSpecificationSubstanceSpecificationNameOfficialComponent(Complex parent,
17060      String parentType, String name, SubstanceSpecification.SubstanceSpecificationNameOfficialComponent element,
17061      int index) {
17062    if (element == null)
17063      return;
17064    Complex t;
17065    if (Utilities.noString(parentType))
17066      t = parent;
17067    else {
17068      t = parent.predicate("fhir:" + parentType + '.' + name);
17069    }
17070    composeBackboneElement(t, "official", name, element, index);
17071    if (element.hasAuthority())
17072      composeCodeableConcept(t, "SubstanceSpecification", "authority", element.getAuthority(), -1);
17073    if (element.hasStatus())
17074      composeCodeableConcept(t, "SubstanceSpecification", "status", element.getStatus(), -1);
17075    if (element.hasDateElement())
17076      composeDateTime(t, "SubstanceSpecification", "date", element.getDateElement(), -1);
17077  }
17078
17079  protected void composeSubstanceSpecificationSubstanceSpecificationRelationshipComponent(Complex parent,
17080      String parentType, String name, SubstanceSpecification.SubstanceSpecificationRelationshipComponent element,
17081      int index) {
17082    if (element == null)
17083      return;
17084    Complex t;
17085    if (Utilities.noString(parentType))
17086      t = parent;
17087    else {
17088      t = parent.predicate("fhir:" + parentType + '.' + name);
17089    }
17090    composeBackboneElement(t, "relationship", name, element, index);
17091    if (element.hasSubstance())
17092      composeType(t, "SubstanceSpecification", "substance", element.getSubstance(), -1);
17093    if (element.hasRelationship())
17094      composeCodeableConcept(t, "SubstanceSpecification", "relationship", element.getRelationship(), -1);
17095    if (element.hasIsDefiningElement())
17096      composeBoolean(t, "SubstanceSpecification", "isDefining", element.getIsDefiningElement(), -1);
17097    if (element.hasAmount())
17098      composeType(t, "SubstanceSpecification", "amount", element.getAmount(), -1);
17099    if (element.hasAmountRatioLowLimit())
17100      composeRatio(t, "SubstanceSpecification", "amountRatioLowLimit", element.getAmountRatioLowLimit(), -1);
17101    if (element.hasAmountType())
17102      composeCodeableConcept(t, "SubstanceSpecification", "amountType", element.getAmountType(), -1);
17103    for (int i = 0; i < element.getSource().size(); i++)
17104      composeReference(t, "SubstanceSpecification", "source", element.getSource().get(i), i);
17105  }
17106
17107  protected void composeSupplyDelivery(Complex parent, String parentType, String name, SupplyDelivery element,
17108      int index) {
17109    if (element == null)
17110      return;
17111    Complex t;
17112    if (Utilities.noString(parentType))
17113      t = parent;
17114    else {
17115      t = parent.predicate("fhir:" + parentType + '.' + name);
17116    }
17117    composeDomainResource(t, "SupplyDelivery", name, element, index);
17118    for (int i = 0; i < element.getIdentifier().size(); i++)
17119      composeIdentifier(t, "SupplyDelivery", "identifier", element.getIdentifier().get(i), i);
17120    for (int i = 0; i < element.getBasedOn().size(); i++)
17121      composeReference(t, "SupplyDelivery", "basedOn", element.getBasedOn().get(i), i);
17122    for (int i = 0; i < element.getPartOf().size(); i++)
17123      composeReference(t, "SupplyDelivery", "partOf", element.getPartOf().get(i), i);
17124    if (element.hasStatusElement())
17125      composeEnum(t, "SupplyDelivery", "status", element.getStatusElement(), -1);
17126    if (element.hasPatient())
17127      composeReference(t, "SupplyDelivery", "patient", element.getPatient(), -1);
17128    if (element.hasType())
17129      composeCodeableConcept(t, "SupplyDelivery", "type", element.getType(), -1);
17130    if (element.hasSuppliedItem())
17131      composeSupplyDeliverySupplyDeliverySuppliedItemComponent(t, "SupplyDelivery", "suppliedItem",
17132          element.getSuppliedItem(), -1);
17133    if (element.hasOccurrence())
17134      composeType(t, "SupplyDelivery", "occurrence", element.getOccurrence(), -1);
17135    if (element.hasSupplier())
17136      composeReference(t, "SupplyDelivery", "supplier", element.getSupplier(), -1);
17137    if (element.hasDestination())
17138      composeReference(t, "SupplyDelivery", "destination", element.getDestination(), -1);
17139    for (int i = 0; i < element.getReceiver().size(); i++)
17140      composeReference(t, "SupplyDelivery", "receiver", element.getReceiver().get(i), i);
17141  }
17142
17143  protected void composeSupplyDeliverySupplyDeliverySuppliedItemComponent(Complex parent, String parentType,
17144      String name, SupplyDelivery.SupplyDeliverySuppliedItemComponent element, int index) {
17145    if (element == null)
17146      return;
17147    Complex t;
17148    if (Utilities.noString(parentType))
17149      t = parent;
17150    else {
17151      t = parent.predicate("fhir:" + parentType + '.' + name);
17152    }
17153    composeBackboneElement(t, "suppliedItem", name, element, index);
17154    if (element.hasQuantity())
17155      composeQuantity(t, "SupplyDelivery", "quantity", element.getQuantity(), -1);
17156    if (element.hasItem())
17157      composeType(t, "SupplyDelivery", "item", element.getItem(), -1);
17158  }
17159
17160  protected void composeSupplyRequest(Complex parent, String parentType, String name, SupplyRequest element,
17161      int index) {
17162    if (element == null)
17163      return;
17164    Complex t;
17165    if (Utilities.noString(parentType))
17166      t = parent;
17167    else {
17168      t = parent.predicate("fhir:" + parentType + '.' + name);
17169    }
17170    composeDomainResource(t, "SupplyRequest", name, element, index);
17171    for (int i = 0; i < element.getIdentifier().size(); i++)
17172      composeIdentifier(t, "SupplyRequest", "identifier", element.getIdentifier().get(i), i);
17173    if (element.hasStatusElement())
17174      composeEnum(t, "SupplyRequest", "status", element.getStatusElement(), -1);
17175    if (element.hasCategory())
17176      composeCodeableConcept(t, "SupplyRequest", "category", element.getCategory(), -1);
17177    if (element.hasPriorityElement())
17178      composeEnum(t, "SupplyRequest", "priority", element.getPriorityElement(), -1);
17179    if (element.hasItem())
17180      composeType(t, "SupplyRequest", "item", element.getItem(), -1);
17181    if (element.hasQuantity())
17182      composeQuantity(t, "SupplyRequest", "quantity", element.getQuantity(), -1);
17183    for (int i = 0; i < element.getParameter().size(); i++)
17184      composeSupplyRequestSupplyRequestParameterComponent(t, "SupplyRequest", "parameter",
17185          element.getParameter().get(i), i);
17186    if (element.hasOccurrence())
17187      composeType(t, "SupplyRequest", "occurrence", element.getOccurrence(), -1);
17188    if (element.hasAuthoredOnElement())
17189      composeDateTime(t, "SupplyRequest", "authoredOn", element.getAuthoredOnElement(), -1);
17190    if (element.hasRequester())
17191      composeReference(t, "SupplyRequest", "requester", element.getRequester(), -1);
17192    for (int i = 0; i < element.getSupplier().size(); i++)
17193      composeReference(t, "SupplyRequest", "supplier", element.getSupplier().get(i), i);
17194    for (int i = 0; i < element.getReasonCode().size(); i++)
17195      composeCodeableConcept(t, "SupplyRequest", "reasonCode", element.getReasonCode().get(i), i);
17196    for (int i = 0; i < element.getReasonReference().size(); i++)
17197      composeReference(t, "SupplyRequest", "reasonReference", element.getReasonReference().get(i), i);
17198    if (element.hasDeliverFrom())
17199      composeReference(t, "SupplyRequest", "deliverFrom", element.getDeliverFrom(), -1);
17200    if (element.hasDeliverTo())
17201      composeReference(t, "SupplyRequest", "deliverTo", element.getDeliverTo(), -1);
17202  }
17203
17204  protected void composeSupplyRequestSupplyRequestParameterComponent(Complex parent, String parentType, String name,
17205      SupplyRequest.SupplyRequestParameterComponent element, int index) {
17206    if (element == null)
17207      return;
17208    Complex t;
17209    if (Utilities.noString(parentType))
17210      t = parent;
17211    else {
17212      t = parent.predicate("fhir:" + parentType + '.' + name);
17213    }
17214    composeBackboneElement(t, "parameter", name, element, index);
17215    if (element.hasCode())
17216      composeCodeableConcept(t, "SupplyRequest", "code", element.getCode(), -1);
17217    if (element.hasValue())
17218      composeType(t, "SupplyRequest", "value", element.getValue(), -1);
17219  }
17220
17221  protected void composeTask(Complex parent, String parentType, String name, Task element, int index) {
17222    if (element == null)
17223      return;
17224    Complex t;
17225    if (Utilities.noString(parentType))
17226      t = parent;
17227    else {
17228      t = parent.predicate("fhir:" + parentType + '.' + name);
17229    }
17230    composeDomainResource(t, "Task", name, element, index);
17231    for (int i = 0; i < element.getIdentifier().size(); i++)
17232      composeIdentifier(t, "Task", "identifier", element.getIdentifier().get(i), i);
17233    if (element.hasInstantiatesCanonicalElement())
17234      composeCanonical(t, "Task", "instantiatesCanonical", element.getInstantiatesCanonicalElement(), -1);
17235    if (element.hasInstantiatesUriElement())
17236      composeUri(t, "Task", "instantiatesUri", element.getInstantiatesUriElement(), -1);
17237    for (int i = 0; i < element.getBasedOn().size(); i++)
17238      composeReference(t, "Task", "basedOn", element.getBasedOn().get(i), i);
17239    if (element.hasGroupIdentifier())
17240      composeIdentifier(t, "Task", "groupIdentifier", element.getGroupIdentifier(), -1);
17241    for (int i = 0; i < element.getPartOf().size(); i++)
17242      composeReference(t, "Task", "partOf", element.getPartOf().get(i), i);
17243    if (element.hasStatusElement())
17244      composeEnum(t, "Task", "status", element.getStatusElement(), -1);
17245    if (element.hasStatusReason())
17246      composeCodeableConcept(t, "Task", "statusReason", element.getStatusReason(), -1);
17247    if (element.hasBusinessStatus())
17248      composeCodeableConcept(t, "Task", "businessStatus", element.getBusinessStatus(), -1);
17249    if (element.hasIntentElement())
17250      composeEnum(t, "Task", "intent", element.getIntentElement(), -1);
17251    if (element.hasPriorityElement())
17252      composeEnum(t, "Task", "priority", element.getPriorityElement(), -1);
17253    if (element.hasCode())
17254      composeCodeableConcept(t, "Task", "code", element.getCode(), -1);
17255    if (element.hasDescriptionElement())
17256      composeString(t, "Task", "description", element.getDescriptionElement(), -1);
17257    if (element.hasFocus())
17258      composeReference(t, "Task", "focus", element.getFocus(), -1);
17259    if (element.hasFor())
17260      composeReference(t, "Task", "for", element.getFor(), -1);
17261    if (element.hasEncounter())
17262      composeReference(t, "Task", "encounter", element.getEncounter(), -1);
17263    if (element.hasExecutionPeriod())
17264      composePeriod(t, "Task", "executionPeriod", element.getExecutionPeriod(), -1);
17265    if (element.hasAuthoredOnElement())
17266      composeDateTime(t, "Task", "authoredOn", element.getAuthoredOnElement(), -1);
17267    if (element.hasLastModifiedElement())
17268      composeDateTime(t, "Task", "lastModified", element.getLastModifiedElement(), -1);
17269    if (element.hasRequester())
17270      composeReference(t, "Task", "requester", element.getRequester(), -1);
17271    for (int i = 0; i < element.getPerformerType().size(); i++)
17272      composeCodeableConcept(t, "Task", "performerType", element.getPerformerType().get(i), i);
17273    if (element.hasOwner())
17274      composeReference(t, "Task", "owner", element.getOwner(), -1);
17275    if (element.hasLocation())
17276      composeReference(t, "Task", "location", element.getLocation(), -1);
17277    if (element.hasReasonCode())
17278      composeCodeableConcept(t, "Task", "reasonCode", element.getReasonCode(), -1);
17279    if (element.hasReasonReference())
17280      composeReference(t, "Task", "reasonReference", element.getReasonReference(), -1);
17281    for (int i = 0; i < element.getInsurance().size(); i++)
17282      composeReference(t, "Task", "insurance", element.getInsurance().get(i), i);
17283    for (int i = 0; i < element.getNote().size(); i++)
17284      composeAnnotation(t, "Task", "note", element.getNote().get(i), i);
17285    for (int i = 0; i < element.getRelevantHistory().size(); i++)
17286      composeReference(t, "Task", "relevantHistory", element.getRelevantHistory().get(i), i);
17287    if (element.hasRestriction())
17288      composeTaskTaskRestrictionComponent(t, "Task", "restriction", element.getRestriction(), -1);
17289    for (int i = 0; i < element.getInput().size(); i++)
17290      composeTaskParameterComponent(t, "Task", "input", element.getInput().get(i), i);
17291    for (int i = 0; i < element.getOutput().size(); i++)
17292      composeTaskTaskOutputComponent(t, "Task", "output", element.getOutput().get(i), i);
17293  }
17294
17295  protected void composeTaskTaskRestrictionComponent(Complex parent, String parentType, String name,
17296      Task.TaskRestrictionComponent element, int index) {
17297    if (element == null)
17298      return;
17299    Complex t;
17300    if (Utilities.noString(parentType))
17301      t = parent;
17302    else {
17303      t = parent.predicate("fhir:" + parentType + '.' + name);
17304    }
17305    composeBackboneElement(t, "restriction", name, element, index);
17306    if (element.hasRepetitionsElement())
17307      composePositiveInt(t, "Task", "repetitions", element.getRepetitionsElement(), -1);
17308    if (element.hasPeriod())
17309      composePeriod(t, "Task", "period", element.getPeriod(), -1);
17310    for (int i = 0; i < element.getRecipient().size(); i++)
17311      composeReference(t, "Task", "recipient", element.getRecipient().get(i), i);
17312  }
17313
17314  protected void composeTaskParameterComponent(Complex parent, String parentType, String name,
17315      Task.ParameterComponent element, int index) {
17316    if (element == null)
17317      return;
17318    Complex t;
17319    if (Utilities.noString(parentType))
17320      t = parent;
17321    else {
17322      t = parent.predicate("fhir:" + parentType + '.' + name);
17323    }
17324    composeBackboneElement(t, "input", name, element, index);
17325    if (element.hasType())
17326      composeCodeableConcept(t, "Task", "type", element.getType(), -1);
17327    if (element.hasValue())
17328      composeType(t, "Task", "value", element.getValue(), -1);
17329  }
17330
17331  protected void composeTaskTaskOutputComponent(Complex parent, String parentType, String name,
17332      Task.TaskOutputComponent element, int index) {
17333    if (element == null)
17334      return;
17335    Complex t;
17336    if (Utilities.noString(parentType))
17337      t = parent;
17338    else {
17339      t = parent.predicate("fhir:" + parentType + '.' + name);
17340    }
17341    composeBackboneElement(t, "output", name, element, index);
17342    if (element.hasType())
17343      composeCodeableConcept(t, "Task", "type", element.getType(), -1);
17344    if (element.hasValue())
17345      composeType(t, "Task", "value", element.getValue(), -1);
17346  }
17347
17348  protected void composeTerminologyCapabilities(Complex parent, String parentType, String name,
17349      TerminologyCapabilities element, int index) {
17350    if (element == null)
17351      return;
17352    Complex t;
17353    if (Utilities.noString(parentType))
17354      t = parent;
17355    else {
17356      t = parent.predicate("fhir:" + parentType + '.' + name);
17357    }
17358    composeDomainResource(t, "TerminologyCapabilities", name, element, index);
17359    if (element.hasUrlElement())
17360      composeUri(t, "TerminologyCapabilities", "url", element.getUrlElement(), -1);
17361    if (element.hasVersionElement())
17362      composeString(t, "TerminologyCapabilities", "version", element.getVersionElement(), -1);
17363    if (element.hasNameElement())
17364      composeString(t, "TerminologyCapabilities", "name", element.getNameElement(), -1);
17365    if (element.hasTitleElement())
17366      composeString(t, "TerminologyCapabilities", "title", element.getTitleElement(), -1);
17367    if (element.hasStatusElement())
17368      composeEnum(t, "TerminologyCapabilities", "status", element.getStatusElement(), -1);
17369    if (element.hasExperimentalElement())
17370      composeBoolean(t, "TerminologyCapabilities", "experimental", element.getExperimentalElement(), -1);
17371    if (element.hasDateElement())
17372      composeDateTime(t, "TerminologyCapabilities", "date", element.getDateElement(), -1);
17373    if (element.hasPublisherElement())
17374      composeString(t, "TerminologyCapabilities", "publisher", element.getPublisherElement(), -1);
17375    for (int i = 0; i < element.getContact().size(); i++)
17376      composeContactDetail(t, "TerminologyCapabilities", "contact", element.getContact().get(i), i);
17377    if (element.hasDescriptionElement())
17378      composeMarkdown(t, "TerminologyCapabilities", "description", element.getDescriptionElement(), -1);
17379    for (int i = 0; i < element.getUseContext().size(); i++)
17380      composeUsageContext(t, "TerminologyCapabilities", "useContext", element.getUseContext().get(i), i);
17381    for (int i = 0; i < element.getJurisdiction().size(); i++)
17382      composeCodeableConcept(t, "TerminologyCapabilities", "jurisdiction", element.getJurisdiction().get(i), i);
17383    if (element.hasPurposeElement())
17384      composeMarkdown(t, "TerminologyCapabilities", "purpose", element.getPurposeElement(), -1);
17385    if (element.hasCopyrightElement())
17386      composeMarkdown(t, "TerminologyCapabilities", "copyright", element.getCopyrightElement(), -1);
17387    if (element.hasKindElement())
17388      composeEnum(t, "TerminologyCapabilities", "kind", element.getKindElement(), -1);
17389    if (element.hasSoftware())
17390      composeTerminologyCapabilitiesTerminologyCapabilitiesSoftwareComponent(t, "TerminologyCapabilities", "software",
17391          element.getSoftware(), -1);
17392    if (element.hasImplementation())
17393      composeTerminologyCapabilitiesTerminologyCapabilitiesImplementationComponent(t, "TerminologyCapabilities",
17394          "implementation", element.getImplementation(), -1);
17395    if (element.hasLockedDateElement())
17396      composeBoolean(t, "TerminologyCapabilities", "lockedDate", element.getLockedDateElement(), -1);
17397    for (int i = 0; i < element.getCodeSystem().size(); i++)
17398      composeTerminologyCapabilitiesTerminologyCapabilitiesCodeSystemComponent(t, "TerminologyCapabilities",
17399          "codeSystem", element.getCodeSystem().get(i), i);
17400    if (element.hasExpansion())
17401      composeTerminologyCapabilitiesTerminologyCapabilitiesExpansionComponent(t, "TerminologyCapabilities", "expansion",
17402          element.getExpansion(), -1);
17403    if (element.hasCodeSearchElement())
17404      composeEnum(t, "TerminologyCapabilities", "codeSearch", element.getCodeSearchElement(), -1);
17405    if (element.hasValidateCode())
17406      composeTerminologyCapabilitiesTerminologyCapabilitiesValidateCodeComponent(t, "TerminologyCapabilities",
17407          "validateCode", element.getValidateCode(), -1);
17408    if (element.hasTranslation())
17409      composeTerminologyCapabilitiesTerminologyCapabilitiesTranslationComponent(t, "TerminologyCapabilities",
17410          "translation", element.getTranslation(), -1);
17411    if (element.hasClosure())
17412      composeTerminologyCapabilitiesTerminologyCapabilitiesClosureComponent(t, "TerminologyCapabilities", "closure",
17413          element.getClosure(), -1);
17414  }
17415
17416  protected void composeTerminologyCapabilitiesTerminologyCapabilitiesSoftwareComponent(Complex parent,
17417      String parentType, String name, TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent element,
17418      int index) {
17419    if (element == null)
17420      return;
17421    Complex t;
17422    if (Utilities.noString(parentType))
17423      t = parent;
17424    else {
17425      t = parent.predicate("fhir:" + parentType + '.' + name);
17426    }
17427    composeBackboneElement(t, "software", name, element, index);
17428    if (element.hasNameElement())
17429      composeString(t, "TerminologyCapabilities", "name", element.getNameElement(), -1);
17430    if (element.hasVersionElement())
17431      composeString(t, "TerminologyCapabilities", "version", element.getVersionElement(), -1);
17432  }
17433
17434  protected void composeTerminologyCapabilitiesTerminologyCapabilitiesImplementationComponent(Complex parent,
17435      String parentType, String name, TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent element,
17436      int index) {
17437    if (element == null)
17438      return;
17439    Complex t;
17440    if (Utilities.noString(parentType))
17441      t = parent;
17442    else {
17443      t = parent.predicate("fhir:" + parentType + '.' + name);
17444    }
17445    composeBackboneElement(t, "implementation", name, element, index);
17446    if (element.hasDescriptionElement())
17447      composeString(t, "TerminologyCapabilities", "description", element.getDescriptionElement(), -1);
17448    if (element.hasUrlElement())
17449      composeUrl(t, "TerminologyCapabilities", "url", element.getUrlElement(), -1);
17450  }
17451
17452  protected void composeTerminologyCapabilitiesTerminologyCapabilitiesCodeSystemComponent(Complex parent,
17453      String parentType, String name, TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent element,
17454      int index) {
17455    if (element == null)
17456      return;
17457    Complex t;
17458    if (Utilities.noString(parentType))
17459      t = parent;
17460    else {
17461      t = parent.predicate("fhir:" + parentType + '.' + name);
17462    }
17463    composeBackboneElement(t, "codeSystem", name, element, index);
17464    if (element.hasUriElement())
17465      composeCanonical(t, "TerminologyCapabilities", "uri", element.getUriElement(), -1);
17466    for (int i = 0; i < element.getVersion().size(); i++)
17467      composeTerminologyCapabilitiesTerminologyCapabilitiesCodeSystemVersionComponent(t, "TerminologyCapabilities",
17468          "version", element.getVersion().get(i), i);
17469    if (element.hasSubsumptionElement())
17470      composeBoolean(t, "TerminologyCapabilities", "subsumption", element.getSubsumptionElement(), -1);
17471  }
17472
17473  protected void composeTerminologyCapabilitiesTerminologyCapabilitiesCodeSystemVersionComponent(Complex parent,
17474      String parentType, String name, TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent element,
17475      int index) {
17476    if (element == null)
17477      return;
17478    Complex t;
17479    if (Utilities.noString(parentType))
17480      t = parent;
17481    else {
17482      t = parent.predicate("fhir:" + parentType + '.' + name);
17483    }
17484    composeBackboneElement(t, "version", name, element, index);
17485    if (element.hasCodeElement())
17486      composeString(t, "TerminologyCapabilities", "code", element.getCodeElement(), -1);
17487    if (element.hasIsDefaultElement())
17488      composeBoolean(t, "TerminologyCapabilities", "isDefault", element.getIsDefaultElement(), -1);
17489    if (element.hasCompositionalElement())
17490      composeBoolean(t, "TerminologyCapabilities", "compositional", element.getCompositionalElement(), -1);
17491    for (int i = 0; i < element.getLanguage().size(); i++)
17492      composeCode(t, "TerminologyCapabilities", "language", element.getLanguage().get(i), i);
17493    for (int i = 0; i < element.getFilter().size(); i++)
17494      composeTerminologyCapabilitiesTerminologyCapabilitiesCodeSystemVersionFilterComponent(t,
17495          "TerminologyCapabilities", "filter", element.getFilter().get(i), i);
17496    for (int i = 0; i < element.getProperty().size(); i++)
17497      composeCode(t, "TerminologyCapabilities", "property", element.getProperty().get(i), i);
17498  }
17499
17500  protected void composeTerminologyCapabilitiesTerminologyCapabilitiesCodeSystemVersionFilterComponent(Complex parent,
17501      String parentType, String name,
17502      TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent element, int index) {
17503    if (element == null)
17504      return;
17505    Complex t;
17506    if (Utilities.noString(parentType))
17507      t = parent;
17508    else {
17509      t = parent.predicate("fhir:" + parentType + '.' + name);
17510    }
17511    composeBackboneElement(t, "filter", name, element, index);
17512    if (element.hasCodeElement())
17513      composeCode(t, "TerminologyCapabilities", "code", element.getCodeElement(), -1);
17514    for (int i = 0; i < element.getOp().size(); i++)
17515      composeCode(t, "TerminologyCapabilities", "op", element.getOp().get(i), i);
17516  }
17517
17518  protected void composeTerminologyCapabilitiesTerminologyCapabilitiesExpansionComponent(Complex parent,
17519      String parentType, String name, TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent element,
17520      int index) {
17521    if (element == null)
17522      return;
17523    Complex t;
17524    if (Utilities.noString(parentType))
17525      t = parent;
17526    else {
17527      t = parent.predicate("fhir:" + parentType + '.' + name);
17528    }
17529    composeBackboneElement(t, "expansion", name, element, index);
17530    if (element.hasHierarchicalElement())
17531      composeBoolean(t, "TerminologyCapabilities", "hierarchical", element.getHierarchicalElement(), -1);
17532    if (element.hasPagingElement())
17533      composeBoolean(t, "TerminologyCapabilities", "paging", element.getPagingElement(), -1);
17534    if (element.hasIncompleteElement())
17535      composeBoolean(t, "TerminologyCapabilities", "incomplete", element.getIncompleteElement(), -1);
17536    for (int i = 0; i < element.getParameter().size(); i++)
17537      composeTerminologyCapabilitiesTerminologyCapabilitiesExpansionParameterComponent(t, "TerminologyCapabilities",
17538          "parameter", element.getParameter().get(i), i);
17539    if (element.hasTextFilterElement())
17540      composeMarkdown(t, "TerminologyCapabilities", "textFilter", element.getTextFilterElement(), -1);
17541  }
17542
17543  protected void composeTerminologyCapabilitiesTerminologyCapabilitiesExpansionParameterComponent(Complex parent,
17544      String parentType, String name,
17545      TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent element, int index) {
17546    if (element == null)
17547      return;
17548    Complex t;
17549    if (Utilities.noString(parentType))
17550      t = parent;
17551    else {
17552      t = parent.predicate("fhir:" + parentType + '.' + name);
17553    }
17554    composeBackboneElement(t, "parameter", name, element, index);
17555    if (element.hasNameElement())
17556      composeCode(t, "TerminologyCapabilities", "name", element.getNameElement(), -1);
17557    if (element.hasDocumentationElement())
17558      composeString(t, "TerminologyCapabilities", "documentation", element.getDocumentationElement(), -1);
17559  }
17560
17561  protected void composeTerminologyCapabilitiesTerminologyCapabilitiesValidateCodeComponent(Complex parent,
17562      String parentType, String name, TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent element,
17563      int index) {
17564    if (element == null)
17565      return;
17566    Complex t;
17567    if (Utilities.noString(parentType))
17568      t = parent;
17569    else {
17570      t = parent.predicate("fhir:" + parentType + '.' + name);
17571    }
17572    composeBackboneElement(t, "validateCode", name, element, index);
17573    if (element.hasTranslationsElement())
17574      composeBoolean(t, "TerminologyCapabilities", "translations", element.getTranslationsElement(), -1);
17575  }
17576
17577  protected void composeTerminologyCapabilitiesTerminologyCapabilitiesTranslationComponent(Complex parent,
17578      String parentType, String name, TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent element,
17579      int index) {
17580    if (element == null)
17581      return;
17582    Complex t;
17583    if (Utilities.noString(parentType))
17584      t = parent;
17585    else {
17586      t = parent.predicate("fhir:" + parentType + '.' + name);
17587    }
17588    composeBackboneElement(t, "translation", name, element, index);
17589    if (element.hasNeedsMapElement())
17590      composeBoolean(t, "TerminologyCapabilities", "needsMap", element.getNeedsMapElement(), -1);
17591  }
17592
17593  protected void composeTerminologyCapabilitiesTerminologyCapabilitiesClosureComponent(Complex parent,
17594      String parentType, String name, TerminologyCapabilities.TerminologyCapabilitiesClosureComponent element,
17595      int index) {
17596    if (element == null)
17597      return;
17598    Complex t;
17599    if (Utilities.noString(parentType))
17600      t = parent;
17601    else {
17602      t = parent.predicate("fhir:" + parentType + '.' + name);
17603    }
17604    composeBackboneElement(t, "closure", name, element, index);
17605    if (element.hasTranslationElement())
17606      composeBoolean(t, "TerminologyCapabilities", "translation", element.getTranslationElement(), -1);
17607  }
17608
17609  protected void composeTestReport(Complex parent, String parentType, String name, TestReport element, int index) {
17610    if (element == null)
17611      return;
17612    Complex t;
17613    if (Utilities.noString(parentType))
17614      t = parent;
17615    else {
17616      t = parent.predicate("fhir:" + parentType + '.' + name);
17617    }
17618    composeDomainResource(t, "TestReport", name, element, index);
17619    if (element.hasIdentifier())
17620      composeIdentifier(t, "TestReport", "identifier", element.getIdentifier(), -1);
17621    if (element.hasNameElement())
17622      composeString(t, "TestReport", "name", element.getNameElement(), -1);
17623    if (element.hasStatusElement())
17624      composeEnum(t, "TestReport", "status", element.getStatusElement(), -1);
17625    if (element.hasTestScript())
17626      composeReference(t, "TestReport", "testScript", element.getTestScript(), -1);
17627    if (element.hasResultElement())
17628      composeEnum(t, "TestReport", "result", element.getResultElement(), -1);
17629    if (element.hasScoreElement())
17630      composeDecimal(t, "TestReport", "score", element.getScoreElement(), -1);
17631    if (element.hasTesterElement())
17632      composeString(t, "TestReport", "tester", element.getTesterElement(), -1);
17633    if (element.hasIssuedElement())
17634      composeDateTime(t, "TestReport", "issued", element.getIssuedElement(), -1);
17635    for (int i = 0; i < element.getParticipant().size(); i++)
17636      composeTestReportTestReportParticipantComponent(t, "TestReport", "participant", element.getParticipant().get(i),
17637          i);
17638    if (element.hasSetup())
17639      composeTestReportTestReportSetupComponent(t, "TestReport", "setup", element.getSetup(), -1);
17640    for (int i = 0; i < element.getTest().size(); i++)
17641      composeTestReportTestReportTestComponent(t, "TestReport", "test", element.getTest().get(i), i);
17642    if (element.hasTeardown())
17643      composeTestReportTestReportTeardownComponent(t, "TestReport", "teardown", element.getTeardown(), -1);
17644  }
17645
17646  protected void composeTestReportTestReportParticipantComponent(Complex parent, String parentType, String name,
17647      TestReport.TestReportParticipantComponent element, int index) {
17648    if (element == null)
17649      return;
17650    Complex t;
17651    if (Utilities.noString(parentType))
17652      t = parent;
17653    else {
17654      t = parent.predicate("fhir:" + parentType + '.' + name);
17655    }
17656    composeBackboneElement(t, "participant", name, element, index);
17657    if (element.hasTypeElement())
17658      composeEnum(t, "TestReport", "type", element.getTypeElement(), -1);
17659    if (element.hasUriElement())
17660      composeUri(t, "TestReport", "uri", element.getUriElement(), -1);
17661    if (element.hasDisplayElement())
17662      composeString(t, "TestReport", "display", element.getDisplayElement(), -1);
17663  }
17664
17665  protected void composeTestReportTestReportSetupComponent(Complex parent, String parentType, String name,
17666      TestReport.TestReportSetupComponent element, int index) {
17667    if (element == null)
17668      return;
17669    Complex t;
17670    if (Utilities.noString(parentType))
17671      t = parent;
17672    else {
17673      t = parent.predicate("fhir:" + parentType + '.' + name);
17674    }
17675    composeBackboneElement(t, "setup", name, element, index);
17676    for (int i = 0; i < element.getAction().size(); i++)
17677      composeTestReportSetupActionComponent(t, "TestReport", "action", element.getAction().get(i), i);
17678  }
17679
17680  protected void composeTestReportSetupActionComponent(Complex parent, String parentType, String name,
17681      TestReport.SetupActionComponent element, int index) {
17682    if (element == null)
17683      return;
17684    Complex t;
17685    if (Utilities.noString(parentType))
17686      t = parent;
17687    else {
17688      t = parent.predicate("fhir:" + parentType + '.' + name);
17689    }
17690    composeBackboneElement(t, "action", name, element, index);
17691    if (element.hasOperation())
17692      composeTestReportSetupActionOperationComponent(t, "TestReport", "operation", element.getOperation(), -1);
17693    if (element.hasAssert())
17694      composeTestReportSetupActionAssertComponent(t, "TestReport", "assert", element.getAssert(), -1);
17695  }
17696
17697  protected void composeTestReportSetupActionOperationComponent(Complex parent, String parentType, String name,
17698      TestReport.SetupActionOperationComponent element, int index) {
17699    if (element == null)
17700      return;
17701    Complex t;
17702    if (Utilities.noString(parentType))
17703      t = parent;
17704    else {
17705      t = parent.predicate("fhir:" + parentType + '.' + name);
17706    }
17707    composeBackboneElement(t, "operation", name, element, index);
17708    if (element.hasResultElement())
17709      composeEnum(t, "TestReport", "result", element.getResultElement(), -1);
17710    if (element.hasMessageElement())
17711      composeMarkdown(t, "TestReport", "message", element.getMessageElement(), -1);
17712    if (element.hasDetailElement())
17713      composeUri(t, "TestReport", "detail", element.getDetailElement(), -1);
17714  }
17715
17716  protected void composeTestReportSetupActionAssertComponent(Complex parent, String parentType, String name,
17717      TestReport.SetupActionAssertComponent element, int index) {
17718    if (element == null)
17719      return;
17720    Complex t;
17721    if (Utilities.noString(parentType))
17722      t = parent;
17723    else {
17724      t = parent.predicate("fhir:" + parentType + '.' + name);
17725    }
17726    composeBackboneElement(t, "assert", name, element, index);
17727    if (element.hasResultElement())
17728      composeEnum(t, "TestReport", "result", element.getResultElement(), -1);
17729    if (element.hasMessageElement())
17730      composeMarkdown(t, "TestReport", "message", element.getMessageElement(), -1);
17731    if (element.hasDetailElement())
17732      composeString(t, "TestReport", "detail", element.getDetailElement(), -1);
17733  }
17734
17735  protected void composeTestReportTestReportTestComponent(Complex parent, String parentType, String name,
17736      TestReport.TestReportTestComponent element, int index) {
17737    if (element == null)
17738      return;
17739    Complex t;
17740    if (Utilities.noString(parentType))
17741      t = parent;
17742    else {
17743      t = parent.predicate("fhir:" + parentType + '.' + name);
17744    }
17745    composeBackboneElement(t, "test", name, element, index);
17746    if (element.hasNameElement())
17747      composeString(t, "TestReport", "name", element.getNameElement(), -1);
17748    if (element.hasDescriptionElement())
17749      composeString(t, "TestReport", "description", element.getDescriptionElement(), -1);
17750    for (int i = 0; i < element.getAction().size(); i++)
17751      composeTestReportTestActionComponent(t, "TestReport", "action", element.getAction().get(i), i);
17752  }
17753
17754  protected void composeTestReportTestActionComponent(Complex parent, String parentType, String name,
17755      TestReport.TestActionComponent element, int index) {
17756    if (element == null)
17757      return;
17758    Complex t;
17759    if (Utilities.noString(parentType))
17760      t = parent;
17761    else {
17762      t = parent.predicate("fhir:" + parentType + '.' + name);
17763    }
17764    composeBackboneElement(t, "action", name, element, index);
17765    if (element.hasOperation())
17766      composeTestReportSetupActionOperationComponent(t, "TestReport", "operation", element.getOperation(), -1);
17767    if (element.hasAssert())
17768      composeTestReportSetupActionAssertComponent(t, "TestReport", "assert", element.getAssert(), -1);
17769  }
17770
17771  protected void composeTestReportTestReportTeardownComponent(Complex parent, String parentType, String name,
17772      TestReport.TestReportTeardownComponent element, int index) {
17773    if (element == null)
17774      return;
17775    Complex t;
17776    if (Utilities.noString(parentType))
17777      t = parent;
17778    else {
17779      t = parent.predicate("fhir:" + parentType + '.' + name);
17780    }
17781    composeBackboneElement(t, "teardown", name, element, index);
17782    for (int i = 0; i < element.getAction().size(); i++)
17783      composeTestReportTeardownActionComponent(t, "TestReport", "action", element.getAction().get(i), i);
17784  }
17785
17786  protected void composeTestReportTeardownActionComponent(Complex parent, String parentType, String name,
17787      TestReport.TeardownActionComponent element, int index) {
17788    if (element == null)
17789      return;
17790    Complex t;
17791    if (Utilities.noString(parentType))
17792      t = parent;
17793    else {
17794      t = parent.predicate("fhir:" + parentType + '.' + name);
17795    }
17796    composeBackboneElement(t, "action", name, element, index);
17797    if (element.hasOperation())
17798      composeTestReportSetupActionOperationComponent(t, "TestReport", "operation", element.getOperation(), -1);
17799  }
17800
17801  protected void composeTestScript(Complex parent, String parentType, String name, TestScript element, int index) {
17802    if (element == null)
17803      return;
17804    Complex t;
17805    if (Utilities.noString(parentType))
17806      t = parent;
17807    else {
17808      t = parent.predicate("fhir:" + parentType + '.' + name);
17809    }
17810    composeDomainResource(t, "TestScript", name, element, index);
17811    if (element.hasUrlElement())
17812      composeUri(t, "TestScript", "url", element.getUrlElement(), -1);
17813    if (element.hasIdentifier())
17814      composeIdentifier(t, "TestScript", "identifier", element.getIdentifier(), -1);
17815    if (element.hasVersionElement())
17816      composeString(t, "TestScript", "version", element.getVersionElement(), -1);
17817    if (element.hasNameElement())
17818      composeString(t, "TestScript", "name", element.getNameElement(), -1);
17819    if (element.hasTitleElement())
17820      composeString(t, "TestScript", "title", element.getTitleElement(), -1);
17821    if (element.hasStatusElement())
17822      composeEnum(t, "TestScript", "status", element.getStatusElement(), -1);
17823    if (element.hasExperimentalElement())
17824      composeBoolean(t, "TestScript", "experimental", element.getExperimentalElement(), -1);
17825    if (element.hasDateElement())
17826      composeDateTime(t, "TestScript", "date", element.getDateElement(), -1);
17827    if (element.hasPublisherElement())
17828      composeString(t, "TestScript", "publisher", element.getPublisherElement(), -1);
17829    for (int i = 0; i < element.getContact().size(); i++)
17830      composeContactDetail(t, "TestScript", "contact", element.getContact().get(i), i);
17831    if (element.hasDescriptionElement())
17832      composeMarkdown(t, "TestScript", "description", element.getDescriptionElement(), -1);
17833    for (int i = 0; i < element.getUseContext().size(); i++)
17834      composeUsageContext(t, "TestScript", "useContext", element.getUseContext().get(i), i);
17835    for (int i = 0; i < element.getJurisdiction().size(); i++)
17836      composeCodeableConcept(t, "TestScript", "jurisdiction", element.getJurisdiction().get(i), i);
17837    if (element.hasPurposeElement())
17838      composeMarkdown(t, "TestScript", "purpose", element.getPurposeElement(), -1);
17839    if (element.hasCopyrightElement())
17840      composeMarkdown(t, "TestScript", "copyright", element.getCopyrightElement(), -1);
17841    for (int i = 0; i < element.getOrigin().size(); i++)
17842      composeTestScriptTestScriptOriginComponent(t, "TestScript", "origin", element.getOrigin().get(i), i);
17843    for (int i = 0; i < element.getDestination().size(); i++)
17844      composeTestScriptTestScriptDestinationComponent(t, "TestScript", "destination", element.getDestination().get(i),
17845          i);
17846    if (element.hasMetadata())
17847      composeTestScriptTestScriptMetadataComponent(t, "TestScript", "metadata", element.getMetadata(), -1);
17848    for (int i = 0; i < element.getFixture().size(); i++)
17849      composeTestScriptTestScriptFixtureComponent(t, "TestScript", "fixture", element.getFixture().get(i), i);
17850    for (int i = 0; i < element.getProfile().size(); i++)
17851      composeReference(t, "TestScript", "profile", element.getProfile().get(i), i);
17852    for (int i = 0; i < element.getVariable().size(); i++)
17853      composeTestScriptTestScriptVariableComponent(t, "TestScript", "variable", element.getVariable().get(i), i);
17854    if (element.hasSetup())
17855      composeTestScriptTestScriptSetupComponent(t, "TestScript", "setup", element.getSetup(), -1);
17856    for (int i = 0; i < element.getTest().size(); i++)
17857      composeTestScriptTestScriptTestComponent(t, "TestScript", "test", element.getTest().get(i), i);
17858    if (element.hasTeardown())
17859      composeTestScriptTestScriptTeardownComponent(t, "TestScript", "teardown", element.getTeardown(), -1);
17860  }
17861
17862  protected void composeTestScriptTestScriptOriginComponent(Complex parent, String parentType, String name,
17863      TestScript.TestScriptOriginComponent element, int index) {
17864    if (element == null)
17865      return;
17866    Complex t;
17867    if (Utilities.noString(parentType))
17868      t = parent;
17869    else {
17870      t = parent.predicate("fhir:" + parentType + '.' + name);
17871    }
17872    composeBackboneElement(t, "origin", name, element, index);
17873    if (element.hasIndexElement())
17874      composeInteger(t, "TestScript", "index", element.getIndexElement(), -1);
17875    if (element.hasProfile())
17876      composeCoding(t, "TestScript", "profile", element.getProfile(), -1);
17877  }
17878
17879  protected void composeTestScriptTestScriptDestinationComponent(Complex parent, String parentType, String name,
17880      TestScript.TestScriptDestinationComponent element, int index) {
17881    if (element == null)
17882      return;
17883    Complex t;
17884    if (Utilities.noString(parentType))
17885      t = parent;
17886    else {
17887      t = parent.predicate("fhir:" + parentType + '.' + name);
17888    }
17889    composeBackboneElement(t, "destination", name, element, index);
17890    if (element.hasIndexElement())
17891      composeInteger(t, "TestScript", "index", element.getIndexElement(), -1);
17892    if (element.hasProfile())
17893      composeCoding(t, "TestScript", "profile", element.getProfile(), -1);
17894  }
17895
17896  protected void composeTestScriptTestScriptMetadataComponent(Complex parent, String parentType, String name,
17897      TestScript.TestScriptMetadataComponent element, int index) {
17898    if (element == null)
17899      return;
17900    Complex t;
17901    if (Utilities.noString(parentType))
17902      t = parent;
17903    else {
17904      t = parent.predicate("fhir:" + parentType + '.' + name);
17905    }
17906    composeBackboneElement(t, "metadata", name, element, index);
17907    for (int i = 0; i < element.getLink().size(); i++)
17908      composeTestScriptTestScriptMetadataLinkComponent(t, "TestScript", "link", element.getLink().get(i), i);
17909    for (int i = 0; i < element.getCapability().size(); i++)
17910      composeTestScriptTestScriptMetadataCapabilityComponent(t, "TestScript", "capability",
17911          element.getCapability().get(i), i);
17912  }
17913
17914  protected void composeTestScriptTestScriptMetadataLinkComponent(Complex parent, String parentType, String name,
17915      TestScript.TestScriptMetadataLinkComponent element, int index) {
17916    if (element == null)
17917      return;
17918    Complex t;
17919    if (Utilities.noString(parentType))
17920      t = parent;
17921    else {
17922      t = parent.predicate("fhir:" + parentType + '.' + name);
17923    }
17924    composeBackboneElement(t, "link", name, element, index);
17925    if (element.hasUrlElement())
17926      composeUri(t, "TestScript", "url", element.getUrlElement(), -1);
17927    if (element.hasDescriptionElement())
17928      composeString(t, "TestScript", "description", element.getDescriptionElement(), -1);
17929  }
17930
17931  protected void composeTestScriptTestScriptMetadataCapabilityComponent(Complex parent, String parentType, String name,
17932      TestScript.TestScriptMetadataCapabilityComponent element, int index) {
17933    if (element == null)
17934      return;
17935    Complex t;
17936    if (Utilities.noString(parentType))
17937      t = parent;
17938    else {
17939      t = parent.predicate("fhir:" + parentType + '.' + name);
17940    }
17941    composeBackboneElement(t, "capability", name, element, index);
17942    if (element.hasRequiredElement())
17943      composeBoolean(t, "TestScript", "required", element.getRequiredElement(), -1);
17944    if (element.hasValidatedElement())
17945      composeBoolean(t, "TestScript", "validated", element.getValidatedElement(), -1);
17946    if (element.hasDescriptionElement())
17947      composeString(t, "TestScript", "description", element.getDescriptionElement(), -1);
17948    for (int i = 0; i < element.getOrigin().size(); i++)
17949      composeInteger(t, "TestScript", "origin", element.getOrigin().get(i), i);
17950    if (element.hasDestinationElement())
17951      composeInteger(t, "TestScript", "destination", element.getDestinationElement(), -1);
17952    for (int i = 0; i < element.getLink().size(); i++)
17953      composeUri(t, "TestScript", "link", element.getLink().get(i), i);
17954    if (element.hasCapabilitiesElement())
17955      composeCanonical(t, "TestScript", "capabilities", element.getCapabilitiesElement(), -1);
17956  }
17957
17958  protected void composeTestScriptTestScriptFixtureComponent(Complex parent, String parentType, String name,
17959      TestScript.TestScriptFixtureComponent element, int index) {
17960    if (element == null)
17961      return;
17962    Complex t;
17963    if (Utilities.noString(parentType))
17964      t = parent;
17965    else {
17966      t = parent.predicate("fhir:" + parentType + '.' + name);
17967    }
17968    composeBackboneElement(t, "fixture", name, element, index);
17969    if (element.hasAutocreateElement())
17970      composeBoolean(t, "TestScript", "autocreate", element.getAutocreateElement(), -1);
17971    if (element.hasAutodeleteElement())
17972      composeBoolean(t, "TestScript", "autodelete", element.getAutodeleteElement(), -1);
17973    if (element.hasResource())
17974      composeReference(t, "TestScript", "resource", element.getResource(), -1);
17975  }
17976
17977  protected void composeTestScriptTestScriptVariableComponent(Complex parent, String parentType, String name,
17978      TestScript.TestScriptVariableComponent element, int index) {
17979    if (element == null)
17980      return;
17981    Complex t;
17982    if (Utilities.noString(parentType))
17983      t = parent;
17984    else {
17985      t = parent.predicate("fhir:" + parentType + '.' + name);
17986    }
17987    composeBackboneElement(t, "variable", name, element, index);
17988    if (element.hasNameElement())
17989      composeString(t, "TestScript", "name", element.getNameElement(), -1);
17990    if (element.hasDefaultValueElement())
17991      composeString(t, "TestScript", "defaultValue", element.getDefaultValueElement(), -1);
17992    if (element.hasDescriptionElement())
17993      composeString(t, "TestScript", "description", element.getDescriptionElement(), -1);
17994    if (element.hasExpressionElement())
17995      composeString(t, "TestScript", "expression", element.getExpressionElement(), -1);
17996    if (element.hasHeaderFieldElement())
17997      composeString(t, "TestScript", "headerField", element.getHeaderFieldElement(), -1);
17998    if (element.hasHintElement())
17999      composeString(t, "TestScript", "hint", element.getHintElement(), -1);
18000    if (element.hasPathElement())
18001      composeString(t, "TestScript", "path", element.getPathElement(), -1);
18002    if (element.hasSourceIdElement())
18003      composeId(t, "TestScript", "sourceId", element.getSourceIdElement(), -1);
18004  }
18005
18006  protected void composeTestScriptTestScriptSetupComponent(Complex parent, String parentType, String name,
18007      TestScript.TestScriptSetupComponent element, int index) {
18008    if (element == null)
18009      return;
18010    Complex t;
18011    if (Utilities.noString(parentType))
18012      t = parent;
18013    else {
18014      t = parent.predicate("fhir:" + parentType + '.' + name);
18015    }
18016    composeBackboneElement(t, "setup", name, element, index);
18017    for (int i = 0; i < element.getAction().size(); i++)
18018      composeTestScriptSetupActionComponent(t, "TestScript", "action", element.getAction().get(i), i);
18019  }
18020
18021  protected void composeTestScriptSetupActionComponent(Complex parent, String parentType, String name,
18022      TestScript.SetupActionComponent element, int index) {
18023    if (element == null)
18024      return;
18025    Complex t;
18026    if (Utilities.noString(parentType))
18027      t = parent;
18028    else {
18029      t = parent.predicate("fhir:" + parentType + '.' + name);
18030    }
18031    composeBackboneElement(t, "action", name, element, index);
18032    if (element.hasOperation())
18033      composeTestScriptSetupActionOperationComponent(t, "TestScript", "operation", element.getOperation(), -1);
18034    if (element.hasAssert())
18035      composeTestScriptSetupActionAssertComponent(t, "TestScript", "assert", element.getAssert(), -1);
18036  }
18037
18038  protected void composeTestScriptSetupActionOperationComponent(Complex parent, String parentType, String name,
18039      TestScript.SetupActionOperationComponent element, int index) {
18040    if (element == null)
18041      return;
18042    Complex t;
18043    if (Utilities.noString(parentType))
18044      t = parent;
18045    else {
18046      t = parent.predicate("fhir:" + parentType + '.' + name);
18047    }
18048    composeBackboneElement(t, "operation", name, element, index);
18049    if (element.hasType())
18050      composeCoding(t, "TestScript", "type", element.getType(), -1);
18051    if (element.hasResourceElement())
18052      composeCode(t, "TestScript", "resource", element.getResourceElement(), -1);
18053    if (element.hasLabelElement())
18054      composeString(t, "TestScript", "label", element.getLabelElement(), -1);
18055    if (element.hasDescriptionElement())
18056      composeString(t, "TestScript", "description", element.getDescriptionElement(), -1);
18057    if (element.hasAcceptElement())
18058      composeCode(t, "TestScript", "accept", element.getAcceptElement(), -1);
18059    if (element.hasContentTypeElement())
18060      composeCode(t, "TestScript", "contentType", element.getContentTypeElement(), -1);
18061    if (element.hasDestinationElement())
18062      composeInteger(t, "TestScript", "destination", element.getDestinationElement(), -1);
18063    if (element.hasEncodeRequestUrlElement())
18064      composeBoolean(t, "TestScript", "encodeRequestUrl", element.getEncodeRequestUrlElement(), -1);
18065    if (element.hasMethodElement())
18066      composeEnum(t, "TestScript", "method", element.getMethodElement(), -1);
18067    if (element.hasOriginElement())
18068      composeInteger(t, "TestScript", "origin", element.getOriginElement(), -1);
18069    if (element.hasParamsElement())
18070      composeString(t, "TestScript", "params", element.getParamsElement(), -1);
18071    for (int i = 0; i < element.getRequestHeader().size(); i++)
18072      composeTestScriptSetupActionOperationRequestHeaderComponent(t, "TestScript", "requestHeader",
18073          element.getRequestHeader().get(i), i);
18074    if (element.hasRequestIdElement())
18075      composeId(t, "TestScript", "requestId", element.getRequestIdElement(), -1);
18076    if (element.hasResponseIdElement())
18077      composeId(t, "TestScript", "responseId", element.getResponseIdElement(), -1);
18078    if (element.hasSourceIdElement())
18079      composeId(t, "TestScript", "sourceId", element.getSourceIdElement(), -1);
18080    if (element.hasTargetIdElement())
18081      composeId(t, "TestScript", "targetId", element.getTargetIdElement(), -1);
18082    if (element.hasUrlElement())
18083      composeString(t, "TestScript", "url", element.getUrlElement(), -1);
18084  }
18085
18086  protected void composeTestScriptSetupActionOperationRequestHeaderComponent(Complex parent, String parentType,
18087      String name, TestScript.SetupActionOperationRequestHeaderComponent element, int index) {
18088    if (element == null)
18089      return;
18090    Complex t;
18091    if (Utilities.noString(parentType))
18092      t = parent;
18093    else {
18094      t = parent.predicate("fhir:" + parentType + '.' + name);
18095    }
18096    composeBackboneElement(t, "requestHeader", name, element, index);
18097    if (element.hasFieldElement())
18098      composeString(t, "TestScript", "field", element.getFieldElement(), -1);
18099    if (element.hasValueElement())
18100      composeString(t, "TestScript", "value", element.getValueElement(), -1);
18101  }
18102
18103  protected void composeTestScriptSetupActionAssertComponent(Complex parent, String parentType, String name,
18104      TestScript.SetupActionAssertComponent element, int index) {
18105    if (element == null)
18106      return;
18107    Complex t;
18108    if (Utilities.noString(parentType))
18109      t = parent;
18110    else {
18111      t = parent.predicate("fhir:" + parentType + '.' + name);
18112    }
18113    composeBackboneElement(t, "assert", name, element, index);
18114    if (element.hasLabelElement())
18115      composeString(t, "TestScript", "label", element.getLabelElement(), -1);
18116    if (element.hasDescriptionElement())
18117      composeString(t, "TestScript", "description", element.getDescriptionElement(), -1);
18118    if (element.hasDirectionElement())
18119      composeEnum(t, "TestScript", "direction", element.getDirectionElement(), -1);
18120    if (element.hasCompareToSourceIdElement())
18121      composeString(t, "TestScript", "compareToSourceId", element.getCompareToSourceIdElement(), -1);
18122    if (element.hasCompareToSourceExpressionElement())
18123      composeString(t, "TestScript", "compareToSourceExpression", element.getCompareToSourceExpressionElement(), -1);
18124    if (element.hasCompareToSourcePathElement())
18125      composeString(t, "TestScript", "compareToSourcePath", element.getCompareToSourcePathElement(), -1);
18126    if (element.hasContentTypeElement())
18127      composeCode(t, "TestScript", "contentType", element.getContentTypeElement(), -1);
18128    if (element.hasExpressionElement())
18129      composeString(t, "TestScript", "expression", element.getExpressionElement(), -1);
18130    if (element.hasHeaderFieldElement())
18131      composeString(t, "TestScript", "headerField", element.getHeaderFieldElement(), -1);
18132    if (element.hasMinimumIdElement())
18133      composeString(t, "TestScript", "minimumId", element.getMinimumIdElement(), -1);
18134    if (element.hasNavigationLinksElement())
18135      composeBoolean(t, "TestScript", "navigationLinks", element.getNavigationLinksElement(), -1);
18136    if (element.hasOperatorElement())
18137      composeEnum(t, "TestScript", "operator", element.getOperatorElement(), -1);
18138    if (element.hasPathElement())
18139      composeString(t, "TestScript", "path", element.getPathElement(), -1);
18140    if (element.hasRequestMethodElement())
18141      composeEnum(t, "TestScript", "requestMethod", element.getRequestMethodElement(), -1);
18142    if (element.hasRequestURLElement())
18143      composeString(t, "TestScript", "requestURL", element.getRequestURLElement(), -1);
18144    if (element.hasResourceElement())
18145      composeCode(t, "TestScript", "resource", element.getResourceElement(), -1);
18146    if (element.hasResponseElement())
18147      composeEnum(t, "TestScript", "response", element.getResponseElement(), -1);
18148    if (element.hasResponseCodeElement())
18149      composeString(t, "TestScript", "responseCode", element.getResponseCodeElement(), -1);
18150    if (element.hasSourceIdElement())
18151      composeId(t, "TestScript", "sourceId", element.getSourceIdElement(), -1);
18152    if (element.hasValidateProfileIdElement())
18153      composeId(t, "TestScript", "validateProfileId", element.getValidateProfileIdElement(), -1);
18154    if (element.hasValueElement())
18155      composeString(t, "TestScript", "value", element.getValueElement(), -1);
18156    if (element.hasWarningOnlyElement())
18157      composeBoolean(t, "TestScript", "warningOnly", element.getWarningOnlyElement(), -1);
18158  }
18159
18160  protected void composeTestScriptTestScriptTestComponent(Complex parent, String parentType, String name,
18161      TestScript.TestScriptTestComponent element, int index) {
18162    if (element == null)
18163      return;
18164    Complex t;
18165    if (Utilities.noString(parentType))
18166      t = parent;
18167    else {
18168      t = parent.predicate("fhir:" + parentType + '.' + name);
18169    }
18170    composeBackboneElement(t, "test", name, element, index);
18171    if (element.hasNameElement())
18172      composeString(t, "TestScript", "name", element.getNameElement(), -1);
18173    if (element.hasDescriptionElement())
18174      composeString(t, "TestScript", "description", element.getDescriptionElement(), -1);
18175    for (int i = 0; i < element.getAction().size(); i++)
18176      composeTestScriptTestActionComponent(t, "TestScript", "action", element.getAction().get(i), i);
18177  }
18178
18179  protected void composeTestScriptTestActionComponent(Complex parent, String parentType, String name,
18180      TestScript.TestActionComponent element, int index) {
18181    if (element == null)
18182      return;
18183    Complex t;
18184    if (Utilities.noString(parentType))
18185      t = parent;
18186    else {
18187      t = parent.predicate("fhir:" + parentType + '.' + name);
18188    }
18189    composeBackboneElement(t, "action", name, element, index);
18190    if (element.hasOperation())
18191      composeTestScriptSetupActionOperationComponent(t, "TestScript", "operation", element.getOperation(), -1);
18192    if (element.hasAssert())
18193      composeTestScriptSetupActionAssertComponent(t, "TestScript", "assert", element.getAssert(), -1);
18194  }
18195
18196  protected void composeTestScriptTestScriptTeardownComponent(Complex parent, String parentType, String name,
18197      TestScript.TestScriptTeardownComponent element, int index) {
18198    if (element == null)
18199      return;
18200    Complex t;
18201    if (Utilities.noString(parentType))
18202      t = parent;
18203    else {
18204      t = parent.predicate("fhir:" + parentType + '.' + name);
18205    }
18206    composeBackboneElement(t, "teardown", name, element, index);
18207    for (int i = 0; i < element.getAction().size(); i++)
18208      composeTestScriptTeardownActionComponent(t, "TestScript", "action", element.getAction().get(i), i);
18209  }
18210
18211  protected void composeTestScriptTeardownActionComponent(Complex parent, String parentType, String name,
18212      TestScript.TeardownActionComponent element, int index) {
18213    if (element == null)
18214      return;
18215    Complex t;
18216    if (Utilities.noString(parentType))
18217      t = parent;
18218    else {
18219      t = parent.predicate("fhir:" + parentType + '.' + name);
18220    }
18221    composeBackboneElement(t, "action", name, element, index);
18222    if (element.hasOperation())
18223      composeTestScriptSetupActionOperationComponent(t, "TestScript", "operation", element.getOperation(), -1);
18224  }
18225
18226  protected void composeValueSet(Complex parent, String parentType, String name, ValueSet element, int index) {
18227    if (element == null)
18228      return;
18229    Complex t;
18230    if (Utilities.noString(parentType))
18231      t = parent;
18232    else {
18233      t = parent.predicate("fhir:" + parentType + '.' + name);
18234    }
18235    composeDomainResource(t, "ValueSet", name, element, index);
18236    if (element.hasUrlElement())
18237      composeUri(t, "ValueSet", "url", element.getUrlElement(), -1);
18238    for (int i = 0; i < element.getIdentifier().size(); i++)
18239      composeIdentifier(t, "ValueSet", "identifier", element.getIdentifier().get(i), i);
18240    if (element.hasVersionElement())
18241      composeString(t, "ValueSet", "version", element.getVersionElement(), -1);
18242    if (element.hasNameElement())
18243      composeString(t, "ValueSet", "name", element.getNameElement(), -1);
18244    if (element.hasTitleElement())
18245      composeString(t, "ValueSet", "title", element.getTitleElement(), -1);
18246    if (element.hasStatusElement())
18247      composeEnum(t, "ValueSet", "status", element.getStatusElement(), -1);
18248    if (element.hasExperimentalElement())
18249      composeBoolean(t, "ValueSet", "experimental", element.getExperimentalElement(), -1);
18250    if (element.hasDateElement())
18251      composeDateTime(t, "ValueSet", "date", element.getDateElement(), -1);
18252    if (element.hasPublisherElement())
18253      composeString(t, "ValueSet", "publisher", element.getPublisherElement(), -1);
18254    for (int i = 0; i < element.getContact().size(); i++)
18255      composeContactDetail(t, "ValueSet", "contact", element.getContact().get(i), i);
18256    if (element.hasDescriptionElement())
18257      composeMarkdown(t, "ValueSet", "description", element.getDescriptionElement(), -1);
18258    for (int i = 0; i < element.getUseContext().size(); i++)
18259      composeUsageContext(t, "ValueSet", "useContext", element.getUseContext().get(i), i);
18260    for (int i = 0; i < element.getJurisdiction().size(); i++)
18261      composeCodeableConcept(t, "ValueSet", "jurisdiction", element.getJurisdiction().get(i), i);
18262    if (element.hasImmutableElement())
18263      composeBoolean(t, "ValueSet", "immutable", element.getImmutableElement(), -1);
18264    if (element.hasPurposeElement())
18265      composeMarkdown(t, "ValueSet", "purpose", element.getPurposeElement(), -1);
18266    if (element.hasCopyrightElement())
18267      composeMarkdown(t, "ValueSet", "copyright", element.getCopyrightElement(), -1);
18268    if (element.hasCompose())
18269      composeValueSetValueSetComposeComponent(t, "ValueSet", "compose", element.getCompose(), -1);
18270    if (element.hasExpansion())
18271      composeValueSetValueSetExpansionComponent(t, "ValueSet", "expansion", element.getExpansion(), -1);
18272  }
18273
18274  protected void composeValueSetValueSetComposeComponent(Complex parent, String parentType, String name,
18275      ValueSet.ValueSetComposeComponent element, int index) {
18276    if (element == null)
18277      return;
18278    Complex t;
18279    if (Utilities.noString(parentType))
18280      t = parent;
18281    else {
18282      t = parent.predicate("fhir:" + parentType + '.' + name);
18283    }
18284    composeBackboneElement(t, "compose", name, element, index);
18285    if (element.hasLockedDateElement())
18286      composeDate(t, "ValueSet", "lockedDate", element.getLockedDateElement(), -1);
18287    if (element.hasInactiveElement())
18288      composeBoolean(t, "ValueSet", "inactive", element.getInactiveElement(), -1);
18289    for (int i = 0; i < element.getInclude().size(); i++)
18290      composeValueSetConceptSetComponent(t, "ValueSet", "include", element.getInclude().get(i), i);
18291    for (int i = 0; i < element.getExclude().size(); i++)
18292      composeValueSetConceptSetComponent(t, "ValueSet", "exclude", element.getExclude().get(i), i);
18293  }
18294
18295  protected void composeValueSetConceptSetComponent(Complex parent, String parentType, String name,
18296      ValueSet.ConceptSetComponent element, int index) {
18297    if (element == null)
18298      return;
18299    Complex t;
18300    if (Utilities.noString(parentType))
18301      t = parent;
18302    else {
18303      t = parent.predicate("fhir:" + parentType + '.' + name);
18304    }
18305    composeBackboneElement(t, "include", name, element, index);
18306    if (element.hasSystemElement())
18307      composeUri(t, "ValueSet", "system", element.getSystemElement(), -1);
18308    if (element.hasVersionElement())
18309      composeString(t, "ValueSet", "version", element.getVersionElement(), -1);
18310    for (int i = 0; i < element.getConcept().size(); i++)
18311      composeValueSetConceptReferenceComponent(t, "ValueSet", "concept", element.getConcept().get(i), i);
18312    for (int i = 0; i < element.getFilter().size(); i++)
18313      composeValueSetConceptSetFilterComponent(t, "ValueSet", "filter", element.getFilter().get(i), i);
18314    for (int i = 0; i < element.getValueSet().size(); i++)
18315      composeCanonical(t, "ValueSet", "valueSet", element.getValueSet().get(i), i);
18316  }
18317
18318  protected void composeValueSetConceptReferenceComponent(Complex parent, String parentType, String name,
18319      ValueSet.ConceptReferenceComponent element, int index) {
18320    if (element == null)
18321      return;
18322    Complex t;
18323    if (Utilities.noString(parentType))
18324      t = parent;
18325    else {
18326      t = parent.predicate("fhir:" + parentType + '.' + name);
18327    }
18328    composeBackboneElement(t, "concept", name, element, index);
18329    if (element.hasCodeElement())
18330      composeCode(t, "ValueSet", "code", element.getCodeElement(), -1);
18331    if (element.hasDisplayElement())
18332      composeString(t, "ValueSet", "display", element.getDisplayElement(), -1);
18333    for (int i = 0; i < element.getDesignation().size(); i++)
18334      composeValueSetConceptReferenceDesignationComponent(t, "ValueSet", "designation", element.getDesignation().get(i),
18335          i);
18336  }
18337
18338  protected void composeValueSetConceptReferenceDesignationComponent(Complex parent, String parentType, String name,
18339      ValueSet.ConceptReferenceDesignationComponent element, int index) {
18340    if (element == null)
18341      return;
18342    Complex t;
18343    if (Utilities.noString(parentType))
18344      t = parent;
18345    else {
18346      t = parent.predicate("fhir:" + parentType + '.' + name);
18347    }
18348    composeBackboneElement(t, "designation", name, element, index);
18349    if (element.hasLanguageElement())
18350      composeCode(t, "ValueSet", "language", element.getLanguageElement(), -1);
18351    if (element.hasUse())
18352      composeCoding(t, "ValueSet", "use", element.getUse(), -1);
18353    if (element.hasValueElement())
18354      composeString(t, "ValueSet", "value", element.getValueElement(), -1);
18355  }
18356
18357  protected void composeValueSetConceptSetFilterComponent(Complex parent, String parentType, String name,
18358      ValueSet.ConceptSetFilterComponent element, int index) {
18359    if (element == null)
18360      return;
18361    Complex t;
18362    if (Utilities.noString(parentType))
18363      t = parent;
18364    else {
18365      t = parent.predicate("fhir:" + parentType + '.' + name);
18366    }
18367    composeBackboneElement(t, "filter", name, element, index);
18368    if (element.hasPropertyElement())
18369      composeCode(t, "ValueSet", "property", element.getPropertyElement(), -1);
18370    if (element.hasOpElement())
18371      composeEnum(t, "ValueSet", "op", element.getOpElement(), -1);
18372    if (element.hasValueElement())
18373      composeString(t, "ValueSet", "value", element.getValueElement(), -1);
18374  }
18375
18376  protected void composeValueSetValueSetExpansionComponent(Complex parent, String parentType, String name,
18377      ValueSet.ValueSetExpansionComponent element, int index) {
18378    if (element == null)
18379      return;
18380    Complex t;
18381    if (Utilities.noString(parentType))
18382      t = parent;
18383    else {
18384      t = parent.predicate("fhir:" + parentType + '.' + name);
18385    }
18386    composeBackboneElement(t, "expansion", name, element, index);
18387    if (element.hasIdentifierElement())
18388      composeUri(t, "ValueSet", "identifier", element.getIdentifierElement(), -1);
18389    if (element.hasTimestampElement())
18390      composeDateTime(t, "ValueSet", "timestamp", element.getTimestampElement(), -1);
18391    if (element.hasTotalElement())
18392      composeInteger(t, "ValueSet", "total", element.getTotalElement(), -1);
18393    if (element.hasOffsetElement())
18394      composeInteger(t, "ValueSet", "offset", element.getOffsetElement(), -1);
18395    for (int i = 0; i < element.getParameter().size(); i++)
18396      composeValueSetValueSetExpansionParameterComponent(t, "ValueSet", "parameter", element.getParameter().get(i), i);
18397    for (int i = 0; i < element.getContains().size(); i++)
18398      composeValueSetValueSetExpansionContainsComponent(t, "ValueSet", "contains", element.getContains().get(i), i);
18399  }
18400
18401  protected void composeValueSetValueSetExpansionParameterComponent(Complex parent, String parentType, String name,
18402      ValueSet.ValueSetExpansionParameterComponent element, int index) {
18403    if (element == null)
18404      return;
18405    Complex t;
18406    if (Utilities.noString(parentType))
18407      t = parent;
18408    else {
18409      t = parent.predicate("fhir:" + parentType + '.' + name);
18410    }
18411    composeBackboneElement(t, "parameter", name, element, index);
18412    if (element.hasNameElement())
18413      composeString(t, "ValueSet", "name", element.getNameElement(), -1);
18414    if (element.hasValue())
18415      composeType(t, "ValueSet", "value", element.getValue(), -1);
18416  }
18417
18418  protected void composeValueSetValueSetExpansionContainsComponent(Complex parent, String parentType, String name,
18419      ValueSet.ValueSetExpansionContainsComponent element, int index) {
18420    if (element == null)
18421      return;
18422    Complex t;
18423    if (Utilities.noString(parentType))
18424      t = parent;
18425    else {
18426      t = parent.predicate("fhir:" + parentType + '.' + name);
18427    }
18428    composeBackboneElement(t, "contains", name, element, index);
18429    if (element.hasSystemElement())
18430      composeUri(t, "ValueSet", "system", element.getSystemElement(), -1);
18431    if (element.hasAbstractElement())
18432      composeBoolean(t, "ValueSet", "abstract", element.getAbstractElement(), -1);
18433    if (element.hasInactiveElement())
18434      composeBoolean(t, "ValueSet", "inactive", element.getInactiveElement(), -1);
18435    if (element.hasVersionElement())
18436      composeString(t, "ValueSet", "version", element.getVersionElement(), -1);
18437    if (element.hasCodeElement())
18438      composeCode(t, "ValueSet", "code", element.getCodeElement(), -1);
18439    if (element.hasDisplayElement())
18440      composeString(t, "ValueSet", "display", element.getDisplayElement(), -1);
18441    for (int i = 0; i < element.getDesignation().size(); i++)
18442      composeValueSetConceptReferenceDesignationComponent(t, "ValueSet", "designation", element.getDesignation().get(i),
18443          i);
18444    for (int i = 0; i < element.getContains().size(); i++)
18445      composeValueSetValueSetExpansionContainsComponent(t, "ValueSet", "contains", element.getContains().get(i), i);
18446  }
18447
18448  protected void composeVerificationResult(Complex parent, String parentType, String name, VerificationResult element,
18449      int index) {
18450    if (element == null)
18451      return;
18452    Complex t;
18453    if (Utilities.noString(parentType))
18454      t = parent;
18455    else {
18456      t = parent.predicate("fhir:" + parentType + '.' + name);
18457    }
18458    composeDomainResource(t, "VerificationResult", name, element, index);
18459    for (int i = 0; i < element.getTarget().size(); i++)
18460      composeReference(t, "VerificationResult", "target", element.getTarget().get(i), i);
18461    for (int i = 0; i < element.getTargetLocation().size(); i++)
18462      composeString(t, "VerificationResult", "targetLocation", element.getTargetLocation().get(i), i);
18463    if (element.hasNeed())
18464      composeCodeableConcept(t, "VerificationResult", "need", element.getNeed(), -1);
18465    if (element.hasStatusElement())
18466      composeEnum(t, "VerificationResult", "status", element.getStatusElement(), -1);
18467    if (element.hasStatusDateElement())
18468      composeDateTime(t, "VerificationResult", "statusDate", element.getStatusDateElement(), -1);
18469    if (element.hasValidationType())
18470      composeCodeableConcept(t, "VerificationResult", "validationType", element.getValidationType(), -1);
18471    for (int i = 0; i < element.getValidationProcess().size(); i++)
18472      composeCodeableConcept(t, "VerificationResult", "validationProcess", element.getValidationProcess().get(i), i);
18473    if (element.hasFrequency())
18474      composeTiming(t, "VerificationResult", "frequency", element.getFrequency(), -1);
18475    if (element.hasLastPerformedElement())
18476      composeDateTime(t, "VerificationResult", "lastPerformed", element.getLastPerformedElement(), -1);
18477    if (element.hasNextScheduledElement())
18478      composeDate(t, "VerificationResult", "nextScheduled", element.getNextScheduledElement(), -1);
18479    if (element.hasFailureAction())
18480      composeCodeableConcept(t, "VerificationResult", "failureAction", element.getFailureAction(), -1);
18481    for (int i = 0; i < element.getPrimarySource().size(); i++)
18482      composeVerificationResultVerificationResultPrimarySourceComponent(t, "VerificationResult", "primarySource",
18483          element.getPrimarySource().get(i), i);
18484    if (element.hasAttestation())
18485      composeVerificationResultVerificationResultAttestationComponent(t, "VerificationResult", "attestation",
18486          element.getAttestation(), -1);
18487    for (int i = 0; i < element.getValidator().size(); i++)
18488      composeVerificationResultVerificationResultValidatorComponent(t, "VerificationResult", "validator",
18489          element.getValidator().get(i), i);
18490  }
18491
18492  protected void composeVerificationResultVerificationResultPrimarySourceComponent(Complex parent, String parentType,
18493      String name, VerificationResult.VerificationResultPrimarySourceComponent element, int index) {
18494    if (element == null)
18495      return;
18496    Complex t;
18497    if (Utilities.noString(parentType))
18498      t = parent;
18499    else {
18500      t = parent.predicate("fhir:" + parentType + '.' + name);
18501    }
18502    composeBackboneElement(t, "primarySource", name, element, index);
18503    if (element.hasWho())
18504      composeReference(t, "VerificationResult", "who", element.getWho(), -1);
18505    for (int i = 0; i < element.getType().size(); i++)
18506      composeCodeableConcept(t, "VerificationResult", "type", element.getType().get(i), i);
18507    for (int i = 0; i < element.getCommunicationMethod().size(); i++)
18508      composeCodeableConcept(t, "VerificationResult", "communicationMethod", element.getCommunicationMethod().get(i),
18509          i);
18510    if (element.hasValidationStatus())
18511      composeCodeableConcept(t, "VerificationResult", "validationStatus", element.getValidationStatus(), -1);
18512    if (element.hasValidationDateElement())
18513      composeDateTime(t, "VerificationResult", "validationDate", element.getValidationDateElement(), -1);
18514    if (element.hasCanPushUpdates())
18515      composeCodeableConcept(t, "VerificationResult", "canPushUpdates", element.getCanPushUpdates(), -1);
18516    for (int i = 0; i < element.getPushTypeAvailable().size(); i++)
18517      composeCodeableConcept(t, "VerificationResult", "pushTypeAvailable", element.getPushTypeAvailable().get(i), i);
18518  }
18519
18520  protected void composeVerificationResultVerificationResultAttestationComponent(Complex parent, String parentType,
18521      String name, VerificationResult.VerificationResultAttestationComponent element, int index) {
18522    if (element == null)
18523      return;
18524    Complex t;
18525    if (Utilities.noString(parentType))
18526      t = parent;
18527    else {
18528      t = parent.predicate("fhir:" + parentType + '.' + name);
18529    }
18530    composeBackboneElement(t, "attestation", name, element, index);
18531    if (element.hasWho())
18532      composeReference(t, "VerificationResult", "who", element.getWho(), -1);
18533    if (element.hasOnBehalfOf())
18534      composeReference(t, "VerificationResult", "onBehalfOf", element.getOnBehalfOf(), -1);
18535    if (element.hasCommunicationMethod())
18536      composeCodeableConcept(t, "VerificationResult", "communicationMethod", element.getCommunicationMethod(), -1);
18537    if (element.hasDateElement())
18538      composeDate(t, "VerificationResult", "date", element.getDateElement(), -1);
18539    if (element.hasSourceIdentityCertificateElement())
18540      composeString(t, "VerificationResult", "sourceIdentityCertificate", element.getSourceIdentityCertificateElement(),
18541          -1);
18542    if (element.hasProxyIdentityCertificateElement())
18543      composeString(t, "VerificationResult", "proxyIdentityCertificate", element.getProxyIdentityCertificateElement(),
18544          -1);
18545    if (element.hasProxySignature())
18546      composeSignature(t, "VerificationResult", "proxySignature", element.getProxySignature(), -1);
18547    if (element.hasSourceSignature())
18548      composeSignature(t, "VerificationResult", "sourceSignature", element.getSourceSignature(), -1);
18549  }
18550
18551  protected void composeVerificationResultVerificationResultValidatorComponent(Complex parent, String parentType,
18552      String name, VerificationResult.VerificationResultValidatorComponent element, int index) {
18553    if (element == null)
18554      return;
18555    Complex t;
18556    if (Utilities.noString(parentType))
18557      t = parent;
18558    else {
18559      t = parent.predicate("fhir:" + parentType + '.' + name);
18560    }
18561    composeBackboneElement(t, "validator", name, element, index);
18562    if (element.hasOrganization())
18563      composeReference(t, "VerificationResult", "organization", element.getOrganization(), -1);
18564    if (element.hasIdentityCertificateElement())
18565      composeString(t, "VerificationResult", "identityCertificate", element.getIdentityCertificateElement(), -1);
18566    if (element.hasAttestationSignature())
18567      composeSignature(t, "VerificationResult", "attestationSignature", element.getAttestationSignature(), -1);
18568  }
18569
18570  protected void composeVisionPrescription(Complex parent, String parentType, String name, VisionPrescription element,
18571      int index) {
18572    if (element == null)
18573      return;
18574    Complex t;
18575    if (Utilities.noString(parentType))
18576      t = parent;
18577    else {
18578      t = parent.predicate("fhir:" + parentType + '.' + name);
18579    }
18580    composeDomainResource(t, "VisionPrescription", name, element, index);
18581    for (int i = 0; i < element.getIdentifier().size(); i++)
18582      composeIdentifier(t, "VisionPrescription", "identifier", element.getIdentifier().get(i), i);
18583    if (element.hasStatusElement())
18584      composeEnum(t, "VisionPrescription", "status", element.getStatusElement(), -1);
18585    if (element.hasCreatedElement())
18586      composeDateTime(t, "VisionPrescription", "created", element.getCreatedElement(), -1);
18587    if (element.hasPatient())
18588      composeReference(t, "VisionPrescription", "patient", element.getPatient(), -1);
18589    if (element.hasEncounter())
18590      composeReference(t, "VisionPrescription", "encounter", element.getEncounter(), -1);
18591    if (element.hasDateWrittenElement())
18592      composeDateTime(t, "VisionPrescription", "dateWritten", element.getDateWrittenElement(), -1);
18593    if (element.hasPrescriber())
18594      composeReference(t, "VisionPrescription", "prescriber", element.getPrescriber(), -1);
18595    for (int i = 0; i < element.getLensSpecification().size(); i++)
18596      composeVisionPrescriptionVisionPrescriptionLensSpecificationComponent(t, "VisionPrescription",
18597          "lensSpecification", element.getLensSpecification().get(i), i);
18598  }
18599
18600  protected void composeVisionPrescriptionVisionPrescriptionLensSpecificationComponent(Complex parent,
18601      String parentType, String name, VisionPrescription.VisionPrescriptionLensSpecificationComponent element,
18602      int index) {
18603    if (element == null)
18604      return;
18605    Complex t;
18606    if (Utilities.noString(parentType))
18607      t = parent;
18608    else {
18609      t = parent.predicate("fhir:" + parentType + '.' + name);
18610    }
18611    composeBackboneElement(t, "lensSpecification", name, element, index);
18612    if (element.hasProduct())
18613      composeCodeableConcept(t, "VisionPrescription", "product", element.getProduct(), -1);
18614    if (element.hasEyeElement())
18615      composeEnum(t, "VisionPrescription", "eye", element.getEyeElement(), -1);
18616    if (element.hasSphereElement())
18617      composeDecimal(t, "VisionPrescription", "sphere", element.getSphereElement(), -1);
18618    if (element.hasCylinderElement())
18619      composeDecimal(t, "VisionPrescription", "cylinder", element.getCylinderElement(), -1);
18620    if (element.hasAxisElement())
18621      composeInteger(t, "VisionPrescription", "axis", element.getAxisElement(), -1);
18622    for (int i = 0; i < element.getPrism().size(); i++)
18623      composeVisionPrescriptionPrismComponent(t, "VisionPrescription", "prism", element.getPrism().get(i), i);
18624    if (element.hasAddElement())
18625      composeDecimal(t, "VisionPrescription", "add", element.getAddElement(), -1);
18626    if (element.hasPowerElement())
18627      composeDecimal(t, "VisionPrescription", "power", element.getPowerElement(), -1);
18628    if (element.hasBackCurveElement())
18629      composeDecimal(t, "VisionPrescription", "backCurve", element.getBackCurveElement(), -1);
18630    if (element.hasDiameterElement())
18631      composeDecimal(t, "VisionPrescription", "diameter", element.getDiameterElement(), -1);
18632    if (element.hasDuration())
18633      composeQuantity(t, "VisionPrescription", "duration", element.getDuration(), -1);
18634    if (element.hasColorElement())
18635      composeString(t, "VisionPrescription", "color", element.getColorElement(), -1);
18636    if (element.hasBrandElement())
18637      composeString(t, "VisionPrescription", "brand", element.getBrandElement(), -1);
18638    for (int i = 0; i < element.getNote().size(); i++)
18639      composeAnnotation(t, "VisionPrescription", "note", element.getNote().get(i), i);
18640  }
18641
18642  protected void composeVisionPrescriptionPrismComponent(Complex parent, String parentType, String name,
18643      VisionPrescription.PrismComponent element, int index) {
18644    if (element == null)
18645      return;
18646    Complex t;
18647    if (Utilities.noString(parentType))
18648      t = parent;
18649    else {
18650      t = parent.predicate("fhir:" + parentType + '.' + name);
18651    }
18652    composeBackboneElement(t, "prism", name, element, index);
18653    if (element.hasAmountElement())
18654      composeDecimal(t, "VisionPrescription", "amount", element.getAmountElement(), -1);
18655    if (element.hasBaseElement())
18656      composeEnum(t, "VisionPrescription", "base", element.getBaseElement(), -1);
18657  }
18658
18659  @Override
18660  protected void composeResource(Complex parent, Resource resource) {
18661    if (resource instanceof Parameters)
18662      composeParameters(parent, null, "Parameters", (Parameters) resource, -1);
18663    else if (resource instanceof Account)
18664      composeAccount(parent, null, "Account", (Account) resource, -1);
18665    else if (resource instanceof ActivityDefinition)
18666      composeActivityDefinition(parent, null, "ActivityDefinition", (ActivityDefinition) resource, -1);
18667    else if (resource instanceof AdverseEvent)
18668      composeAdverseEvent(parent, null, "AdverseEvent", (AdverseEvent) resource, -1);
18669    else if (resource instanceof AllergyIntolerance)
18670      composeAllergyIntolerance(parent, null, "AllergyIntolerance", (AllergyIntolerance) resource, -1);
18671    else if (resource instanceof Appointment)
18672      composeAppointment(parent, null, "Appointment", (Appointment) resource, -1);
18673    else if (resource instanceof AppointmentResponse)
18674      composeAppointmentResponse(parent, null, "AppointmentResponse", (AppointmentResponse) resource, -1);
18675    else if (resource instanceof AuditEvent)
18676      composeAuditEvent(parent, null, "AuditEvent", (AuditEvent) resource, -1);
18677    else if (resource instanceof Basic)
18678      composeBasic(parent, null, "Basic", (Basic) resource, -1);
18679    else if (resource instanceof Binary)
18680      composeBinary(parent, null, "Binary", (Binary) resource, -1);
18681    else if (resource instanceof BiologicallyDerivedProduct)
18682      composeBiologicallyDerivedProduct(parent, null, "BiologicallyDerivedProduct",
18683          (BiologicallyDerivedProduct) resource, -1);
18684    else if (resource instanceof BodyStructure)
18685      composeBodyStructure(parent, null, "BodyStructure", (BodyStructure) resource, -1);
18686    else if (resource instanceof Bundle)
18687      composeBundle(parent, null, "Bundle", (Bundle) resource, -1);
18688    else if (resource instanceof CapabilityStatement)
18689      composeCapabilityStatement(parent, null, "CapabilityStatement", (CapabilityStatement) resource, -1);
18690    else if (resource instanceof CarePlan)
18691      composeCarePlan(parent, null, "CarePlan", (CarePlan) resource, -1);
18692    else if (resource instanceof CareTeam)
18693      composeCareTeam(parent, null, "CareTeam", (CareTeam) resource, -1);
18694    else if (resource instanceof CatalogEntry)
18695      composeCatalogEntry(parent, null, "CatalogEntry", (CatalogEntry) resource, -1);
18696    else if (resource instanceof ChargeItem)
18697      composeChargeItem(parent, null, "ChargeItem", (ChargeItem) resource, -1);
18698    else if (resource instanceof ChargeItemDefinition)
18699      composeChargeItemDefinition(parent, null, "ChargeItemDefinition", (ChargeItemDefinition) resource, -1);
18700    else if (resource instanceof Claim)
18701      composeClaim(parent, null, "Claim", (Claim) resource, -1);
18702    else if (resource instanceof ClaimResponse)
18703      composeClaimResponse(parent, null, "ClaimResponse", (ClaimResponse) resource, -1);
18704    else if (resource instanceof ClinicalImpression)
18705      composeClinicalImpression(parent, null, "ClinicalImpression", (ClinicalImpression) resource, -1);
18706    else if (resource instanceof CodeSystem)
18707      composeCodeSystem(parent, null, "CodeSystem", (CodeSystem) resource, -1);
18708    else if (resource instanceof Communication)
18709      composeCommunication(parent, null, "Communication", (Communication) resource, -1);
18710    else if (resource instanceof CommunicationRequest)
18711      composeCommunicationRequest(parent, null, "CommunicationRequest", (CommunicationRequest) resource, -1);
18712    else if (resource instanceof CompartmentDefinition)
18713      composeCompartmentDefinition(parent, null, "CompartmentDefinition", (CompartmentDefinition) resource, -1);
18714    else if (resource instanceof Composition)
18715      composeComposition(parent, null, "Composition", (Composition) resource, -1);
18716    else if (resource instanceof ConceptMap)
18717      composeConceptMap(parent, null, "ConceptMap", (ConceptMap) resource, -1);
18718    else if (resource instanceof Condition)
18719      composeCondition(parent, null, "Condition", (Condition) resource, -1);
18720    else if (resource instanceof Consent)
18721      composeConsent(parent, null, "Consent", (Consent) resource, -1);
18722    else if (resource instanceof Contract)
18723      composeContract(parent, null, "Contract", (Contract) resource, -1);
18724    else if (resource instanceof Coverage)
18725      composeCoverage(parent, null, "Coverage", (Coverage) resource, -1);
18726    else if (resource instanceof CoverageEligibilityRequest)
18727      composeCoverageEligibilityRequest(parent, null, "CoverageEligibilityRequest",
18728          (CoverageEligibilityRequest) resource, -1);
18729    else if (resource instanceof CoverageEligibilityResponse)
18730      composeCoverageEligibilityResponse(parent, null, "CoverageEligibilityResponse",
18731          (CoverageEligibilityResponse) resource, -1);
18732    else if (resource instanceof DetectedIssue)
18733      composeDetectedIssue(parent, null, "DetectedIssue", (DetectedIssue) resource, -1);
18734    else if (resource instanceof Device)
18735      composeDevice(parent, null, "Device", (Device) resource, -1);
18736    else if (resource instanceof DeviceDefinition)
18737      composeDeviceDefinition(parent, null, "DeviceDefinition", (DeviceDefinition) resource, -1);
18738    else if (resource instanceof DeviceMetric)
18739      composeDeviceMetric(parent, null, "DeviceMetric", (DeviceMetric) resource, -1);
18740    else if (resource instanceof DeviceRequest)
18741      composeDeviceRequest(parent, null, "DeviceRequest", (DeviceRequest) resource, -1);
18742    else if (resource instanceof DeviceUseStatement)
18743      composeDeviceUseStatement(parent, null, "DeviceUseStatement", (DeviceUseStatement) resource, -1);
18744    else if (resource instanceof DiagnosticReport)
18745      composeDiagnosticReport(parent, null, "DiagnosticReport", (DiagnosticReport) resource, -1);
18746    else if (resource instanceof DocumentManifest)
18747      composeDocumentManifest(parent, null, "DocumentManifest", (DocumentManifest) resource, -1);
18748    else if (resource instanceof DocumentReference)
18749      composeDocumentReference(parent, null, "DocumentReference", (DocumentReference) resource, -1);
18750    else if (resource instanceof EffectEvidenceSynthesis)
18751      composeEffectEvidenceSynthesis(parent, null, "EffectEvidenceSynthesis", (EffectEvidenceSynthesis) resource, -1);
18752    else if (resource instanceof Encounter)
18753      composeEncounter(parent, null, "Encounter", (Encounter) resource, -1);
18754    else if (resource instanceof Endpoint)
18755      composeEndpoint(parent, null, "Endpoint", (Endpoint) resource, -1);
18756    else if (resource instanceof EnrollmentRequest)
18757      composeEnrollmentRequest(parent, null, "EnrollmentRequest", (EnrollmentRequest) resource, -1);
18758    else if (resource instanceof EnrollmentResponse)
18759      composeEnrollmentResponse(parent, null, "EnrollmentResponse", (EnrollmentResponse) resource, -1);
18760    else if (resource instanceof EpisodeOfCare)
18761      composeEpisodeOfCare(parent, null, "EpisodeOfCare", (EpisodeOfCare) resource, -1);
18762    else if (resource instanceof EventDefinition)
18763      composeEventDefinition(parent, null, "EventDefinition", (EventDefinition) resource, -1);
18764    else if (resource instanceof Evidence)
18765      composeEvidence(parent, null, "Evidence", (Evidence) resource, -1);
18766    else if (resource instanceof EvidenceVariable)
18767      composeEvidenceVariable(parent, null, "EvidenceVariable", (EvidenceVariable) resource, -1);
18768    else if (resource instanceof ExampleScenario)
18769      composeExampleScenario(parent, null, "ExampleScenario", (ExampleScenario) resource, -1);
18770    else if (resource instanceof ExplanationOfBenefit)
18771      composeExplanationOfBenefit(parent, null, "ExplanationOfBenefit", (ExplanationOfBenefit) resource, -1);
18772    else if (resource instanceof FamilyMemberHistory)
18773      composeFamilyMemberHistory(parent, null, "FamilyMemberHistory", (FamilyMemberHistory) resource, -1);
18774    else if (resource instanceof Flag)
18775      composeFlag(parent, null, "Flag", (Flag) resource, -1);
18776    else if (resource instanceof Goal)
18777      composeGoal(parent, null, "Goal", (Goal) resource, -1);
18778    else if (resource instanceof GraphDefinition)
18779      composeGraphDefinition(parent, null, "GraphDefinition", (GraphDefinition) resource, -1);
18780    else if (resource instanceof Group)
18781      composeGroup(parent, null, "Group", (Group) resource, -1);
18782    else if (resource instanceof GuidanceResponse)
18783      composeGuidanceResponse(parent, null, "GuidanceResponse", (GuidanceResponse) resource, -1);
18784    else if (resource instanceof HealthcareService)
18785      composeHealthcareService(parent, null, "HealthcareService", (HealthcareService) resource, -1);
18786    else if (resource instanceof ImagingStudy)
18787      composeImagingStudy(parent, null, "ImagingStudy", (ImagingStudy) resource, -1);
18788    else if (resource instanceof Immunization)
18789      composeImmunization(parent, null, "Immunization", (Immunization) resource, -1);
18790    else if (resource instanceof ImmunizationEvaluation)
18791      composeImmunizationEvaluation(parent, null, "ImmunizationEvaluation", (ImmunizationEvaluation) resource, -1);
18792    else if (resource instanceof ImmunizationRecommendation)
18793      composeImmunizationRecommendation(parent, null, "ImmunizationRecommendation",
18794          (ImmunizationRecommendation) resource, -1);
18795    else if (resource instanceof ImplementationGuide)
18796      composeImplementationGuide(parent, null, "ImplementationGuide", (ImplementationGuide) resource, -1);
18797    else if (resource instanceof InsurancePlan)
18798      composeInsurancePlan(parent, null, "InsurancePlan", (InsurancePlan) resource, -1);
18799    else if (resource instanceof Invoice)
18800      composeInvoice(parent, null, "Invoice", (Invoice) resource, -1);
18801    else if (resource instanceof Library)
18802      composeLibrary(parent, null, "Library", (Library) resource, -1);
18803    else if (resource instanceof Linkage)
18804      composeLinkage(parent, null, "Linkage", (Linkage) resource, -1);
18805    else if (resource instanceof ListResource)
18806      composeListResource(parent, null, "ListResource", (ListResource) resource, -1);
18807    else if (resource instanceof Location)
18808      composeLocation(parent, null, "Location", (Location) resource, -1);
18809    else if (resource instanceof Measure)
18810      composeMeasure(parent, null, "Measure", (Measure) resource, -1);
18811    else if (resource instanceof MeasureReport)
18812      composeMeasureReport(parent, null, "MeasureReport", (MeasureReport) resource, -1);
18813    else if (resource instanceof Media)
18814      composeMedia(parent, null, "Media", (Media) resource, -1);
18815    else if (resource instanceof Medication)
18816      composeMedication(parent, null, "Medication", (Medication) resource, -1);
18817    else if (resource instanceof MedicationAdministration)
18818      composeMedicationAdministration(parent, null, "MedicationAdministration", (MedicationAdministration) resource,
18819          -1);
18820    else if (resource instanceof MedicationDispense)
18821      composeMedicationDispense(parent, null, "MedicationDispense", (MedicationDispense) resource, -1);
18822    else if (resource instanceof MedicationKnowledge)
18823      composeMedicationKnowledge(parent, null, "MedicationKnowledge", (MedicationKnowledge) resource, -1);
18824    else if (resource instanceof MedicationRequest)
18825      composeMedicationRequest(parent, null, "MedicationRequest", (MedicationRequest) resource, -1);
18826    else if (resource instanceof MedicationStatement)
18827      composeMedicationStatement(parent, null, "MedicationStatement", (MedicationStatement) resource, -1);
18828    else if (resource instanceof MedicinalProduct)
18829      composeMedicinalProduct(parent, null, "MedicinalProduct", (MedicinalProduct) resource, -1);
18830    else if (resource instanceof MedicinalProductAuthorization)
18831      composeMedicinalProductAuthorization(parent, null, "MedicinalProductAuthorization",
18832          (MedicinalProductAuthorization) resource, -1);
18833    else if (resource instanceof MedicinalProductContraindication)
18834      composeMedicinalProductContraindication(parent, null, "MedicinalProductContraindication",
18835          (MedicinalProductContraindication) resource, -1);
18836    else if (resource instanceof MedicinalProductIndication)
18837      composeMedicinalProductIndication(parent, null, "MedicinalProductIndication",
18838          (MedicinalProductIndication) resource, -1);
18839    else if (resource instanceof MedicinalProductIngredient)
18840      composeMedicinalProductIngredient(parent, null, "MedicinalProductIngredient",
18841          (MedicinalProductIngredient) resource, -1);
18842    else if (resource instanceof MedicinalProductInteraction)
18843      composeMedicinalProductInteraction(parent, null, "MedicinalProductInteraction",
18844          (MedicinalProductInteraction) resource, -1);
18845    else if (resource instanceof MedicinalProductManufactured)
18846      composeMedicinalProductManufactured(parent, null, "MedicinalProductManufactured",
18847          (MedicinalProductManufactured) resource, -1);
18848    else if (resource instanceof MedicinalProductPackaged)
18849      composeMedicinalProductPackaged(parent, null, "MedicinalProductPackaged", (MedicinalProductPackaged) resource,
18850          -1);
18851    else if (resource instanceof MedicinalProductPharmaceutical)
18852      composeMedicinalProductPharmaceutical(parent, null, "MedicinalProductPharmaceutical",
18853          (MedicinalProductPharmaceutical) resource, -1);
18854    else if (resource instanceof MedicinalProductUndesirableEffect)
18855      composeMedicinalProductUndesirableEffect(parent, null, "MedicinalProductUndesirableEffect",
18856          (MedicinalProductUndesirableEffect) resource, -1);
18857    else if (resource instanceof MessageDefinition)
18858      composeMessageDefinition(parent, null, "MessageDefinition", (MessageDefinition) resource, -1);
18859    else if (resource instanceof MessageHeader)
18860      composeMessageHeader(parent, null, "MessageHeader", (MessageHeader) resource, -1);
18861    else if (resource instanceof MolecularSequence)
18862      composeMolecularSequence(parent, null, "MolecularSequence", (MolecularSequence) resource, -1);
18863    else if (resource instanceof NamingSystem)
18864      composeNamingSystem(parent, null, "NamingSystem", (NamingSystem) resource, -1);
18865    else if (resource instanceof NutritionOrder)
18866      composeNutritionOrder(parent, null, "NutritionOrder", (NutritionOrder) resource, -1);
18867    else if (resource instanceof Observation)
18868      composeObservation(parent, null, "Observation", (Observation) resource, -1);
18869    else if (resource instanceof ObservationDefinition)
18870      composeObservationDefinition(parent, null, "ObservationDefinition", (ObservationDefinition) resource, -1);
18871    else if (resource instanceof OperationDefinition)
18872      composeOperationDefinition(parent, null, "OperationDefinition", (OperationDefinition) resource, -1);
18873    else if (resource instanceof OperationOutcome)
18874      composeOperationOutcome(parent, null, "OperationOutcome", (OperationOutcome) resource, -1);
18875    else if (resource instanceof Organization)
18876      composeOrganization(parent, null, "Organization", (Organization) resource, -1);
18877    else if (resource instanceof OrganizationAffiliation)
18878      composeOrganizationAffiliation(parent, null, "OrganizationAffiliation", (OrganizationAffiliation) resource, -1);
18879    else if (resource instanceof Patient)
18880      composePatient(parent, null, "Patient", (Patient) resource, -1);
18881    else if (resource instanceof PaymentNotice)
18882      composePaymentNotice(parent, null, "PaymentNotice", (PaymentNotice) resource, -1);
18883    else if (resource instanceof PaymentReconciliation)
18884      composePaymentReconciliation(parent, null, "PaymentReconciliation", (PaymentReconciliation) resource, -1);
18885    else if (resource instanceof Person)
18886      composePerson(parent, null, "Person", (Person) resource, -1);
18887    else if (resource instanceof PlanDefinition)
18888      composePlanDefinition(parent, null, "PlanDefinition", (PlanDefinition) resource, -1);
18889    else if (resource instanceof Practitioner)
18890      composePractitioner(parent, null, "Practitioner", (Practitioner) resource, -1);
18891    else if (resource instanceof PractitionerRole)
18892      composePractitionerRole(parent, null, "PractitionerRole", (PractitionerRole) resource, -1);
18893    else if (resource instanceof Procedure)
18894      composeProcedure(parent, null, "Procedure", (Procedure) resource, -1);
18895    else if (resource instanceof Provenance)
18896      composeProvenance(parent, null, "Provenance", (Provenance) resource, -1);
18897    else if (resource instanceof Questionnaire)
18898      composeQuestionnaire(parent, null, "Questionnaire", (Questionnaire) resource, -1);
18899    else if (resource instanceof QuestionnaireResponse)
18900      composeQuestionnaireResponse(parent, null, "QuestionnaireResponse", (QuestionnaireResponse) resource, -1);
18901    else if (resource instanceof RelatedPerson)
18902      composeRelatedPerson(parent, null, "RelatedPerson", (RelatedPerson) resource, -1);
18903    else if (resource instanceof RequestGroup)
18904      composeRequestGroup(parent, null, "RequestGroup", (RequestGroup) resource, -1);
18905    else if (resource instanceof ResearchDefinition)
18906      composeResearchDefinition(parent, null, "ResearchDefinition", (ResearchDefinition) resource, -1);
18907    else if (resource instanceof ResearchElementDefinition)
18908      composeResearchElementDefinition(parent, null, "ResearchElementDefinition", (ResearchElementDefinition) resource,
18909          -1);
18910    else if (resource instanceof ResearchStudy)
18911      composeResearchStudy(parent, null, "ResearchStudy", (ResearchStudy) resource, -1);
18912    else if (resource instanceof ResearchSubject)
18913      composeResearchSubject(parent, null, "ResearchSubject", (ResearchSubject) resource, -1);
18914    else if (resource instanceof RiskAssessment)
18915      composeRiskAssessment(parent, null, "RiskAssessment", (RiskAssessment) resource, -1);
18916    else if (resource instanceof RiskEvidenceSynthesis)
18917      composeRiskEvidenceSynthesis(parent, null, "RiskEvidenceSynthesis", (RiskEvidenceSynthesis) resource, -1);
18918    else if (resource instanceof Schedule)
18919      composeSchedule(parent, null, "Schedule", (Schedule) resource, -1);
18920    else if (resource instanceof SearchParameter)
18921      composeSearchParameter(parent, null, "SearchParameter", (SearchParameter) resource, -1);
18922    else if (resource instanceof ServiceRequest)
18923      composeServiceRequest(parent, null, "ServiceRequest", (ServiceRequest) resource, -1);
18924    else if (resource instanceof Slot)
18925      composeSlot(parent, null, "Slot", (Slot) resource, -1);
18926    else if (resource instanceof Specimen)
18927      composeSpecimen(parent, null, "Specimen", (Specimen) resource, -1);
18928    else if (resource instanceof SpecimenDefinition)
18929      composeSpecimenDefinition(parent, null, "SpecimenDefinition", (SpecimenDefinition) resource, -1);
18930    else if (resource instanceof StructureDefinition)
18931      composeStructureDefinition(parent, null, "StructureDefinition", (StructureDefinition) resource, -1);
18932    else if (resource instanceof StructureMap)
18933      composeStructureMap(parent, null, "StructureMap", (StructureMap) resource, -1);
18934    else if (resource instanceof Subscription)
18935      composeSubscription(parent, null, "Subscription", (Subscription) resource, -1);
18936    else if (resource instanceof Substance)
18937      composeSubstance(parent, null, "Substance", (Substance) resource, -1);
18938    else if (resource instanceof SubstanceNucleicAcid)
18939      composeSubstanceNucleicAcid(parent, null, "SubstanceNucleicAcid", (SubstanceNucleicAcid) resource, -1);
18940    else if (resource instanceof SubstancePolymer)
18941      composeSubstancePolymer(parent, null, "SubstancePolymer", (SubstancePolymer) resource, -1);
18942    else if (resource instanceof SubstanceProtein)
18943      composeSubstanceProtein(parent, null, "SubstanceProtein", (SubstanceProtein) resource, -1);
18944    else if (resource instanceof SubstanceReferenceInformation)
18945      composeSubstanceReferenceInformation(parent, null, "SubstanceReferenceInformation",
18946          (SubstanceReferenceInformation) resource, -1);
18947    else if (resource instanceof SubstanceSourceMaterial)
18948      composeSubstanceSourceMaterial(parent, null, "SubstanceSourceMaterial", (SubstanceSourceMaterial) resource, -1);
18949    else if (resource instanceof SubstanceSpecification)
18950      composeSubstanceSpecification(parent, null, "SubstanceSpecification", (SubstanceSpecification) resource, -1);
18951    else if (resource instanceof SupplyDelivery)
18952      composeSupplyDelivery(parent, null, "SupplyDelivery", (SupplyDelivery) resource, -1);
18953    else if (resource instanceof SupplyRequest)
18954      composeSupplyRequest(parent, null, "SupplyRequest", (SupplyRequest) resource, -1);
18955    else if (resource instanceof Task)
18956      composeTask(parent, null, "Task", (Task) resource, -1);
18957    else if (resource instanceof TerminologyCapabilities)
18958      composeTerminologyCapabilities(parent, null, "TerminologyCapabilities", (TerminologyCapabilities) resource, -1);
18959    else if (resource instanceof TestReport)
18960      composeTestReport(parent, null, "TestReport", (TestReport) resource, -1);
18961    else if (resource instanceof TestScript)
18962      composeTestScript(parent, null, "TestScript", (TestScript) resource, -1);
18963    else if (resource instanceof ValueSet)
18964      composeValueSet(parent, null, "ValueSet", (ValueSet) resource, -1);
18965    else if (resource instanceof VerificationResult)
18966      composeVerificationResult(parent, null, "VerificationResult", (VerificationResult) resource, -1);
18967    else if (resource instanceof VisionPrescription)
18968      composeVisionPrescription(parent, null, "VisionPrescription", (VisionPrescription) resource, -1);
18969    else
18970      throw new Error("Unhandled resource type " + resource.getClass().getName());
18971  }
18972
18973  protected void composeType(Complex parent, String parentType, String name, Type value, int index) {
18974    if (value == null)
18975      return;
18976    else if (value instanceof DateType)
18977      composeDate(parent, parentType, name, (DateType) value, index);
18978    else if (value instanceof DateTimeType)
18979      composeDateTime(parent, parentType, name, (DateTimeType) value, index);
18980    else if (value instanceof CodeType)
18981      composeCode(parent, parentType, name, (CodeType) value, index);
18982    else if (value instanceof StringType)
18983      composeString(parent, parentType, name, (StringType) value, index);
18984    else if (value instanceof IntegerType)
18985      composeInteger(parent, parentType, name, (IntegerType) value, index);
18986    else if (value instanceof OidType)
18987      composeOid(parent, parentType, name, (OidType) value, index);
18988    else if (value instanceof CanonicalType)
18989      composeCanonical(parent, parentType, name, (CanonicalType) value, index);
18990    else if (value instanceof UriType)
18991      composeUri(parent, parentType, name, (UriType) value, index);
18992    else if (value instanceof UuidType)
18993      composeUuid(parent, parentType, name, (UuidType) value, index);
18994    else if (value instanceof UrlType)
18995      composeUrl(parent, parentType, name, (UrlType) value, index);
18996    else if (value instanceof InstantType)
18997      composeInstant(parent, parentType, name, (InstantType) value, index);
18998    else if (value instanceof BooleanType)
18999      composeBoolean(parent, parentType, name, (BooleanType) value, index);
19000    else if (value instanceof Base64BinaryType)
19001      composeBase64Binary(parent, parentType, name, (Base64BinaryType) value, index);
19002    else if (value instanceof UnsignedIntType)
19003      composeUnsignedInt(parent, parentType, name, (UnsignedIntType) value, index);
19004    else if (value instanceof MarkdownType)
19005      composeMarkdown(parent, parentType, name, (MarkdownType) value, index);
19006    else if (value instanceof TimeType)
19007      composeTime(parent, parentType, name, (TimeType) value, index);
19008    else if (value instanceof IdType)
19009      composeId(parent, parentType, name, (IdType) value, index);
19010    else if (value instanceof PositiveIntType)
19011      composePositiveInt(parent, parentType, name, (PositiveIntType) value, index);
19012    else if (value instanceof DecimalType)
19013      composeDecimal(parent, parentType, name, (DecimalType) value, index);
19014    else if (value instanceof Extension)
19015      composeExtension(parent, parentType, name, (Extension) value, index);
19016    else if (value instanceof Narrative)
19017      composeNarrative(parent, parentType, name, (Narrative) value, index);
19018    else if (value instanceof Meta)
19019      composeMeta(parent, parentType, name, (Meta) value, index);
19020    else if (value instanceof Address)
19021      composeAddress(parent, parentType, name, (Address) value, index);
19022    else if (value instanceof Contributor)
19023      composeContributor(parent, parentType, name, (Contributor) value, index);
19024    else if (value instanceof Attachment)
19025      composeAttachment(parent, parentType, name, (Attachment) value, index);
19026    else if (value instanceof Count)
19027      composeCount(parent, parentType, name, (Count) value, index);
19028    else if (value instanceof DataRequirement)
19029      composeDataRequirement(parent, parentType, name, (DataRequirement) value, index);
19030    else if (value instanceof Dosage)
19031      composeDosage(parent, parentType, name, (Dosage) value, index);
19032    else if (value instanceof Money)
19033      composeMoney(parent, parentType, name, (Money) value, index);
19034    else if (value instanceof HumanName)
19035      composeHumanName(parent, parentType, name, (HumanName) value, index);
19036    else if (value instanceof ContactPoint)
19037      composeContactPoint(parent, parentType, name, (ContactPoint) value, index);
19038    else if (value instanceof MarketingStatus)
19039      composeMarketingStatus(parent, parentType, name, (MarketingStatus) value, index);
19040    else if (value instanceof Identifier)
19041      composeIdentifier(parent, parentType, name, (Identifier) value, index);
19042    else if (value instanceof SubstanceAmount)
19043      composeSubstanceAmount(parent, parentType, name, (SubstanceAmount) value, index);
19044    else if (value instanceof Coding)
19045      composeCoding(parent, parentType, name, (Coding) value, index);
19046    else if (value instanceof SampledData)
19047      composeSampledData(parent, parentType, name, (SampledData) value, index);
19048    else if (value instanceof Population)
19049      composePopulation(parent, parentType, name, (Population) value, index);
19050    else if (value instanceof Ratio)
19051      composeRatio(parent, parentType, name, (Ratio) value, index);
19052    else if (value instanceof Distance)
19053      composeDistance(parent, parentType, name, (Distance) value, index);
19054    else if (value instanceof Age)
19055      composeAge(parent, parentType, name, (Age) value, index);
19056    else if (value instanceof Reference)
19057      composeReference(parent, parentType, name, (Reference) value, index);
19058    else if (value instanceof TriggerDefinition)
19059      composeTriggerDefinition(parent, parentType, name, (TriggerDefinition) value, index);
19060    else if (value instanceof Quantity)
19061      composeQuantity(parent, parentType, name, (Quantity) value, index);
19062    else if (value instanceof Period)
19063      composePeriod(parent, parentType, name, (Period) value, index);
19064    else if (value instanceof Duration)
19065      composeDuration(parent, parentType, name, (Duration) value, index);
19066    else if (value instanceof Range)
19067      composeRange(parent, parentType, name, (Range) value, index);
19068    else if (value instanceof RelatedArtifact)
19069      composeRelatedArtifact(parent, parentType, name, (RelatedArtifact) value, index);
19070    else if (value instanceof Annotation)
19071      composeAnnotation(parent, parentType, name, (Annotation) value, index);
19072    else if (value instanceof ProductShelfLife)
19073      composeProductShelfLife(parent, parentType, name, (ProductShelfLife) value, index);
19074    else if (value instanceof ContactDetail)
19075      composeContactDetail(parent, parentType, name, (ContactDetail) value, index);
19076    else if (value instanceof UsageContext)
19077      composeUsageContext(parent, parentType, name, (UsageContext) value, index);
19078    else if (value instanceof Expression)
19079      composeExpression(parent, parentType, name, (Expression) value, index);
19080    else if (value instanceof Signature)
19081      composeSignature(parent, parentType, name, (Signature) value, index);
19082    else if (value instanceof Timing)
19083      composeTiming(parent, parentType, name, (Timing) value, index);
19084    else if (value instanceof ProdCharacteristic)
19085      composeProdCharacteristic(parent, parentType, name, (ProdCharacteristic) value, index);
19086    else if (value instanceof CodeableConcept)
19087      composeCodeableConcept(parent, parentType, name, (CodeableConcept) value, index);
19088    else if (value instanceof ParameterDefinition)
19089      composeParameterDefinition(parent, parentType, name, (ParameterDefinition) value, index);
19090    else
19091      throw new Error("Unhandled type");
19092  }
19093
19094}