001package org.hl7.fhir.r5.formats;
002
003
004// generated
005
006/*
007  Copyright (c) 2011+, HL7, Inc.
008  All rights reserved.
009  
010  Redistribution and use in source and binary forms, with or without modification, \
011  are permitted provided that the following conditions are met:
012  
013   * Redistributions of source code must retain the above copyright notice, this \
014     list of conditions and the following disclaimer.
015   * Redistributions in binary form must reproduce the above copyright notice, \
016     this list of conditions and the following disclaimer in the documentation \
017     and/or other materials provided with the distribution.
018   * Neither the name of HL7 nor the names of its contributors may be used to 
019     endorse or promote products derived from this software without specific 
020     prior written permission.
021  
022  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
023  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
024  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
025  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
026  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
027  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
028  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
029  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
030  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
031  POSSIBILITY OF SUCH DAMAGE.
032  */
033
034// Generated on Sat, Nov 5, 2022 10:47+1100 for FHIR v5.0.0-ballot
035
036
037
038import org.hl7.fhir.r5.model.*;
039import org.hl7.fhir.r5.model.StringType;
040import org.hl7.fhir.utilities.Utilities;
041import org.hl7.fhir.exceptions.FHIRFormatError;
042import org.hl7.fhir.exceptions.FHIRException;
043import org.hl7.fhir.utilities.turtle.Turtle.*;
044import java.io.IOException;
045
046public class RdfParser extends RdfParserBase {
047
048  public RdfParser() {
049    super();
050  }
051
052  public RdfParser(boolean allowUnknownContent) {
053    super();
054    setAllowUnknownContent(allowUnknownContent);
055  }
056
057  private void composeEnum(Complex parent, String parentType, String name, Enumeration<? extends Enum> value, int index) {
058    if (value == null)
059      return;
060    Complex t = parent.predicate("fhir:"+parentType+"."+name);
061    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
062    composeElement(t, parentType, name, value, index);
063    decorateCode(t, value);
064  }
065
066
067  protected void composeDate(Complex parent, String parentType, String name, DateType value, int index) {
068    if (value == null)
069      return;
070    Complex t = parent.predicate("fhir:"+parentType+"."+name);
071    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
072    composeElement(t, parentType, name, value, index);
073  }
074
075  protected void composeDateTime(Complex parent, String parentType, String name, DateTimeType 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 composeCode(Complex parent, String parentType, String name, CodeType 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    decorateCode(t, value);
090  }
091
092  protected void composeString(Complex parent, String parentType, String name, StringType value, int index) {
093    if (value == null)
094      return;
095    Complex t = parent.predicate("fhir:"+parentType+"."+name);
096    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
097    composeElement(t, parentType, name, value, index);
098  }
099
100  protected void composeInteger(Complex parent, String parentType, String name, IntegerType 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 composeInteger64(Complex parent, String parentType, String name, Integer64Type 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, int index) {
173    if (value == null)
174      return;
175    Complex t = parent.predicate("fhir:"+parentType+"."+name);
176    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
177    composeElement(t, parentType, name, value, index);
178  }
179
180  protected void composeUnsignedInt(Complex parent, String parentType, String name, UnsignedIntType value, int index) {
181    if (value == null)
182      return;
183    Complex t = parent.predicate("fhir:"+parentType+"."+name);
184    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
185    composeElement(t, parentType, name, value, index);
186  }
187
188  protected void composeMarkdown(Complex parent, String parentType, String name, MarkdownType value, int index) {
189    if (value == null)
190      return;
191    Complex t = parent.predicate("fhir:"+parentType+"."+name);
192    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
193    composeElement(t, parentType, name, value, index);
194  }
195
196  protected void composeTime(Complex parent, String parentType, String name, TimeType value, int index) {
197    if (value == null)
198      return;
199    Complex t = parent.predicate("fhir:"+parentType+"."+name);
200    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
201    composeElement(t, parentType, name, value, index);
202  }
203
204  protected void composeId(Complex parent, String parentType, String name, IdType value, int index) {
205    if (value == null)
206      return;
207    Complex t = parent.predicate("fhir:"+parentType+"."+name);
208    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
209    composeElement(t, parentType, name, value, index);
210  }
211
212  protected void composePositiveInt(Complex parent, String parentType, String name, PositiveIntType value, int index) {
213    if (value == null)
214      return;
215    Complex t = parent.predicate("fhir:"+parentType+"."+name);
216    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
217    composeElement(t, parentType, name, value, index);
218  }
219
220  protected void composeDecimal(Complex parent, String parentType, String name, DecimalType value, int index) {
221    if (value == null)
222      return;
223    Complex t = parent.predicate("fhir:"+parentType+"."+name);
224    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
225    composeElement(t, parentType, name, value, index);
226  }
227
228  protected void composeBackboneElement(Complex t, String parentType, String name, BackboneElement element, int index) {
229    composeElement(t, parentType, name, element, index);
230    for (int i = 0; i < element.getModifierExtension().size(); i++) {
231      composeExtension(t, "BackboneElement", "modifierExtension", element.getModifierExtension().get(i), i);
232    }
233  }
234
235  protected void composeBackboneType(Complex t, String parentType, String name, BackboneType element, int index) {
236    composeDataType(t, parentType, name, element, index);
237    for (int i = 0; i < element.getModifierExtension().size(); i++) {
238      composeExtension(t, "BackboneType", "modifierExtension", element.getModifierExtension().get(i), i);
239    }
240  }
241
242  protected void composeDataType(Complex t, String parentType, String name, DataType element, int index) {
243    composeElement(t, parentType, name, element, index);
244  }
245
246  protected void composeElement(Complex t, String parentType, String name, Element element, int index) {
247    composeBase(t, parentType, name, element, index);
248    if (element.hasIdElement()) {
249      composeString(t, "Element", "id", element.getIdElement(), -1);
250    }
251    for (int i = 0; i < element.getExtension().size(); i++) {
252      composeExtension(t, "Element", "extension", element.getExtension().get(i), i);
253    }
254  }
255
256  protected void composeAddress(Complex parent, String parentType, String name, Address element, int index) {
257    if (element == null) 
258      return;
259    Complex t;
260    if (Utilities.noString(parentType))
261      t = parent;
262    else {
263      t = parent.predicate("fhir:"+parentType+'.'+name);
264    }
265    composeDataType(t, "Address", name, element, index);
266    if (element.hasUseElement()) {
267      composeEnum(t, "Address", "use", element.getUseElement(), -1);
268    }
269    if (element.hasTypeElement()) {
270      composeEnum(t, "Address", "type", element.getTypeElement(), -1);
271    }
272    if (element.hasTextElement()) {
273      composeString(t, "Address", "text", element.getTextElement(), -1);
274    }
275    for (int i = 0; i < element.getLine().size(); i++) {
276      composeString(t, "Address", "line", element.getLine().get(i), i);
277    }
278    if (element.hasCityElement()) {
279      composeString(t, "Address", "city", element.getCityElement(), -1);
280    }
281    if (element.hasDistrictElement()) {
282      composeString(t, "Address", "district", element.getDistrictElement(), -1);
283    }
284    if (element.hasStateElement()) {
285      composeString(t, "Address", "state", element.getStateElement(), -1);
286    }
287    if (element.hasPostalCodeElement()) {
288      composeString(t, "Address", "postalCode", element.getPostalCodeElement(), -1);
289    }
290    if (element.hasCountryElement()) {
291      composeString(t, "Address", "country", element.getCountryElement(), -1);
292    }
293    if (element.hasPeriod()) {
294      composePeriod(t, "Address", "period", element.getPeriod(), -1);
295    }
296  }
297
298  protected void composeAge(Complex parent, String parentType, String name, Age element, int index) {
299    if (element == null) 
300      return;
301    Complex t;
302    if (Utilities.noString(parentType))
303      t = parent;
304    else {
305      t = parent.predicate("fhir:"+parentType+'.'+name);
306    }
307    composeQuantity(t, "Age", name, element, index);
308  }
309
310  protected void composeAnnotation(Complex parent, String parentType, String name, Annotation element, int index) {
311    if (element == null) 
312      return;
313    Complex t;
314    if (Utilities.noString(parentType))
315      t = parent;
316    else {
317      t = parent.predicate("fhir:"+parentType+'.'+name);
318    }
319    composeDataType(t, "Annotation", name, element, index);
320    if (element.hasAuthor()) {
321      composeType(t, "Annotation", "author", element.getAuthor(), -1);
322    }
323    if (element.hasTimeElement()) {
324      composeDateTime(t, "Annotation", "time", element.getTimeElement(), -1);
325    }
326    if (element.hasTextElement()) {
327      composeMarkdown(t, "Annotation", "text", element.getTextElement(), -1);
328    }
329  }
330
331  protected void composeAttachment(Complex parent, String parentType, String name, Attachment element, int index) {
332    if (element == null) 
333      return;
334    Complex t;
335    if (Utilities.noString(parentType))
336      t = parent;
337    else {
338      t = parent.predicate("fhir:"+parentType+'.'+name);
339    }
340    composeDataType(t, "Attachment", name, element, index);
341    if (element.hasContentTypeElement()) {
342      composeCode(t, "Attachment", "contentType", element.getContentTypeElement(), -1);
343    }
344    if (element.hasLanguageElement()) {
345      composeCode(t, "Attachment", "language", element.getLanguageElement(), -1);
346    }
347    if (element.hasDataElement()) {
348      composeBase64Binary(t, "Attachment", "data", element.getDataElement(), -1);
349    }
350    if (element.hasUrlElement()) {
351      composeUrl(t, "Attachment", "url", element.getUrlElement(), -1);
352    }
353    if (element.hasSizeElement()) {
354      composeInteger64(t, "Attachment", "size", element.getSizeElement(), -1);
355    }
356    if (element.hasHashElement()) {
357      composeBase64Binary(t, "Attachment", "hash", element.getHashElement(), -1);
358    }
359    if (element.hasTitleElement()) {
360      composeString(t, "Attachment", "title", element.getTitleElement(), -1);
361    }
362    if (element.hasCreationElement()) {
363      composeDateTime(t, "Attachment", "creation", element.getCreationElement(), -1);
364    }
365    if (element.hasHeightElement()) {
366      composePositiveInt(t, "Attachment", "height", element.getHeightElement(), -1);
367    }
368    if (element.hasWidthElement()) {
369      composePositiveInt(t, "Attachment", "width", element.getWidthElement(), -1);
370    }
371    if (element.hasFramesElement()) {
372      composePositiveInt(t, "Attachment", "frames", element.getFramesElement(), -1);
373    }
374    if (element.hasDurationElement()) {
375      composeDecimal(t, "Attachment", "duration", element.getDurationElement(), -1);
376    }
377    if (element.hasPagesElement()) {
378      composePositiveInt(t, "Attachment", "pages", element.getPagesElement(), -1);
379    }
380  }
381
382  protected void composeAvailability(Complex parent, String parentType, String name, Availability element, int index) {
383    if (element == null) 
384      return;
385    Complex t;
386    if (Utilities.noString(parentType))
387      t = parent;
388    else {
389      t = parent.predicate("fhir:"+parentType+'.'+name);
390    }
391    composeDataType(t, "Availability", name, element, index);
392    for (int i = 0; i < element.getAvailableTime().size(); i++) {
393      composeAvailabilityAvailableTimeComponent(t, "Availability", "availableTime", element.getAvailableTime().get(i), i);
394    }
395    for (int i = 0; i < element.getNotAvailableTime().size(); i++) {
396      composeAvailabilityNotAvailableTimeComponent(t, "Availability", "notAvailableTime", element.getNotAvailableTime().get(i), i);
397    }
398  }
399
400  protected void composeAvailabilityAvailableTimeComponent(Complex parent, String parentType, String name, Availability.AvailabilityAvailableTimeComponent element, int index) {
401    if (element == null) 
402      return;
403    Complex t;
404    if (Utilities.noString(parentType))
405      t = parent;
406    else {
407      t = parent.predicate("fhir:"+parentType+'.'+name);
408    }
409    composeElement(t, "availableTime", name, element, index);
410    for (int i = 0; i < element.getDaysOfWeek().size(); i++) {
411      composeEnum(t, "AvailabilityAvailableTimeComponent", "daysOfWeek", element.getDaysOfWeek().get(i), i);
412    }
413    if (element.hasAllDayElement()) {
414      composeBoolean(t, "AvailabilityAvailableTimeComponent", "allDay", element.getAllDayElement(), -1);
415    }
416    if (element.hasAvailableStartTimeElement()) {
417      composeTime(t, "AvailabilityAvailableTimeComponent", "availableStartTime", element.getAvailableStartTimeElement(), -1);
418    }
419    if (element.hasAvailableEndTimeElement()) {
420      composeTime(t, "AvailabilityAvailableTimeComponent", "availableEndTime", element.getAvailableEndTimeElement(), -1);
421    }
422  }
423
424  protected void composeAvailabilityNotAvailableTimeComponent(Complex parent, String parentType, String name, Availability.AvailabilityNotAvailableTimeComponent element, int index) {
425    if (element == null) 
426      return;
427    Complex t;
428    if (Utilities.noString(parentType))
429      t = parent;
430    else {
431      t = parent.predicate("fhir:"+parentType+'.'+name);
432    }
433    composeElement(t, "notAvailableTime", name, element, index);
434    if (element.hasDescriptionElement()) {
435      composeString(t, "AvailabilityNotAvailableTimeComponent", "description", element.getDescriptionElement(), -1);
436    }
437    if (element.hasDuring()) {
438      composePeriod(t, "AvailabilityNotAvailableTimeComponent", "during", element.getDuring(), -1);
439    }
440  }
441
442  protected void composeCodeableConcept(Complex parent, String parentType, String name, CodeableConcept element, int index) {
443    if (element == null) 
444      return;
445    Complex t;
446    if (Utilities.noString(parentType))
447      t = parent;
448    else {
449      t = parent.predicate("fhir:"+parentType+'.'+name);
450    }
451    composeDataType(t, "CodeableConcept", name, element, index);
452    decorateCodeableConcept(t, element);
453    for (int i = 0; i < element.getCoding().size(); i++) {
454      composeCoding(t, "CodeableConcept", "coding", element.getCoding().get(i), i);
455    }
456    if (element.hasTextElement()) {
457      composeString(t, "CodeableConcept", "text", element.getTextElement(), -1);
458    }
459  }
460
461  protected void composeCodeableReference(Complex parent, String parentType, String name, CodeableReference element, int index) {
462    if (element == null) 
463      return;
464    Complex t;
465    if (Utilities.noString(parentType))
466      t = parent;
467    else {
468      t = parent.predicate("fhir:"+parentType+'.'+name);
469    }
470    composeDataType(t, "CodeableReference", name, element, index);
471    if (element.hasConcept()) {
472      composeCodeableConcept(t, "CodeableReference", "concept", element.getConcept(), -1);
473    }
474    if (element.hasReference()) {
475      composeReference(t, "CodeableReference", "reference", element.getReference(), -1);
476    }
477  }
478
479  protected void composeCoding(Complex parent, String parentType, String name, Coding element, int index) {
480    if (element == null) 
481      return;
482    Complex t;
483    if (Utilities.noString(parentType))
484      t = parent;
485    else {
486      t = parent.predicate("fhir:"+parentType+'.'+name);
487    }
488    composeDataType(t, "Coding", name, element, index);
489    decorateCoding(t, element);
490    if (element.hasSystemElement()) {
491      composeUri(t, "Coding", "system", element.getSystemElement(), -1);
492    }
493    if (element.hasVersionElement()) {
494      composeString(t, "Coding", "version", element.getVersionElement(), -1);
495    }
496    if (element.hasCodeElement()) {
497      composeCode(t, "Coding", "code", element.getCodeElement(), -1);
498    }
499    if (element.hasDisplayElement()) {
500      composeString(t, "Coding", "display", element.getDisplayElement(), -1);
501    }
502    if (element.hasUserSelectedElement()) {
503      composeBoolean(t, "Coding", "userSelected", element.getUserSelectedElement(), -1);
504    }
505  }
506
507  protected void composeContactDetail(Complex parent, String parentType, String name, ContactDetail element, int index) {
508    if (element == null) 
509      return;
510    Complex t;
511    if (Utilities.noString(parentType))
512      t = parent;
513    else {
514      t = parent.predicate("fhir:"+parentType+'.'+name);
515    }
516    composeDataType(t, "ContactDetail", name, element, index);
517    if (element.hasNameElement()) {
518      composeString(t, "ContactDetail", "name", element.getNameElement(), -1);
519    }
520    for (int i = 0; i < element.getTelecom().size(); i++) {
521      composeContactPoint(t, "ContactDetail", "telecom", element.getTelecom().get(i), i);
522    }
523  }
524
525  protected void composeContactPoint(Complex parent, String parentType, String name, ContactPoint element, int index) {
526    if (element == null) 
527      return;
528    Complex t;
529    if (Utilities.noString(parentType))
530      t = parent;
531    else {
532      t = parent.predicate("fhir:"+parentType+'.'+name);
533    }
534    composeDataType(t, "ContactPoint", name, element, index);
535    if (element.hasSystemElement()) {
536      composeEnum(t, "ContactPoint", "system", element.getSystemElement(), -1);
537    }
538    if (element.hasValueElement()) {
539      composeString(t, "ContactPoint", "value", element.getValueElement(), -1);
540    }
541    if (element.hasUseElement()) {
542      composeEnum(t, "ContactPoint", "use", element.getUseElement(), -1);
543    }
544    if (element.hasRankElement()) {
545      composePositiveInt(t, "ContactPoint", "rank", element.getRankElement(), -1);
546    }
547    if (element.hasPeriod()) {
548      composePeriod(t, "ContactPoint", "period", element.getPeriod(), -1);
549    }
550  }
551
552  protected void composeContributor(Complex parent, String parentType, String name, Contributor element, int index) {
553    if (element == null) 
554      return;
555    Complex t;
556    if (Utilities.noString(parentType))
557      t = parent;
558    else {
559      t = parent.predicate("fhir:"+parentType+'.'+name);
560    }
561    composeDataType(t, "Contributor", name, element, index);
562    if (element.hasTypeElement()) {
563      composeEnum(t, "Contributor", "type", element.getTypeElement(), -1);
564    }
565    if (element.hasNameElement()) {
566      composeString(t, "Contributor", "name", element.getNameElement(), -1);
567    }
568    for (int i = 0; i < element.getContact().size(); i++) {
569      composeContactDetail(t, "Contributor", "contact", element.getContact().get(i), i);
570    }
571  }
572
573  protected void composeCount(Complex parent, String parentType, String name, Count element, int index) {
574    if (element == null) 
575      return;
576    Complex t;
577    if (Utilities.noString(parentType))
578      t = parent;
579    else {
580      t = parent.predicate("fhir:"+parentType+'.'+name);
581    }
582    composeQuantity(t, "Count", name, element, index);
583  }
584
585  protected void composeDataRequirement(Complex parent, String parentType, String name, DataRequirement element, 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    composeDataType(t, "DataRequirement", name, element, index);
595    if (element.hasTypeElement()) {
596      composeEnum(t, "DataRequirement", "type", element.getTypeElement(), -1);
597    }
598    for (int i = 0; i < element.getProfile().size(); i++) {
599      composeCanonical(t, "DataRequirement", "profile", element.getProfile().get(i), i);
600    }
601    if (element.hasSubject()) {
602      composeType(t, "DataRequirement", "subject", element.getSubject(), -1);
603    }
604    for (int i = 0; i < element.getMustSupport().size(); i++) {
605      composeString(t, "DataRequirement", "mustSupport", element.getMustSupport().get(i), i);
606    }
607    for (int i = 0; i < element.getCodeFilter().size(); i++) {
608      composeDataRequirementCodeFilterComponent(t, "DataRequirement", "codeFilter", element.getCodeFilter().get(i), i);
609    }
610    for (int i = 0; i < element.getDateFilter().size(); i++) {
611      composeDataRequirementDateFilterComponent(t, "DataRequirement", "dateFilter", element.getDateFilter().get(i), i);
612    }
613    for (int i = 0; i < element.getValueFilter().size(); i++) {
614      composeDataRequirementValueFilterComponent(t, "DataRequirement", "valueFilter", element.getValueFilter().get(i), i);
615    }
616    if (element.hasLimitElement()) {
617      composePositiveInt(t, "DataRequirement", "limit", element.getLimitElement(), -1);
618    }
619    for (int i = 0; i < element.getSort().size(); i++) {
620      composeDataRequirementSortComponent(t, "DataRequirement", "sort", element.getSort().get(i), i);
621    }
622  }
623
624  protected void composeDataRequirementCodeFilterComponent(Complex parent, String parentType, String name, DataRequirement.DataRequirementCodeFilterComponent element, int index) {
625    if (element == null) 
626      return;
627    Complex t;
628    if (Utilities.noString(parentType))
629      t = parent;
630    else {
631      t = parent.predicate("fhir:"+parentType+'.'+name);
632    }
633    composeElement(t, "codeFilter", name, element, index);
634    if (element.hasPathElement()) {
635      composeString(t, "DataRequirementCodeFilterComponent", "path", element.getPathElement(), -1);
636    }
637    if (element.hasSearchParamElement()) {
638      composeString(t, "DataRequirementCodeFilterComponent", "searchParam", element.getSearchParamElement(), -1);
639    }
640    if (element.hasValueSetElement()) {
641      composeCanonical(t, "DataRequirementCodeFilterComponent", "valueSet", element.getValueSetElement(), -1);
642    }
643    for (int i = 0; i < element.getCode().size(); i++) {
644      composeCoding(t, "DataRequirementCodeFilterComponent", "code", element.getCode().get(i), i);
645    }
646  }
647
648  protected void composeDataRequirementDateFilterComponent(Complex parent, String parentType, String name, DataRequirement.DataRequirementDateFilterComponent element, int index) {
649    if (element == null) 
650      return;
651    Complex t;
652    if (Utilities.noString(parentType))
653      t = parent;
654    else {
655      t = parent.predicate("fhir:"+parentType+'.'+name);
656    }
657    composeElement(t, "dateFilter", name, element, index);
658    if (element.hasPathElement()) {
659      composeString(t, "DataRequirementDateFilterComponent", "path", element.getPathElement(), -1);
660    }
661    if (element.hasSearchParamElement()) {
662      composeString(t, "DataRequirementDateFilterComponent", "searchParam", element.getSearchParamElement(), -1);
663    }
664    if (element.hasValue()) {
665      composeType(t, "DataRequirementDateFilterComponent", "value", element.getValue(), -1);
666    }
667  }
668
669  protected void composeDataRequirementValueFilterComponent(Complex parent, String parentType, String name, DataRequirement.DataRequirementValueFilterComponent element, int index) {
670    if (element == null) 
671      return;
672    Complex t;
673    if (Utilities.noString(parentType))
674      t = parent;
675    else {
676      t = parent.predicate("fhir:"+parentType+'.'+name);
677    }
678    composeElement(t, "valueFilter", name, element, index);
679    if (element.hasPathElement()) {
680      composeString(t, "DataRequirementValueFilterComponent", "path", element.getPathElement(), -1);
681    }
682    if (element.hasSearchParamElement()) {
683      composeString(t, "DataRequirementValueFilterComponent", "searchParam", element.getSearchParamElement(), -1);
684    }
685    if (element.hasComparatorElement()) {
686      composeEnum(t, "DataRequirementValueFilterComponent", "comparator", element.getComparatorElement(), -1);
687    }
688    if (element.hasValue()) {
689      composeType(t, "DataRequirementValueFilterComponent", "value", element.getValue(), -1);
690    }
691  }
692
693  protected void composeDataRequirementSortComponent(Complex parent, String parentType, String name, DataRequirement.DataRequirementSortComponent 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, "sort", name, element, index);
703    if (element.hasPathElement()) {
704      composeString(t, "DataRequirementSortComponent", "path", element.getPathElement(), -1);
705    }
706    if (element.hasDirectionElement()) {
707      composeEnum(t, "DataRequirementSortComponent", "direction", element.getDirectionElement(), -1);
708    }
709  }
710
711  protected void composeDistance(Complex parent, String parentType, String name, Distance element, int index) {
712    if (element == null) 
713      return;
714    Complex t;
715    if (Utilities.noString(parentType))
716      t = parent;
717    else {
718      t = parent.predicate("fhir:"+parentType+'.'+name);
719    }
720    composeQuantity(t, "Distance", name, element, index);
721  }
722
723  protected void composeDosage(Complex parent, String parentType, String name, Dosage element, int index) {
724    if (element == null) 
725      return;
726    Complex t;
727    if (Utilities.noString(parentType))
728      t = parent;
729    else {
730      t = parent.predicate("fhir:"+parentType+'.'+name);
731    }
732    composeBackboneType(t, "Dosage", name, element, index);
733    if (element.hasSequenceElement()) {
734      composeInteger(t, "Dosage", "sequence", element.getSequenceElement(), -1);
735    }
736    if (element.hasTextElement()) {
737      composeString(t, "Dosage", "text", element.getTextElement(), -1);
738    }
739    for (int i = 0; i < element.getAdditionalInstruction().size(); i++) {
740      composeCodeableConcept(t, "Dosage", "additionalInstruction", element.getAdditionalInstruction().get(i), i);
741    }
742    if (element.hasPatientInstructionElement()) {
743      composeString(t, "Dosage", "patientInstruction", element.getPatientInstructionElement(), -1);
744    }
745    if (element.hasTiming()) {
746      composeTiming(t, "Dosage", "timing", element.getTiming(), -1);
747    }
748    if (element.hasAsNeededElement()) {
749      composeBoolean(t, "Dosage", "asNeeded", element.getAsNeededElement(), -1);
750    }
751    for (int i = 0; i < element.getAsNeededFor().size(); i++) {
752      composeCodeableConcept(t, "Dosage", "asNeededFor", element.getAsNeededFor().get(i), i);
753    }
754    if (element.hasSite()) {
755      composeCodeableConcept(t, "Dosage", "site", element.getSite(), -1);
756    }
757    if (element.hasRoute()) {
758      composeCodeableConcept(t, "Dosage", "route", element.getRoute(), -1);
759    }
760    if (element.hasMethod()) {
761      composeCodeableConcept(t, "Dosage", "method", element.getMethod(), -1);
762    }
763    for (int i = 0; i < element.getDoseAndRate().size(); i++) {
764      composeDosageDoseAndRateComponent(t, "Dosage", "doseAndRate", element.getDoseAndRate().get(i), i);
765    }
766    for (int i = 0; i < element.getMaxDosePerPeriod().size(); i++) {
767      composeRatio(t, "Dosage", "maxDosePerPeriod", element.getMaxDosePerPeriod().get(i), i);
768    }
769    if (element.hasMaxDosePerAdministration()) {
770      composeQuantity(t, "Dosage", "maxDosePerAdministration", element.getMaxDosePerAdministration(), -1);
771    }
772    if (element.hasMaxDosePerLifetime()) {
773      composeQuantity(t, "Dosage", "maxDosePerLifetime", element.getMaxDosePerLifetime(), -1);
774    }
775  }
776
777  protected void composeDosageDoseAndRateComponent(Complex parent, String parentType, String name, Dosage.DosageDoseAndRateComponent element, int index) {
778    if (element == null) 
779      return;
780    Complex t;
781    if (Utilities.noString(parentType))
782      t = parent;
783    else {
784      t = parent.predicate("fhir:"+parentType+'.'+name);
785    }
786    composeElement(t, "doseAndRate", name, element, index);
787    if (element.hasType()) {
788      composeCodeableConcept(t, "DosageDoseAndRateComponent", "type", element.getType(), -1);
789    }
790    if (element.hasDose()) {
791      composeType(t, "DosageDoseAndRateComponent", "dose", element.getDose(), -1);
792    }
793    if (element.hasRate()) {
794      composeType(t, "DosageDoseAndRateComponent", "rate", element.getRate(), -1);
795    }
796  }
797
798  protected void composeDuration(Complex parent, String parentType, String name, Duration element, int index) {
799    if (element == null) 
800      return;
801    Complex t;
802    if (Utilities.noString(parentType))
803      t = parent;
804    else {
805      t = parent.predicate("fhir:"+parentType+'.'+name);
806    }
807    composeQuantity(t, "Duration", name, element, index);
808  }
809
810  protected void composeElementDefinition(Complex parent, String parentType, String name, ElementDefinition element, int index) {
811    if (element == null) 
812      return;
813    Complex t;
814    if (Utilities.noString(parentType))
815      t = parent;
816    else {
817      t = parent.predicate("fhir:"+parentType+'.'+name);
818    }
819    composeBackboneType(t, "ElementDefinition", name, element, index);
820    if (element.hasPathElement()) {
821      composeString(t, "ElementDefinition", "path", element.getPathElement(), -1);
822    }
823    for (int i = 0; i < element.getRepresentation().size(); i++) {
824      composeEnum(t, "ElementDefinition", "representation", element.getRepresentation().get(i), i);
825    }
826    if (element.hasSliceNameElement()) {
827      composeString(t, "ElementDefinition", "sliceName", element.getSliceNameElement(), -1);
828    }
829    if (element.hasSliceIsConstrainingElement()) {
830      composeBoolean(t, "ElementDefinition", "sliceIsConstraining", element.getSliceIsConstrainingElement(), -1);
831    }
832    if (element.hasLabelElement()) {
833      composeString(t, "ElementDefinition", "label", element.getLabelElement(), -1);
834    }
835    for (int i = 0; i < element.getCode().size(); i++) {
836      composeCoding(t, "ElementDefinition", "code", element.getCode().get(i), i);
837    }
838    if (element.hasSlicing()) {
839      composeElementDefinitionSlicingComponent(t, "ElementDefinition", "slicing", element.getSlicing(), -1);
840    }
841    if (element.hasShortElement()) {
842      composeString(t, "ElementDefinition", "short", element.getShortElement(), -1);
843    }
844    if (element.hasDefinitionElement()) {
845      composeMarkdown(t, "ElementDefinition", "definition", element.getDefinitionElement(), -1);
846    }
847    if (element.hasCommentElement()) {
848      composeMarkdown(t, "ElementDefinition", "comment", element.getCommentElement(), -1);
849    }
850    if (element.hasRequirementsElement()) {
851      composeMarkdown(t, "ElementDefinition", "requirements", element.getRequirementsElement(), -1);
852    }
853    for (int i = 0; i < element.getAlias().size(); i++) {
854      composeString(t, "ElementDefinition", "alias", element.getAlias().get(i), i);
855    }
856    if (element.hasMinElement()) {
857      composeUnsignedInt(t, "ElementDefinition", "min", element.getMinElement(), -1);
858    }
859    if (element.hasMaxElement()) {
860      composeString(t, "ElementDefinition", "max", element.getMaxElement(), -1);
861    }
862    if (element.hasBase()) {
863      composeElementDefinitionBaseComponent(t, "ElementDefinition", "base", element.getBase(), -1);
864    }
865    if (element.hasContentReferenceElement()) {
866      composeUri(t, "ElementDefinition", "contentReference", element.getContentReferenceElement(), -1);
867    }
868    for (int i = 0; i < element.getType().size(); i++) {
869      composeElementDefinitionTypeRefComponent(t, "ElementDefinition", "type", element.getType().get(i), i);
870    }
871    if (element.hasDefaultValue()) {
872      composeType(t, "ElementDefinition", "defaultValue", element.getDefaultValue(), -1);
873    }
874    if (element.hasMeaningWhenMissingElement()) {
875      composeMarkdown(t, "ElementDefinition", "meaningWhenMissing", element.getMeaningWhenMissingElement(), -1);
876    }
877    if (element.hasOrderMeaningElement()) {
878      composeString(t, "ElementDefinition", "orderMeaning", element.getOrderMeaningElement(), -1);
879    }
880    if (element.hasFixed()) {
881      composeType(t, "ElementDefinition", "fixed", element.getFixed(), -1);
882    }
883    if (element.hasPattern()) {
884      composeType(t, "ElementDefinition", "pattern", element.getPattern(), -1);
885    }
886    for (int i = 0; i < element.getExample().size(); i++) {
887      composeElementDefinitionExampleComponent(t, "ElementDefinition", "example", element.getExample().get(i), i);
888    }
889    if (element.hasMinValue()) {
890      composeType(t, "ElementDefinition", "minValue", element.getMinValue(), -1);
891    }
892    if (element.hasMaxValue()) {
893      composeType(t, "ElementDefinition", "maxValue", element.getMaxValue(), -1);
894    }
895    if (element.hasMaxLengthElement()) {
896      composeInteger(t, "ElementDefinition", "maxLength", element.getMaxLengthElement(), -1);
897    }
898    for (int i = 0; i < element.getCondition().size(); i++) {
899      composeId(t, "ElementDefinition", "condition", element.getCondition().get(i), i);
900    }
901    for (int i = 0; i < element.getConstraint().size(); i++) {
902      composeElementDefinitionConstraintComponent(t, "ElementDefinition", "constraint", element.getConstraint().get(i), i);
903    }
904    if (element.hasMustSupportElement()) {
905      composeBoolean(t, "ElementDefinition", "mustSupport", element.getMustSupportElement(), -1);
906    }
907    if (element.hasIsModifierElement()) {
908      composeBoolean(t, "ElementDefinition", "isModifier", element.getIsModifierElement(), -1);
909    }
910    if (element.hasIsModifierReasonElement()) {
911      composeString(t, "ElementDefinition", "isModifierReason", element.getIsModifierReasonElement(), -1);
912    }
913    if (element.hasIsSummaryElement()) {
914      composeBoolean(t, "ElementDefinition", "isSummary", element.getIsSummaryElement(), -1);
915    }
916    if (element.hasBinding()) {
917      composeElementDefinitionBindingComponent(t, "ElementDefinition", "binding", element.getBinding(), -1);
918    }
919    for (int i = 0; i < element.getMapping().size(); i++) {
920      composeElementDefinitionMappingComponent(t, "ElementDefinition", "mapping", element.getMapping().get(i), i);
921    }
922  }
923
924  protected void composeElementDefinitionSlicingComponent(Complex parent, String parentType, String name, ElementDefinition.ElementDefinitionSlicingComponent element, int index) {
925    if (element == null) 
926      return;
927    Complex t;
928    if (Utilities.noString(parentType))
929      t = parent;
930    else {
931      t = parent.predicate("fhir:"+parentType+'.'+name);
932    }
933    composeElement(t, "slicing", name, element, index);
934    for (int i = 0; i < element.getDiscriminator().size(); i++) {
935      composeElementDefinitionSlicingDiscriminatorComponent(t, "ElementDefinitionSlicingComponent", "discriminator", element.getDiscriminator().get(i), i);
936    }
937    if (element.hasDescriptionElement()) {
938      composeString(t, "ElementDefinitionSlicingComponent", "description", element.getDescriptionElement(), -1);
939    }
940    if (element.hasOrderedElement()) {
941      composeBoolean(t, "ElementDefinitionSlicingComponent", "ordered", element.getOrderedElement(), -1);
942    }
943    if (element.hasRulesElement()) {
944      composeEnum(t, "ElementDefinitionSlicingComponent", "rules", element.getRulesElement(), -1);
945    }
946  }
947
948  protected void composeElementDefinitionSlicingDiscriminatorComponent(Complex parent, String parentType, String name, ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent element, int index) {
949    if (element == null) 
950      return;
951    Complex t;
952    if (Utilities.noString(parentType))
953      t = parent;
954    else {
955      t = parent.predicate("fhir:"+parentType+'.'+name);
956    }
957    composeElement(t, "discriminator", name, element, index);
958    if (element.hasTypeElement()) {
959      composeEnum(t, "ElementDefinitionSlicingDiscriminatorComponent", "type", element.getTypeElement(), -1);
960    }
961    if (element.hasPathElement()) {
962      composeString(t, "ElementDefinitionSlicingDiscriminatorComponent", "path", element.getPathElement(), -1);
963    }
964  }
965
966  protected void composeElementDefinitionBaseComponent(Complex parent, String parentType, String name, ElementDefinition.ElementDefinitionBaseComponent element, int index) {
967    if (element == null) 
968      return;
969    Complex t;
970    if (Utilities.noString(parentType))
971      t = parent;
972    else {
973      t = parent.predicate("fhir:"+parentType+'.'+name);
974    }
975    composeElement(t, "base", name, element, index);
976    if (element.hasPathElement()) {
977      composeString(t, "ElementDefinitionBaseComponent", "path", element.getPathElement(), -1);
978    }
979    if (element.hasMinElement()) {
980      composeUnsignedInt(t, "ElementDefinitionBaseComponent", "min", element.getMinElement(), -1);
981    }
982    if (element.hasMaxElement()) {
983      composeString(t, "ElementDefinitionBaseComponent", "max", element.getMaxElement(), -1);
984    }
985  }
986
987  protected void composeElementDefinitionTypeRefComponent(Complex parent, String parentType, String name, ElementDefinition.TypeRefComponent element, int index) {
988    if (element == null) 
989      return;
990    Complex t;
991    if (Utilities.noString(parentType))
992      t = parent;
993    else {
994      t = parent.predicate("fhir:"+parentType+'.'+name);
995    }
996    composeElement(t, "type", name, element, index);
997    if (element.hasCodeElement()) {
998      composeUri(t, "TypeRefComponent", "code", element.getCodeElement(), -1);
999    }
1000    for (int i = 0; i < element.getProfile().size(); i++) {
1001      composeCanonical(t, "TypeRefComponent", "profile", element.getProfile().get(i), i);
1002    }
1003    for (int i = 0; i < element.getTargetProfile().size(); i++) {
1004      composeCanonical(t, "TypeRefComponent", "targetProfile", element.getTargetProfile().get(i), i);
1005    }
1006    for (int i = 0; i < element.getAggregation().size(); i++) {
1007      composeEnum(t, "TypeRefComponent", "aggregation", element.getAggregation().get(i), i);
1008    }
1009    if (element.hasVersioningElement()) {
1010      composeEnum(t, "TypeRefComponent", "versioning", element.getVersioningElement(), -1);
1011    }
1012  }
1013
1014  protected void composeElementDefinitionExampleComponent(Complex parent, String parentType, String name, ElementDefinition.ElementDefinitionExampleComponent element, int index) {
1015    if (element == null) 
1016      return;
1017    Complex t;
1018    if (Utilities.noString(parentType))
1019      t = parent;
1020    else {
1021      t = parent.predicate("fhir:"+parentType+'.'+name);
1022    }
1023    composeElement(t, "example", name, element, index);
1024    if (element.hasLabelElement()) {
1025      composeString(t, "ElementDefinitionExampleComponent", "label", element.getLabelElement(), -1);
1026    }
1027    if (element.hasValue()) {
1028      composeType(t, "ElementDefinitionExampleComponent", "value", element.getValue(), -1);
1029    }
1030  }
1031
1032  protected void composeElementDefinitionConstraintComponent(Complex parent, String parentType, String name, ElementDefinition.ElementDefinitionConstraintComponent element, int index) {
1033    if (element == null) 
1034      return;
1035    Complex t;
1036    if (Utilities.noString(parentType))
1037      t = parent;
1038    else {
1039      t = parent.predicate("fhir:"+parentType+'.'+name);
1040    }
1041    composeElement(t, "constraint", name, element, index);
1042    if (element.hasKeyElement()) {
1043      composeId(t, "ElementDefinitionConstraintComponent", "key", element.getKeyElement(), -1);
1044    }
1045    if (element.hasRequirementsElement()) {
1046      composeMarkdown(t, "ElementDefinitionConstraintComponent", "requirements", element.getRequirementsElement(), -1);
1047    }
1048    if (element.hasSeverityElement()) {
1049      composeEnum(t, "ElementDefinitionConstraintComponent", "severity", element.getSeverityElement(), -1);
1050    }
1051    if (element.hasSuppressElement()) {
1052      composeBoolean(t, "ElementDefinitionConstraintComponent", "suppress", element.getSuppressElement(), -1);
1053    }
1054    if (element.hasHumanElement()) {
1055      composeString(t, "ElementDefinitionConstraintComponent", "human", element.getHumanElement(), -1);
1056    }
1057    if (element.hasExpressionElement()) {
1058      composeString(t, "ElementDefinitionConstraintComponent", "expression", element.getExpressionElement(), -1);
1059    }
1060    if (element.hasXpathElement()) {
1061      composeString(t, "ElementDefinitionConstraintComponent", "xpath", element.getXpathElement(), -1);
1062    }
1063    if (element.hasSourceElement()) {
1064      composeCanonical(t, "ElementDefinitionConstraintComponent", "source", element.getSourceElement(), -1);
1065    }
1066  }
1067
1068  protected void composeElementDefinitionBindingComponent(Complex parent, String parentType, String name, ElementDefinition.ElementDefinitionBindingComponent element, int index) {
1069    if (element == null) 
1070      return;
1071    Complex t;
1072    if (Utilities.noString(parentType))
1073      t = parent;
1074    else {
1075      t = parent.predicate("fhir:"+parentType+'.'+name);
1076    }
1077    composeElement(t, "binding", name, element, index);
1078    if (element.hasStrengthElement()) {
1079      composeEnum(t, "ElementDefinitionBindingComponent", "strength", element.getStrengthElement(), -1);
1080    }
1081    if (element.hasDescriptionElement()) {
1082      composeMarkdown(t, "ElementDefinitionBindingComponent", "description", element.getDescriptionElement(), -1);
1083    }
1084    if (element.hasValueSetElement()) {
1085      composeCanonical(t, "ElementDefinitionBindingComponent", "valueSet", element.getValueSetElement(), -1);
1086    }
1087  }
1088
1089  protected void composeElementDefinitionMappingComponent(Complex parent, String parentType, String name, ElementDefinition.ElementDefinitionMappingComponent element, int index) {
1090    if (element == null) 
1091      return;
1092    Complex t;
1093    if (Utilities.noString(parentType))
1094      t = parent;
1095    else {
1096      t = parent.predicate("fhir:"+parentType+'.'+name);
1097    }
1098    composeElement(t, "mapping", name, element, index);
1099    if (element.hasIdentityElement()) {
1100      composeId(t, "ElementDefinitionMappingComponent", "identity", element.getIdentityElement(), -1);
1101    }
1102    if (element.hasLanguageElement()) {
1103      composeCode(t, "ElementDefinitionMappingComponent", "language", element.getLanguageElement(), -1);
1104    }
1105    if (element.hasMapElement()) {
1106      composeString(t, "ElementDefinitionMappingComponent", "map", element.getMapElement(), -1);
1107    }
1108    if (element.hasCommentElement()) {
1109      composeMarkdown(t, "ElementDefinitionMappingComponent", "comment", element.getCommentElement(), -1);
1110    }
1111  }
1112
1113  protected void composeExpression(Complex parent, String parentType, String name, Expression element, int index) {
1114    if (element == null) 
1115      return;
1116    Complex t;
1117    if (Utilities.noString(parentType))
1118      t = parent;
1119    else {
1120      t = parent.predicate("fhir:"+parentType+'.'+name);
1121    }
1122    composeDataType(t, "Expression", name, element, index);
1123    if (element.hasDescriptionElement()) {
1124      composeString(t, "Expression", "description", element.getDescriptionElement(), -1);
1125    }
1126    if (element.hasNameElement()) {
1127      composeId(t, "Expression", "name", element.getNameElement(), -1);
1128    }
1129    if (element.hasLanguageElement()) {
1130      composeCode(t, "Expression", "language", element.getLanguageElement(), -1);
1131    }
1132    if (element.hasExpressionElement()) {
1133      composeString(t, "Expression", "expression", element.getExpressionElement(), -1);
1134    }
1135    if (element.hasReferenceElement()) {
1136      composeUri(t, "Expression", "reference", element.getReferenceElement(), -1);
1137    }
1138  }
1139
1140  protected void composeExtendedContactDetail(Complex parent, String parentType, String name, ExtendedContactDetail element, int index) {
1141    if (element == null) 
1142      return;
1143    Complex t;
1144    if (Utilities.noString(parentType))
1145      t = parent;
1146    else {
1147      t = parent.predicate("fhir:"+parentType+'.'+name);
1148    }
1149    composeDataType(t, "ExtendedContactDetail", name, element, index);
1150    if (element.hasPurpose()) {
1151      composeCodeableConcept(t, "ExtendedContactDetail", "purpose", element.getPurpose(), -1);
1152    }
1153    for (int i = 0; i < element.getName().size(); i++) {
1154      composeHumanName(t, "ExtendedContactDetail", "name", element.getName().get(i), i);
1155    }
1156    for (int i = 0; i < element.getTelecom().size(); i++) {
1157      composeContactPoint(t, "ExtendedContactDetail", "telecom", element.getTelecom().get(i), i);
1158    }
1159    if (element.hasAddress()) {
1160      composeAddress(t, "ExtendedContactDetail", "address", element.getAddress(), -1);
1161    }
1162    if (element.hasOrganization()) {
1163      composeReference(t, "ExtendedContactDetail", "organization", element.getOrganization(), -1);
1164    }
1165    if (element.hasPeriod()) {
1166      composePeriod(t, "ExtendedContactDetail", "period", element.getPeriod(), -1);
1167    }
1168  }
1169
1170  protected void composeExtension(Complex parent, String parentType, String name, Extension element, int index) {
1171    if (element == null) 
1172      return;
1173    Complex t;
1174    if (Utilities.noString(parentType))
1175      t = parent;
1176    else {
1177      t = parent.predicate("fhir:"+parentType+'.'+name);
1178    }
1179    composeDataType(t, "Extension", name, element, index);
1180    if (element.hasUrlElement()) {
1181      composeUri(t, "Extension", "url", element.getUrlElement(), -1);
1182    }
1183    if (element.hasValue()) {
1184      composeType(t, "Extension", "value", element.getValue(), -1);
1185    }
1186  }
1187
1188  protected void composeHumanName(Complex parent, String parentType, String name, HumanName element, int index) {
1189    if (element == null) 
1190      return;
1191    Complex t;
1192    if (Utilities.noString(parentType))
1193      t = parent;
1194    else {
1195      t = parent.predicate("fhir:"+parentType+'.'+name);
1196    }
1197    composeDataType(t, "HumanName", name, element, index);
1198    if (element.hasUseElement()) {
1199      composeEnum(t, "HumanName", "use", element.getUseElement(), -1);
1200    }
1201    if (element.hasTextElement()) {
1202      composeString(t, "HumanName", "text", element.getTextElement(), -1);
1203    }
1204    if (element.hasFamilyElement()) {
1205      composeString(t, "HumanName", "family", element.getFamilyElement(), -1);
1206    }
1207    for (int i = 0; i < element.getGiven().size(); i++) {
1208      composeString(t, "HumanName", "given", element.getGiven().get(i), i);
1209    }
1210    for (int i = 0; i < element.getPrefix().size(); i++) {
1211      composeString(t, "HumanName", "prefix", element.getPrefix().get(i), i);
1212    }
1213    for (int i = 0; i < element.getSuffix().size(); i++) {
1214      composeString(t, "HumanName", "suffix", element.getSuffix().get(i), i);
1215    }
1216    if (element.hasPeriod()) {
1217      composePeriod(t, "HumanName", "period", element.getPeriod(), -1);
1218    }
1219  }
1220
1221  protected void composeIdentifier(Complex parent, String parentType, String name, Identifier element, int index) {
1222    if (element == null) 
1223      return;
1224    Complex t;
1225    if (Utilities.noString(parentType))
1226      t = parent;
1227    else {
1228      t = parent.predicate("fhir:"+parentType+'.'+name);
1229    }
1230    composeDataType(t, "Identifier", name, element, index);
1231    if (element.hasUseElement()) {
1232      composeEnum(t, "Identifier", "use", element.getUseElement(), -1);
1233    }
1234    if (element.hasType()) {
1235      composeCodeableConcept(t, "Identifier", "type", element.getType(), -1);
1236    }
1237    if (element.hasSystemElement()) {
1238      composeUri(t, "Identifier", "system", element.getSystemElement(), -1);
1239    }
1240    if (element.hasValueElement()) {
1241      composeString(t, "Identifier", "value", element.getValueElement(), -1);
1242    }
1243    if (element.hasPeriod()) {
1244      composePeriod(t, "Identifier", "period", element.getPeriod(), -1);
1245    }
1246    if (element.hasAssigner()) {
1247      composeReference(t, "Identifier", "assigner", element.getAssigner(), -1);
1248    }
1249  }
1250
1251  protected void composeMarketingStatus(Complex parent, String parentType, String name, MarketingStatus element, int index) {
1252    if (element == null) 
1253      return;
1254    Complex t;
1255    if (Utilities.noString(parentType))
1256      t = parent;
1257    else {
1258      t = parent.predicate("fhir:"+parentType+'.'+name);
1259    }
1260    composeBackboneType(t, "MarketingStatus", name, element, index);
1261    if (element.hasCountry()) {
1262      composeCodeableConcept(t, "MarketingStatus", "country", element.getCountry(), -1);
1263    }
1264    if (element.hasJurisdiction()) {
1265      composeCodeableConcept(t, "MarketingStatus", "jurisdiction", element.getJurisdiction(), -1);
1266    }
1267    if (element.hasStatus()) {
1268      composeCodeableConcept(t, "MarketingStatus", "status", element.getStatus(), -1);
1269    }
1270    if (element.hasDateRange()) {
1271      composePeriod(t, "MarketingStatus", "dateRange", element.getDateRange(), -1);
1272    }
1273    if (element.hasRestoreDateElement()) {
1274      composeDateTime(t, "MarketingStatus", "restoreDate", element.getRestoreDateElement(), -1);
1275    }
1276  }
1277
1278  protected void composeMeta(Complex parent, String parentType, String name, Meta element, int index) {
1279    if (element == null) 
1280      return;
1281    Complex t;
1282    if (Utilities.noString(parentType))
1283      t = parent;
1284    else {
1285      t = parent.predicate("fhir:"+parentType+'.'+name);
1286    }
1287    composeDataType(t, "Meta", name, element, index);
1288    if (element.hasVersionIdElement()) {
1289      composeId(t, "Meta", "versionId", element.getVersionIdElement(), -1);
1290    }
1291    if (element.hasLastUpdatedElement()) {
1292      composeInstant(t, "Meta", "lastUpdated", element.getLastUpdatedElement(), -1);
1293    }
1294    if (element.hasSourceElement()) {
1295      composeUri(t, "Meta", "source", element.getSourceElement(), -1);
1296    }
1297    for (int i = 0; i < element.getProfile().size(); i++) {
1298      composeCanonical(t, "Meta", "profile", element.getProfile().get(i), i);
1299    }
1300    for (int i = 0; i < element.getSecurity().size(); i++) {
1301      composeCoding(t, "Meta", "security", element.getSecurity().get(i), i);
1302    }
1303    for (int i = 0; i < element.getTag().size(); i++) {
1304      composeCoding(t, "Meta", "tag", element.getTag().get(i), i);
1305    }
1306  }
1307
1308  protected void composeMonetaryComponent(Complex parent, String parentType, String name, MonetaryComponent element, int index) {
1309    if (element == null) 
1310      return;
1311    Complex t;
1312    if (Utilities.noString(parentType))
1313      t = parent;
1314    else {
1315      t = parent.predicate("fhir:"+parentType+'.'+name);
1316    }
1317    composeDataType(t, "MonetaryComponent", name, element, index);
1318    if (element.hasTypeElement()) {
1319      composeEnum(t, "MonetaryComponent", "type", element.getTypeElement(), -1);
1320    }
1321    if (element.hasCode()) {
1322      composeCodeableConcept(t, "MonetaryComponent", "code", element.getCode(), -1);
1323    }
1324    if (element.hasFactorElement()) {
1325      composeDecimal(t, "MonetaryComponent", "factor", element.getFactorElement(), -1);
1326    }
1327    if (element.hasAmount()) {
1328      composeMoney(t, "MonetaryComponent", "amount", element.getAmount(), -1);
1329    }
1330  }
1331
1332  protected void composeMoney(Complex parent, String parentType, String name, Money element, int index) {
1333    if (element == null) 
1334      return;
1335    Complex t;
1336    if (Utilities.noString(parentType))
1337      t = parent;
1338    else {
1339      t = parent.predicate("fhir:"+parentType+'.'+name);
1340    }
1341    composeDataType(t, "Money", name, element, index);
1342    if (element.hasValueElement()) {
1343      composeDecimal(t, "Money", "value", element.getValueElement(), -1);
1344    }
1345    if (element.hasCurrencyElement()) {
1346      composeCode(t, "Money", "currency", element.getCurrencyElement(), -1);
1347    }
1348  }
1349
1350  protected void composeNarrative(Complex parent, String parentType, String name, Narrative element, int index) {
1351    if (element == null) 
1352      return;
1353    Complex t;
1354    if (Utilities.noString(parentType))
1355      t = parent;
1356    else {
1357      t = parent.predicate("fhir:"+parentType+'.'+name);
1358    }
1359    composeDataType(t, "Narrative", name, element, index);
1360    if (element.hasStatusElement()) {
1361      composeEnum(t, "Narrative", "status", element.getStatusElement(), -1);
1362    }
1363    if (element.hasDiv()) {
1364      composeXhtmlNode(t, "Narrative", "div", element.getDiv(), -1);
1365    }
1366  }
1367
1368  protected void composeParameterDefinition(Complex parent, String parentType, String name, ParameterDefinition element, int index) {
1369    if (element == null) 
1370      return;
1371    Complex t;
1372    if (Utilities.noString(parentType))
1373      t = parent;
1374    else {
1375      t = parent.predicate("fhir:"+parentType+'.'+name);
1376    }
1377    composeDataType(t, "ParameterDefinition", name, element, index);
1378    if (element.hasNameElement()) {
1379      composeCode(t, "ParameterDefinition", "name", element.getNameElement(), -1);
1380    }
1381    if (element.hasUseElement()) {
1382      composeEnum(t, "ParameterDefinition", "use", element.getUseElement(), -1);
1383    }
1384    if (element.hasMinElement()) {
1385      composeInteger(t, "ParameterDefinition", "min", element.getMinElement(), -1);
1386    }
1387    if (element.hasMaxElement()) {
1388      composeString(t, "ParameterDefinition", "max", element.getMaxElement(), -1);
1389    }
1390    if (element.hasDocumentationElement()) {
1391      composeString(t, "ParameterDefinition", "documentation", element.getDocumentationElement(), -1);
1392    }
1393    if (element.hasTypeElement()) {
1394      composeEnum(t, "ParameterDefinition", "type", element.getTypeElement(), -1);
1395    }
1396    if (element.hasProfileElement()) {
1397      composeCanonical(t, "ParameterDefinition", "profile", element.getProfileElement(), -1);
1398    }
1399  }
1400
1401  protected void composePeriod(Complex parent, String parentType, String name, Period element, int index) {
1402    if (element == null) 
1403      return;
1404    Complex t;
1405    if (Utilities.noString(parentType))
1406      t = parent;
1407    else {
1408      t = parent.predicate("fhir:"+parentType+'.'+name);
1409    }
1410    composeDataType(t, "Period", name, element, index);
1411    if (element.hasStartElement()) {
1412      composeDateTime(t, "Period", "start", element.getStartElement(), -1);
1413    }
1414    if (element.hasEndElement()) {
1415      composeDateTime(t, "Period", "end", element.getEndElement(), -1);
1416    }
1417  }
1418
1419  protected void composePopulation(Complex parent, String parentType, String name, Population element, int index) {
1420    if (element == null) 
1421      return;
1422    Complex t;
1423    if (Utilities.noString(parentType))
1424      t = parent;
1425    else {
1426      t = parent.predicate("fhir:"+parentType+'.'+name);
1427    }
1428    composeBackboneType(t, "Population", name, element, index);
1429    if (element.hasAge()) {
1430      composeType(t, "Population", "age", element.getAge(), -1);
1431    }
1432    if (element.hasGender()) {
1433      composeCodeableConcept(t, "Population", "gender", element.getGender(), -1);
1434    }
1435    if (element.hasRace()) {
1436      composeCodeableConcept(t, "Population", "race", element.getRace(), -1);
1437    }
1438    if (element.hasPhysiologicalCondition()) {
1439      composeCodeableConcept(t, "Population", "physiologicalCondition", element.getPhysiologicalCondition(), -1);
1440    }
1441  }
1442
1443  protected void composeProductShelfLife(Complex parent, String parentType, String name, ProductShelfLife element, int index) {
1444    if (element == null) 
1445      return;
1446    Complex t;
1447    if (Utilities.noString(parentType))
1448      t = parent;
1449    else {
1450      t = parent.predicate("fhir:"+parentType+'.'+name);
1451    }
1452    composeBackboneType(t, "ProductShelfLife", name, element, index);
1453    if (element.hasType()) {
1454      composeCodeableConcept(t, "ProductShelfLife", "type", element.getType(), -1);
1455    }
1456    if (element.hasPeriod()) {
1457      composeType(t, "ProductShelfLife", "period", element.getPeriod(), -1);
1458    }
1459    for (int i = 0; i < element.getSpecialPrecautionsForStorage().size(); i++) {
1460      composeCodeableConcept(t, "ProductShelfLife", "specialPrecautionsForStorage", element.getSpecialPrecautionsForStorage().get(i), i);
1461    }
1462  }
1463
1464  protected void composeQuantity(Complex parent, String parentType, String name, Quantity element, int index) {
1465    if (element == null) 
1466      return;
1467    Complex t;
1468    if (Utilities.noString(parentType))
1469      t = parent;
1470    else {
1471      t = parent.predicate("fhir:"+parentType+'.'+name);
1472    }
1473    composeDataType(t, "Quantity", name, element, index);
1474    if (element.hasValueElement()) {
1475      composeDecimal(t, "Quantity", "value", element.getValueElement(), -1);
1476    }
1477    if (element.hasComparatorElement()) {
1478      composeEnum(t, "Quantity", "comparator", element.getComparatorElement(), -1);
1479    }
1480    if (element.hasUnitElement()) {
1481      composeString(t, "Quantity", "unit", element.getUnitElement(), -1);
1482    }
1483    if (element.hasSystemElement()) {
1484      composeUri(t, "Quantity", "system", element.getSystemElement(), -1);
1485    }
1486    if (element.hasCodeElement()) {
1487      composeCode(t, "Quantity", "code", element.getCodeElement(), -1);
1488    }
1489  }
1490
1491  protected void composeRange(Complex parent, String parentType, String name, Range element, int index) {
1492    if (element == null) 
1493      return;
1494    Complex t;
1495    if (Utilities.noString(parentType))
1496      t = parent;
1497    else {
1498      t = parent.predicate("fhir:"+parentType+'.'+name);
1499    }
1500    composeDataType(t, "Range", name, element, index);
1501    if (element.hasLow()) {
1502      composeQuantity(t, "Range", "low", element.getLow(), -1);
1503    }
1504    if (element.hasHigh()) {
1505      composeQuantity(t, "Range", "high", element.getHigh(), -1);
1506    }
1507  }
1508
1509  protected void composeRatio(Complex parent, String parentType, String name, Ratio element, int index) {
1510    if (element == null) 
1511      return;
1512    Complex t;
1513    if (Utilities.noString(parentType))
1514      t = parent;
1515    else {
1516      t = parent.predicate("fhir:"+parentType+'.'+name);
1517    }
1518    composeDataType(t, "Ratio", name, element, index);
1519    if (element.hasNumerator()) {
1520      composeQuantity(t, "Ratio", "numerator", element.getNumerator(), -1);
1521    }
1522    if (element.hasDenominator()) {
1523      composeQuantity(t, "Ratio", "denominator", element.getDenominator(), -1);
1524    }
1525  }
1526
1527  protected void composeRatioRange(Complex parent, String parentType, String name, RatioRange element, int index) {
1528    if (element == null) 
1529      return;
1530    Complex t;
1531    if (Utilities.noString(parentType))
1532      t = parent;
1533    else {
1534      t = parent.predicate("fhir:"+parentType+'.'+name);
1535    }
1536    composeDataType(t, "RatioRange", name, element, index);
1537    if (element.hasLowNumerator()) {
1538      composeQuantity(t, "RatioRange", "lowNumerator", element.getLowNumerator(), -1);
1539    }
1540    if (element.hasHighNumerator()) {
1541      composeQuantity(t, "RatioRange", "highNumerator", element.getHighNumerator(), -1);
1542    }
1543    if (element.hasDenominator()) {
1544      composeQuantity(t, "RatioRange", "denominator", element.getDenominator(), -1);
1545    }
1546  }
1547
1548  protected void composeReference(Complex parent, String parentType, String name, Reference element, int index) {
1549    if (element == null) 
1550      return;
1551    Complex t;
1552    if (Utilities.noString(parentType))
1553      t = parent;
1554    else {
1555      t = parent.predicate("fhir:"+parentType+'.'+name);
1556    }
1557    composeDataType(t, "Reference", name, element, index);
1558    if (element.hasReferenceElement()) {
1559      composeString(t, "Reference", "reference", element.getReferenceElement_(), -1);
1560    }
1561    if (element.hasTypeElement()) {
1562      composeUri(t, "Reference", "type", element.getTypeElement(), -1);
1563    }
1564    if (element.hasIdentifier()) {
1565      composeIdentifier(t, "Reference", "identifier", element.getIdentifier(), -1);
1566    }
1567    if (element.hasDisplayElement()) {
1568      composeString(t, "Reference", "display", element.getDisplayElement(), -1);
1569    }
1570  }
1571
1572  protected void composeRelatedArtifact(Complex parent, String parentType, String name, RelatedArtifact element, int index) {
1573    if (element == null) 
1574      return;
1575    Complex t;
1576    if (Utilities.noString(parentType))
1577      t = parent;
1578    else {
1579      t = parent.predicate("fhir:"+parentType+'.'+name);
1580    }
1581    composeDataType(t, "RelatedArtifact", name, element, index);
1582    if (element.hasTypeElement()) {
1583      composeEnum(t, "RelatedArtifact", "type", element.getTypeElement(), -1);
1584    }
1585    for (int i = 0; i < element.getClassifier().size(); i++) {
1586      composeCodeableConcept(t, "RelatedArtifact", "classifier", element.getClassifier().get(i), i);
1587    }
1588    if (element.hasLabelElement()) {
1589      composeString(t, "RelatedArtifact", "label", element.getLabelElement(), -1);
1590    }
1591    if (element.hasDisplayElement()) {
1592      composeString(t, "RelatedArtifact", "display", element.getDisplayElement(), -1);
1593    }
1594    if (element.hasCitationElement()) {
1595      composeMarkdown(t, "RelatedArtifact", "citation", element.getCitationElement(), -1);
1596    }
1597    if (element.hasDocument()) {
1598      composeAttachment(t, "RelatedArtifact", "document", element.getDocument(), -1);
1599    }
1600    if (element.hasResourceElement()) {
1601      composeCanonical(t, "RelatedArtifact", "resource", element.getResourceElement(), -1);
1602    }
1603    if (element.hasResourceReference()) {
1604      composeReference(t, "RelatedArtifact", "resourceReference", element.getResourceReference(), -1);
1605    }
1606    if (element.hasPublicationStatusElement()) {
1607      composeEnum(t, "RelatedArtifact", "publicationStatus", element.getPublicationStatusElement(), -1);
1608    }
1609    if (element.hasPublicationDateElement()) {
1610      composeDate(t, "RelatedArtifact", "publicationDate", element.getPublicationDateElement(), -1);
1611    }
1612  }
1613
1614  protected void composeSampledData(Complex parent, String parentType, String name, SampledData element, int index) {
1615    if (element == null) 
1616      return;
1617    Complex t;
1618    if (Utilities.noString(parentType))
1619      t = parent;
1620    else {
1621      t = parent.predicate("fhir:"+parentType+'.'+name);
1622    }
1623    composeDataType(t, "SampledData", name, element, index);
1624    if (element.hasOrigin()) {
1625      composeQuantity(t, "SampledData", "origin", element.getOrigin(), -1);
1626    }
1627    if (element.hasIntervalElement()) {
1628      composeDecimal(t, "SampledData", "interval", element.getIntervalElement(), -1);
1629    }
1630    if (element.hasIntervalUnitElement()) {
1631      composeCode(t, "SampledData", "intervalUnit", element.getIntervalUnitElement(), -1);
1632    }
1633    if (element.hasFactorElement()) {
1634      composeDecimal(t, "SampledData", "factor", element.getFactorElement(), -1);
1635    }
1636    if (element.hasLowerLimitElement()) {
1637      composeDecimal(t, "SampledData", "lowerLimit", element.getLowerLimitElement(), -1);
1638    }
1639    if (element.hasUpperLimitElement()) {
1640      composeDecimal(t, "SampledData", "upperLimit", element.getUpperLimitElement(), -1);
1641    }
1642    if (element.hasDimensionsElement()) {
1643      composePositiveInt(t, "SampledData", "dimensions", element.getDimensionsElement(), -1);
1644    }
1645    if (element.hasDataElement()) {
1646      composeString(t, "SampledData", "data", element.getDataElement(), -1);
1647    }
1648  }
1649
1650  protected void composeSignature(Complex parent, String parentType, String name, Signature element, int index) {
1651    if (element == null) 
1652      return;
1653    Complex t;
1654    if (Utilities.noString(parentType))
1655      t = parent;
1656    else {
1657      t = parent.predicate("fhir:"+parentType+'.'+name);
1658    }
1659    composeDataType(t, "Signature", name, element, index);
1660    for (int i = 0; i < element.getType().size(); i++) {
1661      composeCoding(t, "Signature", "type", element.getType().get(i), i);
1662    }
1663    if (element.hasWhenElement()) {
1664      composeInstant(t, "Signature", "when", element.getWhenElement(), -1);
1665    }
1666    if (element.hasWho()) {
1667      composeReference(t, "Signature", "who", element.getWho(), -1);
1668    }
1669    if (element.hasOnBehalfOf()) {
1670      composeReference(t, "Signature", "onBehalfOf", element.getOnBehalfOf(), -1);
1671    }
1672    if (element.hasTargetFormatElement()) {
1673      composeCode(t, "Signature", "targetFormat", element.getTargetFormatElement(), -1);
1674    }
1675    if (element.hasSigFormatElement()) {
1676      composeCode(t, "Signature", "sigFormat", element.getSigFormatElement(), -1);
1677    }
1678    if (element.hasDataElement()) {
1679      composeBase64Binary(t, "Signature", "data", element.getDataElement(), -1);
1680    }
1681  }
1682
1683  protected void composeTiming(Complex parent, String parentType, String name, Timing element, int index) {
1684    if (element == null) 
1685      return;
1686    Complex t;
1687    if (Utilities.noString(parentType))
1688      t = parent;
1689    else {
1690      t = parent.predicate("fhir:"+parentType+'.'+name);
1691    }
1692    composeBackboneType(t, "Timing", name, element, index);
1693    for (int i = 0; i < element.getEvent().size(); i++) {
1694      composeDateTime(t, "Timing", "event", element.getEvent().get(i), i);
1695    }
1696    if (element.hasRepeat()) {
1697      composeTimingRepeatComponent(t, "Timing", "repeat", element.getRepeat(), -1);
1698    }
1699    if (element.hasCode()) {
1700      composeCodeableConcept(t, "Timing", "code", element.getCode(), -1);
1701    }
1702  }
1703
1704  protected void composeTimingRepeatComponent(Complex parent, String parentType, String name, Timing.TimingRepeatComponent element, int index) {
1705    if (element == null) 
1706      return;
1707    Complex t;
1708    if (Utilities.noString(parentType))
1709      t = parent;
1710    else {
1711      t = parent.predicate("fhir:"+parentType+'.'+name);
1712    }
1713    composeElement(t, "repeat", name, element, index);
1714    if (element.hasBounds()) {
1715      composeType(t, "TimingRepeatComponent", "bounds", element.getBounds(), -1);
1716    }
1717    if (element.hasCountElement()) {
1718      composePositiveInt(t, "TimingRepeatComponent", "count", element.getCountElement(), -1);
1719    }
1720    if (element.hasCountMaxElement()) {
1721      composePositiveInt(t, "TimingRepeatComponent", "countMax", element.getCountMaxElement(), -1);
1722    }
1723    if (element.hasDurationElement()) {
1724      composeDecimal(t, "TimingRepeatComponent", "duration", element.getDurationElement(), -1);
1725    }
1726    if (element.hasDurationMaxElement()) {
1727      composeDecimal(t, "TimingRepeatComponent", "durationMax", element.getDurationMaxElement(), -1);
1728    }
1729    if (element.hasDurationUnitElement()) {
1730      composeEnum(t, "TimingRepeatComponent", "durationUnit", element.getDurationUnitElement(), -1);
1731    }
1732    if (element.hasFrequencyElement()) {
1733      composePositiveInt(t, "TimingRepeatComponent", "frequency", element.getFrequencyElement(), -1);
1734    }
1735    if (element.hasFrequencyMaxElement()) {
1736      composePositiveInt(t, "TimingRepeatComponent", "frequencyMax", element.getFrequencyMaxElement(), -1);
1737    }
1738    if (element.hasPeriodElement()) {
1739      composeDecimal(t, "TimingRepeatComponent", "period", element.getPeriodElement(), -1);
1740    }
1741    if (element.hasPeriodMaxElement()) {
1742      composeDecimal(t, "TimingRepeatComponent", "periodMax", element.getPeriodMaxElement(), -1);
1743    }
1744    if (element.hasPeriodUnitElement()) {
1745      composeEnum(t, "TimingRepeatComponent", "periodUnit", element.getPeriodUnitElement(), -1);
1746    }
1747    for (int i = 0; i < element.getDayOfWeek().size(); i++) {
1748      composeEnum(t, "TimingRepeatComponent", "dayOfWeek", element.getDayOfWeek().get(i), i);
1749    }
1750    for (int i = 0; i < element.getTimeOfDay().size(); i++) {
1751      composeTime(t, "TimingRepeatComponent", "timeOfDay", element.getTimeOfDay().get(i), i);
1752    }
1753    for (int i = 0; i < element.getWhen().size(); i++) {
1754      composeEnum(t, "TimingRepeatComponent", "when", element.getWhen().get(i), i);
1755    }
1756    if (element.hasOffsetElement()) {
1757      composeUnsignedInt(t, "TimingRepeatComponent", "offset", element.getOffsetElement(), -1);
1758    }
1759  }
1760
1761  protected void composeTriggerDefinition(Complex parent, String parentType, String name, TriggerDefinition element, int index) {
1762    if (element == null) 
1763      return;
1764    Complex t;
1765    if (Utilities.noString(parentType))
1766      t = parent;
1767    else {
1768      t = parent.predicate("fhir:"+parentType+'.'+name);
1769    }
1770    composeDataType(t, "TriggerDefinition", name, element, index);
1771    if (element.hasTypeElement()) {
1772      composeEnum(t, "TriggerDefinition", "type", element.getTypeElement(), -1);
1773    }
1774    if (element.hasNameElement()) {
1775      composeString(t, "TriggerDefinition", "name", element.getNameElement(), -1);
1776    }
1777    if (element.hasCode()) {
1778      composeCodeableConcept(t, "TriggerDefinition", "code", element.getCode(), -1);
1779    }
1780    if (element.hasSubscriptionTopicElement()) {
1781      composeCanonical(t, "TriggerDefinition", "subscriptionTopic", element.getSubscriptionTopicElement(), -1);
1782    }
1783    if (element.hasTiming()) {
1784      composeType(t, "TriggerDefinition", "timing", element.getTiming(), -1);
1785    }
1786    for (int i = 0; i < element.getData().size(); i++) {
1787      composeDataRequirement(t, "TriggerDefinition", "data", element.getData().get(i), i);
1788    }
1789    if (element.hasCondition()) {
1790      composeExpression(t, "TriggerDefinition", "condition", element.getCondition(), -1);
1791    }
1792  }
1793
1794  protected void composeUsageContext(Complex parent, String parentType, String name, UsageContext element, int index) {
1795    if (element == null) 
1796      return;
1797    Complex t;
1798    if (Utilities.noString(parentType))
1799      t = parent;
1800    else {
1801      t = parent.predicate("fhir:"+parentType+'.'+name);
1802    }
1803    composeDataType(t, "UsageContext", name, element, index);
1804    if (element.hasCode()) {
1805      composeCoding(t, "UsageContext", "code", element.getCode(), -1);
1806    }
1807    if (element.hasValue()) {
1808      composeType(t, "UsageContext", "value", element.getValue(), -1);
1809    }
1810  }
1811
1812  protected void composeVirtualServiceDetail(Complex parent, String parentType, String name, VirtualServiceDetail element, int index) {
1813    if (element == null) 
1814      return;
1815    Complex t;
1816    if (Utilities.noString(parentType))
1817      t = parent;
1818    else {
1819      t = parent.predicate("fhir:"+parentType+'.'+name);
1820    }
1821    composeDataType(t, "VirtualServiceDetail", name, element, index);
1822    if (element.hasChannelType()) {
1823      composeCoding(t, "VirtualServiceDetail", "channelType", element.getChannelType(), -1);
1824    }
1825    if (element.hasAddress()) {
1826      composeType(t, "VirtualServiceDetail", "address", element.getAddress(), -1);
1827    }
1828    for (int i = 0; i < element.getAdditionalInfo().size(); i++) {
1829      composeUrl(t, "VirtualServiceDetail", "additionalInfo", element.getAdditionalInfo().get(i), i);
1830    }
1831    if (element.hasMaxParticipantsElement()) {
1832      composePositiveInt(t, "VirtualServiceDetail", "maxParticipants", element.getMaxParticipantsElement(), -1);
1833    }
1834    if (element.hasSessionKeyElement()) {
1835      composeString(t, "VirtualServiceDetail", "sessionKey", element.getSessionKeyElement(), -1);
1836    }
1837  }
1838
1839  protected void composeCanonicalResource(Complex t, String parentType, String name, CanonicalResource element, int index) {
1840    composeDomainResource(t, parentType, name, element, index);
1841    if (element.hasUrlElement()) {
1842      composeUri(t, "CanonicalResource", "url", element.getUrlElement(), -1);
1843    }
1844    for (int i = 0; i < element.getIdentifier().size(); i++) {
1845      composeIdentifier(t, "CanonicalResource", "identifier", element.getIdentifier().get(i), i);
1846    }
1847    if (element.hasVersionElement()) {
1848      composeString(t, "CanonicalResource", "version", element.getVersionElement(), -1);
1849    }
1850    if (element.hasVersionAlgorithm()) {
1851      composeType(t, "CanonicalResource", "versionAlgorithm", element.getVersionAlgorithm(), -1);
1852    }
1853    if (element.hasNameElement()) {
1854      composeString(t, "CanonicalResource", "name", element.getNameElement(), -1);
1855    }
1856    if (element.hasTitleElement()) {
1857      composeString(t, "CanonicalResource", "title", element.getTitleElement(), -1);
1858    }
1859    if (element.hasStatusElement()) {
1860      composeEnum(t, "CanonicalResource", "status", element.getStatusElement(), -1);
1861    }
1862    if (element.hasExperimentalElement()) {
1863      composeBoolean(t, "CanonicalResource", "experimental", element.getExperimentalElement(), -1);
1864    }
1865    if (element.hasDateElement()) {
1866      composeDateTime(t, "CanonicalResource", "date", element.getDateElement(), -1);
1867    }
1868    if (element.hasPublisherElement()) {
1869      composeString(t, "CanonicalResource", "publisher", element.getPublisherElement(), -1);
1870    }
1871    for (int i = 0; i < element.getContact().size(); i++) {
1872      composeContactDetail(t, "CanonicalResource", "contact", element.getContact().get(i), i);
1873    }
1874    if (element.hasDescriptionElement()) {
1875      composeMarkdown(t, "CanonicalResource", "description", element.getDescriptionElement(), -1);
1876    }
1877    for (int i = 0; i < element.getUseContext().size(); i++) {
1878      composeUsageContext(t, "CanonicalResource", "useContext", element.getUseContext().get(i), i);
1879    }
1880    for (int i = 0; i < element.getJurisdiction().size(); i++) {
1881      composeCodeableConcept(t, "CanonicalResource", "jurisdiction", element.getJurisdiction().get(i), i);
1882    }
1883    if (element.hasPurposeElement()) {
1884      composeMarkdown(t, "CanonicalResource", "purpose", element.getPurposeElement(), -1);
1885    }
1886    if (element.hasCopyrightElement()) {
1887      composeMarkdown(t, "CanonicalResource", "copyright", element.getCopyrightElement(), -1);
1888    }
1889    if (element.hasCopyrightLabelElement()) {
1890      composeString(t, "CanonicalResource", "copyrightLabel", element.getCopyrightLabelElement(), -1);
1891    }
1892  }
1893
1894  protected void composeDomainResource(Complex t, String parentType, String name, DomainResource element, int index) {
1895    composeResource(t, parentType, name, element, index);
1896    if (element.hasText()) {
1897      composeNarrative(t, "DomainResource", "text", element.getText(), -1);
1898    }
1899    for (int i = 0; i < element.getContained().size(); i++) {
1900      composeResource(t, "DomainResource", "contained", element.getContained().get(i), i);
1901    }
1902    for (int i = 0; i < element.getExtension().size(); i++) {
1903      composeExtension(t, "DomainResource", "extension", element.getExtension().get(i), i);
1904    }
1905    for (int i = 0; i < element.getModifierExtension().size(); i++) {
1906      composeExtension(t, "DomainResource", "modifierExtension", element.getModifierExtension().get(i), i);
1907    }
1908  }
1909
1910  protected void composeMetadataResource(Complex t, String parentType, String name, MetadataResource element, int index) {
1911    composeCanonicalResource(t, parentType, name, element, index);
1912    if (element.hasApprovalDateElement()) {
1913      composeDate(t, "MetadataResource", "approvalDate", element.getApprovalDateElement(), -1);
1914    }
1915    if (element.hasLastReviewDateElement()) {
1916      composeDate(t, "MetadataResource", "lastReviewDate", element.getLastReviewDateElement(), -1);
1917    }
1918    if (element.hasEffectivePeriod()) {
1919      composePeriod(t, "MetadataResource", "effectivePeriod", element.getEffectivePeriod(), -1);
1920    }
1921    for (int i = 0; i < element.getTopic().size(); i++) {
1922      composeCodeableConcept(t, "MetadataResource", "topic", element.getTopic().get(i), i);
1923    }
1924    for (int i = 0; i < element.getAuthor().size(); i++) {
1925      composeContactDetail(t, "MetadataResource", "author", element.getAuthor().get(i), i);
1926    }
1927    for (int i = 0; i < element.getEditor().size(); i++) {
1928      composeContactDetail(t, "MetadataResource", "editor", element.getEditor().get(i), i);
1929    }
1930    for (int i = 0; i < element.getReviewer().size(); i++) {
1931      composeContactDetail(t, "MetadataResource", "reviewer", element.getReviewer().get(i), i);
1932    }
1933    for (int i = 0; i < element.getEndorser().size(); i++) {
1934      composeContactDetail(t, "MetadataResource", "endorser", element.getEndorser().get(i), i);
1935    }
1936    for (int i = 0; i < element.getRelatedArtifact().size(); i++) {
1937      composeRelatedArtifact(t, "MetadataResource", "relatedArtifact", element.getRelatedArtifact().get(i), i);
1938    }
1939  }
1940
1941  protected void composeResource(Complex t, String parentType, String name, Resource element, int index) {
1942    composeBase(t, parentType, name, element, index);
1943    if (element.hasIdElement()) {
1944      composeId(t, "Resource", "id", element.getIdElement(), -1);
1945    }
1946    if (element.hasMeta()) {
1947      composeMeta(t, "Resource", "meta", element.getMeta(), -1);
1948    }
1949    if (element.hasImplicitRulesElement()) {
1950      composeUri(t, "Resource", "implicitRules", element.getImplicitRulesElement(), -1);
1951    }
1952    if (element.hasLanguageElement()) {
1953      composeCode(t, "Resource", "language", element.getLanguageElement(), -1);
1954    }
1955  }
1956
1957  protected void composeAccount(Complex parent, String parentType, String name, Account element, int index) {
1958    if (element == null) 
1959      return;
1960    Complex t;
1961    if (Utilities.noString(parentType))
1962      t = parent;
1963    else {
1964      t = parent.predicate("fhir:"+parentType+'.'+name);
1965    }
1966    composeDomainResource(t, "Account", name, element, index);
1967    for (int i = 0; i < element.getIdentifier().size(); i++) {
1968      composeIdentifier(t, "Account", "identifier", element.getIdentifier().get(i), i);
1969    }
1970    if (element.hasStatusElement()) {
1971      composeEnum(t, "Account", "status", element.getStatusElement(), -1);
1972    }
1973    if (element.hasBillingStatus()) {
1974      composeCodeableConcept(t, "Account", "billingStatus", element.getBillingStatus(), -1);
1975    }
1976    if (element.hasType()) {
1977      composeCodeableConcept(t, "Account", "type", element.getType(), -1);
1978    }
1979    if (element.hasNameElement()) {
1980      composeString(t, "Account", "name", element.getNameElement(), -1);
1981    }
1982    for (int i = 0; i < element.getSubject().size(); i++) {
1983      composeReference(t, "Account", "subject", element.getSubject().get(i), i);
1984    }
1985    if (element.hasServicePeriod()) {
1986      composePeriod(t, "Account", "servicePeriod", element.getServicePeriod(), -1);
1987    }
1988    for (int i = 0; i < element.getCoverage().size(); i++) {
1989      composeAccountCoverageComponent(t, "Account", "coverage", element.getCoverage().get(i), i);
1990    }
1991    if (element.hasOwner()) {
1992      composeReference(t, "Account", "owner", element.getOwner(), -1);
1993    }
1994    if (element.hasDescriptionElement()) {
1995      composeString(t, "Account", "description", element.getDescriptionElement(), -1);
1996    }
1997    for (int i = 0; i < element.getGuarantor().size(); i++) {
1998      composeAccountGuarantorComponent(t, "Account", "guarantor", element.getGuarantor().get(i), i);
1999    }
2000    for (int i = 0; i < element.getRelatedAccount().size(); i++) {
2001      composeAccountRelatedAccountComponent(t, "Account", "relatedAccount", element.getRelatedAccount().get(i), i);
2002    }
2003    if (element.hasCurrency()) {
2004      composeCodeableConcept(t, "Account", "currency", element.getCurrency(), -1);
2005    }
2006    for (int i = 0; i < element.getBalance().size(); i++) {
2007      composeAccountBalanceComponent(t, "Account", "balance", element.getBalance().get(i), i);
2008    }
2009    if (element.hasCalculatedAtElement()) {
2010      composeInstant(t, "Account", "calculatedAt", element.getCalculatedAtElement(), -1);
2011    }
2012  }
2013
2014  protected void composeAccountCoverageComponent(Complex parent, String parentType, String name, Account.CoverageComponent element, int index) {
2015    if (element == null) 
2016      return;
2017    Complex t;
2018    if (Utilities.noString(parentType))
2019      t = parent;
2020    else {
2021      t = parent.predicate("fhir:"+parentType+'.'+name);
2022    }
2023    composeBackboneElement(t, "coverage", name, element, index);
2024    if (element.hasCoverage()) {
2025      composeReference(t, "CoverageComponent", "coverage", element.getCoverage(), -1);
2026    }
2027    if (element.hasPriorityElement()) {
2028      composePositiveInt(t, "CoverageComponent", "priority", element.getPriorityElement(), -1);
2029    }
2030  }
2031
2032  protected void composeAccountGuarantorComponent(Complex parent, String parentType, String name, Account.GuarantorComponent element, int index) {
2033    if (element == null) 
2034      return;
2035    Complex t;
2036    if (Utilities.noString(parentType))
2037      t = parent;
2038    else {
2039      t = parent.predicate("fhir:"+parentType+'.'+name);
2040    }
2041    composeBackboneElement(t, "guarantor", name, element, index);
2042    if (element.hasParty()) {
2043      composeReference(t, "GuarantorComponent", "party", element.getParty(), -1);
2044    }
2045    if (element.hasOnHoldElement()) {
2046      composeBoolean(t, "GuarantorComponent", "onHold", element.getOnHoldElement(), -1);
2047    }
2048    if (element.hasPeriod()) {
2049      composePeriod(t, "GuarantorComponent", "period", element.getPeriod(), -1);
2050    }
2051  }
2052
2053  protected void composeAccountRelatedAccountComponent(Complex parent, String parentType, String name, Account.AccountRelatedAccountComponent element, int index) {
2054    if (element == null) 
2055      return;
2056    Complex t;
2057    if (Utilities.noString(parentType))
2058      t = parent;
2059    else {
2060      t = parent.predicate("fhir:"+parentType+'.'+name);
2061    }
2062    composeBackboneElement(t, "relatedAccount", name, element, index);
2063    if (element.hasRelationship()) {
2064      composeCodeableConcept(t, "AccountRelatedAccountComponent", "relationship", element.getRelationship(), -1);
2065    }
2066    if (element.hasAccount()) {
2067      composeReference(t, "AccountRelatedAccountComponent", "account", element.getAccount(), -1);
2068    }
2069  }
2070
2071  protected void composeAccountBalanceComponent(Complex parent, String parentType, String name, Account.AccountBalanceComponent element, int index) {
2072    if (element == null) 
2073      return;
2074    Complex t;
2075    if (Utilities.noString(parentType))
2076      t = parent;
2077    else {
2078      t = parent.predicate("fhir:"+parentType+'.'+name);
2079    }
2080    composeBackboneElement(t, "balance", name, element, index);
2081    if (element.hasAggregate()) {
2082      composeCodeableConcept(t, "AccountBalanceComponent", "aggregate", element.getAggregate(), -1);
2083    }
2084    if (element.hasTerm()) {
2085      composeCodeableConcept(t, "AccountBalanceComponent", "term", element.getTerm(), -1);
2086    }
2087    if (element.hasEstimateElement()) {
2088      composeBoolean(t, "AccountBalanceComponent", "estimate", element.getEstimateElement(), -1);
2089    }
2090    if (element.hasAmount()) {
2091      composeMoney(t, "AccountBalanceComponent", "amount", element.getAmount(), -1);
2092    }
2093  }
2094
2095  protected void composeActivityDefinition(Complex parent, String parentType, String name, ActivityDefinition element, int index) {
2096    if (element == null) 
2097      return;
2098    Complex t;
2099    if (Utilities.noString(parentType))
2100      t = parent;
2101    else {
2102      t = parent.predicate("fhir:"+parentType+'.'+name);
2103    }
2104    composeMetadataResource(t, "ActivityDefinition", name, element, index);
2105    if (element.hasUrlElement()) {
2106      composeUri(t, "ActivityDefinition", "url", element.getUrlElement(), -1);
2107    }
2108    for (int i = 0; i < element.getIdentifier().size(); i++) {
2109      composeIdentifier(t, "ActivityDefinition", "identifier", element.getIdentifier().get(i), i);
2110    }
2111    if (element.hasVersionElement()) {
2112      composeString(t, "ActivityDefinition", "version", element.getVersionElement(), -1);
2113    }
2114    if (element.hasNameElement()) {
2115      composeString(t, "ActivityDefinition", "name", element.getNameElement(), -1);
2116    }
2117    if (element.hasTitleElement()) {
2118      composeString(t, "ActivityDefinition", "title", element.getTitleElement(), -1);
2119    }
2120    if (element.hasSubtitleElement()) {
2121      composeString(t, "ActivityDefinition", "subtitle", element.getSubtitleElement(), -1);
2122    }
2123    if (element.hasStatusElement()) {
2124      composeEnum(t, "ActivityDefinition", "status", element.getStatusElement(), -1);
2125    }
2126    if (element.hasExperimentalElement()) {
2127      composeBoolean(t, "ActivityDefinition", "experimental", element.getExperimentalElement(), -1);
2128    }
2129    if (element.hasSubject()) {
2130      composeType(t, "ActivityDefinition", "subject", element.getSubject(), -1);
2131    }
2132    if (element.hasDateElement()) {
2133      composeDateTime(t, "ActivityDefinition", "date", element.getDateElement(), -1);
2134    }
2135    if (element.hasPublisherElement()) {
2136      composeString(t, "ActivityDefinition", "publisher", element.getPublisherElement(), -1);
2137    }
2138    for (int i = 0; i < element.getContact().size(); i++) {
2139      composeContactDetail(t, "ActivityDefinition", "contact", element.getContact().get(i), i);
2140    }
2141    if (element.hasDescriptionElement()) {
2142      composeMarkdown(t, "ActivityDefinition", "description", element.getDescriptionElement(), -1);
2143    }
2144    for (int i = 0; i < element.getUseContext().size(); i++) {
2145      composeUsageContext(t, "ActivityDefinition", "useContext", element.getUseContext().get(i), i);
2146    }
2147    for (int i = 0; i < element.getJurisdiction().size(); i++) {
2148      composeCodeableConcept(t, "ActivityDefinition", "jurisdiction", element.getJurisdiction().get(i), i);
2149    }
2150    if (element.hasPurposeElement()) {
2151      composeMarkdown(t, "ActivityDefinition", "purpose", element.getPurposeElement(), -1);
2152    }
2153    if (element.hasUsageElement()) {
2154      composeString(t, "ActivityDefinition", "usage", element.getUsageElement(), -1);
2155    }
2156    if (element.hasCopyrightElement()) {
2157      composeMarkdown(t, "ActivityDefinition", "copyright", element.getCopyrightElement(), -1);
2158    }
2159    if (element.hasApprovalDateElement()) {
2160      composeDate(t, "ActivityDefinition", "approvalDate", element.getApprovalDateElement(), -1);
2161    }
2162    if (element.hasLastReviewDateElement()) {
2163      composeDate(t, "ActivityDefinition", "lastReviewDate", element.getLastReviewDateElement(), -1);
2164    }
2165    if (element.hasEffectivePeriod()) {
2166      composePeriod(t, "ActivityDefinition", "effectivePeriod", element.getEffectivePeriod(), -1);
2167    }
2168    for (int i = 0; i < element.getTopic().size(); i++) {
2169      composeCodeableConcept(t, "ActivityDefinition", "topic", element.getTopic().get(i), i);
2170    }
2171    for (int i = 0; i < element.getAuthor().size(); i++) {
2172      composeContactDetail(t, "ActivityDefinition", "author", element.getAuthor().get(i), i);
2173    }
2174    for (int i = 0; i < element.getEditor().size(); i++) {
2175      composeContactDetail(t, "ActivityDefinition", "editor", element.getEditor().get(i), i);
2176    }
2177    for (int i = 0; i < element.getReviewer().size(); i++) {
2178      composeContactDetail(t, "ActivityDefinition", "reviewer", element.getReviewer().get(i), i);
2179    }
2180    for (int i = 0; i < element.getEndorser().size(); i++) {
2181      composeContactDetail(t, "ActivityDefinition", "endorser", element.getEndorser().get(i), i);
2182    }
2183    for (int i = 0; i < element.getRelatedArtifact().size(); i++) {
2184      composeRelatedArtifact(t, "ActivityDefinition", "relatedArtifact", element.getRelatedArtifact().get(i), i);
2185    }
2186    for (int i = 0; i < element.getLibrary().size(); i++) {
2187      composeCanonical(t, "ActivityDefinition", "library", element.getLibrary().get(i), i);
2188    }
2189    if (element.hasKindElement()) {
2190      composeEnum(t, "ActivityDefinition", "kind", element.getKindElement(), -1);
2191    }
2192    if (element.hasProfileElement()) {
2193      composeCanonical(t, "ActivityDefinition", "profile", element.getProfileElement(), -1);
2194    }
2195    if (element.hasCode()) {
2196      composeCodeableConcept(t, "ActivityDefinition", "code", element.getCode(), -1);
2197    }
2198    if (element.hasIntentElement()) {
2199      composeEnum(t, "ActivityDefinition", "intent", element.getIntentElement(), -1);
2200    }
2201    if (element.hasPriorityElement()) {
2202      composeEnum(t, "ActivityDefinition", "priority", element.getPriorityElement(), -1);
2203    }
2204    if (element.hasDoNotPerformElement()) {
2205      composeBoolean(t, "ActivityDefinition", "doNotPerform", element.getDoNotPerformElement(), -1);
2206    }
2207    if (element.hasTiming()) {
2208      composeType(t, "ActivityDefinition", "timing", element.getTiming(), -1);
2209    }
2210    if (element.hasAsNeeded()) {
2211      composeType(t, "ActivityDefinition", "asNeeded", element.getAsNeeded(), -1);
2212    }
2213    if (element.hasLocation()) {
2214      composeCodeableReference(t, "ActivityDefinition", "location", element.getLocation(), -1);
2215    }
2216    for (int i = 0; i < element.getParticipant().size(); i++) {
2217      composeActivityDefinitionParticipantComponent(t, "ActivityDefinition", "participant", element.getParticipant().get(i), i);
2218    }
2219    if (element.hasProduct()) {
2220      composeType(t, "ActivityDefinition", "product", element.getProduct(), -1);
2221    }
2222    if (element.hasQuantity()) {
2223      composeQuantity(t, "ActivityDefinition", "quantity", element.getQuantity(), -1);
2224    }
2225    for (int i = 0; i < element.getDosage().size(); i++) {
2226      composeDosage(t, "ActivityDefinition", "dosage", element.getDosage().get(i), i);
2227    }
2228    for (int i = 0; i < element.getBodySite().size(); i++) {
2229      composeCodeableConcept(t, "ActivityDefinition", "bodySite", element.getBodySite().get(i), i);
2230    }
2231    for (int i = 0; i < element.getSpecimenRequirement().size(); i++) {
2232      composeCanonical(t, "ActivityDefinition", "specimenRequirement", element.getSpecimenRequirement().get(i), i);
2233    }
2234    for (int i = 0; i < element.getObservationRequirement().size(); i++) {
2235      composeCanonical(t, "ActivityDefinition", "observationRequirement", element.getObservationRequirement().get(i), i);
2236    }
2237    for (int i = 0; i < element.getObservationResultRequirement().size(); i++) {
2238      composeCanonical(t, "ActivityDefinition", "observationResultRequirement", element.getObservationResultRequirement().get(i), i);
2239    }
2240    if (element.hasTransformElement()) {
2241      composeCanonical(t, "ActivityDefinition", "transform", element.getTransformElement(), -1);
2242    }
2243    for (int i = 0; i < element.getDynamicValue().size(); i++) {
2244      composeActivityDefinitionDynamicValueComponent(t, "ActivityDefinition", "dynamicValue", element.getDynamicValue().get(i), i);
2245    }
2246  }
2247
2248  protected void composeActivityDefinitionParticipantComponent(Complex parent, String parentType, String name, ActivityDefinition.ActivityDefinitionParticipantComponent element, int index) {
2249    if (element == null) 
2250      return;
2251    Complex t;
2252    if (Utilities.noString(parentType))
2253      t = parent;
2254    else {
2255      t = parent.predicate("fhir:"+parentType+'.'+name);
2256    }
2257    composeBackboneElement(t, "participant", name, element, index);
2258    if (element.hasTypeElement()) {
2259      composeEnum(t, "ActivityDefinitionParticipantComponent", "type", element.getTypeElement(), -1);
2260    }
2261    if (element.hasTypeCanonicalElement()) {
2262      composeCanonical(t, "ActivityDefinitionParticipantComponent", "typeCanonical", element.getTypeCanonicalElement(), -1);
2263    }
2264    if (element.hasTypeReference()) {
2265      composeReference(t, "ActivityDefinitionParticipantComponent", "typeReference", element.getTypeReference(), -1);
2266    }
2267    if (element.hasRole()) {
2268      composeCodeableConcept(t, "ActivityDefinitionParticipantComponent", "role", element.getRole(), -1);
2269    }
2270    if (element.hasFunction()) {
2271      composeCodeableConcept(t, "ActivityDefinitionParticipantComponent", "function", element.getFunction(), -1);
2272    }
2273  }
2274
2275  protected void composeActivityDefinitionDynamicValueComponent(Complex parent, String parentType, String name, ActivityDefinition.ActivityDefinitionDynamicValueComponent element, int index) {
2276    if (element == null) 
2277      return;
2278    Complex t;
2279    if (Utilities.noString(parentType))
2280      t = parent;
2281    else {
2282      t = parent.predicate("fhir:"+parentType+'.'+name);
2283    }
2284    composeBackboneElement(t, "dynamicValue", name, element, index);
2285    if (element.hasPathElement()) {
2286      composeString(t, "ActivityDefinitionDynamicValueComponent", "path", element.getPathElement(), -1);
2287    }
2288    if (element.hasExpression()) {
2289      composeExpression(t, "ActivityDefinitionDynamicValueComponent", "expression", element.getExpression(), -1);
2290    }
2291  }
2292
2293  protected void composeActorDefinition(Complex parent, String parentType, String name, ActorDefinition element, int index) {
2294    if (element == null) 
2295      return;
2296    Complex t;
2297    if (Utilities.noString(parentType))
2298      t = parent;
2299    else {
2300      t = parent.predicate("fhir:"+parentType+'.'+name);
2301    }
2302    composeCanonicalResource(t, "ActorDefinition", name, element, index);
2303    if (element.hasUrlElement()) {
2304      composeUri(t, "ActorDefinition", "url", element.getUrlElement(), -1);
2305    }
2306    for (int i = 0; i < element.getIdentifier().size(); i++) {
2307      composeIdentifier(t, "ActorDefinition", "identifier", element.getIdentifier().get(i), i);
2308    }
2309    if (element.hasVersionElement()) {
2310      composeString(t, "ActorDefinition", "version", element.getVersionElement(), -1);
2311    }
2312    if (element.hasNameElement()) {
2313      composeString(t, "ActorDefinition", "name", element.getNameElement(), -1);
2314    }
2315    if (element.hasTitleElement()) {
2316      composeString(t, "ActorDefinition", "title", element.getTitleElement(), -1);
2317    }
2318    if (element.hasStatusElement()) {
2319      composeEnum(t, "ActorDefinition", "status", element.getStatusElement(), -1);
2320    }
2321    if (element.hasExperimentalElement()) {
2322      composeBoolean(t, "ActorDefinition", "experimental", element.getExperimentalElement(), -1);
2323    }
2324    if (element.hasDateElement()) {
2325      composeDateTime(t, "ActorDefinition", "date", element.getDateElement(), -1);
2326    }
2327    if (element.hasPublisherElement()) {
2328      composeString(t, "ActorDefinition", "publisher", element.getPublisherElement(), -1);
2329    }
2330    for (int i = 0; i < element.getContact().size(); i++) {
2331      composeContactDetail(t, "ActorDefinition", "contact", element.getContact().get(i), i);
2332    }
2333    if (element.hasDescriptionElement()) {
2334      composeMarkdown(t, "ActorDefinition", "description", element.getDescriptionElement(), -1);
2335    }
2336    for (int i = 0; i < element.getUseContext().size(); i++) {
2337      composeUsageContext(t, "ActorDefinition", "useContext", element.getUseContext().get(i), i);
2338    }
2339    for (int i = 0; i < element.getJurisdiction().size(); i++) {
2340      composeCodeableConcept(t, "ActorDefinition", "jurisdiction", element.getJurisdiction().get(i), i);
2341    }
2342    if (element.hasPurposeElement()) {
2343      composeMarkdown(t, "ActorDefinition", "purpose", element.getPurposeElement(), -1);
2344    }
2345    if (element.hasCopyrightElement()) {
2346      composeMarkdown(t, "ActorDefinition", "copyright", element.getCopyrightElement(), -1);
2347    }
2348    if (element.hasCopyrightLabelElement()) {
2349      composeString(t, "ActorDefinition", "copyrightLabel", element.getCopyrightLabelElement(), -1);
2350    }
2351    if (element.hasTypeElement()) {
2352      composeEnum(t, "ActorDefinition", "type", element.getTypeElement(), -1);
2353    }
2354    if (element.hasDocumentationElement()) {
2355      composeMarkdown(t, "ActorDefinition", "documentation", element.getDocumentationElement(), -1);
2356    }
2357    for (int i = 0; i < element.getReference().size(); i++) {
2358      composeUrl(t, "ActorDefinition", "reference", element.getReference().get(i), i);
2359    }
2360    if (element.hasCapabilitiesElement()) {
2361      composeCanonical(t, "ActorDefinition", "capabilities", element.getCapabilitiesElement(), -1);
2362    }
2363    for (int i = 0; i < element.getDerivedFrom().size(); i++) {
2364      composeCanonical(t, "ActorDefinition", "derivedFrom", element.getDerivedFrom().get(i), i);
2365    }
2366  }
2367
2368  protected void composeAdministrableProductDefinition(Complex parent, String parentType, String name, AdministrableProductDefinition element, int index) {
2369    if (element == null) 
2370      return;
2371    Complex t;
2372    if (Utilities.noString(parentType))
2373      t = parent;
2374    else {
2375      t = parent.predicate("fhir:"+parentType+'.'+name);
2376    }
2377    composeDomainResource(t, "AdministrableProductDefinition", name, element, index);
2378    for (int i = 0; i < element.getIdentifier().size(); i++) {
2379      composeIdentifier(t, "AdministrableProductDefinition", "identifier", element.getIdentifier().get(i), i);
2380    }
2381    if (element.hasStatusElement()) {
2382      composeEnum(t, "AdministrableProductDefinition", "status", element.getStatusElement(), -1);
2383    }
2384    for (int i = 0; i < element.getFormOf().size(); i++) {
2385      composeReference(t, "AdministrableProductDefinition", "formOf", element.getFormOf().get(i), i);
2386    }
2387    if (element.hasAdministrableDoseForm()) {
2388      composeCodeableConcept(t, "AdministrableProductDefinition", "administrableDoseForm", element.getAdministrableDoseForm(), -1);
2389    }
2390    if (element.hasUnitOfPresentation()) {
2391      composeCodeableConcept(t, "AdministrableProductDefinition", "unitOfPresentation", element.getUnitOfPresentation(), -1);
2392    }
2393    for (int i = 0; i < element.getProducedFrom().size(); i++) {
2394      composeReference(t, "AdministrableProductDefinition", "producedFrom", element.getProducedFrom().get(i), i);
2395    }
2396    for (int i = 0; i < element.getIngredient().size(); i++) {
2397      composeCodeableConcept(t, "AdministrableProductDefinition", "ingredient", element.getIngredient().get(i), i);
2398    }
2399    if (element.hasDevice()) {
2400      composeReference(t, "AdministrableProductDefinition", "device", element.getDevice(), -1);
2401    }
2402    for (int i = 0; i < element.getProperty().size(); i++) {
2403      composeAdministrableProductDefinitionPropertyComponent(t, "AdministrableProductDefinition", "property", element.getProperty().get(i), i);
2404    }
2405    for (int i = 0; i < element.getRouteOfAdministration().size(); i++) {
2406      composeAdministrableProductDefinitionRouteOfAdministrationComponent(t, "AdministrableProductDefinition", "routeOfAdministration", element.getRouteOfAdministration().get(i), i);
2407    }
2408  }
2409
2410  protected void composeAdministrableProductDefinitionPropertyComponent(Complex parent, String parentType, String name, AdministrableProductDefinition.AdministrableProductDefinitionPropertyComponent element, int index) {
2411    if (element == null) 
2412      return;
2413    Complex t;
2414    if (Utilities.noString(parentType))
2415      t = parent;
2416    else {
2417      t = parent.predicate("fhir:"+parentType+'.'+name);
2418    }
2419    composeBackboneElement(t, "property", name, element, index);
2420    if (element.hasType()) {
2421      composeCodeableConcept(t, "AdministrableProductDefinitionPropertyComponent", "type", element.getType(), -1);
2422    }
2423    if (element.hasValue()) {
2424      composeType(t, "AdministrableProductDefinitionPropertyComponent", "value", element.getValue(), -1);
2425    }
2426    if (element.hasStatus()) {
2427      composeCodeableConcept(t, "AdministrableProductDefinitionPropertyComponent", "status", element.getStatus(), -1);
2428    }
2429  }
2430
2431  protected void composeAdministrableProductDefinitionRouteOfAdministrationComponent(Complex parent, String parentType, String name, AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationComponent element, int index) {
2432    if (element == null) 
2433      return;
2434    Complex t;
2435    if (Utilities.noString(parentType))
2436      t = parent;
2437    else {
2438      t = parent.predicate("fhir:"+parentType+'.'+name);
2439    }
2440    composeBackboneElement(t, "routeOfAdministration", name, element, index);
2441    if (element.hasCode()) {
2442      composeCodeableConcept(t, "AdministrableProductDefinitionRouteOfAdministrationComponent", "code", element.getCode(), -1);
2443    }
2444    if (element.hasFirstDose()) {
2445      composeQuantity(t, "AdministrableProductDefinitionRouteOfAdministrationComponent", "firstDose", element.getFirstDose(), -1);
2446    }
2447    if (element.hasMaxSingleDose()) {
2448      composeQuantity(t, "AdministrableProductDefinitionRouteOfAdministrationComponent", "maxSingleDose", element.getMaxSingleDose(), -1);
2449    }
2450    if (element.hasMaxDosePerDay()) {
2451      composeQuantity(t, "AdministrableProductDefinitionRouteOfAdministrationComponent", "maxDosePerDay", element.getMaxDosePerDay(), -1);
2452    }
2453    if (element.hasMaxDosePerTreatmentPeriod()) {
2454      composeRatio(t, "AdministrableProductDefinitionRouteOfAdministrationComponent", "maxDosePerTreatmentPeriod", element.getMaxDosePerTreatmentPeriod(), -1);
2455    }
2456    if (element.hasMaxTreatmentPeriod()) {
2457      composeDuration(t, "AdministrableProductDefinitionRouteOfAdministrationComponent", "maxTreatmentPeriod", element.getMaxTreatmentPeriod(), -1);
2458    }
2459    for (int i = 0; i < element.getTargetSpecies().size(); i++) {
2460      composeAdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent(t, "AdministrableProductDefinitionRouteOfAdministrationComponent", "targetSpecies", element.getTargetSpecies().get(i), i);
2461    }
2462  }
2463
2464  protected void composeAdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent(Complex parent, String parentType, String name, AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent element, int index) {
2465    if (element == null) 
2466      return;
2467    Complex t;
2468    if (Utilities.noString(parentType))
2469      t = parent;
2470    else {
2471      t = parent.predicate("fhir:"+parentType+'.'+name);
2472    }
2473    composeBackboneElement(t, "targetSpecies", name, element, index);
2474    if (element.hasCode()) {
2475      composeCodeableConcept(t, "AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent", "code", element.getCode(), -1);
2476    }
2477    for (int i = 0; i < element.getWithdrawalPeriod().size(); i++) {
2478      composeAdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent(t, "AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent", "withdrawalPeriod", element.getWithdrawalPeriod().get(i), i);
2479    }
2480  }
2481
2482  protected void composeAdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent(Complex parent, String parentType, String name, AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent element, int index) {
2483    if (element == null) 
2484      return;
2485    Complex t;
2486    if (Utilities.noString(parentType))
2487      t = parent;
2488    else {
2489      t = parent.predicate("fhir:"+parentType+'.'+name);
2490    }
2491    composeBackboneElement(t, "withdrawalPeriod", name, element, index);
2492    if (element.hasTissue()) {
2493      composeCodeableConcept(t, "AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent", "tissue", element.getTissue(), -1);
2494    }
2495    if (element.hasValue()) {
2496      composeQuantity(t, "AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent", "value", element.getValue(), -1);
2497    }
2498    if (element.hasSupportingInformationElement()) {
2499      composeString(t, "AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent", "supportingInformation", element.getSupportingInformationElement(), -1);
2500    }
2501  }
2502
2503  protected void composeAdverseEvent(Complex parent, String parentType, String name, AdverseEvent element, int index) {
2504    if (element == null) 
2505      return;
2506    Complex t;
2507    if (Utilities.noString(parentType))
2508      t = parent;
2509    else {
2510      t = parent.predicate("fhir:"+parentType+'.'+name);
2511    }
2512    composeDomainResource(t, "AdverseEvent", name, element, index);
2513    for (int i = 0; i < element.getIdentifier().size(); i++) {
2514      composeIdentifier(t, "AdverseEvent", "identifier", element.getIdentifier().get(i), i);
2515    }
2516    if (element.hasStatusElement()) {
2517      composeEnum(t, "AdverseEvent", "status", element.getStatusElement(), -1);
2518    }
2519    if (element.hasActualityElement()) {
2520      composeEnum(t, "AdverseEvent", "actuality", element.getActualityElement(), -1);
2521    }
2522    for (int i = 0; i < element.getCategory().size(); i++) {
2523      composeCodeableConcept(t, "AdverseEvent", "category", element.getCategory().get(i), i);
2524    }
2525    if (element.hasCode()) {
2526      composeCodeableConcept(t, "AdverseEvent", "code", element.getCode(), -1);
2527    }
2528    if (element.hasSubject()) {
2529      composeReference(t, "AdverseEvent", "subject", element.getSubject(), -1);
2530    }
2531    if (element.hasEncounter()) {
2532      composeReference(t, "AdverseEvent", "encounter", element.getEncounter(), -1);
2533    }
2534    if (element.hasOccurrence()) {
2535      composeType(t, "AdverseEvent", "occurrence", element.getOccurrence(), -1);
2536    }
2537    if (element.hasDetectedElement()) {
2538      composeDateTime(t, "AdverseEvent", "detected", element.getDetectedElement(), -1);
2539    }
2540    if (element.hasRecordedDateElement()) {
2541      composeDateTime(t, "AdverseEvent", "recordedDate", element.getRecordedDateElement(), -1);
2542    }
2543    for (int i = 0; i < element.getResultingCondition().size(); i++) {
2544      composeReference(t, "AdverseEvent", "resultingCondition", element.getResultingCondition().get(i), i);
2545    }
2546    if (element.hasLocation()) {
2547      composeReference(t, "AdverseEvent", "location", element.getLocation(), -1);
2548    }
2549    if (element.hasSeriousness()) {
2550      composeCodeableConcept(t, "AdverseEvent", "seriousness", element.getSeriousness(), -1);
2551    }
2552    for (int i = 0; i < element.getOutcome().size(); i++) {
2553      composeCodeableConcept(t, "AdverseEvent", "outcome", element.getOutcome().get(i), i);
2554    }
2555    if (element.hasRecorder()) {
2556      composeReference(t, "AdverseEvent", "recorder", element.getRecorder(), -1);
2557    }
2558    for (int i = 0; i < element.getParticipant().size(); i++) {
2559      composeAdverseEventParticipantComponent(t, "AdverseEvent", "participant", element.getParticipant().get(i), i);
2560    }
2561    for (int i = 0; i < element.getStudy().size(); i++) {
2562      composeReference(t, "AdverseEvent", "study", element.getStudy().get(i), i);
2563    }
2564    if (element.hasExpectedInResearchStudyElement()) {
2565      composeBoolean(t, "AdverseEvent", "expectedInResearchStudy", element.getExpectedInResearchStudyElement(), -1);
2566    }
2567    for (int i = 0; i < element.getSuspectEntity().size(); i++) {
2568      composeAdverseEventSuspectEntityComponent(t, "AdverseEvent", "suspectEntity", element.getSuspectEntity().get(i), i);
2569    }
2570    for (int i = 0; i < element.getContributingFactor().size(); i++) {
2571      composeAdverseEventContributingFactorComponent(t, "AdverseEvent", "contributingFactor", element.getContributingFactor().get(i), i);
2572    }
2573    for (int i = 0; i < element.getPreventiveAction().size(); i++) {
2574      composeAdverseEventPreventiveActionComponent(t, "AdverseEvent", "preventiveAction", element.getPreventiveAction().get(i), i);
2575    }
2576    for (int i = 0; i < element.getMitigatingAction().size(); i++) {
2577      composeAdverseEventMitigatingActionComponent(t, "AdverseEvent", "mitigatingAction", element.getMitigatingAction().get(i), i);
2578    }
2579    for (int i = 0; i < element.getSupportingInfo().size(); i++) {
2580      composeAdverseEventSupportingInfoComponent(t, "AdverseEvent", "supportingInfo", element.getSupportingInfo().get(i), i);
2581    }
2582    for (int i = 0; i < element.getNote().size(); i++) {
2583      composeAnnotation(t, "AdverseEvent", "note", element.getNote().get(i), i);
2584    }
2585  }
2586
2587  protected void composeAdverseEventParticipantComponent(Complex parent, String parentType, String name, AdverseEvent.AdverseEventParticipantComponent element, int index) {
2588    if (element == null) 
2589      return;
2590    Complex t;
2591    if (Utilities.noString(parentType))
2592      t = parent;
2593    else {
2594      t = parent.predicate("fhir:"+parentType+'.'+name);
2595    }
2596    composeBackboneElement(t, "participant", name, element, index);
2597    if (element.hasFunction()) {
2598      composeCodeableConcept(t, "AdverseEventParticipantComponent", "function", element.getFunction(), -1);
2599    }
2600    if (element.hasActor()) {
2601      composeReference(t, "AdverseEventParticipantComponent", "actor", element.getActor(), -1);
2602    }
2603  }
2604
2605  protected void composeAdverseEventSuspectEntityComponent(Complex parent, String parentType, String name, AdverseEvent.AdverseEventSuspectEntityComponent element, int index) {
2606    if (element == null) 
2607      return;
2608    Complex t;
2609    if (Utilities.noString(parentType))
2610      t = parent;
2611    else {
2612      t = parent.predicate("fhir:"+parentType+'.'+name);
2613    }
2614    composeBackboneElement(t, "suspectEntity", name, element, index);
2615    if (element.hasInstance()) {
2616      composeType(t, "AdverseEventSuspectEntityComponent", "instance", element.getInstance(), -1);
2617    }
2618    if (element.hasCausality()) {
2619      composeAdverseEventSuspectEntityCausalityComponent(t, "AdverseEventSuspectEntityComponent", "causality", element.getCausality(), -1);
2620    }
2621  }
2622
2623  protected void composeAdverseEventSuspectEntityCausalityComponent(Complex parent, String parentType, String name, AdverseEvent.AdverseEventSuspectEntityCausalityComponent element, int index) {
2624    if (element == null) 
2625      return;
2626    Complex t;
2627    if (Utilities.noString(parentType))
2628      t = parent;
2629    else {
2630      t = parent.predicate("fhir:"+parentType+'.'+name);
2631    }
2632    composeBackboneElement(t, "causality", name, element, index);
2633    if (element.hasAssessmentMethod()) {
2634      composeCodeableConcept(t, "AdverseEventSuspectEntityCausalityComponent", "assessmentMethod", element.getAssessmentMethod(), -1);
2635    }
2636    if (element.hasEntityRelatedness()) {
2637      composeCodeableConcept(t, "AdverseEventSuspectEntityCausalityComponent", "entityRelatedness", element.getEntityRelatedness(), -1);
2638    }
2639    if (element.hasAuthor()) {
2640      composeReference(t, "AdverseEventSuspectEntityCausalityComponent", "author", element.getAuthor(), -1);
2641    }
2642  }
2643
2644  protected void composeAdverseEventContributingFactorComponent(Complex parent, String parentType, String name, AdverseEvent.AdverseEventContributingFactorComponent element, int index) {
2645    if (element == null) 
2646      return;
2647    Complex t;
2648    if (Utilities.noString(parentType))
2649      t = parent;
2650    else {
2651      t = parent.predicate("fhir:"+parentType+'.'+name);
2652    }
2653    composeBackboneElement(t, "contributingFactor", name, element, index);
2654    if (element.hasItem()) {
2655      composeType(t, "AdverseEventContributingFactorComponent", "item", element.getItem(), -1);
2656    }
2657  }
2658
2659  protected void composeAdverseEventPreventiveActionComponent(Complex parent, String parentType, String name, AdverseEvent.AdverseEventPreventiveActionComponent element, int index) {
2660    if (element == null) 
2661      return;
2662    Complex t;
2663    if (Utilities.noString(parentType))
2664      t = parent;
2665    else {
2666      t = parent.predicate("fhir:"+parentType+'.'+name);
2667    }
2668    composeBackboneElement(t, "preventiveAction", name, element, index);
2669    if (element.hasItem()) {
2670      composeType(t, "AdverseEventPreventiveActionComponent", "item", element.getItem(), -1);
2671    }
2672  }
2673
2674  protected void composeAdverseEventMitigatingActionComponent(Complex parent, String parentType, String name, AdverseEvent.AdverseEventMitigatingActionComponent element, int index) {
2675    if (element == null) 
2676      return;
2677    Complex t;
2678    if (Utilities.noString(parentType))
2679      t = parent;
2680    else {
2681      t = parent.predicate("fhir:"+parentType+'.'+name);
2682    }
2683    composeBackboneElement(t, "mitigatingAction", name, element, index);
2684    if (element.hasItem()) {
2685      composeType(t, "AdverseEventMitigatingActionComponent", "item", element.getItem(), -1);
2686    }
2687  }
2688
2689  protected void composeAdverseEventSupportingInfoComponent(Complex parent, String parentType, String name, AdverseEvent.AdverseEventSupportingInfoComponent element, int index) {
2690    if (element == null) 
2691      return;
2692    Complex t;
2693    if (Utilities.noString(parentType))
2694      t = parent;
2695    else {
2696      t = parent.predicate("fhir:"+parentType+'.'+name);
2697    }
2698    composeBackboneElement(t, "supportingInfo", name, element, index);
2699    if (element.hasItem()) {
2700      composeType(t, "AdverseEventSupportingInfoComponent", "item", element.getItem(), -1);
2701    }
2702  }
2703
2704  protected void composeAllergyIntolerance(Complex parent, String parentType, String name, AllergyIntolerance element, int index) {
2705    if (element == null) 
2706      return;
2707    Complex t;
2708    if (Utilities.noString(parentType))
2709      t = parent;
2710    else {
2711      t = parent.predicate("fhir:"+parentType+'.'+name);
2712    }
2713    composeDomainResource(t, "AllergyIntolerance", name, element, index);
2714    for (int i = 0; i < element.getIdentifier().size(); i++) {
2715      composeIdentifier(t, "AllergyIntolerance", "identifier", element.getIdentifier().get(i), i);
2716    }
2717    if (element.hasClinicalStatus()) {
2718      composeCodeableConcept(t, "AllergyIntolerance", "clinicalStatus", element.getClinicalStatus(), -1);
2719    }
2720    if (element.hasVerificationStatus()) {
2721      composeCodeableConcept(t, "AllergyIntolerance", "verificationStatus", element.getVerificationStatus(), -1);
2722    }
2723    if (element.hasTypeElement()) {
2724      composeEnum(t, "AllergyIntolerance", "type", element.getTypeElement(), -1);
2725    }
2726    for (int i = 0; i < element.getCategory().size(); i++) {
2727      composeEnum(t, "AllergyIntolerance", "category", element.getCategory().get(i), i);
2728    }
2729    if (element.hasCriticalityElement()) {
2730      composeEnum(t, "AllergyIntolerance", "criticality", element.getCriticalityElement(), -1);
2731    }
2732    if (element.hasCode()) {
2733      composeCodeableConcept(t, "AllergyIntolerance", "code", element.getCode(), -1);
2734    }
2735    if (element.hasPatient()) {
2736      composeReference(t, "AllergyIntolerance", "patient", element.getPatient(), -1);
2737    }
2738    if (element.hasEncounter()) {
2739      composeReference(t, "AllergyIntolerance", "encounter", element.getEncounter(), -1);
2740    }
2741    if (element.hasOnset()) {
2742      composeType(t, "AllergyIntolerance", "onset", element.getOnset(), -1);
2743    }
2744    if (element.hasRecordedDateElement()) {
2745      composeDateTime(t, "AllergyIntolerance", "recordedDate", element.getRecordedDateElement(), -1);
2746    }
2747    for (int i = 0; i < element.getParticipant().size(); i++) {
2748      composeAllergyIntoleranceParticipantComponent(t, "AllergyIntolerance", "participant", element.getParticipant().get(i), i);
2749    }
2750    if (element.hasLastOccurrenceElement()) {
2751      composeDateTime(t, "AllergyIntolerance", "lastOccurrence", element.getLastOccurrenceElement(), -1);
2752    }
2753    for (int i = 0; i < element.getNote().size(); i++) {
2754      composeAnnotation(t, "AllergyIntolerance", "note", element.getNote().get(i), i);
2755    }
2756    for (int i = 0; i < element.getReaction().size(); i++) {
2757      composeAllergyIntoleranceReactionComponent(t, "AllergyIntolerance", "reaction", element.getReaction().get(i), i);
2758    }
2759  }
2760
2761  protected void composeAllergyIntoleranceParticipantComponent(Complex parent, String parentType, String name, AllergyIntolerance.AllergyIntoleranceParticipantComponent element, int index) {
2762    if (element == null) 
2763      return;
2764    Complex t;
2765    if (Utilities.noString(parentType))
2766      t = parent;
2767    else {
2768      t = parent.predicate("fhir:"+parentType+'.'+name);
2769    }
2770    composeBackboneElement(t, "participant", name, element, index);
2771    if (element.hasFunction()) {
2772      composeCodeableConcept(t, "AllergyIntoleranceParticipantComponent", "function", element.getFunction(), -1);
2773    }
2774    if (element.hasActor()) {
2775      composeReference(t, "AllergyIntoleranceParticipantComponent", "actor", element.getActor(), -1);
2776    }
2777  }
2778
2779  protected void composeAllergyIntoleranceReactionComponent(Complex parent, String parentType, String name, AllergyIntolerance.AllergyIntoleranceReactionComponent element, int index) {
2780    if (element == null) 
2781      return;
2782    Complex t;
2783    if (Utilities.noString(parentType))
2784      t = parent;
2785    else {
2786      t = parent.predicate("fhir:"+parentType+'.'+name);
2787    }
2788    composeBackboneElement(t, "reaction", name, element, index);
2789    if (element.hasSubstance()) {
2790      composeCodeableConcept(t, "AllergyIntoleranceReactionComponent", "substance", element.getSubstance(), -1);
2791    }
2792    for (int i = 0; i < element.getManifestation().size(); i++) {
2793      composeCodeableReference(t, "AllergyIntoleranceReactionComponent", "manifestation", element.getManifestation().get(i), i);
2794    }
2795    if (element.hasDescriptionElement()) {
2796      composeString(t, "AllergyIntoleranceReactionComponent", "description", element.getDescriptionElement(), -1);
2797    }
2798    if (element.hasOnsetElement()) {
2799      composeDateTime(t, "AllergyIntoleranceReactionComponent", "onset", element.getOnsetElement(), -1);
2800    }
2801    if (element.hasSeverityElement()) {
2802      composeEnum(t, "AllergyIntoleranceReactionComponent", "severity", element.getSeverityElement(), -1);
2803    }
2804    if (element.hasExposureRoute()) {
2805      composeCodeableConcept(t, "AllergyIntoleranceReactionComponent", "exposureRoute", element.getExposureRoute(), -1);
2806    }
2807    for (int i = 0; i < element.getNote().size(); i++) {
2808      composeAnnotation(t, "AllergyIntoleranceReactionComponent", "note", element.getNote().get(i), i);
2809    }
2810  }
2811
2812  protected void composeAppointment(Complex parent, String parentType, String name, Appointment element, int index) {
2813    if (element == null) 
2814      return;
2815    Complex t;
2816    if (Utilities.noString(parentType))
2817      t = parent;
2818    else {
2819      t = parent.predicate("fhir:"+parentType+'.'+name);
2820    }
2821    composeDomainResource(t, "Appointment", name, element, index);
2822    for (int i = 0; i < element.getIdentifier().size(); i++) {
2823      composeIdentifier(t, "Appointment", "identifier", element.getIdentifier().get(i), i);
2824    }
2825    if (element.hasStatusElement()) {
2826      composeEnum(t, "Appointment", "status", element.getStatusElement(), -1);
2827    }
2828    if (element.hasCancellationReason()) {
2829      composeCodeableConcept(t, "Appointment", "cancellationReason", element.getCancellationReason(), -1);
2830    }
2831    for (int i = 0; i < element.getClass_().size(); i++) {
2832      composeCodeableConcept(t, "Appointment", "class", element.getClass_().get(i), i);
2833    }
2834    for (int i = 0; i < element.getServiceCategory().size(); i++) {
2835      composeCodeableConcept(t, "Appointment", "serviceCategory", element.getServiceCategory().get(i), i);
2836    }
2837    for (int i = 0; i < element.getServiceType().size(); i++) {
2838      composeCodeableReference(t, "Appointment", "serviceType", element.getServiceType().get(i), i);
2839    }
2840    for (int i = 0; i < element.getSpecialty().size(); i++) {
2841      composeCodeableConcept(t, "Appointment", "specialty", element.getSpecialty().get(i), i);
2842    }
2843    if (element.hasAppointmentType()) {
2844      composeCodeableConcept(t, "Appointment", "appointmentType", element.getAppointmentType(), -1);
2845    }
2846    for (int i = 0; i < element.getReason().size(); i++) {
2847      composeCodeableReference(t, "Appointment", "reason", element.getReason().get(i), i);
2848    }
2849    if (element.hasPriority()) {
2850      composeCodeableConcept(t, "Appointment", "priority", element.getPriority(), -1);
2851    }
2852    if (element.hasDescriptionElement()) {
2853      composeString(t, "Appointment", "description", element.getDescriptionElement(), -1);
2854    }
2855    for (int i = 0; i < element.getReplaces().size(); i++) {
2856      composeReference(t, "Appointment", "replaces", element.getReplaces().get(i), i);
2857    }
2858    for (int i = 0; i < element.getVirtualService().size(); i++) {
2859      composeVirtualServiceDetail(t, "Appointment", "virtualService", element.getVirtualService().get(i), i);
2860    }
2861    for (int i = 0; i < element.getSupportingInformation().size(); i++) {
2862      composeReference(t, "Appointment", "supportingInformation", element.getSupportingInformation().get(i), i);
2863    }
2864    if (element.hasPreviousAppointment()) {
2865      composeReference(t, "Appointment", "previousAppointment", element.getPreviousAppointment(), -1);
2866    }
2867    if (element.hasOriginatingAppointment()) {
2868      composeReference(t, "Appointment", "originatingAppointment", element.getOriginatingAppointment(), -1);
2869    }
2870    if (element.hasStartElement()) {
2871      composeInstant(t, "Appointment", "start", element.getStartElement(), -1);
2872    }
2873    if (element.hasEndElement()) {
2874      composeInstant(t, "Appointment", "end", element.getEndElement(), -1);
2875    }
2876    if (element.hasMinutesDurationElement()) {
2877      composePositiveInt(t, "Appointment", "minutesDuration", element.getMinutesDurationElement(), -1);
2878    }
2879    for (int i = 0; i < element.getSlot().size(); i++) {
2880      composeReference(t, "Appointment", "slot", element.getSlot().get(i), i);
2881    }
2882    for (int i = 0; i < element.getAccount().size(); i++) {
2883      composeReference(t, "Appointment", "account", element.getAccount().get(i), i);
2884    }
2885    if (element.hasCreatedElement()) {
2886      composeDateTime(t, "Appointment", "created", element.getCreatedElement(), -1);
2887    }
2888    for (int i = 0; i < element.getNote().size(); i++) {
2889      composeAnnotation(t, "Appointment", "note", element.getNote().get(i), i);
2890    }
2891    for (int i = 0; i < element.getPatientInstruction().size(); i++) {
2892      composeCodeableReference(t, "Appointment", "patientInstruction", element.getPatientInstruction().get(i), i);
2893    }
2894    for (int i = 0; i < element.getBasedOn().size(); i++) {
2895      composeReference(t, "Appointment", "basedOn", element.getBasedOn().get(i), i);
2896    }
2897    if (element.hasSubject()) {
2898      composeReference(t, "Appointment", "subject", element.getSubject(), -1);
2899    }
2900    for (int i = 0; i < element.getParticipant().size(); i++) {
2901      composeAppointmentParticipantComponent(t, "Appointment", "participant", element.getParticipant().get(i), i);
2902    }
2903    for (int i = 0; i < element.getRequestedPeriod().size(); i++) {
2904      composePeriod(t, "Appointment", "requestedPeriod", element.getRequestedPeriod().get(i), i);
2905    }
2906    if (element.hasRecurrenceIdElement()) {
2907      composePositiveInt(t, "Appointment", "recurrenceId", element.getRecurrenceIdElement(), -1);
2908    }
2909    if (element.hasOccurrenceChangedElement()) {
2910      composeBoolean(t, "Appointment", "occurrenceChanged", element.getOccurrenceChangedElement(), -1);
2911    }
2912    for (int i = 0; i < element.getRecurrenceTemplate().size(); i++) {
2913      composeAppointmentRecurrenceTemplateComponent(t, "Appointment", "recurrenceTemplate", element.getRecurrenceTemplate().get(i), i);
2914    }
2915  }
2916
2917  protected void composeAppointmentParticipantComponent(Complex parent, String parentType, String name, Appointment.AppointmentParticipantComponent element, int index) {
2918    if (element == null) 
2919      return;
2920    Complex t;
2921    if (Utilities.noString(parentType))
2922      t = parent;
2923    else {
2924      t = parent.predicate("fhir:"+parentType+'.'+name);
2925    }
2926    composeBackboneElement(t, "participant", name, element, index);
2927    for (int i = 0; i < element.getType().size(); i++) {
2928      composeCodeableConcept(t, "AppointmentParticipantComponent", "type", element.getType().get(i), i);
2929    }
2930    if (element.hasPeriod()) {
2931      composePeriod(t, "AppointmentParticipantComponent", "period", element.getPeriod(), -1);
2932    }
2933    if (element.hasActor()) {
2934      composeReference(t, "AppointmentParticipantComponent", "actor", element.getActor(), -1);
2935    }
2936    if (element.hasRequiredElement()) {
2937      composeBoolean(t, "AppointmentParticipantComponent", "required", element.getRequiredElement(), -1);
2938    }
2939    if (element.hasStatusElement()) {
2940      composeEnum(t, "AppointmentParticipantComponent", "status", element.getStatusElement(), -1);
2941    }
2942  }
2943
2944  protected void composeAppointmentRecurrenceTemplateComponent(Complex parent, String parentType, String name, Appointment.AppointmentRecurrenceTemplateComponent element, int index) {
2945    if (element == null) 
2946      return;
2947    Complex t;
2948    if (Utilities.noString(parentType))
2949      t = parent;
2950    else {
2951      t = parent.predicate("fhir:"+parentType+'.'+name);
2952    }
2953    composeBackboneElement(t, "recurrenceTemplate", name, element, index);
2954    if (element.hasTimezone()) {
2955      composeCodeableConcept(t, "AppointmentRecurrenceTemplateComponent", "timezone", element.getTimezone(), -1);
2956    }
2957    if (element.hasRecurrenceType()) {
2958      composeCodeableConcept(t, "AppointmentRecurrenceTemplateComponent", "recurrenceType", element.getRecurrenceType(), -1);
2959    }
2960    if (element.hasLastOccurrenceDateElement()) {
2961      composeDate(t, "AppointmentRecurrenceTemplateComponent", "lastOccurrenceDate", element.getLastOccurrenceDateElement(), -1);
2962    }
2963    if (element.hasOccurrenceCountElement()) {
2964      composePositiveInt(t, "AppointmentRecurrenceTemplateComponent", "occurrenceCount", element.getOccurrenceCountElement(), -1);
2965    }
2966    for (int i = 0; i < element.getOccurrenceDate().size(); i++) {
2967      composeDate(t, "AppointmentRecurrenceTemplateComponent", "occurrenceDate", element.getOccurrenceDate().get(i), i);
2968    }
2969    if (element.hasWeeklyTemplate()) {
2970      composeAppointmentRecurrenceTemplateWeeklyTemplateComponent(t, "AppointmentRecurrenceTemplateComponent", "weeklyTemplate", element.getWeeklyTemplate(), -1);
2971    }
2972    if (element.hasMonthlyTemplate()) {
2973      composeAppointmentRecurrenceTemplateMonthlyTemplateComponent(t, "AppointmentRecurrenceTemplateComponent", "monthlyTemplate", element.getMonthlyTemplate(), -1);
2974    }
2975    if (element.hasYearlyTemplate()) {
2976      composeAppointmentRecurrenceTemplateYearlyTemplateComponent(t, "AppointmentRecurrenceTemplateComponent", "yearlyTemplate", element.getYearlyTemplate(), -1);
2977    }
2978    for (int i = 0; i < element.getExcludingDate().size(); i++) {
2979      composeDate(t, "AppointmentRecurrenceTemplateComponent", "excludingDate", element.getExcludingDate().get(i), i);
2980    }
2981    for (int i = 0; i < element.getExcludingRecurrenceId().size(); i++) {
2982      composePositiveInt(t, "AppointmentRecurrenceTemplateComponent", "excludingRecurrenceId", element.getExcludingRecurrenceId().get(i), i);
2983    }
2984  }
2985
2986  protected void composeAppointmentRecurrenceTemplateWeeklyTemplateComponent(Complex parent, String parentType, String name, Appointment.AppointmentRecurrenceTemplateWeeklyTemplateComponent element, int index) {
2987    if (element == null) 
2988      return;
2989    Complex t;
2990    if (Utilities.noString(parentType))
2991      t = parent;
2992    else {
2993      t = parent.predicate("fhir:"+parentType+'.'+name);
2994    }
2995    composeBackboneElement(t, "weeklyTemplate", name, element, index);
2996    if (element.hasMondayElement()) {
2997      composeBoolean(t, "AppointmentRecurrenceTemplateWeeklyTemplateComponent", "monday", element.getMondayElement(), -1);
2998    }
2999    if (element.hasTuesdayElement()) {
3000      composeBoolean(t, "AppointmentRecurrenceTemplateWeeklyTemplateComponent", "tuesday", element.getTuesdayElement(), -1);
3001    }
3002    if (element.hasWednesdayElement()) {
3003      composeBoolean(t, "AppointmentRecurrenceTemplateWeeklyTemplateComponent", "wednesday", element.getWednesdayElement(), -1);
3004    }
3005    if (element.hasThursdayElement()) {
3006      composeBoolean(t, "AppointmentRecurrenceTemplateWeeklyTemplateComponent", "thursday", element.getThursdayElement(), -1);
3007    }
3008    if (element.hasFridayElement()) {
3009      composeBoolean(t, "AppointmentRecurrenceTemplateWeeklyTemplateComponent", "friday", element.getFridayElement(), -1);
3010    }
3011    if (element.hasSaturdayElement()) {
3012      composeBoolean(t, "AppointmentRecurrenceTemplateWeeklyTemplateComponent", "saturday", element.getSaturdayElement(), -1);
3013    }
3014    if (element.hasSundayElement()) {
3015      composeBoolean(t, "AppointmentRecurrenceTemplateWeeklyTemplateComponent", "sunday", element.getSundayElement(), -1);
3016    }
3017    if (element.hasWeekIntervalElement()) {
3018      composePositiveInt(t, "AppointmentRecurrenceTemplateWeeklyTemplateComponent", "weekInterval", element.getWeekIntervalElement(), -1);
3019    }
3020  }
3021
3022  protected void composeAppointmentRecurrenceTemplateMonthlyTemplateComponent(Complex parent, String parentType, String name, Appointment.AppointmentRecurrenceTemplateMonthlyTemplateComponent element, int index) {
3023    if (element == null) 
3024      return;
3025    Complex t;
3026    if (Utilities.noString(parentType))
3027      t = parent;
3028    else {
3029      t = parent.predicate("fhir:"+parentType+'.'+name);
3030    }
3031    composeBackboneElement(t, "monthlyTemplate", name, element, index);
3032    if (element.hasDayOfMonthElement()) {
3033      composePositiveInt(t, "AppointmentRecurrenceTemplateMonthlyTemplateComponent", "dayOfMonth", element.getDayOfMonthElement(), -1);
3034    }
3035    if (element.hasNthWeekOfMonth()) {
3036      composeCoding(t, "AppointmentRecurrenceTemplateMonthlyTemplateComponent", "nthWeekOfMonth", element.getNthWeekOfMonth(), -1);
3037    }
3038    if (element.hasDayOfWeek()) {
3039      composeCoding(t, "AppointmentRecurrenceTemplateMonthlyTemplateComponent", "dayOfWeek", element.getDayOfWeek(), -1);
3040    }
3041    if (element.hasMonthIntervalElement()) {
3042      composePositiveInt(t, "AppointmentRecurrenceTemplateMonthlyTemplateComponent", "monthInterval", element.getMonthIntervalElement(), -1);
3043    }
3044  }
3045
3046  protected void composeAppointmentRecurrenceTemplateYearlyTemplateComponent(Complex parent, String parentType, String name, Appointment.AppointmentRecurrenceTemplateYearlyTemplateComponent element, int index) {
3047    if (element == null) 
3048      return;
3049    Complex t;
3050    if (Utilities.noString(parentType))
3051      t = parent;
3052    else {
3053      t = parent.predicate("fhir:"+parentType+'.'+name);
3054    }
3055    composeBackboneElement(t, "yearlyTemplate", name, element, index);
3056    if (element.hasYearIntervalElement()) {
3057      composePositiveInt(t, "AppointmentRecurrenceTemplateYearlyTemplateComponent", "yearInterval", element.getYearIntervalElement(), -1);
3058    }
3059  }
3060
3061  protected void composeAppointmentResponse(Complex parent, String parentType, String name, AppointmentResponse element, int index) {
3062    if (element == null) 
3063      return;
3064    Complex t;
3065    if (Utilities.noString(parentType))
3066      t = parent;
3067    else {
3068      t = parent.predicate("fhir:"+parentType+'.'+name);
3069    }
3070    composeDomainResource(t, "AppointmentResponse", name, element, index);
3071    for (int i = 0; i < element.getIdentifier().size(); i++) {
3072      composeIdentifier(t, "AppointmentResponse", "identifier", element.getIdentifier().get(i), i);
3073    }
3074    if (element.hasAppointment()) {
3075      composeReference(t, "AppointmentResponse", "appointment", element.getAppointment(), -1);
3076    }
3077    if (element.hasProposedNewTimeElement()) {
3078      composeBoolean(t, "AppointmentResponse", "proposedNewTime", element.getProposedNewTimeElement(), -1);
3079    }
3080    if (element.hasStartElement()) {
3081      composeInstant(t, "AppointmentResponse", "start", element.getStartElement(), -1);
3082    }
3083    if (element.hasEndElement()) {
3084      composeInstant(t, "AppointmentResponse", "end", element.getEndElement(), -1);
3085    }
3086    for (int i = 0; i < element.getParticipantType().size(); i++) {
3087      composeCodeableConcept(t, "AppointmentResponse", "participantType", element.getParticipantType().get(i), i);
3088    }
3089    if (element.hasActor()) {
3090      composeReference(t, "AppointmentResponse", "actor", element.getActor(), -1);
3091    }
3092    if (element.hasParticipantStatusElement()) {
3093      composeEnum(t, "AppointmentResponse", "participantStatus", element.getParticipantStatusElement(), -1);
3094    }
3095    if (element.hasCommentElement()) {
3096      composeString(t, "AppointmentResponse", "comment", element.getCommentElement(), -1);
3097    }
3098    if (element.hasRecurringElement()) {
3099      composeBoolean(t, "AppointmentResponse", "recurring", element.getRecurringElement(), -1);
3100    }
3101    if (element.hasOccurrenceDateElement()) {
3102      composeDate(t, "AppointmentResponse", "occurrenceDate", element.getOccurrenceDateElement(), -1);
3103    }
3104    if (element.hasRecurrenceIdElement()) {
3105      composePositiveInt(t, "AppointmentResponse", "recurrenceId", element.getRecurrenceIdElement(), -1);
3106    }
3107  }
3108
3109  protected void composeArtifactAssessment(Complex parent, String parentType, String name, ArtifactAssessment element, int index) {
3110    if (element == null) 
3111      return;
3112    Complex t;
3113    if (Utilities.noString(parentType))
3114      t = parent;
3115    else {
3116      t = parent.predicate("fhir:"+parentType+'.'+name);
3117    }
3118    composeDomainResource(t, "ArtifactAssessment", name, element, index);
3119    for (int i = 0; i < element.getIdentifier().size(); i++) {
3120      composeIdentifier(t, "ArtifactAssessment", "identifier", element.getIdentifier().get(i), i);
3121    }
3122    if (element.hasCiteAs()) {
3123      composeType(t, "ArtifactAssessment", "citeAs", element.getCiteAs(), -1);
3124    }
3125    if (element.hasDateElement()) {
3126      composeDateTime(t, "ArtifactAssessment", "date", element.getDateElement(), -1);
3127    }
3128    if (element.hasCopyrightElement()) {
3129      composeMarkdown(t, "ArtifactAssessment", "copyright", element.getCopyrightElement(), -1);
3130    }
3131    if (element.hasApprovalDateElement()) {
3132      composeDate(t, "ArtifactAssessment", "approvalDate", element.getApprovalDateElement(), -1);
3133    }
3134    if (element.hasLastReviewDateElement()) {
3135      composeDate(t, "ArtifactAssessment", "lastReviewDate", element.getLastReviewDateElement(), -1);
3136    }
3137    if (element.hasArtifact()) {
3138      composeType(t, "ArtifactAssessment", "artifact", element.getArtifact(), -1);
3139    }
3140    for (int i = 0; i < element.getContent().size(); i++) {
3141      composeArtifactAssessmentContentComponent(t, "ArtifactAssessment", "content", element.getContent().get(i), i);
3142    }
3143    if (element.hasWorkflowStatusElement()) {
3144      composeEnum(t, "ArtifactAssessment", "workflowStatus", element.getWorkflowStatusElement(), -1);
3145    }
3146    if (element.hasDispositionElement()) {
3147      composeEnum(t, "ArtifactAssessment", "disposition", element.getDispositionElement(), -1);
3148    }
3149  }
3150
3151  protected void composeArtifactAssessmentContentComponent(Complex parent, String parentType, String name, ArtifactAssessment.ArtifactAssessmentContentComponent element, int index) {
3152    if (element == null) 
3153      return;
3154    Complex t;
3155    if (Utilities.noString(parentType))
3156      t = parent;
3157    else {
3158      t = parent.predicate("fhir:"+parentType+'.'+name);
3159    }
3160    composeBackboneElement(t, "content", name, element, index);
3161    if (element.hasInformationTypeElement()) {
3162      composeEnum(t, "ArtifactAssessmentContentComponent", "informationType", element.getInformationTypeElement(), -1);
3163    }
3164    if (element.hasSummaryElement()) {
3165      composeMarkdown(t, "ArtifactAssessmentContentComponent", "summary", element.getSummaryElement(), -1);
3166    }
3167    if (element.hasType()) {
3168      composeCodeableConcept(t, "ArtifactAssessmentContentComponent", "type", element.getType(), -1);
3169    }
3170    for (int i = 0; i < element.getClassifier().size(); i++) {
3171      composeCodeableConcept(t, "ArtifactAssessmentContentComponent", "classifier", element.getClassifier().get(i), i);
3172    }
3173    if (element.hasAuthor()) {
3174      composeReference(t, "ArtifactAssessmentContentComponent", "author", element.getAuthor(), -1);
3175    }
3176    for (int i = 0; i < element.getPath().size(); i++) {
3177      composeUri(t, "ArtifactAssessmentContentComponent", "path", element.getPath().get(i), i);
3178    }
3179    for (int i = 0; i < element.getRelatedArtifact().size(); i++) {
3180      composeRelatedArtifact(t, "ArtifactAssessmentContentComponent", "relatedArtifact", element.getRelatedArtifact().get(i), i);
3181    }
3182    if (element.hasFreeToShareElement()) {
3183      composeBoolean(t, "ArtifactAssessmentContentComponent", "freeToShare", element.getFreeToShareElement(), -1);
3184    }
3185    for (int i = 0; i < element.getComponent().size(); i++) {
3186      composeArtifactAssessmentContentComponent(t, "ArtifactAssessmentContentComponent", "component", element.getComponent().get(i), i);
3187    }
3188  }
3189
3190  protected void composeAuditEvent(Complex parent, String parentType, String name, AuditEvent element, int index) {
3191    if (element == null) 
3192      return;
3193    Complex t;
3194    if (Utilities.noString(parentType))
3195      t = parent;
3196    else {
3197      t = parent.predicate("fhir:"+parentType+'.'+name);
3198    }
3199    composeDomainResource(t, "AuditEvent", name, element, index);
3200    for (int i = 0; i < element.getCategory().size(); i++) {
3201      composeCodeableConcept(t, "AuditEvent", "category", element.getCategory().get(i), i);
3202    }
3203    if (element.hasCode()) {
3204      composeCodeableConcept(t, "AuditEvent", "code", element.getCode(), -1);
3205    }
3206    if (element.hasActionElement()) {
3207      composeEnum(t, "AuditEvent", "action", element.getActionElement(), -1);
3208    }
3209    if (element.hasSeverityElement()) {
3210      composeEnum(t, "AuditEvent", "severity", element.getSeverityElement(), -1);
3211    }
3212    if (element.hasOccurred()) {
3213      composeType(t, "AuditEvent", "occurred", element.getOccurred(), -1);
3214    }
3215    if (element.hasRecordedElement()) {
3216      composeInstant(t, "AuditEvent", "recorded", element.getRecordedElement(), -1);
3217    }
3218    if (element.hasOutcome()) {
3219      composeAuditEventOutcomeComponent(t, "AuditEvent", "outcome", element.getOutcome(), -1);
3220    }
3221    for (int i = 0; i < element.getAuthorization().size(); i++) {
3222      composeCodeableConcept(t, "AuditEvent", "authorization", element.getAuthorization().get(i), i);
3223    }
3224    for (int i = 0; i < element.getBasedOn().size(); i++) {
3225      composeReference(t, "AuditEvent", "basedOn", element.getBasedOn().get(i), i);
3226    }
3227    if (element.hasPatient()) {
3228      composeReference(t, "AuditEvent", "patient", element.getPatient(), -1);
3229    }
3230    if (element.hasEncounter()) {
3231      composeReference(t, "AuditEvent", "encounter", element.getEncounter(), -1);
3232    }
3233    for (int i = 0; i < element.getAgent().size(); i++) {
3234      composeAuditEventAgentComponent(t, "AuditEvent", "agent", element.getAgent().get(i), i);
3235    }
3236    if (element.hasSource()) {
3237      composeAuditEventSourceComponent(t, "AuditEvent", "source", element.getSource(), -1);
3238    }
3239    for (int i = 0; i < element.getEntity().size(); i++) {
3240      composeAuditEventEntityComponent(t, "AuditEvent", "entity", element.getEntity().get(i), i);
3241    }
3242  }
3243
3244  protected void composeAuditEventOutcomeComponent(Complex parent, String parentType, String name, AuditEvent.AuditEventOutcomeComponent 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, "outcome", name, element, index);
3254    if (element.hasCode()) {
3255      composeCoding(t, "AuditEventOutcomeComponent", "code", element.getCode(), -1);
3256    }
3257    for (int i = 0; i < element.getDetail().size(); i++) {
3258      composeCodeableConcept(t, "AuditEventOutcomeComponent", "detail", element.getDetail().get(i), i);
3259    }
3260  }
3261
3262  protected void composeAuditEventAgentComponent(Complex parent, String parentType, String name, AuditEvent.AuditEventAgentComponent element, int index) {
3263    if (element == null) 
3264      return;
3265    Complex t;
3266    if (Utilities.noString(parentType))
3267      t = parent;
3268    else {
3269      t = parent.predicate("fhir:"+parentType+'.'+name);
3270    }
3271    composeBackboneElement(t, "agent", name, element, index);
3272    if (element.hasType()) {
3273      composeCodeableConcept(t, "AuditEventAgentComponent", "type", element.getType(), -1);
3274    }
3275    for (int i = 0; i < element.getRole().size(); i++) {
3276      composeCodeableConcept(t, "AuditEventAgentComponent", "role", element.getRole().get(i), i);
3277    }
3278    if (element.hasWho()) {
3279      composeReference(t, "AuditEventAgentComponent", "who", element.getWho(), -1);
3280    }
3281    if (element.hasRequestorElement()) {
3282      composeBoolean(t, "AuditEventAgentComponent", "requestor", element.getRequestorElement(), -1);
3283    }
3284    if (element.hasLocation()) {
3285      composeReference(t, "AuditEventAgentComponent", "location", element.getLocation(), -1);
3286    }
3287    for (int i = 0; i < element.getPolicy().size(); i++) {
3288      composeUri(t, "AuditEventAgentComponent", "policy", element.getPolicy().get(i), i);
3289    }
3290    if (element.hasNetwork()) {
3291      composeType(t, "AuditEventAgentComponent", "network", element.getNetwork(), -1);
3292    }
3293    for (int i = 0; i < element.getAuthorization().size(); i++) {
3294      composeCodeableConcept(t, "AuditEventAgentComponent", "authorization", element.getAuthorization().get(i), i);
3295    }
3296  }
3297
3298  protected void composeAuditEventSourceComponent(Complex parent, String parentType, String name, AuditEvent.AuditEventSourceComponent element, int index) {
3299    if (element == null) 
3300      return;
3301    Complex t;
3302    if (Utilities.noString(parentType))
3303      t = parent;
3304    else {
3305      t = parent.predicate("fhir:"+parentType+'.'+name);
3306    }
3307    composeBackboneElement(t, "source", name, element, index);
3308    if (element.hasSite()) {
3309      composeReference(t, "AuditEventSourceComponent", "site", element.getSite(), -1);
3310    }
3311    if (element.hasObserver()) {
3312      composeReference(t, "AuditEventSourceComponent", "observer", element.getObserver(), -1);
3313    }
3314    for (int i = 0; i < element.getType().size(); i++) {
3315      composeCodeableConcept(t, "AuditEventSourceComponent", "type", element.getType().get(i), i);
3316    }
3317  }
3318
3319  protected void composeAuditEventEntityComponent(Complex parent, String parentType, String name, AuditEvent.AuditEventEntityComponent element, int index) {
3320    if (element == null) 
3321      return;
3322    Complex t;
3323    if (Utilities.noString(parentType))
3324      t = parent;
3325    else {
3326      t = parent.predicate("fhir:"+parentType+'.'+name);
3327    }
3328    composeBackboneElement(t, "entity", name, element, index);
3329    if (element.hasWhat()) {
3330      composeReference(t, "AuditEventEntityComponent", "what", element.getWhat(), -1);
3331    }
3332    if (element.hasRole()) {
3333      composeCodeableConcept(t, "AuditEventEntityComponent", "role", element.getRole(), -1);
3334    }
3335    for (int i = 0; i < element.getSecurityLabel().size(); i++) {
3336      composeCodeableConcept(t, "AuditEventEntityComponent", "securityLabel", element.getSecurityLabel().get(i), i);
3337    }
3338    if (element.hasQueryElement()) {
3339      composeBase64Binary(t, "AuditEventEntityComponent", "query", element.getQueryElement(), -1);
3340    }
3341    for (int i = 0; i < element.getDetail().size(); i++) {
3342      composeAuditEventEntityDetailComponent(t, "AuditEventEntityComponent", "detail", element.getDetail().get(i), i);
3343    }
3344    for (int i = 0; i < element.getAgent().size(); i++) {
3345      composeAuditEventAgentComponent(t, "AuditEventEntityComponent", "agent", element.getAgent().get(i), i);
3346    }
3347  }
3348
3349  protected void composeAuditEventEntityDetailComponent(Complex parent, String parentType, String name, AuditEvent.AuditEventEntityDetailComponent element, int index) {
3350    if (element == null) 
3351      return;
3352    Complex t;
3353    if (Utilities.noString(parentType))
3354      t = parent;
3355    else {
3356      t = parent.predicate("fhir:"+parentType+'.'+name);
3357    }
3358    composeBackboneElement(t, "detail", name, element, index);
3359    if (element.hasType()) {
3360      composeCodeableConcept(t, "AuditEventEntityDetailComponent", "type", element.getType(), -1);
3361    }
3362    if (element.hasValue()) {
3363      composeType(t, "AuditEventEntityDetailComponent", "value", element.getValue(), -1);
3364    }
3365  }
3366
3367  protected void composeBasic(Complex parent, String parentType, String name, Basic 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    composeDomainResource(t, "Basic", name, element, index);
3377    for (int i = 0; i < element.getIdentifier().size(); i++) {
3378      composeIdentifier(t, "Basic", "identifier", element.getIdentifier().get(i), i);
3379    }
3380    if (element.hasCode()) {
3381      composeCodeableConcept(t, "Basic", "code", element.getCode(), -1);
3382    }
3383    if (element.hasSubject()) {
3384      composeReference(t, "Basic", "subject", element.getSubject(), -1);
3385    }
3386    if (element.hasCreatedElement()) {
3387      composeDateTime(t, "Basic", "created", element.getCreatedElement(), -1);
3388    }
3389    if (element.hasAuthor()) {
3390      composeReference(t, "Basic", "author", element.getAuthor(), -1);
3391    }
3392  }
3393
3394  protected void composeBinary(Complex parent, String parentType, String name, Binary element, int index) {
3395    if (element == null) 
3396      return;
3397    Complex t;
3398    if (Utilities.noString(parentType))
3399      t = parent;
3400    else {
3401      t = parent.predicate("fhir:"+parentType+'.'+name);
3402    }
3403    composeResource(t, "Binary", name, element, index);
3404    if (element.hasContentTypeElement()) {
3405      composeCode(t, "Binary", "contentType", element.getContentTypeElement(), -1);
3406    }
3407    if (element.hasSecurityContext()) {
3408      composeReference(t, "Binary", "securityContext", element.getSecurityContext(), -1);
3409    }
3410    if (element.hasDataElement()) {
3411      composeBase64Binary(t, "Binary", "data", element.getDataElement(), -1);
3412    }
3413  }
3414
3415  protected void composeBiologicallyDerivedProduct(Complex parent, String parentType, String name, BiologicallyDerivedProduct 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    composeDomainResource(t, "BiologicallyDerivedProduct", name, element, index);
3425    if (element.hasProductCategory()) {
3426      composeCoding(t, "BiologicallyDerivedProduct", "productCategory", element.getProductCategory(), -1);
3427    }
3428    if (element.hasProductCode()) {
3429      composeCodeableConcept(t, "BiologicallyDerivedProduct", "productCode", element.getProductCode(), -1);
3430    }
3431    for (int i = 0; i < element.getParent().size(); i++) {
3432      composeReference(t, "BiologicallyDerivedProduct", "parent", element.getParent().get(i), i);
3433    }
3434    for (int i = 0; i < element.getRequest().size(); i++) {
3435      composeReference(t, "BiologicallyDerivedProduct", "request", element.getRequest().get(i), i);
3436    }
3437    for (int i = 0; i < element.getIdentifier().size(); i++) {
3438      composeIdentifier(t, "BiologicallyDerivedProduct", "identifier", element.getIdentifier().get(i), i);
3439    }
3440    if (element.hasBiologicalSourceEvent()) {
3441      composeIdentifier(t, "BiologicallyDerivedProduct", "biologicalSourceEvent", element.getBiologicalSourceEvent(), -1);
3442    }
3443    for (int i = 0; i < element.getProcessingFacility().size(); i++) {
3444      composeReference(t, "BiologicallyDerivedProduct", "processingFacility", element.getProcessingFacility().get(i), i);
3445    }
3446    if (element.hasDivisionElement()) {
3447      composeString(t, "BiologicallyDerivedProduct", "division", element.getDivisionElement(), -1);
3448    }
3449    if (element.hasProductStatus()) {
3450      composeCoding(t, "BiologicallyDerivedProduct", "productStatus", element.getProductStatus(), -1);
3451    }
3452    if (element.hasExpirationDateElement()) {
3453      composeDateTime(t, "BiologicallyDerivedProduct", "expirationDate", element.getExpirationDateElement(), -1);
3454    }
3455    if (element.hasCollection()) {
3456      composeBiologicallyDerivedProductCollectionComponent(t, "BiologicallyDerivedProduct", "collection", element.getCollection(), -1);
3457    }
3458    if (element.hasStorageTempRequirements()) {
3459      composeRange(t, "BiologicallyDerivedProduct", "storageTempRequirements", element.getStorageTempRequirements(), -1);
3460    }
3461    for (int i = 0; i < element.getProperty().size(); i++) {
3462      composeBiologicallyDerivedProductPropertyComponent(t, "BiologicallyDerivedProduct", "property", element.getProperty().get(i), i);
3463    }
3464  }
3465
3466  protected void composeBiologicallyDerivedProductCollectionComponent(Complex parent, String parentType, String name, BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent element, int index) {
3467    if (element == null) 
3468      return;
3469    Complex t;
3470    if (Utilities.noString(parentType))
3471      t = parent;
3472    else {
3473      t = parent.predicate("fhir:"+parentType+'.'+name);
3474    }
3475    composeBackboneElement(t, "collection", name, element, index);
3476    if (element.hasCollector()) {
3477      composeReference(t, "BiologicallyDerivedProductCollectionComponent", "collector", element.getCollector(), -1);
3478    }
3479    if (element.hasSource()) {
3480      composeReference(t, "BiologicallyDerivedProductCollectionComponent", "source", element.getSource(), -1);
3481    }
3482    if (element.hasCollected()) {
3483      composeType(t, "BiologicallyDerivedProductCollectionComponent", "collected", element.getCollected(), -1);
3484    }
3485  }
3486
3487  protected void composeBiologicallyDerivedProductPropertyComponent(Complex parent, String parentType, String name, BiologicallyDerivedProduct.BiologicallyDerivedProductPropertyComponent element, int index) {
3488    if (element == null) 
3489      return;
3490    Complex t;
3491    if (Utilities.noString(parentType))
3492      t = parent;
3493    else {
3494      t = parent.predicate("fhir:"+parentType+'.'+name);
3495    }
3496    composeBackboneElement(t, "property", name, element, index);
3497    if (element.hasType()) {
3498      composeCoding(t, "BiologicallyDerivedProductPropertyComponent", "type", element.getType(), -1);
3499    }
3500    if (element.hasValue()) {
3501      composeType(t, "BiologicallyDerivedProductPropertyComponent", "value", element.getValue(), -1);
3502    }
3503  }
3504
3505  protected void composeBodyStructure(Complex parent, String parentType, String name, BodyStructure element, int index) {
3506    if (element == null) 
3507      return;
3508    Complex t;
3509    if (Utilities.noString(parentType))
3510      t = parent;
3511    else {
3512      t = parent.predicate("fhir:"+parentType+'.'+name);
3513    }
3514    composeDomainResource(t, "BodyStructure", name, element, index);
3515    for (int i = 0; i < element.getIdentifier().size(); i++) {
3516      composeIdentifier(t, "BodyStructure", "identifier", element.getIdentifier().get(i), i);
3517    }
3518    if (element.hasActiveElement()) {
3519      composeBoolean(t, "BodyStructure", "active", element.getActiveElement(), -1);
3520    }
3521    if (element.hasMorphology()) {
3522      composeCodeableConcept(t, "BodyStructure", "morphology", element.getMorphology(), -1);
3523    }
3524    for (int i = 0; i < element.getIncludedStructure().size(); i++) {
3525      composeBodyStructureIncludedStructureComponent(t, "BodyStructure", "includedStructure", element.getIncludedStructure().get(i), i);
3526    }
3527    for (int i = 0; i < element.getExcludedStructure().size(); i++) {
3528      composeBodyStructureExcludedStructureComponent(t, "BodyStructure", "excludedStructure", element.getExcludedStructure().get(i), i);
3529    }
3530    if (element.hasDescriptionElement()) {
3531      composeString(t, "BodyStructure", "description", element.getDescriptionElement(), -1);
3532    }
3533    for (int i = 0; i < element.getImage().size(); i++) {
3534      composeAttachment(t, "BodyStructure", "image", element.getImage().get(i), i);
3535    }
3536    if (element.hasPatient()) {
3537      composeReference(t, "BodyStructure", "patient", element.getPatient(), -1);
3538    }
3539  }
3540
3541  protected void composeBodyStructureIncludedStructureComponent(Complex parent, String parentType, String name, BodyStructure.BodyStructureIncludedStructureComponent element, int index) {
3542    if (element == null) 
3543      return;
3544    Complex t;
3545    if (Utilities.noString(parentType))
3546      t = parent;
3547    else {
3548      t = parent.predicate("fhir:"+parentType+'.'+name);
3549    }
3550    composeBackboneElement(t, "includedStructure", name, element, index);
3551    if (element.hasStructure()) {
3552      composeCodeableConcept(t, "BodyStructureIncludedStructureComponent", "structure", element.getStructure(), -1);
3553    }
3554    if (element.hasLaterality()) {
3555      composeCodeableConcept(t, "BodyStructureIncludedStructureComponent", "laterality", element.getLaterality(), -1);
3556    }
3557    for (int i = 0; i < element.getQualifier().size(); i++) {
3558      composeCodeableConcept(t, "BodyStructureIncludedStructureComponent", "qualifier", element.getQualifier().get(i), i);
3559    }
3560  }
3561
3562  protected void composeBodyStructureExcludedStructureComponent(Complex parent, String parentType, String name, BodyStructure.BodyStructureExcludedStructureComponent 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, "excludedStructure", name, element, index);
3572    if (element.hasStructure()) {
3573      composeCodeableConcept(t, "BodyStructureExcludedStructureComponent", "structure", element.getStructure(), -1);
3574    }
3575    if (element.hasLaterality()) {
3576      composeCodeableConcept(t, "BodyStructureExcludedStructureComponent", "laterality", element.getLaterality(), -1);
3577    }
3578    for (int i = 0; i < element.getQualifier().size(); i++) {
3579      composeCodeableConcept(t, "BodyStructureExcludedStructureComponent", "qualifier", element.getQualifier().get(i), i);
3580    }
3581  }
3582
3583  protected void composeBundle(Complex parent, String parentType, String name, Bundle element, int index) {
3584    if (element == null) 
3585      return;
3586    Complex t;
3587    if (Utilities.noString(parentType))
3588      t = parent;
3589    else {
3590      t = parent.predicate("fhir:"+parentType+'.'+name);
3591    }
3592    composeResource(t, "Bundle", name, element, index);
3593    if (element.hasIdentifier()) {
3594      composeIdentifier(t, "Bundle", "identifier", element.getIdentifier(), -1);
3595    }
3596    if (element.hasTypeElement()) {
3597      composeEnum(t, "Bundle", "type", element.getTypeElement(), -1);
3598    }
3599    if (element.hasTimestampElement()) {
3600      composeInstant(t, "Bundle", "timestamp", element.getTimestampElement(), -1);
3601    }
3602    if (element.hasTotalElement()) {
3603      composeUnsignedInt(t, "Bundle", "total", element.getTotalElement(), -1);
3604    }
3605    for (int i = 0; i < element.getLink().size(); i++) {
3606      composeBundleLinkComponent(t, "Bundle", "link", element.getLink().get(i), i);
3607    }
3608    for (int i = 0; i < element.getEntry().size(); i++) {
3609      composeBundleEntryComponent(t, "Bundle", "entry", element.getEntry().get(i), i);
3610    }
3611    if (element.hasSignature()) {
3612      composeSignature(t, "Bundle", "signature", element.getSignature(), -1);
3613    }
3614    if (element.hasIssues()) {
3615      composeResource(t, "Bundle", "issues", element.getIssues(), -1);
3616    }
3617  }
3618
3619  protected void composeBundleLinkComponent(Complex parent, String parentType, String name, Bundle.BundleLinkComponent element, int index) {
3620    if (element == null) 
3621      return;
3622    Complex t;
3623    if (Utilities.noString(parentType))
3624      t = parent;
3625    else {
3626      t = parent.predicate("fhir:"+parentType+'.'+name);
3627    }
3628    composeBackboneElement(t, "link", name, element, index);
3629    if (element.hasRelationElement()) {
3630      composeEnum(t, "BundleLinkComponent", "relation", element.getRelationElement(), -1);
3631    }
3632    if (element.hasUrlElement()) {
3633      composeUri(t, "BundleLinkComponent", "url", element.getUrlElement(), -1);
3634    }
3635  }
3636
3637  protected void composeBundleEntryComponent(Complex parent, String parentType, String name, Bundle.BundleEntryComponent element, int index) {
3638    if (element == null) 
3639      return;
3640    Complex t;
3641    if (Utilities.noString(parentType))
3642      t = parent;
3643    else {
3644      t = parent.predicate("fhir:"+parentType+'.'+name);
3645    }
3646    composeBackboneElement(t, "entry", name, element, index);
3647    for (int i = 0; i < element.getLink().size(); i++) {
3648      composeBundleLinkComponent(t, "BundleEntryComponent", "link", element.getLink().get(i), i);
3649    }
3650    if (element.hasFullUrlElement()) {
3651      composeUri(t, "BundleEntryComponent", "fullUrl", element.getFullUrlElement(), -1);
3652    }
3653    if (element.hasResource()) {
3654      composeResource(t, "BundleEntryComponent", "resource", element.getResource(), -1);
3655    }
3656    if (element.hasSearch()) {
3657      composeBundleEntrySearchComponent(t, "BundleEntryComponent", "search", element.getSearch(), -1);
3658    }
3659    if (element.hasRequest()) {
3660      composeBundleEntryRequestComponent(t, "BundleEntryComponent", "request", element.getRequest(), -1);
3661    }
3662    if (element.hasResponse()) {
3663      composeBundleEntryResponseComponent(t, "BundleEntryComponent", "response", element.getResponse(), -1);
3664    }
3665  }
3666
3667  protected void composeBundleEntrySearchComponent(Complex parent, String parentType, String name, Bundle.BundleEntrySearchComponent element, int index) {
3668    if (element == null) 
3669      return;
3670    Complex t;
3671    if (Utilities.noString(parentType))
3672      t = parent;
3673    else {
3674      t = parent.predicate("fhir:"+parentType+'.'+name);
3675    }
3676    composeBackboneElement(t, "search", name, element, index);
3677    if (element.hasModeElement()) {
3678      composeEnum(t, "BundleEntrySearchComponent", "mode", element.getModeElement(), -1);
3679    }
3680    if (element.hasScoreElement()) {
3681      composeDecimal(t, "BundleEntrySearchComponent", "score", element.getScoreElement(), -1);
3682    }
3683  }
3684
3685  protected void composeBundleEntryRequestComponent(Complex parent, String parentType, String name, Bundle.BundleEntryRequestComponent element, int index) {
3686    if (element == null) 
3687      return;
3688    Complex t;
3689    if (Utilities.noString(parentType))
3690      t = parent;
3691    else {
3692      t = parent.predicate("fhir:"+parentType+'.'+name);
3693    }
3694    composeBackboneElement(t, "request", name, element, index);
3695    if (element.hasMethodElement()) {
3696      composeEnum(t, "BundleEntryRequestComponent", "method", element.getMethodElement(), -1);
3697    }
3698    if (element.hasUrlElement()) {
3699      composeUri(t, "BundleEntryRequestComponent", "url", element.getUrlElement(), -1);
3700    }
3701    if (element.hasIfNoneMatchElement()) {
3702      composeString(t, "BundleEntryRequestComponent", "ifNoneMatch", element.getIfNoneMatchElement(), -1);
3703    }
3704    if (element.hasIfModifiedSinceElement()) {
3705      composeInstant(t, "BundleEntryRequestComponent", "ifModifiedSince", element.getIfModifiedSinceElement(), -1);
3706    }
3707    if (element.hasIfMatchElement()) {
3708      composeString(t, "BundleEntryRequestComponent", "ifMatch", element.getIfMatchElement(), -1);
3709    }
3710    if (element.hasIfNoneExistElement()) {
3711      composeString(t, "BundleEntryRequestComponent", "ifNoneExist", element.getIfNoneExistElement(), -1);
3712    }
3713  }
3714
3715  protected void composeBundleEntryResponseComponent(Complex parent, String parentType, String name, Bundle.BundleEntryResponseComponent element, int index) {
3716    if (element == null) 
3717      return;
3718    Complex t;
3719    if (Utilities.noString(parentType))
3720      t = parent;
3721    else {
3722      t = parent.predicate("fhir:"+parentType+'.'+name);
3723    }
3724    composeBackboneElement(t, "response", name, element, index);
3725    if (element.hasStatusElement()) {
3726      composeString(t, "BundleEntryResponseComponent", "status", element.getStatusElement(), -1);
3727    }
3728    if (element.hasLocationElement()) {
3729      composeUri(t, "BundleEntryResponseComponent", "location", element.getLocationElement(), -1);
3730    }
3731    if (element.hasEtagElement()) {
3732      composeString(t, "BundleEntryResponseComponent", "etag", element.getEtagElement(), -1);
3733    }
3734    if (element.hasLastModifiedElement()) {
3735      composeInstant(t, "BundleEntryResponseComponent", "lastModified", element.getLastModifiedElement(), -1);
3736    }
3737    if (element.hasOutcome()) {
3738      composeResource(t, "BundleEntryResponseComponent", "outcome", element.getOutcome(), -1);
3739    }
3740  }
3741
3742  protected void composeCapabilityStatement(Complex parent, String parentType, String name, CapabilityStatement element, int index) {
3743    if (element == null) 
3744      return;
3745    Complex t;
3746    if (Utilities.noString(parentType))
3747      t = parent;
3748    else {
3749      t = parent.predicate("fhir:"+parentType+'.'+name);
3750    }
3751    composeCanonicalResource(t, "CapabilityStatement", name, element, index);
3752    if (element.hasUrlElement()) {
3753      composeUri(t, "CapabilityStatement", "url", element.getUrlElement(), -1);
3754    }
3755    if (element.hasVersionElement()) {
3756      composeString(t, "CapabilityStatement", "version", element.getVersionElement(), -1);
3757    }
3758    if (element.hasVersionAlgorithm()) {
3759      composeType(t, "CapabilityStatement", "versionAlgorithm", element.getVersionAlgorithm(), -1);
3760    }
3761    if (element.hasNameElement()) {
3762      composeString(t, "CapabilityStatement", "name", element.getNameElement(), -1);
3763    }
3764    if (element.hasTitleElement()) {
3765      composeString(t, "CapabilityStatement", "title", element.getTitleElement(), -1);
3766    }
3767    if (element.hasStatusElement()) {
3768      composeEnum(t, "CapabilityStatement", "status", element.getStatusElement(), -1);
3769    }
3770    if (element.hasExperimentalElement()) {
3771      composeBoolean(t, "CapabilityStatement", "experimental", element.getExperimentalElement(), -1);
3772    }
3773    if (element.hasDateElement()) {
3774      composeDateTime(t, "CapabilityStatement", "date", element.getDateElement(), -1);
3775    }
3776    if (element.hasPublisherElement()) {
3777      composeString(t, "CapabilityStatement", "publisher", element.getPublisherElement(), -1);
3778    }
3779    for (int i = 0; i < element.getContact().size(); i++) {
3780      composeContactDetail(t, "CapabilityStatement", "contact", element.getContact().get(i), i);
3781    }
3782    if (element.hasDescriptionElement()) {
3783      composeMarkdown(t, "CapabilityStatement", "description", element.getDescriptionElement(), -1);
3784    }
3785    for (int i = 0; i < element.getUseContext().size(); i++) {
3786      composeUsageContext(t, "CapabilityStatement", "useContext", element.getUseContext().get(i), i);
3787    }
3788    for (int i = 0; i < element.getJurisdiction().size(); i++) {
3789      composeCodeableConcept(t, "CapabilityStatement", "jurisdiction", element.getJurisdiction().get(i), i);
3790    }
3791    if (element.hasPurposeElement()) {
3792      composeMarkdown(t, "CapabilityStatement", "purpose", element.getPurposeElement(), -1);
3793    }
3794    if (element.hasCopyrightElement()) {
3795      composeMarkdown(t, "CapabilityStatement", "copyright", element.getCopyrightElement(), -1);
3796    }
3797    if (element.hasCopyrightLabelElement()) {
3798      composeString(t, "CapabilityStatement", "copyrightLabel", element.getCopyrightLabelElement(), -1);
3799    }
3800    if (element.hasKindElement()) {
3801      composeEnum(t, "CapabilityStatement", "kind", element.getKindElement(), -1);
3802    }
3803    for (int i = 0; i < element.getInstantiates().size(); i++) {
3804      composeCanonical(t, "CapabilityStatement", "instantiates", element.getInstantiates().get(i), i);
3805    }
3806    for (int i = 0; i < element.getImports().size(); i++) {
3807      composeCanonical(t, "CapabilityStatement", "imports", element.getImports().get(i), i);
3808    }
3809    if (element.hasSoftware()) {
3810      composeCapabilityStatementSoftwareComponent(t, "CapabilityStatement", "software", element.getSoftware(), -1);
3811    }
3812    if (element.hasImplementation()) {
3813      composeCapabilityStatementImplementationComponent(t, "CapabilityStatement", "implementation", element.getImplementation(), -1);
3814    }
3815    if (element.hasFhirVersionElement()) {
3816      composeEnum(t, "CapabilityStatement", "fhirVersion", element.getFhirVersionElement(), -1);
3817    }
3818    for (int i = 0; i < element.getFormat().size(); i++) {
3819      composeCode(t, "CapabilityStatement", "format", element.getFormat().get(i), i);
3820    }
3821    for (int i = 0; i < element.getPatchFormat().size(); i++) {
3822      composeCode(t, "CapabilityStatement", "patchFormat", element.getPatchFormat().get(i), i);
3823    }
3824    for (int i = 0; i < element.getAcceptLanguage().size(); i++) {
3825      composeCode(t, "CapabilityStatement", "acceptLanguage", element.getAcceptLanguage().get(i), i);
3826    }
3827    for (int i = 0; i < element.getImplementationGuide().size(); i++) {
3828      composeCanonical(t, "CapabilityStatement", "implementationGuide", element.getImplementationGuide().get(i), i);
3829    }
3830    for (int i = 0; i < element.getRest().size(); i++) {
3831      composeCapabilityStatementRestComponent(t, "CapabilityStatement", "rest", element.getRest().get(i), i);
3832    }
3833    for (int i = 0; i < element.getMessaging().size(); i++) {
3834      composeCapabilityStatementMessagingComponent(t, "CapabilityStatement", "messaging", element.getMessaging().get(i), i);
3835    }
3836    for (int i = 0; i < element.getDocument().size(); i++) {
3837      composeCapabilityStatementDocumentComponent(t, "CapabilityStatement", "document", element.getDocument().get(i), i);
3838    }
3839  }
3840
3841  protected void composeCapabilityStatementSoftwareComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementSoftwareComponent element, int index) {
3842    if (element == null) 
3843      return;
3844    Complex t;
3845    if (Utilities.noString(parentType))
3846      t = parent;
3847    else {
3848      t = parent.predicate("fhir:"+parentType+'.'+name);
3849    }
3850    composeBackboneElement(t, "software", name, element, index);
3851    if (element.hasNameElement()) {
3852      composeString(t, "CapabilityStatementSoftwareComponent", "name", element.getNameElement(), -1);
3853    }
3854    if (element.hasVersionElement()) {
3855      composeString(t, "CapabilityStatementSoftwareComponent", "version", element.getVersionElement(), -1);
3856    }
3857    if (element.hasReleaseDateElement()) {
3858      composeDateTime(t, "CapabilityStatementSoftwareComponent", "releaseDate", element.getReleaseDateElement(), -1);
3859    }
3860  }
3861
3862  protected void composeCapabilityStatementImplementationComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementImplementationComponent element, int index) {
3863    if (element == null) 
3864      return;
3865    Complex t;
3866    if (Utilities.noString(parentType))
3867      t = parent;
3868    else {
3869      t = parent.predicate("fhir:"+parentType+'.'+name);
3870    }
3871    composeBackboneElement(t, "implementation", name, element, index);
3872    if (element.hasDescriptionElement()) {
3873      composeString(t, "CapabilityStatementImplementationComponent", "description", element.getDescriptionElement(), -1);
3874    }
3875    if (element.hasUrlElement()) {
3876      composeUrl(t, "CapabilityStatementImplementationComponent", "url", element.getUrlElement(), -1);
3877    }
3878    if (element.hasCustodian()) {
3879      composeReference(t, "CapabilityStatementImplementationComponent", "custodian", element.getCustodian(), -1);
3880    }
3881  }
3882
3883  protected void composeCapabilityStatementRestComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementRestComponent element, int index) {
3884    if (element == null) 
3885      return;
3886    Complex t;
3887    if (Utilities.noString(parentType))
3888      t = parent;
3889    else {
3890      t = parent.predicate("fhir:"+parentType+'.'+name);
3891    }
3892    composeBackboneElement(t, "rest", name, element, index);
3893    if (element.hasModeElement()) {
3894      composeEnum(t, "CapabilityStatementRestComponent", "mode", element.getModeElement(), -1);
3895    }
3896    if (element.hasDocumentationElement()) {
3897      composeMarkdown(t, "CapabilityStatementRestComponent", "documentation", element.getDocumentationElement(), -1);
3898    }
3899    if (element.hasSecurity()) {
3900      composeCapabilityStatementRestSecurityComponent(t, "CapabilityStatementRestComponent", "security", element.getSecurity(), -1);
3901    }
3902    for (int i = 0; i < element.getResource().size(); i++) {
3903      composeCapabilityStatementRestResourceComponent(t, "CapabilityStatementRestComponent", "resource", element.getResource().get(i), i);
3904    }
3905    for (int i = 0; i < element.getInteraction().size(); i++) {
3906      composeCapabilityStatementSystemInteractionComponent(t, "CapabilityStatementRestComponent", "interaction", element.getInteraction().get(i), i);
3907    }
3908    for (int i = 0; i < element.getSearchParam().size(); i++) {
3909      composeCapabilityStatementRestResourceSearchParamComponent(t, "CapabilityStatementRestComponent", "searchParam", element.getSearchParam().get(i), i);
3910    }
3911    for (int i = 0; i < element.getOperation().size(); i++) {
3912      composeCapabilityStatementRestResourceOperationComponent(t, "CapabilityStatementRestComponent", "operation", element.getOperation().get(i), i);
3913    }
3914    for (int i = 0; i < element.getCompartment().size(); i++) {
3915      composeCanonical(t, "CapabilityStatementRestComponent", "compartment", element.getCompartment().get(i), i);
3916    }
3917  }
3918
3919  protected void composeCapabilityStatementRestSecurityComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementRestSecurityComponent element, int index) {
3920    if (element == null) 
3921      return;
3922    Complex t;
3923    if (Utilities.noString(parentType))
3924      t = parent;
3925    else {
3926      t = parent.predicate("fhir:"+parentType+'.'+name);
3927    }
3928    composeBackboneElement(t, "security", name, element, index);
3929    if (element.hasCorsElement()) {
3930      composeBoolean(t, "CapabilityStatementRestSecurityComponent", "cors", element.getCorsElement(), -1);
3931    }
3932    for (int i = 0; i < element.getService().size(); i++) {
3933      composeCodeableConcept(t, "CapabilityStatementRestSecurityComponent", "service", element.getService().get(i), i);
3934    }
3935    if (element.hasDescriptionElement()) {
3936      composeMarkdown(t, "CapabilityStatementRestSecurityComponent", "description", element.getDescriptionElement(), -1);
3937    }
3938  }
3939
3940  protected void composeCapabilityStatementRestResourceComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementRestResourceComponent element, int index) {
3941    if (element == null) 
3942      return;
3943    Complex t;
3944    if (Utilities.noString(parentType))
3945      t = parent;
3946    else {
3947      t = parent.predicate("fhir:"+parentType+'.'+name);
3948    }
3949    composeBackboneElement(t, "resource", name, element, index);
3950    if (element.hasTypeElement()) {
3951      composeCode(t, "CapabilityStatementRestResourceComponent", "type", element.getTypeElement(), -1);
3952    }
3953    if (element.hasProfileElement()) {
3954      composeCanonical(t, "CapabilityStatementRestResourceComponent", "profile", element.getProfileElement(), -1);
3955    }
3956    for (int i = 0; i < element.getSupportedProfile().size(); i++) {
3957      composeCanonical(t, "CapabilityStatementRestResourceComponent", "supportedProfile", element.getSupportedProfile().get(i), i);
3958    }
3959    if (element.hasDocumentationElement()) {
3960      composeMarkdown(t, "CapabilityStatementRestResourceComponent", "documentation", element.getDocumentationElement(), -1);
3961    }
3962    for (int i = 0; i < element.getInteraction().size(); i++) {
3963      composeCapabilityStatementResourceInteractionComponent(t, "CapabilityStatementRestResourceComponent", "interaction", element.getInteraction().get(i), i);
3964    }
3965    if (element.hasVersioningElement()) {
3966      composeEnum(t, "CapabilityStatementRestResourceComponent", "versioning", element.getVersioningElement(), -1);
3967    }
3968    if (element.hasReadHistoryElement()) {
3969      composeBoolean(t, "CapabilityStatementRestResourceComponent", "readHistory", element.getReadHistoryElement(), -1);
3970    }
3971    if (element.hasUpdateCreateElement()) {
3972      composeBoolean(t, "CapabilityStatementRestResourceComponent", "updateCreate", element.getUpdateCreateElement(), -1);
3973    }
3974    if (element.hasConditionalCreateElement()) {
3975      composeBoolean(t, "CapabilityStatementRestResourceComponent", "conditionalCreate", element.getConditionalCreateElement(), -1);
3976    }
3977    if (element.hasConditionalReadElement()) {
3978      composeEnum(t, "CapabilityStatementRestResourceComponent", "conditionalRead", element.getConditionalReadElement(), -1);
3979    }
3980    if (element.hasConditionalUpdateElement()) {
3981      composeBoolean(t, "CapabilityStatementRestResourceComponent", "conditionalUpdate", element.getConditionalUpdateElement(), -1);
3982    }
3983    if (element.hasConditionalPatchElement()) {
3984      composeBoolean(t, "CapabilityStatementRestResourceComponent", "conditionalPatch", element.getConditionalPatchElement(), -1);
3985    }
3986    if (element.hasConditionalDeleteElement()) {
3987      composeEnum(t, "CapabilityStatementRestResourceComponent", "conditionalDelete", element.getConditionalDeleteElement(), -1);
3988    }
3989    for (int i = 0; i < element.getReferencePolicy().size(); i++) {
3990      composeEnum(t, "CapabilityStatementRestResourceComponent", "referencePolicy", element.getReferencePolicy().get(i), i);
3991    }
3992    for (int i = 0; i < element.getSearchInclude().size(); i++) {
3993      composeString(t, "CapabilityStatementRestResourceComponent", "searchInclude", element.getSearchInclude().get(i), i);
3994    }
3995    for (int i = 0; i < element.getSearchRevInclude().size(); i++) {
3996      composeString(t, "CapabilityStatementRestResourceComponent", "searchRevInclude", element.getSearchRevInclude().get(i), i);
3997    }
3998    for (int i = 0; i < element.getSearchParam().size(); i++) {
3999      composeCapabilityStatementRestResourceSearchParamComponent(t, "CapabilityStatementRestResourceComponent", "searchParam", element.getSearchParam().get(i), i);
4000    }
4001    for (int i = 0; i < element.getOperation().size(); i++) {
4002      composeCapabilityStatementRestResourceOperationComponent(t, "CapabilityStatementRestResourceComponent", "operation", element.getOperation().get(i), i);
4003    }
4004  }
4005
4006  protected void composeCapabilityStatementResourceInteractionComponent(Complex parent, String parentType, String name, CapabilityStatement.ResourceInteractionComponent element, int index) {
4007    if (element == null) 
4008      return;
4009    Complex t;
4010    if (Utilities.noString(parentType))
4011      t = parent;
4012    else {
4013      t = parent.predicate("fhir:"+parentType+'.'+name);
4014    }
4015    composeBackboneElement(t, "interaction", name, element, index);
4016    if (element.hasCodeElement()) {
4017      composeEnum(t, "ResourceInteractionComponent", "code", element.getCodeElement(), -1);
4018    }
4019    if (element.hasDocumentationElement()) {
4020      composeMarkdown(t, "ResourceInteractionComponent", "documentation", element.getDocumentationElement(), -1);
4021    }
4022  }
4023
4024  protected void composeCapabilityStatementRestResourceSearchParamComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent element, int index) {
4025    if (element == null) 
4026      return;
4027    Complex t;
4028    if (Utilities.noString(parentType))
4029      t = parent;
4030    else {
4031      t = parent.predicate("fhir:"+parentType+'.'+name);
4032    }
4033    composeBackboneElement(t, "searchParam", name, element, index);
4034    if (element.hasNameElement()) {
4035      composeString(t, "CapabilityStatementRestResourceSearchParamComponent", "name", element.getNameElement(), -1);
4036    }
4037    if (element.hasDefinitionElement()) {
4038      composeCanonical(t, "CapabilityStatementRestResourceSearchParamComponent", "definition", element.getDefinitionElement(), -1);
4039    }
4040    if (element.hasTypeElement()) {
4041      composeEnum(t, "CapabilityStatementRestResourceSearchParamComponent", "type", element.getTypeElement(), -1);
4042    }
4043    if (element.hasDocumentationElement()) {
4044      composeMarkdown(t, "CapabilityStatementRestResourceSearchParamComponent", "documentation", element.getDocumentationElement(), -1);
4045    }
4046  }
4047
4048  protected void composeCapabilityStatementRestResourceOperationComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementRestResourceOperationComponent element, int index) {
4049    if (element == null) 
4050      return;
4051    Complex t;
4052    if (Utilities.noString(parentType))
4053      t = parent;
4054    else {
4055      t = parent.predicate("fhir:"+parentType+'.'+name);
4056    }
4057    composeBackboneElement(t, "operation", name, element, index);
4058    if (element.hasNameElement()) {
4059      composeString(t, "CapabilityStatementRestResourceOperationComponent", "name", element.getNameElement(), -1);
4060    }
4061    if (element.hasDefinitionElement()) {
4062      composeCanonical(t, "CapabilityStatementRestResourceOperationComponent", "definition", element.getDefinitionElement(), -1);
4063    }
4064    if (element.hasDocumentationElement()) {
4065      composeMarkdown(t, "CapabilityStatementRestResourceOperationComponent", "documentation", element.getDocumentationElement(), -1);
4066    }
4067  }
4068
4069  protected void composeCapabilityStatementSystemInteractionComponent(Complex parent, String parentType, String name, CapabilityStatement.SystemInteractionComponent element, int index) {
4070    if (element == null) 
4071      return;
4072    Complex t;
4073    if (Utilities.noString(parentType))
4074      t = parent;
4075    else {
4076      t = parent.predicate("fhir:"+parentType+'.'+name);
4077    }
4078    composeBackboneElement(t, "interaction", name, element, index);
4079    if (element.hasCodeElement()) {
4080      composeEnum(t, "SystemInteractionComponent", "code", element.getCodeElement(), -1);
4081    }
4082    if (element.hasDocumentationElement()) {
4083      composeMarkdown(t, "SystemInteractionComponent", "documentation", element.getDocumentationElement(), -1);
4084    }
4085  }
4086
4087  protected void composeCapabilityStatementMessagingComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementMessagingComponent element, int index) {
4088    if (element == null) 
4089      return;
4090    Complex t;
4091    if (Utilities.noString(parentType))
4092      t = parent;
4093    else {
4094      t = parent.predicate("fhir:"+parentType+'.'+name);
4095    }
4096    composeBackboneElement(t, "messaging", name, element, index);
4097    for (int i = 0; i < element.getEndpoint().size(); i++) {
4098      composeCapabilityStatementMessagingEndpointComponent(t, "CapabilityStatementMessagingComponent", "endpoint", element.getEndpoint().get(i), i);
4099    }
4100    if (element.hasReliableCacheElement()) {
4101      composeUnsignedInt(t, "CapabilityStatementMessagingComponent", "reliableCache", element.getReliableCacheElement(), -1);
4102    }
4103    if (element.hasDocumentationElement()) {
4104      composeMarkdown(t, "CapabilityStatementMessagingComponent", "documentation", element.getDocumentationElement(), -1);
4105    }
4106    for (int i = 0; i < element.getSupportedMessage().size(); i++) {
4107      composeCapabilityStatementMessagingSupportedMessageComponent(t, "CapabilityStatementMessagingComponent", "supportedMessage", element.getSupportedMessage().get(i), i);
4108    }
4109  }
4110
4111  protected void composeCapabilityStatementMessagingEndpointComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementMessagingEndpointComponent element, int index) {
4112    if (element == null) 
4113      return;
4114    Complex t;
4115    if (Utilities.noString(parentType))
4116      t = parent;
4117    else {
4118      t = parent.predicate("fhir:"+parentType+'.'+name);
4119    }
4120    composeBackboneElement(t, "endpoint", name, element, index);
4121    if (element.hasProtocol()) {
4122      composeCoding(t, "CapabilityStatementMessagingEndpointComponent", "protocol", element.getProtocol(), -1);
4123    }
4124    if (element.hasAddressElement()) {
4125      composeUrl(t, "CapabilityStatementMessagingEndpointComponent", "address", element.getAddressElement(), -1);
4126    }
4127  }
4128
4129  protected void composeCapabilityStatementMessagingSupportedMessageComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent element, int index) {
4130    if (element == null) 
4131      return;
4132    Complex t;
4133    if (Utilities.noString(parentType))
4134      t = parent;
4135    else {
4136      t = parent.predicate("fhir:"+parentType+'.'+name);
4137    }
4138    composeBackboneElement(t, "supportedMessage", name, element, index);
4139    if (element.hasModeElement()) {
4140      composeEnum(t, "CapabilityStatementMessagingSupportedMessageComponent", "mode", element.getModeElement(), -1);
4141    }
4142    if (element.hasDefinitionElement()) {
4143      composeCanonical(t, "CapabilityStatementMessagingSupportedMessageComponent", "definition", element.getDefinitionElement(), -1);
4144    }
4145  }
4146
4147  protected void composeCapabilityStatementDocumentComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementDocumentComponent element, int index) {
4148    if (element == null) 
4149      return;
4150    Complex t;
4151    if (Utilities.noString(parentType))
4152      t = parent;
4153    else {
4154      t = parent.predicate("fhir:"+parentType+'.'+name);
4155    }
4156    composeBackboneElement(t, "document", name, element, index);
4157    if (element.hasModeElement()) {
4158      composeEnum(t, "CapabilityStatementDocumentComponent", "mode", element.getModeElement(), -1);
4159    }
4160    if (element.hasDocumentationElement()) {
4161      composeMarkdown(t, "CapabilityStatementDocumentComponent", "documentation", element.getDocumentationElement(), -1);
4162    }
4163    if (element.hasProfileElement()) {
4164      composeCanonical(t, "CapabilityStatementDocumentComponent", "profile", element.getProfileElement(), -1);
4165    }
4166  }
4167
4168  protected void composeCarePlan(Complex parent, String parentType, String name, CarePlan element, int index) {
4169    if (element == null) 
4170      return;
4171    Complex t;
4172    if (Utilities.noString(parentType))
4173      t = parent;
4174    else {
4175      t = parent.predicate("fhir:"+parentType+'.'+name);
4176    }
4177    composeDomainResource(t, "CarePlan", name, element, index);
4178    for (int i = 0; i < element.getIdentifier().size(); i++) {
4179      composeIdentifier(t, "CarePlan", "identifier", element.getIdentifier().get(i), i);
4180    }
4181    for (int i = 0; i < element.getInstantiatesCanonical().size(); i++) {
4182      composeCanonical(t, "CarePlan", "instantiatesCanonical", element.getInstantiatesCanonical().get(i), i);
4183    }
4184    for (int i = 0; i < element.getInstantiatesUri().size(); i++) {
4185      composeUri(t, "CarePlan", "instantiatesUri", element.getInstantiatesUri().get(i), i);
4186    }
4187    for (int i = 0; i < element.getBasedOn().size(); i++) {
4188      composeReference(t, "CarePlan", "basedOn", element.getBasedOn().get(i), i);
4189    }
4190    for (int i = 0; i < element.getReplaces().size(); i++) {
4191      composeReference(t, "CarePlan", "replaces", element.getReplaces().get(i), i);
4192    }
4193    for (int i = 0; i < element.getPartOf().size(); i++) {
4194      composeReference(t, "CarePlan", "partOf", element.getPartOf().get(i), i);
4195    }
4196    if (element.hasStatusElement()) {
4197      composeEnum(t, "CarePlan", "status", element.getStatusElement(), -1);
4198    }
4199    if (element.hasIntentElement()) {
4200      composeEnum(t, "CarePlan", "intent", element.getIntentElement(), -1);
4201    }
4202    for (int i = 0; i < element.getCategory().size(); i++) {
4203      composeCodeableConcept(t, "CarePlan", "category", element.getCategory().get(i), i);
4204    }
4205    if (element.hasTitleElement()) {
4206      composeString(t, "CarePlan", "title", element.getTitleElement(), -1);
4207    }
4208    if (element.hasDescriptionElement()) {
4209      composeString(t, "CarePlan", "description", element.getDescriptionElement(), -1);
4210    }
4211    if (element.hasSubject()) {
4212      composeReference(t, "CarePlan", "subject", element.getSubject(), -1);
4213    }
4214    if (element.hasEncounter()) {
4215      composeReference(t, "CarePlan", "encounter", element.getEncounter(), -1);
4216    }
4217    if (element.hasPeriod()) {
4218      composePeriod(t, "CarePlan", "period", element.getPeriod(), -1);
4219    }
4220    if (element.hasCreatedElement()) {
4221      composeDateTime(t, "CarePlan", "created", element.getCreatedElement(), -1);
4222    }
4223    if (element.hasCustodian()) {
4224      composeReference(t, "CarePlan", "custodian", element.getCustodian(), -1);
4225    }
4226    for (int i = 0; i < element.getContributor().size(); i++) {
4227      composeReference(t, "CarePlan", "contributor", element.getContributor().get(i), i);
4228    }
4229    for (int i = 0; i < element.getCareTeam().size(); i++) {
4230      composeReference(t, "CarePlan", "careTeam", element.getCareTeam().get(i), i);
4231    }
4232    for (int i = 0; i < element.getAddresses().size(); i++) {
4233      composeCodeableReference(t, "CarePlan", "addresses", element.getAddresses().get(i), i);
4234    }
4235    for (int i = 0; i < element.getSupportingInfo().size(); i++) {
4236      composeReference(t, "CarePlan", "supportingInfo", element.getSupportingInfo().get(i), i);
4237    }
4238    for (int i = 0; i < element.getGoal().size(); i++) {
4239      composeReference(t, "CarePlan", "goal", element.getGoal().get(i), i);
4240    }
4241    for (int i = 0; i < element.getActivity().size(); i++) {
4242      composeCarePlanActivityComponent(t, "CarePlan", "activity", element.getActivity().get(i), i);
4243    }
4244    for (int i = 0; i < element.getNote().size(); i++) {
4245      composeAnnotation(t, "CarePlan", "note", element.getNote().get(i), i);
4246    }
4247  }
4248
4249  protected void composeCarePlanActivityComponent(Complex parent, String parentType, String name, CarePlan.CarePlanActivityComponent element, int index) {
4250    if (element == null) 
4251      return;
4252    Complex t;
4253    if (Utilities.noString(parentType))
4254      t = parent;
4255    else {
4256      t = parent.predicate("fhir:"+parentType+'.'+name);
4257    }
4258    composeBackboneElement(t, "activity", name, element, index);
4259    for (int i = 0; i < element.getPerformedActivity().size(); i++) {
4260      composeCodeableReference(t, "CarePlanActivityComponent", "performedActivity", element.getPerformedActivity().get(i), i);
4261    }
4262    for (int i = 0; i < element.getProgress().size(); i++) {
4263      composeAnnotation(t, "CarePlanActivityComponent", "progress", element.getProgress().get(i), i);
4264    }
4265    if (element.hasPlannedActivityReference()) {
4266      composeReference(t, "CarePlanActivityComponent", "plannedActivityReference", element.getPlannedActivityReference(), -1);
4267    }
4268    if (element.hasPlannedActivityDetail()) {
4269      composeCarePlanActivityPlannedActivityDetailComponent(t, "CarePlanActivityComponent", "plannedActivityDetail", element.getPlannedActivityDetail(), -1);
4270    }
4271  }
4272
4273  protected void composeCarePlanActivityPlannedActivityDetailComponent(Complex parent, String parentType, String name, CarePlan.CarePlanActivityPlannedActivityDetailComponent element, int index) {
4274    if (element == null) 
4275      return;
4276    Complex t;
4277    if (Utilities.noString(parentType))
4278      t = parent;
4279    else {
4280      t = parent.predicate("fhir:"+parentType+'.'+name);
4281    }
4282    composeBackboneElement(t, "plannedActivityDetail", name, element, index);
4283    if (element.hasKindElement()) {
4284      composeEnum(t, "CarePlanActivityPlannedActivityDetailComponent", "kind", element.getKindElement(), -1);
4285    }
4286    for (int i = 0; i < element.getInstantiatesCanonical().size(); i++) {
4287      composeCanonical(t, "CarePlanActivityPlannedActivityDetailComponent", "instantiatesCanonical", element.getInstantiatesCanonical().get(i), i);
4288    }
4289    for (int i = 0; i < element.getInstantiatesUri().size(); i++) {
4290      composeUri(t, "CarePlanActivityPlannedActivityDetailComponent", "instantiatesUri", element.getInstantiatesUri().get(i), i);
4291    }
4292    if (element.hasCode()) {
4293      composeCodeableConcept(t, "CarePlanActivityPlannedActivityDetailComponent", "code", element.getCode(), -1);
4294    }
4295    for (int i = 0; i < element.getReason().size(); i++) {
4296      composeCodeableReference(t, "CarePlanActivityPlannedActivityDetailComponent", "reason", element.getReason().get(i), i);
4297    }
4298    for (int i = 0; i < element.getGoal().size(); i++) {
4299      composeReference(t, "CarePlanActivityPlannedActivityDetailComponent", "goal", element.getGoal().get(i), i);
4300    }
4301    if (element.hasStatusElement()) {
4302      composeEnum(t, "CarePlanActivityPlannedActivityDetailComponent", "status", element.getStatusElement(), -1);
4303    }
4304    if (element.hasStatusReason()) {
4305      composeCodeableConcept(t, "CarePlanActivityPlannedActivityDetailComponent", "statusReason", element.getStatusReason(), -1);
4306    }
4307    if (element.hasDoNotPerformElement()) {
4308      composeBoolean(t, "CarePlanActivityPlannedActivityDetailComponent", "doNotPerform", element.getDoNotPerformElement(), -1);
4309    }
4310    if (element.hasScheduled()) {
4311      composeType(t, "CarePlanActivityPlannedActivityDetailComponent", "scheduled", element.getScheduled(), -1);
4312    }
4313    if (element.hasLocation()) {
4314      composeCodeableReference(t, "CarePlanActivityPlannedActivityDetailComponent", "location", element.getLocation(), -1);
4315    }
4316    if (element.hasReported()) {
4317      composeType(t, "CarePlanActivityPlannedActivityDetailComponent", "reported", element.getReported(), -1);
4318    }
4319    for (int i = 0; i < element.getPerformer().size(); i++) {
4320      composeReference(t, "CarePlanActivityPlannedActivityDetailComponent", "performer", element.getPerformer().get(i), i);
4321    }
4322    if (element.hasProduct()) {
4323      composeType(t, "CarePlanActivityPlannedActivityDetailComponent", "product", element.getProduct(), -1);
4324    }
4325    if (element.hasDailyAmount()) {
4326      composeQuantity(t, "CarePlanActivityPlannedActivityDetailComponent", "dailyAmount", element.getDailyAmount(), -1);
4327    }
4328    if (element.hasQuantity()) {
4329      composeQuantity(t, "CarePlanActivityPlannedActivityDetailComponent", "quantity", element.getQuantity(), -1);
4330    }
4331    if (element.hasDescriptionElement()) {
4332      composeString(t, "CarePlanActivityPlannedActivityDetailComponent", "description", element.getDescriptionElement(), -1);
4333    }
4334  }
4335
4336  protected void composeCareTeam(Complex parent, String parentType, String name, CareTeam element, int index) {
4337    if (element == null) 
4338      return;
4339    Complex t;
4340    if (Utilities.noString(parentType))
4341      t = parent;
4342    else {
4343      t = parent.predicate("fhir:"+parentType+'.'+name);
4344    }
4345    composeDomainResource(t, "CareTeam", name, element, index);
4346    for (int i = 0; i < element.getIdentifier().size(); i++) {
4347      composeIdentifier(t, "CareTeam", "identifier", element.getIdentifier().get(i), i);
4348    }
4349    if (element.hasStatusElement()) {
4350      composeEnum(t, "CareTeam", "status", element.getStatusElement(), -1);
4351    }
4352    for (int i = 0; i < element.getCategory().size(); i++) {
4353      composeCodeableConcept(t, "CareTeam", "category", element.getCategory().get(i), i);
4354    }
4355    if (element.hasNameElement()) {
4356      composeString(t, "CareTeam", "name", element.getNameElement(), -1);
4357    }
4358    if (element.hasSubject()) {
4359      composeReference(t, "CareTeam", "subject", element.getSubject(), -1);
4360    }
4361    if (element.hasPeriod()) {
4362      composePeriod(t, "CareTeam", "period", element.getPeriod(), -1);
4363    }
4364    for (int i = 0; i < element.getParticipant().size(); i++) {
4365      composeCareTeamParticipantComponent(t, "CareTeam", "participant", element.getParticipant().get(i), i);
4366    }
4367    for (int i = 0; i < element.getReason().size(); i++) {
4368      composeCodeableReference(t, "CareTeam", "reason", element.getReason().get(i), i);
4369    }
4370    for (int i = 0; i < element.getManagingOrganization().size(); i++) {
4371      composeReference(t, "CareTeam", "managingOrganization", element.getManagingOrganization().get(i), i);
4372    }
4373    for (int i = 0; i < element.getTelecom().size(); i++) {
4374      composeContactPoint(t, "CareTeam", "telecom", element.getTelecom().get(i), i);
4375    }
4376    for (int i = 0; i < element.getNote().size(); i++) {
4377      composeAnnotation(t, "CareTeam", "note", element.getNote().get(i), i);
4378    }
4379  }
4380
4381  protected void composeCareTeamParticipantComponent(Complex parent, String parentType, String name, CareTeam.CareTeamParticipantComponent element, int index) {
4382    if (element == null) 
4383      return;
4384    Complex t;
4385    if (Utilities.noString(parentType))
4386      t = parent;
4387    else {
4388      t = parent.predicate("fhir:"+parentType+'.'+name);
4389    }
4390    composeBackboneElement(t, "participant", name, element, index);
4391    if (element.hasRole()) {
4392      composeCodeableConcept(t, "CareTeamParticipantComponent", "role", element.getRole(), -1);
4393    }
4394    if (element.hasMember()) {
4395      composeReference(t, "CareTeamParticipantComponent", "member", element.getMember(), -1);
4396    }
4397    if (element.hasOnBehalfOf()) {
4398      composeReference(t, "CareTeamParticipantComponent", "onBehalfOf", element.getOnBehalfOf(), -1);
4399    }
4400    if (element.hasCoverage()) {
4401      composeType(t, "CareTeamParticipantComponent", "coverage", element.getCoverage(), -1);
4402    }
4403  }
4404
4405  protected void composeChargeItem(Complex parent, String parentType, String name, ChargeItem element, int index) {
4406    if (element == null) 
4407      return;
4408    Complex t;
4409    if (Utilities.noString(parentType))
4410      t = parent;
4411    else {
4412      t = parent.predicate("fhir:"+parentType+'.'+name);
4413    }
4414    composeDomainResource(t, "ChargeItem", name, element, index);
4415    for (int i = 0; i < element.getIdentifier().size(); i++) {
4416      composeIdentifier(t, "ChargeItem", "identifier", element.getIdentifier().get(i), i);
4417    }
4418    for (int i = 0; i < element.getDefinitionUri().size(); i++) {
4419      composeUri(t, "ChargeItem", "definitionUri", element.getDefinitionUri().get(i), i);
4420    }
4421    for (int i = 0; i < element.getDefinitionCanonical().size(); i++) {
4422      composeCanonical(t, "ChargeItem", "definitionCanonical", element.getDefinitionCanonical().get(i), i);
4423    }
4424    if (element.hasStatusElement()) {
4425      composeEnum(t, "ChargeItem", "status", element.getStatusElement(), -1);
4426    }
4427    for (int i = 0; i < element.getPartOf().size(); i++) {
4428      composeReference(t, "ChargeItem", "partOf", element.getPartOf().get(i), i);
4429    }
4430    if (element.hasCode()) {
4431      composeCodeableConcept(t, "ChargeItem", "code", element.getCode(), -1);
4432    }
4433    if (element.hasSubject()) {
4434      composeReference(t, "ChargeItem", "subject", element.getSubject(), -1);
4435    }
4436    if (element.hasEncounter()) {
4437      composeReference(t, "ChargeItem", "encounter", element.getEncounter(), -1);
4438    }
4439    if (element.hasOccurrence()) {
4440      composeType(t, "ChargeItem", "occurrence", element.getOccurrence(), -1);
4441    }
4442    for (int i = 0; i < element.getPerformer().size(); i++) {
4443      composeChargeItemPerformerComponent(t, "ChargeItem", "performer", element.getPerformer().get(i), i);
4444    }
4445    if (element.hasPerformingOrganization()) {
4446      composeReference(t, "ChargeItem", "performingOrganization", element.getPerformingOrganization(), -1);
4447    }
4448    if (element.hasRequestingOrganization()) {
4449      composeReference(t, "ChargeItem", "requestingOrganization", element.getRequestingOrganization(), -1);
4450    }
4451    if (element.hasCostCenter()) {
4452      composeReference(t, "ChargeItem", "costCenter", element.getCostCenter(), -1);
4453    }
4454    if (element.hasQuantity()) {
4455      composeQuantity(t, "ChargeItem", "quantity", element.getQuantity(), -1);
4456    }
4457    for (int i = 0; i < element.getBodysite().size(); i++) {
4458      composeCodeableConcept(t, "ChargeItem", "bodysite", element.getBodysite().get(i), i);
4459    }
4460    if (element.hasUnitPriceComponent()) {
4461      composeMonetaryComponent(t, "ChargeItem", "unitPriceComponent", element.getUnitPriceComponent(), -1);
4462    }
4463    if (element.hasTotalPriceComponent()) {
4464      composeMonetaryComponent(t, "ChargeItem", "totalPriceComponent", element.getTotalPriceComponent(), -1);
4465    }
4466    if (element.hasOverrideReason()) {
4467      composeCodeableConcept(t, "ChargeItem", "overrideReason", element.getOverrideReason(), -1);
4468    }
4469    if (element.hasEnterer()) {
4470      composeReference(t, "ChargeItem", "enterer", element.getEnterer(), -1);
4471    }
4472    if (element.hasEnteredDateElement()) {
4473      composeDateTime(t, "ChargeItem", "enteredDate", element.getEnteredDateElement(), -1);
4474    }
4475    for (int i = 0; i < element.getReason().size(); i++) {
4476      composeCodeableConcept(t, "ChargeItem", "reason", element.getReason().get(i), i);
4477    }
4478    for (int i = 0; i < element.getService().size(); i++) {
4479      composeCodeableReference(t, "ChargeItem", "service", element.getService().get(i), i);
4480    }
4481    for (int i = 0; i < element.getProduct().size(); i++) {
4482      composeCodeableReference(t, "ChargeItem", "product", element.getProduct().get(i), i);
4483    }
4484    for (int i = 0; i < element.getAccount().size(); i++) {
4485      composeReference(t, "ChargeItem", "account", element.getAccount().get(i), i);
4486    }
4487    for (int i = 0; i < element.getNote().size(); i++) {
4488      composeAnnotation(t, "ChargeItem", "note", element.getNote().get(i), i);
4489    }
4490    for (int i = 0; i < element.getSupportingInformation().size(); i++) {
4491      composeReference(t, "ChargeItem", "supportingInformation", element.getSupportingInformation().get(i), i);
4492    }
4493  }
4494
4495  protected void composeChargeItemPerformerComponent(Complex parent, String parentType, String name, ChargeItem.ChargeItemPerformerComponent element, int index) {
4496    if (element == null) 
4497      return;
4498    Complex t;
4499    if (Utilities.noString(parentType))
4500      t = parent;
4501    else {
4502      t = parent.predicate("fhir:"+parentType+'.'+name);
4503    }
4504    composeBackboneElement(t, "performer", name, element, index);
4505    if (element.hasFunction()) {
4506      composeCodeableConcept(t, "ChargeItemPerformerComponent", "function", element.getFunction(), -1);
4507    }
4508    if (element.hasActor()) {
4509      composeReference(t, "ChargeItemPerformerComponent", "actor", element.getActor(), -1);
4510    }
4511  }
4512
4513  protected void composeChargeItemDefinition(Complex parent, String parentType, String name, ChargeItemDefinition element, int index) {
4514    if (element == null) 
4515      return;
4516    Complex t;
4517    if (Utilities.noString(parentType))
4518      t = parent;
4519    else {
4520      t = parent.predicate("fhir:"+parentType+'.'+name);
4521    }
4522    composeMetadataResource(t, "ChargeItemDefinition", name, element, index);
4523    if (element.hasUrlElement()) {
4524      composeUri(t, "ChargeItemDefinition", "url", element.getUrlElement(), -1);
4525    }
4526    for (int i = 0; i < element.getIdentifier().size(); i++) {
4527      composeIdentifier(t, "ChargeItemDefinition", "identifier", element.getIdentifier().get(i), i);
4528    }
4529    if (element.hasVersionElement()) {
4530      composeString(t, "ChargeItemDefinition", "version", element.getVersionElement(), -1);
4531    }
4532    if (element.hasNameElement()) {
4533      composeString(t, "ChargeItemDefinition", "name", element.getNameElement(), -1);
4534    }
4535    if (element.hasTitleElement()) {
4536      composeString(t, "ChargeItemDefinition", "title", element.getTitleElement(), -1);
4537    }
4538    for (int i = 0; i < element.getDerivedFromUri().size(); i++) {
4539      composeUri(t, "ChargeItemDefinition", "derivedFromUri", element.getDerivedFromUri().get(i), i);
4540    }
4541    for (int i = 0; i < element.getPartOf().size(); i++) {
4542      composeCanonical(t, "ChargeItemDefinition", "partOf", element.getPartOf().get(i), i);
4543    }
4544    for (int i = 0; i < element.getReplaces().size(); i++) {
4545      composeCanonical(t, "ChargeItemDefinition", "replaces", element.getReplaces().get(i), i);
4546    }
4547    if (element.hasStatusElement()) {
4548      composeEnum(t, "ChargeItemDefinition", "status", element.getStatusElement(), -1);
4549    }
4550    if (element.hasExperimentalElement()) {
4551      composeBoolean(t, "ChargeItemDefinition", "experimental", element.getExperimentalElement(), -1);
4552    }
4553    if (element.hasDateElement()) {
4554      composeDateTime(t, "ChargeItemDefinition", "date", element.getDateElement(), -1);
4555    }
4556    if (element.hasPublisherElement()) {
4557      composeString(t, "ChargeItemDefinition", "publisher", element.getPublisherElement(), -1);
4558    }
4559    for (int i = 0; i < element.getContact().size(); i++) {
4560      composeContactDetail(t, "ChargeItemDefinition", "contact", element.getContact().get(i), i);
4561    }
4562    if (element.hasDescriptionElement()) {
4563      composeMarkdown(t, "ChargeItemDefinition", "description", element.getDescriptionElement(), -1);
4564    }
4565    for (int i = 0; i < element.getUseContext().size(); i++) {
4566      composeUsageContext(t, "ChargeItemDefinition", "useContext", element.getUseContext().get(i), i);
4567    }
4568    for (int i = 0; i < element.getJurisdiction().size(); i++) {
4569      composeCodeableConcept(t, "ChargeItemDefinition", "jurisdiction", element.getJurisdiction().get(i), i);
4570    }
4571    if (element.hasPurposeElement()) {
4572      composeMarkdown(t, "ChargeItemDefinition", "purpose", element.getPurposeElement(), -1);
4573    }
4574    if (element.hasCopyrightElement()) {
4575      composeMarkdown(t, "ChargeItemDefinition", "copyright", element.getCopyrightElement(), -1);
4576    }
4577    if (element.hasApprovalDateElement()) {
4578      composeDate(t, "ChargeItemDefinition", "approvalDate", element.getApprovalDateElement(), -1);
4579    }
4580    if (element.hasLastReviewDateElement()) {
4581      composeDate(t, "ChargeItemDefinition", "lastReviewDate", element.getLastReviewDateElement(), -1);
4582    }
4583    if (element.hasCode()) {
4584      composeCodeableConcept(t, "ChargeItemDefinition", "code", element.getCode(), -1);
4585    }
4586    for (int i = 0; i < element.getInstance().size(); i++) {
4587      composeReference(t, "ChargeItemDefinition", "instance", element.getInstance().get(i), i);
4588    }
4589    for (int i = 0; i < element.getApplicability().size(); i++) {
4590      composeChargeItemDefinitionApplicabilityComponent(t, "ChargeItemDefinition", "applicability", element.getApplicability().get(i), i);
4591    }
4592    for (int i = 0; i < element.getPropertyGroup().size(); i++) {
4593      composeChargeItemDefinitionPropertyGroupComponent(t, "ChargeItemDefinition", "propertyGroup", element.getPropertyGroup().get(i), i);
4594    }
4595  }
4596
4597  protected void composeChargeItemDefinitionApplicabilityComponent(Complex parent, String parentType, String name, ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent element, int index) {
4598    if (element == null) 
4599      return;
4600    Complex t;
4601    if (Utilities.noString(parentType))
4602      t = parent;
4603    else {
4604      t = parent.predicate("fhir:"+parentType+'.'+name);
4605    }
4606    composeBackboneElement(t, "applicability", name, element, index);
4607    if (element.hasCondition()) {
4608      composeExpression(t, "ChargeItemDefinitionApplicabilityComponent", "condition", element.getCondition(), -1);
4609    }
4610    if (element.hasEffectivePeriod()) {
4611      composePeriod(t, "ChargeItemDefinitionApplicabilityComponent", "effectivePeriod", element.getEffectivePeriod(), -1);
4612    }
4613    if (element.hasRelatedArtifact()) {
4614      composeRelatedArtifact(t, "ChargeItemDefinitionApplicabilityComponent", "relatedArtifact", element.getRelatedArtifact(), -1);
4615    }
4616  }
4617
4618  protected void composeChargeItemDefinitionPropertyGroupComponent(Complex parent, String parentType, String name, ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent element, int index) {
4619    if (element == null) 
4620      return;
4621    Complex t;
4622    if (Utilities.noString(parentType))
4623      t = parent;
4624    else {
4625      t = parent.predicate("fhir:"+parentType+'.'+name);
4626    }
4627    composeBackboneElement(t, "propertyGroup", name, element, index);
4628    for (int i = 0; i < element.getApplicability().size(); i++) {
4629      composeChargeItemDefinitionApplicabilityComponent(t, "ChargeItemDefinitionPropertyGroupComponent", "applicability", element.getApplicability().get(i), i);
4630    }
4631    for (int i = 0; i < element.getPriceComponent().size(); i++) {
4632      composeMonetaryComponent(t, "ChargeItemDefinitionPropertyGroupComponent", "priceComponent", element.getPriceComponent().get(i), i);
4633    }
4634  }
4635
4636  protected void composeCitation(Complex parent, String parentType, String name, Citation element, int index) {
4637    if (element == null) 
4638      return;
4639    Complex t;
4640    if (Utilities.noString(parentType))
4641      t = parent;
4642    else {
4643      t = parent.predicate("fhir:"+parentType+'.'+name);
4644    }
4645    composeMetadataResource(t, "Citation", name, element, index);
4646    if (element.hasUrlElement()) {
4647      composeUri(t, "Citation", "url", element.getUrlElement(), -1);
4648    }
4649    for (int i = 0; i < element.getIdentifier().size(); i++) {
4650      composeIdentifier(t, "Citation", "identifier", element.getIdentifier().get(i), i);
4651    }
4652    if (element.hasVersionElement()) {
4653      composeString(t, "Citation", "version", element.getVersionElement(), -1);
4654    }
4655    if (element.hasNameElement()) {
4656      composeString(t, "Citation", "name", element.getNameElement(), -1);
4657    }
4658    if (element.hasTitleElement()) {
4659      composeString(t, "Citation", "title", element.getTitleElement(), -1);
4660    }
4661    if (element.hasStatusElement()) {
4662      composeEnum(t, "Citation", "status", element.getStatusElement(), -1);
4663    }
4664    if (element.hasExperimentalElement()) {
4665      composeBoolean(t, "Citation", "experimental", element.getExperimentalElement(), -1);
4666    }
4667    if (element.hasDateElement()) {
4668      composeDateTime(t, "Citation", "date", element.getDateElement(), -1);
4669    }
4670    if (element.hasPublisherElement()) {
4671      composeString(t, "Citation", "publisher", element.getPublisherElement(), -1);
4672    }
4673    for (int i = 0; i < element.getContact().size(); i++) {
4674      composeContactDetail(t, "Citation", "contact", element.getContact().get(i), i);
4675    }
4676    if (element.hasDescriptionElement()) {
4677      composeMarkdown(t, "Citation", "description", element.getDescriptionElement(), -1);
4678    }
4679    for (int i = 0; i < element.getUseContext().size(); i++) {
4680      composeUsageContext(t, "Citation", "useContext", element.getUseContext().get(i), i);
4681    }
4682    for (int i = 0; i < element.getJurisdiction().size(); i++) {
4683      composeCodeableConcept(t, "Citation", "jurisdiction", element.getJurisdiction().get(i), i);
4684    }
4685    if (element.hasPurposeElement()) {
4686      composeMarkdown(t, "Citation", "purpose", element.getPurposeElement(), -1);
4687    }
4688    if (element.hasCopyrightElement()) {
4689      composeMarkdown(t, "Citation", "copyright", element.getCopyrightElement(), -1);
4690    }
4691    if (element.hasApprovalDateElement()) {
4692      composeDate(t, "Citation", "approvalDate", element.getApprovalDateElement(), -1);
4693    }
4694    if (element.hasLastReviewDateElement()) {
4695      composeDate(t, "Citation", "lastReviewDate", element.getLastReviewDateElement(), -1);
4696    }
4697    if (element.hasEffectivePeriod()) {
4698      composePeriod(t, "Citation", "effectivePeriod", element.getEffectivePeriod(), -1);
4699    }
4700    for (int i = 0; i < element.getAuthor().size(); i++) {
4701      composeContactDetail(t, "Citation", "author", element.getAuthor().get(i), i);
4702    }
4703    for (int i = 0; i < element.getEditor().size(); i++) {
4704      composeContactDetail(t, "Citation", "editor", element.getEditor().get(i), i);
4705    }
4706    for (int i = 0; i < element.getReviewer().size(); i++) {
4707      composeContactDetail(t, "Citation", "reviewer", element.getReviewer().get(i), i);
4708    }
4709    for (int i = 0; i < element.getEndorser().size(); i++) {
4710      composeContactDetail(t, "Citation", "endorser", element.getEndorser().get(i), i);
4711    }
4712    for (int i = 0; i < element.getSummary().size(); i++) {
4713      composeCitationSummaryComponent(t, "Citation", "summary", element.getSummary().get(i), i);
4714    }
4715    for (int i = 0; i < element.getClassification().size(); i++) {
4716      composeCitationClassificationComponent(t, "Citation", "classification", element.getClassification().get(i), i);
4717    }
4718    for (int i = 0; i < element.getNote().size(); i++) {
4719      composeAnnotation(t, "Citation", "note", element.getNote().get(i), i);
4720    }
4721    for (int i = 0; i < element.getCurrentState().size(); i++) {
4722      composeCodeableConcept(t, "Citation", "currentState", element.getCurrentState().get(i), i);
4723    }
4724    for (int i = 0; i < element.getStatusDate().size(); i++) {
4725      composeCitationStatusDateComponent(t, "Citation", "statusDate", element.getStatusDate().get(i), i);
4726    }
4727    for (int i = 0; i < element.getRelatedArtifact().size(); i++) {
4728      composeRelatedArtifact(t, "Citation", "relatedArtifact", element.getRelatedArtifact().get(i), i);
4729    }
4730    if (element.hasCitedArtifact()) {
4731      composeCitationCitedArtifactComponent(t, "Citation", "citedArtifact", element.getCitedArtifact(), -1);
4732    }
4733  }
4734
4735  protected void composeCitationSummaryComponent(Complex parent, String parentType, String name, Citation.CitationSummaryComponent element, int index) {
4736    if (element == null) 
4737      return;
4738    Complex t;
4739    if (Utilities.noString(parentType))
4740      t = parent;
4741    else {
4742      t = parent.predicate("fhir:"+parentType+'.'+name);
4743    }
4744    composeBackboneElement(t, "summary", name, element, index);
4745    if (element.hasStyle()) {
4746      composeCodeableConcept(t, "CitationSummaryComponent", "style", element.getStyle(), -1);
4747    }
4748    if (element.hasTextElement()) {
4749      composeMarkdown(t, "CitationSummaryComponent", "text", element.getTextElement(), -1);
4750    }
4751  }
4752
4753  protected void composeCitationClassificationComponent(Complex parent, String parentType, String name, Citation.CitationClassificationComponent element, int index) {
4754    if (element == null) 
4755      return;
4756    Complex t;
4757    if (Utilities.noString(parentType))
4758      t = parent;
4759    else {
4760      t = parent.predicate("fhir:"+parentType+'.'+name);
4761    }
4762    composeBackboneElement(t, "classification", name, element, index);
4763    if (element.hasType()) {
4764      composeCodeableConcept(t, "CitationClassificationComponent", "type", element.getType(), -1);
4765    }
4766    for (int i = 0; i < element.getClassifier().size(); i++) {
4767      composeCodeableConcept(t, "CitationClassificationComponent", "classifier", element.getClassifier().get(i), i);
4768    }
4769  }
4770
4771  protected void composeCitationStatusDateComponent(Complex parent, String parentType, String name, Citation.CitationStatusDateComponent element, int index) {
4772    if (element == null) 
4773      return;
4774    Complex t;
4775    if (Utilities.noString(parentType))
4776      t = parent;
4777    else {
4778      t = parent.predicate("fhir:"+parentType+'.'+name);
4779    }
4780    composeBackboneElement(t, "statusDate", name, element, index);
4781    if (element.hasActivity()) {
4782      composeCodeableConcept(t, "CitationStatusDateComponent", "activity", element.getActivity(), -1);
4783    }
4784    if (element.hasActualElement()) {
4785      composeBoolean(t, "CitationStatusDateComponent", "actual", element.getActualElement(), -1);
4786    }
4787    if (element.hasPeriod()) {
4788      composePeriod(t, "CitationStatusDateComponent", "period", element.getPeriod(), -1);
4789    }
4790  }
4791
4792  protected void composeCitationCitedArtifactComponent(Complex parent, String parentType, String name, Citation.CitationCitedArtifactComponent element, int index) {
4793    if (element == null) 
4794      return;
4795    Complex t;
4796    if (Utilities.noString(parentType))
4797      t = parent;
4798    else {
4799      t = parent.predicate("fhir:"+parentType+'.'+name);
4800    }
4801    composeBackboneElement(t, "citedArtifact", name, element, index);
4802    for (int i = 0; i < element.getIdentifier().size(); i++) {
4803      composeIdentifier(t, "CitationCitedArtifactComponent", "identifier", element.getIdentifier().get(i), i);
4804    }
4805    for (int i = 0; i < element.getRelatedIdentifier().size(); i++) {
4806      composeIdentifier(t, "CitationCitedArtifactComponent", "relatedIdentifier", element.getRelatedIdentifier().get(i), i);
4807    }
4808    if (element.hasDateAccessedElement()) {
4809      composeDateTime(t, "CitationCitedArtifactComponent", "dateAccessed", element.getDateAccessedElement(), -1);
4810    }
4811    if (element.hasVersion()) {
4812      composeCitationCitedArtifactVersionComponent(t, "CitationCitedArtifactComponent", "version", element.getVersion(), -1);
4813    }
4814    for (int i = 0; i < element.getCurrentState().size(); i++) {
4815      composeCodeableConcept(t, "CitationCitedArtifactComponent", "currentState", element.getCurrentState().get(i), i);
4816    }
4817    for (int i = 0; i < element.getStatusDate().size(); i++) {
4818      composeCitationCitedArtifactStatusDateComponent(t, "CitationCitedArtifactComponent", "statusDate", element.getStatusDate().get(i), i);
4819    }
4820    for (int i = 0; i < element.getTitle().size(); i++) {
4821      composeCitationCitedArtifactTitleComponent(t, "CitationCitedArtifactComponent", "title", element.getTitle().get(i), i);
4822    }
4823    for (int i = 0; i < element.getAbstract().size(); i++) {
4824      composeCitationCitedArtifactAbstractComponent(t, "CitationCitedArtifactComponent", "abstract", element.getAbstract().get(i), i);
4825    }
4826    if (element.hasPart()) {
4827      composeCitationCitedArtifactPartComponent(t, "CitationCitedArtifactComponent", "part", element.getPart(), -1);
4828    }
4829    for (int i = 0; i < element.getRelatesTo().size(); i++) {
4830      composeCitationCitedArtifactRelatesToComponent(t, "CitationCitedArtifactComponent", "relatesTo", element.getRelatesTo().get(i), i);
4831    }
4832    for (int i = 0; i < element.getPublicationForm().size(); i++) {
4833      composeCitationCitedArtifactPublicationFormComponent(t, "CitationCitedArtifactComponent", "publicationForm", element.getPublicationForm().get(i), i);
4834    }
4835    for (int i = 0; i < element.getWebLocation().size(); i++) {
4836      composeCitationCitedArtifactWebLocationComponent(t, "CitationCitedArtifactComponent", "webLocation", element.getWebLocation().get(i), i);
4837    }
4838    for (int i = 0; i < element.getClassification().size(); i++) {
4839      composeCitationCitedArtifactClassificationComponent(t, "CitationCitedArtifactComponent", "classification", element.getClassification().get(i), i);
4840    }
4841    if (element.hasContributorship()) {
4842      composeCitationCitedArtifactContributorshipComponent(t, "CitationCitedArtifactComponent", "contributorship", element.getContributorship(), -1);
4843    }
4844    for (int i = 0; i < element.getNote().size(); i++) {
4845      composeAnnotation(t, "CitationCitedArtifactComponent", "note", element.getNote().get(i), i);
4846    }
4847  }
4848
4849  protected void composeCitationCitedArtifactVersionComponent(Complex parent, String parentType, String name, Citation.CitationCitedArtifactVersionComponent element, int index) {
4850    if (element == null) 
4851      return;
4852    Complex t;
4853    if (Utilities.noString(parentType))
4854      t = parent;
4855    else {
4856      t = parent.predicate("fhir:"+parentType+'.'+name);
4857    }
4858    composeBackboneElement(t, "version", name, element, index);
4859    if (element.hasValueElement()) {
4860      composeString(t, "CitationCitedArtifactVersionComponent", "value", element.getValueElement(), -1);
4861    }
4862    if (element.hasBaseCitation()) {
4863      composeReference(t, "CitationCitedArtifactVersionComponent", "baseCitation", element.getBaseCitation(), -1);
4864    }
4865  }
4866
4867  protected void composeCitationCitedArtifactStatusDateComponent(Complex parent, String parentType, String name, Citation.CitationCitedArtifactStatusDateComponent element, int index) {
4868    if (element == null) 
4869      return;
4870    Complex t;
4871    if (Utilities.noString(parentType))
4872      t = parent;
4873    else {
4874      t = parent.predicate("fhir:"+parentType+'.'+name);
4875    }
4876    composeBackboneElement(t, "statusDate", name, element, index);
4877    if (element.hasActivity()) {
4878      composeCodeableConcept(t, "CitationCitedArtifactStatusDateComponent", "activity", element.getActivity(), -1);
4879    }
4880    if (element.hasActualElement()) {
4881      composeBoolean(t, "CitationCitedArtifactStatusDateComponent", "actual", element.getActualElement(), -1);
4882    }
4883    if (element.hasPeriod()) {
4884      composePeriod(t, "CitationCitedArtifactStatusDateComponent", "period", element.getPeriod(), -1);
4885    }
4886  }
4887
4888  protected void composeCitationCitedArtifactTitleComponent(Complex parent, String parentType, String name, Citation.CitationCitedArtifactTitleComponent element, int index) {
4889    if (element == null) 
4890      return;
4891    Complex t;
4892    if (Utilities.noString(parentType))
4893      t = parent;
4894    else {
4895      t = parent.predicate("fhir:"+parentType+'.'+name);
4896    }
4897    composeBackboneElement(t, "title", name, element, index);
4898    for (int i = 0; i < element.getType().size(); i++) {
4899      composeCodeableConcept(t, "CitationCitedArtifactTitleComponent", "type", element.getType().get(i), i);
4900    }
4901    if (element.hasLanguage()) {
4902      composeCodeableConcept(t, "CitationCitedArtifactTitleComponent", "language", element.getLanguage(), -1);
4903    }
4904    if (element.hasTextElement()) {
4905      composeMarkdown(t, "CitationCitedArtifactTitleComponent", "text", element.getTextElement(), -1);
4906    }
4907  }
4908
4909  protected void composeCitationCitedArtifactAbstractComponent(Complex parent, String parentType, String name, Citation.CitationCitedArtifactAbstractComponent element, int index) {
4910    if (element == null) 
4911      return;
4912    Complex t;
4913    if (Utilities.noString(parentType))
4914      t = parent;
4915    else {
4916      t = parent.predicate("fhir:"+parentType+'.'+name);
4917    }
4918    composeBackboneElement(t, "abstract", name, element, index);
4919    if (element.hasType()) {
4920      composeCodeableConcept(t, "CitationCitedArtifactAbstractComponent", "type", element.getType(), -1);
4921    }
4922    if (element.hasLanguage()) {
4923      composeCodeableConcept(t, "CitationCitedArtifactAbstractComponent", "language", element.getLanguage(), -1);
4924    }
4925    if (element.hasTextElement()) {
4926      composeMarkdown(t, "CitationCitedArtifactAbstractComponent", "text", element.getTextElement(), -1);
4927    }
4928    if (element.hasCopyrightElement()) {
4929      composeMarkdown(t, "CitationCitedArtifactAbstractComponent", "copyright", element.getCopyrightElement(), -1);
4930    }
4931  }
4932
4933  protected void composeCitationCitedArtifactPartComponent(Complex parent, String parentType, String name, Citation.CitationCitedArtifactPartComponent element, int index) {
4934    if (element == null) 
4935      return;
4936    Complex t;
4937    if (Utilities.noString(parentType))
4938      t = parent;
4939    else {
4940      t = parent.predicate("fhir:"+parentType+'.'+name);
4941    }
4942    composeBackboneElement(t, "part", name, element, index);
4943    if (element.hasType()) {
4944      composeCodeableConcept(t, "CitationCitedArtifactPartComponent", "type", element.getType(), -1);
4945    }
4946    if (element.hasValueElement()) {
4947      composeString(t, "CitationCitedArtifactPartComponent", "value", element.getValueElement(), -1);
4948    }
4949    if (element.hasBaseCitation()) {
4950      composeReference(t, "CitationCitedArtifactPartComponent", "baseCitation", element.getBaseCitation(), -1);
4951    }
4952  }
4953
4954  protected void composeCitationCitedArtifactRelatesToComponent(Complex parent, String parentType, String name, Citation.CitationCitedArtifactRelatesToComponent element, int index) {
4955    if (element == null) 
4956      return;
4957    Complex t;
4958    if (Utilities.noString(parentType))
4959      t = parent;
4960    else {
4961      t = parent.predicate("fhir:"+parentType+'.'+name);
4962    }
4963    composeBackboneElement(t, "relatesTo", name, element, index);
4964    if (element.hasTypeElement()) {
4965      composeEnum(t, "CitationCitedArtifactRelatesToComponent", "type", element.getTypeElement(), -1);
4966    }
4967    for (int i = 0; i < element.getClassifier().size(); i++) {
4968      composeCodeableConcept(t, "CitationCitedArtifactRelatesToComponent", "classifier", element.getClassifier().get(i), i);
4969    }
4970    if (element.hasLabelElement()) {
4971      composeString(t, "CitationCitedArtifactRelatesToComponent", "label", element.getLabelElement(), -1);
4972    }
4973    if (element.hasDisplayElement()) {
4974      composeString(t, "CitationCitedArtifactRelatesToComponent", "display", element.getDisplayElement(), -1);
4975    }
4976    if (element.hasCitationElement()) {
4977      composeMarkdown(t, "CitationCitedArtifactRelatesToComponent", "citation", element.getCitationElement(), -1);
4978    }
4979    if (element.hasDocument()) {
4980      composeAttachment(t, "CitationCitedArtifactRelatesToComponent", "document", element.getDocument(), -1);
4981    }
4982    if (element.hasResourceElement()) {
4983      composeCanonical(t, "CitationCitedArtifactRelatesToComponent", "resource", element.getResourceElement(), -1);
4984    }
4985    if (element.hasResourceReference()) {
4986      composeReference(t, "CitationCitedArtifactRelatesToComponent", "resourceReference", element.getResourceReference(), -1);
4987    }
4988  }
4989
4990  protected void composeCitationCitedArtifactPublicationFormComponent(Complex parent, String parentType, String name, Citation.CitationCitedArtifactPublicationFormComponent element, int index) {
4991    if (element == null) 
4992      return;
4993    Complex t;
4994    if (Utilities.noString(parentType))
4995      t = parent;
4996    else {
4997      t = parent.predicate("fhir:"+parentType+'.'+name);
4998    }
4999    composeBackboneElement(t, "publicationForm", name, element, index);
5000    if (element.hasPublishedIn()) {
5001      composeCitationCitedArtifactPublicationFormPublishedInComponent(t, "CitationCitedArtifactPublicationFormComponent", "publishedIn", element.getPublishedIn(), -1);
5002    }
5003    if (element.hasCitedMedium()) {
5004      composeCodeableConcept(t, "CitationCitedArtifactPublicationFormComponent", "citedMedium", element.getCitedMedium(), -1);
5005    }
5006    if (element.hasVolumeElement()) {
5007      composeString(t, "CitationCitedArtifactPublicationFormComponent", "volume", element.getVolumeElement(), -1);
5008    }
5009    if (element.hasIssueElement()) {
5010      composeString(t, "CitationCitedArtifactPublicationFormComponent", "issue", element.getIssueElement(), -1);
5011    }
5012    if (element.hasPublicationDateYearElement()) {
5013      composeString(t, "CitationCitedArtifactPublicationFormComponent", "publicationDateYear", element.getPublicationDateYearElement(), -1);
5014    }
5015    if (element.hasPublicationDateMonthElement()) {
5016      composeString(t, "CitationCitedArtifactPublicationFormComponent", "publicationDateMonth", element.getPublicationDateMonthElement(), -1);
5017    }
5018    if (element.hasPublicationDateDayElement()) {
5019      composeString(t, "CitationCitedArtifactPublicationFormComponent", "publicationDateDay", element.getPublicationDateDayElement(), -1);
5020    }
5021    if (element.hasPublicationDateSeasonElement()) {
5022      composeString(t, "CitationCitedArtifactPublicationFormComponent", "publicationDateSeason", element.getPublicationDateSeasonElement(), -1);
5023    }
5024    if (element.hasPublicationDateTextElement()) {
5025      composeString(t, "CitationCitedArtifactPublicationFormComponent", "publicationDateText", element.getPublicationDateTextElement(), -1);
5026    }
5027    if (element.hasArticleDateElement()) {
5028      composeDateTime(t, "CitationCitedArtifactPublicationFormComponent", "articleDate", element.getArticleDateElement(), -1);
5029    }
5030    if (element.hasLastRevisionDateElement()) {
5031      composeDateTime(t, "CitationCitedArtifactPublicationFormComponent", "lastRevisionDate", element.getLastRevisionDateElement(), -1);
5032    }
5033    for (int i = 0; i < element.getLanguage().size(); i++) {
5034      composeCodeableConcept(t, "CitationCitedArtifactPublicationFormComponent", "language", element.getLanguage().get(i), i);
5035    }
5036    if (element.hasAccessionNumberElement()) {
5037      composeString(t, "CitationCitedArtifactPublicationFormComponent", "accessionNumber", element.getAccessionNumberElement(), -1);
5038    }
5039    if (element.hasPageStringElement()) {
5040      composeString(t, "CitationCitedArtifactPublicationFormComponent", "pageString", element.getPageStringElement(), -1);
5041    }
5042    if (element.hasFirstPageElement()) {
5043      composeString(t, "CitationCitedArtifactPublicationFormComponent", "firstPage", element.getFirstPageElement(), -1);
5044    }
5045    if (element.hasLastPageElement()) {
5046      composeString(t, "CitationCitedArtifactPublicationFormComponent", "lastPage", element.getLastPageElement(), -1);
5047    }
5048    if (element.hasPageCountElement()) {
5049      composeString(t, "CitationCitedArtifactPublicationFormComponent", "pageCount", element.getPageCountElement(), -1);
5050    }
5051    if (element.hasCopyrightElement()) {
5052      composeMarkdown(t, "CitationCitedArtifactPublicationFormComponent", "copyright", element.getCopyrightElement(), -1);
5053    }
5054  }
5055
5056  protected void composeCitationCitedArtifactPublicationFormPublishedInComponent(Complex parent, String parentType, String name, Citation.CitationCitedArtifactPublicationFormPublishedInComponent element, int index) {
5057    if (element == null) 
5058      return;
5059    Complex t;
5060    if (Utilities.noString(parentType))
5061      t = parent;
5062    else {
5063      t = parent.predicate("fhir:"+parentType+'.'+name);
5064    }
5065    composeBackboneElement(t, "publishedIn", name, element, index);
5066    if (element.hasType()) {
5067      composeCodeableConcept(t, "CitationCitedArtifactPublicationFormPublishedInComponent", "type", element.getType(), -1);
5068    }
5069    for (int i = 0; i < element.getIdentifier().size(); i++) {
5070      composeIdentifier(t, "CitationCitedArtifactPublicationFormPublishedInComponent", "identifier", element.getIdentifier().get(i), i);
5071    }
5072    if (element.hasTitleElement()) {
5073      composeString(t, "CitationCitedArtifactPublicationFormPublishedInComponent", "title", element.getTitleElement(), -1);
5074    }
5075    if (element.hasPublisher()) {
5076      composeReference(t, "CitationCitedArtifactPublicationFormPublishedInComponent", "publisher", element.getPublisher(), -1);
5077    }
5078    if (element.hasPublisherLocationElement()) {
5079      composeString(t, "CitationCitedArtifactPublicationFormPublishedInComponent", "publisherLocation", element.getPublisherLocationElement(), -1);
5080    }
5081  }
5082
5083  protected void composeCitationCitedArtifactWebLocationComponent(Complex parent, String parentType, String name, Citation.CitationCitedArtifactWebLocationComponent element, int index) {
5084    if (element == null) 
5085      return;
5086    Complex t;
5087    if (Utilities.noString(parentType))
5088      t = parent;
5089    else {
5090      t = parent.predicate("fhir:"+parentType+'.'+name);
5091    }
5092    composeBackboneElement(t, "webLocation", name, element, index);
5093    for (int i = 0; i < element.getClassifier().size(); i++) {
5094      composeCodeableConcept(t, "CitationCitedArtifactWebLocationComponent", "classifier", element.getClassifier().get(i), i);
5095    }
5096    if (element.hasUrlElement()) {
5097      composeUri(t, "CitationCitedArtifactWebLocationComponent", "url", element.getUrlElement(), -1);
5098    }
5099  }
5100
5101  protected void composeCitationCitedArtifactClassificationComponent(Complex parent, String parentType, String name, Citation.CitationCitedArtifactClassificationComponent element, int index) {
5102    if (element == null) 
5103      return;
5104    Complex t;
5105    if (Utilities.noString(parentType))
5106      t = parent;
5107    else {
5108      t = parent.predicate("fhir:"+parentType+'.'+name);
5109    }
5110    composeBackboneElement(t, "classification", name, element, index);
5111    if (element.hasType()) {
5112      composeCodeableConcept(t, "CitationCitedArtifactClassificationComponent", "type", element.getType(), -1);
5113    }
5114    for (int i = 0; i < element.getClassifier().size(); i++) {
5115      composeCodeableConcept(t, "CitationCitedArtifactClassificationComponent", "classifier", element.getClassifier().get(i), i);
5116    }
5117    for (int i = 0; i < element.getArtifactAssessment().size(); i++) {
5118      composeReference(t, "CitationCitedArtifactClassificationComponent", "artifactAssessment", element.getArtifactAssessment().get(i), i);
5119    }
5120  }
5121
5122  protected void composeCitationCitedArtifactContributorshipComponent(Complex parent, String parentType, String name, Citation.CitationCitedArtifactContributorshipComponent element, int index) {
5123    if (element == null) 
5124      return;
5125    Complex t;
5126    if (Utilities.noString(parentType))
5127      t = parent;
5128    else {
5129      t = parent.predicate("fhir:"+parentType+'.'+name);
5130    }
5131    composeBackboneElement(t, "contributorship", name, element, index);
5132    if (element.hasCompleteElement()) {
5133      composeBoolean(t, "CitationCitedArtifactContributorshipComponent", "complete", element.getCompleteElement(), -1);
5134    }
5135    for (int i = 0; i < element.getEntry().size(); i++) {
5136      composeCitationCitedArtifactContributorshipEntryComponent(t, "CitationCitedArtifactContributorshipComponent", "entry", element.getEntry().get(i), i);
5137    }
5138    for (int i = 0; i < element.getSummary().size(); i++) {
5139      composeCitationContributorshipSummaryComponent(t, "CitationCitedArtifactContributorshipComponent", "summary", element.getSummary().get(i), i);
5140    }
5141  }
5142
5143  protected void composeCitationCitedArtifactContributorshipEntryComponent(Complex parent, String parentType, String name, Citation.CitationCitedArtifactContributorshipEntryComponent element, int index) {
5144    if (element == null) 
5145      return;
5146    Complex t;
5147    if (Utilities.noString(parentType))
5148      t = parent;
5149    else {
5150      t = parent.predicate("fhir:"+parentType+'.'+name);
5151    }
5152    composeBackboneElement(t, "entry", name, element, index);
5153    if (element.hasContributor()) {
5154      composeReference(t, "CitationCitedArtifactContributorshipEntryComponent", "contributor", element.getContributor(), -1);
5155    }
5156    if (element.hasForenameInitialsElement()) {
5157      composeString(t, "CitationCitedArtifactContributorshipEntryComponent", "forenameInitials", element.getForenameInitialsElement(), -1);
5158    }
5159    for (int i = 0; i < element.getAffiliation().size(); i++) {
5160      composeReference(t, "CitationCitedArtifactContributorshipEntryComponent", "affiliation", element.getAffiliation().get(i), i);
5161    }
5162    for (int i = 0; i < element.getContributionType().size(); i++) {
5163      composeCodeableConcept(t, "CitationCitedArtifactContributorshipEntryComponent", "contributionType", element.getContributionType().get(i), i);
5164    }
5165    if (element.hasRole()) {
5166      composeCodeableConcept(t, "CitationCitedArtifactContributorshipEntryComponent", "role", element.getRole(), -1);
5167    }
5168    for (int i = 0; i < element.getContributionInstance().size(); i++) {
5169      composeCitationCitedArtifactContributorshipEntryContributionInstanceComponent(t, "CitationCitedArtifactContributorshipEntryComponent", "contributionInstance", element.getContributionInstance().get(i), i);
5170    }
5171    if (element.hasCorrespondingContactElement()) {
5172      composeBoolean(t, "CitationCitedArtifactContributorshipEntryComponent", "correspondingContact", element.getCorrespondingContactElement(), -1);
5173    }
5174    if (element.hasRankingOrderElement()) {
5175      composePositiveInt(t, "CitationCitedArtifactContributorshipEntryComponent", "rankingOrder", element.getRankingOrderElement(), -1);
5176    }
5177  }
5178
5179  protected void composeCitationCitedArtifactContributorshipEntryContributionInstanceComponent(Complex parent, String parentType, String name, Citation.CitationCitedArtifactContributorshipEntryContributionInstanceComponent element, int index) {
5180    if (element == null) 
5181      return;
5182    Complex t;
5183    if (Utilities.noString(parentType))
5184      t = parent;
5185    else {
5186      t = parent.predicate("fhir:"+parentType+'.'+name);
5187    }
5188    composeBackboneElement(t, "contributionInstance", name, element, index);
5189    if (element.hasType()) {
5190      composeCodeableConcept(t, "CitationCitedArtifactContributorshipEntryContributionInstanceComponent", "type", element.getType(), -1);
5191    }
5192    if (element.hasTimeElement()) {
5193      composeDateTime(t, "CitationCitedArtifactContributorshipEntryContributionInstanceComponent", "time", element.getTimeElement(), -1);
5194    }
5195  }
5196
5197  protected void composeCitationContributorshipSummaryComponent(Complex parent, String parentType, String name, Citation.ContributorshipSummaryComponent element, int index) {
5198    if (element == null) 
5199      return;
5200    Complex t;
5201    if (Utilities.noString(parentType))
5202      t = parent;
5203    else {
5204      t = parent.predicate("fhir:"+parentType+'.'+name);
5205    }
5206    composeBackboneElement(t, "summary", name, element, index);
5207    if (element.hasType()) {
5208      composeCodeableConcept(t, "ContributorshipSummaryComponent", "type", element.getType(), -1);
5209    }
5210    if (element.hasStyle()) {
5211      composeCodeableConcept(t, "ContributorshipSummaryComponent", "style", element.getStyle(), -1);
5212    }
5213    if (element.hasSource()) {
5214      composeCodeableConcept(t, "ContributorshipSummaryComponent", "source", element.getSource(), -1);
5215    }
5216    if (element.hasValueElement()) {
5217      composeMarkdown(t, "ContributorshipSummaryComponent", "value", element.getValueElement(), -1);
5218    }
5219  }
5220
5221  protected void composeClaim(Complex parent, String parentType, String name, Claim element, int index) {
5222    if (element == null) 
5223      return;
5224    Complex t;
5225    if (Utilities.noString(parentType))
5226      t = parent;
5227    else {
5228      t = parent.predicate("fhir:"+parentType+'.'+name);
5229    }
5230    composeDomainResource(t, "Claim", name, element, index);
5231    for (int i = 0; i < element.getIdentifier().size(); i++) {
5232      composeIdentifier(t, "Claim", "identifier", element.getIdentifier().get(i), i);
5233    }
5234    if (element.hasStatusElement()) {
5235      composeEnum(t, "Claim", "status", element.getStatusElement(), -1);
5236    }
5237    if (element.hasType()) {
5238      composeCodeableConcept(t, "Claim", "type", element.getType(), -1);
5239    }
5240    if (element.hasSubType()) {
5241      composeCodeableConcept(t, "Claim", "subType", element.getSubType(), -1);
5242    }
5243    if (element.hasUseElement()) {
5244      composeEnum(t, "Claim", "use", element.getUseElement(), -1);
5245    }
5246    if (element.hasPatient()) {
5247      composeReference(t, "Claim", "patient", element.getPatient(), -1);
5248    }
5249    if (element.hasBillablePeriod()) {
5250      composePeriod(t, "Claim", "billablePeriod", element.getBillablePeriod(), -1);
5251    }
5252    if (element.hasCreatedElement()) {
5253      composeDateTime(t, "Claim", "created", element.getCreatedElement(), -1);
5254    }
5255    if (element.hasEnterer()) {
5256      composeReference(t, "Claim", "enterer", element.getEnterer(), -1);
5257    }
5258    if (element.hasInsurer()) {
5259      composeReference(t, "Claim", "insurer", element.getInsurer(), -1);
5260    }
5261    if (element.hasProvider()) {
5262      composeReference(t, "Claim", "provider", element.getProvider(), -1);
5263    }
5264    if (element.hasPriority()) {
5265      composeCodeableConcept(t, "Claim", "priority", element.getPriority(), -1);
5266    }
5267    if (element.hasFundsReserve()) {
5268      composeCodeableConcept(t, "Claim", "fundsReserve", element.getFundsReserve(), -1);
5269    }
5270    for (int i = 0; i < element.getRelated().size(); i++) {
5271      composeClaimRelatedClaimComponent(t, "Claim", "related", element.getRelated().get(i), i);
5272    }
5273    if (element.hasPrescription()) {
5274      composeReference(t, "Claim", "prescription", element.getPrescription(), -1);
5275    }
5276    if (element.hasOriginalPrescription()) {
5277      composeReference(t, "Claim", "originalPrescription", element.getOriginalPrescription(), -1);
5278    }
5279    if (element.hasPayee()) {
5280      composeClaimPayeeComponent(t, "Claim", "payee", element.getPayee(), -1);
5281    }
5282    if (element.hasReferral()) {
5283      composeReference(t, "Claim", "referral", element.getReferral(), -1);
5284    }
5285    for (int i = 0; i < element.getEncounter().size(); i++) {
5286      composeReference(t, "Claim", "encounter", element.getEncounter().get(i), i);
5287    }
5288    if (element.hasFacility()) {
5289      composeReference(t, "Claim", "facility", element.getFacility(), -1);
5290    }
5291    if (element.hasDiagnosisRelatedGroup()) {
5292      composeCodeableConcept(t, "Claim", "diagnosisRelatedGroup", element.getDiagnosisRelatedGroup(), -1);
5293    }
5294    for (int i = 0; i < element.getCareTeam().size(); i++) {
5295      composeClaimCareTeamComponent(t, "Claim", "careTeam", element.getCareTeam().get(i), i);
5296    }
5297    for (int i = 0; i < element.getSupportingInfo().size(); i++) {
5298      composeClaimSupportingInformationComponent(t, "Claim", "supportingInfo", element.getSupportingInfo().get(i), i);
5299    }
5300    for (int i = 0; i < element.getDiagnosis().size(); i++) {
5301      composeClaimDiagnosisComponent(t, "Claim", "diagnosis", element.getDiagnosis().get(i), i);
5302    }
5303    for (int i = 0; i < element.getProcedure().size(); i++) {
5304      composeClaimProcedureComponent(t, "Claim", "procedure", element.getProcedure().get(i), i);
5305    }
5306    for (int i = 0; i < element.getInsurance().size(); i++) {
5307      composeClaimInsuranceComponent(t, "Claim", "insurance", element.getInsurance().get(i), i);
5308    }
5309    if (element.hasAccident()) {
5310      composeClaimAccidentComponent(t, "Claim", "accident", element.getAccident(), -1);
5311    }
5312    if (element.hasPatientPaid()) {
5313      composeMoney(t, "Claim", "patientPaid", element.getPatientPaid(), -1);
5314    }
5315    for (int i = 0; i < element.getItem().size(); i++) {
5316      composeClaimItemComponent(t, "Claim", "item", element.getItem().get(i), i);
5317    }
5318    if (element.hasTotal()) {
5319      composeMoney(t, "Claim", "total", element.getTotal(), -1);
5320    }
5321  }
5322
5323  protected void composeClaimRelatedClaimComponent(Complex parent, String parentType, String name, Claim.RelatedClaimComponent element, int index) {
5324    if (element == null) 
5325      return;
5326    Complex t;
5327    if (Utilities.noString(parentType))
5328      t = parent;
5329    else {
5330      t = parent.predicate("fhir:"+parentType+'.'+name);
5331    }
5332    composeBackboneElement(t, "related", name, element, index);
5333    if (element.hasClaim()) {
5334      composeReference(t, "RelatedClaimComponent", "claim", element.getClaim(), -1);
5335    }
5336    if (element.hasRelationship()) {
5337      composeCodeableConcept(t, "RelatedClaimComponent", "relationship", element.getRelationship(), -1);
5338    }
5339    if (element.hasReference()) {
5340      composeIdentifier(t, "RelatedClaimComponent", "reference", element.getReference(), -1);
5341    }
5342  }
5343
5344  protected void composeClaimPayeeComponent(Complex parent, String parentType, String name, Claim.PayeeComponent element, int index) {
5345    if (element == null) 
5346      return;
5347    Complex t;
5348    if (Utilities.noString(parentType))
5349      t = parent;
5350    else {
5351      t = parent.predicate("fhir:"+parentType+'.'+name);
5352    }
5353    composeBackboneElement(t, "payee", name, element, index);
5354    if (element.hasType()) {
5355      composeCodeableConcept(t, "PayeeComponent", "type", element.getType(), -1);
5356    }
5357    if (element.hasParty()) {
5358      composeReference(t, "PayeeComponent", "party", element.getParty(), -1);
5359    }
5360  }
5361
5362  protected void composeClaimCareTeamComponent(Complex parent, String parentType, String name, Claim.CareTeamComponent element, int index) {
5363    if (element == null) 
5364      return;
5365    Complex t;
5366    if (Utilities.noString(parentType))
5367      t = parent;
5368    else {
5369      t = parent.predicate("fhir:"+parentType+'.'+name);
5370    }
5371    composeBackboneElement(t, "careTeam", name, element, index);
5372    if (element.hasSequenceElement()) {
5373      composePositiveInt(t, "CareTeamComponent", "sequence", element.getSequenceElement(), -1);
5374    }
5375    if (element.hasProvider()) {
5376      composeReference(t, "CareTeamComponent", "provider", element.getProvider(), -1);
5377    }
5378    if (element.hasResponsibleElement()) {
5379      composeBoolean(t, "CareTeamComponent", "responsible", element.getResponsibleElement(), -1);
5380    }
5381    if (element.hasRole()) {
5382      composeCodeableConcept(t, "CareTeamComponent", "role", element.getRole(), -1);
5383    }
5384    if (element.hasSpecialty()) {
5385      composeCodeableConcept(t, "CareTeamComponent", "specialty", element.getSpecialty(), -1);
5386    }
5387  }
5388
5389  protected void composeClaimSupportingInformationComponent(Complex parent, String parentType, String name, Claim.SupportingInformationComponent element, int index) {
5390    if (element == null) 
5391      return;
5392    Complex t;
5393    if (Utilities.noString(parentType))
5394      t = parent;
5395    else {
5396      t = parent.predicate("fhir:"+parentType+'.'+name);
5397    }
5398    composeBackboneElement(t, "supportingInfo", name, element, index);
5399    if (element.hasSequenceElement()) {
5400      composePositiveInt(t, "SupportingInformationComponent", "sequence", element.getSequenceElement(), -1);
5401    }
5402    if (element.hasCategory()) {
5403      composeCodeableConcept(t, "SupportingInformationComponent", "category", element.getCategory(), -1);
5404    }
5405    if (element.hasCode()) {
5406      composeCodeableConcept(t, "SupportingInformationComponent", "code", element.getCode(), -1);
5407    }
5408    if (element.hasTiming()) {
5409      composeType(t, "SupportingInformationComponent", "timing", element.getTiming(), -1);
5410    }
5411    if (element.hasValue()) {
5412      composeType(t, "SupportingInformationComponent", "value", element.getValue(), -1);
5413    }
5414    if (element.hasReason()) {
5415      composeCodeableConcept(t, "SupportingInformationComponent", "reason", element.getReason(), -1);
5416    }
5417  }
5418
5419  protected void composeClaimDiagnosisComponent(Complex parent, String parentType, String name, Claim.DiagnosisComponent element, int index) {
5420    if (element == null) 
5421      return;
5422    Complex t;
5423    if (Utilities.noString(parentType))
5424      t = parent;
5425    else {
5426      t = parent.predicate("fhir:"+parentType+'.'+name);
5427    }
5428    composeBackboneElement(t, "diagnosis", name, element, index);
5429    if (element.hasSequenceElement()) {
5430      composePositiveInt(t, "DiagnosisComponent", "sequence", element.getSequenceElement(), -1);
5431    }
5432    if (element.hasDiagnosis()) {
5433      composeType(t, "DiagnosisComponent", "diagnosis", element.getDiagnosis(), -1);
5434    }
5435    for (int i = 0; i < element.getType().size(); i++) {
5436      composeCodeableConcept(t, "DiagnosisComponent", "type", element.getType().get(i), i);
5437    }
5438    if (element.hasOnAdmission()) {
5439      composeCodeableConcept(t, "DiagnosisComponent", "onAdmission", element.getOnAdmission(), -1);
5440    }
5441  }
5442
5443  protected void composeClaimProcedureComponent(Complex parent, String parentType, String name, Claim.ProcedureComponent element, int index) {
5444    if (element == null) 
5445      return;
5446    Complex t;
5447    if (Utilities.noString(parentType))
5448      t = parent;
5449    else {
5450      t = parent.predicate("fhir:"+parentType+'.'+name);
5451    }
5452    composeBackboneElement(t, "procedure", name, element, index);
5453    if (element.hasSequenceElement()) {
5454      composePositiveInt(t, "ProcedureComponent", "sequence", element.getSequenceElement(), -1);
5455    }
5456    for (int i = 0; i < element.getType().size(); i++) {
5457      composeCodeableConcept(t, "ProcedureComponent", "type", element.getType().get(i), i);
5458    }
5459    if (element.hasDateElement()) {
5460      composeDateTime(t, "ProcedureComponent", "date", element.getDateElement(), -1);
5461    }
5462    if (element.hasProcedure()) {
5463      composeType(t, "ProcedureComponent", "procedure", element.getProcedure(), -1);
5464    }
5465    for (int i = 0; i < element.getUdi().size(); i++) {
5466      composeReference(t, "ProcedureComponent", "udi", element.getUdi().get(i), i);
5467    }
5468  }
5469
5470  protected void composeClaimInsuranceComponent(Complex parent, String parentType, String name, Claim.InsuranceComponent element, int index) {
5471    if (element == null) 
5472      return;
5473    Complex t;
5474    if (Utilities.noString(parentType))
5475      t = parent;
5476    else {
5477      t = parent.predicate("fhir:"+parentType+'.'+name);
5478    }
5479    composeBackboneElement(t, "insurance", name, element, index);
5480    if (element.hasSequenceElement()) {
5481      composePositiveInt(t, "InsuranceComponent", "sequence", element.getSequenceElement(), -1);
5482    }
5483    if (element.hasFocalElement()) {
5484      composeBoolean(t, "InsuranceComponent", "focal", element.getFocalElement(), -1);
5485    }
5486    if (element.hasIdentifier()) {
5487      composeIdentifier(t, "InsuranceComponent", "identifier", element.getIdentifier(), -1);
5488    }
5489    if (element.hasCoverage()) {
5490      composeReference(t, "InsuranceComponent", "coverage", element.getCoverage(), -1);
5491    }
5492    if (element.hasBusinessArrangementElement()) {
5493      composeString(t, "InsuranceComponent", "businessArrangement", element.getBusinessArrangementElement(), -1);
5494    }
5495    for (int i = 0; i < element.getPreAuthRef().size(); i++) {
5496      composeString(t, "InsuranceComponent", "preAuthRef", element.getPreAuthRef().get(i), i);
5497    }
5498    if (element.hasClaimResponse()) {
5499      composeReference(t, "InsuranceComponent", "claimResponse", element.getClaimResponse(), -1);
5500    }
5501  }
5502
5503  protected void composeClaimAccidentComponent(Complex parent, String parentType, String name, Claim.AccidentComponent element, int index) {
5504    if (element == null) 
5505      return;
5506    Complex t;
5507    if (Utilities.noString(parentType))
5508      t = parent;
5509    else {
5510      t = parent.predicate("fhir:"+parentType+'.'+name);
5511    }
5512    composeBackboneElement(t, "accident", name, element, index);
5513    if (element.hasDateElement()) {
5514      composeDate(t, "AccidentComponent", "date", element.getDateElement(), -1);
5515    }
5516    if (element.hasType()) {
5517      composeCodeableConcept(t, "AccidentComponent", "type", element.getType(), -1);
5518    }
5519    if (element.hasLocation()) {
5520      composeType(t, "AccidentComponent", "location", element.getLocation(), -1);
5521    }
5522  }
5523
5524  protected void composeClaimItemComponent(Complex parent, String parentType, String name, Claim.ItemComponent element, int index) {
5525    if (element == null) 
5526      return;
5527    Complex t;
5528    if (Utilities.noString(parentType))
5529      t = parent;
5530    else {
5531      t = parent.predicate("fhir:"+parentType+'.'+name);
5532    }
5533    composeBackboneElement(t, "item", name, element, index);
5534    if (element.hasSequenceElement()) {
5535      composePositiveInt(t, "ItemComponent", "sequence", element.getSequenceElement(), -1);
5536    }
5537    for (int i = 0; i < element.getCareTeamSequence().size(); i++) {
5538      composePositiveInt(t, "ItemComponent", "careTeamSequence", element.getCareTeamSequence().get(i), i);
5539    }
5540    for (int i = 0; i < element.getDiagnosisSequence().size(); i++) {
5541      composePositiveInt(t, "ItemComponent", "diagnosisSequence", element.getDiagnosisSequence().get(i), i);
5542    }
5543    for (int i = 0; i < element.getProcedureSequence().size(); i++) {
5544      composePositiveInt(t, "ItemComponent", "procedureSequence", element.getProcedureSequence().get(i), i);
5545    }
5546    for (int i = 0; i < element.getInformationSequence().size(); i++) {
5547      composePositiveInt(t, "ItemComponent", "informationSequence", element.getInformationSequence().get(i), i);
5548    }
5549    if (element.hasRevenue()) {
5550      composeCodeableConcept(t, "ItemComponent", "revenue", element.getRevenue(), -1);
5551    }
5552    if (element.hasCategory()) {
5553      composeCodeableConcept(t, "ItemComponent", "category", element.getCategory(), -1);
5554    }
5555    if (element.hasProductOrService()) {
5556      composeCodeableConcept(t, "ItemComponent", "productOrService", element.getProductOrService(), -1);
5557    }
5558    if (element.hasProductOrServiceEnd()) {
5559      composeCodeableConcept(t, "ItemComponent", "productOrServiceEnd", element.getProductOrServiceEnd(), -1);
5560    }
5561    for (int i = 0; i < element.getModifier().size(); i++) {
5562      composeCodeableConcept(t, "ItemComponent", "modifier", element.getModifier().get(i), i);
5563    }
5564    for (int i = 0; i < element.getProgramCode().size(); i++) {
5565      composeCodeableConcept(t, "ItemComponent", "programCode", element.getProgramCode().get(i), i);
5566    }
5567    if (element.hasServiced()) {
5568      composeType(t, "ItemComponent", "serviced", element.getServiced(), -1);
5569    }
5570    if (element.hasLocation()) {
5571      composeType(t, "ItemComponent", "location", element.getLocation(), -1);
5572    }
5573    if (element.hasPatientPaid()) {
5574      composeMoney(t, "ItemComponent", "patientPaid", element.getPatientPaid(), -1);
5575    }
5576    if (element.hasQuantity()) {
5577      composeQuantity(t, "ItemComponent", "quantity", element.getQuantity(), -1);
5578    }
5579    if (element.hasUnitPrice()) {
5580      composeMoney(t, "ItemComponent", "unitPrice", element.getUnitPrice(), -1);
5581    }
5582    if (element.hasFactorElement()) {
5583      composeDecimal(t, "ItemComponent", "factor", element.getFactorElement(), -1);
5584    }
5585    if (element.hasTax()) {
5586      composeMoney(t, "ItemComponent", "tax", element.getTax(), -1);
5587    }
5588    if (element.hasNet()) {
5589      composeMoney(t, "ItemComponent", "net", element.getNet(), -1);
5590    }
5591    for (int i = 0; i < element.getUdi().size(); i++) {
5592      composeReference(t, "ItemComponent", "udi", element.getUdi().get(i), i);
5593    }
5594    for (int i = 0; i < element.getBodySite().size(); i++) {
5595      composeClaimBodySiteComponent(t, "ItemComponent", "bodySite", element.getBodySite().get(i), i);
5596    }
5597    for (int i = 0; i < element.getEncounter().size(); i++) {
5598      composeReference(t, "ItemComponent", "encounter", element.getEncounter().get(i), i);
5599    }
5600    for (int i = 0; i < element.getDetail().size(); i++) {
5601      composeClaimDetailComponent(t, "ItemComponent", "detail", element.getDetail().get(i), i);
5602    }
5603  }
5604
5605  protected void composeClaimBodySiteComponent(Complex parent, String parentType, String name, Claim.BodySiteComponent element, int index) {
5606    if (element == null) 
5607      return;
5608    Complex t;
5609    if (Utilities.noString(parentType))
5610      t = parent;
5611    else {
5612      t = parent.predicate("fhir:"+parentType+'.'+name);
5613    }
5614    composeBackboneElement(t, "bodySite", name, element, index);
5615    for (int i = 0; i < element.getSite().size(); i++) {
5616      composeCodeableReference(t, "BodySiteComponent", "site", element.getSite().get(i), i);
5617    }
5618    for (int i = 0; i < element.getSubSite().size(); i++) {
5619      composeCodeableConcept(t, "BodySiteComponent", "subSite", element.getSubSite().get(i), i);
5620    }
5621  }
5622
5623  protected void composeClaimDetailComponent(Complex parent, String parentType, String name, Claim.DetailComponent element, int index) {
5624    if (element == null) 
5625      return;
5626    Complex t;
5627    if (Utilities.noString(parentType))
5628      t = parent;
5629    else {
5630      t = parent.predicate("fhir:"+parentType+'.'+name);
5631    }
5632    composeBackboneElement(t, "detail", name, element, index);
5633    if (element.hasSequenceElement()) {
5634      composePositiveInt(t, "DetailComponent", "sequence", element.getSequenceElement(), -1);
5635    }
5636    if (element.hasRevenue()) {
5637      composeCodeableConcept(t, "DetailComponent", "revenue", element.getRevenue(), -1);
5638    }
5639    if (element.hasCategory()) {
5640      composeCodeableConcept(t, "DetailComponent", "category", element.getCategory(), -1);
5641    }
5642    if (element.hasProductOrService()) {
5643      composeCodeableConcept(t, "DetailComponent", "productOrService", element.getProductOrService(), -1);
5644    }
5645    if (element.hasProductOrServiceEnd()) {
5646      composeCodeableConcept(t, "DetailComponent", "productOrServiceEnd", element.getProductOrServiceEnd(), -1);
5647    }
5648    for (int i = 0; i < element.getModifier().size(); i++) {
5649      composeCodeableConcept(t, "DetailComponent", "modifier", element.getModifier().get(i), i);
5650    }
5651    for (int i = 0; i < element.getProgramCode().size(); i++) {
5652      composeCodeableConcept(t, "DetailComponent", "programCode", element.getProgramCode().get(i), i);
5653    }
5654    if (element.hasPatientPaid()) {
5655      composeMoney(t, "DetailComponent", "patientPaid", element.getPatientPaid(), -1);
5656    }
5657    if (element.hasQuantity()) {
5658      composeQuantity(t, "DetailComponent", "quantity", element.getQuantity(), -1);
5659    }
5660    if (element.hasUnitPrice()) {
5661      composeMoney(t, "DetailComponent", "unitPrice", element.getUnitPrice(), -1);
5662    }
5663    if (element.hasFactorElement()) {
5664      composeDecimal(t, "DetailComponent", "factor", element.getFactorElement(), -1);
5665    }
5666    if (element.hasTax()) {
5667      composeMoney(t, "DetailComponent", "tax", element.getTax(), -1);
5668    }
5669    if (element.hasNet()) {
5670      composeMoney(t, "DetailComponent", "net", element.getNet(), -1);
5671    }
5672    for (int i = 0; i < element.getUdi().size(); i++) {
5673      composeReference(t, "DetailComponent", "udi", element.getUdi().get(i), i);
5674    }
5675    for (int i = 0; i < element.getSubDetail().size(); i++) {
5676      composeClaimSubDetailComponent(t, "DetailComponent", "subDetail", element.getSubDetail().get(i), i);
5677    }
5678  }
5679
5680  protected void composeClaimSubDetailComponent(Complex parent, String parentType, String name, Claim.SubDetailComponent element, int index) {
5681    if (element == null) 
5682      return;
5683    Complex t;
5684    if (Utilities.noString(parentType))
5685      t = parent;
5686    else {
5687      t = parent.predicate("fhir:"+parentType+'.'+name);
5688    }
5689    composeBackboneElement(t, "subDetail", name, element, index);
5690    if (element.hasSequenceElement()) {
5691      composePositiveInt(t, "SubDetailComponent", "sequence", element.getSequenceElement(), -1);
5692    }
5693    if (element.hasRevenue()) {
5694      composeCodeableConcept(t, "SubDetailComponent", "revenue", element.getRevenue(), -1);
5695    }
5696    if (element.hasCategory()) {
5697      composeCodeableConcept(t, "SubDetailComponent", "category", element.getCategory(), -1);
5698    }
5699    if (element.hasProductOrService()) {
5700      composeCodeableConcept(t, "SubDetailComponent", "productOrService", element.getProductOrService(), -1);
5701    }
5702    if (element.hasProductOrServiceEnd()) {
5703      composeCodeableConcept(t, "SubDetailComponent", "productOrServiceEnd", element.getProductOrServiceEnd(), -1);
5704    }
5705    for (int i = 0; i < element.getModifier().size(); i++) {
5706      composeCodeableConcept(t, "SubDetailComponent", "modifier", element.getModifier().get(i), i);
5707    }
5708    for (int i = 0; i < element.getProgramCode().size(); i++) {
5709      composeCodeableConcept(t, "SubDetailComponent", "programCode", element.getProgramCode().get(i), i);
5710    }
5711    if (element.hasPatientPaid()) {
5712      composeMoney(t, "SubDetailComponent", "patientPaid", element.getPatientPaid(), -1);
5713    }
5714    if (element.hasQuantity()) {
5715      composeQuantity(t, "SubDetailComponent", "quantity", element.getQuantity(), -1);
5716    }
5717    if (element.hasUnitPrice()) {
5718      composeMoney(t, "SubDetailComponent", "unitPrice", element.getUnitPrice(), -1);
5719    }
5720    if (element.hasFactorElement()) {
5721      composeDecimal(t, "SubDetailComponent", "factor", element.getFactorElement(), -1);
5722    }
5723    if (element.hasTax()) {
5724      composeMoney(t, "SubDetailComponent", "tax", element.getTax(), -1);
5725    }
5726    if (element.hasNet()) {
5727      composeMoney(t, "SubDetailComponent", "net", element.getNet(), -1);
5728    }
5729    for (int i = 0; i < element.getUdi().size(); i++) {
5730      composeReference(t, "SubDetailComponent", "udi", element.getUdi().get(i), i);
5731    }
5732  }
5733
5734  protected void composeClaimResponse(Complex parent, String parentType, String name, ClaimResponse 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    composeDomainResource(t, "ClaimResponse", name, element, index);
5744    for (int i = 0; i < element.getIdentifier().size(); i++) {
5745      composeIdentifier(t, "ClaimResponse", "identifier", element.getIdentifier().get(i), i);
5746    }
5747    if (element.hasStatusElement()) {
5748      composeEnum(t, "ClaimResponse", "status", element.getStatusElement(), -1);
5749    }
5750    if (element.hasType()) {
5751      composeCodeableConcept(t, "ClaimResponse", "type", element.getType(), -1);
5752    }
5753    if (element.hasSubType()) {
5754      composeCodeableConcept(t, "ClaimResponse", "subType", element.getSubType(), -1);
5755    }
5756    if (element.hasUseElement()) {
5757      composeEnum(t, "ClaimResponse", "use", element.getUseElement(), -1);
5758    }
5759    if (element.hasPatient()) {
5760      composeReference(t, "ClaimResponse", "patient", element.getPatient(), -1);
5761    }
5762    if (element.hasCreatedElement()) {
5763      composeDateTime(t, "ClaimResponse", "created", element.getCreatedElement(), -1);
5764    }
5765    if (element.hasInsurer()) {
5766      composeReference(t, "ClaimResponse", "insurer", element.getInsurer(), -1);
5767    }
5768    if (element.hasRequestor()) {
5769      composeReference(t, "ClaimResponse", "requestor", element.getRequestor(), -1);
5770    }
5771    if (element.hasRequest()) {
5772      composeReference(t, "ClaimResponse", "request", element.getRequest(), -1);
5773    }
5774    if (element.hasOutcomeElement()) {
5775      composeEnum(t, "ClaimResponse", "outcome", element.getOutcomeElement(), -1);
5776    }
5777    if (element.hasDecision()) {
5778      composeCodeableConcept(t, "ClaimResponse", "decision", element.getDecision(), -1);
5779    }
5780    if (element.hasDispositionElement()) {
5781      composeString(t, "ClaimResponse", "disposition", element.getDispositionElement(), -1);
5782    }
5783    if (element.hasPreAuthRefElement()) {
5784      composeString(t, "ClaimResponse", "preAuthRef", element.getPreAuthRefElement(), -1);
5785    }
5786    if (element.hasPreAuthPeriod()) {
5787      composePeriod(t, "ClaimResponse", "preAuthPeriod", element.getPreAuthPeriod(), -1);
5788    }
5789    if (element.hasPayeeType()) {
5790      composeCodeableConcept(t, "ClaimResponse", "payeeType", element.getPayeeType(), -1);
5791    }
5792    for (int i = 0; i < element.getEncounter().size(); i++) {
5793      composeReference(t, "ClaimResponse", "encounter", element.getEncounter().get(i), i);
5794    }
5795    if (element.hasDiagnosisRelatedGroup()) {
5796      composeCodeableConcept(t, "ClaimResponse", "diagnosisRelatedGroup", element.getDiagnosisRelatedGroup(), -1);
5797    }
5798    for (int i = 0; i < element.getItem().size(); i++) {
5799      composeClaimResponseItemComponent(t, "ClaimResponse", "item", element.getItem().get(i), i);
5800    }
5801    for (int i = 0; i < element.getAddItem().size(); i++) {
5802      composeClaimResponseAddedItemComponent(t, "ClaimResponse", "addItem", element.getAddItem().get(i), i);
5803    }
5804    for (int i = 0; i < element.getAdjudication().size(); i++) {
5805      composeClaimResponseAdjudicationComponent(t, "ClaimResponse", "adjudication", element.getAdjudication().get(i), i);
5806    }
5807    for (int i = 0; i < element.getTotal().size(); i++) {
5808      composeClaimResponseTotalComponent(t, "ClaimResponse", "total", element.getTotal().get(i), i);
5809    }
5810    if (element.hasPayment()) {
5811      composeClaimResponsePaymentComponent(t, "ClaimResponse", "payment", element.getPayment(), -1);
5812    }
5813    if (element.hasFundsReserve()) {
5814      composeCodeableConcept(t, "ClaimResponse", "fundsReserve", element.getFundsReserve(), -1);
5815    }
5816    if (element.hasFormCode()) {
5817      composeCodeableConcept(t, "ClaimResponse", "formCode", element.getFormCode(), -1);
5818    }
5819    if (element.hasForm()) {
5820      composeAttachment(t, "ClaimResponse", "form", element.getForm(), -1);
5821    }
5822    for (int i = 0; i < element.getProcessNote().size(); i++) {
5823      composeClaimResponseNoteComponent(t, "ClaimResponse", "processNote", element.getProcessNote().get(i), i);
5824    }
5825    for (int i = 0; i < element.getCommunicationRequest().size(); i++) {
5826      composeReference(t, "ClaimResponse", "communicationRequest", element.getCommunicationRequest().get(i), i);
5827    }
5828    for (int i = 0; i < element.getInsurance().size(); i++) {
5829      composeClaimResponseInsuranceComponent(t, "ClaimResponse", "insurance", element.getInsurance().get(i), i);
5830    }
5831    for (int i = 0; i < element.getError().size(); i++) {
5832      composeClaimResponseErrorComponent(t, "ClaimResponse", "error", element.getError().get(i), i);
5833    }
5834  }
5835
5836  protected void composeClaimResponseItemComponent(Complex parent, String parentType, String name, ClaimResponse.ItemComponent element, int index) {
5837    if (element == null) 
5838      return;
5839    Complex t;
5840    if (Utilities.noString(parentType))
5841      t = parent;
5842    else {
5843      t = parent.predicate("fhir:"+parentType+'.'+name);
5844    }
5845    composeBackboneElement(t, "item", name, element, index);
5846    if (element.hasItemSequenceElement()) {
5847      composePositiveInt(t, "ItemComponent", "itemSequence", element.getItemSequenceElement(), -1);
5848    }
5849    for (int i = 0; i < element.getNoteNumber().size(); i++) {
5850      composePositiveInt(t, "ItemComponent", "noteNumber", element.getNoteNumber().get(i), i);
5851    }
5852    if (element.hasDecision()) {
5853      composeCodeableConcept(t, "ItemComponent", "decision", element.getDecision(), -1);
5854    }
5855    for (int i = 0; i < element.getAdjudication().size(); i++) {
5856      composeClaimResponseAdjudicationComponent(t, "ItemComponent", "adjudication", element.getAdjudication().get(i), i);
5857    }
5858    for (int i = 0; i < element.getDetail().size(); i++) {
5859      composeClaimResponseItemDetailComponent(t, "ItemComponent", "detail", element.getDetail().get(i), i);
5860    }
5861  }
5862
5863  protected void composeClaimResponseAdjudicationComponent(Complex parent, String parentType, String name, ClaimResponse.AdjudicationComponent element, int index) {
5864    if (element == null) 
5865      return;
5866    Complex t;
5867    if (Utilities.noString(parentType))
5868      t = parent;
5869    else {
5870      t = parent.predicate("fhir:"+parentType+'.'+name);
5871    }
5872    composeBackboneElement(t, "adjudication", name, element, index);
5873    if (element.hasCategory()) {
5874      composeCodeableConcept(t, "AdjudicationComponent", "category", element.getCategory(), -1);
5875    }
5876    if (element.hasReason()) {
5877      composeCodeableConcept(t, "AdjudicationComponent", "reason", element.getReason(), -1);
5878    }
5879    if (element.hasAmount()) {
5880      composeMoney(t, "AdjudicationComponent", "amount", element.getAmount(), -1);
5881    }
5882    if (element.hasValueElement()) {
5883      composeDecimal(t, "AdjudicationComponent", "value", element.getValueElement(), -1);
5884    }
5885  }
5886
5887  protected void composeClaimResponseItemDetailComponent(Complex parent, String parentType, String name, ClaimResponse.ItemDetailComponent element, int index) {
5888    if (element == null) 
5889      return;
5890    Complex t;
5891    if (Utilities.noString(parentType))
5892      t = parent;
5893    else {
5894      t = parent.predicate("fhir:"+parentType+'.'+name);
5895    }
5896    composeBackboneElement(t, "detail", name, element, index);
5897    if (element.hasDetailSequenceElement()) {
5898      composePositiveInt(t, "ItemDetailComponent", "detailSequence", element.getDetailSequenceElement(), -1);
5899    }
5900    for (int i = 0; i < element.getNoteNumber().size(); i++) {
5901      composePositiveInt(t, "ItemDetailComponent", "noteNumber", element.getNoteNumber().get(i), i);
5902    }
5903    if (element.hasDecision()) {
5904      composeCodeableConcept(t, "ItemDetailComponent", "decision", element.getDecision(), -1);
5905    }
5906    for (int i = 0; i < element.getAdjudication().size(); i++) {
5907      composeClaimResponseAdjudicationComponent(t, "ItemDetailComponent", "adjudication", element.getAdjudication().get(i), i);
5908    }
5909    for (int i = 0; i < element.getSubDetail().size(); i++) {
5910      composeClaimResponseSubDetailComponent(t, "ItemDetailComponent", "subDetail", element.getSubDetail().get(i), i);
5911    }
5912  }
5913
5914  protected void composeClaimResponseSubDetailComponent(Complex parent, String parentType, String name, ClaimResponse.SubDetailComponent element, int index) {
5915    if (element == null) 
5916      return;
5917    Complex t;
5918    if (Utilities.noString(parentType))
5919      t = parent;
5920    else {
5921      t = parent.predicate("fhir:"+parentType+'.'+name);
5922    }
5923    composeBackboneElement(t, "subDetail", name, element, index);
5924    if (element.hasSubDetailSequenceElement()) {
5925      composePositiveInt(t, "SubDetailComponent", "subDetailSequence", element.getSubDetailSequenceElement(), -1);
5926    }
5927    for (int i = 0; i < element.getNoteNumber().size(); i++) {
5928      composePositiveInt(t, "SubDetailComponent", "noteNumber", element.getNoteNumber().get(i), i);
5929    }
5930    if (element.hasDecision()) {
5931      composeCodeableConcept(t, "SubDetailComponent", "decision", element.getDecision(), -1);
5932    }
5933    for (int i = 0; i < element.getAdjudication().size(); i++) {
5934      composeClaimResponseAdjudicationComponent(t, "SubDetailComponent", "adjudication", element.getAdjudication().get(i), i);
5935    }
5936  }
5937
5938  protected void composeClaimResponseAddedItemComponent(Complex parent, String parentType, String name, ClaimResponse.AddedItemComponent element, int index) {
5939    if (element == null) 
5940      return;
5941    Complex t;
5942    if (Utilities.noString(parentType))
5943      t = parent;
5944    else {
5945      t = parent.predicate("fhir:"+parentType+'.'+name);
5946    }
5947    composeBackboneElement(t, "addItem", name, element, index);
5948    for (int i = 0; i < element.getItemSequence().size(); i++) {
5949      composePositiveInt(t, "AddedItemComponent", "itemSequence", element.getItemSequence().get(i), i);
5950    }
5951    for (int i = 0; i < element.getDetailSequence().size(); i++) {
5952      composePositiveInt(t, "AddedItemComponent", "detailSequence", element.getDetailSequence().get(i), i);
5953    }
5954    for (int i = 0; i < element.getSubdetailSequence().size(); i++) {
5955      composePositiveInt(t, "AddedItemComponent", "subdetailSequence", element.getSubdetailSequence().get(i), i);
5956    }
5957    for (int i = 0; i < element.getProvider().size(); i++) {
5958      composeReference(t, "AddedItemComponent", "provider", element.getProvider().get(i), i);
5959    }
5960    if (element.hasRevenue()) {
5961      composeCodeableConcept(t, "AddedItemComponent", "revenue", element.getRevenue(), -1);
5962    }
5963    if (element.hasProductOrService()) {
5964      composeCodeableConcept(t, "AddedItemComponent", "productOrService", element.getProductOrService(), -1);
5965    }
5966    if (element.hasProductOrServiceEnd()) {
5967      composeCodeableConcept(t, "AddedItemComponent", "productOrServiceEnd", element.getProductOrServiceEnd(), -1);
5968    }
5969    for (int i = 0; i < element.getModifier().size(); i++) {
5970      composeCodeableConcept(t, "AddedItemComponent", "modifier", element.getModifier().get(i), i);
5971    }
5972    for (int i = 0; i < element.getProgramCode().size(); i++) {
5973      composeCodeableConcept(t, "AddedItemComponent", "programCode", element.getProgramCode().get(i), i);
5974    }
5975    if (element.hasServiced()) {
5976      composeType(t, "AddedItemComponent", "serviced", element.getServiced(), -1);
5977    }
5978    if (element.hasLocation()) {
5979      composeType(t, "AddedItemComponent", "location", element.getLocation(), -1);
5980    }
5981    if (element.hasQuantity()) {
5982      composeQuantity(t, "AddedItemComponent", "quantity", element.getQuantity(), -1);
5983    }
5984    if (element.hasUnitPrice()) {
5985      composeMoney(t, "AddedItemComponent", "unitPrice", element.getUnitPrice(), -1);
5986    }
5987    if (element.hasFactorElement()) {
5988      composeDecimal(t, "AddedItemComponent", "factor", element.getFactorElement(), -1);
5989    }
5990    if (element.hasTax()) {
5991      composeMoney(t, "AddedItemComponent", "tax", element.getTax(), -1);
5992    }
5993    if (element.hasNet()) {
5994      composeMoney(t, "AddedItemComponent", "net", element.getNet(), -1);
5995    }
5996    for (int i = 0; i < element.getBodySite().size(); i++) {
5997      composeClaimResponseBodySiteComponent(t, "AddedItemComponent", "bodySite", element.getBodySite().get(i), i);
5998    }
5999    for (int i = 0; i < element.getNoteNumber().size(); i++) {
6000      composePositiveInt(t, "AddedItemComponent", "noteNumber", element.getNoteNumber().get(i), i);
6001    }
6002    if (element.hasDecision()) {
6003      composeCodeableConcept(t, "AddedItemComponent", "decision", element.getDecision(), -1);
6004    }
6005    for (int i = 0; i < element.getAdjudication().size(); i++) {
6006      composeClaimResponseAdjudicationComponent(t, "AddedItemComponent", "adjudication", element.getAdjudication().get(i), i);
6007    }
6008    for (int i = 0; i < element.getDetail().size(); i++) {
6009      composeClaimResponseAddedItemDetailComponent(t, "AddedItemComponent", "detail", element.getDetail().get(i), i);
6010    }
6011  }
6012
6013  protected void composeClaimResponseBodySiteComponent(Complex parent, String parentType, String name, ClaimResponse.BodySiteComponent element, int index) {
6014    if (element == null) 
6015      return;
6016    Complex t;
6017    if (Utilities.noString(parentType))
6018      t = parent;
6019    else {
6020      t = parent.predicate("fhir:"+parentType+'.'+name);
6021    }
6022    composeBackboneElement(t, "bodySite", name, element, index);
6023    for (int i = 0; i < element.getSite().size(); i++) {
6024      composeCodeableReference(t, "BodySiteComponent", "site", element.getSite().get(i), i);
6025    }
6026    for (int i = 0; i < element.getSubSite().size(); i++) {
6027      composeCodeableConcept(t, "BodySiteComponent", "subSite", element.getSubSite().get(i), i);
6028    }
6029  }
6030
6031  protected void composeClaimResponseAddedItemDetailComponent(Complex parent, String parentType, String name, ClaimResponse.AddedItemDetailComponent element, int index) {
6032    if (element == null) 
6033      return;
6034    Complex t;
6035    if (Utilities.noString(parentType))
6036      t = parent;
6037    else {
6038      t = parent.predicate("fhir:"+parentType+'.'+name);
6039    }
6040    composeBackboneElement(t, "detail", name, element, index);
6041    if (element.hasRevenue()) {
6042      composeCodeableConcept(t, "AddedItemDetailComponent", "revenue", element.getRevenue(), -1);
6043    }
6044    if (element.hasProductOrService()) {
6045      composeCodeableConcept(t, "AddedItemDetailComponent", "productOrService", element.getProductOrService(), -1);
6046    }
6047    if (element.hasProductOrServiceEnd()) {
6048      composeCodeableConcept(t, "AddedItemDetailComponent", "productOrServiceEnd", element.getProductOrServiceEnd(), -1);
6049    }
6050    for (int i = 0; i < element.getModifier().size(); i++) {
6051      composeCodeableConcept(t, "AddedItemDetailComponent", "modifier", element.getModifier().get(i), i);
6052    }
6053    if (element.hasQuantity()) {
6054      composeQuantity(t, "AddedItemDetailComponent", "quantity", element.getQuantity(), -1);
6055    }
6056    if (element.hasUnitPrice()) {
6057      composeMoney(t, "AddedItemDetailComponent", "unitPrice", element.getUnitPrice(), -1);
6058    }
6059    if (element.hasFactorElement()) {
6060      composeDecimal(t, "AddedItemDetailComponent", "factor", element.getFactorElement(), -1);
6061    }
6062    if (element.hasTax()) {
6063      composeMoney(t, "AddedItemDetailComponent", "tax", element.getTax(), -1);
6064    }
6065    if (element.hasNet()) {
6066      composeMoney(t, "AddedItemDetailComponent", "net", element.getNet(), -1);
6067    }
6068    for (int i = 0; i < element.getNoteNumber().size(); i++) {
6069      composePositiveInt(t, "AddedItemDetailComponent", "noteNumber", element.getNoteNumber().get(i), i);
6070    }
6071    if (element.hasDecision()) {
6072      composeCodeableConcept(t, "AddedItemDetailComponent", "decision", element.getDecision(), -1);
6073    }
6074    for (int i = 0; i < element.getAdjudication().size(); i++) {
6075      composeClaimResponseAdjudicationComponent(t, "AddedItemDetailComponent", "adjudication", element.getAdjudication().get(i), i);
6076    }
6077    for (int i = 0; i < element.getSubDetail().size(); i++) {
6078      composeClaimResponseAddedItemSubDetailComponent(t, "AddedItemDetailComponent", "subDetail", element.getSubDetail().get(i), i);
6079    }
6080  }
6081
6082  protected void composeClaimResponseAddedItemSubDetailComponent(Complex parent, String parentType, String name, ClaimResponse.AddedItemSubDetailComponent element, int index) {
6083    if (element == null) 
6084      return;
6085    Complex t;
6086    if (Utilities.noString(parentType))
6087      t = parent;
6088    else {
6089      t = parent.predicate("fhir:"+parentType+'.'+name);
6090    }
6091    composeBackboneElement(t, "subDetail", name, element, index);
6092    if (element.hasRevenue()) {
6093      composeCodeableConcept(t, "AddedItemSubDetailComponent", "revenue", element.getRevenue(), -1);
6094    }
6095    if (element.hasProductOrService()) {
6096      composeCodeableConcept(t, "AddedItemSubDetailComponent", "productOrService", element.getProductOrService(), -1);
6097    }
6098    if (element.hasProductOrServiceEnd()) {
6099      composeCodeableConcept(t, "AddedItemSubDetailComponent", "productOrServiceEnd", element.getProductOrServiceEnd(), -1);
6100    }
6101    for (int i = 0; i < element.getModifier().size(); i++) {
6102      composeCodeableConcept(t, "AddedItemSubDetailComponent", "modifier", element.getModifier().get(i), i);
6103    }
6104    if (element.hasQuantity()) {
6105      composeQuantity(t, "AddedItemSubDetailComponent", "quantity", element.getQuantity(), -1);
6106    }
6107    if (element.hasUnitPrice()) {
6108      composeMoney(t, "AddedItemSubDetailComponent", "unitPrice", element.getUnitPrice(), -1);
6109    }
6110    if (element.hasFactorElement()) {
6111      composeDecimal(t, "AddedItemSubDetailComponent", "factor", element.getFactorElement(), -1);
6112    }
6113    if (element.hasTax()) {
6114      composeMoney(t, "AddedItemSubDetailComponent", "tax", element.getTax(), -1);
6115    }
6116    if (element.hasNet()) {
6117      composeMoney(t, "AddedItemSubDetailComponent", "net", element.getNet(), -1);
6118    }
6119    for (int i = 0; i < element.getNoteNumber().size(); i++) {
6120      composePositiveInt(t, "AddedItemSubDetailComponent", "noteNumber", element.getNoteNumber().get(i), i);
6121    }
6122    if (element.hasDecision()) {
6123      composeCodeableConcept(t, "AddedItemSubDetailComponent", "decision", element.getDecision(), -1);
6124    }
6125    for (int i = 0; i < element.getAdjudication().size(); i++) {
6126      composeClaimResponseAdjudicationComponent(t, "AddedItemSubDetailComponent", "adjudication", element.getAdjudication().get(i), i);
6127    }
6128  }
6129
6130  protected void composeClaimResponseTotalComponent(Complex parent, String parentType, String name, ClaimResponse.TotalComponent element, int index) {
6131    if (element == null) 
6132      return;
6133    Complex t;
6134    if (Utilities.noString(parentType))
6135      t = parent;
6136    else {
6137      t = parent.predicate("fhir:"+parentType+'.'+name);
6138    }
6139    composeBackboneElement(t, "total", name, element, index);
6140    if (element.hasCategory()) {
6141      composeCodeableConcept(t, "TotalComponent", "category", element.getCategory(), -1);
6142    }
6143    if (element.hasAmount()) {
6144      composeMoney(t, "TotalComponent", "amount", element.getAmount(), -1);
6145    }
6146  }
6147
6148  protected void composeClaimResponsePaymentComponent(Complex parent, String parentType, String name, ClaimResponse.PaymentComponent element, int index) {
6149    if (element == null) 
6150      return;
6151    Complex t;
6152    if (Utilities.noString(parentType))
6153      t = parent;
6154    else {
6155      t = parent.predicate("fhir:"+parentType+'.'+name);
6156    }
6157    composeBackboneElement(t, "payment", name, element, index);
6158    if (element.hasType()) {
6159      composeCodeableConcept(t, "PaymentComponent", "type", element.getType(), -1);
6160    }
6161    if (element.hasAdjustment()) {
6162      composeMoney(t, "PaymentComponent", "adjustment", element.getAdjustment(), -1);
6163    }
6164    if (element.hasAdjustmentReason()) {
6165      composeCodeableConcept(t, "PaymentComponent", "adjustmentReason", element.getAdjustmentReason(), -1);
6166    }
6167    if (element.hasDateElement()) {
6168      composeDate(t, "PaymentComponent", "date", element.getDateElement(), -1);
6169    }
6170    if (element.hasAmount()) {
6171      composeMoney(t, "PaymentComponent", "amount", element.getAmount(), -1);
6172    }
6173    if (element.hasIdentifier()) {
6174      composeIdentifier(t, "PaymentComponent", "identifier", element.getIdentifier(), -1);
6175    }
6176  }
6177
6178  protected void composeClaimResponseNoteComponent(Complex parent, String parentType, String name, ClaimResponse.NoteComponent element, int index) {
6179    if (element == null) 
6180      return;
6181    Complex t;
6182    if (Utilities.noString(parentType))
6183      t = parent;
6184    else {
6185      t = parent.predicate("fhir:"+parentType+'.'+name);
6186    }
6187    composeBackboneElement(t, "processNote", name, element, index);
6188    if (element.hasNumberElement()) {
6189      composePositiveInt(t, "NoteComponent", "number", element.getNumberElement(), -1);
6190    }
6191    if (element.hasTypeElement()) {
6192      composeEnum(t, "NoteComponent", "type", element.getTypeElement(), -1);
6193    }
6194    if (element.hasTextElement()) {
6195      composeString(t, "NoteComponent", "text", element.getTextElement(), -1);
6196    }
6197    if (element.hasLanguage()) {
6198      composeCodeableConcept(t, "NoteComponent", "language", element.getLanguage(), -1);
6199    }
6200  }
6201
6202  protected void composeClaimResponseInsuranceComponent(Complex parent, String parentType, String name, ClaimResponse.InsuranceComponent element, int index) {
6203    if (element == null) 
6204      return;
6205    Complex t;
6206    if (Utilities.noString(parentType))
6207      t = parent;
6208    else {
6209      t = parent.predicate("fhir:"+parentType+'.'+name);
6210    }
6211    composeBackboneElement(t, "insurance", name, element, index);
6212    if (element.hasSequenceElement()) {
6213      composePositiveInt(t, "InsuranceComponent", "sequence", element.getSequenceElement(), -1);
6214    }
6215    if (element.hasFocalElement()) {
6216      composeBoolean(t, "InsuranceComponent", "focal", element.getFocalElement(), -1);
6217    }
6218    if (element.hasCoverage()) {
6219      composeReference(t, "InsuranceComponent", "coverage", element.getCoverage(), -1);
6220    }
6221    if (element.hasBusinessArrangementElement()) {
6222      composeString(t, "InsuranceComponent", "businessArrangement", element.getBusinessArrangementElement(), -1);
6223    }
6224    if (element.hasClaimResponse()) {
6225      composeReference(t, "InsuranceComponent", "claimResponse", element.getClaimResponse(), -1);
6226    }
6227  }
6228
6229  protected void composeClaimResponseErrorComponent(Complex parent, String parentType, String name, ClaimResponse.ErrorComponent element, int index) {
6230    if (element == null) 
6231      return;
6232    Complex t;
6233    if (Utilities.noString(parentType))
6234      t = parent;
6235    else {
6236      t = parent.predicate("fhir:"+parentType+'.'+name);
6237    }
6238    composeBackboneElement(t, "error", name, element, index);
6239    if (element.hasItemSequenceElement()) {
6240      composePositiveInt(t, "ErrorComponent", "itemSequence", element.getItemSequenceElement(), -1);
6241    }
6242    if (element.hasDetailSequenceElement()) {
6243      composePositiveInt(t, "ErrorComponent", "detailSequence", element.getDetailSequenceElement(), -1);
6244    }
6245    if (element.hasSubDetailSequenceElement()) {
6246      composePositiveInt(t, "ErrorComponent", "subDetailSequence", element.getSubDetailSequenceElement(), -1);
6247    }
6248    if (element.hasCode()) {
6249      composeCodeableConcept(t, "ErrorComponent", "code", element.getCode(), -1);
6250    }
6251  }
6252
6253  protected void composeClinicalImpression(Complex parent, String parentType, String name, ClinicalImpression element, int index) {
6254    if (element == null) 
6255      return;
6256    Complex t;
6257    if (Utilities.noString(parentType))
6258      t = parent;
6259    else {
6260      t = parent.predicate("fhir:"+parentType+'.'+name);
6261    }
6262    composeDomainResource(t, "ClinicalImpression", name, element, index);
6263    for (int i = 0; i < element.getIdentifier().size(); i++) {
6264      composeIdentifier(t, "ClinicalImpression", "identifier", element.getIdentifier().get(i), i);
6265    }
6266    if (element.hasStatusElement()) {
6267      composeEnum(t, "ClinicalImpression", "status", element.getStatusElement(), -1);
6268    }
6269    if (element.hasStatusReason()) {
6270      composeCodeableConcept(t, "ClinicalImpression", "statusReason", element.getStatusReason(), -1);
6271    }
6272    if (element.hasDescriptionElement()) {
6273      composeString(t, "ClinicalImpression", "description", element.getDescriptionElement(), -1);
6274    }
6275    if (element.hasSubject()) {
6276      composeReference(t, "ClinicalImpression", "subject", element.getSubject(), -1);
6277    }
6278    if (element.hasEncounter()) {
6279      composeReference(t, "ClinicalImpression", "encounter", element.getEncounter(), -1);
6280    }
6281    if (element.hasEffective()) {
6282      composeType(t, "ClinicalImpression", "effective", element.getEffective(), -1);
6283    }
6284    if (element.hasDateElement()) {
6285      composeDateTime(t, "ClinicalImpression", "date", element.getDateElement(), -1);
6286    }
6287    if (element.hasPerformer()) {
6288      composeReference(t, "ClinicalImpression", "performer", element.getPerformer(), -1);
6289    }
6290    if (element.hasPrevious()) {
6291      composeReference(t, "ClinicalImpression", "previous", element.getPrevious(), -1);
6292    }
6293    for (int i = 0; i < element.getProblem().size(); i++) {
6294      composeReference(t, "ClinicalImpression", "problem", element.getProblem().get(i), i);
6295    }
6296    if (element.hasChangePattern()) {
6297      composeCodeableConcept(t, "ClinicalImpression", "changePattern", element.getChangePattern(), -1);
6298    }
6299    for (int i = 0; i < element.getProtocol().size(); i++) {
6300      composeUri(t, "ClinicalImpression", "protocol", element.getProtocol().get(i), i);
6301    }
6302    if (element.hasSummaryElement()) {
6303      composeString(t, "ClinicalImpression", "summary", element.getSummaryElement(), -1);
6304    }
6305    for (int i = 0; i < element.getFinding().size(); i++) {
6306      composeClinicalImpressionFindingComponent(t, "ClinicalImpression", "finding", element.getFinding().get(i), i);
6307    }
6308    for (int i = 0; i < element.getPrognosisCodeableConcept().size(); i++) {
6309      composeCodeableConcept(t, "ClinicalImpression", "prognosisCodeableConcept", element.getPrognosisCodeableConcept().get(i), i);
6310    }
6311    for (int i = 0; i < element.getPrognosisReference().size(); i++) {
6312      composeReference(t, "ClinicalImpression", "prognosisReference", element.getPrognosisReference().get(i), i);
6313    }
6314    for (int i = 0; i < element.getSupportingInfo().size(); i++) {
6315      composeReference(t, "ClinicalImpression", "supportingInfo", element.getSupportingInfo().get(i), i);
6316    }
6317    for (int i = 0; i < element.getNote().size(); i++) {
6318      composeAnnotation(t, "ClinicalImpression", "note", element.getNote().get(i), i);
6319    }
6320  }
6321
6322  protected void composeClinicalImpressionFindingComponent(Complex parent, String parentType, String name, ClinicalImpression.ClinicalImpressionFindingComponent element, int index) {
6323    if (element == null) 
6324      return;
6325    Complex t;
6326    if (Utilities.noString(parentType))
6327      t = parent;
6328    else {
6329      t = parent.predicate("fhir:"+parentType+'.'+name);
6330    }
6331    composeBackboneElement(t, "finding", name, element, index);
6332    if (element.hasItem()) {
6333      composeCodeableReference(t, "ClinicalImpressionFindingComponent", "item", element.getItem(), -1);
6334    }
6335    if (element.hasBasisElement()) {
6336      composeString(t, "ClinicalImpressionFindingComponent", "basis", element.getBasisElement(), -1);
6337    }
6338  }
6339
6340  protected void composeClinicalUseDefinition(Complex parent, String parentType, String name, ClinicalUseDefinition element, int index) {
6341    if (element == null) 
6342      return;
6343    Complex t;
6344    if (Utilities.noString(parentType))
6345      t = parent;
6346    else {
6347      t = parent.predicate("fhir:"+parentType+'.'+name);
6348    }
6349    composeDomainResource(t, "ClinicalUseDefinition", name, element, index);
6350    for (int i = 0; i < element.getIdentifier().size(); i++) {
6351      composeIdentifier(t, "ClinicalUseDefinition", "identifier", element.getIdentifier().get(i), i);
6352    }
6353    if (element.hasTypeElement()) {
6354      composeEnum(t, "ClinicalUseDefinition", "type", element.getTypeElement(), -1);
6355    }
6356    for (int i = 0; i < element.getCategory().size(); i++) {
6357      composeCodeableConcept(t, "ClinicalUseDefinition", "category", element.getCategory().get(i), i);
6358    }
6359    for (int i = 0; i < element.getSubject().size(); i++) {
6360      composeReference(t, "ClinicalUseDefinition", "subject", element.getSubject().get(i), i);
6361    }
6362    if (element.hasStatus()) {
6363      composeCodeableConcept(t, "ClinicalUseDefinition", "status", element.getStatus(), -1);
6364    }
6365    if (element.hasContraindication()) {
6366      composeClinicalUseDefinitionContraindicationComponent(t, "ClinicalUseDefinition", "contraindication", element.getContraindication(), -1);
6367    }
6368    if (element.hasIndication()) {
6369      composeClinicalUseDefinitionIndicationComponent(t, "ClinicalUseDefinition", "indication", element.getIndication(), -1);
6370    }
6371    if (element.hasInteraction()) {
6372      composeClinicalUseDefinitionInteractionComponent(t, "ClinicalUseDefinition", "interaction", element.getInteraction(), -1);
6373    }
6374    for (int i = 0; i < element.getPopulation().size(); i++) {
6375      composeReference(t, "ClinicalUseDefinition", "population", element.getPopulation().get(i), i);
6376    }
6377    if (element.hasUndesirableEffect()) {
6378      composeClinicalUseDefinitionUndesirableEffectComponent(t, "ClinicalUseDefinition", "undesirableEffect", element.getUndesirableEffect(), -1);
6379    }
6380    if (element.hasWarning()) {
6381      composeClinicalUseDefinitionWarningComponent(t, "ClinicalUseDefinition", "warning", element.getWarning(), -1);
6382    }
6383  }
6384
6385  protected void composeClinicalUseDefinitionContraindicationComponent(Complex parent, String parentType, String name, ClinicalUseDefinition.ClinicalUseDefinitionContraindicationComponent element, int index) {
6386    if (element == null) 
6387      return;
6388    Complex t;
6389    if (Utilities.noString(parentType))
6390      t = parent;
6391    else {
6392      t = parent.predicate("fhir:"+parentType+'.'+name);
6393    }
6394    composeBackboneElement(t, "contraindication", name, element, index);
6395    if (element.hasDiseaseSymptomProcedure()) {
6396      composeCodeableReference(t, "ClinicalUseDefinitionContraindicationComponent", "diseaseSymptomProcedure", element.getDiseaseSymptomProcedure(), -1);
6397    }
6398    if (element.hasDiseaseStatus()) {
6399      composeCodeableReference(t, "ClinicalUseDefinitionContraindicationComponent", "diseaseStatus", element.getDiseaseStatus(), -1);
6400    }
6401    for (int i = 0; i < element.getComorbidity().size(); i++) {
6402      composeCodeableReference(t, "ClinicalUseDefinitionContraindicationComponent", "comorbidity", element.getComorbidity().get(i), i);
6403    }
6404    for (int i = 0; i < element.getIndication().size(); i++) {
6405      composeReference(t, "ClinicalUseDefinitionContraindicationComponent", "indication", element.getIndication().get(i), i);
6406    }
6407    for (int i = 0; i < element.getOtherTherapy().size(); i++) {
6408      composeClinicalUseDefinitionContraindicationOtherTherapyComponent(t, "ClinicalUseDefinitionContraindicationComponent", "otherTherapy", element.getOtherTherapy().get(i), i);
6409    }
6410  }
6411
6412  protected void composeClinicalUseDefinitionContraindicationOtherTherapyComponent(Complex parent, String parentType, String name, ClinicalUseDefinition.ClinicalUseDefinitionContraindicationOtherTherapyComponent element, 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    composeBackboneElement(t, "otherTherapy", name, element, index);
6422    if (element.hasRelationshipType()) {
6423      composeCodeableConcept(t, "ClinicalUseDefinitionContraindicationOtherTherapyComponent", "relationshipType", element.getRelationshipType(), -1);
6424    }
6425    if (element.hasTreatment()) {
6426      composeCodeableReference(t, "ClinicalUseDefinitionContraindicationOtherTherapyComponent", "treatment", element.getTreatment(), -1);
6427    }
6428  }
6429
6430  protected void composeClinicalUseDefinitionIndicationComponent(Complex parent, String parentType, String name, ClinicalUseDefinition.ClinicalUseDefinitionIndicationComponent element, int index) {
6431    if (element == null) 
6432      return;
6433    Complex t;
6434    if (Utilities.noString(parentType))
6435      t = parent;
6436    else {
6437      t = parent.predicate("fhir:"+parentType+'.'+name);
6438    }
6439    composeBackboneElement(t, "indication", name, element, index);
6440    if (element.hasDiseaseSymptomProcedure()) {
6441      composeCodeableReference(t, "ClinicalUseDefinitionIndicationComponent", "diseaseSymptomProcedure", element.getDiseaseSymptomProcedure(), -1);
6442    }
6443    if (element.hasDiseaseStatus()) {
6444      composeCodeableReference(t, "ClinicalUseDefinitionIndicationComponent", "diseaseStatus", element.getDiseaseStatus(), -1);
6445    }
6446    for (int i = 0; i < element.getComorbidity().size(); i++) {
6447      composeCodeableReference(t, "ClinicalUseDefinitionIndicationComponent", "comorbidity", element.getComorbidity().get(i), i);
6448    }
6449    if (element.hasIntendedEffect()) {
6450      composeCodeableReference(t, "ClinicalUseDefinitionIndicationComponent", "intendedEffect", element.getIntendedEffect(), -1);
6451    }
6452    if (element.hasDuration()) {
6453      composeType(t, "ClinicalUseDefinitionIndicationComponent", "duration", element.getDuration(), -1);
6454    }
6455    for (int i = 0; i < element.getUndesirableEffect().size(); i++) {
6456      composeReference(t, "ClinicalUseDefinitionIndicationComponent", "undesirableEffect", element.getUndesirableEffect().get(i), i);
6457    }
6458    for (int i = 0; i < element.getOtherTherapy().size(); i++) {
6459      composeClinicalUseDefinitionContraindicationOtherTherapyComponent(t, "ClinicalUseDefinitionIndicationComponent", "otherTherapy", element.getOtherTherapy().get(i), i);
6460    }
6461  }
6462
6463  protected void composeClinicalUseDefinitionInteractionComponent(Complex parent, String parentType, String name, ClinicalUseDefinition.ClinicalUseDefinitionInteractionComponent element, int index) {
6464    if (element == null) 
6465      return;
6466    Complex t;
6467    if (Utilities.noString(parentType))
6468      t = parent;
6469    else {
6470      t = parent.predicate("fhir:"+parentType+'.'+name);
6471    }
6472    composeBackboneElement(t, "interaction", name, element, index);
6473    for (int i = 0; i < element.getInteractant().size(); i++) {
6474      composeClinicalUseDefinitionInteractionInteractantComponent(t, "ClinicalUseDefinitionInteractionComponent", "interactant", element.getInteractant().get(i), i);
6475    }
6476    if (element.hasType()) {
6477      composeCodeableConcept(t, "ClinicalUseDefinitionInteractionComponent", "type", element.getType(), -1);
6478    }
6479    if (element.hasEffect()) {
6480      composeCodeableReference(t, "ClinicalUseDefinitionInteractionComponent", "effect", element.getEffect(), -1);
6481    }
6482    if (element.hasIncidence()) {
6483      composeCodeableConcept(t, "ClinicalUseDefinitionInteractionComponent", "incidence", element.getIncidence(), -1);
6484    }
6485    for (int i = 0; i < element.getManagement().size(); i++) {
6486      composeCodeableConcept(t, "ClinicalUseDefinitionInteractionComponent", "management", element.getManagement().get(i), i);
6487    }
6488  }
6489
6490  protected void composeClinicalUseDefinitionInteractionInteractantComponent(Complex parent, String parentType, String name, ClinicalUseDefinition.ClinicalUseDefinitionInteractionInteractantComponent element, int index) {
6491    if (element == null) 
6492      return;
6493    Complex t;
6494    if (Utilities.noString(parentType))
6495      t = parent;
6496    else {
6497      t = parent.predicate("fhir:"+parentType+'.'+name);
6498    }
6499    composeBackboneElement(t, "interactant", name, element, index);
6500    if (element.hasItem()) {
6501      composeType(t, "ClinicalUseDefinitionInteractionInteractantComponent", "item", element.getItem(), -1);
6502    }
6503  }
6504
6505  protected void composeClinicalUseDefinitionUndesirableEffectComponent(Complex parent, String parentType, String name, ClinicalUseDefinition.ClinicalUseDefinitionUndesirableEffectComponent element, int index) {
6506    if (element == null) 
6507      return;
6508    Complex t;
6509    if (Utilities.noString(parentType))
6510      t = parent;
6511    else {
6512      t = parent.predicate("fhir:"+parentType+'.'+name);
6513    }
6514    composeBackboneElement(t, "undesirableEffect", name, element, index);
6515    if (element.hasSymptomConditionEffect()) {
6516      composeCodeableReference(t, "ClinicalUseDefinitionUndesirableEffectComponent", "symptomConditionEffect", element.getSymptomConditionEffect(), -1);
6517    }
6518    if (element.hasClassification()) {
6519      composeCodeableConcept(t, "ClinicalUseDefinitionUndesirableEffectComponent", "classification", element.getClassification(), -1);
6520    }
6521    if (element.hasFrequencyOfOccurrence()) {
6522      composeCodeableConcept(t, "ClinicalUseDefinitionUndesirableEffectComponent", "frequencyOfOccurrence", element.getFrequencyOfOccurrence(), -1);
6523    }
6524  }
6525
6526  protected void composeClinicalUseDefinitionWarningComponent(Complex parent, String parentType, String name, ClinicalUseDefinition.ClinicalUseDefinitionWarningComponent element, int index) {
6527    if (element == null) 
6528      return;
6529    Complex t;
6530    if (Utilities.noString(parentType))
6531      t = parent;
6532    else {
6533      t = parent.predicate("fhir:"+parentType+'.'+name);
6534    }
6535    composeBackboneElement(t, "warning", name, element, index);
6536    if (element.hasDescriptionElement()) {
6537      composeMarkdown(t, "ClinicalUseDefinitionWarningComponent", "description", element.getDescriptionElement(), -1);
6538    }
6539    if (element.hasCode()) {
6540      composeCodeableConcept(t, "ClinicalUseDefinitionWarningComponent", "code", element.getCode(), -1);
6541    }
6542  }
6543
6544  protected void composeCodeSystem(Complex parent, String parentType, String name, CodeSystem element, int index) {
6545    if (element == null) 
6546      return;
6547    Complex t;
6548    if (Utilities.noString(parentType))
6549      t = parent;
6550    else {
6551      t = parent.predicate("fhir:"+parentType+'.'+name);
6552    }
6553    composeMetadataResource(t, "CodeSystem", name, element, index);
6554    if (element.hasUrlElement()) {
6555      composeUri(t, "CodeSystem", "url", element.getUrlElement(), -1);
6556    }
6557    for (int i = 0; i < element.getIdentifier().size(); i++) {
6558      composeIdentifier(t, "CodeSystem", "identifier", element.getIdentifier().get(i), i);
6559    }
6560    if (element.hasVersionElement()) {
6561      composeString(t, "CodeSystem", "version", element.getVersionElement(), -1);
6562    }
6563    if (element.hasNameElement()) {
6564      composeString(t, "CodeSystem", "name", element.getNameElement(), -1);
6565    }
6566    if (element.hasTitleElement()) {
6567      composeString(t, "CodeSystem", "title", element.getTitleElement(), -1);
6568    }
6569    if (element.hasStatusElement()) {
6570      composeEnum(t, "CodeSystem", "status", element.getStatusElement(), -1);
6571    }
6572    if (element.hasExperimentalElement()) {
6573      composeBoolean(t, "CodeSystem", "experimental", element.getExperimentalElement(), -1);
6574    }
6575    if (element.hasDateElement()) {
6576      composeDateTime(t, "CodeSystem", "date", element.getDateElement(), -1);
6577    }
6578    if (element.hasPublisherElement()) {
6579      composeString(t, "CodeSystem", "publisher", element.getPublisherElement(), -1);
6580    }
6581    for (int i = 0; i < element.getContact().size(); i++) {
6582      composeContactDetail(t, "CodeSystem", "contact", element.getContact().get(i), i);
6583    }
6584    if (element.hasDescriptionElement()) {
6585      composeMarkdown(t, "CodeSystem", "description", element.getDescriptionElement(), -1);
6586    }
6587    for (int i = 0; i < element.getUseContext().size(); i++) {
6588      composeUsageContext(t, "CodeSystem", "useContext", element.getUseContext().get(i), i);
6589    }
6590    for (int i = 0; i < element.getJurisdiction().size(); i++) {
6591      composeCodeableConcept(t, "CodeSystem", "jurisdiction", element.getJurisdiction().get(i), i);
6592    }
6593    if (element.hasPurposeElement()) {
6594      composeMarkdown(t, "CodeSystem", "purpose", element.getPurposeElement(), -1);
6595    }
6596    if (element.hasCopyrightElement()) {
6597      composeMarkdown(t, "CodeSystem", "copyright", element.getCopyrightElement(), -1);
6598    }
6599    if (element.hasApprovalDateElement()) {
6600      composeDate(t, "CodeSystem", "approvalDate", element.getApprovalDateElement(), -1);
6601    }
6602    if (element.hasLastReviewDateElement()) {
6603      composeDate(t, "CodeSystem", "lastReviewDate", element.getLastReviewDateElement(), -1);
6604    }
6605    if (element.hasEffectivePeriod()) {
6606      composePeriod(t, "CodeSystem", "effectivePeriod", element.getEffectivePeriod(), -1);
6607    }
6608    for (int i = 0; i < element.getTopic().size(); i++) {
6609      composeCodeableConcept(t, "CodeSystem", "topic", element.getTopic().get(i), i);
6610    }
6611    for (int i = 0; i < element.getAuthor().size(); i++) {
6612      composeContactDetail(t, "CodeSystem", "author", element.getAuthor().get(i), i);
6613    }
6614    for (int i = 0; i < element.getEditor().size(); i++) {
6615      composeContactDetail(t, "CodeSystem", "editor", element.getEditor().get(i), i);
6616    }
6617    for (int i = 0; i < element.getReviewer().size(); i++) {
6618      composeContactDetail(t, "CodeSystem", "reviewer", element.getReviewer().get(i), i);
6619    }
6620    for (int i = 0; i < element.getEndorser().size(); i++) {
6621      composeContactDetail(t, "CodeSystem", "endorser", element.getEndorser().get(i), i);
6622    }
6623    for (int i = 0; i < element.getRelatedArtifact().size(); i++) {
6624      composeRelatedArtifact(t, "CodeSystem", "relatedArtifact", element.getRelatedArtifact().get(i), i);
6625    }
6626    if (element.hasCaseSensitiveElement()) {
6627      composeBoolean(t, "CodeSystem", "caseSensitive", element.getCaseSensitiveElement(), -1);
6628    }
6629    if (element.hasValueSetElement()) {
6630      composeCanonical(t, "CodeSystem", "valueSet", element.getValueSetElement(), -1);
6631    }
6632    if (element.hasHierarchyMeaningElement()) {
6633      composeEnum(t, "CodeSystem", "hierarchyMeaning", element.getHierarchyMeaningElement(), -1);
6634    }
6635    if (element.hasCompositionalElement()) {
6636      composeBoolean(t, "CodeSystem", "compositional", element.getCompositionalElement(), -1);
6637    }
6638    if (element.hasVersionNeededElement()) {
6639      composeBoolean(t, "CodeSystem", "versionNeeded", element.getVersionNeededElement(), -1);
6640    }
6641    if (element.hasContentElement()) {
6642      composeEnum(t, "CodeSystem", "content", element.getContentElement(), -1);
6643    }
6644    if (element.hasSupplementsElement()) {
6645      composeCanonical(t, "CodeSystem", "supplements", element.getSupplementsElement(), -1);
6646    }
6647    if (element.hasCountElement()) {
6648      composeUnsignedInt(t, "CodeSystem", "count", element.getCountElement(), -1);
6649    }
6650    for (int i = 0; i < element.getFilter().size(); i++) {
6651      composeCodeSystemFilterComponent(t, "CodeSystem", "filter", element.getFilter().get(i), i);
6652    }
6653    for (int i = 0; i < element.getProperty().size(); i++) {
6654      composeCodeSystemPropertyComponent(t, "CodeSystem", "property", element.getProperty().get(i), i);
6655    }
6656    for (int i = 0; i < element.getConcept().size(); i++) {
6657      composeCodeSystemConceptDefinitionComponent(t, "CodeSystem", "concept", element.getConcept().get(i), i);
6658    }
6659  }
6660
6661  protected void composeCodeSystemFilterComponent(Complex parent, String parentType, String name, CodeSystem.CodeSystemFilterComponent element, int index) {
6662    if (element == null) 
6663      return;
6664    Complex t;
6665    if (Utilities.noString(parentType))
6666      t = parent;
6667    else {
6668      t = parent.predicate("fhir:"+parentType+'.'+name);
6669    }
6670    composeBackboneElement(t, "filter", name, element, index);
6671    if (element.hasCodeElement()) {
6672      composeCode(t, "CodeSystemFilterComponent", "code", element.getCodeElement(), -1);
6673    }
6674    if (element.hasDescriptionElement()) {
6675      composeString(t, "CodeSystemFilterComponent", "description", element.getDescriptionElement(), -1);
6676    }
6677    for (int i = 0; i < element.getOperator().size(); i++) {
6678      composeEnum(t, "CodeSystemFilterComponent", "operator", element.getOperator().get(i), i);
6679    }
6680    if (element.hasValueElement()) {
6681      composeString(t, "CodeSystemFilterComponent", "value", element.getValueElement(), -1);
6682    }
6683  }
6684
6685  protected void composeCodeSystemPropertyComponent(Complex parent, String parentType, String name, CodeSystem.PropertyComponent element, int index) {
6686    if (element == null) 
6687      return;
6688    Complex t;
6689    if (Utilities.noString(parentType))
6690      t = parent;
6691    else {
6692      t = parent.predicate("fhir:"+parentType+'.'+name);
6693    }
6694    composeBackboneElement(t, "property", name, element, index);
6695    if (element.hasCodeElement()) {
6696      composeCode(t, "PropertyComponent", "code", element.getCodeElement(), -1);
6697    }
6698    if (element.hasUriElement()) {
6699      composeUri(t, "PropertyComponent", "uri", element.getUriElement(), -1);
6700    }
6701    if (element.hasDescriptionElement()) {
6702      composeString(t, "PropertyComponent", "description", element.getDescriptionElement(), -1);
6703    }
6704    if (element.hasTypeElement()) {
6705      composeEnum(t, "PropertyComponent", "type", element.getTypeElement(), -1);
6706    }
6707  }
6708
6709  protected void composeCodeSystemConceptDefinitionComponent(Complex parent, String parentType, String name, CodeSystem.ConceptDefinitionComponent element, int index) {
6710    if (element == null) 
6711      return;
6712    Complex t;
6713    if (Utilities.noString(parentType))
6714      t = parent;
6715    else {
6716      t = parent.predicate("fhir:"+parentType+'.'+name);
6717    }
6718    composeBackboneElement(t, "concept", name, element, index);
6719    if (element.hasCodeElement()) {
6720      composeCode(t, "ConceptDefinitionComponent", "code", element.getCodeElement(), -1);
6721    }
6722    if (element.hasDisplayElement()) {
6723      composeString(t, "ConceptDefinitionComponent", "display", element.getDisplayElement(), -1);
6724    }
6725    if (element.hasDefinitionElement()) {
6726      composeString(t, "ConceptDefinitionComponent", "definition", element.getDefinitionElement(), -1);
6727    }
6728    for (int i = 0; i < element.getDesignation().size(); i++) {
6729      composeCodeSystemConceptDefinitionDesignationComponent(t, "ConceptDefinitionComponent", "designation", element.getDesignation().get(i), i);
6730    }
6731    for (int i = 0; i < element.getProperty().size(); i++) {
6732      composeCodeSystemConceptPropertyComponent(t, "ConceptDefinitionComponent", "property", element.getProperty().get(i), i);
6733    }
6734    for (int i = 0; i < element.getConcept().size(); i++) {
6735      composeCodeSystemConceptDefinitionComponent(t, "ConceptDefinitionComponent", "concept", element.getConcept().get(i), i);
6736    }
6737  }
6738
6739  protected void composeCodeSystemConceptDefinitionDesignationComponent(Complex parent, String parentType, String name, CodeSystem.ConceptDefinitionDesignationComponent element, int index) {
6740    if (element == null) 
6741      return;
6742    Complex t;
6743    if (Utilities.noString(parentType))
6744      t = parent;
6745    else {
6746      t = parent.predicate("fhir:"+parentType+'.'+name);
6747    }
6748    composeBackboneElement(t, "designation", name, element, index);
6749    if (element.hasLanguageElement()) {
6750      composeCode(t, "ConceptDefinitionDesignationComponent", "language", element.getLanguageElement(), -1);
6751    }
6752    if (element.hasUse()) {
6753      composeCoding(t, "ConceptDefinitionDesignationComponent", "use", element.getUse(), -1);
6754    }
6755    for (int i = 0; i < element.getAdditionalUse().size(); i++) {
6756      composeCoding(t, "ConceptDefinitionDesignationComponent", "additionalUse", element.getAdditionalUse().get(i), i);
6757    }
6758    if (element.hasValueElement()) {
6759      composeString(t, "ConceptDefinitionDesignationComponent", "value", element.getValueElement(), -1);
6760    }
6761  }
6762
6763  protected void composeCodeSystemConceptPropertyComponent(Complex parent, String parentType, String name, CodeSystem.ConceptPropertyComponent element, int index) {
6764    if (element == null) 
6765      return;
6766    Complex t;
6767    if (Utilities.noString(parentType))
6768      t = parent;
6769    else {
6770      t = parent.predicate("fhir:"+parentType+'.'+name);
6771    }
6772    composeBackboneElement(t, "property", name, element, index);
6773    if (element.hasCodeElement()) {
6774      composeCode(t, "ConceptPropertyComponent", "code", element.getCodeElement(), -1);
6775    }
6776    if (element.hasValue()) {
6777      composeType(t, "ConceptPropertyComponent", "value", element.getValue(), -1);
6778    }
6779  }
6780
6781  protected void composeCommunication(Complex parent, String parentType, String name, Communication element, int index) {
6782    if (element == null) 
6783      return;
6784    Complex t;
6785    if (Utilities.noString(parentType))
6786      t = parent;
6787    else {
6788      t = parent.predicate("fhir:"+parentType+'.'+name);
6789    }
6790    composeDomainResource(t, "Communication", name, element, index);
6791    for (int i = 0; i < element.getIdentifier().size(); i++) {
6792      composeIdentifier(t, "Communication", "identifier", element.getIdentifier().get(i), i);
6793    }
6794    for (int i = 0; i < element.getInstantiatesCanonical().size(); i++) {
6795      composeCanonical(t, "Communication", "instantiatesCanonical", element.getInstantiatesCanonical().get(i), i);
6796    }
6797    for (int i = 0; i < element.getInstantiatesUri().size(); i++) {
6798      composeUri(t, "Communication", "instantiatesUri", element.getInstantiatesUri().get(i), i);
6799    }
6800    for (int i = 0; i < element.getBasedOn().size(); i++) {
6801      composeReference(t, "Communication", "basedOn", element.getBasedOn().get(i), i);
6802    }
6803    for (int i = 0; i < element.getPartOf().size(); i++) {
6804      composeReference(t, "Communication", "partOf", element.getPartOf().get(i), i);
6805    }
6806    for (int i = 0; i < element.getInResponseTo().size(); i++) {
6807      composeReference(t, "Communication", "inResponseTo", element.getInResponseTo().get(i), i);
6808    }
6809    if (element.hasStatusElement()) {
6810      composeEnum(t, "Communication", "status", element.getStatusElement(), -1);
6811    }
6812    if (element.hasStatusReason()) {
6813      composeCodeableConcept(t, "Communication", "statusReason", element.getStatusReason(), -1);
6814    }
6815    for (int i = 0; i < element.getCategory().size(); i++) {
6816      composeCodeableConcept(t, "Communication", "category", element.getCategory().get(i), i);
6817    }
6818    if (element.hasPriorityElement()) {
6819      composeEnum(t, "Communication", "priority", element.getPriorityElement(), -1);
6820    }
6821    for (int i = 0; i < element.getMedium().size(); i++) {
6822      composeCodeableConcept(t, "Communication", "medium", element.getMedium().get(i), i);
6823    }
6824    if (element.hasSubject()) {
6825      composeReference(t, "Communication", "subject", element.getSubject(), -1);
6826    }
6827    if (element.hasTopic()) {
6828      composeCodeableConcept(t, "Communication", "topic", element.getTopic(), -1);
6829    }
6830    for (int i = 0; i < element.getAbout().size(); i++) {
6831      composeReference(t, "Communication", "about", element.getAbout().get(i), i);
6832    }
6833    if (element.hasEncounter()) {
6834      composeReference(t, "Communication", "encounter", element.getEncounter(), -1);
6835    }
6836    if (element.hasSentElement()) {
6837      composeDateTime(t, "Communication", "sent", element.getSentElement(), -1);
6838    }
6839    if (element.hasReceivedElement()) {
6840      composeDateTime(t, "Communication", "received", element.getReceivedElement(), -1);
6841    }
6842    for (int i = 0; i < element.getRecipient().size(); i++) {
6843      composeReference(t, "Communication", "recipient", element.getRecipient().get(i), i);
6844    }
6845    if (element.hasSender()) {
6846      composeReference(t, "Communication", "sender", element.getSender(), -1);
6847    }
6848    for (int i = 0; i < element.getReason().size(); i++) {
6849      composeCodeableReference(t, "Communication", "reason", element.getReason().get(i), i);
6850    }
6851    for (int i = 0; i < element.getPayload().size(); i++) {
6852      composeCommunicationPayloadComponent(t, "Communication", "payload", element.getPayload().get(i), i);
6853    }
6854    for (int i = 0; i < element.getNote().size(); i++) {
6855      composeAnnotation(t, "Communication", "note", element.getNote().get(i), i);
6856    }
6857  }
6858
6859  protected void composeCommunicationPayloadComponent(Complex parent, String parentType, String name, Communication.CommunicationPayloadComponent element, int index) {
6860    if (element == null) 
6861      return;
6862    Complex t;
6863    if (Utilities.noString(parentType))
6864      t = parent;
6865    else {
6866      t = parent.predicate("fhir:"+parentType+'.'+name);
6867    }
6868    composeBackboneElement(t, "payload", name, element, index);
6869    if (element.hasContent()) {
6870      composeType(t, "CommunicationPayloadComponent", "content", element.getContent(), -1);
6871    }
6872  }
6873
6874  protected void composeCommunicationRequest(Complex parent, String parentType, String name, CommunicationRequest element, int index) {
6875    if (element == null) 
6876      return;
6877    Complex t;
6878    if (Utilities.noString(parentType))
6879      t = parent;
6880    else {
6881      t = parent.predicate("fhir:"+parentType+'.'+name);
6882    }
6883    composeDomainResource(t, "CommunicationRequest", name, element, index);
6884    for (int i = 0; i < element.getIdentifier().size(); i++) {
6885      composeIdentifier(t, "CommunicationRequest", "identifier", element.getIdentifier().get(i), i);
6886    }
6887    for (int i = 0; i < element.getBasedOn().size(); i++) {
6888      composeReference(t, "CommunicationRequest", "basedOn", element.getBasedOn().get(i), i);
6889    }
6890    for (int i = 0; i < element.getReplaces().size(); i++) {
6891      composeReference(t, "CommunicationRequest", "replaces", element.getReplaces().get(i), i);
6892    }
6893    if (element.hasGroupIdentifier()) {
6894      composeIdentifier(t, "CommunicationRequest", "groupIdentifier", element.getGroupIdentifier(), -1);
6895    }
6896    if (element.hasStatusElement()) {
6897      composeEnum(t, "CommunicationRequest", "status", element.getStatusElement(), -1);
6898    }
6899    if (element.hasStatusReason()) {
6900      composeCodeableConcept(t, "CommunicationRequest", "statusReason", element.getStatusReason(), -1);
6901    }
6902    if (element.hasIntentElement()) {
6903      composeEnum(t, "CommunicationRequest", "intent", element.getIntentElement(), -1);
6904    }
6905    for (int i = 0; i < element.getCategory().size(); i++) {
6906      composeCodeableConcept(t, "CommunicationRequest", "category", element.getCategory().get(i), i);
6907    }
6908    if (element.hasPriorityElement()) {
6909      composeEnum(t, "CommunicationRequest", "priority", element.getPriorityElement(), -1);
6910    }
6911    if (element.hasDoNotPerformElement()) {
6912      composeBoolean(t, "CommunicationRequest", "doNotPerform", element.getDoNotPerformElement(), -1);
6913    }
6914    for (int i = 0; i < element.getMedium().size(); i++) {
6915      composeCodeableConcept(t, "CommunicationRequest", "medium", element.getMedium().get(i), i);
6916    }
6917    if (element.hasSubject()) {
6918      composeReference(t, "CommunicationRequest", "subject", element.getSubject(), -1);
6919    }
6920    for (int i = 0; i < element.getAbout().size(); i++) {
6921      composeReference(t, "CommunicationRequest", "about", element.getAbout().get(i), i);
6922    }
6923    if (element.hasEncounter()) {
6924      composeReference(t, "CommunicationRequest", "encounter", element.getEncounter(), -1);
6925    }
6926    for (int i = 0; i < element.getPayload().size(); i++) {
6927      composeCommunicationRequestPayloadComponent(t, "CommunicationRequest", "payload", element.getPayload().get(i), i);
6928    }
6929    if (element.hasOccurrence()) {
6930      composeType(t, "CommunicationRequest", "occurrence", element.getOccurrence(), -1);
6931    }
6932    if (element.hasAuthoredOnElement()) {
6933      composeDateTime(t, "CommunicationRequest", "authoredOn", element.getAuthoredOnElement(), -1);
6934    }
6935    if (element.hasRequester()) {
6936      composeReference(t, "CommunicationRequest", "requester", element.getRequester(), -1);
6937    }
6938    for (int i = 0; i < element.getRecipient().size(); i++) {
6939      composeReference(t, "CommunicationRequest", "recipient", element.getRecipient().get(i), i);
6940    }
6941    for (int i = 0; i < element.getInformationProvider().size(); i++) {
6942      composeReference(t, "CommunicationRequest", "informationProvider", element.getInformationProvider().get(i), i);
6943    }
6944    for (int i = 0; i < element.getReason().size(); i++) {
6945      composeCodeableReference(t, "CommunicationRequest", "reason", element.getReason().get(i), i);
6946    }
6947    for (int i = 0; i < element.getNote().size(); i++) {
6948      composeAnnotation(t, "CommunicationRequest", "note", element.getNote().get(i), i);
6949    }
6950  }
6951
6952  protected void composeCommunicationRequestPayloadComponent(Complex parent, String parentType, String name, CommunicationRequest.CommunicationRequestPayloadComponent 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, "payload", name, element, index);
6962    if (element.hasContent()) {
6963      composeType(t, "CommunicationRequestPayloadComponent", "content", element.getContent(), -1);
6964    }
6965  }
6966
6967  protected void composeCompartmentDefinition(Complex parent, String parentType, String name, CompartmentDefinition element, int index) {
6968    if (element == null) 
6969      return;
6970    Complex t;
6971    if (Utilities.noString(parentType))
6972      t = parent;
6973    else {
6974      t = parent.predicate("fhir:"+parentType+'.'+name);
6975    }
6976    composeCanonicalResource(t, "CompartmentDefinition", name, element, index);
6977    if (element.hasUrlElement()) {
6978      composeUri(t, "CompartmentDefinition", "url", element.getUrlElement(), -1);
6979    }
6980    if (element.hasVersionElement()) {
6981      composeString(t, "CompartmentDefinition", "version", element.getVersionElement(), -1);
6982    }
6983    if (element.hasVersionAlgorithm()) {
6984      composeType(t, "CompartmentDefinition", "versionAlgorithm", element.getVersionAlgorithm(), -1);
6985    }
6986    if (element.hasNameElement()) {
6987      composeString(t, "CompartmentDefinition", "name", element.getNameElement(), -1);
6988    }
6989    if (element.hasTitleElement()) {
6990      composeString(t, "CompartmentDefinition", "title", element.getTitleElement(), -1);
6991    }
6992    if (element.hasStatusElement()) {
6993      composeEnum(t, "CompartmentDefinition", "status", element.getStatusElement(), -1);
6994    }
6995    if (element.hasExperimentalElement()) {
6996      composeBoolean(t, "CompartmentDefinition", "experimental", element.getExperimentalElement(), -1);
6997    }
6998    if (element.hasDateElement()) {
6999      composeDateTime(t, "CompartmentDefinition", "date", element.getDateElement(), -1);
7000    }
7001    if (element.hasPublisherElement()) {
7002      composeString(t, "CompartmentDefinition", "publisher", element.getPublisherElement(), -1);
7003    }
7004    for (int i = 0; i < element.getContact().size(); i++) {
7005      composeContactDetail(t, "CompartmentDefinition", "contact", element.getContact().get(i), i);
7006    }
7007    if (element.hasDescriptionElement()) {
7008      composeMarkdown(t, "CompartmentDefinition", "description", element.getDescriptionElement(), -1);
7009    }
7010    for (int i = 0; i < element.getUseContext().size(); i++) {
7011      composeUsageContext(t, "CompartmentDefinition", "useContext", element.getUseContext().get(i), i);
7012    }
7013    if (element.hasPurposeElement()) {
7014      composeMarkdown(t, "CompartmentDefinition", "purpose", element.getPurposeElement(), -1);
7015    }
7016    if (element.hasCodeElement()) {
7017      composeEnum(t, "CompartmentDefinition", "code", element.getCodeElement(), -1);
7018    }
7019    if (element.hasSearchElement()) {
7020      composeBoolean(t, "CompartmentDefinition", "search", element.getSearchElement(), -1);
7021    }
7022    for (int i = 0; i < element.getResource().size(); i++) {
7023      composeCompartmentDefinitionResourceComponent(t, "CompartmentDefinition", "resource", element.getResource().get(i), i);
7024    }
7025  }
7026
7027  protected void composeCompartmentDefinitionResourceComponent(Complex parent, String parentType, String name, CompartmentDefinition.CompartmentDefinitionResourceComponent element, int index) {
7028    if (element == null) 
7029      return;
7030    Complex t;
7031    if (Utilities.noString(parentType))
7032      t = parent;
7033    else {
7034      t = parent.predicate("fhir:"+parentType+'.'+name);
7035    }
7036    composeBackboneElement(t, "resource", name, element, index);
7037    if (element.hasCodeElement()) {
7038      composeCode(t, "CompartmentDefinitionResourceComponent", "code", element.getCodeElement(), -1);
7039    }
7040    for (int i = 0; i < element.getParam().size(); i++) {
7041      composeString(t, "CompartmentDefinitionResourceComponent", "param", element.getParam().get(i), i);
7042    }
7043    if (element.hasDocumentationElement()) {
7044      composeString(t, "CompartmentDefinitionResourceComponent", "documentation", element.getDocumentationElement(), -1);
7045    }
7046    if (element.hasStartParamElement()) {
7047      composeUri(t, "CompartmentDefinitionResourceComponent", "startParam", element.getStartParamElement(), -1);
7048    }
7049    if (element.hasEndParamElement()) {
7050      composeUri(t, "CompartmentDefinitionResourceComponent", "endParam", element.getEndParamElement(), -1);
7051    }
7052  }
7053
7054  protected void composeComposition(Complex parent, String parentType, String name, Composition element, int index) {
7055    if (element == null) 
7056      return;
7057    Complex t;
7058    if (Utilities.noString(parentType))
7059      t = parent;
7060    else {
7061      t = parent.predicate("fhir:"+parentType+'.'+name);
7062    }
7063    composeDomainResource(t, "Composition", name, element, index);
7064    if (element.hasUrlElement()) {
7065      composeUri(t, "Composition", "url", element.getUrlElement(), -1);
7066    }
7067    for (int i = 0; i < element.getIdentifier().size(); i++) {
7068      composeIdentifier(t, "Composition", "identifier", element.getIdentifier().get(i), i);
7069    }
7070    if (element.hasVersionElement()) {
7071      composeString(t, "Composition", "version", element.getVersionElement(), -1);
7072    }
7073    if (element.hasStatusElement()) {
7074      composeEnum(t, "Composition", "status", element.getStatusElement(), -1);
7075    }
7076    if (element.hasType()) {
7077      composeCodeableConcept(t, "Composition", "type", element.getType(), -1);
7078    }
7079    for (int i = 0; i < element.getCategory().size(); i++) {
7080      composeCodeableConcept(t, "Composition", "category", element.getCategory().get(i), i);
7081    }
7082    for (int i = 0; i < element.getSubject().size(); i++) {
7083      composeReference(t, "Composition", "subject", element.getSubject().get(i), i);
7084    }
7085    if (element.hasEncounter()) {
7086      composeReference(t, "Composition", "encounter", element.getEncounter(), -1);
7087    }
7088    if (element.hasDateElement()) {
7089      composeDateTime(t, "Composition", "date", element.getDateElement(), -1);
7090    }
7091    for (int i = 0; i < element.getUseContext().size(); i++) {
7092      composeUsageContext(t, "Composition", "useContext", element.getUseContext().get(i), i);
7093    }
7094    for (int i = 0; i < element.getAuthor().size(); i++) {
7095      composeReference(t, "Composition", "author", element.getAuthor().get(i), i);
7096    }
7097    if (element.hasNameElement()) {
7098      composeString(t, "Composition", "name", element.getNameElement(), -1);
7099    }
7100    if (element.hasTitleElement()) {
7101      composeString(t, "Composition", "title", element.getTitleElement(), -1);
7102    }
7103    for (int i = 0; i < element.getNote().size(); i++) {
7104      composeAnnotation(t, "Composition", "note", element.getNote().get(i), i);
7105    }
7106    for (int i = 0; i < element.getAttester().size(); i++) {
7107      composeCompositionAttesterComponent(t, "Composition", "attester", element.getAttester().get(i), i);
7108    }
7109    if (element.hasCustodian()) {
7110      composeReference(t, "Composition", "custodian", element.getCustodian(), -1);
7111    }
7112    for (int i = 0; i < element.getRelatesTo().size(); i++) {
7113      composeRelatedArtifact(t, "Composition", "relatesTo", element.getRelatesTo().get(i), i);
7114    }
7115    for (int i = 0; i < element.getEvent().size(); i++) {
7116      composeCompositionEventComponent(t, "Composition", "event", element.getEvent().get(i), i);
7117    }
7118    for (int i = 0; i < element.getSection().size(); i++) {
7119      composeCompositionSectionComponent(t, "Composition", "section", element.getSection().get(i), i);
7120    }
7121  }
7122
7123  protected void composeCompositionAttesterComponent(Complex parent, String parentType, String name, Composition.CompositionAttesterComponent element, int index) {
7124    if (element == null) 
7125      return;
7126    Complex t;
7127    if (Utilities.noString(parentType))
7128      t = parent;
7129    else {
7130      t = parent.predicate("fhir:"+parentType+'.'+name);
7131    }
7132    composeBackboneElement(t, "attester", name, element, index);
7133    if (element.hasMode()) {
7134      composeCodeableConcept(t, "CompositionAttesterComponent", "mode", element.getMode(), -1);
7135    }
7136    if (element.hasTimeElement()) {
7137      composeDateTime(t, "CompositionAttesterComponent", "time", element.getTimeElement(), -1);
7138    }
7139    if (element.hasParty()) {
7140      composeReference(t, "CompositionAttesterComponent", "party", element.getParty(), -1);
7141    }
7142  }
7143
7144  protected void composeCompositionEventComponent(Complex parent, String parentType, String name, Composition.CompositionEventComponent element, int index) {
7145    if (element == null) 
7146      return;
7147    Complex t;
7148    if (Utilities.noString(parentType))
7149      t = parent;
7150    else {
7151      t = parent.predicate("fhir:"+parentType+'.'+name);
7152    }
7153    composeBackboneElement(t, "event", name, element, index);
7154    for (int i = 0; i < element.getCode().size(); i++) {
7155      composeCodeableConcept(t, "CompositionEventComponent", "code", element.getCode().get(i), i);
7156    }
7157    if (element.hasPeriod()) {
7158      composePeriod(t, "CompositionEventComponent", "period", element.getPeriod(), -1);
7159    }
7160    for (int i = 0; i < element.getDetail().size(); i++) {
7161      composeReference(t, "CompositionEventComponent", "detail", element.getDetail().get(i), i);
7162    }
7163  }
7164
7165  protected void composeCompositionSectionComponent(Complex parent, String parentType, String name, Composition.SectionComponent element, int index) {
7166    if (element == null) 
7167      return;
7168    Complex t;
7169    if (Utilities.noString(parentType))
7170      t = parent;
7171    else {
7172      t = parent.predicate("fhir:"+parentType+'.'+name);
7173    }
7174    composeBackboneElement(t, "section", name, element, index);
7175    if (element.hasTitleElement()) {
7176      composeString(t, "SectionComponent", "title", element.getTitleElement(), -1);
7177    }
7178    if (element.hasCode()) {
7179      composeCodeableConcept(t, "SectionComponent", "code", element.getCode(), -1);
7180    }
7181    for (int i = 0; i < element.getAuthor().size(); i++) {
7182      composeReference(t, "SectionComponent", "author", element.getAuthor().get(i), i);
7183    }
7184    if (element.hasFocus()) {
7185      composeReference(t, "SectionComponent", "focus", element.getFocus(), -1);
7186    }
7187    if (element.hasText()) {
7188      composeNarrative(t, "SectionComponent", "text", element.getText(), -1);
7189    }
7190    if (element.hasModeElement()) {
7191      composeEnum(t, "SectionComponent", "mode", element.getModeElement(), -1);
7192    }
7193    if (element.hasOrderedBy()) {
7194      composeCodeableConcept(t, "SectionComponent", "orderedBy", element.getOrderedBy(), -1);
7195    }
7196    for (int i = 0; i < element.getEntry().size(); i++) {
7197      composeReference(t, "SectionComponent", "entry", element.getEntry().get(i), i);
7198    }
7199    if (element.hasEmptyReason()) {
7200      composeCodeableConcept(t, "SectionComponent", "emptyReason", element.getEmptyReason(), -1);
7201    }
7202    for (int i = 0; i < element.getSection().size(); i++) {
7203      composeCompositionSectionComponent(t, "SectionComponent", "section", element.getSection().get(i), i);
7204    }
7205  }
7206
7207  protected void composeConceptMap(Complex parent, String parentType, String name, ConceptMap element, int index) {
7208    if (element == null) 
7209      return;
7210    Complex t;
7211    if (Utilities.noString(parentType))
7212      t = parent;
7213    else {
7214      t = parent.predicate("fhir:"+parentType+'.'+name);
7215    }
7216    composeMetadataResource(t, "ConceptMap", name, element, index);
7217    if (element.hasUrlElement()) {
7218      composeUri(t, "ConceptMap", "url", element.getUrlElement(), -1);
7219    }
7220    for (int i = 0; i < element.getIdentifier().size(); i++) {
7221      composeIdentifier(t, "ConceptMap", "identifier", element.getIdentifier().get(i), i);
7222    }
7223    if (element.hasVersionElement()) {
7224      composeString(t, "ConceptMap", "version", element.getVersionElement(), -1);
7225    }
7226    if (element.hasNameElement()) {
7227      composeString(t, "ConceptMap", "name", element.getNameElement(), -1);
7228    }
7229    if (element.hasTitleElement()) {
7230      composeString(t, "ConceptMap", "title", element.getTitleElement(), -1);
7231    }
7232    if (element.hasStatusElement()) {
7233      composeEnum(t, "ConceptMap", "status", element.getStatusElement(), -1);
7234    }
7235    if (element.hasExperimentalElement()) {
7236      composeBoolean(t, "ConceptMap", "experimental", element.getExperimentalElement(), -1);
7237    }
7238    if (element.hasDateElement()) {
7239      composeDateTime(t, "ConceptMap", "date", element.getDateElement(), -1);
7240    }
7241    if (element.hasPublisherElement()) {
7242      composeString(t, "ConceptMap", "publisher", element.getPublisherElement(), -1);
7243    }
7244    for (int i = 0; i < element.getContact().size(); i++) {
7245      composeContactDetail(t, "ConceptMap", "contact", element.getContact().get(i), i);
7246    }
7247    if (element.hasDescriptionElement()) {
7248      composeMarkdown(t, "ConceptMap", "description", element.getDescriptionElement(), -1);
7249    }
7250    for (int i = 0; i < element.getUseContext().size(); i++) {
7251      composeUsageContext(t, "ConceptMap", "useContext", element.getUseContext().get(i), i);
7252    }
7253    for (int i = 0; i < element.getJurisdiction().size(); i++) {
7254      composeCodeableConcept(t, "ConceptMap", "jurisdiction", element.getJurisdiction().get(i), i);
7255    }
7256    if (element.hasPurposeElement()) {
7257      composeMarkdown(t, "ConceptMap", "purpose", element.getPurposeElement(), -1);
7258    }
7259    if (element.hasCopyrightElement()) {
7260      composeMarkdown(t, "ConceptMap", "copyright", element.getCopyrightElement(), -1);
7261    }
7262    if (element.hasApprovalDateElement()) {
7263      composeDate(t, "ConceptMap", "approvalDate", element.getApprovalDateElement(), -1);
7264    }
7265    if (element.hasLastReviewDateElement()) {
7266      composeDate(t, "ConceptMap", "lastReviewDate", element.getLastReviewDateElement(), -1);
7267    }
7268    if (element.hasEffectivePeriod()) {
7269      composePeriod(t, "ConceptMap", "effectivePeriod", element.getEffectivePeriod(), -1);
7270    }
7271    for (int i = 0; i < element.getTopic().size(); i++) {
7272      composeCodeableConcept(t, "ConceptMap", "topic", element.getTopic().get(i), i);
7273    }
7274    for (int i = 0; i < element.getAuthor().size(); i++) {
7275      composeContactDetail(t, "ConceptMap", "author", element.getAuthor().get(i), i);
7276    }
7277    for (int i = 0; i < element.getEditor().size(); i++) {
7278      composeContactDetail(t, "ConceptMap", "editor", element.getEditor().get(i), i);
7279    }
7280    for (int i = 0; i < element.getReviewer().size(); i++) {
7281      composeContactDetail(t, "ConceptMap", "reviewer", element.getReviewer().get(i), i);
7282    }
7283    for (int i = 0; i < element.getEndorser().size(); i++) {
7284      composeContactDetail(t, "ConceptMap", "endorser", element.getEndorser().get(i), i);
7285    }
7286    for (int i = 0; i < element.getRelatedArtifact().size(); i++) {
7287      composeRelatedArtifact(t, "ConceptMap", "relatedArtifact", element.getRelatedArtifact().get(i), i);
7288    }
7289    if (element.hasSourceScope()) {
7290      composeType(t, "ConceptMap", "sourceScope", element.getSourceScope(), -1);
7291    }
7292    if (element.hasTargetScope()) {
7293      composeType(t, "ConceptMap", "targetScope", element.getTargetScope(), -1);
7294    }
7295    for (int i = 0; i < element.getGroup().size(); i++) {
7296      composeConceptMapGroupComponent(t, "ConceptMap", "group", element.getGroup().get(i), i);
7297    }
7298  }
7299
7300  protected void composeConceptMapGroupComponent(Complex parent, String parentType, String name, ConceptMap.ConceptMapGroupComponent element, int index) {
7301    if (element == null) 
7302      return;
7303    Complex t;
7304    if (Utilities.noString(parentType))
7305      t = parent;
7306    else {
7307      t = parent.predicate("fhir:"+parentType+'.'+name);
7308    }
7309    composeBackboneElement(t, "group", name, element, index);
7310    if (element.hasSourceElement()) {
7311      composeCanonical(t, "ConceptMapGroupComponent", "source", element.getSourceElement(), -1);
7312    }
7313    if (element.hasTargetElement()) {
7314      composeCanonical(t, "ConceptMapGroupComponent", "target", element.getTargetElement(), -1);
7315    }
7316    for (int i = 0; i < element.getElement().size(); i++) {
7317      composeConceptMapSourceElementComponent(t, "ConceptMapGroupComponent", "element", element.getElement().get(i), i);
7318    }
7319    if (element.hasUnmapped()) {
7320      composeConceptMapGroupUnmappedComponent(t, "ConceptMapGroupComponent", "unmapped", element.getUnmapped(), -1);
7321    }
7322  }
7323
7324  protected void composeConceptMapSourceElementComponent(Complex parent, String parentType, String name, ConceptMap.SourceElementComponent element, int index) {
7325    if (element == null) 
7326      return;
7327    Complex t;
7328    if (Utilities.noString(parentType))
7329      t = parent;
7330    else {
7331      t = parent.predicate("fhir:"+parentType+'.'+name);
7332    }
7333    composeBackboneElement(t, "element", name, element, index);
7334    if (element.hasCodeElement()) {
7335      composeCode(t, "SourceElementComponent", "code", element.getCodeElement(), -1);
7336    }
7337    if (element.hasDisplayElement()) {
7338      composeString(t, "SourceElementComponent", "display", element.getDisplayElement(), -1);
7339    }
7340    if (element.hasValueSetElement()) {
7341      composeCanonical(t, "SourceElementComponent", "valueSet", element.getValueSetElement(), -1);
7342    }
7343    if (element.hasNoMapElement()) {
7344      composeBoolean(t, "SourceElementComponent", "noMap", element.getNoMapElement(), -1);
7345    }
7346    for (int i = 0; i < element.getTarget().size(); i++) {
7347      composeConceptMapTargetElementComponent(t, "SourceElementComponent", "target", element.getTarget().get(i), i);
7348    }
7349  }
7350
7351  protected void composeConceptMapTargetElementComponent(Complex parent, String parentType, String name, ConceptMap.TargetElementComponent element, int index) {
7352    if (element == null) 
7353      return;
7354    Complex t;
7355    if (Utilities.noString(parentType))
7356      t = parent;
7357    else {
7358      t = parent.predicate("fhir:"+parentType+'.'+name);
7359    }
7360    composeBackboneElement(t, "target", name, element, index);
7361    if (element.hasCodeElement()) {
7362      composeCode(t, "TargetElementComponent", "code", element.getCodeElement(), -1);
7363    }
7364    if (element.hasDisplayElement()) {
7365      composeString(t, "TargetElementComponent", "display", element.getDisplayElement(), -1);
7366    }
7367    if (element.hasValueSetElement()) {
7368      composeCanonical(t, "TargetElementComponent", "valueSet", element.getValueSetElement(), -1);
7369    }
7370    if (element.hasRelationshipElement()) {
7371      composeEnum(t, "TargetElementComponent", "relationship", element.getRelationshipElement(), -1);
7372    }
7373    if (element.hasCommentElement()) {
7374      composeString(t, "TargetElementComponent", "comment", element.getCommentElement(), -1);
7375    }
7376    for (int i = 0; i < element.getDependsOn().size(); i++) {
7377      composeConceptMapOtherElementComponent(t, "TargetElementComponent", "dependsOn", element.getDependsOn().get(i), i);
7378    }
7379    for (int i = 0; i < element.getProduct().size(); i++) {
7380      composeConceptMapOtherElementComponent(t, "TargetElementComponent", "product", element.getProduct().get(i), i);
7381    }
7382  }
7383
7384  protected void composeConceptMapOtherElementComponent(Complex parent, String parentType, String name, ConceptMap.OtherElementComponent element, int index) {
7385    if (element == null) 
7386      return;
7387    Complex t;
7388    if (Utilities.noString(parentType))
7389      t = parent;
7390    else {
7391      t = parent.predicate("fhir:"+parentType+'.'+name);
7392    }
7393    composeBackboneElement(t, "dependsOn", name, element, index);
7394    if (element.hasPropertyElement()) {
7395      composeUri(t, "OtherElementComponent", "property", element.getPropertyElement(), -1);
7396    }
7397    if (element.hasValue()) {
7398      composeType(t, "OtherElementComponent", "value", element.getValue(), -1);
7399    }
7400    if (element.hasValueSetElement()) {
7401      composeCanonical(t, "OtherElementComponent", "valueSet", element.getValueSetElement(), -1);
7402    }
7403  }
7404
7405  protected void composeConceptMapGroupUnmappedComponent(Complex parent, String parentType, String name, ConceptMap.ConceptMapGroupUnmappedComponent element, int index) {
7406    if (element == null) 
7407      return;
7408    Complex t;
7409    if (Utilities.noString(parentType))
7410      t = parent;
7411    else {
7412      t = parent.predicate("fhir:"+parentType+'.'+name);
7413    }
7414    composeBackboneElement(t, "unmapped", name, element, index);
7415    if (element.hasModeElement()) {
7416      composeEnum(t, "ConceptMapGroupUnmappedComponent", "mode", element.getModeElement(), -1);
7417    }
7418    if (element.hasCodeElement()) {
7419      composeCode(t, "ConceptMapGroupUnmappedComponent", "code", element.getCodeElement(), -1);
7420    }
7421    if (element.hasDisplayElement()) {
7422      composeString(t, "ConceptMapGroupUnmappedComponent", "display", element.getDisplayElement(), -1);
7423    }
7424    if (element.hasValueSetElement()) {
7425      composeCanonical(t, "ConceptMapGroupUnmappedComponent", "valueSet", element.getValueSetElement(), -1);
7426    }
7427    if (element.hasRelationshipElement()) {
7428      composeEnum(t, "ConceptMapGroupUnmappedComponent", "relationship", element.getRelationshipElement(), -1);
7429    }
7430    if (element.hasOtherMapElement()) {
7431      composeCanonical(t, "ConceptMapGroupUnmappedComponent", "otherMap", element.getOtherMapElement(), -1);
7432    }
7433  }
7434
7435  protected void composeCondition(Complex parent, String parentType, String name, Condition element, int index) {
7436    if (element == null) 
7437      return;
7438    Complex t;
7439    if (Utilities.noString(parentType))
7440      t = parent;
7441    else {
7442      t = parent.predicate("fhir:"+parentType+'.'+name);
7443    }
7444    composeDomainResource(t, "Condition", name, element, index);
7445    for (int i = 0; i < element.getIdentifier().size(); i++) {
7446      composeIdentifier(t, "Condition", "identifier", element.getIdentifier().get(i), i);
7447    }
7448    if (element.hasClinicalStatus()) {
7449      composeCodeableConcept(t, "Condition", "clinicalStatus", element.getClinicalStatus(), -1);
7450    }
7451    if (element.hasVerificationStatus()) {
7452      composeCodeableConcept(t, "Condition", "verificationStatus", element.getVerificationStatus(), -1);
7453    }
7454    for (int i = 0; i < element.getCategory().size(); i++) {
7455      composeCodeableConcept(t, "Condition", "category", element.getCategory().get(i), i);
7456    }
7457    if (element.hasSeverity()) {
7458      composeCodeableConcept(t, "Condition", "severity", element.getSeverity(), -1);
7459    }
7460    if (element.hasCode()) {
7461      composeCodeableConcept(t, "Condition", "code", element.getCode(), -1);
7462    }
7463    for (int i = 0; i < element.getBodySite().size(); i++) {
7464      composeCodeableConcept(t, "Condition", "bodySite", element.getBodySite().get(i), i);
7465    }
7466    if (element.hasSubject()) {
7467      composeReference(t, "Condition", "subject", element.getSubject(), -1);
7468    }
7469    if (element.hasEncounter()) {
7470      composeReference(t, "Condition", "encounter", element.getEncounter(), -1);
7471    }
7472    if (element.hasOnset()) {
7473      composeType(t, "Condition", "onset", element.getOnset(), -1);
7474    }
7475    if (element.hasAbatement()) {
7476      composeType(t, "Condition", "abatement", element.getAbatement(), -1);
7477    }
7478    if (element.hasRecordedDateElement()) {
7479      composeDateTime(t, "Condition", "recordedDate", element.getRecordedDateElement(), -1);
7480    }
7481    for (int i = 0; i < element.getParticipant().size(); i++) {
7482      composeConditionParticipantComponent(t, "Condition", "participant", element.getParticipant().get(i), i);
7483    }
7484    for (int i = 0; i < element.getStage().size(); i++) {
7485      composeConditionStageComponent(t, "Condition", "stage", element.getStage().get(i), i);
7486    }
7487    for (int i = 0; i < element.getEvidence().size(); i++) {
7488      composeCodeableReference(t, "Condition", "evidence", element.getEvidence().get(i), i);
7489    }
7490    for (int i = 0; i < element.getNote().size(); i++) {
7491      composeAnnotation(t, "Condition", "note", element.getNote().get(i), i);
7492    }
7493  }
7494
7495  protected void composeConditionParticipantComponent(Complex parent, String parentType, String name, Condition.ConditionParticipantComponent element, int index) {
7496    if (element == null) 
7497      return;
7498    Complex t;
7499    if (Utilities.noString(parentType))
7500      t = parent;
7501    else {
7502      t = parent.predicate("fhir:"+parentType+'.'+name);
7503    }
7504    composeBackboneElement(t, "participant", name, element, index);
7505    if (element.hasFunction()) {
7506      composeCodeableConcept(t, "ConditionParticipantComponent", "function", element.getFunction(), -1);
7507    }
7508    if (element.hasActor()) {
7509      composeReference(t, "ConditionParticipantComponent", "actor", element.getActor(), -1);
7510    }
7511  }
7512
7513  protected void composeConditionStageComponent(Complex parent, String parentType, String name, Condition.ConditionStageComponent element, int index) {
7514    if (element == null) 
7515      return;
7516    Complex t;
7517    if (Utilities.noString(parentType))
7518      t = parent;
7519    else {
7520      t = parent.predicate("fhir:"+parentType+'.'+name);
7521    }
7522    composeBackboneElement(t, "stage", name, element, index);
7523    if (element.hasSummary()) {
7524      composeCodeableConcept(t, "ConditionStageComponent", "summary", element.getSummary(), -1);
7525    }
7526    for (int i = 0; i < element.getAssessment().size(); i++) {
7527      composeReference(t, "ConditionStageComponent", "assessment", element.getAssessment().get(i), i);
7528    }
7529    if (element.hasType()) {
7530      composeCodeableConcept(t, "ConditionStageComponent", "type", element.getType(), -1);
7531    }
7532  }
7533
7534  protected void composeConditionDefinition(Complex parent, String parentType, String name, ConditionDefinition element, int index) {
7535    if (element == null) 
7536      return;
7537    Complex t;
7538    if (Utilities.noString(parentType))
7539      t = parent;
7540    else {
7541      t = parent.predicate("fhir:"+parentType+'.'+name);
7542    }
7543    composeMetadataResource(t, "ConditionDefinition", name, element, index);
7544    if (element.hasUrlElement()) {
7545      composeUri(t, "ConditionDefinition", "url", element.getUrlElement(), -1);
7546    }
7547    for (int i = 0; i < element.getIdentifier().size(); i++) {
7548      composeIdentifier(t, "ConditionDefinition", "identifier", element.getIdentifier().get(i), i);
7549    }
7550    if (element.hasVersionElement()) {
7551      composeString(t, "ConditionDefinition", "version", element.getVersionElement(), -1);
7552    }
7553    if (element.hasNameElement()) {
7554      composeString(t, "ConditionDefinition", "name", element.getNameElement(), -1);
7555    }
7556    if (element.hasTitleElement()) {
7557      composeString(t, "ConditionDefinition", "title", element.getTitleElement(), -1);
7558    }
7559    if (element.hasSubtitleElement()) {
7560      composeString(t, "ConditionDefinition", "subtitle", element.getSubtitleElement(), -1);
7561    }
7562    if (element.hasStatusElement()) {
7563      composeEnum(t, "ConditionDefinition", "status", element.getStatusElement(), -1);
7564    }
7565    if (element.hasExperimentalElement()) {
7566      composeBoolean(t, "ConditionDefinition", "experimental", element.getExperimentalElement(), -1);
7567    }
7568    if (element.hasDateElement()) {
7569      composeDateTime(t, "ConditionDefinition", "date", element.getDateElement(), -1);
7570    }
7571    if (element.hasPublisherElement()) {
7572      composeString(t, "ConditionDefinition", "publisher", element.getPublisherElement(), -1);
7573    }
7574    for (int i = 0; i < element.getContact().size(); i++) {
7575      composeContactDetail(t, "ConditionDefinition", "contact", element.getContact().get(i), i);
7576    }
7577    if (element.hasDescriptionElement()) {
7578      composeMarkdown(t, "ConditionDefinition", "description", element.getDescriptionElement(), -1);
7579    }
7580    for (int i = 0; i < element.getUseContext().size(); i++) {
7581      composeUsageContext(t, "ConditionDefinition", "useContext", element.getUseContext().get(i), i);
7582    }
7583    for (int i = 0; i < element.getJurisdiction().size(); i++) {
7584      composeCodeableConcept(t, "ConditionDefinition", "jurisdiction", element.getJurisdiction().get(i), i);
7585    }
7586    if (element.hasCode()) {
7587      composeCodeableConcept(t, "ConditionDefinition", "code", element.getCode(), -1);
7588    }
7589    if (element.hasSeverity()) {
7590      composeCodeableConcept(t, "ConditionDefinition", "severity", element.getSeverity(), -1);
7591    }
7592    if (element.hasBodySite()) {
7593      composeCodeableConcept(t, "ConditionDefinition", "bodySite", element.getBodySite(), -1);
7594    }
7595    if (element.hasStage()) {
7596      composeCodeableConcept(t, "ConditionDefinition", "stage", element.getStage(), -1);
7597    }
7598    if (element.hasHasSeverityElement()) {
7599      composeBoolean(t, "ConditionDefinition", "hasSeverity", element.getHasSeverityElement(), -1);
7600    }
7601    if (element.hasHasBodySiteElement()) {
7602      composeBoolean(t, "ConditionDefinition", "hasBodySite", element.getHasBodySiteElement(), -1);
7603    }
7604    if (element.hasHasStageElement()) {
7605      composeBoolean(t, "ConditionDefinition", "hasStage", element.getHasStageElement(), -1);
7606    }
7607    for (int i = 0; i < element.getDefinition().size(); i++) {
7608      composeUri(t, "ConditionDefinition", "definition", element.getDefinition().get(i), i);
7609    }
7610    for (int i = 0; i < element.getObservation().size(); i++) {
7611      composeConditionDefinitionObservationComponent(t, "ConditionDefinition", "observation", element.getObservation().get(i), i);
7612    }
7613    for (int i = 0; i < element.getMedication().size(); i++) {
7614      composeConditionDefinitionMedicationComponent(t, "ConditionDefinition", "medication", element.getMedication().get(i), i);
7615    }
7616    for (int i = 0; i < element.getPrecondition().size(); i++) {
7617      composeConditionDefinitionPreconditionComponent(t, "ConditionDefinition", "precondition", element.getPrecondition().get(i), i);
7618    }
7619    for (int i = 0; i < element.getTeam().size(); i++) {
7620      composeReference(t, "ConditionDefinition", "team", element.getTeam().get(i), i);
7621    }
7622    for (int i = 0; i < element.getQuestionnaire().size(); i++) {
7623      composeConditionDefinitionQuestionnaireComponent(t, "ConditionDefinition", "questionnaire", element.getQuestionnaire().get(i), i);
7624    }
7625    for (int i = 0; i < element.getPlan().size(); i++) {
7626      composeConditionDefinitionPlanComponent(t, "ConditionDefinition", "plan", element.getPlan().get(i), i);
7627    }
7628  }
7629
7630  protected void composeConditionDefinitionObservationComponent(Complex parent, String parentType, String name, ConditionDefinition.ConditionDefinitionObservationComponent element, int index) {
7631    if (element == null) 
7632      return;
7633    Complex t;
7634    if (Utilities.noString(parentType))
7635      t = parent;
7636    else {
7637      t = parent.predicate("fhir:"+parentType+'.'+name);
7638    }
7639    composeBackboneElement(t, "observation", name, element, index);
7640    if (element.hasCategory()) {
7641      composeCodeableConcept(t, "ConditionDefinitionObservationComponent", "category", element.getCategory(), -1);
7642    }
7643    if (element.hasCode()) {
7644      composeCodeableConcept(t, "ConditionDefinitionObservationComponent", "code", element.getCode(), -1);
7645    }
7646  }
7647
7648  protected void composeConditionDefinitionMedicationComponent(Complex parent, String parentType, String name, ConditionDefinition.ConditionDefinitionMedicationComponent element, int index) {
7649    if (element == null) 
7650      return;
7651    Complex t;
7652    if (Utilities.noString(parentType))
7653      t = parent;
7654    else {
7655      t = parent.predicate("fhir:"+parentType+'.'+name);
7656    }
7657    composeBackboneElement(t, "medication", name, element, index);
7658    if (element.hasCategory()) {
7659      composeCodeableConcept(t, "ConditionDefinitionMedicationComponent", "category", element.getCategory(), -1);
7660    }
7661    if (element.hasCode()) {
7662      composeCodeableConcept(t, "ConditionDefinitionMedicationComponent", "code", element.getCode(), -1);
7663    }
7664  }
7665
7666  protected void composeConditionDefinitionPreconditionComponent(Complex parent, String parentType, String name, ConditionDefinition.ConditionDefinitionPreconditionComponent element, int index) {
7667    if (element == null) 
7668      return;
7669    Complex t;
7670    if (Utilities.noString(parentType))
7671      t = parent;
7672    else {
7673      t = parent.predicate("fhir:"+parentType+'.'+name);
7674    }
7675    composeBackboneElement(t, "precondition", name, element, index);
7676    if (element.hasTypeElement()) {
7677      composeEnum(t, "ConditionDefinitionPreconditionComponent", "type", element.getTypeElement(), -1);
7678    }
7679    if (element.hasCode()) {
7680      composeCodeableConcept(t, "ConditionDefinitionPreconditionComponent", "code", element.getCode(), -1);
7681    }
7682    if (element.hasValue()) {
7683      composeType(t, "ConditionDefinitionPreconditionComponent", "value", element.getValue(), -1);
7684    }
7685  }
7686
7687  protected void composeConditionDefinitionQuestionnaireComponent(Complex parent, String parentType, String name, ConditionDefinition.ConditionDefinitionQuestionnaireComponent element, int index) {
7688    if (element == null) 
7689      return;
7690    Complex t;
7691    if (Utilities.noString(parentType))
7692      t = parent;
7693    else {
7694      t = parent.predicate("fhir:"+parentType+'.'+name);
7695    }
7696    composeBackboneElement(t, "questionnaire", name, element, index);
7697    if (element.hasPurposeElement()) {
7698      composeEnum(t, "ConditionDefinitionQuestionnaireComponent", "purpose", element.getPurposeElement(), -1);
7699    }
7700    if (element.hasReference()) {
7701      composeReference(t, "ConditionDefinitionQuestionnaireComponent", "reference", element.getReference(), -1);
7702    }
7703  }
7704
7705  protected void composeConditionDefinitionPlanComponent(Complex parent, String parentType, String name, ConditionDefinition.ConditionDefinitionPlanComponent element, int index) {
7706    if (element == null) 
7707      return;
7708    Complex t;
7709    if (Utilities.noString(parentType))
7710      t = parent;
7711    else {
7712      t = parent.predicate("fhir:"+parentType+'.'+name);
7713    }
7714    composeBackboneElement(t, "plan", name, element, index);
7715    if (element.hasRole()) {
7716      composeCodeableConcept(t, "ConditionDefinitionPlanComponent", "role", element.getRole(), -1);
7717    }
7718    if (element.hasReference()) {
7719      composeReference(t, "ConditionDefinitionPlanComponent", "reference", element.getReference(), -1);
7720    }
7721  }
7722
7723  protected void composeConsent(Complex parent, String parentType, String name, Consent element, int index) {
7724    if (element == null) 
7725      return;
7726    Complex t;
7727    if (Utilities.noString(parentType))
7728      t = parent;
7729    else {
7730      t = parent.predicate("fhir:"+parentType+'.'+name);
7731    }
7732    composeDomainResource(t, "Consent", name, element, index);
7733    for (int i = 0; i < element.getIdentifier().size(); i++) {
7734      composeIdentifier(t, "Consent", "identifier", element.getIdentifier().get(i), i);
7735    }
7736    if (element.hasStatusElement()) {
7737      composeEnum(t, "Consent", "status", element.getStatusElement(), -1);
7738    }
7739    for (int i = 0; i < element.getCategory().size(); i++) {
7740      composeCodeableConcept(t, "Consent", "category", element.getCategory().get(i), i);
7741    }
7742    if (element.hasSubject()) {
7743      composeReference(t, "Consent", "subject", element.getSubject(), -1);
7744    }
7745    if (element.hasDateTimeElement()) {
7746      composeDateTime(t, "Consent", "dateTime", element.getDateTimeElement(), -1);
7747    }
7748    for (int i = 0; i < element.getGrantor().size(); i++) {
7749      composeReference(t, "Consent", "grantor", element.getGrantor().get(i), i);
7750    }
7751    for (int i = 0; i < element.getGrantee().size(); i++) {
7752      composeReference(t, "Consent", "grantee", element.getGrantee().get(i), i);
7753    }
7754    for (int i = 0; i < element.getManager().size(); i++) {
7755      composeReference(t, "Consent", "manager", element.getManager().get(i), i);
7756    }
7757    for (int i = 0; i < element.getController().size(); i++) {
7758      composeReference(t, "Consent", "controller", element.getController().get(i), i);
7759    }
7760    for (int i = 0; i < element.getSourceAttachment().size(); i++) {
7761      composeAttachment(t, "Consent", "sourceAttachment", element.getSourceAttachment().get(i), i);
7762    }
7763    for (int i = 0; i < element.getSourceReference().size(); i++) {
7764      composeReference(t, "Consent", "sourceReference", element.getSourceReference().get(i), i);
7765    }
7766    for (int i = 0; i < element.getRegulatoryBasis().size(); i++) {
7767      composeCodeableConcept(t, "Consent", "regulatoryBasis", element.getRegulatoryBasis().get(i), i);
7768    }
7769    if (element.hasPolicyBasis()) {
7770      composeConsentPolicyBasisComponent(t, "Consent", "policyBasis", element.getPolicyBasis(), -1);
7771    }
7772    for (int i = 0; i < element.getPolicyText().size(); i++) {
7773      composeReference(t, "Consent", "policyText", element.getPolicyText().get(i), i);
7774    }
7775    for (int i = 0; i < element.getVerification().size(); i++) {
7776      composeConsentVerificationComponent(t, "Consent", "verification", element.getVerification().get(i), i);
7777    }
7778    if (element.hasProvision()) {
7779      composeConsentProvisionComponent(t, "Consent", "provision", element.getProvision(), -1);
7780    }
7781  }
7782
7783  protected void composeConsentPolicyBasisComponent(Complex parent, String parentType, String name, Consent.ConsentPolicyBasisComponent 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, "policyBasis", name, element, index);
7793    if (element.hasReference()) {
7794      composeReference(t, "ConsentPolicyBasisComponent", "reference", element.getReference(), -1);
7795    }
7796    if (element.hasUrlElement()) {
7797      composeUrl(t, "ConsentPolicyBasisComponent", "url", element.getUrlElement(), -1);
7798    }
7799  }
7800
7801  protected void composeConsentVerificationComponent(Complex parent, String parentType, String name, Consent.ConsentVerificationComponent element, int index) {
7802    if (element == null) 
7803      return;
7804    Complex t;
7805    if (Utilities.noString(parentType))
7806      t = parent;
7807    else {
7808      t = parent.predicate("fhir:"+parentType+'.'+name);
7809    }
7810    composeBackboneElement(t, "verification", name, element, index);
7811    if (element.hasVerifiedElement()) {
7812      composeBoolean(t, "ConsentVerificationComponent", "verified", element.getVerifiedElement(), -1);
7813    }
7814    if (element.hasVerificationType()) {
7815      composeCodeableConcept(t, "ConsentVerificationComponent", "verificationType", element.getVerificationType(), -1);
7816    }
7817    if (element.hasVerifiedBy()) {
7818      composeReference(t, "ConsentVerificationComponent", "verifiedBy", element.getVerifiedBy(), -1);
7819    }
7820    if (element.hasVerifiedWith()) {
7821      composeReference(t, "ConsentVerificationComponent", "verifiedWith", element.getVerifiedWith(), -1);
7822    }
7823    for (int i = 0; i < element.getVerificationDate().size(); i++) {
7824      composeDateTime(t, "ConsentVerificationComponent", "verificationDate", element.getVerificationDate().get(i), i);
7825    }
7826  }
7827
7828  protected void composeConsentProvisionComponent(Complex parent, String parentType, String name, Consent.ProvisionComponent element, int index) {
7829    if (element == null) 
7830      return;
7831    Complex t;
7832    if (Utilities.noString(parentType))
7833      t = parent;
7834    else {
7835      t = parent.predicate("fhir:"+parentType+'.'+name);
7836    }
7837    composeBackboneElement(t, "provision", name, element, index);
7838    if (element.hasTypeElement()) {
7839      composeEnum(t, "ProvisionComponent", "type", element.getTypeElement(), -1);
7840    }
7841    if (element.hasPeriod()) {
7842      composePeriod(t, "ProvisionComponent", "period", element.getPeriod(), -1);
7843    }
7844    for (int i = 0; i < element.getActor().size(); i++) {
7845      composeConsentProvisionActorComponent(t, "ProvisionComponent", "actor", element.getActor().get(i), i);
7846    }
7847    for (int i = 0; i < element.getAction().size(); i++) {
7848      composeCodeableConcept(t, "ProvisionComponent", "action", element.getAction().get(i), i);
7849    }
7850    for (int i = 0; i < element.getSecurityLabel().size(); i++) {
7851      composeCoding(t, "ProvisionComponent", "securityLabel", element.getSecurityLabel().get(i), i);
7852    }
7853    for (int i = 0; i < element.getPurpose().size(); i++) {
7854      composeCoding(t, "ProvisionComponent", "purpose", element.getPurpose().get(i), i);
7855    }
7856    for (int i = 0; i < element.getClass_().size(); i++) {
7857      composeCoding(t, "ProvisionComponent", "class", element.getClass_().get(i), i);
7858    }
7859    for (int i = 0; i < element.getCode().size(); i++) {
7860      composeCodeableConcept(t, "ProvisionComponent", "code", element.getCode().get(i), i);
7861    }
7862    if (element.hasDataPeriod()) {
7863      composePeriod(t, "ProvisionComponent", "dataPeriod", element.getDataPeriod(), -1);
7864    }
7865    for (int i = 0; i < element.getData().size(); i++) {
7866      composeConsentProvisionDataComponent(t, "ProvisionComponent", "data", element.getData().get(i), i);
7867    }
7868    if (element.hasExpression()) {
7869      composeExpression(t, "ProvisionComponent", "expression", element.getExpression(), -1);
7870    }
7871    for (int i = 0; i < element.getProvision().size(); i++) {
7872      composeConsentProvisionComponent(t, "ProvisionComponent", "provision", element.getProvision().get(i), i);
7873    }
7874  }
7875
7876  protected void composeConsentProvisionActorComponent(Complex parent, String parentType, String name, Consent.ProvisionActorComponent element, int index) {
7877    if (element == null) 
7878      return;
7879    Complex t;
7880    if (Utilities.noString(parentType))
7881      t = parent;
7882    else {
7883      t = parent.predicate("fhir:"+parentType+'.'+name);
7884    }
7885    composeBackboneElement(t, "actor", name, element, index);
7886    if (element.hasRole()) {
7887      composeCodeableConcept(t, "ProvisionActorComponent", "role", element.getRole(), -1);
7888    }
7889    if (element.hasReference()) {
7890      composeReference(t, "ProvisionActorComponent", "reference", element.getReference(), -1);
7891    }
7892  }
7893
7894  protected void composeConsentProvisionDataComponent(Complex parent, String parentType, String name, Consent.ProvisionDataComponent element, int index) {
7895    if (element == null) 
7896      return;
7897    Complex t;
7898    if (Utilities.noString(parentType))
7899      t = parent;
7900    else {
7901      t = parent.predicate("fhir:"+parentType+'.'+name);
7902    }
7903    composeBackboneElement(t, "data", name, element, index);
7904    if (element.hasMeaningElement()) {
7905      composeEnum(t, "ProvisionDataComponent", "meaning", element.getMeaningElement(), -1);
7906    }
7907    if (element.hasReference()) {
7908      composeReference(t, "ProvisionDataComponent", "reference", element.getReference(), -1);
7909    }
7910  }
7911
7912  protected void composeContract(Complex parent, String parentType, String name, Contract element, int index) {
7913    if (element == null) 
7914      return;
7915    Complex t;
7916    if (Utilities.noString(parentType))
7917      t = parent;
7918    else {
7919      t = parent.predicate("fhir:"+parentType+'.'+name);
7920    }
7921    composeDomainResource(t, "Contract", name, element, index);
7922    for (int i = 0; i < element.getIdentifier().size(); i++) {
7923      composeIdentifier(t, "Contract", "identifier", element.getIdentifier().get(i), i);
7924    }
7925    if (element.hasUrlElement()) {
7926      composeUri(t, "Contract", "url", element.getUrlElement(), -1);
7927    }
7928    if (element.hasVersionElement()) {
7929      composeString(t, "Contract", "version", element.getVersionElement(), -1);
7930    }
7931    if (element.hasStatusElement()) {
7932      composeEnum(t, "Contract", "status", element.getStatusElement(), -1);
7933    }
7934    if (element.hasLegalState()) {
7935      composeCodeableConcept(t, "Contract", "legalState", element.getLegalState(), -1);
7936    }
7937    if (element.hasInstantiatesCanonical()) {
7938      composeReference(t, "Contract", "instantiatesCanonical", element.getInstantiatesCanonical(), -1);
7939    }
7940    if (element.hasInstantiatesUriElement()) {
7941      composeUri(t, "Contract", "instantiatesUri", element.getInstantiatesUriElement(), -1);
7942    }
7943    if (element.hasContentDerivative()) {
7944      composeCodeableConcept(t, "Contract", "contentDerivative", element.getContentDerivative(), -1);
7945    }
7946    if (element.hasIssuedElement()) {
7947      composeDateTime(t, "Contract", "issued", element.getIssuedElement(), -1);
7948    }
7949    if (element.hasApplies()) {
7950      composePeriod(t, "Contract", "applies", element.getApplies(), -1);
7951    }
7952    if (element.hasExpirationType()) {
7953      composeCodeableConcept(t, "Contract", "expirationType", element.getExpirationType(), -1);
7954    }
7955    for (int i = 0; i < element.getSubject().size(); i++) {
7956      composeReference(t, "Contract", "subject", element.getSubject().get(i), i);
7957    }
7958    for (int i = 0; i < element.getAuthority().size(); i++) {
7959      composeReference(t, "Contract", "authority", element.getAuthority().get(i), i);
7960    }
7961    for (int i = 0; i < element.getDomain().size(); i++) {
7962      composeReference(t, "Contract", "domain", element.getDomain().get(i), i);
7963    }
7964    for (int i = 0; i < element.getSite().size(); i++) {
7965      composeReference(t, "Contract", "site", element.getSite().get(i), i);
7966    }
7967    if (element.hasNameElement()) {
7968      composeString(t, "Contract", "name", element.getNameElement(), -1);
7969    }
7970    if (element.hasTitleElement()) {
7971      composeString(t, "Contract", "title", element.getTitleElement(), -1);
7972    }
7973    if (element.hasSubtitleElement()) {
7974      composeString(t, "Contract", "subtitle", element.getSubtitleElement(), -1);
7975    }
7976    for (int i = 0; i < element.getAlias().size(); i++) {
7977      composeString(t, "Contract", "alias", element.getAlias().get(i), i);
7978    }
7979    if (element.hasAuthor()) {
7980      composeReference(t, "Contract", "author", element.getAuthor(), -1);
7981    }
7982    if (element.hasScope()) {
7983      composeCodeableConcept(t, "Contract", "scope", element.getScope(), -1);
7984    }
7985    if (element.hasTopic()) {
7986      composeType(t, "Contract", "topic", element.getTopic(), -1);
7987    }
7988    if (element.hasType()) {
7989      composeCodeableConcept(t, "Contract", "type", element.getType(), -1);
7990    }
7991    for (int i = 0; i < element.getSubType().size(); i++) {
7992      composeCodeableConcept(t, "Contract", "subType", element.getSubType().get(i), i);
7993    }
7994    if (element.hasContentDefinition()) {
7995      composeContractContentDefinitionComponent(t, "Contract", "contentDefinition", element.getContentDefinition(), -1);
7996    }
7997    for (int i = 0; i < element.getTerm().size(); i++) {
7998      composeContractTermComponent(t, "Contract", "term", element.getTerm().get(i), i);
7999    }
8000    for (int i = 0; i < element.getSupportingInfo().size(); i++) {
8001      composeReference(t, "Contract", "supportingInfo", element.getSupportingInfo().get(i), i);
8002    }
8003    for (int i = 0; i < element.getRelevantHistory().size(); i++) {
8004      composeReference(t, "Contract", "relevantHistory", element.getRelevantHistory().get(i), i);
8005    }
8006    for (int i = 0; i < element.getSigner().size(); i++) {
8007      composeContractSignatoryComponent(t, "Contract", "signer", element.getSigner().get(i), i);
8008    }
8009    for (int i = 0; i < element.getFriendly().size(); i++) {
8010      composeContractFriendlyLanguageComponent(t, "Contract", "friendly", element.getFriendly().get(i), i);
8011    }
8012    for (int i = 0; i < element.getLegal().size(); i++) {
8013      composeContractLegalLanguageComponent(t, "Contract", "legal", element.getLegal().get(i), i);
8014    }
8015    for (int i = 0; i < element.getRule().size(); i++) {
8016      composeContractComputableLanguageComponent(t, "Contract", "rule", element.getRule().get(i), i);
8017    }
8018    if (element.hasLegallyBinding()) {
8019      composeType(t, "Contract", "legallyBinding", element.getLegallyBinding(), -1);
8020    }
8021  }
8022
8023  protected void composeContractContentDefinitionComponent(Complex parent, String parentType, String name, Contract.ContentDefinitionComponent element, int index) {
8024    if (element == null) 
8025      return;
8026    Complex t;
8027    if (Utilities.noString(parentType))
8028      t = parent;
8029    else {
8030      t = parent.predicate("fhir:"+parentType+'.'+name);
8031    }
8032    composeBackboneElement(t, "contentDefinition", name, element, index);
8033    if (element.hasType()) {
8034      composeCodeableConcept(t, "ContentDefinitionComponent", "type", element.getType(), -1);
8035    }
8036    if (element.hasSubType()) {
8037      composeCodeableConcept(t, "ContentDefinitionComponent", "subType", element.getSubType(), -1);
8038    }
8039    if (element.hasPublisher()) {
8040      composeReference(t, "ContentDefinitionComponent", "publisher", element.getPublisher(), -1);
8041    }
8042    if (element.hasPublicationDateElement()) {
8043      composeDateTime(t, "ContentDefinitionComponent", "publicationDate", element.getPublicationDateElement(), -1);
8044    }
8045    if (element.hasPublicationStatusElement()) {
8046      composeEnum(t, "ContentDefinitionComponent", "publicationStatus", element.getPublicationStatusElement(), -1);
8047    }
8048    if (element.hasCopyrightElement()) {
8049      composeMarkdown(t, "ContentDefinitionComponent", "copyright", element.getCopyrightElement(), -1);
8050    }
8051  }
8052
8053  protected void composeContractTermComponent(Complex parent, String parentType, String name, Contract.TermComponent element, int index) {
8054    if (element == null) 
8055      return;
8056    Complex t;
8057    if (Utilities.noString(parentType))
8058      t = parent;
8059    else {
8060      t = parent.predicate("fhir:"+parentType+'.'+name);
8061    }
8062    composeBackboneElement(t, "term", name, element, index);
8063    if (element.hasIdentifier()) {
8064      composeIdentifier(t, "TermComponent", "identifier", element.getIdentifier(), -1);
8065    }
8066    if (element.hasIssuedElement()) {
8067      composeDateTime(t, "TermComponent", "issued", element.getIssuedElement(), -1);
8068    }
8069    if (element.hasApplies()) {
8070      composePeriod(t, "TermComponent", "applies", element.getApplies(), -1);
8071    }
8072    if (element.hasTopic()) {
8073      composeType(t, "TermComponent", "topic", element.getTopic(), -1);
8074    }
8075    if (element.hasType()) {
8076      composeCodeableConcept(t, "TermComponent", "type", element.getType(), -1);
8077    }
8078    if (element.hasSubType()) {
8079      composeCodeableConcept(t, "TermComponent", "subType", element.getSubType(), -1);
8080    }
8081    if (element.hasTextElement()) {
8082      composeString(t, "TermComponent", "text", element.getTextElement(), -1);
8083    }
8084    for (int i = 0; i < element.getSecurityLabel().size(); i++) {
8085      composeContractSecurityLabelComponent(t, "TermComponent", "securityLabel", element.getSecurityLabel().get(i), i);
8086    }
8087    if (element.hasOffer()) {
8088      composeContractOfferComponent(t, "TermComponent", "offer", element.getOffer(), -1);
8089    }
8090    for (int i = 0; i < element.getAsset().size(); i++) {
8091      composeContractAssetComponent(t, "TermComponent", "asset", element.getAsset().get(i), i);
8092    }
8093    for (int i = 0; i < element.getAction().size(); i++) {
8094      composeContractActionComponent(t, "TermComponent", "action", element.getAction().get(i), i);
8095    }
8096    for (int i = 0; i < element.getGroup().size(); i++) {
8097      composeContractTermComponent(t, "TermComponent", "group", element.getGroup().get(i), i);
8098    }
8099  }
8100
8101  protected void composeContractSecurityLabelComponent(Complex parent, String parentType, String name, Contract.SecurityLabelComponent element, int index) {
8102    if (element == null) 
8103      return;
8104    Complex t;
8105    if (Utilities.noString(parentType))
8106      t = parent;
8107    else {
8108      t = parent.predicate("fhir:"+parentType+'.'+name);
8109    }
8110    composeBackboneElement(t, "securityLabel", name, element, index);
8111    for (int i = 0; i < element.getNumber().size(); i++) {
8112      composeUnsignedInt(t, "SecurityLabelComponent", "number", element.getNumber().get(i), i);
8113    }
8114    if (element.hasClassification()) {
8115      composeCoding(t, "SecurityLabelComponent", "classification", element.getClassification(), -1);
8116    }
8117    for (int i = 0; i < element.getCategory().size(); i++) {
8118      composeCoding(t, "SecurityLabelComponent", "category", element.getCategory().get(i), i);
8119    }
8120    for (int i = 0; i < element.getControl().size(); i++) {
8121      composeCoding(t, "SecurityLabelComponent", "control", element.getControl().get(i), i);
8122    }
8123  }
8124
8125  protected void composeContractOfferComponent(Complex parent, String parentType, String name, Contract.ContractOfferComponent element, int index) {
8126    if (element == null) 
8127      return;
8128    Complex t;
8129    if (Utilities.noString(parentType))
8130      t = parent;
8131    else {
8132      t = parent.predicate("fhir:"+parentType+'.'+name);
8133    }
8134    composeBackboneElement(t, "offer", name, element, index);
8135    for (int i = 0; i < element.getIdentifier().size(); i++) {
8136      composeIdentifier(t, "ContractOfferComponent", "identifier", element.getIdentifier().get(i), i);
8137    }
8138    for (int i = 0; i < element.getParty().size(); i++) {
8139      composeContractPartyComponent(t, "ContractOfferComponent", "party", element.getParty().get(i), i);
8140    }
8141    if (element.hasTopic()) {
8142      composeReference(t, "ContractOfferComponent", "topic", element.getTopic(), -1);
8143    }
8144    if (element.hasType()) {
8145      composeCodeableConcept(t, "ContractOfferComponent", "type", element.getType(), -1);
8146    }
8147    if (element.hasDecision()) {
8148      composeCodeableConcept(t, "ContractOfferComponent", "decision", element.getDecision(), -1);
8149    }
8150    for (int i = 0; i < element.getDecisionMode().size(); i++) {
8151      composeCodeableConcept(t, "ContractOfferComponent", "decisionMode", element.getDecisionMode().get(i), i);
8152    }
8153    for (int i = 0; i < element.getAnswer().size(); i++) {
8154      composeContractAnswerComponent(t, "ContractOfferComponent", "answer", element.getAnswer().get(i), i);
8155    }
8156    if (element.hasTextElement()) {
8157      composeString(t, "ContractOfferComponent", "text", element.getTextElement(), -1);
8158    }
8159    for (int i = 0; i < element.getLinkId().size(); i++) {
8160      composeString(t, "ContractOfferComponent", "linkId", element.getLinkId().get(i), i);
8161    }
8162    for (int i = 0; i < element.getSecurityLabelNumber().size(); i++) {
8163      composeUnsignedInt(t, "ContractOfferComponent", "securityLabelNumber", element.getSecurityLabelNumber().get(i), i);
8164    }
8165  }
8166
8167  protected void composeContractPartyComponent(Complex parent, String parentType, String name, Contract.ContractPartyComponent element, int index) {
8168    if (element == null) 
8169      return;
8170    Complex t;
8171    if (Utilities.noString(parentType))
8172      t = parent;
8173    else {
8174      t = parent.predicate("fhir:"+parentType+'.'+name);
8175    }
8176    composeBackboneElement(t, "party", name, element, index);
8177    for (int i = 0; i < element.getReference().size(); i++) {
8178      composeReference(t, "ContractPartyComponent", "reference", element.getReference().get(i), i);
8179    }
8180    if (element.hasRole()) {
8181      composeCodeableConcept(t, "ContractPartyComponent", "role", element.getRole(), -1);
8182    }
8183  }
8184
8185  protected void composeContractAnswerComponent(Complex parent, String parentType, String name, Contract.AnswerComponent element, int index) {
8186    if (element == null) 
8187      return;
8188    Complex t;
8189    if (Utilities.noString(parentType))
8190      t = parent;
8191    else {
8192      t = parent.predicate("fhir:"+parentType+'.'+name);
8193    }
8194    composeBackboneElement(t, "answer", name, element, index);
8195    if (element.hasValue()) {
8196      composeType(t, "AnswerComponent", "value", element.getValue(), -1);
8197    }
8198  }
8199
8200  protected void composeContractAssetComponent(Complex parent, String parentType, String name, Contract.ContractAssetComponent element, int index) {
8201    if (element == null) 
8202      return;
8203    Complex t;
8204    if (Utilities.noString(parentType))
8205      t = parent;
8206    else {
8207      t = parent.predicate("fhir:"+parentType+'.'+name);
8208    }
8209    composeBackboneElement(t, "asset", name, element, index);
8210    if (element.hasScope()) {
8211      composeCodeableConcept(t, "ContractAssetComponent", "scope", element.getScope(), -1);
8212    }
8213    for (int i = 0; i < element.getType().size(); i++) {
8214      composeCodeableConcept(t, "ContractAssetComponent", "type", element.getType().get(i), i);
8215    }
8216    for (int i = 0; i < element.getTypeReference().size(); i++) {
8217      composeReference(t, "ContractAssetComponent", "typeReference", element.getTypeReference().get(i), i);
8218    }
8219    for (int i = 0; i < element.getSubtype().size(); i++) {
8220      composeCodeableConcept(t, "ContractAssetComponent", "subtype", element.getSubtype().get(i), i);
8221    }
8222    if (element.hasRelationship()) {
8223      composeCoding(t, "ContractAssetComponent", "relationship", element.getRelationship(), -1);
8224    }
8225    for (int i = 0; i < element.getContext().size(); i++) {
8226      composeContractAssetContextComponent(t, "ContractAssetComponent", "context", element.getContext().get(i), i);
8227    }
8228    if (element.hasConditionElement()) {
8229      composeString(t, "ContractAssetComponent", "condition", element.getConditionElement(), -1);
8230    }
8231    for (int i = 0; i < element.getPeriodType().size(); i++) {
8232      composeCodeableConcept(t, "ContractAssetComponent", "periodType", element.getPeriodType().get(i), i);
8233    }
8234    for (int i = 0; i < element.getPeriod().size(); i++) {
8235      composePeriod(t, "ContractAssetComponent", "period", element.getPeriod().get(i), i);
8236    }
8237    for (int i = 0; i < element.getUsePeriod().size(); i++) {
8238      composePeriod(t, "ContractAssetComponent", "usePeriod", element.getUsePeriod().get(i), i);
8239    }
8240    if (element.hasTextElement()) {
8241      composeString(t, "ContractAssetComponent", "text", element.getTextElement(), -1);
8242    }
8243    for (int i = 0; i < element.getLinkId().size(); i++) {
8244      composeString(t, "ContractAssetComponent", "linkId", element.getLinkId().get(i), i);
8245    }
8246    for (int i = 0; i < element.getAnswer().size(); i++) {
8247      composeContractAnswerComponent(t, "ContractAssetComponent", "answer", element.getAnswer().get(i), i);
8248    }
8249    for (int i = 0; i < element.getSecurityLabelNumber().size(); i++) {
8250      composeUnsignedInt(t, "ContractAssetComponent", "securityLabelNumber", element.getSecurityLabelNumber().get(i), i);
8251    }
8252    for (int i = 0; i < element.getValuedItem().size(); i++) {
8253      composeContractValuedItemComponent(t, "ContractAssetComponent", "valuedItem", element.getValuedItem().get(i), i);
8254    }
8255  }
8256
8257  protected void composeContractAssetContextComponent(Complex parent, String parentType, String name, Contract.AssetContextComponent element, int index) {
8258    if (element == null) 
8259      return;
8260    Complex t;
8261    if (Utilities.noString(parentType))
8262      t = parent;
8263    else {
8264      t = parent.predicate("fhir:"+parentType+'.'+name);
8265    }
8266    composeBackboneElement(t, "context", name, element, index);
8267    if (element.hasReference()) {
8268      composeReference(t, "AssetContextComponent", "reference", element.getReference(), -1);
8269    }
8270    for (int i = 0; i < element.getCode().size(); i++) {
8271      composeCodeableConcept(t, "AssetContextComponent", "code", element.getCode().get(i), i);
8272    }
8273    if (element.hasTextElement()) {
8274      composeString(t, "AssetContextComponent", "text", element.getTextElement(), -1);
8275    }
8276  }
8277
8278  protected void composeContractValuedItemComponent(Complex parent, String parentType, String name, Contract.ValuedItemComponent element, int index) {
8279    if (element == null) 
8280      return;
8281    Complex t;
8282    if (Utilities.noString(parentType))
8283      t = parent;
8284    else {
8285      t = parent.predicate("fhir:"+parentType+'.'+name);
8286    }
8287    composeBackboneElement(t, "valuedItem", name, element, index);
8288    if (element.hasEntity()) {
8289      composeType(t, "ValuedItemComponent", "entity", element.getEntity(), -1);
8290    }
8291    if (element.hasIdentifier()) {
8292      composeIdentifier(t, "ValuedItemComponent", "identifier", element.getIdentifier(), -1);
8293    }
8294    if (element.hasEffectiveTimeElement()) {
8295      composeDateTime(t, "ValuedItemComponent", "effectiveTime", element.getEffectiveTimeElement(), -1);
8296    }
8297    if (element.hasQuantity()) {
8298      composeQuantity(t, "ValuedItemComponent", "quantity", element.getQuantity(), -1);
8299    }
8300    if (element.hasUnitPrice()) {
8301      composeMoney(t, "ValuedItemComponent", "unitPrice", element.getUnitPrice(), -1);
8302    }
8303    if (element.hasFactorElement()) {
8304      composeDecimal(t, "ValuedItemComponent", "factor", element.getFactorElement(), -1);
8305    }
8306    if (element.hasPointsElement()) {
8307      composeDecimal(t, "ValuedItemComponent", "points", element.getPointsElement(), -1);
8308    }
8309    if (element.hasNet()) {
8310      composeMoney(t, "ValuedItemComponent", "net", element.getNet(), -1);
8311    }
8312    if (element.hasPaymentElement()) {
8313      composeString(t, "ValuedItemComponent", "payment", element.getPaymentElement(), -1);
8314    }
8315    if (element.hasPaymentDateElement()) {
8316      composeDateTime(t, "ValuedItemComponent", "paymentDate", element.getPaymentDateElement(), -1);
8317    }
8318    if (element.hasResponsible()) {
8319      composeReference(t, "ValuedItemComponent", "responsible", element.getResponsible(), -1);
8320    }
8321    if (element.hasRecipient()) {
8322      composeReference(t, "ValuedItemComponent", "recipient", element.getRecipient(), -1);
8323    }
8324    for (int i = 0; i < element.getLinkId().size(); i++) {
8325      composeString(t, "ValuedItemComponent", "linkId", element.getLinkId().get(i), i);
8326    }
8327    for (int i = 0; i < element.getSecurityLabelNumber().size(); i++) {
8328      composeUnsignedInt(t, "ValuedItemComponent", "securityLabelNumber", element.getSecurityLabelNumber().get(i), i);
8329    }
8330  }
8331
8332  protected void composeContractActionComponent(Complex parent, String parentType, String name, Contract.ActionComponent element, int index) {
8333    if (element == null) 
8334      return;
8335    Complex t;
8336    if (Utilities.noString(parentType))
8337      t = parent;
8338    else {
8339      t = parent.predicate("fhir:"+parentType+'.'+name);
8340    }
8341    composeBackboneElement(t, "action", name, element, index);
8342    if (element.hasDoNotPerformElement()) {
8343      composeBoolean(t, "ActionComponent", "doNotPerform", element.getDoNotPerformElement(), -1);
8344    }
8345    if (element.hasType()) {
8346      composeCodeableConcept(t, "ActionComponent", "type", element.getType(), -1);
8347    }
8348    for (int i = 0; i < element.getSubject().size(); i++) {
8349      composeContractActionSubjectComponent(t, "ActionComponent", "subject", element.getSubject().get(i), i);
8350    }
8351    if (element.hasIntent()) {
8352      composeCodeableConcept(t, "ActionComponent", "intent", element.getIntent(), -1);
8353    }
8354    for (int i = 0; i < element.getLinkId().size(); i++) {
8355      composeString(t, "ActionComponent", "linkId", element.getLinkId().get(i), i);
8356    }
8357    if (element.hasStatus()) {
8358      composeCodeableConcept(t, "ActionComponent", "status", element.getStatus(), -1);
8359    }
8360    if (element.hasContext()) {
8361      composeReference(t, "ActionComponent", "context", element.getContext(), -1);
8362    }
8363    for (int i = 0; i < element.getContextLinkId().size(); i++) {
8364      composeString(t, "ActionComponent", "contextLinkId", element.getContextLinkId().get(i), i);
8365    }
8366    if (element.hasOccurrence()) {
8367      composeType(t, "ActionComponent", "occurrence", element.getOccurrence(), -1);
8368    }
8369    for (int i = 0; i < element.getRequester().size(); i++) {
8370      composeReference(t, "ActionComponent", "requester", element.getRequester().get(i), i);
8371    }
8372    for (int i = 0; i < element.getRequesterLinkId().size(); i++) {
8373      composeString(t, "ActionComponent", "requesterLinkId", element.getRequesterLinkId().get(i), i);
8374    }
8375    for (int i = 0; i < element.getPerformerType().size(); i++) {
8376      composeCodeableConcept(t, "ActionComponent", "performerType", element.getPerformerType().get(i), i);
8377    }
8378    if (element.hasPerformerRole()) {
8379      composeCodeableConcept(t, "ActionComponent", "performerRole", element.getPerformerRole(), -1);
8380    }
8381    if (element.hasPerformer()) {
8382      composeReference(t, "ActionComponent", "performer", element.getPerformer(), -1);
8383    }
8384    for (int i = 0; i < element.getPerformerLinkId().size(); i++) {
8385      composeString(t, "ActionComponent", "performerLinkId", element.getPerformerLinkId().get(i), i);
8386    }
8387    for (int i = 0; i < element.getReason().size(); i++) {
8388      composeCodeableReference(t, "ActionComponent", "reason", element.getReason().get(i), i);
8389    }
8390    for (int i = 0; i < element.getReasonLinkId().size(); i++) {
8391      composeString(t, "ActionComponent", "reasonLinkId", element.getReasonLinkId().get(i), i);
8392    }
8393    for (int i = 0; i < element.getNote().size(); i++) {
8394      composeAnnotation(t, "ActionComponent", "note", element.getNote().get(i), i);
8395    }
8396    for (int i = 0; i < element.getSecurityLabelNumber().size(); i++) {
8397      composeUnsignedInt(t, "ActionComponent", "securityLabelNumber", element.getSecurityLabelNumber().get(i), i);
8398    }
8399  }
8400
8401  protected void composeContractActionSubjectComponent(Complex parent, String parentType, String name, Contract.ActionSubjectComponent element, int index) {
8402    if (element == null) 
8403      return;
8404    Complex t;
8405    if (Utilities.noString(parentType))
8406      t = parent;
8407    else {
8408      t = parent.predicate("fhir:"+parentType+'.'+name);
8409    }
8410    composeBackboneElement(t, "subject", name, element, index);
8411    for (int i = 0; i < element.getReference().size(); i++) {
8412      composeReference(t, "ActionSubjectComponent", "reference", element.getReference().get(i), i);
8413    }
8414    if (element.hasRole()) {
8415      composeCodeableConcept(t, "ActionSubjectComponent", "role", element.getRole(), -1);
8416    }
8417  }
8418
8419  protected void composeContractSignatoryComponent(Complex parent, String parentType, String name, Contract.SignatoryComponent element, int index) {
8420    if (element == null) 
8421      return;
8422    Complex t;
8423    if (Utilities.noString(parentType))
8424      t = parent;
8425    else {
8426      t = parent.predicate("fhir:"+parentType+'.'+name);
8427    }
8428    composeBackboneElement(t, "signer", name, element, index);
8429    if (element.hasType()) {
8430      composeCoding(t, "SignatoryComponent", "type", element.getType(), -1);
8431    }
8432    if (element.hasParty()) {
8433      composeReference(t, "SignatoryComponent", "party", element.getParty(), -1);
8434    }
8435    for (int i = 0; i < element.getSignature().size(); i++) {
8436      composeSignature(t, "SignatoryComponent", "signature", element.getSignature().get(i), i);
8437    }
8438  }
8439
8440  protected void composeContractFriendlyLanguageComponent(Complex parent, String parentType, String name, Contract.FriendlyLanguageComponent element, int index) {
8441    if (element == null) 
8442      return;
8443    Complex t;
8444    if (Utilities.noString(parentType))
8445      t = parent;
8446    else {
8447      t = parent.predicate("fhir:"+parentType+'.'+name);
8448    }
8449    composeBackboneElement(t, "friendly", name, element, index);
8450    if (element.hasContent()) {
8451      composeType(t, "FriendlyLanguageComponent", "content", element.getContent(), -1);
8452    }
8453  }
8454
8455  protected void composeContractLegalLanguageComponent(Complex parent, String parentType, String name, Contract.LegalLanguageComponent element, int index) {
8456    if (element == null) 
8457      return;
8458    Complex t;
8459    if (Utilities.noString(parentType))
8460      t = parent;
8461    else {
8462      t = parent.predicate("fhir:"+parentType+'.'+name);
8463    }
8464    composeBackboneElement(t, "legal", name, element, index);
8465    if (element.hasContent()) {
8466      composeType(t, "LegalLanguageComponent", "content", element.getContent(), -1);
8467    }
8468  }
8469
8470  protected void composeContractComputableLanguageComponent(Complex parent, String parentType, String name, Contract.ComputableLanguageComponent element, int index) {
8471    if (element == null) 
8472      return;
8473    Complex t;
8474    if (Utilities.noString(parentType))
8475      t = parent;
8476    else {
8477      t = parent.predicate("fhir:"+parentType+'.'+name);
8478    }
8479    composeBackboneElement(t, "rule", name, element, index);
8480    if (element.hasContent()) {
8481      composeType(t, "ComputableLanguageComponent", "content", element.getContent(), -1);
8482    }
8483  }
8484
8485  protected void composeCoverage(Complex parent, String parentType, String name, Coverage element, int index) {
8486    if (element == null) 
8487      return;
8488    Complex t;
8489    if (Utilities.noString(parentType))
8490      t = parent;
8491    else {
8492      t = parent.predicate("fhir:"+parentType+'.'+name);
8493    }
8494    composeDomainResource(t, "Coverage", name, element, index);
8495    for (int i = 0; i < element.getIdentifier().size(); i++) {
8496      composeIdentifier(t, "Coverage", "identifier", element.getIdentifier().get(i), i);
8497    }
8498    if (element.hasStatusElement()) {
8499      composeEnum(t, "Coverage", "status", element.getStatusElement(), -1);
8500    }
8501    if (element.hasKindElement()) {
8502      composeEnum(t, "Coverage", "kind", element.getKindElement(), -1);
8503    }
8504    for (int i = 0; i < element.getPaymentBy().size(); i++) {
8505      composeCoveragePaymentByComponent(t, "Coverage", "paymentBy", element.getPaymentBy().get(i), i);
8506    }
8507    if (element.hasType()) {
8508      composeCodeableConcept(t, "Coverage", "type", element.getType(), -1);
8509    }
8510    if (element.hasPolicyHolder()) {
8511      composeReference(t, "Coverage", "policyHolder", element.getPolicyHolder(), -1);
8512    }
8513    if (element.hasSubscriber()) {
8514      composeReference(t, "Coverage", "subscriber", element.getSubscriber(), -1);
8515    }
8516    for (int i = 0; i < element.getSubscriberId().size(); i++) {
8517      composeIdentifier(t, "Coverage", "subscriberId", element.getSubscriberId().get(i), i);
8518    }
8519    if (element.hasBeneficiary()) {
8520      composeReference(t, "Coverage", "beneficiary", element.getBeneficiary(), -1);
8521    }
8522    if (element.hasDependentElement()) {
8523      composeString(t, "Coverage", "dependent", element.getDependentElement(), -1);
8524    }
8525    if (element.hasRelationship()) {
8526      composeCodeableConcept(t, "Coverage", "relationship", element.getRelationship(), -1);
8527    }
8528    if (element.hasPeriod()) {
8529      composePeriod(t, "Coverage", "period", element.getPeriod(), -1);
8530    }
8531    if (element.hasInsurer()) {
8532      composeReference(t, "Coverage", "insurer", element.getInsurer(), -1);
8533    }
8534    for (int i = 0; i < element.getClass_().size(); i++) {
8535      composeCoverageClassComponent(t, "Coverage", "class", element.getClass_().get(i), i);
8536    }
8537    if (element.hasOrderElement()) {
8538      composePositiveInt(t, "Coverage", "order", element.getOrderElement(), -1);
8539    }
8540    if (element.hasNetworkElement()) {
8541      composeString(t, "Coverage", "network", element.getNetworkElement(), -1);
8542    }
8543    for (int i = 0; i < element.getCostToBeneficiary().size(); i++) {
8544      composeCoverageCostToBeneficiaryComponent(t, "Coverage", "costToBeneficiary", element.getCostToBeneficiary().get(i), i);
8545    }
8546    if (element.hasSubrogationElement()) {
8547      composeBoolean(t, "Coverage", "subrogation", element.getSubrogationElement(), -1);
8548    }
8549    for (int i = 0; i < element.getContract().size(); i++) {
8550      composeReference(t, "Coverage", "contract", element.getContract().get(i), i);
8551    }
8552    if (element.hasInsurancePlan()) {
8553      composeReference(t, "Coverage", "insurancePlan", element.getInsurancePlan(), -1);
8554    }
8555  }
8556
8557  protected void composeCoveragePaymentByComponent(Complex parent, String parentType, String name, Coverage.CoveragePaymentByComponent element, int index) {
8558    if (element == null) 
8559      return;
8560    Complex t;
8561    if (Utilities.noString(parentType))
8562      t = parent;
8563    else {
8564      t = parent.predicate("fhir:"+parentType+'.'+name);
8565    }
8566    composeBackboneElement(t, "paymentBy", name, element, index);
8567    if (element.hasParty()) {
8568      composeReference(t, "CoveragePaymentByComponent", "party", element.getParty(), -1);
8569    }
8570    if (element.hasResponsibilityElement()) {
8571      composeString(t, "CoveragePaymentByComponent", "responsibility", element.getResponsibilityElement(), -1);
8572    }
8573  }
8574
8575  protected void composeCoverageClassComponent(Complex parent, String parentType, String name, Coverage.ClassComponent element, int index) {
8576    if (element == null) 
8577      return;
8578    Complex t;
8579    if (Utilities.noString(parentType))
8580      t = parent;
8581    else {
8582      t = parent.predicate("fhir:"+parentType+'.'+name);
8583    }
8584    composeBackboneElement(t, "class", name, element, index);
8585    if (element.hasType()) {
8586      composeCodeableConcept(t, "ClassComponent", "type", element.getType(), -1);
8587    }
8588    if (element.hasValue()) {
8589      composeIdentifier(t, "ClassComponent", "value", element.getValue(), -1);
8590    }
8591    if (element.hasNameElement()) {
8592      composeString(t, "ClassComponent", "name", element.getNameElement(), -1);
8593    }
8594  }
8595
8596  protected void composeCoverageCostToBeneficiaryComponent(Complex parent, String parentType, String name, Coverage.CostToBeneficiaryComponent element, int index) {
8597    if (element == null) 
8598      return;
8599    Complex t;
8600    if (Utilities.noString(parentType))
8601      t = parent;
8602    else {
8603      t = parent.predicate("fhir:"+parentType+'.'+name);
8604    }
8605    composeBackboneElement(t, "costToBeneficiary", name, element, index);
8606    if (element.hasType()) {
8607      composeCodeableConcept(t, "CostToBeneficiaryComponent", "type", element.getType(), -1);
8608    }
8609    if (element.hasCategory()) {
8610      composeCodeableConcept(t, "CostToBeneficiaryComponent", "category", element.getCategory(), -1);
8611    }
8612    if (element.hasNetwork()) {
8613      composeCodeableConcept(t, "CostToBeneficiaryComponent", "network", element.getNetwork(), -1);
8614    }
8615    if (element.hasUnit()) {
8616      composeCodeableConcept(t, "CostToBeneficiaryComponent", "unit", element.getUnit(), -1);
8617    }
8618    if (element.hasTerm()) {
8619      composeCodeableConcept(t, "CostToBeneficiaryComponent", "term", element.getTerm(), -1);
8620    }
8621    if (element.hasValue()) {
8622      composeType(t, "CostToBeneficiaryComponent", "value", element.getValue(), -1);
8623    }
8624    for (int i = 0; i < element.getException().size(); i++) {
8625      composeCoverageExemptionComponent(t, "CostToBeneficiaryComponent", "exception", element.getException().get(i), i);
8626    }
8627  }
8628
8629  protected void composeCoverageExemptionComponent(Complex parent, String parentType, String name, Coverage.ExemptionComponent element, int index) {
8630    if (element == null) 
8631      return;
8632    Complex t;
8633    if (Utilities.noString(parentType))
8634      t = parent;
8635    else {
8636      t = parent.predicate("fhir:"+parentType+'.'+name);
8637    }
8638    composeBackboneElement(t, "exception", name, element, index);
8639    if (element.hasType()) {
8640      composeCodeableConcept(t, "ExemptionComponent", "type", element.getType(), -1);
8641    }
8642    if (element.hasPeriod()) {
8643      composePeriod(t, "ExemptionComponent", "period", element.getPeriod(), -1);
8644    }
8645  }
8646
8647  protected void composeCoverageEligibilityRequest(Complex parent, String parentType, String name, CoverageEligibilityRequest element, int index) {
8648    if (element == null) 
8649      return;
8650    Complex t;
8651    if (Utilities.noString(parentType))
8652      t = parent;
8653    else {
8654      t = parent.predicate("fhir:"+parentType+'.'+name);
8655    }
8656    composeDomainResource(t, "CoverageEligibilityRequest", name, element, index);
8657    for (int i = 0; i < element.getIdentifier().size(); i++) {
8658      composeIdentifier(t, "CoverageEligibilityRequest", "identifier", element.getIdentifier().get(i), i);
8659    }
8660    if (element.hasStatusElement()) {
8661      composeEnum(t, "CoverageEligibilityRequest", "status", element.getStatusElement(), -1);
8662    }
8663    if (element.hasPriority()) {
8664      composeCodeableConcept(t, "CoverageEligibilityRequest", "priority", element.getPriority(), -1);
8665    }
8666    for (int i = 0; i < element.getPurpose().size(); i++) {
8667      composeEnum(t, "CoverageEligibilityRequest", "purpose", element.getPurpose().get(i), i);
8668    }
8669    if (element.hasPatient()) {
8670      composeReference(t, "CoverageEligibilityRequest", "patient", element.getPatient(), -1);
8671    }
8672    if (element.hasServiced()) {
8673      composeType(t, "CoverageEligibilityRequest", "serviced", element.getServiced(), -1);
8674    }
8675    if (element.hasCreatedElement()) {
8676      composeDateTime(t, "CoverageEligibilityRequest", "created", element.getCreatedElement(), -1);
8677    }
8678    if (element.hasEnterer()) {
8679      composeReference(t, "CoverageEligibilityRequest", "enterer", element.getEnterer(), -1);
8680    }
8681    if (element.hasProvider()) {
8682      composeReference(t, "CoverageEligibilityRequest", "provider", element.getProvider(), -1);
8683    }
8684    if (element.hasInsurer()) {
8685      composeReference(t, "CoverageEligibilityRequest", "insurer", element.getInsurer(), -1);
8686    }
8687    if (element.hasFacility()) {
8688      composeReference(t, "CoverageEligibilityRequest", "facility", element.getFacility(), -1);
8689    }
8690    for (int i = 0; i < element.getSupportingInfo().size(); i++) {
8691      composeCoverageEligibilityRequestSupportingInformationComponent(t, "CoverageEligibilityRequest", "supportingInfo", element.getSupportingInfo().get(i), i);
8692    }
8693    for (int i = 0; i < element.getInsurance().size(); i++) {
8694      composeCoverageEligibilityRequestInsuranceComponent(t, "CoverageEligibilityRequest", "insurance", element.getInsurance().get(i), i);
8695    }
8696    for (int i = 0; i < element.getItem().size(); i++) {
8697      composeCoverageEligibilityRequestDetailsComponent(t, "CoverageEligibilityRequest", "item", element.getItem().get(i), i);
8698    }
8699  }
8700
8701  protected void composeCoverageEligibilityRequestSupportingInformationComponent(Complex parent, String parentType, String name, CoverageEligibilityRequest.SupportingInformationComponent element, int index) {
8702    if (element == null) 
8703      return;
8704    Complex t;
8705    if (Utilities.noString(parentType))
8706      t = parent;
8707    else {
8708      t = parent.predicate("fhir:"+parentType+'.'+name);
8709    }
8710    composeBackboneElement(t, "supportingInfo", name, element, index);
8711    if (element.hasSequenceElement()) {
8712      composePositiveInt(t, "SupportingInformationComponent", "sequence", element.getSequenceElement(), -1);
8713    }
8714    if (element.hasInformation()) {
8715      composeReference(t, "SupportingInformationComponent", "information", element.getInformation(), -1);
8716    }
8717    if (element.hasAppliesToAllElement()) {
8718      composeBoolean(t, "SupportingInformationComponent", "appliesToAll", element.getAppliesToAllElement(), -1);
8719    }
8720  }
8721
8722  protected void composeCoverageEligibilityRequestInsuranceComponent(Complex parent, String parentType, String name, CoverageEligibilityRequest.InsuranceComponent element, int index) {
8723    if (element == null) 
8724      return;
8725    Complex t;
8726    if (Utilities.noString(parentType))
8727      t = parent;
8728    else {
8729      t = parent.predicate("fhir:"+parentType+'.'+name);
8730    }
8731    composeBackboneElement(t, "insurance", name, element, index);
8732    if (element.hasFocalElement()) {
8733      composeBoolean(t, "InsuranceComponent", "focal", element.getFocalElement(), -1);
8734    }
8735    if (element.hasCoverage()) {
8736      composeReference(t, "InsuranceComponent", "coverage", element.getCoverage(), -1);
8737    }
8738    if (element.hasBusinessArrangementElement()) {
8739      composeString(t, "InsuranceComponent", "businessArrangement", element.getBusinessArrangementElement(), -1);
8740    }
8741  }
8742
8743  protected void composeCoverageEligibilityRequestDetailsComponent(Complex parent, String parentType, String name, CoverageEligibilityRequest.DetailsComponent element, int index) {
8744    if (element == null) 
8745      return;
8746    Complex t;
8747    if (Utilities.noString(parentType))
8748      t = parent;
8749    else {
8750      t = parent.predicate("fhir:"+parentType+'.'+name);
8751    }
8752    composeBackboneElement(t, "item", name, element, index);
8753    for (int i = 0; i < element.getSupportingInfoSequence().size(); i++) {
8754      composePositiveInt(t, "DetailsComponent", "supportingInfoSequence", element.getSupportingInfoSequence().get(i), i);
8755    }
8756    if (element.hasCategory()) {
8757      composeCodeableConcept(t, "DetailsComponent", "category", element.getCategory(), -1);
8758    }
8759    if (element.hasProductOrService()) {
8760      composeCodeableConcept(t, "DetailsComponent", "productOrService", element.getProductOrService(), -1);
8761    }
8762    for (int i = 0; i < element.getModifier().size(); i++) {
8763      composeCodeableConcept(t, "DetailsComponent", "modifier", element.getModifier().get(i), i);
8764    }
8765    if (element.hasProvider()) {
8766      composeReference(t, "DetailsComponent", "provider", element.getProvider(), -1);
8767    }
8768    if (element.hasQuantity()) {
8769      composeQuantity(t, "DetailsComponent", "quantity", element.getQuantity(), -1);
8770    }
8771    if (element.hasUnitPrice()) {
8772      composeMoney(t, "DetailsComponent", "unitPrice", element.getUnitPrice(), -1);
8773    }
8774    if (element.hasFacility()) {
8775      composeReference(t, "DetailsComponent", "facility", element.getFacility(), -1);
8776    }
8777    for (int i = 0; i < element.getDiagnosis().size(); i++) {
8778      composeCoverageEligibilityRequestDiagnosisComponent(t, "DetailsComponent", "diagnosis", element.getDiagnosis().get(i), i);
8779    }
8780    for (int i = 0; i < element.getDetail().size(); i++) {
8781      composeReference(t, "DetailsComponent", "detail", element.getDetail().get(i), i);
8782    }
8783  }
8784
8785  protected void composeCoverageEligibilityRequestDiagnosisComponent(Complex parent, String parentType, String name, CoverageEligibilityRequest.DiagnosisComponent element, int index) {
8786    if (element == null) 
8787      return;
8788    Complex t;
8789    if (Utilities.noString(parentType))
8790      t = parent;
8791    else {
8792      t = parent.predicate("fhir:"+parentType+'.'+name);
8793    }
8794    composeBackboneElement(t, "diagnosis", name, element, index);
8795    if (element.hasDiagnosis()) {
8796      composeType(t, "DiagnosisComponent", "diagnosis", element.getDiagnosis(), -1);
8797    }
8798  }
8799
8800  protected void composeCoverageEligibilityResponse(Complex parent, String parentType, String name, CoverageEligibilityResponse element, int index) {
8801    if (element == null) 
8802      return;
8803    Complex t;
8804    if (Utilities.noString(parentType))
8805      t = parent;
8806    else {
8807      t = parent.predicate("fhir:"+parentType+'.'+name);
8808    }
8809    composeDomainResource(t, "CoverageEligibilityResponse", name, element, index);
8810    for (int i = 0; i < element.getIdentifier().size(); i++) {
8811      composeIdentifier(t, "CoverageEligibilityResponse", "identifier", element.getIdentifier().get(i), i);
8812    }
8813    if (element.hasStatusElement()) {
8814      composeEnum(t, "CoverageEligibilityResponse", "status", element.getStatusElement(), -1);
8815    }
8816    for (int i = 0; i < element.getPurpose().size(); i++) {
8817      composeEnum(t, "CoverageEligibilityResponse", "purpose", element.getPurpose().get(i), i);
8818    }
8819    if (element.hasPatient()) {
8820      composeReference(t, "CoverageEligibilityResponse", "patient", element.getPatient(), -1);
8821    }
8822    if (element.hasServiced()) {
8823      composeType(t, "CoverageEligibilityResponse", "serviced", element.getServiced(), -1);
8824    }
8825    if (element.hasCreatedElement()) {
8826      composeDateTime(t, "CoverageEligibilityResponse", "created", element.getCreatedElement(), -1);
8827    }
8828    if (element.hasRequestor()) {
8829      composeReference(t, "CoverageEligibilityResponse", "requestor", element.getRequestor(), -1);
8830    }
8831    if (element.hasRequest()) {
8832      composeReference(t, "CoverageEligibilityResponse", "request", element.getRequest(), -1);
8833    }
8834    if (element.hasOutcomeElement()) {
8835      composeEnum(t, "CoverageEligibilityResponse", "outcome", element.getOutcomeElement(), -1);
8836    }
8837    if (element.hasDispositionElement()) {
8838      composeString(t, "CoverageEligibilityResponse", "disposition", element.getDispositionElement(), -1);
8839    }
8840    if (element.hasInsurer()) {
8841      composeReference(t, "CoverageEligibilityResponse", "insurer", element.getInsurer(), -1);
8842    }
8843    for (int i = 0; i < element.getInsurance().size(); i++) {
8844      composeCoverageEligibilityResponseInsuranceComponent(t, "CoverageEligibilityResponse", "insurance", element.getInsurance().get(i), i);
8845    }
8846    if (element.hasPreAuthRefElement()) {
8847      composeString(t, "CoverageEligibilityResponse", "preAuthRef", element.getPreAuthRefElement(), -1);
8848    }
8849    if (element.hasForm()) {
8850      composeCodeableConcept(t, "CoverageEligibilityResponse", "form", element.getForm(), -1);
8851    }
8852    for (int i = 0; i < element.getError().size(); i++) {
8853      composeCoverageEligibilityResponseErrorsComponent(t, "CoverageEligibilityResponse", "error", element.getError().get(i), i);
8854    }
8855  }
8856
8857  protected void composeCoverageEligibilityResponseInsuranceComponent(Complex parent, String parentType, String name, CoverageEligibilityResponse.InsuranceComponent element, int index) {
8858    if (element == null) 
8859      return;
8860    Complex t;
8861    if (Utilities.noString(parentType))
8862      t = parent;
8863    else {
8864      t = parent.predicate("fhir:"+parentType+'.'+name);
8865    }
8866    composeBackboneElement(t, "insurance", name, element, index);
8867    if (element.hasCoverage()) {
8868      composeReference(t, "InsuranceComponent", "coverage", element.getCoverage(), -1);
8869    }
8870    if (element.hasInforceElement()) {
8871      composeBoolean(t, "InsuranceComponent", "inforce", element.getInforceElement(), -1);
8872    }
8873    if (element.hasBenefitPeriod()) {
8874      composePeriod(t, "InsuranceComponent", "benefitPeriod", element.getBenefitPeriod(), -1);
8875    }
8876    for (int i = 0; i < element.getItem().size(); i++) {
8877      composeCoverageEligibilityResponseItemsComponent(t, "InsuranceComponent", "item", element.getItem().get(i), i);
8878    }
8879  }
8880
8881  protected void composeCoverageEligibilityResponseItemsComponent(Complex parent, String parentType, String name, CoverageEligibilityResponse.ItemsComponent element, int index) {
8882    if (element == null) 
8883      return;
8884    Complex t;
8885    if (Utilities.noString(parentType))
8886      t = parent;
8887    else {
8888      t = parent.predicate("fhir:"+parentType+'.'+name);
8889    }
8890    composeBackboneElement(t, "item", name, element, index);
8891    if (element.hasCategory()) {
8892      composeCodeableConcept(t, "ItemsComponent", "category", element.getCategory(), -1);
8893    }
8894    if (element.hasProductOrService()) {
8895      composeCodeableConcept(t, "ItemsComponent", "productOrService", element.getProductOrService(), -1);
8896    }
8897    for (int i = 0; i < element.getModifier().size(); i++) {
8898      composeCodeableConcept(t, "ItemsComponent", "modifier", element.getModifier().get(i), i);
8899    }
8900    if (element.hasProvider()) {
8901      composeReference(t, "ItemsComponent", "provider", element.getProvider(), -1);
8902    }
8903    if (element.hasExcludedElement()) {
8904      composeBoolean(t, "ItemsComponent", "excluded", element.getExcludedElement(), -1);
8905    }
8906    if (element.hasNameElement()) {
8907      composeString(t, "ItemsComponent", "name", element.getNameElement(), -1);
8908    }
8909    if (element.hasDescriptionElement()) {
8910      composeString(t, "ItemsComponent", "description", element.getDescriptionElement(), -1);
8911    }
8912    if (element.hasNetwork()) {
8913      composeCodeableConcept(t, "ItemsComponent", "network", element.getNetwork(), -1);
8914    }
8915    if (element.hasUnit()) {
8916      composeCodeableConcept(t, "ItemsComponent", "unit", element.getUnit(), -1);
8917    }
8918    if (element.hasTerm()) {
8919      composeCodeableConcept(t, "ItemsComponent", "term", element.getTerm(), -1);
8920    }
8921    for (int i = 0; i < element.getBenefit().size(); i++) {
8922      composeCoverageEligibilityResponseBenefitComponent(t, "ItemsComponent", "benefit", element.getBenefit().get(i), i);
8923    }
8924    if (element.hasAuthorizationRequiredElement()) {
8925      composeBoolean(t, "ItemsComponent", "authorizationRequired", element.getAuthorizationRequiredElement(), -1);
8926    }
8927    for (int i = 0; i < element.getAuthorizationSupporting().size(); i++) {
8928      composeCodeableConcept(t, "ItemsComponent", "authorizationSupporting", element.getAuthorizationSupporting().get(i), i);
8929    }
8930    if (element.hasAuthorizationUrlElement()) {
8931      composeUri(t, "ItemsComponent", "authorizationUrl", element.getAuthorizationUrlElement(), -1);
8932    }
8933  }
8934
8935  protected void composeCoverageEligibilityResponseBenefitComponent(Complex parent, String parentType, String name, CoverageEligibilityResponse.BenefitComponent element, int index) {
8936    if (element == null) 
8937      return;
8938    Complex t;
8939    if (Utilities.noString(parentType))
8940      t = parent;
8941    else {
8942      t = parent.predicate("fhir:"+parentType+'.'+name);
8943    }
8944    composeBackboneElement(t, "benefit", name, element, index);
8945    if (element.hasType()) {
8946      composeCodeableConcept(t, "BenefitComponent", "type", element.getType(), -1);
8947    }
8948    if (element.hasAllowed()) {
8949      composeType(t, "BenefitComponent", "allowed", element.getAllowed(), -1);
8950    }
8951    if (element.hasUsed()) {
8952      composeType(t, "BenefitComponent", "used", element.getUsed(), -1);
8953    }
8954  }
8955
8956  protected void composeCoverageEligibilityResponseErrorsComponent(Complex parent, String parentType, String name, CoverageEligibilityResponse.ErrorsComponent element, int index) {
8957    if (element == null) 
8958      return;
8959    Complex t;
8960    if (Utilities.noString(parentType))
8961      t = parent;
8962    else {
8963      t = parent.predicate("fhir:"+parentType+'.'+name);
8964    }
8965    composeBackboneElement(t, "error", name, element, index);
8966    if (element.hasCode()) {
8967      composeCodeableConcept(t, "ErrorsComponent", "code", element.getCode(), -1);
8968    }
8969  }
8970
8971  protected void composeDetectedIssue(Complex parent, String parentType, String name, DetectedIssue element, int index) {
8972    if (element == null) 
8973      return;
8974    Complex t;
8975    if (Utilities.noString(parentType))
8976      t = parent;
8977    else {
8978      t = parent.predicate("fhir:"+parentType+'.'+name);
8979    }
8980    composeDomainResource(t, "DetectedIssue", name, element, index);
8981    for (int i = 0; i < element.getIdentifier().size(); i++) {
8982      composeIdentifier(t, "DetectedIssue", "identifier", element.getIdentifier().get(i), i);
8983    }
8984    if (element.hasStatusElement()) {
8985      composeEnum(t, "DetectedIssue", "status", element.getStatusElement(), -1);
8986    }
8987    for (int i = 0; i < element.getCategory().size(); i++) {
8988      composeCodeableConcept(t, "DetectedIssue", "category", element.getCategory().get(i), i);
8989    }
8990    if (element.hasCode()) {
8991      composeCodeableConcept(t, "DetectedIssue", "code", element.getCode(), -1);
8992    }
8993    if (element.hasSeverityElement()) {
8994      composeEnum(t, "DetectedIssue", "severity", element.getSeverityElement(), -1);
8995    }
8996    if (element.hasSubject()) {
8997      composeReference(t, "DetectedIssue", "subject", element.getSubject(), -1);
8998    }
8999    if (element.hasIdentified()) {
9000      composeType(t, "DetectedIssue", "identified", element.getIdentified(), -1);
9001    }
9002    if (element.hasAuthor()) {
9003      composeReference(t, "DetectedIssue", "author", element.getAuthor(), -1);
9004    }
9005    for (int i = 0; i < element.getImplicated().size(); i++) {
9006      composeReference(t, "DetectedIssue", "implicated", element.getImplicated().get(i), i);
9007    }
9008    for (int i = 0; i < element.getEvidence().size(); i++) {
9009      composeDetectedIssueEvidenceComponent(t, "DetectedIssue", "evidence", element.getEvidence().get(i), i);
9010    }
9011    if (element.hasDetailElement()) {
9012      composeString(t, "DetectedIssue", "detail", element.getDetailElement(), -1);
9013    }
9014    if (element.hasReferenceElement()) {
9015      composeUri(t, "DetectedIssue", "reference", element.getReferenceElement(), -1);
9016    }
9017    for (int i = 0; i < element.getMitigation().size(); i++) {
9018      composeDetectedIssueMitigationComponent(t, "DetectedIssue", "mitigation", element.getMitigation().get(i), i);
9019    }
9020  }
9021
9022  protected void composeDetectedIssueEvidenceComponent(Complex parent, String parentType, String name, DetectedIssue.DetectedIssueEvidenceComponent element, int index) {
9023    if (element == null) 
9024      return;
9025    Complex t;
9026    if (Utilities.noString(parentType))
9027      t = parent;
9028    else {
9029      t = parent.predicate("fhir:"+parentType+'.'+name);
9030    }
9031    composeBackboneElement(t, "evidence", name, element, index);
9032    for (int i = 0; i < element.getCode().size(); i++) {
9033      composeCodeableConcept(t, "DetectedIssueEvidenceComponent", "code", element.getCode().get(i), i);
9034    }
9035    for (int i = 0; i < element.getDetail().size(); i++) {
9036      composeReference(t, "DetectedIssueEvidenceComponent", "detail", element.getDetail().get(i), i);
9037    }
9038  }
9039
9040  protected void composeDetectedIssueMitigationComponent(Complex parent, String parentType, String name, DetectedIssue.DetectedIssueMitigationComponent element, int index) {
9041    if (element == null) 
9042      return;
9043    Complex t;
9044    if (Utilities.noString(parentType))
9045      t = parent;
9046    else {
9047      t = parent.predicate("fhir:"+parentType+'.'+name);
9048    }
9049    composeBackboneElement(t, "mitigation", name, element, index);
9050    if (element.hasAction()) {
9051      composeCodeableConcept(t, "DetectedIssueMitigationComponent", "action", element.getAction(), -1);
9052    }
9053    if (element.hasDateElement()) {
9054      composeDateTime(t, "DetectedIssueMitigationComponent", "date", element.getDateElement(), -1);
9055    }
9056    if (element.hasAuthor()) {
9057      composeReference(t, "DetectedIssueMitigationComponent", "author", element.getAuthor(), -1);
9058    }
9059  }
9060
9061  protected void composeDevice(Complex parent, String parentType, String name, Device element, int index) {
9062    if (element == null) 
9063      return;
9064    Complex t;
9065    if (Utilities.noString(parentType))
9066      t = parent;
9067    else {
9068      t = parent.predicate("fhir:"+parentType+'.'+name);
9069    }
9070    composeDomainResource(t, "Device", name, element, index);
9071    for (int i = 0; i < element.getIdentifier().size(); i++) {
9072      composeIdentifier(t, "Device", "identifier", element.getIdentifier().get(i), i);
9073    }
9074    if (element.hasDisplayNameElement()) {
9075      composeString(t, "Device", "displayName", element.getDisplayNameElement(), -1);
9076    }
9077    if (element.hasDefinition()) {
9078      composeCodeableReference(t, "Device", "definition", element.getDefinition(), -1);
9079    }
9080    for (int i = 0; i < element.getUdiCarrier().size(); i++) {
9081      composeDeviceUdiCarrierComponent(t, "Device", "udiCarrier", element.getUdiCarrier().get(i), i);
9082    }
9083    if (element.hasStatusElement()) {
9084      composeEnum(t, "Device", "status", element.getStatusElement(), -1);
9085    }
9086    if (element.hasAvailabilityStatus()) {
9087      composeCodeableConcept(t, "Device", "availabilityStatus", element.getAvailabilityStatus(), -1);
9088    }
9089    if (element.hasBiologicalSourceEvent()) {
9090      composeIdentifier(t, "Device", "biologicalSourceEvent", element.getBiologicalSourceEvent(), -1);
9091    }
9092    if (element.hasManufacturerElement()) {
9093      composeString(t, "Device", "manufacturer", element.getManufacturerElement(), -1);
9094    }
9095    if (element.hasManufactureDateElement()) {
9096      composeDateTime(t, "Device", "manufactureDate", element.getManufactureDateElement(), -1);
9097    }
9098    if (element.hasExpirationDateElement()) {
9099      composeDateTime(t, "Device", "expirationDate", element.getExpirationDateElement(), -1);
9100    }
9101    if (element.hasLotNumberElement()) {
9102      composeString(t, "Device", "lotNumber", element.getLotNumberElement(), -1);
9103    }
9104    if (element.hasSerialNumberElement()) {
9105      composeString(t, "Device", "serialNumber", element.getSerialNumberElement(), -1);
9106    }
9107    for (int i = 0; i < element.getDeviceName().size(); i++) {
9108      composeDeviceDeviceNameComponent(t, "Device", "deviceName", element.getDeviceName().get(i), i);
9109    }
9110    if (element.hasModelNumberElement()) {
9111      composeString(t, "Device", "modelNumber", element.getModelNumberElement(), -1);
9112    }
9113    if (element.hasPartNumberElement()) {
9114      composeString(t, "Device", "partNumber", element.getPartNumberElement(), -1);
9115    }
9116    for (int i = 0; i < element.getCategory().size(); i++) {
9117      composeCodeableConcept(t, "Device", "category", element.getCategory().get(i), i);
9118    }
9119    for (int i = 0; i < element.getType().size(); i++) {
9120      composeCodeableConcept(t, "Device", "type", element.getType().get(i), i);
9121    }
9122    for (int i = 0; i < element.getVersion().size(); i++) {
9123      composeDeviceVersionComponent(t, "Device", "version", element.getVersion().get(i), i);
9124    }
9125    for (int i = 0; i < element.getSpecialization().size(); i++) {
9126      composeDeviceSpecializationComponent(t, "Device", "specialization", element.getSpecialization().get(i), i);
9127    }
9128    for (int i = 0; i < element.getProperty().size(); i++) {
9129      composeDevicePropertyComponent(t, "Device", "property", element.getProperty().get(i), i);
9130    }
9131    for (int i = 0; i < element.getOperation().size(); i++) {
9132      composeDeviceOperationComponent(t, "Device", "operation", element.getOperation().get(i), i);
9133    }
9134    for (int i = 0; i < element.getAssociation().size(); i++) {
9135      composeDeviceAssociationComponent(t, "Device", "association", element.getAssociation().get(i), i);
9136    }
9137    if (element.hasOwner()) {
9138      composeReference(t, "Device", "owner", element.getOwner(), -1);
9139    }
9140    for (int i = 0; i < element.getContact().size(); i++) {
9141      composeContactPoint(t, "Device", "contact", element.getContact().get(i), i);
9142    }
9143    if (element.hasLocation()) {
9144      composeReference(t, "Device", "location", element.getLocation(), -1);
9145    }
9146    if (element.hasUrlElement()) {
9147      composeUri(t, "Device", "url", element.getUrlElement(), -1);
9148    }
9149    for (int i = 0; i < element.getEndpoint().size(); i++) {
9150      composeReference(t, "Device", "endpoint", element.getEndpoint().get(i), i);
9151    }
9152    for (int i = 0; i < element.getGateway().size(); i++) {
9153      composeCodeableReference(t, "Device", "gateway", element.getGateway().get(i), i);
9154    }
9155    for (int i = 0; i < element.getNote().size(); i++) {
9156      composeAnnotation(t, "Device", "note", element.getNote().get(i), i);
9157    }
9158    for (int i = 0; i < element.getSafety().size(); i++) {
9159      composeCodeableConcept(t, "Device", "safety", element.getSafety().get(i), i);
9160    }
9161    if (element.hasParent()) {
9162      composeReference(t, "Device", "parent", element.getParent(), -1);
9163    }
9164  }
9165
9166  protected void composeDeviceUdiCarrierComponent(Complex parent, String parentType, String name, Device.DeviceUdiCarrierComponent element, int index) {
9167    if (element == null) 
9168      return;
9169    Complex t;
9170    if (Utilities.noString(parentType))
9171      t = parent;
9172    else {
9173      t = parent.predicate("fhir:"+parentType+'.'+name);
9174    }
9175    composeBackboneElement(t, "udiCarrier", name, element, index);
9176    if (element.hasDeviceIdentifierElement()) {
9177      composeString(t, "DeviceUdiCarrierComponent", "deviceIdentifier", element.getDeviceIdentifierElement(), -1);
9178    }
9179    if (element.hasIssuerElement()) {
9180      composeUri(t, "DeviceUdiCarrierComponent", "issuer", element.getIssuerElement(), -1);
9181    }
9182    if (element.hasJurisdictionElement()) {
9183      composeUri(t, "DeviceUdiCarrierComponent", "jurisdiction", element.getJurisdictionElement(), -1);
9184    }
9185    if (element.hasCarrierAIDCElement()) {
9186      composeBase64Binary(t, "DeviceUdiCarrierComponent", "carrierAIDC", element.getCarrierAIDCElement(), -1);
9187    }
9188    if (element.hasCarrierHRFElement()) {
9189      composeString(t, "DeviceUdiCarrierComponent", "carrierHRF", element.getCarrierHRFElement(), -1);
9190    }
9191    if (element.hasEntryTypeElement()) {
9192      composeEnum(t, "DeviceUdiCarrierComponent", "entryType", element.getEntryTypeElement(), -1);
9193    }
9194  }
9195
9196  protected void composeDeviceDeviceNameComponent(Complex parent, String parentType, String name, Device.DeviceDeviceNameComponent element, int index) {
9197    if (element == null) 
9198      return;
9199    Complex t;
9200    if (Utilities.noString(parentType))
9201      t = parent;
9202    else {
9203      t = parent.predicate("fhir:"+parentType+'.'+name);
9204    }
9205    composeBackboneElement(t, "deviceName", name, element, index);
9206    if (element.hasNameElement()) {
9207      composeString(t, "DeviceDeviceNameComponent", "name", element.getNameElement(), -1);
9208    }
9209    if (element.hasTypeElement()) {
9210      composeEnum(t, "DeviceDeviceNameComponent", "type", element.getTypeElement(), -1);
9211    }
9212  }
9213
9214  protected void composeDeviceVersionComponent(Complex parent, String parentType, String name, Device.DeviceVersionComponent element, int index) {
9215    if (element == null) 
9216      return;
9217    Complex t;
9218    if (Utilities.noString(parentType))
9219      t = parent;
9220    else {
9221      t = parent.predicate("fhir:"+parentType+'.'+name);
9222    }
9223    composeBackboneElement(t, "version", name, element, index);
9224    if (element.hasType()) {
9225      composeCodeableConcept(t, "DeviceVersionComponent", "type", element.getType(), -1);
9226    }
9227    if (element.hasComponent()) {
9228      composeIdentifier(t, "DeviceVersionComponent", "component", element.getComponent(), -1);
9229    }
9230    if (element.hasInstallDateElement()) {
9231      composeDateTime(t, "DeviceVersionComponent", "installDate", element.getInstallDateElement(), -1);
9232    }
9233    if (element.hasValueElement()) {
9234      composeString(t, "DeviceVersionComponent", "value", element.getValueElement(), -1);
9235    }
9236  }
9237
9238  protected void composeDeviceSpecializationComponent(Complex parent, String parentType, String name, Device.DeviceSpecializationComponent element, int index) {
9239    if (element == null) 
9240      return;
9241    Complex t;
9242    if (Utilities.noString(parentType))
9243      t = parent;
9244    else {
9245      t = parent.predicate("fhir:"+parentType+'.'+name);
9246    }
9247    composeBackboneElement(t, "specialization", name, element, index);
9248    if (element.hasSystemType()) {
9249      composeCodeableConcept(t, "DeviceSpecializationComponent", "systemType", element.getSystemType(), -1);
9250    }
9251    if (element.hasVersionElement()) {
9252      composeString(t, "DeviceSpecializationComponent", "version", element.getVersionElement(), -1);
9253    }
9254    if (element.hasCategory()) {
9255      composeCoding(t, "DeviceSpecializationComponent", "category", element.getCategory(), -1);
9256    }
9257  }
9258
9259  protected void composeDevicePropertyComponent(Complex parent, String parentType, String name, Device.DevicePropertyComponent element, 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    composeBackboneElement(t, "property", name, element, index);
9269    if (element.hasType()) {
9270      composeCodeableConcept(t, "DevicePropertyComponent", "type", element.getType(), -1);
9271    }
9272    if (element.hasValue()) {
9273      composeType(t, "DevicePropertyComponent", "value", element.getValue(), -1);
9274    }
9275  }
9276
9277  protected void composeDeviceOperationComponent(Complex parent, String parentType, String name, Device.DeviceOperationComponent element, int index) {
9278    if (element == null) 
9279      return;
9280    Complex t;
9281    if (Utilities.noString(parentType))
9282      t = parent;
9283    else {
9284      t = parent.predicate("fhir:"+parentType+'.'+name);
9285    }
9286    composeBackboneElement(t, "operation", name, element, index);
9287    if (element.hasStatus()) {
9288      composeCodeableConcept(t, "DeviceOperationComponent", "status", element.getStatus(), -1);
9289    }
9290    for (int i = 0; i < element.getStatusReason().size(); i++) {
9291      composeCodeableConcept(t, "DeviceOperationComponent", "statusReason", element.getStatusReason().get(i), i);
9292    }
9293    for (int i = 0; i < element.getOperator().size(); i++) {
9294      composeReference(t, "DeviceOperationComponent", "operator", element.getOperator().get(i), i);
9295    }
9296    if (element.hasMode()) {
9297      composeCodeableConcept(t, "DeviceOperationComponent", "mode", element.getMode(), -1);
9298    }
9299    if (element.hasCycle()) {
9300      composeCount(t, "DeviceOperationComponent", "cycle", element.getCycle(), -1);
9301    }
9302    if (element.hasDuration()) {
9303      composeDuration(t, "DeviceOperationComponent", "duration", element.getDuration(), -1);
9304    }
9305  }
9306
9307  protected void composeDeviceAssociationComponent(Complex parent, String parentType, String name, Device.DeviceAssociationComponent element, int index) {
9308    if (element == null) 
9309      return;
9310    Complex t;
9311    if (Utilities.noString(parentType))
9312      t = parent;
9313    else {
9314      t = parent.predicate("fhir:"+parentType+'.'+name);
9315    }
9316    composeBackboneElement(t, "association", name, element, index);
9317    if (element.hasStatus()) {
9318      composeCodeableConcept(t, "DeviceAssociationComponent", "status", element.getStatus(), -1);
9319    }
9320    for (int i = 0; i < element.getStatusReason().size(); i++) {
9321      composeCodeableConcept(t, "DeviceAssociationComponent", "statusReason", element.getStatusReason().get(i), i);
9322    }
9323    if (element.hasHumanSubject()) {
9324      composeReference(t, "DeviceAssociationComponent", "humanSubject", element.getHumanSubject(), -1);
9325    }
9326    if (element.hasBodyStructure()) {
9327      composeCodeableReference(t, "DeviceAssociationComponent", "bodyStructure", element.getBodyStructure(), -1);
9328    }
9329  }
9330
9331  protected void composeDeviceDefinition(Complex parent, String parentType, String name, DeviceDefinition element, int index) {
9332    if (element == null) 
9333      return;
9334    Complex t;
9335    if (Utilities.noString(parentType))
9336      t = parent;
9337    else {
9338      t = parent.predicate("fhir:"+parentType+'.'+name);
9339    }
9340    composeDomainResource(t, "DeviceDefinition", name, element, index);
9341    if (element.hasD