001package org.hl7.fhir.dstu3.formats;
002
003
004
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
035// Generated on Mon, Apr 17, 2017 08:38+1000 for FHIR v3.0.x
036import org.hl7.fhir.dstu3.model.*;
037import org.hl7.fhir.dstu3.utils.formats.Turtle.Complex;
038import org.hl7.fhir.utilities.Utilities;
039
040public class RdfParser extends RdfParserBase {
041
042  public RdfParser() {
043    super();
044  }
045
046  public RdfParser(boolean allowUnknownContent) {
047    super();
048    setAllowUnknownContent(allowUnknownContent);
049  }
050
051
052  protected void composeElement(Complex t, String parentType, String name, Element element, int index) {
053    if (element == null) 
054      return;
055    if (index > -1)
056      t.predicate("fhir:index", Integer.toString(index));
057    if (element.hasIdElement())
058      composeString(t, "Element", "id", element.getIdElement(), -1);
059    for (int i = 0; i < element.getExtension().size(); i++)
060      composeExtension(t, "Element", "extension", element.getExtension().get(i), i);
061  }
062
063  protected void composeBackboneElement(Complex t, String tType, String name, BackboneElement element, int index) {
064    composeElement(t, tType, name, element, index);
065    for (int i = 0; i < element.getModifierExtension().size(); i++)
066      composeExtension(t, "Element", "modifierExtension", element.getModifierExtension().get(i), i);
067  }
068
069  private void composeEnum(Complex parent, String parentType, String name, Enumeration<? extends Enum> value, int index) {
070    if (value == null)
071      return;
072    Complex t = parent.predicate("fhir:"+parentType+"."+name);
073    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
074    composeElement(t, parentType, name, value, index);
075    decorateCode(t, value);
076  }
077
078
079  protected void composeDate(Complex parent, String parentType, String name, DateType value, int index) {
080    if (value == null)
081      return;
082    Complex t = parent.predicate("fhir:"+parentType+"."+name);
083    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
084    composeElement(t, parentType, name, value, index);
085  }
086
087  protected void composeDateTime(Complex parent, String parentType, String name, DateTimeType value, int index) {
088    if (value == null)
089      return;
090    Complex t = parent.predicate("fhir:"+parentType+"."+name);
091    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
092    composeElement(t, parentType, name, value, index);
093  }
094
095  protected void composeCode(Complex parent, String parentType, String name, CodeType value, int index) {
096    if (value == null)
097      return;
098    Complex t = parent.predicate("fhir:"+parentType+"."+name);
099    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
100    composeElement(t, parentType, name, value, index);
101    decorateCode(t, value);
102  }
103
104  protected void composeString(Complex parent, String parentType, String name, StringType value, int index) {
105    if (value == null)
106      return;
107    Complex t = parent.predicate("fhir:"+parentType+"."+name);
108    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
109    composeElement(t, parentType, name, value, index);
110  }
111
112  protected void composeInteger(Complex parent, String parentType, String name, IntegerType value, int index) {
113    if (value == null)
114      return;
115    Complex t = parent.predicate("fhir:"+parentType+"."+name);
116    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
117    composeElement(t, parentType, name, value, index);
118  }
119
120  protected void composeOid(Complex parent, String parentType, String name, OidType value, int index) {
121    if (value == null)
122      return;
123    Complex t = parent.predicate("fhir:"+parentType+"."+name);
124    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
125    composeElement(t, parentType, name, value, index);
126  }
127
128  protected void composeUri(Complex parent, String parentType, String name, UriType value, int index) {
129    if (value == null)
130      return;
131    Complex t = parent.predicate("fhir:"+parentType+"."+name);
132    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
133    composeElement(t, parentType, name, value, index);
134  }
135
136  protected void composeUuid(Complex parent, String parentType, String name, UuidType value, int index) {
137    if (value == null)
138      return;
139    Complex t = parent.predicate("fhir:"+parentType+"."+name);
140    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
141    composeElement(t, parentType, name, value, index);
142  }
143
144  protected void composeInstant(Complex parent, String parentType, String name, InstantType value, int index) {
145    if (value == null)
146      return;
147    Complex t = parent.predicate("fhir:"+parentType+"."+name);
148    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
149    composeElement(t, parentType, name, value, index);
150  }
151
152  protected void composeBoolean(Complex parent, String parentType, String name, BooleanType value, int index) {
153    if (value == null)
154      return;
155    Complex t = parent.predicate("fhir:"+parentType+"."+name);
156    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
157    composeElement(t, parentType, name, value, index);
158  }
159
160  protected void composeBase64Binary(Complex parent, String parentType, String name, Base64BinaryType value, int index) {
161    if (value == null)
162      return;
163    Complex t = parent.predicate("fhir:"+parentType+"."+name);
164    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
165    composeElement(t, parentType, name, value, index);
166  }
167
168  protected void composeUnsignedInt(Complex parent, String parentType, String name, UnsignedIntType value, int index) {
169    if (value == null)
170      return;
171    Complex t = parent.predicate("fhir:"+parentType+"."+name);
172    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
173    composeElement(t, parentType, name, value, index);
174  }
175
176  protected void composeMarkdown(Complex parent, String parentType, String name, MarkdownType value, int index) {
177    if (value == null)
178      return;
179    Complex t = parent.predicate("fhir:"+parentType+"."+name);
180    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
181    composeElement(t, parentType, name, value, index);
182  }
183
184  protected void composeTime(Complex parent, String parentType, String name, TimeType value, int index) {
185    if (value == null)
186      return;
187    Complex t = parent.predicate("fhir:"+parentType+"."+name);
188    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
189    composeElement(t, parentType, name, value, index);
190  }
191
192  protected void composeId(Complex parent, String parentType, String name, IdType value, int index) {
193    if (value == null)
194      return;
195    Complex t = parent.predicate("fhir:"+parentType+"."+name);
196    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
197    composeElement(t, parentType, name, value, index);
198  }
199
200  protected void composePositiveInt(Complex parent, String parentType, String name, PositiveIntType value, int index) {
201    if (value == null)
202      return;
203    Complex t = parent.predicate("fhir:"+parentType+"."+name);
204    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
205    composeElement(t, parentType, name, value, index);
206  }
207
208  protected void composeDecimal(Complex parent, String parentType, String name, DecimalType value, int index) {
209    if (value == null)
210      return;
211    Complex t = parent.predicate("fhir:"+parentType+"."+name);
212    t.predicate("fhir:value", ttlLiteral(value.asStringValue()));
213    composeElement(t, parentType, name, value, index);
214  }
215
216  protected void composeExtension(Complex parent, String parentType, String name, Extension element, int index) {
217    if (element == null) 
218      return;
219    Complex t;
220    if (Utilities.noString(parentType))
221      t = parent;
222    else {
223      t = parent.predicate("fhir:"+parentType+'.'+name);
224    }
225    composeElement(t, "Extension", name, element, index);
226    if (element.hasUrlElement())
227      composeUri(t, "Extension", "url", element.getUrlElement(), -1);
228    if (element.hasValue())
229      composeType(t, "Extension", "value", element.getValue(), -1);
230  }
231
232  protected void composeNarrative(Complex parent, String parentType, String name, Narrative element, int index) {
233    if (element == null) 
234      return;
235    Complex t;
236    if (Utilities.noString(parentType))
237      t = parent;
238    else {
239      t = parent.predicate("fhir:"+parentType+'.'+name);
240    }
241    composeElement(t, "Narrative", name, element, index);
242    if (element.hasStatusElement())
243      composeEnum(t, "Narrative", "status", element.getStatusElement(), -1);
244    if (element.hasDiv())
245      composeXhtml(t, "Narrative", "div", element.getDiv(), -1);
246  }
247
248  protected void composeReference(Complex parent, String parentType, String name, Reference element, int index) {
249    if (element == null) 
250      return;
251    Complex t;
252    if (Utilities.noString(parentType))
253      t = parent;
254    else {
255      t = parent.predicate("fhir:"+parentType+'.'+name);
256    }
257    composeElement(t, "Reference", name, element, index);
258    if (element.hasReferenceElement())
259      composeString(t, "Reference", "reference", element.getReferenceElement_(), -1);
260    if (element.hasIdentifier())
261      composeIdentifier(t, "Reference", "identifier", element.getIdentifier(), -1);
262    if (element.hasDisplayElement())
263      composeString(t, "Reference", "display", element.getDisplayElement(), -1);
264  }
265
266  protected void composeQuantity(Complex parent, String parentType, String name, Quantity element, int index) {
267    if (element == null) 
268      return;
269    Complex t;
270    if (Utilities.noString(parentType))
271      t = parent;
272    else {
273      t = parent.predicate("fhir:"+parentType+'.'+name);
274    }
275    composeElement(t, "Quantity", name, element, index);
276    if (element.hasValueElement())
277      composeDecimal(t, "Quantity", "value", element.getValueElement(), -1);
278    if (element.hasComparatorElement())
279      composeEnum(t, "Quantity", "comparator", element.getComparatorElement(), -1);
280    if (element.hasUnitElement())
281      composeString(t, "Quantity", "unit", element.getUnitElement(), -1);
282    if (element.hasSystemElement())
283      composeUri(t, "Quantity", "system", element.getSystemElement(), -1);
284    if (element.hasCodeElement())
285      composeCode(t, "Quantity", "code", element.getCodeElement(), -1);
286  }
287
288  protected void composePeriod(Complex parent, String parentType, String name, Period element, int index) {
289    if (element == null) 
290      return;
291    Complex t;
292    if (Utilities.noString(parentType))
293      t = parent;
294    else {
295      t = parent.predicate("fhir:"+parentType+'.'+name);
296    }
297    composeElement(t, "Period", name, element, index);
298    if (element.hasStartElement())
299      composeDateTime(t, "Period", "start", element.getStartElement(), -1);
300    if (element.hasEndElement())
301      composeDateTime(t, "Period", "end", element.getEndElement(), -1);
302  }
303
304  protected void composeAttachment(Complex parent, String parentType, String name, Attachment element, int index) {
305    if (element == null) 
306      return;
307    Complex t;
308    if (Utilities.noString(parentType))
309      t = parent;
310    else {
311      t = parent.predicate("fhir:"+parentType+'.'+name);
312    }
313    composeElement(t, "Attachment", name, element, index);
314    if (element.hasContentTypeElement())
315      composeCode(t, "Attachment", "contentType", element.getContentTypeElement(), -1);
316    if (element.hasLanguageElement())
317      composeCode(t, "Attachment", "language", element.getLanguageElement(), -1);
318    if (element.hasDataElement())
319      composeBase64Binary(t, "Attachment", "data", element.getDataElement(), -1);
320    if (element.hasUrlElement())
321      composeUri(t, "Attachment", "url", element.getUrlElement(), -1);
322    if (element.hasSizeElement())
323      composeUnsignedInt(t, "Attachment", "size", element.getSizeElement(), -1);
324    if (element.hasHashElement())
325      composeBase64Binary(t, "Attachment", "hash", element.getHashElement(), -1);
326    if (element.hasTitleElement())
327      composeString(t, "Attachment", "title", element.getTitleElement(), -1);
328    if (element.hasCreationElement())
329      composeDateTime(t, "Attachment", "creation", element.getCreationElement(), -1);
330  }
331
332  protected void composeDuration(Complex parent, String parentType, String name, Duration element, int index) {
333    if (element == null) 
334      return;
335    Complex t;
336    if (Utilities.noString(parentType))
337      t = parent;
338    else {
339      t = parent.predicate("fhir:"+parentType+'.'+name);
340    }
341    composeElement(t, "Duration", name, element, index);
342  }
343
344  protected void composeCount(Complex parent, String parentType, String name, Count element, int index) {
345    if (element == null) 
346      return;
347    Complex t;
348    if (Utilities.noString(parentType))
349      t = parent;
350    else {
351      t = parent.predicate("fhir:"+parentType+'.'+name);
352    }
353    composeElement(t, "Count", name, element, index);
354  }
355
356  protected void composeRange(Complex parent, String parentType, String name, Range element, int index) {
357    if (element == null) 
358      return;
359    Complex t;
360    if (Utilities.noString(parentType))
361      t = parent;
362    else {
363      t = parent.predicate("fhir:"+parentType+'.'+name);
364    }
365    composeElement(t, "Range", name, element, index);
366    if (element.hasLow())
367      composeQuantity(t, "Range", "low", element.getLow(), -1);
368    if (element.hasHigh())
369      composeQuantity(t, "Range", "high", element.getHigh(), -1);
370  }
371
372  protected void composeAnnotation(Complex parent, String parentType, String name, Annotation element, int index) {
373    if (element == null) 
374      return;
375    Complex t;
376    if (Utilities.noString(parentType))
377      t = parent;
378    else {
379      t = parent.predicate("fhir:"+parentType+'.'+name);
380    }
381    composeElement(t, "Annotation", name, element, index);
382    if (element.hasAuthor())
383      composeType(t, "Annotation", "author", element.getAuthor(), -1);
384    if (element.hasTimeElement())
385      composeDateTime(t, "Annotation", "time", element.getTimeElement(), -1);
386    if (element.hasTextElement())
387      composeString(t, "Annotation", "text", element.getTextElement(), -1);
388  }
389
390  protected void composeMoney(Complex parent, String parentType, String name, Money element, int index) {
391    if (element == null) 
392      return;
393    Complex t;
394    if (Utilities.noString(parentType))
395      t = parent;
396    else {
397      t = parent.predicate("fhir:"+parentType+'.'+name);
398    }
399    composeElement(t, "Money", name, element, index);
400  }
401
402  protected void composeIdentifier(Complex parent, String parentType, String name, Identifier element, int index) {
403    if (element == null) 
404      return;
405    Complex t;
406    if (Utilities.noString(parentType))
407      t = parent;
408    else {
409      t = parent.predicate("fhir:"+parentType+'.'+name);
410    }
411    composeElement(t, "Identifier", name, element, index);
412    if (element.hasUseElement())
413      composeEnum(t, "Identifier", "use", element.getUseElement(), -1);
414    if (element.hasType())
415      composeCodeableConcept(t, "Identifier", "type", element.getType(), -1);
416    if (element.hasSystemElement())
417      composeUri(t, "Identifier", "system", element.getSystemElement(), -1);
418    if (element.hasValueElement())
419      composeString(t, "Identifier", "value", element.getValueElement(), -1);
420    if (element.hasPeriod())
421      composePeriod(t, "Identifier", "period", element.getPeriod(), -1);
422    if (element.hasAssigner())
423      composeReference(t, "Identifier", "assigner", element.getAssigner(), -1);
424  }
425
426  protected void composeCoding(Complex parent, String parentType, String name, Coding element, int index) {
427    if (element == null) 
428      return;
429    Complex t;
430    if (Utilities.noString(parentType))
431      t = parent;
432    else {
433      t = parent.predicate("fhir:"+parentType+'.'+name);
434    }
435    composeElement(t, "Coding", name, element, index);
436    decorateCoding(t, element);
437    if (element.hasSystemElement())
438      composeUri(t, "Coding", "system", element.getSystemElement(), -1);
439    if (element.hasVersionElement())
440      composeString(t, "Coding", "version", element.getVersionElement(), -1);
441    if (element.hasCodeElement())
442      composeCode(t, "Coding", "code", element.getCodeElement(), -1);
443    if (element.hasDisplayElement())
444      composeString(t, "Coding", "display", element.getDisplayElement(), -1);
445    if (element.hasUserSelectedElement())
446      composeBoolean(t, "Coding", "userSelected", element.getUserSelectedElement(), -1);
447  }
448
449  protected void composeSignature(Complex parent, String parentType, String name, Signature element, int index) {
450    if (element == null) 
451      return;
452    Complex t;
453    if (Utilities.noString(parentType))
454      t = parent;
455    else {
456      t = parent.predicate("fhir:"+parentType+'.'+name);
457    }
458    composeElement(t, "Signature", name, element, index);
459    for (int i = 0; i < element.getType().size(); i++)
460      composeCoding(t, "Signature", "type", element.getType().get(i), i);
461    if (element.hasWhenElement())
462      composeInstant(t, "Signature", "when", element.getWhenElement(), -1);
463    if (element.hasWho())
464      composeType(t, "Signature", "who", element.getWho(), -1);
465    if (element.hasOnBehalfOf())
466      composeType(t, "Signature", "onBehalfOf", element.getOnBehalfOf(), -1);
467    if (element.hasContentTypeElement())
468      composeCode(t, "Signature", "contentType", element.getContentTypeElement(), -1);
469    if (element.hasBlobElement())
470      composeBase64Binary(t, "Signature", "blob", element.getBlobElement(), -1);
471  }
472
473  protected void composeSampledData(Complex parent, String parentType, String name, SampledData element, int index) {
474    if (element == null) 
475      return;
476    Complex t;
477    if (Utilities.noString(parentType))
478      t = parent;
479    else {
480      t = parent.predicate("fhir:"+parentType+'.'+name);
481    }
482    composeElement(t, "SampledData", name, element, index);
483    if (element.hasOrigin())
484      composeQuantity(t, "SampledData", "origin", element.getOrigin(), -1);
485    if (element.hasPeriodElement())
486      composeDecimal(t, "SampledData", "period", element.getPeriodElement(), -1);
487    if (element.hasFactorElement())
488      composeDecimal(t, "SampledData", "factor", element.getFactorElement(), -1);
489    if (element.hasLowerLimitElement())
490      composeDecimal(t, "SampledData", "lowerLimit", element.getLowerLimitElement(), -1);
491    if (element.hasUpperLimitElement())
492      composeDecimal(t, "SampledData", "upperLimit", element.getUpperLimitElement(), -1);
493    if (element.hasDimensionsElement())
494      composePositiveInt(t, "SampledData", "dimensions", element.getDimensionsElement(), -1);
495    if (element.hasDataElement())
496      composeString(t, "SampledData", "data", element.getDataElement(), -1);
497  }
498
499  protected void composeRatio(Complex parent, String parentType, String name, Ratio element, int index) {
500    if (element == null) 
501      return;
502    Complex t;
503    if (Utilities.noString(parentType))
504      t = parent;
505    else {
506      t = parent.predicate("fhir:"+parentType+'.'+name);
507    }
508    composeElement(t, "Ratio", name, element, index);
509    if (element.hasNumerator())
510      composeQuantity(t, "Ratio", "numerator", element.getNumerator(), -1);
511    if (element.hasDenominator())
512      composeQuantity(t, "Ratio", "denominator", element.getDenominator(), -1);
513  }
514
515  protected void composeDistance(Complex parent, String parentType, String name, Distance element, int index) {
516    if (element == null) 
517      return;
518    Complex t;
519    if (Utilities.noString(parentType))
520      t = parent;
521    else {
522      t = parent.predicate("fhir:"+parentType+'.'+name);
523    }
524    composeElement(t, "Distance", name, element, index);
525  }
526
527  protected void composeAge(Complex parent, String parentType, String name, Age element, int index) {
528    if (element == null) 
529      return;
530    Complex t;
531    if (Utilities.noString(parentType))
532      t = parent;
533    else {
534      t = parent.predicate("fhir:"+parentType+'.'+name);
535    }
536    composeElement(t, "Age", name, element, index);
537  }
538
539  protected void composeCodeableConcept(Complex parent, String parentType, String name, CodeableConcept element, int index) {
540    if (element == null) 
541      return;
542    Complex t;
543    if (Utilities.noString(parentType))
544      t = parent;
545    else {
546      t = parent.predicate("fhir:"+parentType+'.'+name);
547    }
548    composeElement(t, "CodeableConcept", name, element, index);
549    decorateCodeableConcept(t, element);
550    for (int i = 0; i < element.getCoding().size(); i++)
551      composeCoding(t, "CodeableConcept", "coding", element.getCoding().get(i), i);
552    if (element.hasTextElement())
553      composeString(t, "CodeableConcept", "text", element.getTextElement(), -1);
554  }
555
556  protected void composeMeta(Complex parent, String parentType, String name, Meta element, int index) {
557    if (element == null) 
558      return;
559    Complex t;
560    if (Utilities.noString(parentType))
561      t = parent;
562    else {
563      t = parent.predicate("fhir:"+parentType+'.'+name);
564    }
565    composeElement(t, "Meta", name, element, index);
566    if (element.hasVersionIdElement())
567      composeId(t, "Meta", "versionId", element.getVersionIdElement(), -1);
568    if (element.hasLastUpdatedElement())
569      composeInstant(t, "Meta", "lastUpdated", element.getLastUpdatedElement(), -1);
570    for (int i = 0; i < element.getProfile().size(); i++)
571      composeUri(t, "Meta", "profile", element.getProfile().get(i), i);
572    for (int i = 0; i < element.getSecurity().size(); i++)
573      composeCoding(t, "Meta", "security", element.getSecurity().get(i), i);
574    for (int i = 0; i < element.getTag().size(); i++)
575      composeCoding(t, "Meta", "tag", element.getTag().get(i), i);
576  }
577
578  protected void composeAddress(Complex parent, String parentType, String name, Address element, int index) {
579    if (element == null) 
580      return;
581    Complex t;
582    if (Utilities.noString(parentType))
583      t = parent;
584    else {
585      t = parent.predicate("fhir:"+parentType+'.'+name);
586    }
587    composeElement(t, "Address", name, element, index);
588    if (element.hasUseElement())
589      composeEnum(t, "Address", "use", element.getUseElement(), -1);
590    if (element.hasTypeElement())
591      composeEnum(t, "Address", "type", element.getTypeElement(), -1);
592    if (element.hasTextElement())
593      composeString(t, "Address", "text", element.getTextElement(), -1);
594    for (int i = 0; i < element.getLine().size(); i++)
595      composeString(t, "Address", "line", element.getLine().get(i), i);
596    if (element.hasCityElement())
597      composeString(t, "Address", "city", element.getCityElement(), -1);
598    if (element.hasDistrictElement())
599      composeString(t, "Address", "district", element.getDistrictElement(), -1);
600    if (element.hasStateElement())
601      composeString(t, "Address", "state", element.getStateElement(), -1);
602    if (element.hasPostalCodeElement())
603      composeString(t, "Address", "postalCode", element.getPostalCodeElement(), -1);
604    if (element.hasCountryElement())
605      composeString(t, "Address", "country", element.getCountryElement(), -1);
606    if (element.hasPeriod())
607      composePeriod(t, "Address", "period", element.getPeriod(), -1);
608  }
609
610  protected void composeTriggerDefinition(Complex parent, String parentType, String name, TriggerDefinition element, int index) {
611    if (element == null) 
612      return;
613    Complex t;
614    if (Utilities.noString(parentType))
615      t = parent;
616    else {
617      t = parent.predicate("fhir:"+parentType+'.'+name);
618    }
619    composeElement(t, "TriggerDefinition", name, element, index);
620    if (element.hasTypeElement())
621      composeEnum(t, "TriggerDefinition", "type", element.getTypeElement(), -1);
622    if (element.hasEventNameElement())
623      composeString(t, "TriggerDefinition", "eventName", element.getEventNameElement(), -1);
624    if (element.hasEventTiming())
625      composeType(t, "TriggerDefinition", "eventTiming", element.getEventTiming(), -1);
626    if (element.hasEventData())
627      composeDataRequirement(t, "TriggerDefinition", "eventData", element.getEventData(), -1);
628  }
629
630  protected void composeContributor(Complex parent, String parentType, String name, Contributor element, int index) {
631    if (element == null) 
632      return;
633    Complex t;
634    if (Utilities.noString(parentType))
635      t = parent;
636    else {
637      t = parent.predicate("fhir:"+parentType+'.'+name);
638    }
639    composeElement(t, "Contributor", name, element, index);
640    if (element.hasTypeElement())
641      composeEnum(t, "Contributor", "type", element.getTypeElement(), -1);
642    if (element.hasNameElement())
643      composeString(t, "Contributor", "name", element.getNameElement(), -1);
644    for (int i = 0; i < element.getContact().size(); i++)
645      composeContactDetail(t, "Contributor", "contact", element.getContact().get(i), i);
646  }
647
648  protected void composeDataRequirement(Complex parent, String parentType, String name, DataRequirement 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, "DataRequirement", name, element, index);
658    if (element.hasTypeElement())
659      composeCode(t, "DataRequirement", "type", element.getTypeElement(), -1);
660    for (int i = 0; i < element.getProfile().size(); i++)
661      composeUri(t, "DataRequirement", "profile", element.getProfile().get(i), i);
662    for (int i = 0; i < element.getMustSupport().size(); i++)
663      composeString(t, "DataRequirement", "mustSupport", element.getMustSupport().get(i), i);
664    for (int i = 0; i < element.getCodeFilter().size(); i++)
665      composeDataRequirementDataRequirementCodeFilterComponent(t, "DataRequirement", "codeFilter", element.getCodeFilter().get(i), i);
666    for (int i = 0; i < element.getDateFilter().size(); i++)
667      composeDataRequirementDataRequirementDateFilterComponent(t, "DataRequirement", "dateFilter", element.getDateFilter().get(i), i);
668  }
669
670  protected void composeDataRequirementDataRequirementCodeFilterComponent(Complex parent, String parentType, String name, DataRequirement.DataRequirementCodeFilterComponent element, int index) {
671    if (element == null) 
672      return;
673    Complex t;
674    if (Utilities.noString(parentType))
675      t = parent;
676    else {
677      t = parent.predicate("fhir:"+parentType+'.'+name);
678    }
679    composeElement(t, "codeFilter", name, element, index);
680    if (element.hasPathElement())
681      composeString(t, "DataRequirement", "path", element.getPathElement(), -1);
682    if (element.hasValueSet())
683      composeType(t, "DataRequirement", "valueSet", element.getValueSet(), -1);
684    for (int i = 0; i < element.getValueCode().size(); i++)
685      composeCode(t, "DataRequirement", "valueCode", element.getValueCode().get(i), i);
686    for (int i = 0; i < element.getValueCoding().size(); i++)
687      composeCoding(t, "DataRequirement", "valueCoding", element.getValueCoding().get(i), i);
688    for (int i = 0; i < element.getValueCodeableConcept().size(); i++)
689      composeCodeableConcept(t, "DataRequirement", "valueCodeableConcept", element.getValueCodeableConcept().get(i), i);
690  }
691
692  protected void composeDataRequirementDataRequirementDateFilterComponent(Complex parent, String parentType, String name, DataRequirement.DataRequirementDateFilterComponent element, int index) {
693    if (element == null) 
694      return;
695    Complex t;
696    if (Utilities.noString(parentType))
697      t = parent;
698    else {
699      t = parent.predicate("fhir:"+parentType+'.'+name);
700    }
701    composeElement(t, "dateFilter", name, element, index);
702    if (element.hasPathElement())
703      composeString(t, "DataRequirement", "path", element.getPathElement(), -1);
704    if (element.hasValue())
705      composeType(t, "DataRequirement", "value", element.getValue(), -1);
706  }
707
708  protected void composeDosage(Complex parent, String parentType, String name, Dosage element, int index) {
709    if (element == null) 
710      return;
711    Complex t;
712    if (Utilities.noString(parentType))
713      t = parent;
714    else {
715      t = parent.predicate("fhir:"+parentType+'.'+name);
716    }
717    composeElement(t, "Dosage", name, element, index);
718    if (element.hasSequenceElement())
719      composeInteger(t, "Dosage", "sequence", element.getSequenceElement(), -1);
720    if (element.hasTextElement())
721      composeString(t, "Dosage", "text", element.getTextElement(), -1);
722    for (int i = 0; i < element.getAdditionalInstruction().size(); i++)
723      composeCodeableConcept(t, "Dosage", "additionalInstruction", element.getAdditionalInstruction().get(i), i);
724    if (element.hasPatientInstructionElement())
725      composeString(t, "Dosage", "patientInstruction", element.getPatientInstructionElement(), -1);
726    if (element.hasTiming())
727      composeTiming(t, "Dosage", "timing", element.getTiming(), -1);
728    if (element.hasAsNeeded())
729      composeType(t, "Dosage", "asNeeded", element.getAsNeeded(), -1);
730    if (element.hasSite())
731      composeCodeableConcept(t, "Dosage", "site", element.getSite(), -1);
732    if (element.hasRoute())
733      composeCodeableConcept(t, "Dosage", "route", element.getRoute(), -1);
734    if (element.hasMethod())
735      composeCodeableConcept(t, "Dosage", "method", element.getMethod(), -1);
736    if (element.hasDose())
737      composeType(t, "Dosage", "dose", element.getDose(), -1);
738    if (element.hasMaxDosePerPeriod())
739      composeRatio(t, "Dosage", "maxDosePerPeriod", element.getMaxDosePerPeriod(), -1);
740    if (element.hasMaxDosePerAdministration())
741      composeQuantity(t, "Dosage", "maxDosePerAdministration", element.getMaxDosePerAdministration(), -1);
742    if (element.hasMaxDosePerLifetime())
743      composeQuantity(t, "Dosage", "maxDosePerLifetime", element.getMaxDosePerLifetime(), -1);
744    if (element.hasRate())
745      composeType(t, "Dosage", "rate", element.getRate(), -1);
746  }
747
748  protected void composeRelatedArtifact(Complex parent, String parentType, String name, RelatedArtifact element, int index) {
749    if (element == null) 
750      return;
751    Complex t;
752    if (Utilities.noString(parentType))
753      t = parent;
754    else {
755      t = parent.predicate("fhir:"+parentType+'.'+name);
756    }
757    composeElement(t, "RelatedArtifact", name, element, index);
758    if (element.hasTypeElement())
759      composeEnum(t, "RelatedArtifact", "type", element.getTypeElement(), -1);
760    if (element.hasDisplayElement())
761      composeString(t, "RelatedArtifact", "display", element.getDisplayElement(), -1);
762    if (element.hasCitationElement())
763      composeString(t, "RelatedArtifact", "citation", element.getCitationElement(), -1);
764    if (element.hasUrlElement())
765      composeUri(t, "RelatedArtifact", "url", element.getUrlElement(), -1);
766    if (element.hasDocument())
767      composeAttachment(t, "RelatedArtifact", "document", element.getDocument(), -1);
768    if (element.hasResource())
769      composeReference(t, "RelatedArtifact", "resource", element.getResource(), -1);
770  }
771
772  protected void composeContactDetail(Complex parent, String parentType, String name, ContactDetail element, int index) {
773    if (element == null) 
774      return;
775    Complex t;
776    if (Utilities.noString(parentType))
777      t = parent;
778    else {
779      t = parent.predicate("fhir:"+parentType+'.'+name);
780    }
781    composeElement(t, "ContactDetail", name, element, index);
782    if (element.hasNameElement())
783      composeString(t, "ContactDetail", "name", element.getNameElement(), -1);
784    for (int i = 0; i < element.getTelecom().size(); i++)
785      composeContactPoint(t, "ContactDetail", "telecom", element.getTelecom().get(i), i);
786  }
787
788  protected void composeHumanName(Complex parent, String parentType, String name, HumanName element, int index) {
789    if (element == null) 
790      return;
791    Complex t;
792    if (Utilities.noString(parentType))
793      t = parent;
794    else {
795      t = parent.predicate("fhir:"+parentType+'.'+name);
796    }
797    composeElement(t, "HumanName", name, element, index);
798    if (element.hasUseElement())
799      composeEnum(t, "HumanName", "use", element.getUseElement(), -1);
800    if (element.hasTextElement())
801      composeString(t, "HumanName", "text", element.getTextElement(), -1);
802    if (element.hasFamilyElement())
803      composeString(t, "HumanName", "family", element.getFamilyElement(), -1);
804    for (int i = 0; i < element.getGiven().size(); i++)
805      composeString(t, "HumanName", "given", element.getGiven().get(i), i);
806    for (int i = 0; i < element.getPrefix().size(); i++)
807      composeString(t, "HumanName", "prefix", element.getPrefix().get(i), i);
808    for (int i = 0; i < element.getSuffix().size(); i++)
809      composeString(t, "HumanName", "suffix", element.getSuffix().get(i), i);
810    if (element.hasPeriod())
811      composePeriod(t, "HumanName", "period", element.getPeriod(), -1);
812  }
813
814  protected void composeContactPoint(Complex parent, String parentType, String name, ContactPoint element, int index) {
815    if (element == null) 
816      return;
817    Complex t;
818    if (Utilities.noString(parentType))
819      t = parent;
820    else {
821      t = parent.predicate("fhir:"+parentType+'.'+name);
822    }
823    composeElement(t, "ContactPoint", name, element, index);
824    if (element.hasSystemElement())
825      composeEnum(t, "ContactPoint", "system", element.getSystemElement(), -1);
826    if (element.hasValueElement())
827      composeString(t, "ContactPoint", "value", element.getValueElement(), -1);
828    if (element.hasUseElement())
829      composeEnum(t, "ContactPoint", "use", element.getUseElement(), -1);
830    if (element.hasRankElement())
831      composePositiveInt(t, "ContactPoint", "rank", element.getRankElement(), -1);
832    if (element.hasPeriod())
833      composePeriod(t, "ContactPoint", "period", element.getPeriod(), -1);
834  }
835
836  protected void composeUsageContext(Complex parent, String parentType, String name, UsageContext element, int index) {
837    if (element == null) 
838      return;
839    Complex t;
840    if (Utilities.noString(parentType))
841      t = parent;
842    else {
843      t = parent.predicate("fhir:"+parentType+'.'+name);
844    }
845    composeElement(t, "UsageContext", name, element, index);
846    if (element.hasCode())
847      composeCoding(t, "UsageContext", "code", element.getCode(), -1);
848    if (element.hasValue())
849      composeType(t, "UsageContext", "value", element.getValue(), -1);
850  }
851
852  protected void composeTiming(Complex parent, String parentType, String name, Timing element, int index) {
853    if (element == null) 
854      return;
855    Complex t;
856    if (Utilities.noString(parentType))
857      t = parent;
858    else {
859      t = parent.predicate("fhir:"+parentType+'.'+name);
860    }
861    composeElement(t, "Timing", name, element, index);
862    for (int i = 0; i < element.getEvent().size(); i++)
863      composeDateTime(t, "Timing", "event", element.getEvent().get(i), i);
864    if (element.hasRepeat())
865      composeTimingTimingRepeatComponent(t, "Timing", "repeat", element.getRepeat(), -1);
866    if (element.hasCode())
867      composeCodeableConcept(t, "Timing", "code", element.getCode(), -1);
868  }
869
870  protected void composeTimingTimingRepeatComponent(Complex parent, String parentType, String name, Timing.TimingRepeatComponent element, int index) {
871    if (element == null) 
872      return;
873    Complex t;
874    if (Utilities.noString(parentType))
875      t = parent;
876    else {
877      t = parent.predicate("fhir:"+parentType+'.'+name);
878    }
879    composeElement(t, "repeat", name, element, index);
880    if (element.hasBounds())
881      composeType(t, "Timing", "bounds", element.getBounds(), -1);
882    if (element.hasCountElement())
883      composeInteger(t, "Timing", "count", element.getCountElement(), -1);
884    if (element.hasCountMaxElement())
885      composeInteger(t, "Timing", "countMax", element.getCountMaxElement(), -1);
886    if (element.hasDurationElement())
887      composeDecimal(t, "Timing", "duration", element.getDurationElement(), -1);
888    if (element.hasDurationMaxElement())
889      composeDecimal(t, "Timing", "durationMax", element.getDurationMaxElement(), -1);
890    if (element.hasDurationUnitElement())
891      composeEnum(t, "Timing", "durationUnit", element.getDurationUnitElement(), -1);
892    if (element.hasFrequencyElement())
893      composeInteger(t, "Timing", "frequency", element.getFrequencyElement(), -1);
894    if (element.hasFrequencyMaxElement())
895      composeInteger(t, "Timing", "frequencyMax", element.getFrequencyMaxElement(), -1);
896    if (element.hasPeriodElement())
897      composeDecimal(t, "Timing", "period", element.getPeriodElement(), -1);
898    if (element.hasPeriodMaxElement())
899      composeDecimal(t, "Timing", "periodMax", element.getPeriodMaxElement(), -1);
900    if (element.hasPeriodUnitElement())
901      composeEnum(t, "Timing", "periodUnit", element.getPeriodUnitElement(), -1);
902    for (int i = 0; i < element.getDayOfWeek().size(); i++)
903      composeEnum(t, "Timing", "dayOfWeek", element.getDayOfWeek().get(i), i);
904    for (int i = 0; i < element.getTimeOfDay().size(); i++)
905      composeTime(t, "Timing", "timeOfDay", element.getTimeOfDay().get(i), i);
906    for (int i = 0; i < element.getWhen().size(); i++)
907      composeEnum(t, "Timing", "when", element.getWhen().get(i), i);
908    if (element.hasOffsetElement())
909      composeUnsignedInt(t, "Timing", "offset", element.getOffsetElement(), -1);
910  }
911
912  protected void composeElementDefinition(Complex parent, String parentType, String name, ElementDefinition element, int index) {
913    if (element == null) 
914      return;
915    Complex t;
916    if (Utilities.noString(parentType))
917      t = parent;
918    else {
919      t = parent.predicate("fhir:"+parentType+'.'+name);
920    }
921    composeElement(t, "ElementDefinition", name, element, index);
922    if (element.hasPathElement())
923      composeString(t, "ElementDefinition", "path", element.getPathElement(), -1);
924    for (int i = 0; i < element.getRepresentation().size(); i++)
925      composeEnum(t, "ElementDefinition", "representation", element.getRepresentation().get(i), i);
926    if (element.hasSliceNameElement())
927      composeString(t, "ElementDefinition", "sliceName", element.getSliceNameElement(), -1);
928    if (element.hasLabelElement())
929      composeString(t, "ElementDefinition", "label", element.getLabelElement(), -1);
930    for (int i = 0; i < element.getCode().size(); i++)
931      composeCoding(t, "ElementDefinition", "code", element.getCode().get(i), i);
932    if (element.hasSlicing())
933      composeElementDefinitionElementDefinitionSlicingComponent(t, "ElementDefinition", "slicing", element.getSlicing(), -1);
934    if (element.hasShortElement())
935      composeString(t, "ElementDefinition", "short", element.getShortElement(), -1);
936    if (element.hasDefinitionElement())
937      composeMarkdown(t, "ElementDefinition", "definition", element.getDefinitionElement(), -1);
938    if (element.hasCommentElement())
939      composeMarkdown(t, "ElementDefinition", "comment", element.getCommentElement(), -1);
940    if (element.hasRequirementsElement())
941      composeMarkdown(t, "ElementDefinition", "requirements", element.getRequirementsElement(), -1);
942    for (int i = 0; i < element.getAlias().size(); i++)
943      composeString(t, "ElementDefinition", "alias", element.getAlias().get(i), i);
944    if (element.hasMinElement())
945      composeUnsignedInt(t, "ElementDefinition", "min", element.getMinElement(), -1);
946    if (element.hasMaxElement())
947      composeString(t, "ElementDefinition", "max", element.getMaxElement(), -1);
948    if (element.hasBase())
949      composeElementDefinitionElementDefinitionBaseComponent(t, "ElementDefinition", "base", element.getBase(), -1);
950    if (element.hasContentReferenceElement())
951      composeUri(t, "ElementDefinition", "contentReference", element.getContentReferenceElement(), -1);
952    for (int i = 0; i < element.getType().size(); i++)
953      composeElementDefinitionTypeRefComponent(t, "ElementDefinition", "type", element.getType().get(i), i);
954    if (element.hasDefaultValue())
955      composeType(t, "ElementDefinition", "defaultValue", element.getDefaultValue(), -1);
956    if (element.hasMeaningWhenMissingElement())
957      composeMarkdown(t, "ElementDefinition", "meaningWhenMissing", element.getMeaningWhenMissingElement(), -1);
958    if (element.hasOrderMeaningElement())
959      composeString(t, "ElementDefinition", "orderMeaning", element.getOrderMeaningElement(), -1);
960    if (element.hasFixed())
961      composeType(t, "ElementDefinition", "fixed", element.getFixed(), -1);
962    if (element.hasPattern())
963      composeType(t, "ElementDefinition", "pattern", element.getPattern(), -1);
964    for (int i = 0; i < element.getExample().size(); i++)
965      composeElementDefinitionElementDefinitionExampleComponent(t, "ElementDefinition", "example", element.getExample().get(i), i);
966    if (element.hasMinValue())
967      composeType(t, "ElementDefinition", "minValue", element.getMinValue(), -1);
968    if (element.hasMaxValue())
969      composeType(t, "ElementDefinition", "maxValue", element.getMaxValue(), -1);
970    if (element.hasMaxLengthElement())
971      composeInteger(t, "ElementDefinition", "maxLength", element.getMaxLengthElement(), -1);
972    for (int i = 0; i < element.getCondition().size(); i++)
973      composeId(t, "ElementDefinition", "condition", element.getCondition().get(i), i);
974    for (int i = 0; i < element.getConstraint().size(); i++)
975      composeElementDefinitionElementDefinitionConstraintComponent(t, "ElementDefinition", "constraint", element.getConstraint().get(i), i);
976    if (element.hasMustSupportElement())
977      composeBoolean(t, "ElementDefinition", "mustSupport", element.getMustSupportElement(), -1);
978    if (element.hasIsModifierElement())
979      composeBoolean(t, "ElementDefinition", "isModifier", element.getIsModifierElement(), -1);
980    if (element.hasIsSummaryElement())
981      composeBoolean(t, "ElementDefinition", "isSummary", element.getIsSummaryElement(), -1);
982    if (element.hasBinding())
983      composeElementDefinitionElementDefinitionBindingComponent(t, "ElementDefinition", "binding", element.getBinding(), -1);
984    for (int i = 0; i < element.getMapping().size(); i++)
985      composeElementDefinitionElementDefinitionMappingComponent(t, "ElementDefinition", "mapping", element.getMapping().get(i), i);
986  }
987
988  protected void composeElementDefinitionElementDefinitionSlicingComponent(Complex parent, String parentType, String name, ElementDefinition.ElementDefinitionSlicingComponent element, int index) {
989    if (element == null) 
990      return;
991    Complex t;
992    if (Utilities.noString(parentType))
993      t = parent;
994    else {
995      t = parent.predicate("fhir:"+parentType+'.'+name);
996    }
997    composeElement(t, "slicing", name, element, index);
998    for (int i = 0; i < element.getDiscriminator().size(); i++)
999      composeElementDefinitionElementDefinitionSlicingDiscriminatorComponent(t, "ElementDefinition", "discriminator", element.getDiscriminator().get(i), i);
1000    if (element.hasDescriptionElement())
1001      composeString(t, "ElementDefinition", "description", element.getDescriptionElement(), -1);
1002    if (element.hasOrderedElement())
1003      composeBoolean(t, "ElementDefinition", "ordered", element.getOrderedElement(), -1);
1004    if (element.hasRulesElement())
1005      composeEnum(t, "ElementDefinition", "rules", element.getRulesElement(), -1);
1006  }
1007
1008  protected void composeElementDefinitionElementDefinitionSlicingDiscriminatorComponent(Complex parent, String parentType, String name, ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent element, int index) {
1009    if (element == null) 
1010      return;
1011    Complex t;
1012    if (Utilities.noString(parentType))
1013      t = parent;
1014    else {
1015      t = parent.predicate("fhir:"+parentType+'.'+name);
1016    }
1017    composeElement(t, "discriminator", name, element, index);
1018    if (element.hasTypeElement())
1019      composeEnum(t, "ElementDefinition", "type", element.getTypeElement(), -1);
1020    if (element.hasPathElement())
1021      composeString(t, "ElementDefinition", "path", element.getPathElement(), -1);
1022  }
1023
1024  protected void composeElementDefinitionElementDefinitionBaseComponent(Complex parent, String parentType, String name, ElementDefinition.ElementDefinitionBaseComponent element, int index) {
1025    if (element == null) 
1026      return;
1027    Complex t;
1028    if (Utilities.noString(parentType))
1029      t = parent;
1030    else {
1031      t = parent.predicate("fhir:"+parentType+'.'+name);
1032    }
1033    composeElement(t, "base", name, element, index);
1034    if (element.hasPathElement())
1035      composeString(t, "ElementDefinition", "path", element.getPathElement(), -1);
1036    if (element.hasMinElement())
1037      composeUnsignedInt(t, "ElementDefinition", "min", element.getMinElement(), -1);
1038    if (element.hasMaxElement())
1039      composeString(t, "ElementDefinition", "max", element.getMaxElement(), -1);
1040  }
1041
1042  protected void composeElementDefinitionTypeRefComponent(Complex parent, String parentType, String name, ElementDefinition.TypeRefComponent element, int index) {
1043    if (element == null) 
1044      return;
1045    Complex t;
1046    if (Utilities.noString(parentType))
1047      t = parent;
1048    else {
1049      t = parent.predicate("fhir:"+parentType+'.'+name);
1050    }
1051    composeElement(t, "type", name, element, index);
1052    if (element.hasCodeElement())
1053      composeUri(t, "ElementDefinition", "code", element.getCodeElement(), -1);
1054    if (element.hasProfileElement())
1055      composeUri(t, "ElementDefinition", "profile", element.getProfileElement(), -1);
1056    if (element.hasTargetProfileElement())
1057      composeUri(t, "ElementDefinition", "targetProfile", element.getTargetProfileElement(), -1);
1058    for (int i = 0; i < element.getAggregation().size(); i++)
1059      composeEnum(t, "ElementDefinition", "aggregation", element.getAggregation().get(i), i);
1060    if (element.hasVersioningElement())
1061      composeEnum(t, "ElementDefinition", "versioning", element.getVersioningElement(), -1);
1062  }
1063
1064  protected void composeElementDefinitionElementDefinitionExampleComponent(Complex parent, String parentType, String name, ElementDefinition.ElementDefinitionExampleComponent element, int index) {
1065    if (element == null) 
1066      return;
1067    Complex t;
1068    if (Utilities.noString(parentType))
1069      t = parent;
1070    else {
1071      t = parent.predicate("fhir:"+parentType+'.'+name);
1072    }
1073    composeElement(t, "example", name, element, index);
1074    if (element.hasLabelElement())
1075      composeString(t, "ElementDefinition", "label", element.getLabelElement(), -1);
1076    if (element.hasValue())
1077      composeType(t, "ElementDefinition", "value", element.getValue(), -1);
1078  }
1079
1080  protected void composeElementDefinitionElementDefinitionConstraintComponent(Complex parent, String parentType, String name, ElementDefinition.ElementDefinitionConstraintComponent element, int index) {
1081    if (element == null) 
1082      return;
1083    Complex t;
1084    if (Utilities.noString(parentType))
1085      t = parent;
1086    else {
1087      t = parent.predicate("fhir:"+parentType+'.'+name);
1088    }
1089    composeElement(t, "constraint", name, element, index);
1090    if (element.hasKeyElement())
1091      composeId(t, "ElementDefinition", "key", element.getKeyElement(), -1);
1092    if (element.hasRequirementsElement())
1093      composeString(t, "ElementDefinition", "requirements", element.getRequirementsElement(), -1);
1094    if (element.hasSeverityElement())
1095      composeEnum(t, "ElementDefinition", "severity", element.getSeverityElement(), -1);
1096    if (element.hasHumanElement())
1097      composeString(t, "ElementDefinition", "human", element.getHumanElement(), -1);
1098    if (element.hasExpressionElement())
1099      composeString(t, "ElementDefinition", "expression", element.getExpressionElement(), -1);
1100    if (element.hasXpathElement())
1101      composeString(t, "ElementDefinition", "xpath", element.getXpathElement(), -1);
1102    if (element.hasSourceElement())
1103      composeUri(t, "ElementDefinition", "source", element.getSourceElement(), -1);
1104  }
1105
1106  protected void composeElementDefinitionElementDefinitionBindingComponent(Complex parent, String parentType, String name, ElementDefinition.ElementDefinitionBindingComponent element, int index) {
1107    if (element == null) 
1108      return;
1109    Complex t;
1110    if (Utilities.noString(parentType))
1111      t = parent;
1112    else {
1113      t = parent.predicate("fhir:"+parentType+'.'+name);
1114    }
1115    composeElement(t, "binding", name, element, index);
1116    if (element.hasStrengthElement())
1117      composeEnum(t, "ElementDefinition", "strength", element.getStrengthElement(), -1);
1118    if (element.hasDescriptionElement())
1119      composeString(t, "ElementDefinition", "description", element.getDescriptionElement(), -1);
1120    if (element.hasValueSet())
1121      composeType(t, "ElementDefinition", "valueSet", element.getValueSet(), -1);
1122  }
1123
1124  protected void composeElementDefinitionElementDefinitionMappingComponent(Complex parent, String parentType, String name, ElementDefinition.ElementDefinitionMappingComponent element, int index) {
1125    if (element == null) 
1126      return;
1127    Complex t;
1128    if (Utilities.noString(parentType))
1129      t = parent;
1130    else {
1131      t = parent.predicate("fhir:"+parentType+'.'+name);
1132    }
1133    composeElement(t, "mapping", name, element, index);
1134    if (element.hasIdentityElement())
1135      composeId(t, "ElementDefinition", "identity", element.getIdentityElement(), -1);
1136    if (element.hasLanguageElement())
1137      composeCode(t, "ElementDefinition", "language", element.getLanguageElement(), -1);
1138    if (element.hasMapElement())
1139      composeString(t, "ElementDefinition", "map", element.getMapElement(), -1);
1140    if (element.hasCommentElement())
1141      composeString(t, "ElementDefinition", "comment", element.getCommentElement(), -1);
1142  }
1143
1144  protected void composeParameterDefinition(Complex parent, String parentType, String name, ParameterDefinition element, int index) {
1145    if (element == null) 
1146      return;
1147    Complex t;
1148    if (Utilities.noString(parentType))
1149      t = parent;
1150    else {
1151      t = parent.predicate("fhir:"+parentType+'.'+name);
1152    }
1153    composeElement(t, "ParameterDefinition", name, element, index);
1154    if (element.hasNameElement())
1155      composeCode(t, "ParameterDefinition", "name", element.getNameElement(), -1);
1156    if (element.hasUseElement())
1157      composeEnum(t, "ParameterDefinition", "use", element.getUseElement(), -1);
1158    if (element.hasMinElement())
1159      composeInteger(t, "ParameterDefinition", "min", element.getMinElement(), -1);
1160    if (element.hasMaxElement())
1161      composeString(t, "ParameterDefinition", "max", element.getMaxElement(), -1);
1162    if (element.hasDocumentationElement())
1163      composeString(t, "ParameterDefinition", "documentation", element.getDocumentationElement(), -1);
1164    if (element.hasTypeElement())
1165      composeCode(t, "ParameterDefinition", "type", element.getTypeElement(), -1);
1166    if (element.hasProfile())
1167      composeReference(t, "ParameterDefinition", "profile", element.getProfile(), -1);
1168  }
1169
1170  protected void composeDomainResource(Complex t, String parentType, String name, DomainResource element, int index) {
1171    composeResource(t, parentType, name, element, index);
1172    if (element.hasText())
1173      composeNarrative(t, "DomainResource", "text", element.getText(), -1);
1174    for (int i = 0; i < element.getContained().size(); i++)
1175      composeResource(t, "DomainResource", "contained", element.getContained().get(i), i);
1176    for (int i = 0; i < element.getExtension().size(); i++)
1177      composeExtension(t, "DomainResource", "extension", element.getExtension().get(i), i);
1178    for (int i = 0; i < element.getModifierExtension().size(); i++)
1179      composeExtension(t, "DomainResource", "modifierExtension", element.getModifierExtension().get(i), i);
1180  }
1181
1182  protected void composeParameters(Complex parent, String parentType, String name, Parameters element, int index) {
1183    if (element == null) 
1184      return;
1185    Complex t;
1186    if (Utilities.noString(parentType))
1187      t = parent;
1188    else {
1189      t = parent.predicate("fhir:"+parentType+'.'+name);
1190    }
1191    composeResource(t, "Parameters", name, element, index);
1192    for (int i = 0; i < element.getParameter().size(); i++)
1193      composeParametersParametersParameterComponent(t, "Parameters", "parameter", element.getParameter().get(i), i);
1194  }
1195
1196  protected void composeParametersParametersParameterComponent(Complex parent, String parentType, String name, Parameters.ParametersParameterComponent element, int index) {
1197    if (element == null) 
1198      return;
1199    Complex t;
1200    if (Utilities.noString(parentType))
1201      t = parent;
1202    else {
1203      t = parent.predicate("fhir:"+parentType+'.'+name);
1204    }
1205    composeBackboneElement(t, "parameter", name, element, index);
1206    if (element.hasNameElement())
1207      composeString(t, "Parameters", "name", element.getNameElement(), -1);
1208    if (element.hasValue())
1209      composeType(t, "Parameters", "value", element.getValue(), -1);
1210    if (element.hasResource())
1211      composeResource(t, "Parameters", "resource", element.getResource(), -1);
1212    for (int i = 0; i < element.getPart().size(); i++)
1213      composeParametersParametersParameterComponent(t, "Parameters", "part", element.getPart().get(i), i);
1214  }
1215
1216  protected void composeResource(Complex t, String parentType, String name, Resource element, int index) {
1217    if (element.hasIdElement())
1218      composeId(t, "Resource", "id", element.getIdElement(), -1);
1219    if (element.hasMeta())
1220      composeMeta(t, "Resource", "meta", element.getMeta(), -1);
1221    if (element.hasImplicitRulesElement())
1222      composeUri(t, "Resource", "implicitRules", element.getImplicitRulesElement(), -1);
1223    if (element.hasLanguageElement())
1224      composeCode(t, "Resource", "language", element.getLanguageElement(), -1);
1225  }
1226
1227  protected void composeAccount(Complex parent, String parentType, String name, Account element, int index) {
1228    if (element == null) 
1229      return;
1230    Complex t;
1231    if (Utilities.noString(parentType))
1232      t = parent;
1233    else {
1234      t = parent.predicate("fhir:"+parentType+'.'+name);
1235    }
1236    composeDomainResource(t, "Account", name, element, index);
1237    for (int i = 0; i < element.getIdentifier().size(); i++)
1238      composeIdentifier(t, "Account", "identifier", element.getIdentifier().get(i), i);
1239    if (element.hasStatusElement())
1240      composeEnum(t, "Account", "status", element.getStatusElement(), -1);
1241    if (element.hasType())
1242      composeCodeableConcept(t, "Account", "type", element.getType(), -1);
1243    if (element.hasNameElement())
1244      composeString(t, "Account", "name", element.getNameElement(), -1);
1245    if (element.hasSubject())
1246      composeReference(t, "Account", "subject", element.getSubject(), -1);
1247    if (element.hasPeriod())
1248      composePeriod(t, "Account", "period", element.getPeriod(), -1);
1249    if (element.hasActive())
1250      composePeriod(t, "Account", "active", element.getActive(), -1);
1251    if (element.hasBalance())
1252      composeMoney(t, "Account", "balance", element.getBalance(), -1);
1253    for (int i = 0; i < element.getCoverage().size(); i++)
1254      composeAccountCoverageComponent(t, "Account", "coverage", element.getCoverage().get(i), i);
1255    if (element.hasOwner())
1256      composeReference(t, "Account", "owner", element.getOwner(), -1);
1257    if (element.hasDescriptionElement())
1258      composeString(t, "Account", "description", element.getDescriptionElement(), -1);
1259    for (int i = 0; i < element.getGuarantor().size(); i++)
1260      composeAccountGuarantorComponent(t, "Account", "guarantor", element.getGuarantor().get(i), i);
1261  }
1262
1263  protected void composeAccountCoverageComponent(Complex parent, String parentType, String name, Account.CoverageComponent element, int index) {
1264    if (element == null) 
1265      return;
1266    Complex t;
1267    if (Utilities.noString(parentType))
1268      t = parent;
1269    else {
1270      t = parent.predicate("fhir:"+parentType+'.'+name);
1271    }
1272    composeBackboneElement(t, "coverage", name, element, index);
1273    if (element.hasCoverage())
1274      composeReference(t, "Account", "coverage", element.getCoverage(), -1);
1275    if (element.hasPriorityElement())
1276      composePositiveInt(t, "Account", "priority", element.getPriorityElement(), -1);
1277  }
1278
1279  protected void composeAccountGuarantorComponent(Complex parent, String parentType, String name, Account.GuarantorComponent element, int index) {
1280    if (element == null) 
1281      return;
1282    Complex t;
1283    if (Utilities.noString(parentType))
1284      t = parent;
1285    else {
1286      t = parent.predicate("fhir:"+parentType+'.'+name);
1287    }
1288    composeBackboneElement(t, "guarantor", name, element, index);
1289    if (element.hasParty())
1290      composeReference(t, "Account", "party", element.getParty(), -1);
1291    if (element.hasOnHoldElement())
1292      composeBoolean(t, "Account", "onHold", element.getOnHoldElement(), -1);
1293    if (element.hasPeriod())
1294      composePeriod(t, "Account", "period", element.getPeriod(), -1);
1295  }
1296
1297  protected void composeActivityDefinition(Complex parent, String parentType, String name, ActivityDefinition element, int index) {
1298    if (element == null) 
1299      return;
1300    Complex t;
1301    if (Utilities.noString(parentType))
1302      t = parent;
1303    else {
1304      t = parent.predicate("fhir:"+parentType+'.'+name);
1305    }
1306    composeDomainResource(t, "ActivityDefinition", name, element, index);
1307    if (element.hasUrlElement())
1308      composeUri(t, "ActivityDefinition", "url", element.getUrlElement(), -1);
1309    for (int i = 0; i < element.getIdentifier().size(); i++)
1310      composeIdentifier(t, "ActivityDefinition", "identifier", element.getIdentifier().get(i), i);
1311    if (element.hasVersionElement())
1312      composeString(t, "ActivityDefinition", "version", element.getVersionElement(), -1);
1313    if (element.hasNameElement())
1314      composeString(t, "ActivityDefinition", "name", element.getNameElement(), -1);
1315    if (element.hasTitleElement())
1316      composeString(t, "ActivityDefinition", "title", element.getTitleElement(), -1);
1317    if (element.hasStatusElement())
1318      composeEnum(t, "ActivityDefinition", "status", element.getStatusElement(), -1);
1319    if (element.hasExperimentalElement())
1320      composeBoolean(t, "ActivityDefinition", "experimental", element.getExperimentalElement(), -1);
1321    if (element.hasDateElement())
1322      composeDateTime(t, "ActivityDefinition", "date", element.getDateElement(), -1);
1323    if (element.hasPublisherElement())
1324      composeString(t, "ActivityDefinition", "publisher", element.getPublisherElement(), -1);
1325    if (element.hasDescriptionElement())
1326      composeMarkdown(t, "ActivityDefinition", "description", element.getDescriptionElement(), -1);
1327    if (element.hasPurposeElement())
1328      composeMarkdown(t, "ActivityDefinition", "purpose", element.getPurposeElement(), -1);
1329    if (element.hasUsageElement())
1330      composeString(t, "ActivityDefinition", "usage", element.getUsageElement(), -1);
1331    if (element.hasApprovalDateElement())
1332      composeDate(t, "ActivityDefinition", "approvalDate", element.getApprovalDateElement(), -1);
1333    if (element.hasLastReviewDateElement())
1334      composeDate(t, "ActivityDefinition", "lastReviewDate", element.getLastReviewDateElement(), -1);
1335    if (element.hasEffectivePeriod())
1336      composePeriod(t, "ActivityDefinition", "effectivePeriod", element.getEffectivePeriod(), -1);
1337    for (int i = 0; i < element.getUseContext().size(); i++)
1338      composeUsageContext(t, "ActivityDefinition", "useContext", element.getUseContext().get(i), i);
1339    for (int i = 0; i < element.getJurisdiction().size(); i++)
1340      composeCodeableConcept(t, "ActivityDefinition", "jurisdiction", element.getJurisdiction().get(i), i);
1341    for (int i = 0; i < element.getTopic().size(); i++)
1342      composeCodeableConcept(t, "ActivityDefinition", "topic", element.getTopic().get(i), i);
1343    for (int i = 0; i < element.getContributor().size(); i++)
1344      composeContributor(t, "ActivityDefinition", "contributor", element.getContributor().get(i), i);
1345    for (int i = 0; i < element.getContact().size(); i++)
1346      composeContactDetail(t, "ActivityDefinition", "contact", element.getContact().get(i), i);
1347    if (element.hasCopyrightElement())
1348      composeMarkdown(t, "ActivityDefinition", "copyright", element.getCopyrightElement(), -1);
1349    for (int i = 0; i < element.getRelatedArtifact().size(); i++)
1350      composeRelatedArtifact(t, "ActivityDefinition", "relatedArtifact", element.getRelatedArtifact().get(i), i);
1351    for (int i = 0; i < element.getLibrary().size(); i++)
1352      composeReference(t, "ActivityDefinition", "library", element.getLibrary().get(i), i);
1353    if (element.hasKindElement())
1354      composeEnum(t, "ActivityDefinition", "kind", element.getKindElement(), -1);
1355    if (element.hasCode())
1356      composeCodeableConcept(t, "ActivityDefinition", "code", element.getCode(), -1);
1357    if (element.hasTiming())
1358      composeType(t, "ActivityDefinition", "timing", element.getTiming(), -1);
1359    if (element.hasLocation())
1360      composeReference(t, "ActivityDefinition", "location", element.getLocation(), -1);
1361    for (int i = 0; i < element.getParticipant().size(); i++)
1362      composeActivityDefinitionActivityDefinitionParticipantComponent(t, "ActivityDefinition", "participant", element.getParticipant().get(i), i);
1363    if (element.hasProduct())
1364      composeType(t, "ActivityDefinition", "product", element.getProduct(), -1);
1365    if (element.hasQuantity())
1366      composeQuantity(t, "ActivityDefinition", "quantity", element.getQuantity(), -1);
1367    for (int i = 0; i < element.getDosage().size(); i++)
1368      composeDosage(t, "ActivityDefinition", "dosage", element.getDosage().get(i), i);
1369    for (int i = 0; i < element.getBodySite().size(); i++)
1370      composeCodeableConcept(t, "ActivityDefinition", "bodySite", element.getBodySite().get(i), i);
1371    if (element.hasTransform())
1372      composeReference(t, "ActivityDefinition", "transform", element.getTransform(), -1);
1373    for (int i = 0; i < element.getDynamicValue().size(); i++)
1374      composeActivityDefinitionActivityDefinitionDynamicValueComponent(t, "ActivityDefinition", "dynamicValue", element.getDynamicValue().get(i), i);
1375  }
1376
1377  protected void composeActivityDefinitionActivityDefinitionParticipantComponent(Complex parent, String parentType, String name, ActivityDefinition.ActivityDefinitionParticipantComponent element, int index) {
1378    if (element == null) 
1379      return;
1380    Complex t;
1381    if (Utilities.noString(parentType))
1382      t = parent;
1383    else {
1384      t = parent.predicate("fhir:"+parentType+'.'+name);
1385    }
1386    composeBackboneElement(t, "participant", name, element, index);
1387    if (element.hasTypeElement())
1388      composeEnum(t, "ActivityDefinition", "type", element.getTypeElement(), -1);
1389    if (element.hasRole())
1390      composeCodeableConcept(t, "ActivityDefinition", "role", element.getRole(), -1);
1391  }
1392
1393  protected void composeActivityDefinitionActivityDefinitionDynamicValueComponent(Complex parent, String parentType, String name, ActivityDefinition.ActivityDefinitionDynamicValueComponent element, int index) {
1394    if (element == null) 
1395      return;
1396    Complex t;
1397    if (Utilities.noString(parentType))
1398      t = parent;
1399    else {
1400      t = parent.predicate("fhir:"+parentType+'.'+name);
1401    }
1402    composeBackboneElement(t, "dynamicValue", name, element, index);
1403    if (element.hasDescriptionElement())
1404      composeString(t, "ActivityDefinition", "description", element.getDescriptionElement(), -1);
1405    if (element.hasPathElement())
1406      composeString(t, "ActivityDefinition", "path", element.getPathElement(), -1);
1407    if (element.hasLanguageElement())
1408      composeString(t, "ActivityDefinition", "language", element.getLanguageElement(), -1);
1409    if (element.hasExpressionElement())
1410      composeString(t, "ActivityDefinition", "expression", element.getExpressionElement(), -1);
1411  }
1412
1413  protected void composeAdverseEvent(Complex parent, String parentType, String name, AdverseEvent element, int index) {
1414    if (element == null) 
1415      return;
1416    Complex t;
1417    if (Utilities.noString(parentType))
1418      t = parent;
1419    else {
1420      t = parent.predicate("fhir:"+parentType+'.'+name);
1421    }
1422    composeDomainResource(t, "AdverseEvent", name, element, index);
1423    if (element.hasIdentifier())
1424      composeIdentifier(t, "AdverseEvent", "identifier", element.getIdentifier(), -1);
1425    if (element.hasCategoryElement())
1426      composeEnum(t, "AdverseEvent", "category", element.getCategoryElement(), -1);
1427    if (element.hasType())
1428      composeCodeableConcept(t, "AdverseEvent", "type", element.getType(), -1);
1429    if (element.hasSubject())
1430      composeReference(t, "AdverseEvent", "subject", element.getSubject(), -1);
1431    if (element.hasDateElement())
1432      composeDateTime(t, "AdverseEvent", "date", element.getDateElement(), -1);
1433    for (int i = 0; i < element.getReaction().size(); i++)
1434      composeReference(t, "AdverseEvent", "reaction", element.getReaction().get(i), i);
1435    if (element.hasLocation())
1436      composeReference(t, "AdverseEvent", "location", element.getLocation(), -1);
1437    if (element.hasSeriousness())
1438      composeCodeableConcept(t, "AdverseEvent", "seriousness", element.getSeriousness(), -1);
1439    if (element.hasOutcome())
1440      composeCodeableConcept(t, "AdverseEvent", "outcome", element.getOutcome(), -1);
1441    if (element.hasRecorder())
1442      composeReference(t, "AdverseEvent", "recorder", element.getRecorder(), -1);
1443    if (element.hasEventParticipant())
1444      composeReference(t, "AdverseEvent", "eventParticipant", element.getEventParticipant(), -1);
1445    if (element.hasDescriptionElement())
1446      composeString(t, "AdverseEvent", "description", element.getDescriptionElement(), -1);
1447    for (int i = 0; i < element.getSuspectEntity().size(); i++)
1448      composeAdverseEventAdverseEventSuspectEntityComponent(t, "AdverseEvent", "suspectEntity", element.getSuspectEntity().get(i), i);
1449    for (int i = 0; i < element.getSubjectMedicalHistory().size(); i++)
1450      composeReference(t, "AdverseEvent", "subjectMedicalHistory", element.getSubjectMedicalHistory().get(i), i);
1451    for (int i = 0; i < element.getReferenceDocument().size(); i++)
1452      composeReference(t, "AdverseEvent", "referenceDocument", element.getReferenceDocument().get(i), i);
1453    for (int i = 0; i < element.getStudy().size(); i++)
1454      composeReference(t, "AdverseEvent", "study", element.getStudy().get(i), i);
1455  }
1456
1457  protected void composeAdverseEventAdverseEventSuspectEntityComponent(Complex parent, String parentType, String name, AdverseEvent.AdverseEventSuspectEntityComponent element, int index) {
1458    if (element == null) 
1459      return;
1460    Complex t;
1461    if (Utilities.noString(parentType))
1462      t = parent;
1463    else {
1464      t = parent.predicate("fhir:"+parentType+'.'+name);
1465    }
1466    composeBackboneElement(t, "suspectEntity", name, element, index);
1467    if (element.hasInstance())
1468      composeReference(t, "AdverseEvent", "instance", element.getInstance(), -1);
1469    if (element.hasCausalityElement())
1470      composeEnum(t, "AdverseEvent", "causality", element.getCausalityElement(), -1);
1471    if (element.hasCausalityAssessment())
1472      composeCodeableConcept(t, "AdverseEvent", "causalityAssessment", element.getCausalityAssessment(), -1);
1473    if (element.hasCausalityProductRelatednessElement())
1474      composeString(t, "AdverseEvent", "causalityProductRelatedness", element.getCausalityProductRelatednessElement(), -1);
1475    if (element.hasCausalityMethod())
1476      composeCodeableConcept(t, "AdverseEvent", "causalityMethod", element.getCausalityMethod(), -1);
1477    if (element.hasCausalityAuthor())
1478      composeReference(t, "AdverseEvent", "causalityAuthor", element.getCausalityAuthor(), -1);
1479    if (element.hasCausalityResult())
1480      composeCodeableConcept(t, "AdverseEvent", "causalityResult", element.getCausalityResult(), -1);
1481  }
1482
1483  protected void composeAllergyIntolerance(Complex parent, String parentType, String name, AllergyIntolerance element, int index) {
1484    if (element == null) 
1485      return;
1486    Complex t;
1487    if (Utilities.noString(parentType))
1488      t = parent;
1489    else {
1490      t = parent.predicate("fhir:"+parentType+'.'+name);
1491    }
1492    composeDomainResource(t, "AllergyIntolerance", name, element, index);
1493    for (int i = 0; i < element.getIdentifier().size(); i++)
1494      composeIdentifier(t, "AllergyIntolerance", "identifier", element.getIdentifier().get(i), i);
1495    if (element.hasClinicalStatusElement())
1496      composeEnum(t, "AllergyIntolerance", "clinicalStatus", element.getClinicalStatusElement(), -1);
1497    if (element.hasVerificationStatusElement())
1498      composeEnum(t, "AllergyIntolerance", "verificationStatus", element.getVerificationStatusElement(), -1);
1499    if (element.hasTypeElement())
1500      composeEnum(t, "AllergyIntolerance", "type", element.getTypeElement(), -1);
1501    for (int i = 0; i < element.getCategory().size(); i++)
1502      composeEnum(t, "AllergyIntolerance", "category", element.getCategory().get(i), i);
1503    if (element.hasCriticalityElement())
1504      composeEnum(t, "AllergyIntolerance", "criticality", element.getCriticalityElement(), -1);
1505    if (element.hasCode())
1506      composeCodeableConcept(t, "AllergyIntolerance", "code", element.getCode(), -1);
1507    if (element.hasPatient())
1508      composeReference(t, "AllergyIntolerance", "patient", element.getPatient(), -1);
1509    if (element.hasOnset())
1510      composeType(t, "AllergyIntolerance", "onset", element.getOnset(), -1);
1511    if (element.hasAssertedDateElement())
1512      composeDateTime(t, "AllergyIntolerance", "assertedDate", element.getAssertedDateElement(), -1);
1513    if (element.hasRecorder())
1514      composeReference(t, "AllergyIntolerance", "recorder", element.getRecorder(), -1);
1515    if (element.hasAsserter())
1516      composeReference(t, "AllergyIntolerance", "asserter", element.getAsserter(), -1);
1517    if (element.hasLastOccurrenceElement())
1518      composeDateTime(t, "AllergyIntolerance", "lastOccurrence", element.getLastOccurrenceElement(), -1);
1519    for (int i = 0; i < element.getNote().size(); i++)
1520      composeAnnotation(t, "AllergyIntolerance", "note", element.getNote().get(i), i);
1521    for (int i = 0; i < element.getReaction().size(); i++)
1522      composeAllergyIntoleranceAllergyIntoleranceReactionComponent(t, "AllergyIntolerance", "reaction", element.getReaction().get(i), i);
1523  }
1524
1525  protected void composeAllergyIntoleranceAllergyIntoleranceReactionComponent(Complex parent, String parentType, String name, AllergyIntolerance.AllergyIntoleranceReactionComponent element, int index) {
1526    if (element == null) 
1527      return;
1528    Complex t;
1529    if (Utilities.noString(parentType))
1530      t = parent;
1531    else {
1532      t = parent.predicate("fhir:"+parentType+'.'+name);
1533    }
1534    composeBackboneElement(t, "reaction", name, element, index);
1535    if (element.hasSubstance())
1536      composeCodeableConcept(t, "AllergyIntolerance", "substance", element.getSubstance(), -1);
1537    for (int i = 0; i < element.getManifestation().size(); i++)
1538      composeCodeableConcept(t, "AllergyIntolerance", "manifestation", element.getManifestation().get(i), i);
1539    if (element.hasDescriptionElement())
1540      composeString(t, "AllergyIntolerance", "description", element.getDescriptionElement(), -1);
1541    if (element.hasOnsetElement())
1542      composeDateTime(t, "AllergyIntolerance", "onset", element.getOnsetElement(), -1);
1543    if (element.hasSeverityElement())
1544      composeEnum(t, "AllergyIntolerance", "severity", element.getSeverityElement(), -1);
1545    if (element.hasExposureRoute())
1546      composeCodeableConcept(t, "AllergyIntolerance", "exposureRoute", element.getExposureRoute(), -1);
1547    for (int i = 0; i < element.getNote().size(); i++)
1548      composeAnnotation(t, "AllergyIntolerance", "note", element.getNote().get(i), i);
1549  }
1550
1551  protected void composeAppointment(Complex parent, String parentType, String name, Appointment element, int index) {
1552    if (element == null) 
1553      return;
1554    Complex t;
1555    if (Utilities.noString(parentType))
1556      t = parent;
1557    else {
1558      t = parent.predicate("fhir:"+parentType+'.'+name);
1559    }
1560    composeDomainResource(t, "Appointment", name, element, index);
1561    for (int i = 0; i < element.getIdentifier().size(); i++)
1562      composeIdentifier(t, "Appointment", "identifier", element.getIdentifier().get(i), i);
1563    if (element.hasStatusElement())
1564      composeEnum(t, "Appointment", "status", element.getStatusElement(), -1);
1565    if (element.hasServiceCategory())
1566      composeCodeableConcept(t, "Appointment", "serviceCategory", element.getServiceCategory(), -1);
1567    for (int i = 0; i < element.getServiceType().size(); i++)
1568      composeCodeableConcept(t, "Appointment", "serviceType", element.getServiceType().get(i), i);
1569    for (int i = 0; i < element.getSpecialty().size(); i++)
1570      composeCodeableConcept(t, "Appointment", "specialty", element.getSpecialty().get(i), i);
1571    if (element.hasAppointmentType())
1572      composeCodeableConcept(t, "Appointment", "appointmentType", element.getAppointmentType(), -1);
1573    for (int i = 0; i < element.getReason().size(); i++)
1574      composeCodeableConcept(t, "Appointment", "reason", element.getReason().get(i), i);
1575    for (int i = 0; i < element.getIndication().size(); i++)
1576      composeReference(t, "Appointment", "indication", element.getIndication().get(i), i);
1577    if (element.hasPriorityElement())
1578      composeUnsignedInt(t, "Appointment", "priority", element.getPriorityElement(), -1);
1579    if (element.hasDescriptionElement())
1580      composeString(t, "Appointment", "description", element.getDescriptionElement(), -1);
1581    for (int i = 0; i < element.getSupportingInformation().size(); i++)
1582      composeReference(t, "Appointment", "supportingInformation", element.getSupportingInformation().get(i), i);
1583    if (element.hasStartElement())
1584      composeInstant(t, "Appointment", "start", element.getStartElement(), -1);
1585    if (element.hasEndElement())
1586      composeInstant(t, "Appointment", "end", element.getEndElement(), -1);
1587    if (element.hasMinutesDurationElement())
1588      composePositiveInt(t, "Appointment", "minutesDuration", element.getMinutesDurationElement(), -1);
1589    for (int i = 0; i < element.getSlot().size(); i++)
1590      composeReference(t, "Appointment", "slot", element.getSlot().get(i), i);
1591    if (element.hasCreatedElement())
1592      composeDateTime(t, "Appointment", "created", element.getCreatedElement(), -1);
1593    if (element.hasCommentElement())
1594      composeString(t, "Appointment", "comment", element.getCommentElement(), -1);
1595    for (int i = 0; i < element.getIncomingReferral().size(); i++)
1596      composeReference(t, "Appointment", "incomingReferral", element.getIncomingReferral().get(i), i);
1597    for (int i = 0; i < element.getParticipant().size(); i++)
1598      composeAppointmentAppointmentParticipantComponent(t, "Appointment", "participant", element.getParticipant().get(i), i);
1599    for (int i = 0; i < element.getRequestedPeriod().size(); i++)
1600      composePeriod(t, "Appointment", "requestedPeriod", element.getRequestedPeriod().get(i), i);
1601  }
1602
1603  protected void composeAppointmentAppointmentParticipantComponent(Complex parent, String parentType, String name, Appointment.AppointmentParticipantComponent element, int index) {
1604    if (element == null) 
1605      return;
1606    Complex t;
1607    if (Utilities.noString(parentType))
1608      t = parent;
1609    else {
1610      t = parent.predicate("fhir:"+parentType+'.'+name);
1611    }
1612    composeBackboneElement(t, "participant", name, element, index);
1613    for (int i = 0; i < element.getType().size(); i++)
1614      composeCodeableConcept(t, "Appointment", "type", element.getType().get(i), i);
1615    if (element.hasActor())
1616      composeReference(t, "Appointment", "actor", element.getActor(), -1);
1617    if (element.hasRequiredElement())
1618      composeEnum(t, "Appointment", "required", element.getRequiredElement(), -1);
1619    if (element.hasStatusElement())
1620      composeEnum(t, "Appointment", "status", element.getStatusElement(), -1);
1621  }
1622
1623  protected void composeAppointmentResponse(Complex parent, String parentType, String name, AppointmentResponse element, int index) {
1624    if (element == null) 
1625      return;
1626    Complex t;
1627    if (Utilities.noString(parentType))
1628      t = parent;
1629    else {
1630      t = parent.predicate("fhir:"+parentType+'.'+name);
1631    }
1632    composeDomainResource(t, "AppointmentResponse", name, element, index);
1633    for (int i = 0; i < element.getIdentifier().size(); i++)
1634      composeIdentifier(t, "AppointmentResponse", "identifier", element.getIdentifier().get(i), i);
1635    if (element.hasAppointment())
1636      composeReference(t, "AppointmentResponse", "appointment", element.getAppointment(), -1);
1637    if (element.hasStartElement())
1638      composeInstant(t, "AppointmentResponse", "start", element.getStartElement(), -1);
1639    if (element.hasEndElement())
1640      composeInstant(t, "AppointmentResponse", "end", element.getEndElement(), -1);
1641    for (int i = 0; i < element.getParticipantType().size(); i++)
1642      composeCodeableConcept(t, "AppointmentResponse", "participantType", element.getParticipantType().get(i), i);
1643    if (element.hasActor())
1644      composeReference(t, "AppointmentResponse", "actor", element.getActor(), -1);
1645    if (element.hasParticipantStatusElement())
1646      composeEnum(t, "AppointmentResponse", "participantStatus", element.getParticipantStatusElement(), -1);
1647    if (element.hasCommentElement())
1648      composeString(t, "AppointmentResponse", "comment", element.getCommentElement(), -1);
1649  }
1650
1651  protected void composeAuditEvent(Complex parent, String parentType, String name, AuditEvent element, int index) {
1652    if (element == null) 
1653      return;
1654    Complex t;
1655    if (Utilities.noString(parentType))
1656      t = parent;
1657    else {
1658      t = parent.predicate("fhir:"+parentType+'.'+name);
1659    }
1660    composeDomainResource(t, "AuditEvent", name, element, index);
1661    if (element.hasType())
1662      composeCoding(t, "AuditEvent", "type", element.getType(), -1);
1663    for (int i = 0; i < element.getSubtype().size(); i++)
1664      composeCoding(t, "AuditEvent", "subtype", element.getSubtype().get(i), i);
1665    if (element.hasActionElement())
1666      composeEnum(t, "AuditEvent", "action", element.getActionElement(), -1);
1667    if (element.hasRecordedElement())
1668      composeInstant(t, "AuditEvent", "recorded", element.getRecordedElement(), -1);
1669    if (element.hasOutcomeElement())
1670      composeEnum(t, "AuditEvent", "outcome", element.getOutcomeElement(), -1);
1671    if (element.hasOutcomeDescElement())
1672      composeString(t, "AuditEvent", "outcomeDesc", element.getOutcomeDescElement(), -1);
1673    for (int i = 0; i < element.getPurposeOfEvent().size(); i++)
1674      composeCodeableConcept(t, "AuditEvent", "purposeOfEvent", element.getPurposeOfEvent().get(i), i);
1675    for (int i = 0; i < element.getAgent().size(); i++)
1676      composeAuditEventAuditEventAgentComponent(t, "AuditEvent", "agent", element.getAgent().get(i), i);
1677    if (element.hasSource())
1678      composeAuditEventAuditEventSourceComponent(t, "AuditEvent", "source", element.getSource(), -1);
1679    for (int i = 0; i < element.getEntity().size(); i++)
1680      composeAuditEventAuditEventEntityComponent(t, "AuditEvent", "entity", element.getEntity().get(i), i);
1681  }
1682
1683  protected void composeAuditEventAuditEventAgentComponent(Complex parent, String parentType, String name, AuditEvent.AuditEventAgentComponent 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    composeBackboneElement(t, "agent", name, element, index);
1693    for (int i = 0; i < element.getRole().size(); i++)
1694      composeCodeableConcept(t, "AuditEvent", "role", element.getRole().get(i), i);
1695    if (element.hasReference())
1696      composeReference(t, "AuditEvent", "reference", element.getReference(), -1);
1697    if (element.hasUserId())
1698      composeIdentifier(t, "AuditEvent", "userId", element.getUserId(), -1);
1699    if (element.hasAltIdElement())
1700      composeString(t, "AuditEvent", "altId", element.getAltIdElement(), -1);
1701    if (element.hasNameElement())
1702      composeString(t, "AuditEvent", "name", element.getNameElement(), -1);
1703    if (element.hasRequestorElement())
1704      composeBoolean(t, "AuditEvent", "requestor", element.getRequestorElement(), -1);
1705    if (element.hasLocation())
1706      composeReference(t, "AuditEvent", "location", element.getLocation(), -1);
1707    for (int i = 0; i < element.getPolicy().size(); i++)
1708      composeUri(t, "AuditEvent", "policy", element.getPolicy().get(i), i);
1709    if (element.hasMedia())
1710      composeCoding(t, "AuditEvent", "media", element.getMedia(), -1);
1711    if (element.hasNetwork())
1712      composeAuditEventAuditEventAgentNetworkComponent(t, "AuditEvent", "network", element.getNetwork(), -1);
1713    for (int i = 0; i < element.getPurposeOfUse().size(); i++)
1714      composeCodeableConcept(t, "AuditEvent", "purposeOfUse", element.getPurposeOfUse().get(i), i);
1715  }
1716
1717  protected void composeAuditEventAuditEventAgentNetworkComponent(Complex parent, String parentType, String name, AuditEvent.AuditEventAgentNetworkComponent element, int index) {
1718    if (element == null) 
1719      return;
1720    Complex t;
1721    if (Utilities.noString(parentType))
1722      t = parent;
1723    else {
1724      t = parent.predicate("fhir:"+parentType+'.'+name);
1725    }
1726    composeBackboneElement(t, "network", name, element, index);
1727    if (element.hasAddressElement())
1728      composeString(t, "AuditEvent", "address", element.getAddressElement(), -1);
1729    if (element.hasTypeElement())
1730      composeEnum(t, "AuditEvent", "type", element.getTypeElement(), -1);
1731  }
1732
1733  protected void composeAuditEventAuditEventSourceComponent(Complex parent, String parentType, String name, AuditEvent.AuditEventSourceComponent element, int index) {
1734    if (element == null) 
1735      return;
1736    Complex t;
1737    if (Utilities.noString(parentType))
1738      t = parent;
1739    else {
1740      t = parent.predicate("fhir:"+parentType+'.'+name);
1741    }
1742    composeBackboneElement(t, "source", name, element, index);
1743    if (element.hasSiteElement())
1744      composeString(t, "AuditEvent", "site", element.getSiteElement(), -1);
1745    if (element.hasIdentifier())
1746      composeIdentifier(t, "AuditEvent", "identifier", element.getIdentifier(), -1);
1747    for (int i = 0; i < element.getType().size(); i++)
1748      composeCoding(t, "AuditEvent", "type", element.getType().get(i), i);
1749  }
1750
1751  protected void composeAuditEventAuditEventEntityComponent(Complex parent, String parentType, String name, AuditEvent.AuditEventEntityComponent element, int index) {
1752    if (element == null) 
1753      return;
1754    Complex t;
1755    if (Utilities.noString(parentType))
1756      t = parent;
1757    else {
1758      t = parent.predicate("fhir:"+parentType+'.'+name);
1759    }
1760    composeBackboneElement(t, "entity", name, element, index);
1761    if (element.hasIdentifier())
1762      composeIdentifier(t, "AuditEvent", "identifier", element.getIdentifier(), -1);
1763    if (element.hasReference())
1764      composeReference(t, "AuditEvent", "reference", element.getReference(), -1);
1765    if (element.hasType())
1766      composeCoding(t, "AuditEvent", "type", element.getType(), -1);
1767    if (element.hasRole())
1768      composeCoding(t, "AuditEvent", "role", element.getRole(), -1);
1769    if (element.hasLifecycle())
1770      composeCoding(t, "AuditEvent", "lifecycle", element.getLifecycle(), -1);
1771    for (int i = 0; i < element.getSecurityLabel().size(); i++)
1772      composeCoding(t, "AuditEvent", "securityLabel", element.getSecurityLabel().get(i), i);
1773    if (element.hasNameElement())
1774      composeString(t, "AuditEvent", "name", element.getNameElement(), -1);
1775    if (element.hasDescriptionElement())
1776      composeString(t, "AuditEvent", "description", element.getDescriptionElement(), -1);
1777    if (element.hasQueryElement())
1778      composeBase64Binary(t, "AuditEvent", "query", element.getQueryElement(), -1);
1779    for (int i = 0; i < element.getDetail().size(); i++)
1780      composeAuditEventAuditEventEntityDetailComponent(t, "AuditEvent", "detail", element.getDetail().get(i), i);
1781  }
1782
1783  protected void composeAuditEventAuditEventEntityDetailComponent(Complex parent, String parentType, String name, AuditEvent.AuditEventEntityDetailComponent element, int index) {
1784    if (element == null) 
1785      return;
1786    Complex t;
1787    if (Utilities.noString(parentType))
1788      t = parent;
1789    else {
1790      t = parent.predicate("fhir:"+parentType+'.'+name);
1791    }
1792    composeBackboneElement(t, "detail", name, element, index);
1793    if (element.hasTypeElement())
1794      composeString(t, "AuditEvent", "type", element.getTypeElement(), -1);
1795    if (element.hasValueElement())
1796      composeBase64Binary(t, "AuditEvent", "value", element.getValueElement(), -1);
1797  }
1798
1799  protected void composeBasic(Complex parent, String parentType, String name, Basic element, int index) {
1800    if (element == null) 
1801      return;
1802    Complex t;
1803    if (Utilities.noString(parentType))
1804      t = parent;
1805    else {
1806      t = parent.predicate("fhir:"+parentType+'.'+name);
1807    }
1808    composeDomainResource(t, "Basic", name, element, index);
1809    for (int i = 0; i < element.getIdentifier().size(); i++)
1810      composeIdentifier(t, "Basic", "identifier", element.getIdentifier().get(i), i);
1811    if (element.hasCode())
1812      composeCodeableConcept(t, "Basic", "code", element.getCode(), -1);
1813    if (element.hasSubject())
1814      composeReference(t, "Basic", "subject", element.getSubject(), -1);
1815    if (element.hasCreatedElement())
1816      composeDate(t, "Basic", "created", element.getCreatedElement(), -1);
1817    if (element.hasAuthor())
1818      composeReference(t, "Basic", "author", element.getAuthor(), -1);
1819  }
1820
1821  protected void composeBinary(Complex parent, String parentType, String name, Binary element, int index) {
1822    if (element == null) 
1823      return;
1824    Complex t;
1825    if (Utilities.noString(parentType))
1826      t = parent;
1827    else {
1828      t = parent.predicate("fhir:"+parentType+'.'+name);
1829    }
1830    composeResource(t, "Binary", name, element, index);
1831    if (element.hasContentTypeElement())
1832      composeCode(t, "Binary", "contentType", element.getContentTypeElement(), -1);
1833    if (element.hasSecurityContext())
1834      composeReference(t, "Binary", "securityContext", element.getSecurityContext(), -1);
1835    if (element.hasContentElement())
1836      composeBase64Binary(t, "Binary", "content", element.getContentElement(), -1);
1837  }
1838
1839  protected void composeBodySite(Complex parent, String parentType, String name, BodySite element, int index) {
1840    if (element == null) 
1841      return;
1842    Complex t;
1843    if (Utilities.noString(parentType))
1844      t = parent;
1845    else {
1846      t = parent.predicate("fhir:"+parentType+'.'+name);
1847    }
1848    composeDomainResource(t, "BodySite", name, element, index);
1849    for (int i = 0; i < element.getIdentifier().size(); i++)
1850      composeIdentifier(t, "BodySite", "identifier", element.getIdentifier().get(i), i);
1851    if (element.hasActiveElement())
1852      composeBoolean(t, "BodySite", "active", element.getActiveElement(), -1);
1853    if (element.hasCode())
1854      composeCodeableConcept(t, "BodySite", "code", element.getCode(), -1);
1855    for (int i = 0; i < element.getQualifier().size(); i++)
1856      composeCodeableConcept(t, "BodySite", "qualifier", element.getQualifier().get(i), i);
1857    if (element.hasDescriptionElement())
1858      composeString(t, "BodySite", "description", element.getDescriptionElement(), -1);
1859    for (int i = 0; i < element.getImage().size(); i++)
1860      composeAttachment(t, "BodySite", "image", element.getImage().get(i), i);
1861    if (element.hasPatient())
1862      composeReference(t, "BodySite", "patient", element.getPatient(), -1);
1863  }
1864
1865  protected void composeBundle(Complex parent, String parentType, String name, Bundle element, int index) {
1866    if (element == null) 
1867      return;
1868    Complex t;
1869    if (Utilities.noString(parentType))
1870      t = parent;
1871    else {
1872      t = parent.predicate("fhir:"+parentType+'.'+name);
1873    }
1874    composeResource(t, "Bundle", name, element, index);
1875    if (element.hasIdentifier())
1876      composeIdentifier(t, "Bundle", "identifier", element.getIdentifier(), -1);
1877    if (element.hasTypeElement())
1878      composeEnum(t, "Bundle", "type", element.getTypeElement(), -1);
1879    if (element.hasTotalElement())
1880      composeUnsignedInt(t, "Bundle", "total", element.getTotalElement(), -1);
1881    for (int i = 0; i < element.getLink().size(); i++)
1882      composeBundleBundleLinkComponent(t, "Bundle", "link", element.getLink().get(i), i);
1883    for (int i = 0; i < element.getEntry().size(); i++)
1884      composeBundleBundleEntryComponent(t, "Bundle", "entry", element.getEntry().get(i), i);
1885    if (element.hasSignature())
1886      composeSignature(t, "Bundle", "signature", element.getSignature(), -1);
1887  }
1888
1889  protected void composeBundleBundleLinkComponent(Complex parent, String parentType, String name, Bundle.BundleLinkComponent element, int index) {
1890    if (element == null) 
1891      return;
1892    Complex t;
1893    if (Utilities.noString(parentType))
1894      t = parent;
1895    else {
1896      t = parent.predicate("fhir:"+parentType+'.'+name);
1897    }
1898    composeBackboneElement(t, "link", name, element, index);
1899    if (element.hasRelationElement())
1900      composeString(t, "Bundle", "relation", element.getRelationElement(), -1);
1901    if (element.hasUrlElement())
1902      composeUri(t, "Bundle", "url", element.getUrlElement(), -1);
1903  }
1904
1905  protected void composeBundleBundleEntryComponent(Complex parent, String parentType, String name, Bundle.BundleEntryComponent element, int index) {
1906    if (element == null) 
1907      return;
1908    Complex t;
1909    if (Utilities.noString(parentType))
1910      t = parent;
1911    else {
1912      t = parent.predicate("fhir:"+parentType+'.'+name);
1913    }
1914    composeBackboneElement(t, "entry", name, element, index);
1915    for (int i = 0; i < element.getLink().size(); i++)
1916      composeBundleBundleLinkComponent(t, "Bundle", "link", element.getLink().get(i), i);
1917    if (element.hasFullUrlElement())
1918      composeUri(t, "Bundle", "fullUrl", element.getFullUrlElement(), -1);
1919    if (element.hasResource())
1920      composeResource(t, "Bundle", "resource", element.getResource(), -1);
1921    if (element.hasSearch())
1922      composeBundleBundleEntrySearchComponent(t, "Bundle", "search", element.getSearch(), -1);
1923    if (element.hasRequest())
1924      composeBundleBundleEntryRequestComponent(t, "Bundle", "request", element.getRequest(), -1);
1925    if (element.hasResponse())
1926      composeBundleBundleEntryResponseComponent(t, "Bundle", "response", element.getResponse(), -1);
1927  }
1928
1929  protected void composeBundleBundleEntrySearchComponent(Complex parent, String parentType, String name, Bundle.BundleEntrySearchComponent element, int index) {
1930    if (element == null) 
1931      return;
1932    Complex t;
1933    if (Utilities.noString(parentType))
1934      t = parent;
1935    else {
1936      t = parent.predicate("fhir:"+parentType+'.'+name);
1937    }
1938    composeBackboneElement(t, "search", name, element, index);
1939    if (element.hasModeElement())
1940      composeEnum(t, "Bundle", "mode", element.getModeElement(), -1);
1941    if (element.hasScoreElement())
1942      composeDecimal(t, "Bundle", "score", element.getScoreElement(), -1);
1943  }
1944
1945  protected void composeBundleBundleEntryRequestComponent(Complex parent, String parentType, String name, Bundle.BundleEntryRequestComponent element, int index) {
1946    if (element == null) 
1947      return;
1948    Complex t;
1949    if (Utilities.noString(parentType))
1950      t = parent;
1951    else {
1952      t = parent.predicate("fhir:"+parentType+'.'+name);
1953    }
1954    composeBackboneElement(t, "request", name, element, index);
1955    if (element.hasMethodElement())
1956      composeEnum(t, "Bundle", "method", element.getMethodElement(), -1);
1957    if (element.hasUrlElement())
1958      composeUri(t, "Bundle", "url", element.getUrlElement(), -1);
1959    if (element.hasIfNoneMatchElement())
1960      composeString(t, "Bundle", "ifNoneMatch", element.getIfNoneMatchElement(), -1);
1961    if (element.hasIfModifiedSinceElement())
1962      composeInstant(t, "Bundle", "ifModifiedSince", element.getIfModifiedSinceElement(), -1);
1963    if (element.hasIfMatchElement())
1964      composeString(t, "Bundle", "ifMatch", element.getIfMatchElement(), -1);
1965    if (element.hasIfNoneExistElement())
1966      composeString(t, "Bundle", "ifNoneExist", element.getIfNoneExistElement(), -1);
1967  }
1968
1969  protected void composeBundleBundleEntryResponseComponent(Complex parent, String parentType, String name, Bundle.BundleEntryResponseComponent element, int index) {
1970    if (element == null) 
1971      return;
1972    Complex t;
1973    if (Utilities.noString(parentType))
1974      t = parent;
1975    else {
1976      t = parent.predicate("fhir:"+parentType+'.'+name);
1977    }
1978    composeBackboneElement(t, "response", name, element, index);
1979    if (element.hasStatusElement())
1980      composeString(t, "Bundle", "status", element.getStatusElement(), -1);
1981    if (element.hasLocationElement())
1982      composeUri(t, "Bundle", "location", element.getLocationElement(), -1);
1983    if (element.hasEtagElement())
1984      composeString(t, "Bundle", "etag", element.getEtagElement(), -1);
1985    if (element.hasLastModifiedElement())
1986      composeInstant(t, "Bundle", "lastModified", element.getLastModifiedElement(), -1);
1987    if (element.hasOutcome())
1988      composeResource(t, "Bundle", "outcome", element.getOutcome(), -1);
1989  }
1990
1991  protected void composeCapabilityStatement(Complex parent, String parentType, String name, CapabilityStatement element, int index) {
1992    if (element == null) 
1993      return;
1994    Complex t;
1995    if (Utilities.noString(parentType))
1996      t = parent;
1997    else {
1998      t = parent.predicate("fhir:"+parentType+'.'+name);
1999    }
2000    composeDomainResource(t, "CapabilityStatement", name, element, index);
2001    if (element.hasUrlElement())
2002      composeUri(t, "CapabilityStatement", "url", element.getUrlElement(), -1);
2003    if (element.hasVersionElement())
2004      composeString(t, "CapabilityStatement", "version", element.getVersionElement(), -1);
2005    if (element.hasNameElement())
2006      composeString(t, "CapabilityStatement", "name", element.getNameElement(), -1);
2007    if (element.hasTitleElement())
2008      composeString(t, "CapabilityStatement", "title", element.getTitleElement(), -1);
2009    if (element.hasStatusElement())
2010      composeEnum(t, "CapabilityStatement", "status", element.getStatusElement(), -1);
2011    if (element.hasExperimentalElement())
2012      composeBoolean(t, "CapabilityStatement", "experimental", element.getExperimentalElement(), -1);
2013    if (element.hasDateElement())
2014      composeDateTime(t, "CapabilityStatement", "date", element.getDateElement(), -1);
2015    if (element.hasPublisherElement())
2016      composeString(t, "CapabilityStatement", "publisher", element.getPublisherElement(), -1);
2017    for (int i = 0; i < element.getContact().size(); i++)
2018      composeContactDetail(t, "CapabilityStatement", "contact", element.getContact().get(i), i);
2019    if (element.hasDescriptionElement())
2020      composeMarkdown(t, "CapabilityStatement", "description", element.getDescriptionElement(), -1);
2021    for (int i = 0; i < element.getUseContext().size(); i++)
2022      composeUsageContext(t, "CapabilityStatement", "useContext", element.getUseContext().get(i), i);
2023    for (int i = 0; i < element.getJurisdiction().size(); i++)
2024      composeCodeableConcept(t, "CapabilityStatement", "jurisdiction", element.getJurisdiction().get(i), i);
2025    if (element.hasPurposeElement())
2026      composeMarkdown(t, "CapabilityStatement", "purpose", element.getPurposeElement(), -1);
2027    if (element.hasCopyrightElement())
2028      composeMarkdown(t, "CapabilityStatement", "copyright", element.getCopyrightElement(), -1);
2029    if (element.hasKindElement())
2030      composeEnum(t, "CapabilityStatement", "kind", element.getKindElement(), -1);
2031    for (int i = 0; i < element.getInstantiates().size(); i++)
2032      composeUri(t, "CapabilityStatement", "instantiates", element.getInstantiates().get(i), i);
2033    if (element.hasSoftware())
2034      composeCapabilityStatementCapabilityStatementSoftwareComponent(t, "CapabilityStatement", "software", element.getSoftware(), -1);
2035    if (element.hasImplementation())
2036      composeCapabilityStatementCapabilityStatementImplementationComponent(t, "CapabilityStatement", "implementation", element.getImplementation(), -1);
2037    if (element.hasFhirVersionElement())
2038      composeId(t, "CapabilityStatement", "fhirVersion", element.getFhirVersionElement(), -1);
2039    if (element.hasAcceptUnknownElement())
2040      composeEnum(t, "CapabilityStatement", "acceptUnknown", element.getAcceptUnknownElement(), -1);
2041    for (int i = 0; i < element.getFormat().size(); i++)
2042      composeCode(t, "CapabilityStatement", "format", element.getFormat().get(i), i);
2043    for (int i = 0; i < element.getPatchFormat().size(); i++)
2044      composeCode(t, "CapabilityStatement", "patchFormat", element.getPatchFormat().get(i), i);
2045    for (int i = 0; i < element.getImplementationGuide().size(); i++)
2046      composeUri(t, "CapabilityStatement", "implementationGuide", element.getImplementationGuide().get(i), i);
2047    for (int i = 0; i < element.getProfile().size(); i++)
2048      composeReference(t, "CapabilityStatement", "profile", element.getProfile().get(i), i);
2049    for (int i = 0; i < element.getRest().size(); i++)
2050      composeCapabilityStatementCapabilityStatementRestComponent(t, "CapabilityStatement", "rest", element.getRest().get(i), i);
2051    for (int i = 0; i < element.getMessaging().size(); i++)
2052      composeCapabilityStatementCapabilityStatementMessagingComponent(t, "CapabilityStatement", "messaging", element.getMessaging().get(i), i);
2053    for (int i = 0; i < element.getDocument().size(); i++)
2054      composeCapabilityStatementCapabilityStatementDocumentComponent(t, "CapabilityStatement", "document", element.getDocument().get(i), i);
2055  }
2056
2057  protected void composeCapabilityStatementCapabilityStatementSoftwareComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementSoftwareComponent element, int index) {
2058    if (element == null) 
2059      return;
2060    Complex t;
2061    if (Utilities.noString(parentType))
2062      t = parent;
2063    else {
2064      t = parent.predicate("fhir:"+parentType+'.'+name);
2065    }
2066    composeBackboneElement(t, "software", name, element, index);
2067    if (element.hasNameElement())
2068      composeString(t, "CapabilityStatement", "name", element.getNameElement(), -1);
2069    if (element.hasVersionElement())
2070      composeString(t, "CapabilityStatement", "version", element.getVersionElement(), -1);
2071    if (element.hasReleaseDateElement())
2072      composeDateTime(t, "CapabilityStatement", "releaseDate", element.getReleaseDateElement(), -1);
2073  }
2074
2075  protected void composeCapabilityStatementCapabilityStatementImplementationComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementImplementationComponent element, int index) {
2076    if (element == null) 
2077      return;
2078    Complex t;
2079    if (Utilities.noString(parentType))
2080      t = parent;
2081    else {
2082      t = parent.predicate("fhir:"+parentType+'.'+name);
2083    }
2084    composeBackboneElement(t, "implementation", name, element, index);
2085    if (element.hasDescriptionElement())
2086      composeString(t, "CapabilityStatement", "description", element.getDescriptionElement(), -1);
2087    if (element.hasUrlElement())
2088      composeUri(t, "CapabilityStatement", "url", element.getUrlElement(), -1);
2089  }
2090
2091  protected void composeCapabilityStatementCapabilityStatementRestComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementRestComponent element, int index) {
2092    if (element == null) 
2093      return;
2094    Complex t;
2095    if (Utilities.noString(parentType))
2096      t = parent;
2097    else {
2098      t = parent.predicate("fhir:"+parentType+'.'+name);
2099    }
2100    composeBackboneElement(t, "rest", name, element, index);
2101    if (element.hasModeElement())
2102      composeEnum(t, "CapabilityStatement", "mode", element.getModeElement(), -1);
2103    if (element.hasDocumentationElement())
2104      composeString(t, "CapabilityStatement", "documentation", element.getDocumentationElement(), -1);
2105    if (element.hasSecurity())
2106      composeCapabilityStatementCapabilityStatementRestSecurityComponent(t, "CapabilityStatement", "security", element.getSecurity(), -1);
2107    for (int i = 0; i < element.getResource().size(); i++)
2108      composeCapabilityStatementCapabilityStatementRestResourceComponent(t, "CapabilityStatement", "resource", element.getResource().get(i), i);
2109    for (int i = 0; i < element.getInteraction().size(); i++)
2110      composeCapabilityStatementSystemInteractionComponent(t, "CapabilityStatement", "interaction", element.getInteraction().get(i), i);
2111    for (int i = 0; i < element.getSearchParam().size(); i++)
2112      composeCapabilityStatementCapabilityStatementRestResourceSearchParamComponent(t, "CapabilityStatement", "searchParam", element.getSearchParam().get(i), i);
2113    for (int i = 0; i < element.getOperation().size(); i++)
2114      composeCapabilityStatementCapabilityStatementRestOperationComponent(t, "CapabilityStatement", "operation", element.getOperation().get(i), i);
2115    for (int i = 0; i < element.getCompartment().size(); i++)
2116      composeUri(t, "CapabilityStatement", "compartment", element.getCompartment().get(i), i);
2117  }
2118
2119  protected void composeCapabilityStatementCapabilityStatementRestSecurityComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementRestSecurityComponent element, int index) {
2120    if (element == null) 
2121      return;
2122    Complex t;
2123    if (Utilities.noString(parentType))
2124      t = parent;
2125    else {
2126      t = parent.predicate("fhir:"+parentType+'.'+name);
2127    }
2128    composeBackboneElement(t, "security", name, element, index);
2129    if (element.hasCorsElement())
2130      composeBoolean(t, "CapabilityStatement", "cors", element.getCorsElement(), -1);
2131    for (int i = 0; i < element.getService().size(); i++)
2132      composeCodeableConcept(t, "CapabilityStatement", "service", element.getService().get(i), i);
2133    if (element.hasDescriptionElement())
2134      composeString(t, "CapabilityStatement", "description", element.getDescriptionElement(), -1);
2135    for (int i = 0; i < element.getCertificate().size(); i++)
2136      composeCapabilityStatementCapabilityStatementRestSecurityCertificateComponent(t, "CapabilityStatement", "certificate", element.getCertificate().get(i), i);
2137  }
2138
2139  protected void composeCapabilityStatementCapabilityStatementRestSecurityCertificateComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementRestSecurityCertificateComponent element, int index) {
2140    if (element == null) 
2141      return;
2142    Complex t;
2143    if (Utilities.noString(parentType))
2144      t = parent;
2145    else {
2146      t = parent.predicate("fhir:"+parentType+'.'+name);
2147    }
2148    composeBackboneElement(t, "certificate", name, element, index);
2149    if (element.hasTypeElement())
2150      composeCode(t, "CapabilityStatement", "type", element.getTypeElement(), -1);
2151    if (element.hasBlobElement())
2152      composeBase64Binary(t, "CapabilityStatement", "blob", element.getBlobElement(), -1);
2153  }
2154
2155  protected void composeCapabilityStatementCapabilityStatementRestResourceComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementRestResourceComponent element, int index) {
2156    if (element == null) 
2157      return;
2158    Complex t;
2159    if (Utilities.noString(parentType))
2160      t = parent;
2161    else {
2162      t = parent.predicate("fhir:"+parentType+'.'+name);
2163    }
2164    composeBackboneElement(t, "resource", name, element, index);
2165    if (element.hasTypeElement())
2166      composeCode(t, "CapabilityStatement", "type", element.getTypeElement(), -1);
2167    if (element.hasProfile())
2168      composeReference(t, "CapabilityStatement", "profile", element.getProfile(), -1);
2169    if (element.hasDocumentationElement())
2170      composeMarkdown(t, "CapabilityStatement", "documentation", element.getDocumentationElement(), -1);
2171    for (int i = 0; i < element.getInteraction().size(); i++)
2172      composeCapabilityStatementResourceInteractionComponent(t, "CapabilityStatement", "interaction", element.getInteraction().get(i), i);
2173    if (element.hasVersioningElement())
2174      composeEnum(t, "CapabilityStatement", "versioning", element.getVersioningElement(), -1);
2175    if (element.hasReadHistoryElement())
2176      composeBoolean(t, "CapabilityStatement", "readHistory", element.getReadHistoryElement(), -1);
2177    if (element.hasUpdateCreateElement())
2178      composeBoolean(t, "CapabilityStatement", "updateCreate", element.getUpdateCreateElement(), -1);
2179    if (element.hasConditionalCreateElement())
2180      composeBoolean(t, "CapabilityStatement", "conditionalCreate", element.getConditionalCreateElement(), -1);
2181    if (element.hasConditionalReadElement())
2182      composeEnum(t, "CapabilityStatement", "conditionalRead", element.getConditionalReadElement(), -1);
2183    if (element.hasConditionalUpdateElement())
2184      composeBoolean(t, "CapabilityStatement", "conditionalUpdate", element.getConditionalUpdateElement(), -1);
2185    if (element.hasConditionalDeleteElement())
2186      composeEnum(t, "CapabilityStatement", "conditionalDelete", element.getConditionalDeleteElement(), -1);
2187    for (int i = 0; i < element.getReferencePolicy().size(); i++)
2188      composeEnum(t, "CapabilityStatement", "referencePolicy", element.getReferencePolicy().get(i), i);
2189    for (int i = 0; i < element.getSearchInclude().size(); i++)
2190      composeString(t, "CapabilityStatement", "searchInclude", element.getSearchInclude().get(i), i);
2191    for (int i = 0; i < element.getSearchRevInclude().size(); i++)
2192      composeString(t, "CapabilityStatement", "searchRevInclude", element.getSearchRevInclude().get(i), i);
2193    for (int i = 0; i < element.getSearchParam().size(); i++)
2194      composeCapabilityStatementCapabilityStatementRestResourceSearchParamComponent(t, "CapabilityStatement", "searchParam", element.getSearchParam().get(i), i);
2195  }
2196
2197  protected void composeCapabilityStatementResourceInteractionComponent(Complex parent, String parentType, String name, CapabilityStatement.ResourceInteractionComponent element, int index) {
2198    if (element == null) 
2199      return;
2200    Complex t;
2201    if (Utilities.noString(parentType))
2202      t = parent;
2203    else {
2204      t = parent.predicate("fhir:"+parentType+'.'+name);
2205    }
2206    composeBackboneElement(t, "interaction", name, element, index);
2207    if (element.hasCodeElement())
2208      composeEnum(t, "CapabilityStatement", "code", element.getCodeElement(), -1);
2209    if (element.hasDocumentationElement())
2210      composeString(t, "CapabilityStatement", "documentation", element.getDocumentationElement(), -1);
2211  }
2212
2213  protected void composeCapabilityStatementCapabilityStatementRestResourceSearchParamComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent element, int index) {
2214    if (element == null) 
2215      return;
2216    Complex t;
2217    if (Utilities.noString(parentType))
2218      t = parent;
2219    else {
2220      t = parent.predicate("fhir:"+parentType+'.'+name);
2221    }
2222    composeBackboneElement(t, "searchParam", name, element, index);
2223    if (element.hasNameElement())
2224      composeString(t, "CapabilityStatement", "name", element.getNameElement(), -1);
2225    if (element.hasDefinitionElement())
2226      composeUri(t, "CapabilityStatement", "definition", element.getDefinitionElement(), -1);
2227    if (element.hasTypeElement())
2228      composeEnum(t, "CapabilityStatement", "type", element.getTypeElement(), -1);
2229    if (element.hasDocumentationElement())
2230      composeString(t, "CapabilityStatement", "documentation", element.getDocumentationElement(), -1);
2231  }
2232
2233  protected void composeCapabilityStatementSystemInteractionComponent(Complex parent, String parentType, String name, CapabilityStatement.SystemInteractionComponent element, int index) {
2234    if (element == null) 
2235      return;
2236    Complex t;
2237    if (Utilities.noString(parentType))
2238      t = parent;
2239    else {
2240      t = parent.predicate("fhir:"+parentType+'.'+name);
2241    }
2242    composeBackboneElement(t, "interaction", name, element, index);
2243    if (element.hasCodeElement())
2244      composeEnum(t, "CapabilityStatement", "code", element.getCodeElement(), -1);
2245    if (element.hasDocumentationElement())
2246      composeString(t, "CapabilityStatement", "documentation", element.getDocumentationElement(), -1);
2247  }
2248
2249  protected void composeCapabilityStatementCapabilityStatementRestOperationComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementRestOperationComponent element, int index) {
2250    if (element == null) 
2251      return;
2252    Complex t;
2253    if (Utilities.noString(parentType))
2254      t = parent;
2255    else {
2256      t = parent.predicate("fhir:"+parentType+'.'+name);
2257    }
2258    composeBackboneElement(t, "operation", name, element, index);
2259    if (element.hasNameElement())
2260      composeString(t, "CapabilityStatement", "name", element.getNameElement(), -1);
2261    if (element.hasDefinition())
2262      composeReference(t, "CapabilityStatement", "definition", element.getDefinition(), -1);
2263  }
2264
2265  protected void composeCapabilityStatementCapabilityStatementMessagingComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementMessagingComponent element, int index) {
2266    if (element == null) 
2267      return;
2268    Complex t;
2269    if (Utilities.noString(parentType))
2270      t = parent;
2271    else {
2272      t = parent.predicate("fhir:"+parentType+'.'+name);
2273    }
2274    composeBackboneElement(t, "messaging", name, element, index);
2275    for (int i = 0; i < element.getEndpoint().size(); i++)
2276      composeCapabilityStatementCapabilityStatementMessagingEndpointComponent(t, "CapabilityStatement", "endpoint", element.getEndpoint().get(i), i);
2277    if (element.hasReliableCacheElement())
2278      composeUnsignedInt(t, "CapabilityStatement", "reliableCache", element.getReliableCacheElement(), -1);
2279    if (element.hasDocumentationElement())
2280      composeString(t, "CapabilityStatement", "documentation", element.getDocumentationElement(), -1);
2281    for (int i = 0; i < element.getSupportedMessage().size(); i++)
2282      composeCapabilityStatementCapabilityStatementMessagingSupportedMessageComponent(t, "CapabilityStatement", "supportedMessage", element.getSupportedMessage().get(i), i);
2283    for (int i = 0; i < element.getEvent().size(); i++)
2284      composeCapabilityStatementCapabilityStatementMessagingEventComponent(t, "CapabilityStatement", "event", element.getEvent().get(i), i);
2285  }
2286
2287  protected void composeCapabilityStatementCapabilityStatementMessagingEndpointComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementMessagingEndpointComponent element, int index) {
2288    if (element == null) 
2289      return;
2290    Complex t;
2291    if (Utilities.noString(parentType))
2292      t = parent;
2293    else {
2294      t = parent.predicate("fhir:"+parentType+'.'+name);
2295    }
2296    composeBackboneElement(t, "endpoint", name, element, index);
2297    if (element.hasProtocol())
2298      composeCoding(t, "CapabilityStatement", "protocol", element.getProtocol(), -1);
2299    if (element.hasAddressElement())
2300      composeUri(t, "CapabilityStatement", "address", element.getAddressElement(), -1);
2301  }
2302
2303  protected void composeCapabilityStatementCapabilityStatementMessagingSupportedMessageComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent element, int index) {
2304    if (element == null) 
2305      return;
2306    Complex t;
2307    if (Utilities.noString(parentType))
2308      t = parent;
2309    else {
2310      t = parent.predicate("fhir:"+parentType+'.'+name);
2311    }
2312    composeBackboneElement(t, "supportedMessage", name, element, index);
2313    if (element.hasModeElement())
2314      composeEnum(t, "CapabilityStatement", "mode", element.getModeElement(), -1);
2315    if (element.hasDefinition())
2316      composeReference(t, "CapabilityStatement", "definition", element.getDefinition(), -1);
2317  }
2318
2319  protected void composeCapabilityStatementCapabilityStatementMessagingEventComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementMessagingEventComponent element, int index) {
2320    if (element == null) 
2321      return;
2322    Complex t;
2323    if (Utilities.noString(parentType))
2324      t = parent;
2325    else {
2326      t = parent.predicate("fhir:"+parentType+'.'+name);
2327    }
2328    composeBackboneElement(t, "event", name, element, index);
2329    if (element.hasCode())
2330      composeCoding(t, "CapabilityStatement", "code", element.getCode(), -1);
2331    if (element.hasCategoryElement())
2332      composeEnum(t, "CapabilityStatement", "category", element.getCategoryElement(), -1);
2333    if (element.hasModeElement())
2334      composeEnum(t, "CapabilityStatement", "mode", element.getModeElement(), -1);
2335    if (element.hasFocusElement())
2336      composeCode(t, "CapabilityStatement", "focus", element.getFocusElement(), -1);
2337    if (element.hasRequest())
2338      composeReference(t, "CapabilityStatement", "request", element.getRequest(), -1);
2339    if (element.hasResponse())
2340      composeReference(t, "CapabilityStatement", "response", element.getResponse(), -1);
2341    if (element.hasDocumentationElement())
2342      composeString(t, "CapabilityStatement", "documentation", element.getDocumentationElement(), -1);
2343  }
2344
2345  protected void composeCapabilityStatementCapabilityStatementDocumentComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementDocumentComponent element, int index) {
2346    if (element == null) 
2347      return;
2348    Complex t;
2349    if (Utilities.noString(parentType))
2350      t = parent;
2351    else {
2352      t = parent.predicate("fhir:"+parentType+'.'+name);
2353    }
2354    composeBackboneElement(t, "document", name, element, index);
2355    if (element.hasModeElement())
2356      composeEnum(t, "CapabilityStatement", "mode", element.getModeElement(), -1);
2357    if (element.hasDocumentationElement())
2358      composeString(t, "CapabilityStatement", "documentation", element.getDocumentationElement(), -1);
2359    if (element.hasProfile())
2360      composeReference(t, "CapabilityStatement", "profile", element.getProfile(), -1);
2361  }
2362
2363  protected void composeCarePlan(Complex parent, String parentType, String name, CarePlan element, int index) {
2364    if (element == null) 
2365      return;
2366    Complex t;
2367    if (Utilities.noString(parentType))
2368      t = parent;
2369    else {
2370      t = parent.predicate("fhir:"+parentType+'.'+name);
2371    }
2372    composeDomainResource(t, "CarePlan", name, element, index);
2373    for (int i = 0; i < element.getIdentifier().size(); i++)
2374      composeIdentifier(t, "CarePlan", "identifier", element.getIdentifier().get(i), i);
2375    for (int i = 0; i < element.getDefinition().size(); i++)
2376      composeReference(t, "CarePlan", "definition", element.getDefinition().get(i), i);
2377    for (int i = 0; i < element.getBasedOn().size(); i++)
2378      composeReference(t, "CarePlan", "basedOn", element.getBasedOn().get(i), i);
2379    for (int i = 0; i < element.getReplaces().size(); i++)
2380      composeReference(t, "CarePlan", "replaces", element.getReplaces().get(i), i);
2381    for (int i = 0; i < element.getPartOf().size(); i++)
2382      composeReference(t, "CarePlan", "partOf", element.getPartOf().get(i), i);
2383    if (element.hasStatusElement())
2384      composeEnum(t, "CarePlan", "status", element.getStatusElement(), -1);
2385    if (element.hasIntentElement())
2386      composeEnum(t, "CarePlan", "intent", element.getIntentElement(), -1);
2387    for (int i = 0; i < element.getCategory().size(); i++)
2388      composeCodeableConcept(t, "CarePlan", "category", element.getCategory().get(i), i);
2389    if (element.hasTitleElement())
2390      composeString(t, "CarePlan", "title", element.getTitleElement(), -1);
2391    if (element.hasDescriptionElement())
2392      composeString(t, "CarePlan", "description", element.getDescriptionElement(), -1);
2393    if (element.hasSubject())
2394      composeReference(t, "CarePlan", "subject", element.getSubject(), -1);
2395    if (element.hasContext())
2396      composeReference(t, "CarePlan", "context", element.getContext(), -1);
2397    if (element.hasPeriod())
2398      composePeriod(t, "CarePlan", "period", element.getPeriod(), -1);
2399    for (int i = 0; i < element.getAuthor().size(); i++)
2400      composeReference(t, "CarePlan", "author", element.getAuthor().get(i), i);
2401    for (int i = 0; i < element.getCareTeam().size(); i++)
2402      composeReference(t, "CarePlan", "careTeam", element.getCareTeam().get(i), i);
2403    for (int i = 0; i < element.getAddresses().size(); i++)
2404      composeReference(t, "CarePlan", "addresses", element.getAddresses().get(i), i);
2405    for (int i = 0; i < element.getSupportingInfo().size(); i++)
2406      composeReference(t, "CarePlan", "supportingInfo", element.getSupportingInfo().get(i), i);
2407    for (int i = 0; i < element.getGoal().size(); i++)
2408      composeReference(t, "CarePlan", "goal", element.getGoal().get(i), i);
2409    for (int i = 0; i < element.getActivity().size(); i++)
2410      composeCarePlanCarePlanActivityComponent(t, "CarePlan", "activity", element.getActivity().get(i), i);
2411    for (int i = 0; i < element.getNote().size(); i++)
2412      composeAnnotation(t, "CarePlan", "note", element.getNote().get(i), i);
2413  }
2414
2415  protected void composeCarePlanCarePlanActivityComponent(Complex parent, String parentType, String name, CarePlan.CarePlanActivityComponent element, int index) {
2416    if (element == null) 
2417      return;
2418    Complex t;
2419    if (Utilities.noString(parentType))
2420      t = parent;
2421    else {
2422      t = parent.predicate("fhir:"+parentType+'.'+name);
2423    }
2424    composeBackboneElement(t, "activity", name, element, index);
2425    for (int i = 0; i < element.getOutcomeCodeableConcept().size(); i++)
2426      composeCodeableConcept(t, "CarePlan", "outcomeCodeableConcept", element.getOutcomeCodeableConcept().get(i), i);
2427    for (int i = 0; i < element.getOutcomeReference().size(); i++)
2428      composeReference(t, "CarePlan", "outcomeReference", element.getOutcomeReference().get(i), i);
2429    for (int i = 0; i < element.getProgress().size(); i++)
2430      composeAnnotation(t, "CarePlan", "progress", element.getProgress().get(i), i);
2431    if (element.hasReference())
2432      composeReference(t, "CarePlan", "reference", element.getReference(), -1);
2433    if (element.hasDetail())
2434      composeCarePlanCarePlanActivityDetailComponent(t, "CarePlan", "detail", element.getDetail(), -1);
2435  }
2436
2437  protected void composeCarePlanCarePlanActivityDetailComponent(Complex parent, String parentType, String name, CarePlan.CarePlanActivityDetailComponent element, int index) {
2438    if (element == null) 
2439      return;
2440    Complex t;
2441    if (Utilities.noString(parentType))
2442      t = parent;
2443    else {
2444      t = parent.predicate("fhir:"+parentType+'.'+name);
2445    }
2446    composeBackboneElement(t, "detail", name, element, index);
2447    if (element.hasCategory())
2448      composeCodeableConcept(t, "CarePlan", "category", element.getCategory(), -1);
2449    if (element.hasDefinition())
2450      composeReference(t, "CarePlan", "definition", element.getDefinition(), -1);
2451    if (element.hasCode())
2452      composeCodeableConcept(t, "CarePlan", "code", element.getCode(), -1);
2453    for (int i = 0; i < element.getReasonCode().size(); i++)
2454      composeCodeableConcept(t, "CarePlan", "reasonCode", element.getReasonCode().get(i), i);
2455    for (int i = 0; i < element.getReasonReference().size(); i++)
2456      composeReference(t, "CarePlan", "reasonReference", element.getReasonReference().get(i), i);
2457    for (int i = 0; i < element.getGoal().size(); i++)
2458      composeReference(t, "CarePlan", "goal", element.getGoal().get(i), i);
2459    if (element.hasStatusElement())
2460      composeEnum(t, "CarePlan", "status", element.getStatusElement(), -1);
2461    if (element.hasStatusReasonElement())
2462      composeString(t, "CarePlan", "statusReason", element.getStatusReasonElement(), -1);
2463    if (element.hasProhibitedElement())
2464      composeBoolean(t, "CarePlan", "prohibited", element.getProhibitedElement(), -1);
2465    if (element.hasScheduled())
2466      composeType(t, "CarePlan", "scheduled", element.getScheduled(), -1);
2467    if (element.hasLocation())
2468      composeReference(t, "CarePlan", "location", element.getLocation(), -1);
2469    for (int i = 0; i < element.getPerformer().size(); i++)
2470      composeReference(t, "CarePlan", "performer", element.getPerformer().get(i), i);
2471    if (element.hasProduct())
2472      composeType(t, "CarePlan", "product", element.getProduct(), -1);
2473    if (element.hasDailyAmount())
2474      composeQuantity(t, "CarePlan", "dailyAmount", element.getDailyAmount(), -1);
2475    if (element.hasQuantity())
2476      composeQuantity(t, "CarePlan", "quantity", element.getQuantity(), -1);
2477    if (element.hasDescriptionElement())
2478      composeString(t, "CarePlan", "description", element.getDescriptionElement(), -1);
2479  }
2480
2481  protected void composeCareTeam(Complex parent, String parentType, String name, CareTeam element, int index) {
2482    if (element == null) 
2483      return;
2484    Complex t;
2485    if (Utilities.noString(parentType))
2486      t = parent;
2487    else {
2488      t = parent.predicate("fhir:"+parentType+'.'+name);
2489    }
2490    composeDomainResource(t, "CareTeam", name, element, index);
2491    for (int i = 0; i < element.getIdentifier().size(); i++)
2492      composeIdentifier(t, "CareTeam", "identifier", element.getIdentifier().get(i), i);
2493    if (element.hasStatusElement())
2494      composeEnum(t, "CareTeam", "status", element.getStatusElement(), -1);
2495    for (int i = 0; i < element.getCategory().size(); i++)
2496      composeCodeableConcept(t, "CareTeam", "category", element.getCategory().get(i), i);
2497    if (element.hasNameElement())
2498      composeString(t, "CareTeam", "name", element.getNameElement(), -1);
2499    if (element.hasSubject())
2500      composeReference(t, "CareTeam", "subject", element.getSubject(), -1);
2501    if (element.hasContext())
2502      composeReference(t, "CareTeam", "context", element.getContext(), -1);
2503    if (element.hasPeriod())
2504      composePeriod(t, "CareTeam", "period", element.getPeriod(), -1);
2505    for (int i = 0; i < element.getParticipant().size(); i++)
2506      composeCareTeamCareTeamParticipantComponent(t, "CareTeam", "participant", element.getParticipant().get(i), i);
2507    for (int i = 0; i < element.getReasonCode().size(); i++)
2508      composeCodeableConcept(t, "CareTeam", "reasonCode", element.getReasonCode().get(i), i);
2509    for (int i = 0; i < element.getReasonReference().size(); i++)
2510      composeReference(t, "CareTeam", "reasonReference", element.getReasonReference().get(i), i);
2511    for (int i = 0; i < element.getManagingOrganization().size(); i++)
2512      composeReference(t, "CareTeam", "managingOrganization", element.getManagingOrganization().get(i), i);
2513    for (int i = 0; i < element.getNote().size(); i++)
2514      composeAnnotation(t, "CareTeam", "note", element.getNote().get(i), i);
2515  }
2516
2517  protected void composeCareTeamCareTeamParticipantComponent(Complex parent, String parentType, String name, CareTeam.CareTeamParticipantComponent element, int index) {
2518    if (element == null) 
2519      return;
2520    Complex t;
2521    if (Utilities.noString(parentType))
2522      t = parent;
2523    else {
2524      t = parent.predicate("fhir:"+parentType+'.'+name);
2525    }
2526    composeBackboneElement(t, "participant", name, element, index);
2527    if (element.hasRole())
2528      composeCodeableConcept(t, "CareTeam", "role", element.getRole(), -1);
2529    if (element.hasMember())
2530      composeReference(t, "CareTeam", "member", element.getMember(), -1);
2531    if (element.hasOnBehalfOf())
2532      composeReference(t, "CareTeam", "onBehalfOf", element.getOnBehalfOf(), -1);
2533    if (element.hasPeriod())
2534      composePeriod(t, "CareTeam", "period", element.getPeriod(), -1);
2535  }
2536
2537  protected void composeChargeItem(Complex parent, String parentType, String name, ChargeItem element, int index) {
2538    if (element == null) 
2539      return;
2540    Complex t;
2541    if (Utilities.noString(parentType))
2542      t = parent;
2543    else {
2544      t = parent.predicate("fhir:"+parentType+'.'+name);
2545    }
2546    composeDomainResource(t, "ChargeItem", name, element, index);
2547    if (element.hasIdentifier())
2548      composeIdentifier(t, "ChargeItem", "identifier", element.getIdentifier(), -1);
2549    for (int i = 0; i < element.getDefinition().size(); i++)
2550      composeUri(t, "ChargeItem", "definition", element.getDefinition().get(i), i);
2551    if (element.hasStatusElement())
2552      composeEnum(t, "ChargeItem", "status", element.getStatusElement(), -1);
2553    for (int i = 0; i < element.getPartOf().size(); i++)
2554      composeReference(t, "ChargeItem", "partOf", element.getPartOf().get(i), i);
2555    if (element.hasCode())
2556      composeCodeableConcept(t, "ChargeItem", "code", element.getCode(), -1);
2557    if (element.hasSubject())
2558      composeReference(t, "ChargeItem", "subject", element.getSubject(), -1);
2559    if (element.hasContext())
2560      composeReference(t, "ChargeItem", "context", element.getContext(), -1);
2561    if (element.hasOccurrence())
2562      composeType(t, "ChargeItem", "occurrence", element.getOccurrence(), -1);
2563    for (int i = 0; i < element.getParticipant().size(); i++)
2564      composeChargeItemChargeItemParticipantComponent(t, "ChargeItem", "participant", element.getParticipant().get(i), i);
2565    if (element.hasPerformingOrganization())
2566      composeReference(t, "ChargeItem", "performingOrganization", element.getPerformingOrganization(), -1);
2567    if (element.hasRequestingOrganization())
2568      composeReference(t, "ChargeItem", "requestingOrganization", element.getRequestingOrganization(), -1);
2569    if (element.hasQuantity())
2570      composeQuantity(t, "ChargeItem", "quantity", element.getQuantity(), -1);
2571    for (int i = 0; i < element.getBodysite().size(); i++)
2572      composeCodeableConcept(t, "ChargeItem", "bodysite", element.getBodysite().get(i), i);
2573    if (element.hasFactorOverrideElement())
2574      composeDecimal(t, "ChargeItem", "factorOverride", element.getFactorOverrideElement(), -1);
2575    if (element.hasPriceOverride())
2576      composeMoney(t, "ChargeItem", "priceOverride", element.getPriceOverride(), -1);
2577    if (element.hasOverrideReasonElement())
2578      composeString(t, "ChargeItem", "overrideReason", element.getOverrideReasonElement(), -1);
2579    if (element.hasEnterer())
2580      composeReference(t, "ChargeItem", "enterer", element.getEnterer(), -1);
2581    if (element.hasEnteredDateElement())
2582      composeDateTime(t, "ChargeItem", "enteredDate", element.getEnteredDateElement(), -1);
2583    for (int i = 0; i < element.getReason().size(); i++)
2584      composeCodeableConcept(t, "ChargeItem", "reason", element.getReason().get(i), i);
2585    for (int i = 0; i < element.getService().size(); i++)
2586      composeReference(t, "ChargeItem", "service", element.getService().get(i), i);
2587    for (int i = 0; i < element.getAccount().size(); i++)
2588      composeReference(t, "ChargeItem", "account", element.getAccount().get(i), i);
2589    for (int i = 0; i < element.getNote().size(); i++)
2590      composeAnnotation(t, "ChargeItem", "note", element.getNote().get(i), i);
2591    for (int i = 0; i < element.getSupportingInformation().size(); i++)
2592      composeReference(t, "ChargeItem", "supportingInformation", element.getSupportingInformation().get(i), i);
2593  }
2594
2595  protected void composeChargeItemChargeItemParticipantComponent(Complex parent, String parentType, String name, ChargeItem.ChargeItemParticipantComponent element, int index) {
2596    if (element == null) 
2597      return;
2598    Complex t;
2599    if (Utilities.noString(parentType))
2600      t = parent;
2601    else {
2602      t = parent.predicate("fhir:"+parentType+'.'+name);
2603    }
2604    composeBackboneElement(t, "participant", name, element, index);
2605    if (element.hasRole())
2606      composeCodeableConcept(t, "ChargeItem", "role", element.getRole(), -1);
2607    if (element.hasActor())
2608      composeReference(t, "ChargeItem", "actor", element.getActor(), -1);
2609  }
2610
2611  protected void composeClaim(Complex parent, String parentType, String name, Claim element, int index) {
2612    if (element == null) 
2613      return;
2614    Complex t;
2615    if (Utilities.noString(parentType))
2616      t = parent;
2617    else {
2618      t = parent.predicate("fhir:"+parentType+'.'+name);
2619    }
2620    composeDomainResource(t, "Claim", name, element, index);
2621    for (int i = 0; i < element.getIdentifier().size(); i++)
2622      composeIdentifier(t, "Claim", "identifier", element.getIdentifier().get(i), i);
2623    if (element.hasStatusElement())
2624      composeEnum(t, "Claim", "status", element.getStatusElement(), -1);
2625    if (element.hasType())
2626      composeCodeableConcept(t, "Claim", "type", element.getType(), -1);
2627    for (int i = 0; i < element.getSubType().size(); i++)
2628      composeCodeableConcept(t, "Claim", "subType", element.getSubType().get(i), i);
2629    if (element.hasUseElement())
2630      composeEnum(t, "Claim", "use", element.getUseElement(), -1);
2631    if (element.hasPatient())
2632      composeReference(t, "Claim", "patient", element.getPatient(), -1);
2633    if (element.hasBillablePeriod())
2634      composePeriod(t, "Claim", "billablePeriod", element.getBillablePeriod(), -1);
2635    if (element.hasCreatedElement())
2636      composeDateTime(t, "Claim", "created", element.getCreatedElement(), -1);
2637    if (element.hasEnterer())
2638      composeReference(t, "Claim", "enterer", element.getEnterer(), -1);
2639    if (element.hasInsurer())
2640      composeReference(t, "Claim", "insurer", element.getInsurer(), -1);
2641    if (element.hasProvider())
2642      composeReference(t, "Claim", "provider", element.getProvider(), -1);
2643    if (element.hasOrganization())
2644      composeReference(t, "Claim", "organization", element.getOrganization(), -1);
2645    if (element.hasPriority())
2646      composeCodeableConcept(t, "Claim", "priority", element.getPriority(), -1);
2647    if (element.hasFundsReserve())
2648      composeCodeableConcept(t, "Claim", "fundsReserve", element.getFundsReserve(), -1);
2649    for (int i = 0; i < element.getRelated().size(); i++)
2650      composeClaimRelatedClaimComponent(t, "Claim", "related", element.getRelated().get(i), i);
2651    if (element.hasPrescription())
2652      composeReference(t, "Claim", "prescription", element.getPrescription(), -1);
2653    if (element.hasOriginalPrescription())
2654      composeReference(t, "Claim", "originalPrescription", element.getOriginalPrescription(), -1);
2655    if (element.hasPayee())
2656      composeClaimPayeeComponent(t, "Claim", "payee", element.getPayee(), -1);
2657    if (element.hasReferral())
2658      composeReference(t, "Claim", "referral", element.getReferral(), -1);
2659    if (element.hasFacility())
2660      composeReference(t, "Claim", "facility", element.getFacility(), -1);
2661    for (int i = 0; i < element.getCareTeam().size(); i++)
2662      composeClaimCareTeamComponent(t, "Claim", "careTeam", element.getCareTeam().get(i), i);
2663    for (int i = 0; i < element.getInformation().size(); i++)
2664      composeClaimSpecialConditionComponent(t, "Claim", "information", element.getInformation().get(i), i);
2665    for (int i = 0; i < element.getDiagnosis().size(); i++)
2666      composeClaimDiagnosisComponent(t, "Claim", "diagnosis", element.getDiagnosis().get(i), i);
2667    for (int i = 0; i < element.getProcedure().size(); i++)
2668      composeClaimProcedureComponent(t, "Claim", "procedure", element.getProcedure().get(i), i);
2669    for (int i = 0; i < element.getInsurance().size(); i++)
2670      composeClaimInsuranceComponent(t, "Claim", "insurance", element.getInsurance().get(i), i);
2671    if (element.hasAccident())
2672      composeClaimAccidentComponent(t, "Claim", "accident", element.getAccident(), -1);
2673    if (element.hasEmploymentImpacted())
2674      composePeriod(t, "Claim", "employmentImpacted", element.getEmploymentImpacted(), -1);
2675    if (element.hasHospitalization())
2676      composePeriod(t, "Claim", "hospitalization", element.getHospitalization(), -1);
2677    for (int i = 0; i < element.getItem().size(); i++)
2678      composeClaimItemComponent(t, "Claim", "item", element.getItem().get(i), i);
2679    if (element.hasTotal())
2680      composeMoney(t, "Claim", "total", element.getTotal(), -1);
2681  }
2682
2683  protected void composeClaimRelatedClaimComponent(Complex parent, String parentType, String name, Claim.RelatedClaimComponent element, int index) {
2684    if (element == null) 
2685      return;
2686    Complex t;
2687    if (Utilities.noString(parentType))
2688      t = parent;
2689    else {
2690      t = parent.predicate("fhir:"+parentType+'.'+name);
2691    }
2692    composeBackboneElement(t, "related", name, element, index);
2693    if (element.hasClaim())
2694      composeReference(t, "Claim", "claim", element.getClaim(), -1);
2695    if (element.hasRelationship())
2696      composeCodeableConcept(t, "Claim", "relationship", element.getRelationship(), -1);
2697    if (element.hasReference())
2698      composeIdentifier(t, "Claim", "reference", element.getReference(), -1);
2699  }
2700
2701  protected void composeClaimPayeeComponent(Complex parent, String parentType, String name, Claim.PayeeComponent element, int index) {
2702    if (element == null) 
2703      return;
2704    Complex t;
2705    if (Utilities.noString(parentType))
2706      t = parent;
2707    else {
2708      t = parent.predicate("fhir:"+parentType+'.'+name);
2709    }
2710    composeBackboneElement(t, "payee", name, element, index);
2711    if (element.hasType())
2712      composeCodeableConcept(t, "Claim", "type", element.getType(), -1);
2713    if (element.hasResourceType())
2714      composeCoding(t, "Claim", "resourceType", element.getResourceType(), -1);
2715    if (element.hasParty())
2716      composeReference(t, "Claim", "party", element.getParty(), -1);
2717  }
2718
2719  protected void composeClaimCareTeamComponent(Complex parent, String parentType, String name, Claim.CareTeamComponent element, int index) {
2720    if (element == null) 
2721      return;
2722    Complex t;
2723    if (Utilities.noString(parentType))
2724      t = parent;
2725    else {
2726      t = parent.predicate("fhir:"+parentType+'.'+name);
2727    }
2728    composeBackboneElement(t, "careTeam", name, element, index);
2729    if (element.hasSequenceElement())
2730      composePositiveInt(t, "Claim", "sequence", element.getSequenceElement(), -1);
2731    if (element.hasProvider())
2732      composeReference(t, "Claim", "provider", element.getProvider(), -1);
2733    if (element.hasResponsibleElement())
2734      composeBoolean(t, "Claim", "responsible", element.getResponsibleElement(), -1);
2735    if (element.hasRole())
2736      composeCodeableConcept(t, "Claim", "role", element.getRole(), -1);
2737    if (element.hasQualification())
2738      composeCodeableConcept(t, "Claim", "qualification", element.getQualification(), -1);
2739  }
2740
2741  protected void composeClaimSpecialConditionComponent(Complex parent, String parentType, String name, Claim.SpecialConditionComponent element, int index) {
2742    if (element == null) 
2743      return;
2744    Complex t;
2745    if (Utilities.noString(parentType))
2746      t = parent;
2747    else {
2748      t = parent.predicate("fhir:"+parentType+'.'+name);
2749    }
2750    composeBackboneElement(t, "information", name, element, index);
2751    if (element.hasSequenceElement())
2752      composePositiveInt(t, "Claim", "sequence", element.getSequenceElement(), -1);
2753    if (element.hasCategory())
2754      composeCodeableConcept(t, "Claim", "category", element.getCategory(), -1);
2755    if (element.hasCode())
2756      composeCodeableConcept(t, "Claim", "code", element.getCode(), -1);
2757    if (element.hasTiming())
2758      composeType(t, "Claim", "timing", element.getTiming(), -1);
2759    if (element.hasValue())
2760      composeType(t, "Claim", "value", element.getValue(), -1);
2761    if (element.hasReason())
2762      composeCodeableConcept(t, "Claim", "reason", element.getReason(), -1);
2763  }
2764
2765  protected void composeClaimDiagnosisComponent(Complex parent, String parentType, String name, Claim.DiagnosisComponent element, int index) {
2766    if (element == null) 
2767      return;
2768    Complex t;
2769    if (Utilities.noString(parentType))
2770      t = parent;
2771    else {
2772      t = parent.predicate("fhir:"+parentType+'.'+name);
2773    }
2774    composeBackboneElement(t, "diagnosis", name, element, index);
2775    if (element.hasSequenceElement())
2776      composePositiveInt(t, "Claim", "sequence", element.getSequenceElement(), -1);
2777    if (element.hasDiagnosis())
2778      composeType(t, "Claim", "diagnosis", element.getDiagnosis(), -1);
2779    for (int i = 0; i < element.getType().size(); i++)
2780      composeCodeableConcept(t, "Claim", "type", element.getType().get(i), i);
2781    if (element.hasPackageCode())
2782      composeCodeableConcept(t, "Claim", "packageCode", element.getPackageCode(), -1);
2783  }
2784
2785  protected void composeClaimProcedureComponent(Complex parent, String parentType, String name, Claim.ProcedureComponent element, int index) {
2786    if (element == null) 
2787      return;
2788    Complex t;
2789    if (Utilities.noString(parentType))
2790      t = parent;
2791    else {
2792      t = parent.predicate("fhir:"+parentType+'.'+name);
2793    }
2794    composeBackboneElement(t, "procedure", name, element, index);
2795    if (element.hasSequenceElement())
2796      composePositiveInt(t, "Claim", "sequence", element.getSequenceElement(), -1);
2797    if (element.hasDateElement())
2798      composeDateTime(t, "Claim", "date", element.getDateElement(), -1);
2799    if (element.hasProcedure())
2800      composeType(t, "Claim", "procedure", element.getProcedure(), -1);
2801  }
2802
2803  protected void composeClaimInsuranceComponent(Complex parent, String parentType, String name, Claim.InsuranceComponent element, int index) {
2804    if (element == null) 
2805      return;
2806    Complex t;
2807    if (Utilities.noString(parentType))
2808      t = parent;
2809    else {
2810      t = parent.predicate("fhir:"+parentType+'.'+name);
2811    }
2812    composeBackboneElement(t, "insurance", name, element, index);
2813    if (element.hasSequenceElement())
2814      composePositiveInt(t, "Claim", "sequence", element.getSequenceElement(), -1);
2815    if (element.hasFocalElement())
2816      composeBoolean(t, "Claim", "focal", element.getFocalElement(), -1);
2817    if (element.hasCoverage())
2818      composeReference(t, "Claim", "coverage", element.getCoverage(), -1);
2819    if (element.hasBusinessArrangementElement())
2820      composeString(t, "Claim", "businessArrangement", element.getBusinessArrangementElement(), -1);
2821    for (int i = 0; i < element.getPreAuthRef().size(); i++)
2822      composeString(t, "Claim", "preAuthRef", element.getPreAuthRef().get(i), i);
2823    if (element.hasClaimResponse())
2824      composeReference(t, "Claim", "claimResponse", element.getClaimResponse(), -1);
2825  }
2826
2827  protected void composeClaimAccidentComponent(Complex parent, String parentType, String name, Claim.AccidentComponent element, int index) {
2828    if (element == null) 
2829      return;
2830    Complex t;
2831    if (Utilities.noString(parentType))
2832      t = parent;
2833    else {
2834      t = parent.predicate("fhir:"+parentType+'.'+name);
2835    }
2836    composeBackboneElement(t, "accident", name, element, index);
2837    if (element.hasDateElement())
2838      composeDate(t, "Claim", "date", element.getDateElement(), -1);
2839    if (element.hasType())
2840      composeCodeableConcept(t, "Claim", "type", element.getType(), -1);
2841    if (element.hasLocation())
2842      composeType(t, "Claim", "location", element.getLocation(), -1);
2843  }
2844
2845  protected void composeClaimItemComponent(Complex parent, String parentType, String name, Claim.ItemComponent element, int index) {
2846    if (element == null) 
2847      return;
2848    Complex t;
2849    if (Utilities.noString(parentType))
2850      t = parent;
2851    else {
2852      t = parent.predicate("fhir:"+parentType+'.'+name);
2853    }
2854    composeBackboneElement(t, "item", name, element, index);
2855    if (element.hasSequenceElement())
2856      composePositiveInt(t, "Claim", "sequence", element.getSequenceElement(), -1);
2857    for (int i = 0; i < element.getCareTeamLinkId().size(); i++)
2858      composePositiveInt(t, "Claim", "careTeamLinkId", element.getCareTeamLinkId().get(i), i);
2859    for (int i = 0; i < element.getDiagnosisLinkId().size(); i++)
2860      composePositiveInt(t, "Claim", "diagnosisLinkId", element.getDiagnosisLinkId().get(i), i);
2861    for (int i = 0; i < element.getProcedureLinkId().size(); i++)
2862      composePositiveInt(t, "Claim", "procedureLinkId", element.getProcedureLinkId().get(i), i);
2863    for (int i = 0; i < element.getInformationLinkId().size(); i++)
2864      composePositiveInt(t, "Claim", "informationLinkId", element.getInformationLinkId().get(i), i);
2865    if (element.hasRevenue())
2866      composeCodeableConcept(t, "Claim", "revenue", element.getRevenue(), -1);
2867    if (element.hasCategory())
2868      composeCodeableConcept(t, "Claim", "category", element.getCategory(), -1);
2869    if (element.hasService())
2870      composeCodeableConcept(t, "Claim", "service", element.getService(), -1);
2871    for (int i = 0; i < element.getModifier().size(); i++)
2872      composeCodeableConcept(t, "Claim", "modifier", element.getModifier().get(i), i);
2873    for (int i = 0; i < element.getProgramCode().size(); i++)
2874      composeCodeableConcept(t, "Claim", "programCode", element.getProgramCode().get(i), i);
2875    if (element.hasServiced())
2876      composeType(t, "Claim", "serviced", element.getServiced(), -1);
2877    if (element.hasLocation())
2878      composeType(t, "Claim", "location", element.getLocation(), -1);
2879    if (element.hasQuantity())
2880      composeQuantity(t, "Claim", "quantity", element.getQuantity(), -1);
2881    if (element.hasUnitPrice())
2882      composeMoney(t, "Claim", "unitPrice", element.getUnitPrice(), -1);
2883    if (element.hasFactorElement())
2884      composeDecimal(t, "Claim", "factor", element.getFactorElement(), -1);
2885    if (element.hasNet())
2886      composeMoney(t, "Claim", "net", element.getNet(), -1);
2887    for (int i = 0; i < element.getUdi().size(); i++)
2888      composeReference(t, "Claim", "udi", element.getUdi().get(i), i);
2889    if (element.hasBodySite())
2890      composeCodeableConcept(t, "Claim", "bodySite", element.getBodySite(), -1);
2891    for (int i = 0; i < element.getSubSite().size(); i++)
2892      composeCodeableConcept(t, "Claim", "subSite", element.getSubSite().get(i), i);
2893    for (int i = 0; i < element.getEncounter().size(); i++)
2894      composeReference(t, "Claim", "encounter", element.getEncounter().get(i), i);
2895    for (int i = 0; i < element.getDetail().size(); i++)
2896      composeClaimDetailComponent(t, "Claim", "detail", element.getDetail().get(i), i);
2897  }
2898
2899  protected void composeClaimDetailComponent(Complex parent, String parentType, String name, Claim.DetailComponent element, int index) {
2900    if (element == null) 
2901      return;
2902    Complex t;
2903    if (Utilities.noString(parentType))
2904      t = parent;
2905    else {
2906      t = parent.predicate("fhir:"+parentType+'.'+name);
2907    }
2908    composeBackboneElement(t, "detail", name, element, index);
2909    if (element.hasSequenceElement())
2910      composePositiveInt(t, "Claim", "sequence", element.getSequenceElement(), -1);
2911    if (element.hasRevenue())
2912      composeCodeableConcept(t, "Claim", "revenue", element.getRevenue(), -1);
2913    if (element.hasCategory())
2914      composeCodeableConcept(t, "Claim", "category", element.getCategory(), -1);
2915    if (element.hasService())
2916      composeCodeableConcept(t, "Claim", "service", element.getService(), -1);
2917    for (int i = 0; i < element.getModifier().size(); i++)
2918      composeCodeableConcept(t, "Claim", "modifier", element.getModifier().get(i), i);
2919    for (int i = 0; i < element.getProgramCode().size(); i++)
2920      composeCodeableConcept(t, "Claim", "programCode", element.getProgramCode().get(i), i);
2921    if (element.hasQuantity())
2922      composeQuantity(t, "Claim", "quantity", element.getQuantity(), -1);
2923    if (element.hasUnitPrice())
2924      composeMoney(t, "Claim", "unitPrice", element.getUnitPrice(), -1);
2925    if (element.hasFactorElement())
2926      composeDecimal(t, "Claim", "factor", element.getFactorElement(), -1);
2927    if (element.hasNet())
2928      composeMoney(t, "Claim", "net", element.getNet(), -1);
2929    for (int i = 0; i < element.getUdi().size(); i++)
2930      composeReference(t, "Claim", "udi", element.getUdi().get(i), i);
2931    for (int i = 0; i < element.getSubDetail().size(); i++)
2932      composeClaimSubDetailComponent(t, "Claim", "subDetail", element.getSubDetail().get(i), i);
2933  }
2934
2935  protected void composeClaimSubDetailComponent(Complex parent, String parentType, String name, Claim.SubDetailComponent element, int index) {
2936    if (element == null) 
2937      return;
2938    Complex t;
2939    if (Utilities.noString(parentType))
2940      t = parent;
2941    else {
2942      t = parent.predicate("fhir:"+parentType+'.'+name);
2943    }
2944    composeBackboneElement(t, "subDetail", name, element, index);
2945    if (element.hasSequenceElement())
2946      composePositiveInt(t, "Claim", "sequence", element.getSequenceElement(), -1);
2947    if (element.hasRevenue())
2948      composeCodeableConcept(t, "Claim", "revenue", element.getRevenue(), -1);
2949    if (element.hasCategory())
2950      composeCodeableConcept(t, "Claim", "category", element.getCategory(), -1);
2951    if (element.hasService())
2952      composeCodeableConcept(t, "Claim", "service", element.getService(), -1);
2953    for (int i = 0; i < element.getModifier().size(); i++)
2954      composeCodeableConcept(t, "Claim", "modifier", element.getModifier().get(i), i);
2955    for (int i = 0; i < element.getProgramCode().size(); i++)
2956      composeCodeableConcept(t, "Claim", "programCode", element.getProgramCode().get(i), i);
2957    if (element.hasQuantity())
2958      composeQuantity(t, "Claim", "quantity", element.getQuantity(), -1);
2959    if (element.hasUnitPrice())
2960      composeMoney(t, "Claim", "unitPrice", element.getUnitPrice(), -1);
2961    if (element.hasFactorElement())
2962      composeDecimal(t, "Claim", "factor", element.getFactorElement(), -1);
2963    if (element.hasNet())
2964      composeMoney(t, "Claim", "net", element.getNet(), -1);
2965    for (int i = 0; i < element.getUdi().size(); i++)
2966      composeReference(t, "Claim", "udi", element.getUdi().get(i), i);
2967  }
2968
2969  protected void composeClaimResponse(Complex parent, String parentType, String name, ClaimResponse element, int index) {
2970    if (element == null) 
2971      return;
2972    Complex t;
2973    if (Utilities.noString(parentType))
2974      t = parent;
2975    else {
2976      t = parent.predicate("fhir:"+parentType+'.'+name);
2977    }
2978    composeDomainResource(t, "ClaimResponse", name, element, index);
2979    for (int i = 0; i < element.getIdentifier().size(); i++)
2980      composeIdentifier(t, "ClaimResponse", "identifier", element.getIdentifier().get(i), i);
2981    if (element.hasStatusElement())
2982      composeEnum(t, "ClaimResponse", "status", element.getStatusElement(), -1);
2983    if (element.hasPatient())
2984      composeReference(t, "ClaimResponse", "patient", element.getPatient(), -1);
2985    if (element.hasCreatedElement())
2986      composeDateTime(t, "ClaimResponse", "created", element.getCreatedElement(), -1);
2987    if (element.hasInsurer())
2988      composeReference(t, "ClaimResponse", "insurer", element.getInsurer(), -1);
2989    if (element.hasRequestProvider())
2990      composeReference(t, "ClaimResponse", "requestProvider", element.getRequestProvider(), -1);
2991    if (element.hasRequestOrganization())
2992      composeReference(t, "ClaimResponse", "requestOrganization", element.getRequestOrganization(), -1);
2993    if (element.hasRequest())
2994      composeReference(t, "ClaimResponse", "request", element.getRequest(), -1);
2995    if (element.hasOutcome())
2996      composeCodeableConcept(t, "ClaimResponse", "outcome", element.getOutcome(), -1);
2997    if (element.hasDispositionElement())
2998      composeString(t, "ClaimResponse", "disposition", element.getDispositionElement(), -1);
2999    if (element.hasPayeeType())
3000      composeCodeableConcept(t, "ClaimResponse", "payeeType", element.getPayeeType(), -1);
3001    for (int i = 0; i < element.getItem().size(); i++)
3002      composeClaimResponseItemComponent(t, "ClaimResponse", "item", element.getItem().get(i), i);
3003    for (int i = 0; i < element.getAddItem().size(); i++)
3004      composeClaimResponseAddedItemComponent(t, "ClaimResponse", "addItem", element.getAddItem().get(i), i);
3005    for (int i = 0; i < element.getError().size(); i++)
3006      composeClaimResponseErrorComponent(t, "ClaimResponse", "error", element.getError().get(i), i);
3007    if (element.hasTotalCost())
3008      composeMoney(t, "ClaimResponse", "totalCost", element.getTotalCost(), -1);
3009    if (element.hasUnallocDeductable())
3010      composeMoney(t, "ClaimResponse", "unallocDeductable", element.getUnallocDeductable(), -1);
3011    if (element.hasTotalBenefit())
3012      composeMoney(t, "ClaimResponse", "totalBenefit", element.getTotalBenefit(), -1);
3013    if (element.hasPayment())
3014      composeClaimResponsePaymentComponent(t, "ClaimResponse", "payment", element.getPayment(), -1);
3015    if (element.hasReserved())
3016      composeCoding(t, "ClaimResponse", "reserved", element.getReserved(), -1);
3017    if (element.hasForm())
3018      composeCodeableConcept(t, "ClaimResponse", "form", element.getForm(), -1);
3019    for (int i = 0; i < element.getProcessNote().size(); i++)
3020      composeClaimResponseNoteComponent(t, "ClaimResponse", "processNote", element.getProcessNote().get(i), i);
3021    for (int i = 0; i < element.getCommunicationRequest().size(); i++)
3022      composeReference(t, "ClaimResponse", "communicationRequest", element.getCommunicationRequest().get(i), i);
3023    for (int i = 0; i < element.getInsurance().size(); i++)
3024      composeClaimResponseInsuranceComponent(t, "ClaimResponse", "insurance", element.getInsurance().get(i), i);
3025  }
3026
3027  protected void composeClaimResponseItemComponent(Complex parent, String parentType, String name, ClaimResponse.ItemComponent element, int index) {
3028    if (element == null) 
3029      return;
3030    Complex t;
3031    if (Utilities.noString(parentType))
3032      t = parent;
3033    else {
3034      t = parent.predicate("fhir:"+parentType+'.'+name);
3035    }
3036    composeBackboneElement(t, "item", name, element, index);
3037    if (element.hasSequenceLinkIdElement())
3038      composePositiveInt(t, "ClaimResponse", "sequenceLinkId", element.getSequenceLinkIdElement(), -1);
3039    for (int i = 0; i < element.getNoteNumber().size(); i++)
3040      composePositiveInt(t, "ClaimResponse", "noteNumber", element.getNoteNumber().get(i), i);
3041    for (int i = 0; i < element.getAdjudication().size(); i++)
3042      composeClaimResponseAdjudicationComponent(t, "ClaimResponse", "adjudication", element.getAdjudication().get(i), i);
3043    for (int i = 0; i < element.getDetail().size(); i++)
3044      composeClaimResponseItemDetailComponent(t, "ClaimResponse", "detail", element.getDetail().get(i), i);
3045  }
3046
3047  protected void composeClaimResponseAdjudicationComponent(Complex parent, String parentType, String name, ClaimResponse.AdjudicationComponent element, int index) {
3048    if (element == null) 
3049      return;
3050    Complex t;
3051    if (Utilities.noString(parentType))
3052      t = parent;
3053    else {
3054      t = parent.predicate("fhir:"+parentType+'.'+name);
3055    }
3056    composeBackboneElement(t, "adjudication", name, element, index);
3057    if (element.hasCategory())
3058      composeCodeableConcept(t, "ClaimResponse", "category", element.getCategory(), -1);
3059    if (element.hasReason())
3060      composeCodeableConcept(t, "ClaimResponse", "reason", element.getReason(), -1);
3061    if (element.hasAmount())
3062      composeMoney(t, "ClaimResponse", "amount", element.getAmount(), -1);
3063    if (element.hasValueElement())
3064      composeDecimal(t, "ClaimResponse", "value", element.getValueElement(), -1);
3065  }
3066
3067  protected void composeClaimResponseItemDetailComponent(Complex parent, String parentType, String name, ClaimResponse.ItemDetailComponent element, int index) {
3068    if (element == null) 
3069      return;
3070    Complex t;
3071    if (Utilities.noString(parentType))
3072      t = parent;
3073    else {
3074      t = parent.predicate("fhir:"+parentType+'.'+name);
3075    }
3076    composeBackboneElement(t, "detail", name, element, index);
3077    if (element.hasSequenceLinkIdElement())
3078      composePositiveInt(t, "ClaimResponse", "sequenceLinkId", element.getSequenceLinkIdElement(), -1);
3079    for (int i = 0; i < element.getNoteNumber().size(); i++)
3080      composePositiveInt(t, "ClaimResponse", "noteNumber", element.getNoteNumber().get(i), i);
3081    for (int i = 0; i < element.getAdjudication().size(); i++)
3082      composeClaimResponseAdjudicationComponent(t, "ClaimResponse", "adjudication", element.getAdjudication().get(i), i);
3083    for (int i = 0; i < element.getSubDetail().size(); i++)
3084      composeClaimResponseSubDetailComponent(t, "ClaimResponse", "subDetail", element.getSubDetail().get(i), i);
3085  }
3086
3087  protected void composeClaimResponseSubDetailComponent(Complex parent, String parentType, String name, ClaimResponse.SubDetailComponent element, int index) {
3088    if (element == null) 
3089      return;
3090    Complex t;
3091    if (Utilities.noString(parentType))
3092      t = parent;
3093    else {
3094      t = parent.predicate("fhir:"+parentType+'.'+name);
3095    }
3096    composeBackboneElement(t, "subDetail", name, element, index);
3097    if (element.hasSequenceLinkIdElement())
3098      composePositiveInt(t, "ClaimResponse", "sequenceLinkId", element.getSequenceLinkIdElement(), -1);
3099    for (int i = 0; i < element.getNoteNumber().size(); i++)
3100      composePositiveInt(t, "ClaimResponse", "noteNumber", element.getNoteNumber().get(i), i);
3101    for (int i = 0; i < element.getAdjudication().size(); i++)
3102      composeClaimResponseAdjudicationComponent(t, "ClaimResponse", "adjudication", element.getAdjudication().get(i), i);
3103  }
3104
3105  protected void composeClaimResponseAddedItemComponent(Complex parent, String parentType, String name, ClaimResponse.AddedItemComponent element, int index) {
3106    if (element == null) 
3107      return;
3108    Complex t;
3109    if (Utilities.noString(parentType))
3110      t = parent;
3111    else {
3112      t = parent.predicate("fhir:"+parentType+'.'+name);
3113    }
3114    composeBackboneElement(t, "addItem", name, element, index);
3115    for (int i = 0; i < element.getSequenceLinkId().size(); i++)
3116      composePositiveInt(t, "ClaimResponse", "sequenceLinkId", element.getSequenceLinkId().get(i), i);
3117    if (element.hasRevenue())
3118      composeCodeableConcept(t, "ClaimResponse", "revenue", element.getRevenue(), -1);
3119    if (element.hasCategory())
3120      composeCodeableConcept(t, "ClaimResponse", "category", element.getCategory(), -1);
3121    if (element.hasService())
3122      composeCodeableConcept(t, "ClaimResponse", "service", element.getService(), -1);
3123    for (int i = 0; i < element.getModifier().size(); i++)
3124      composeCodeableConcept(t, "ClaimResponse", "modifier", element.getModifier().get(i), i);
3125    if (element.hasFee())
3126      composeMoney(t, "ClaimResponse", "fee", element.getFee(), -1);
3127    for (int i = 0; i < element.getNoteNumber().size(); i++)
3128      composePositiveInt(t, "ClaimResponse", "noteNumber", element.getNoteNumber().get(i), i);
3129    for (int i = 0; i < element.getAdjudication().size(); i++)
3130      composeClaimResponseAdjudicationComponent(t, "ClaimResponse", "adjudication", element.getAdjudication().get(i), i);
3131    for (int i = 0; i < element.getDetail().size(); i++)
3132      composeClaimResponseAddedItemsDetailComponent(t, "ClaimResponse", "detail", element.getDetail().get(i), i);
3133  }
3134
3135  protected void composeClaimResponseAddedItemsDetailComponent(Complex parent, String parentType, String name, ClaimResponse.AddedItemsDetailComponent element, int index) {
3136    if (element == null) 
3137      return;
3138    Complex t;
3139    if (Utilities.noString(parentType))
3140      t = parent;
3141    else {
3142      t = parent.predicate("fhir:"+parentType+'.'+name);
3143    }
3144    composeBackboneElement(t, "detail", name, element, index);
3145    if (element.hasRevenue())
3146      composeCodeableConcept(t, "ClaimResponse", "revenue", element.getRevenue(), -1);
3147    if (element.hasCategory())
3148      composeCodeableConcept(t, "ClaimResponse", "category", element.getCategory(), -1);
3149    if (element.hasService())
3150      composeCodeableConcept(t, "ClaimResponse", "service", element.getService(), -1);
3151    for (int i = 0; i < element.getModifier().size(); i++)
3152      composeCodeableConcept(t, "ClaimResponse", "modifier", element.getModifier().get(i), i);
3153    if (element.hasFee())
3154      composeMoney(t, "ClaimResponse", "fee", element.getFee(), -1);
3155    for (int i = 0; i < element.getNoteNumber().size(); i++)
3156      composePositiveInt(t, "ClaimResponse", "noteNumber", element.getNoteNumber().get(i), i);
3157    for (int i = 0; i < element.getAdjudication().size(); i++)
3158      composeClaimResponseAdjudicationComponent(t, "ClaimResponse", "adjudication", element.getAdjudication().get(i), i);
3159  }
3160
3161  protected void composeClaimResponseErrorComponent(Complex parent, String parentType, String name, ClaimResponse.ErrorComponent element, int index) {
3162    if (element == null) 
3163      return;
3164    Complex t;
3165    if (Utilities.noString(parentType))
3166      t = parent;
3167    else {
3168      t = parent.predicate("fhir:"+parentType+'.'+name);
3169    }
3170    composeBackboneElement(t, "error", name, element, index);
3171    if (element.hasSequenceLinkIdElement())
3172      composePositiveInt(t, "ClaimResponse", "sequenceLinkId", element.getSequenceLinkIdElement(), -1);
3173    if (element.hasDetailSequenceLinkIdElement())
3174      composePositiveInt(t, "ClaimResponse", "detailSequenceLinkId", element.getDetailSequenceLinkIdElement(), -1);
3175    if (element.hasSubdetailSequenceLinkIdElement())
3176      composePositiveInt(t, "ClaimResponse", "subdetailSequenceLinkId", element.getSubdetailSequenceLinkIdElement(), -1);
3177    if (element.hasCode())
3178      composeCodeableConcept(t, "ClaimResponse", "code", element.getCode(), -1);
3179  }
3180
3181  protected void composeClaimResponsePaymentComponent(Complex parent, String parentType, String name, ClaimResponse.PaymentComponent element, int index) {
3182    if (element == null) 
3183      return;
3184    Complex t;
3185    if (Utilities.noString(parentType))
3186      t = parent;
3187    else {
3188      t = parent.predicate("fhir:"+parentType+'.'+name);
3189    }
3190    composeBackboneElement(t, "payment", name, element, index);
3191    if (element.hasType())
3192      composeCodeableConcept(t, "ClaimResponse", "type", element.getType(), -1);
3193    if (element.hasAdjustment())
3194      composeMoney(t, "ClaimResponse", "adjustment", element.getAdjustment(), -1);
3195    if (element.hasAdjustmentReason())
3196      composeCodeableConcept(t, "ClaimResponse", "adjustmentReason", element.getAdjustmentReason(), -1);
3197    if (element.hasDateElement())
3198      composeDate(t, "ClaimResponse", "date", element.getDateElement(), -1);
3199    if (element.hasAmount())
3200      composeMoney(t, "ClaimResponse", "amount", element.getAmount(), -1);
3201    if (element.hasIdentifier())
3202      composeIdentifier(t, "ClaimResponse", "identifier", element.getIdentifier(), -1);
3203  }
3204
3205  protected void composeClaimResponseNoteComponent(Complex parent, String parentType, String name, ClaimResponse.NoteComponent element, int index) {
3206    if (element == null) 
3207      return;
3208    Complex t;
3209    if (Utilities.noString(parentType))
3210      t = parent;
3211    else {
3212      t = parent.predicate("fhir:"+parentType+'.'+name);
3213    }
3214    composeBackboneElement(t, "processNote", name, element, index);
3215    if (element.hasNumberElement())
3216      composePositiveInt(t, "ClaimResponse", "number", element.getNumberElement(), -1);
3217    if (element.hasType())
3218      composeCodeableConcept(t, "ClaimResponse", "type", element.getType(), -1);
3219    if (element.hasTextElement())
3220      composeString(t, "ClaimResponse", "text", element.getTextElement(), -1);
3221    if (element.hasLanguage())
3222      composeCodeableConcept(t, "ClaimResponse", "language", element.getLanguage(), -1);
3223  }
3224
3225  protected void composeClaimResponseInsuranceComponent(Complex parent, String parentType, String name, ClaimResponse.InsuranceComponent element, int index) {
3226    if (element == null) 
3227      return;
3228    Complex t;
3229    if (Utilities.noString(parentType))
3230      t = parent;
3231    else {
3232      t = parent.predicate("fhir:"+parentType+'.'+name);
3233    }
3234    composeBackboneElement(t, "insurance", name, element, index);
3235    if (element.hasSequenceElement())
3236      composePositiveInt(t, "ClaimResponse", "sequence", element.getSequenceElement(), -1);
3237    if (element.hasFocalElement())
3238      composeBoolean(t, "ClaimResponse", "focal", element.getFocalElement(), -1);
3239    if (element.hasCoverage())
3240      composeReference(t, "ClaimResponse", "coverage", element.getCoverage(), -1);
3241    if (element.hasBusinessArrangementElement())
3242      composeString(t, "ClaimResponse", "businessArrangement", element.getBusinessArrangementElement(), -1);
3243    for (int i = 0; i < element.getPreAuthRef().size(); i++)
3244      composeString(t, "ClaimResponse", "preAuthRef", element.getPreAuthRef().get(i), i);
3245    if (element.hasClaimResponse())
3246      composeReference(t, "ClaimResponse", "claimResponse", element.getClaimResponse(), -1);
3247  }
3248
3249  protected void composeClinicalImpression(Complex parent, String parentType, String name, ClinicalImpression element, int index) {
3250    if (element == null) 
3251      return;
3252    Complex t;
3253    if (Utilities.noString(parentType))
3254      t = parent;
3255    else {
3256      t = parent.predicate("fhir:"+parentType+'.'+name);
3257    }
3258    composeDomainResource(t, "ClinicalImpression", name, element, index);
3259    for (int i = 0; i < element.getIdentifier().size(); i++)
3260      composeIdentifier(t, "ClinicalImpression", "identifier", element.getIdentifier().get(i), i);
3261    if (element.hasStatusElement())
3262      composeEnum(t, "ClinicalImpression", "status", element.getStatusElement(), -1);
3263    if (element.hasCode())
3264      composeCodeableConcept(t, "ClinicalImpression", "code", element.getCode(), -1);
3265    if (element.hasDescriptionElement())
3266      composeString(t, "ClinicalImpression", "description", element.getDescriptionElement(), -1);
3267    if (element.hasSubject())
3268      composeReference(t, "ClinicalImpression", "subject", element.getSubject(), -1);
3269    if (element.hasContext())
3270      composeReference(t, "ClinicalImpression", "context", element.getContext(), -1);
3271    if (element.hasEffective())
3272      composeType(t, "ClinicalImpression", "effective", element.getEffective(), -1);
3273    if (element.hasDateElement())
3274      composeDateTime(t, "ClinicalImpression", "date", element.getDateElement(), -1);
3275    if (element.hasAssessor())
3276      composeReference(t, "ClinicalImpression", "assessor", element.getAssessor(), -1);
3277    if (element.hasPrevious())
3278      composeReference(t, "ClinicalImpression", "previous", element.getPrevious(), -1);
3279    for (int i = 0; i < element.getProblem().size(); i++)
3280      composeReference(t, "ClinicalImpression", "problem", element.getProblem().get(i), i);
3281    for (int i = 0; i < element.getInvestigation().size(); i++)
3282      composeClinicalImpressionClinicalImpressionInvestigationComponent(t, "ClinicalImpression", "investigation", element.getInvestigation().get(i), i);
3283    for (int i = 0; i < element.getProtocol().size(); i++)
3284      composeUri(t, "ClinicalImpression", "protocol", element.getProtocol().get(i), i);
3285    if (element.hasSummaryElement())
3286      composeString(t, "ClinicalImpression", "summary", element.getSummaryElement(), -1);
3287    for (int i = 0; i < element.getFinding().size(); i++)
3288      composeClinicalImpressionClinicalImpressionFindingComponent(t, "ClinicalImpression", "finding", element.getFinding().get(i), i);
3289    for (int i = 0; i < element.getPrognosisCodeableConcept().size(); i++)
3290      composeCodeableConcept(t, "ClinicalImpression", "prognosisCodeableConcept", element.getPrognosisCodeableConcept().get(i), i);
3291    for (int i = 0; i < element.getPrognosisReference().size(); i++)
3292      composeReference(t, "ClinicalImpression", "prognosisReference", element.getPrognosisReference().get(i), i);
3293    for (int i = 0; i < element.getAction().size(); i++)
3294      composeReference(t, "ClinicalImpression", "action", element.getAction().get(i), i);
3295    for (int i = 0; i < element.getNote().size(); i++)
3296      composeAnnotation(t, "ClinicalImpression", "note", element.getNote().get(i), i);
3297  }
3298
3299  protected void composeClinicalImpressionClinicalImpressionInvestigationComponent(Complex parent, String parentType, String name, ClinicalImpression.ClinicalImpressionInvestigationComponent element, int index) {
3300    if (element == null) 
3301      return;
3302    Complex t;
3303    if (Utilities.noString(parentType))
3304      t = parent;
3305    else {
3306      t = parent.predicate("fhir:"+parentType+'.'+name);
3307    }
3308    composeBackboneElement(t, "investigation", name, element, index);
3309    if (element.hasCode())
3310      composeCodeableConcept(t, "ClinicalImpression", "code", element.getCode(), -1);
3311    for (int i = 0; i < element.getItem().size(); i++)
3312      composeReference(t, "ClinicalImpression", "item", element.getItem().get(i), i);
3313  }
3314
3315  protected void composeClinicalImpressionClinicalImpressionFindingComponent(Complex parent, String parentType, String name, ClinicalImpression.ClinicalImpressionFindingComponent element, int index) {
3316    if (element == null) 
3317      return;
3318    Complex t;
3319    if (Utilities.noString(parentType))
3320      t = parent;
3321    else {
3322      t = parent.predicate("fhir:"+parentType+'.'+name);
3323    }
3324    composeBackboneElement(t, "finding", name, element, index);
3325    if (element.hasItem())
3326      composeType(t, "ClinicalImpression", "item", element.getItem(), -1);
3327    if (element.hasBasisElement())
3328      composeString(t, "ClinicalImpression", "basis", element.getBasisElement(), -1);
3329  }
3330
3331  protected void composeCodeSystem(Complex parent, String parentType, String name, CodeSystem element, int index) {
3332    if (element == null) 
3333      return;
3334    Complex t;
3335    if (Utilities.noString(parentType))
3336      t = parent;
3337    else {
3338      t = parent.predicate("fhir:"+parentType+'.'+name);
3339    }
3340    composeDomainResource(t, "CodeSystem", name, element, index);
3341    if (element.hasUrlElement())
3342      composeUri(t, "CodeSystem", "url", element.getUrlElement(), -1);
3343    if (element.hasIdentifier())
3344      composeIdentifier(t, "CodeSystem", "identifier", element.getIdentifier(), -1);
3345    if (element.hasVersionElement())
3346      composeString(t, "CodeSystem", "version", element.getVersionElement(), -1);
3347    if (element.hasNameElement())
3348      composeString(t, "CodeSystem", "name", element.getNameElement(), -1);
3349    if (element.hasTitleElement())
3350      composeString(t, "CodeSystem", "title", element.getTitleElement(), -1);
3351    if (element.hasStatusElement())
3352      composeEnum(t, "CodeSystem", "status", element.getStatusElement(), -1);
3353    if (element.hasExperimentalElement())
3354      composeBoolean(t, "CodeSystem", "experimental", element.getExperimentalElement(), -1);
3355    if (element.hasDateElement())
3356      composeDateTime(t, "CodeSystem", "date", element.getDateElement(), -1);
3357    if (element.hasPublisherElement())
3358      composeString(t, "CodeSystem", "publisher", element.getPublisherElement(), -1);
3359    for (int i = 0; i < element.getContact().size(); i++)
3360      composeContactDetail(t, "CodeSystem", "contact", element.getContact().get(i), i);
3361    if (element.hasDescriptionElement())
3362      composeMarkdown(t, "CodeSystem", "description", element.getDescriptionElement(), -1);
3363    for (int i = 0; i < element.getUseContext().size(); i++)
3364      composeUsageContext(t, "CodeSystem", "useContext", element.getUseContext().get(i), i);
3365    for (int i = 0; i < element.getJurisdiction().size(); i++)
3366      composeCodeableConcept(t, "CodeSystem", "jurisdiction", element.getJurisdiction().get(i), i);
3367    if (element.hasPurposeElement())
3368      composeMarkdown(t, "CodeSystem", "purpose", element.getPurposeElement(), -1);
3369    if (element.hasCopyrightElement())
3370      composeMarkdown(t, "CodeSystem", "copyright", element.getCopyrightElement(), -1);
3371    if (element.hasCaseSensitiveElement())
3372      composeBoolean(t, "CodeSystem", "caseSensitive", element.getCaseSensitiveElement(), -1);
3373    if (element.hasValueSetElement())
3374      composeUri(t, "CodeSystem", "valueSet", element.getValueSetElement(), -1);
3375    if (element.hasHierarchyMeaningElement())
3376      composeEnum(t, "CodeSystem", "hierarchyMeaning", element.getHierarchyMeaningElement(), -1);
3377    if (element.hasCompositionalElement())
3378      composeBoolean(t, "CodeSystem", "compositional", element.getCompositionalElement(), -1);
3379    if (element.hasVersionNeededElement())
3380      composeBoolean(t, "CodeSystem", "versionNeeded", element.getVersionNeededElement(), -1);
3381    if (element.hasContentElement())
3382      composeEnum(t, "CodeSystem", "content", element.getContentElement(), -1);
3383    if (element.hasCountElement())
3384      composeUnsignedInt(t, "CodeSystem", "count", element.getCountElement(), -1);
3385    for (int i = 0; i < element.getFilter().size(); i++)
3386      composeCodeSystemCodeSystemFilterComponent(t, "CodeSystem", "filter", element.getFilter().get(i), i);
3387    for (int i = 0; i < element.getProperty().size(); i++)
3388      composeCodeSystemPropertyComponent(t, "CodeSystem", "property", element.getProperty().get(i), i);
3389    for (int i = 0; i < element.getConcept().size(); i++)
3390      composeCodeSystemConceptDefinitionComponent(t, "CodeSystem", "concept", element.getConcept().get(i), i);
3391  }
3392
3393  protected void composeCodeSystemCodeSystemFilterComponent(Complex parent, String parentType, String name, CodeSystem.CodeSystemFilterComponent element, int index) {
3394    if (element == null) 
3395      return;
3396    Complex t;
3397    if (Utilities.noString(parentType))
3398      t = parent;
3399    else {
3400      t = parent.predicate("fhir:"+parentType+'.'+name);
3401    }
3402    composeBackboneElement(t, "filter", name, element, index);
3403    if (element.hasCodeElement())
3404      composeCode(t, "CodeSystem", "code", element.getCodeElement(), -1);
3405    if (element.hasDescriptionElement())
3406      composeString(t, "CodeSystem", "description", element.getDescriptionElement(), -1);
3407    for (int i = 0; i < element.getOperator().size(); i++)
3408      composeEnum(t, "CodeSystem", "operator", element.getOperator().get(i), i);
3409    if (element.hasValueElement())
3410      composeString(t, "CodeSystem", "value", element.getValueElement(), -1);
3411  }
3412
3413  protected void composeCodeSystemPropertyComponent(Complex parent, String parentType, String name, CodeSystem.PropertyComponent element, int index) {
3414    if (element == null) 
3415      return;
3416    Complex t;
3417    if (Utilities.noString(parentType))
3418      t = parent;
3419    else {
3420      t = parent.predicate("fhir:"+parentType+'.'+name);
3421    }
3422    composeBackboneElement(t, "property", name, element, index);
3423    if (element.hasCodeElement())
3424      composeCode(t, "CodeSystem", "code", element.getCodeElement(), -1);
3425    if (element.hasUriElement())
3426      composeUri(t, "CodeSystem", "uri", element.getUriElement(), -1);
3427    if (element.hasDescriptionElement())
3428      composeString(t, "CodeSystem", "description", element.getDescriptionElement(), -1);
3429    if (element.hasTypeElement())
3430      composeEnum(t, "CodeSystem", "type", element.getTypeElement(), -1);
3431  }
3432
3433  protected void composeCodeSystemConceptDefinitionComponent(Complex parent, String parentType, String name, CodeSystem.ConceptDefinitionComponent element, int index) {
3434    if (element == null) 
3435      return;
3436    Complex t;
3437    if (Utilities.noString(parentType))
3438      t = parent;
3439    else {
3440      t = parent.predicate("fhir:"+parentType+'.'+name);
3441    }
3442    composeBackboneElement(t, "concept", name, element, index);
3443    if (element.hasCodeElement())
3444      composeCode(t, "CodeSystem", "code", element.getCodeElement(), -1);
3445    if (element.hasDisplayElement())
3446      composeString(t, "CodeSystem", "display", element.getDisplayElement(), -1);
3447    if (element.hasDefinitionElement())
3448      composeString(t, "CodeSystem", "definition", element.getDefinitionElement(), -1);
3449    for (int i = 0; i < element.getDesignation().size(); i++)
3450      composeCodeSystemConceptDefinitionDesignationComponent(t, "CodeSystem", "designation", element.getDesignation().get(i), i);
3451    for (int i = 0; i < element.getProperty().size(); i++)
3452      composeCodeSystemConceptPropertyComponent(t, "CodeSystem", "property", element.getProperty().get(i), i);
3453    for (int i = 0; i < element.getConcept().size(); i++)
3454      composeCodeSystemConceptDefinitionComponent(t, "CodeSystem", "concept", element.getConcept().get(i), i);
3455  }
3456
3457  protected void composeCodeSystemConceptDefinitionDesignationComponent(Complex parent, String parentType, String name, CodeSystem.ConceptDefinitionDesignationComponent element, int index) {
3458    if (element == null) 
3459      return;
3460    Complex t;
3461    if (Utilities.noString(parentType))
3462      t = parent;
3463    else {
3464      t = parent.predicate("fhir:"+parentType+'.'+name);
3465    }
3466    composeBackboneElement(t, "designation", name, element, index);
3467    if (element.hasLanguageElement())
3468      composeCode(t, "CodeSystem", "language", element.getLanguageElement(), -1);
3469    if (element.hasUse())
3470      composeCoding(t, "CodeSystem", "use", element.getUse(), -1);
3471    if (element.hasValueElement())
3472      composeString(t, "CodeSystem", "value", element.getValueElement(), -1);
3473  }
3474
3475  protected void composeCodeSystemConceptPropertyComponent(Complex parent, String parentType, String name, CodeSystem.ConceptPropertyComponent element, int index) {
3476    if (element == null) 
3477      return;
3478    Complex t;
3479    if (Utilities.noString(parentType))
3480      t = parent;
3481    else {
3482      t = parent.predicate("fhir:"+parentType+'.'+name);
3483    }
3484    composeBackboneElement(t, "property", name, element, index);
3485    if (element.hasCodeElement())
3486      composeCode(t, "CodeSystem", "code", element.getCodeElement(), -1);
3487    if (element.hasValue())
3488      composeType(t, "CodeSystem", "value", element.getValue(), -1);
3489  }
3490
3491  protected void composeCommunication(Complex parent, String parentType, String name, Communication element, int index) {
3492    if (element == null) 
3493      return;
3494    Complex t;
3495    if (Utilities.noString(parentType))
3496      t = parent;
3497    else {
3498      t = parent.predicate("fhir:"+parentType+'.'+name);
3499    }
3500    composeDomainResource(t, "Communication", name, element, index);
3501    for (int i = 0; i < element.getIdentifier().size(); i++)
3502      composeIdentifier(t, "Communication", "identifier", element.getIdentifier().get(i), i);
3503    for (int i = 0; i < element.getDefinition().size(); i++)
3504      composeReference(t, "Communication", "definition", element.getDefinition().get(i), i);
3505    for (int i = 0; i < element.getBasedOn().size(); i++)
3506      composeReference(t, "Communication", "basedOn", element.getBasedOn().get(i), i);
3507    for (int i = 0; i < element.getPartOf().size(); i++)
3508      composeReference(t, "Communication", "partOf", element.getPartOf().get(i), i);
3509    if (element.hasStatusElement())
3510      composeEnum(t, "Communication", "status", element.getStatusElement(), -1);
3511    if (element.hasNotDoneElement())
3512      composeBoolean(t, "Communication", "notDone", element.getNotDoneElement(), -1);
3513    if (element.hasNotDoneReason())
3514      composeCodeableConcept(t, "Communication", "notDoneReason", element.getNotDoneReason(), -1);
3515    for (int i = 0; i < element.getCategory().size(); i++)
3516      composeCodeableConcept(t, "Communication", "category", element.getCategory().get(i), i);
3517    for (int i = 0; i < element.getMedium().size(); i++)
3518      composeCodeableConcept(t, "Communication", "medium", element.getMedium().get(i), i);
3519    if (element.hasSubject())
3520      composeReference(t, "Communication", "subject", element.getSubject(), -1);
3521    for (int i = 0; i < element.getRecipient().size(); i++)
3522      composeReference(t, "Communication", "recipient", element.getRecipient().get(i), i);
3523    for (int i = 0; i < element.getTopic().size(); i++)
3524      composeReference(t, "Communication", "topic", element.getTopic().get(i), i);
3525    if (element.hasContext())
3526      composeReference(t, "Communication", "context", element.getContext(), -1);
3527    if (element.hasSentElement())
3528      composeDateTime(t, "Communication", "sent", element.getSentElement(), -1);
3529    if (element.hasReceivedElement())
3530      composeDateTime(t, "Communication", "received", element.getReceivedElement(), -1);
3531    if (element.hasSender())
3532      composeReference(t, "Communication", "sender", element.getSender(), -1);
3533    for (int i = 0; i < element.getReasonCode().size(); i++)
3534      composeCodeableConcept(t, "Communication", "reasonCode", element.getReasonCode().get(i), i);
3535    for (int i = 0; i < element.getReasonReference().size(); i++)
3536      composeReference(t, "Communication", "reasonReference", element.getReasonReference().get(i), i);
3537    for (int i = 0; i < element.getPayload().size(); i++)
3538      composeCommunicationCommunicationPayloadComponent(t, "Communication", "payload", element.getPayload().get(i), i);
3539    for (int i = 0; i < element.getNote().size(); i++)
3540      composeAnnotation(t, "Communication", "note", element.getNote().get(i), i);
3541  }
3542
3543  protected void composeCommunicationCommunicationPayloadComponent(Complex parent, String parentType, String name, Communication.CommunicationPayloadComponent element, int index) {
3544    if (element == null) 
3545      return;
3546    Complex t;
3547    if (Utilities.noString(parentType))
3548      t = parent;
3549    else {
3550      t = parent.predicate("fhir:"+parentType+'.'+name);
3551    }
3552    composeBackboneElement(t, "payload", name, element, index);
3553    if (element.hasContent())
3554      composeType(t, "Communication", "content", element.getContent(), -1);
3555  }
3556
3557  protected void composeCommunicationRequest(Complex parent, String parentType, String name, CommunicationRequest element, int index) {
3558    if (element == null) 
3559      return;
3560    Complex t;
3561    if (Utilities.noString(parentType))
3562      t = parent;
3563    else {
3564      t = parent.predicate("fhir:"+parentType+'.'+name);
3565    }
3566    composeDomainResource(t, "CommunicationRequest", name, element, index);
3567    for (int i = 0; i < element.getIdentifier().size(); i++)
3568      composeIdentifier(t, "CommunicationRequest", "identifier", element.getIdentifier().get(i), i);
3569    for (int i = 0; i < element.getBasedOn().size(); i++)
3570      composeReference(t, "CommunicationRequest", "basedOn", element.getBasedOn().get(i), i);
3571    for (int i = 0; i < element.getReplaces().size(); i++)
3572      composeReference(t, "CommunicationRequest", "replaces", element.getReplaces().get(i), i);
3573    if (element.hasGroupIdentifier())
3574      composeIdentifier(t, "CommunicationRequest", "groupIdentifier", element.getGroupIdentifier(), -1);
3575    if (element.hasStatusElement())
3576      composeEnum(t, "CommunicationRequest", "status", element.getStatusElement(), -1);
3577    for (int i = 0; i < element.getCategory().size(); i++)
3578      composeCodeableConcept(t, "CommunicationRequest", "category", element.getCategory().get(i), i);
3579    if (element.hasPriorityElement())
3580      composeEnum(t, "CommunicationRequest", "priority", element.getPriorityElement(), -1);
3581    for (int i = 0; i < element.getMedium().size(); i++)
3582      composeCodeableConcept(t, "CommunicationRequest", "medium", element.getMedium().get(i), i);
3583    if (element.hasSubject())
3584      composeReference(t, "CommunicationRequest", "subject", element.getSubject(), -1);
3585    for (int i = 0; i < element.getRecipient().size(); i++)
3586      composeReference(t, "CommunicationRequest", "recipient", element.getRecipient().get(i), i);
3587    for (int i = 0; i < element.getTopic().size(); i++)
3588      composeReference(t, "CommunicationRequest", "topic", element.getTopic().get(i), i);
3589    if (element.hasContext())
3590      composeReference(t, "CommunicationRequest", "context", element.getContext(), -1);
3591    for (int i = 0; i < element.getPayload().size(); i++)
3592      composeCommunicationRequestCommunicationRequestPayloadComponent(t, "CommunicationRequest", "payload", element.getPayload().get(i), i);
3593    if (element.hasOccurrence())
3594      composeType(t, "CommunicationRequest", "occurrence", element.getOccurrence(), -1);
3595    if (element.hasAuthoredOnElement())
3596      composeDateTime(t, "CommunicationRequest", "authoredOn", element.getAuthoredOnElement(), -1);
3597    if (element.hasSender())
3598      composeReference(t, "CommunicationRequest", "sender", element.getSender(), -1);
3599    if (element.hasRequester())
3600      composeCommunicationRequestCommunicationRequestRequesterComponent(t, "CommunicationRequest", "requester", element.getRequester(), -1);
3601    for (int i = 0; i < element.getReasonCode().size(); i++)
3602      composeCodeableConcept(t, "CommunicationRequest", "reasonCode", element.getReasonCode().get(i), i);
3603    for (int i = 0; i < element.getReasonReference().size(); i++)
3604      composeReference(t, "CommunicationRequest", "reasonReference", element.getReasonReference().get(i), i);
3605    for (int i = 0; i < element.getNote().size(); i++)
3606      composeAnnotation(t, "CommunicationRequest", "note", element.getNote().get(i), i);
3607  }
3608
3609  protected void composeCommunicationRequestCommunicationRequestPayloadComponent(Complex parent, String parentType, String name, CommunicationRequest.CommunicationRequestPayloadComponent element, int index) {
3610    if (element == null) 
3611      return;
3612    Complex t;
3613    if (Utilities.noString(parentType))
3614      t = parent;
3615    else {
3616      t = parent.predicate("fhir:"+parentType+'.'+name);
3617    }
3618    composeBackboneElement(t, "payload", name, element, index);
3619    if (element.hasContent())
3620      composeType(t, "CommunicationRequest", "content", element.getContent(), -1);
3621  }
3622
3623  protected void composeCommunicationRequestCommunicationRequestRequesterComponent(Complex parent, String parentType, String name, CommunicationRequest.CommunicationRequestRequesterComponent element, int index) {
3624    if (element == null) 
3625      return;
3626    Complex t;
3627    if (Utilities.noString(parentType))
3628      t = parent;
3629    else {
3630      t = parent.predicate("fhir:"+parentType+'.'+name);
3631    }
3632    composeBackboneElement(t, "requester", name, element, index);
3633    if (element.hasAgent())
3634      composeReference(t, "CommunicationRequest", "agent", element.getAgent(), -1);
3635    if (element.hasOnBehalfOf())
3636      composeReference(t, "CommunicationRequest", "onBehalfOf", element.getOnBehalfOf(), -1);
3637  }
3638
3639  protected void composeCompartmentDefinition(Complex parent, String parentType, String name, CompartmentDefinition element, int index) {
3640    if (element == null) 
3641      return;
3642    Complex t;
3643    if (Utilities.noString(parentType))
3644      t = parent;
3645    else {
3646      t = parent.predicate("fhir:"+parentType+'.'+name);
3647    }
3648    composeDomainResource(t, "CompartmentDefinition", name, element, index);
3649    if (element.hasUrlElement())
3650      composeUri(t, "CompartmentDefinition", "url", element.getUrlElement(), -1);
3651    if (element.hasNameElement())
3652      composeString(t, "CompartmentDefinition", "name", element.getNameElement(), -1);
3653    if (element.hasTitleElement())
3654      composeString(t, "CompartmentDefinition", "title", element.getTitleElement(), -1);
3655    if (element.hasStatusElement())
3656      composeEnum(t, "CompartmentDefinition", "status", element.getStatusElement(), -1);
3657    if (element.hasExperimentalElement())
3658      composeBoolean(t, "CompartmentDefinition", "experimental", element.getExperimentalElement(), -1);
3659    if (element.hasDateElement())
3660      composeDateTime(t, "CompartmentDefinition", "date", element.getDateElement(), -1);
3661    if (element.hasPublisherElement())
3662      composeString(t, "CompartmentDefinition", "publisher", element.getPublisherElement(), -1);
3663    for (int i = 0; i < element.getContact().size(); i++)
3664      composeContactDetail(t, "CompartmentDefinition", "contact", element.getContact().get(i), i);
3665    if (element.hasDescriptionElement())
3666      composeMarkdown(t, "CompartmentDefinition", "description", element.getDescriptionElement(), -1);
3667    if (element.hasPurposeElement())
3668      composeMarkdown(t, "CompartmentDefinition", "purpose", element.getPurposeElement(), -1);
3669    for (int i = 0; i < element.getUseContext().size(); i++)
3670      composeUsageContext(t, "CompartmentDefinition", "useContext", element.getUseContext().get(i), i);
3671    for (int i = 0; i < element.getJurisdiction().size(); i++)
3672      composeCodeableConcept(t, "CompartmentDefinition", "jurisdiction", element.getJurisdiction().get(i), i);
3673    if (element.hasCodeElement())
3674      composeEnum(t, "CompartmentDefinition", "code", element.getCodeElement(), -1);
3675    if (element.hasSearchElement())
3676      composeBoolean(t, "CompartmentDefinition", "search", element.getSearchElement(), -1);
3677    for (int i = 0; i < element.getResource().size(); i++)
3678      composeCompartmentDefinitionCompartmentDefinitionResourceComponent(t, "CompartmentDefinition", "resource", element.getResource().get(i), i);
3679  }
3680
3681  protected void composeCompartmentDefinitionCompartmentDefinitionResourceComponent(Complex parent, String parentType, String name, CompartmentDefinition.CompartmentDefinitionResourceComponent element, int index) {
3682    if (element == null) 
3683      return;
3684    Complex t;
3685    if (Utilities.noString(parentType))
3686      t = parent;
3687    else {
3688      t = parent.predicate("fhir:"+parentType+'.'+name);
3689    }
3690    composeBackboneElement(t, "resource", name, element, index);
3691    if (element.hasCodeElement())
3692      composeCode(t, "CompartmentDefinition", "code", element.getCodeElement(), -1);
3693    for (int i = 0; i < element.getParam().size(); i++)
3694      composeString(t, "CompartmentDefinition", "param", element.getParam().get(i), i);
3695    if (element.hasDocumentationElement())
3696      composeString(t, "CompartmentDefinition", "documentation", element.getDocumentationElement(), -1);
3697  }
3698
3699  protected void composeComposition(Complex parent, String parentType, String name, Composition element, int index) {
3700    if (element == null) 
3701      return;
3702    Complex t;
3703    if (Utilities.noString(parentType))
3704      t = parent;
3705    else {
3706      t = parent.predicate("fhir:"+parentType+'.'+name);
3707    }
3708    composeDomainResource(t, "Composition", name, element, index);
3709    if (element.hasIdentifier())
3710      composeIdentifier(t, "Composition", "identifier", element.getIdentifier(), -1);
3711    if (element.hasStatusElement())
3712      composeEnum(t, "Composition", "status", element.getStatusElement(), -1);
3713    if (element.hasType())
3714      composeCodeableConcept(t, "Composition", "type", element.getType(), -1);
3715    if (element.hasClass_())
3716      composeCodeableConcept(t, "Composition", "class", element.getClass_(), -1);
3717    if (element.hasSubject())
3718      composeReference(t, "Composition", "subject", element.getSubject(), -1);
3719    if (element.hasEncounter())
3720      composeReference(t, "Composition", "encounter", element.getEncounter(), -1);
3721    if (element.hasDateElement())
3722      composeDateTime(t, "Composition", "date", element.getDateElement(), -1);
3723    for (int i = 0; i < element.getAuthor().size(); i++)
3724      composeReference(t, "Composition", "author", element.getAuthor().get(i), i);
3725    if (element.hasTitleElement())
3726      composeString(t, "Composition", "title", element.getTitleElement(), -1);
3727    if (element.hasConfidentialityElement())
3728      composeEnum(t, "Composition", "confidentiality", element.getConfidentialityElement(), -1);
3729    for (int i = 0; i < element.getAttester().size(); i++)
3730      composeCompositionCompositionAttesterComponent(t, "Composition", "attester", element.getAttester().get(i), i);
3731    if (element.hasCustodian())
3732      composeReference(t, "Composition", "custodian", element.getCustodian(), -1);
3733    for (int i = 0; i < element.getRelatesTo().size(); i++)
3734      composeCompositionCompositionRelatesToComponent(t, "Composition", "relatesTo", element.getRelatesTo().get(i), i);
3735    for (int i = 0; i < element.getEvent().size(); i++)
3736      composeCompositionCompositionEventComponent(t, "Composition", "event", element.getEvent().get(i), i);
3737    for (int i = 0; i < element.getSection().size(); i++)
3738      composeCompositionSectionComponent(t, "Composition", "section", element.getSection().get(i), i);
3739  }
3740
3741  protected void composeCompositionCompositionAttesterComponent(Complex parent, String parentType, String name, Composition.CompositionAttesterComponent element, int index) {
3742    if (element == null) 
3743      return;
3744    Complex t;
3745    if (Utilities.noString(parentType))
3746      t = parent;
3747    else {
3748      t = parent.predicate("fhir:"+parentType+'.'+name);
3749    }
3750    composeBackboneElement(t, "attester", name, element, index);
3751    for (int i = 0; i < element.getMode().size(); i++)
3752      composeEnum(t, "Composition", "mode", element.getMode().get(i), i);
3753    if (element.hasTimeElement())
3754      composeDateTime(t, "Composition", "time", element.getTimeElement(), -1);
3755    if (element.hasParty())
3756      composeReference(t, "Composition", "party", element.getParty(), -1);
3757  }
3758
3759  protected void composeCompositionCompositionRelatesToComponent(Complex parent, String parentType, String name, Composition.CompositionRelatesToComponent element, int index) {
3760    if (element == null) 
3761      return;
3762    Complex t;
3763    if (Utilities.noString(parentType))
3764      t = parent;
3765    else {
3766      t = parent.predicate("fhir:"+parentType+'.'+name);
3767    }
3768    composeBackboneElement(t, "relatesTo", name, element, index);
3769    if (element.hasCodeElement())
3770      composeEnum(t, "Composition", "code", element.getCodeElement(), -1);
3771    if (element.hasTarget())
3772      composeType(t, "Composition", "target", element.getTarget(), -1);
3773  }
3774
3775  protected void composeCompositionCompositionEventComponent(Complex parent, String parentType, String name, Composition.CompositionEventComponent element, int index) {
3776    if (element == null) 
3777      return;
3778    Complex t;
3779    if (Utilities.noString(parentType))
3780      t = parent;
3781    else {
3782      t = parent.predicate("fhir:"+parentType+'.'+name);
3783    }
3784    composeBackboneElement(t, "event", name, element, index);
3785    for (int i = 0; i < element.getCode().size(); i++)
3786      composeCodeableConcept(t, "Composition", "code", element.getCode().get(i), i);
3787    if (element.hasPeriod())
3788      composePeriod(t, "Composition", "period", element.getPeriod(), -1);
3789    for (int i = 0; i < element.getDetail().size(); i++)
3790      composeReference(t, "Composition", "detail", element.getDetail().get(i), i);
3791  }
3792
3793  protected void composeCompositionSectionComponent(Complex parent, String parentType, String name, Composition.SectionComponent element, int index) {
3794    if (element == null) 
3795      return;
3796    Complex t;
3797    if (Utilities.noString(parentType))
3798      t = parent;
3799    else {
3800      t = parent.predicate("fhir:"+parentType+'.'+name);
3801    }
3802    composeBackboneElement(t, "section", name, element, index);
3803    if (element.hasTitleElement())
3804      composeString(t, "Composition", "title", element.getTitleElement(), -1);
3805    if (element.hasCode())
3806      composeCodeableConcept(t, "Composition", "code", element.getCode(), -1);
3807    if (element.hasText())
3808      composeNarrative(t, "Composition", "text", element.getText(), -1);
3809    if (element.hasModeElement())
3810      composeEnum(t, "Composition", "mode", element.getModeElement(), -1);
3811    if (element.hasOrderedBy())
3812      composeCodeableConcept(t, "Composition", "orderedBy", element.getOrderedBy(), -1);
3813    for (int i = 0; i < element.getEntry().size(); i++)
3814      composeReference(t, "Composition", "entry", element.getEntry().get(i), i);
3815    if (element.hasEmptyReason())
3816      composeCodeableConcept(t, "Composition", "emptyReason", element.getEmptyReason(), -1);
3817    for (int i = 0; i < element.getSection().size(); i++)
3818      composeCompositionSectionComponent(t, "Composition", "section", element.getSection().get(i), i);
3819  }
3820
3821  protected void composeConceptMap(Complex parent, String parentType, String name, ConceptMap element, int index) {
3822    if (element == null) 
3823      return;
3824    Complex t;
3825    if (Utilities.noString(parentType))
3826      t = parent;
3827    else {
3828      t = parent.predicate("fhir:"+parentType+'.'+name);
3829    }
3830    composeDomainResource(t, "ConceptMap", name, element, index);
3831    if (element.hasUrlElement())
3832      composeUri(t, "ConceptMap", "url", element.getUrlElement(), -1);
3833    if (element.hasIdentifier())
3834      composeIdentifier(t, "ConceptMap", "identifier", element.getIdentifier(), -1);
3835    if (element.hasVersionElement())
3836      composeString(t, "ConceptMap", "version", element.getVersionElement(), -1);
3837    if (element.hasNameElement())
3838      composeString(t, "ConceptMap", "name", element.getNameElement(), -1);
3839    if (element.hasTitleElement())
3840      composeString(t, "ConceptMap", "title", element.getTitleElement(), -1);
3841    if (element.hasStatusElement())
3842      composeEnum(t, "ConceptMap", "status", element.getStatusElement(), -1);
3843    if (element.hasExperimentalElement())
3844      composeBoolean(t, "ConceptMap", "experimental", element.getExperimentalElement(), -1);
3845    if (element.hasDateElement())
3846      composeDateTime(t, "ConceptMap", "date", element.getDateElement(), -1);
3847    if (element.hasPublisherElement())
3848      composeString(t, "ConceptMap", "publisher", element.getPublisherElement(), -1);
3849    for (int i = 0; i < element.getContact().size(); i++)
3850      composeContactDetail(t, "ConceptMap", "contact", element.getContact().get(i), i);
3851    if (element.hasDescriptionElement())
3852      composeMarkdown(t, "ConceptMap", "description", element.getDescriptionElement(), -1);
3853    for (int i = 0; i < element.getUseContext().size(); i++)
3854      composeUsageContext(t, "ConceptMap", "useContext", element.getUseContext().get(i), i);
3855    for (int i = 0; i < element.getJurisdiction().size(); i++)
3856      composeCodeableConcept(t, "ConceptMap", "jurisdiction", element.getJurisdiction().get(i), i);
3857    if (element.hasPurposeElement())
3858      composeMarkdown(t, "ConceptMap", "purpose", element.getPurposeElement(), -1);
3859    if (element.hasCopyrightElement())
3860      composeMarkdown(t, "ConceptMap", "copyright", element.getCopyrightElement(), -1);
3861    if (element.hasSource())
3862      composeType(t, "ConceptMap", "source", element.getSource(), -1);
3863    if (element.hasTarget())
3864      composeType(t, "ConceptMap", "target", element.getTarget(), -1);
3865    for (int i = 0; i < element.getGroup().size(); i++)
3866      composeConceptMapConceptMapGroupComponent(t, "ConceptMap", "group", element.getGroup().get(i), i);
3867  }
3868
3869  protected void composeConceptMapConceptMapGroupComponent(Complex parent, String parentType, String name, ConceptMap.ConceptMapGroupComponent element, int index) {
3870    if (element == null) 
3871      return;
3872    Complex t;
3873    if (Utilities.noString(parentType))
3874      t = parent;
3875    else {
3876      t = parent.predicate("fhir:"+parentType+'.'+name);
3877    }
3878    composeBackboneElement(t, "group", name, element, index);
3879    if (element.hasSourceElement())
3880      composeUri(t, "ConceptMap", "source", element.getSourceElement(), -1);
3881    if (element.hasSourceVersionElement())
3882      composeString(t, "ConceptMap", "sourceVersion", element.getSourceVersionElement(), -1);
3883    if (element.hasTargetElement())
3884      composeUri(t, "ConceptMap", "target", element.getTargetElement(), -1);
3885    if (element.hasTargetVersionElement())
3886      composeString(t, "ConceptMap", "targetVersion", element.getTargetVersionElement(), -1);
3887    for (int i = 0; i < element.getElement().size(); i++)
3888      composeConceptMapSourceElementComponent(t, "ConceptMap", "element", element.getElement().get(i), i);
3889    if (element.hasUnmapped())
3890      composeConceptMapConceptMapGroupUnmappedComponent(t, "ConceptMap", "unmapped", element.getUnmapped(), -1);
3891  }
3892
3893  protected void composeConceptMapSourceElementComponent(Complex parent, String parentType, String name, ConceptMap.SourceElementComponent element, int index) {
3894    if (element == null) 
3895      return;
3896    Complex t;
3897    if (Utilities.noString(parentType))
3898      t = parent;
3899    else {
3900      t = parent.predicate("fhir:"+parentType+'.'+name);
3901    }
3902    composeBackboneElement(t, "element", name, element, index);
3903    if (element.hasCodeElement())
3904      composeCode(t, "ConceptMap", "code", element.getCodeElement(), -1);
3905    if (element.hasDisplayElement())
3906      composeString(t, "ConceptMap", "display", element.getDisplayElement(), -1);
3907    for (int i = 0; i < element.getTarget().size(); i++)
3908      composeConceptMapTargetElementComponent(t, "ConceptMap", "target", element.getTarget().get(i), i);
3909  }
3910
3911  protected void composeConceptMapTargetElementComponent(Complex parent, String parentType, String name, ConceptMap.TargetElementComponent element, int index) {
3912    if (element == null) 
3913      return;
3914    Complex t;
3915    if (Utilities.noString(parentType))
3916      t = parent;
3917    else {
3918      t = parent.predicate("fhir:"+parentType+'.'+name);
3919    }
3920    composeBackboneElement(t, "target", name, element, index);
3921    if (element.hasCodeElement())
3922      composeCode(t, "ConceptMap", "code", element.getCodeElement(), -1);
3923    if (element.hasDisplayElement())
3924      composeString(t, "ConceptMap", "display", element.getDisplayElement(), -1);
3925    if (element.hasEquivalenceElement())
3926      composeEnum(t, "ConceptMap", "equivalence", element.getEquivalenceElement(), -1);
3927    if (element.hasCommentElement())
3928      composeString(t, "ConceptMap", "comment", element.getCommentElement(), -1);
3929    for (int i = 0; i < element.getDependsOn().size(); i++)
3930      composeConceptMapOtherElementComponent(t, "ConceptMap", "dependsOn", element.getDependsOn().get(i), i);
3931    for (int i = 0; i < element.getProduct().size(); i++)
3932      composeConceptMapOtherElementComponent(t, "ConceptMap", "product", element.getProduct().get(i), i);
3933  }
3934
3935  protected void composeConceptMapOtherElementComponent(Complex parent, String parentType, String name, ConceptMap.OtherElementComponent element, int index) {
3936    if (element == null) 
3937      return;
3938    Complex t;
3939    if (Utilities.noString(parentType))
3940      t = parent;
3941    else {
3942      t = parent.predicate("fhir:"+parentType+'.'+name);
3943    }
3944    composeBackboneElement(t, "dependsOn", name, element, index);
3945    if (element.hasPropertyElement())
3946      composeUri(t, "ConceptMap", "property", element.getPropertyElement(), -1);
3947    if (element.hasSystemElement())
3948      composeUri(t, "ConceptMap", "system", element.getSystemElement(), -1);
3949    if (element.hasCodeElement())
3950      composeString(t, "ConceptMap", "code", element.getCodeElement(), -1);
3951    if (element.hasDisplayElement())
3952      composeString(t, "ConceptMap", "display", element.getDisplayElement(), -1);
3953  }
3954
3955  protected void composeConceptMapConceptMapGroupUnmappedComponent(Complex parent, String parentType, String name, ConceptMap.ConceptMapGroupUnmappedComponent element, int index) {
3956    if (element == null) 
3957      return;
3958    Complex t;
3959    if (Utilities.noString(parentType))
3960      t = parent;
3961    else {
3962      t = parent.predicate("fhir:"+parentType+'.'+name);
3963    }
3964    composeBackboneElement(t, "unmapped", name, element, index);
3965    if (element.hasModeElement())
3966      composeEnum(t, "ConceptMap", "mode", element.getModeElement(), -1);
3967    if (element.hasCodeElement())
3968      composeCode(t, "ConceptMap", "code", element.getCodeElement(), -1);
3969    if (element.hasDisplayElement())
3970      composeString(t, "ConceptMap", "display", element.getDisplayElement(), -1);
3971    if (element.hasUrlElement())
3972      composeUri(t, "ConceptMap", "url", element.getUrlElement(), -1);
3973  }
3974
3975  protected void composeCondition(Complex parent, String parentType, String name, Condition element, int index) {
3976    if (element == null) 
3977      return;
3978    Complex t;
3979    if (Utilities.noString(parentType))
3980      t = parent;
3981    else {
3982      t = parent.predicate("fhir:"+parentType+'.'+name);
3983    }
3984    composeDomainResource(t, "Condition", name, element, index);
3985    for (int i = 0; i < element.getIdentifier().size(); i++)
3986      composeIdentifier(t, "Condition", "identifier", element.getIdentifier().get(i), i);
3987    if (element.hasClinicalStatusElement())
3988      composeEnum(t, "Condition", "clinicalStatus", element.getClinicalStatusElement(), -1);
3989    if (element.hasVerificationStatusElement())
3990      composeEnum(t, "Condition", "verificationStatus", element.getVerificationStatusElement(), -1);
3991    for (int i = 0; i < element.getCategory().size(); i++)
3992      composeCodeableConcept(t, "Condition", "category", element.getCategory().get(i), i);
3993    if (element.hasSeverity())
3994      composeCodeableConcept(t, "Condition", "severity", element.getSeverity(), -1);
3995    if (element.hasCode())
3996      composeCodeableConcept(t, "Condition", "code", element.getCode(), -1);
3997    for (int i = 0; i < element.getBodySite().size(); i++)
3998      composeCodeableConcept(t, "Condition", "bodySite", element.getBodySite().get(i), i);
3999    if (element.hasSubject())
4000      composeReference(t, "Condition", "subject", element.getSubject(), -1);
4001    if (element.hasContext())
4002      composeReference(t, "Condition", "context", element.getContext(), -1);
4003    if (element.hasOnset())
4004      composeType(t, "Condition", "onset", element.getOnset(), -1);
4005    if (element.hasAbatement())
4006      composeType(t, "Condition", "abatement", element.getAbatement(), -1);
4007    if (element.hasAssertedDateElement())
4008      composeDateTime(t, "Condition", "assertedDate", element.getAssertedDateElement(), -1);
4009    if (element.hasAsserter())
4010      composeReference(t, "Condition", "asserter", element.getAsserter(), -1);
4011    if (element.hasStage())
4012      composeConditionConditionStageComponent(t, "Condition", "stage", element.getStage(), -1);
4013    for (int i = 0; i < element.getEvidence().size(); i++)
4014      composeConditionConditionEvidenceComponent(t, "Condition", "evidence", element.getEvidence().get(i), i);
4015    for (int i = 0; i < element.getNote().size(); i++)
4016      composeAnnotation(t, "Condition", "note", element.getNote().get(i), i);
4017  }
4018
4019  protected void composeConditionConditionStageComponent(Complex parent, String parentType, String name, Condition.ConditionStageComponent element, int index) {
4020    if (element == null) 
4021      return;
4022    Complex t;
4023    if (Utilities.noString(parentType))
4024      t = parent;
4025    else {
4026      t = parent.predicate("fhir:"+parentType+'.'+name);
4027    }
4028    composeBackboneElement(t, "stage", name, element, index);
4029    if (element.hasSummary())
4030      composeCodeableConcept(t, "Condition", "summary", element.getSummary(), -1);
4031    for (int i = 0; i < element.getAssessment().size(); i++)
4032      composeReference(t, "Condition", "assessment", element.getAssessment().get(i), i);
4033  }
4034
4035  protected void composeConditionConditionEvidenceComponent(Complex parent, String parentType, String name, Condition.ConditionEvidenceComponent element, int index) {
4036    if (element == null) 
4037      return;
4038    Complex t;
4039    if (Utilities.noString(parentType))
4040      t = parent;
4041    else {
4042      t = parent.predicate("fhir:"+parentType+'.'+name);
4043    }
4044    composeBackboneElement(t, "evidence", name, element, index);
4045    for (int i = 0; i < element.getCode().size(); i++)
4046      composeCodeableConcept(t, "Condition", "code", element.getCode().get(i), i);
4047    for (int i = 0; i < element.getDetail().size(); i++)
4048      composeReference(t, "Condition", "detail", element.getDetail().get(i), i);
4049  }
4050
4051  protected void composeConsent(Complex parent, String parentType, String name, Consent element, int index) {
4052    if (element == null) 
4053      return;
4054    Complex t;
4055    if (Utilities.noString(parentType))
4056      t = parent;
4057    else {
4058      t = parent.predicate("fhir:"+parentType+'.'+name);
4059    }
4060    composeDomainResource(t, "Consent", name, element, index);
4061    if (element.hasIdentifier())
4062      composeIdentifier(t, "Consent", "identifier", element.getIdentifier(), -1);
4063    if (element.hasStatusElement())
4064      composeEnum(t, "Consent", "status", element.getStatusElement(), -1);
4065    for (int i = 0; i < element.getCategory().size(); i++)
4066      composeCodeableConcept(t, "Consent", "category", element.getCategory().get(i), i);
4067    if (element.hasPatient())
4068      composeReference(t, "Consent", "patient", element.getPatient(), -1);
4069    if (element.hasPeriod())
4070      composePeriod(t, "Consent", "period", element.getPeriod(), -1);
4071    if (element.hasDateTimeElement())
4072      composeDateTime(t, "Consent", "dateTime", element.getDateTimeElement(), -1);
4073    for (int i = 0; i < element.getConsentingParty().size(); i++)
4074      composeReference(t, "Consent", "consentingParty", element.getConsentingParty().get(i), i);
4075    for (int i = 0; i < element.getActor().size(); i++)
4076      composeConsentConsentActorComponent(t, "Consent", "actor", element.getActor().get(i), i);
4077    for (int i = 0; i < element.getAction().size(); i++)
4078      composeCodeableConcept(t, "Consent", "action", element.getAction().get(i), i);
4079    for (int i = 0; i < element.getOrganization().size(); i++)
4080      composeReference(t, "Consent", "organization", element.getOrganization().get(i), i);
4081    if (element.hasSource())
4082      composeType(t, "Consent", "source", element.getSource(), -1);
4083    for (int i = 0; i < element.getPolicy().size(); i++)
4084      composeConsentConsentPolicyComponent(t, "Consent", "policy", element.getPolicy().get(i), i);
4085    if (element.hasPolicyRuleElement())
4086      composeUri(t, "Consent", "policyRule", element.getPolicyRuleElement(), -1);
4087    for (int i = 0; i < element.getSecurityLabel().size(); i++)
4088      composeCoding(t, "Consent", "securityLabel", element.getSecurityLabel().get(i), i);
4089    for (int i = 0; i < element.getPurpose().size(); i++)
4090      composeCoding(t, "Consent", "purpose", element.getPurpose().get(i), i);
4091    if (element.hasDataPeriod())
4092      composePeriod(t, "Consent", "dataPeriod", element.getDataPeriod(), -1);
4093    for (int i = 0; i < element.getData().size(); i++)
4094      composeConsentConsentDataComponent(t, "Consent", "data", element.getData().get(i), i);
4095    for (int i = 0; i < element.getExcept().size(); i++)
4096      composeConsentExceptComponent(t, "Consent", "except", element.getExcept().get(i), i);
4097  }
4098
4099  protected void composeConsentConsentActorComponent(Complex parent, String parentType, String name, Consent.ConsentActorComponent element, int index) {
4100    if (element == null) 
4101      return;
4102    Complex t;
4103    if (Utilities.noString(parentType))
4104      t = parent;
4105    else {
4106      t = parent.predicate("fhir:"+parentType+'.'+name);
4107    }
4108    composeBackboneElement(t, "actor", name, element, index);
4109    if (element.hasRole())
4110      composeCodeableConcept(t, "Consent", "role", element.getRole(), -1);
4111    if (element.hasReference())
4112      composeReference(t, "Consent", "reference", element.getReference(), -1);
4113  }
4114
4115  protected void composeConsentConsentPolicyComponent(Complex parent, String parentType, String name, Consent.ConsentPolicyComponent element, int index) {
4116    if (element == null) 
4117      return;
4118    Complex t;
4119    if (Utilities.noString(parentType))
4120      t = parent;
4121    else {
4122      t = parent.predicate("fhir:"+parentType+'.'+name);
4123    }
4124    composeBackboneElement(t, "policy", name, element, index);
4125    if (element.hasAuthorityElement())
4126      composeUri(t, "Consent", "authority", element.getAuthorityElement(), -1);
4127    if (element.hasUriElement())
4128      composeUri(t, "Consent", "uri", element.getUriElement(), -1);
4129  }
4130
4131  protected void composeConsentConsentDataComponent(Complex parent, String parentType, String name, Consent.ConsentDataComponent element, int index) {
4132    if (element == null) 
4133      return;
4134    Complex t;
4135    if (Utilities.noString(parentType))
4136      t = parent;
4137    else {
4138      t = parent.predicate("fhir:"+parentType+'.'+name);
4139    }
4140    composeBackboneElement(t, "data", name, element, index);
4141    if (element.hasMeaningElement())
4142      composeEnum(t, "Consent", "meaning", element.getMeaningElement(), -1);
4143    if (element.hasReference())
4144      composeReference(t, "Consent", "reference", element.getReference(), -1);
4145  }
4146
4147  protected void composeConsentExceptComponent(Complex parent, String parentType, String name, Consent.ExceptComponent 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, "except", name, element, index);
4157    if (element.hasTypeElement())
4158      composeEnum(t, "Consent", "type", element.getTypeElement(), -1);
4159    if (element.hasPeriod())
4160      composePeriod(t, "Consent", "period", element.getPeriod(), -1);
4161    for (int i = 0; i < element.getActor().size(); i++)
4162      composeConsentExceptActorComponent(t, "Consent", "actor", element.getActor().get(i), i);
4163    for (int i = 0; i < element.getAction().size(); i++)
4164      composeCodeableConcept(t, "Consent", "action", element.getAction().get(i), i);
4165    for (int i = 0; i < element.getSecurityLabel().size(); i++)
4166      composeCoding(t, "Consent", "securityLabel", element.getSecurityLabel().get(i), i);
4167    for (int i = 0; i < element.getPurpose().size(); i++)
4168      composeCoding(t, "Consent", "purpose", element.getPurpose().get(i), i);
4169    for (int i = 0; i < element.getClass_().size(); i++)
4170      composeCoding(t, "Consent", "class", element.getClass_().get(i), i);
4171    for (int i = 0; i < element.getCode().size(); i++)
4172      composeCoding(t, "Consent", "code", element.getCode().get(i), i);
4173    if (element.hasDataPeriod())
4174      composePeriod(t, "Consent", "dataPeriod", element.getDataPeriod(), -1);
4175    for (int i = 0; i < element.getData().size(); i++)
4176      composeConsentExceptDataComponent(t, "Consent", "data", element.getData().get(i), i);
4177  }
4178
4179  protected void composeConsentExceptActorComponent(Complex parent, String parentType, String name, Consent.ExceptActorComponent element, int index) {
4180    if (element == null) 
4181      return;
4182    Complex t;
4183    if (Utilities.noString(parentType))
4184      t = parent;
4185    else {
4186      t = parent.predicate("fhir:"+parentType+'.'+name);
4187    }
4188    composeBackboneElement(t, "actor", name, element, index);
4189    if (element.hasRole())
4190      composeCodeableConcept(t, "Consent", "role", element.getRole(), -1);
4191    if (element.hasReference())
4192      composeReference(t, "Consent", "reference", element.getReference(), -1);
4193  }
4194
4195  protected void composeConsentExceptDataComponent(Complex parent, String parentType, String name, Consent.ExceptDataComponent element, int index) {
4196    if (element == null) 
4197      return;
4198    Complex t;
4199    if (Utilities.noString(parentType))
4200      t = parent;
4201    else {
4202      t = parent.predicate("fhir:"+parentType+'.'+name);
4203    }
4204    composeBackboneElement(t, "data", name, element, index);
4205    if (element.hasMeaningElement())
4206      composeEnum(t, "Consent", "meaning", element.getMeaningElement(), -1);
4207    if (element.hasReference())
4208      composeReference(t, "Consent", "reference", element.getReference(), -1);
4209  }
4210
4211  protected void composeContract(Complex parent, String parentType, String name, Contract element, int index) {
4212    if (element == null) 
4213      return;
4214    Complex t;
4215    if (Utilities.noString(parentType))
4216      t = parent;
4217    else {
4218      t = parent.predicate("fhir:"+parentType+'.'+name);
4219    }
4220    composeDomainResource(t, "Contract", name, element, index);
4221    if (element.hasIdentifier())
4222      composeIdentifier(t, "Contract", "identifier", element.getIdentifier(), -1);
4223    if (element.hasStatusElement())
4224      composeEnum(t, "Contract", "status", element.getStatusElement(), -1);
4225    if (element.hasIssuedElement())
4226      composeDateTime(t, "Contract", "issued", element.getIssuedElement(), -1);
4227    if (element.hasApplies())
4228      composePeriod(t, "Contract", "applies", element.getApplies(), -1);
4229    for (int i = 0; i < element.getSubject().size(); i++)
4230      composeReference(t, "Contract", "subject", element.getSubject().get(i), i);
4231    for (int i = 0; i < element.getTopic().size(); i++)
4232      composeReference(t, "Contract", "topic", element.getTopic().get(i), i);
4233    for (int i = 0; i < element.getAuthority().size(); i++)
4234      composeReference(t, "Contract", "authority", element.getAuthority().get(i), i);
4235    for (int i = 0; i < element.getDomain().size(); i++)
4236      composeReference(t, "Contract", "domain", element.getDomain().get(i), i);
4237    if (element.hasType())
4238      composeCodeableConcept(t, "Contract", "type", element.getType(), -1);
4239    for (int i = 0; i < element.getSubType().size(); i++)
4240      composeCodeableConcept(t, "Contract", "subType", element.getSubType().get(i), i);
4241    for (int i = 0; i < element.getAction().size(); i++)
4242      composeCodeableConcept(t, "Contract", "action", element.getAction().get(i), i);
4243    for (int i = 0; i < element.getActionReason().size(); i++)
4244      composeCodeableConcept(t, "Contract", "actionReason", element.getActionReason().get(i), i);
4245    if (element.hasDecisionType())
4246      composeCodeableConcept(t, "Contract", "decisionType", element.getDecisionType(), -1);
4247    if (element.hasContentDerivative())
4248      composeCodeableConcept(t, "Contract", "contentDerivative", element.getContentDerivative(), -1);
4249    for (int i = 0; i < element.getSecurityLabel().size(); i++)
4250      composeCoding(t, "Contract", "securityLabel", element.getSecurityLabel().get(i), i);
4251    for (int i = 0; i < element.getAgent().size(); i++)
4252      composeContractAgentComponent(t, "Contract", "agent", element.getAgent().get(i), i);
4253    for (int i = 0; i < element.getSigner().size(); i++)
4254      composeContractSignatoryComponent(t, "Contract", "signer", element.getSigner().get(i), i);
4255    for (int i = 0; i < element.getValuedItem().size(); i++)
4256      composeContractValuedItemComponent(t, "Contract", "valuedItem", element.getValuedItem().get(i), i);
4257    for (int i = 0; i < element.getTerm().size(); i++)
4258      composeContractTermComponent(t, "Contract", "term", element.getTerm().get(i), i);
4259    if (element.hasBinding())
4260      composeType(t, "Contract", "binding", element.getBinding(), -1);
4261    for (int i = 0; i < element.getFriendly().size(); i++)
4262      composeContractFriendlyLanguageComponent(t, "Contract", "friendly", element.getFriendly().get(i), i);
4263    for (int i = 0; i < element.getLegal().size(); i++)
4264      composeContractLegalLanguageComponent(t, "Contract", "legal", element.getLegal().get(i), i);
4265    for (int i = 0; i < element.getRule().size(); i++)
4266      composeContractComputableLanguageComponent(t, "Contract", "rule", element.getRule().get(i), i);
4267  }
4268
4269  protected void composeContractAgentComponent(Complex parent, String parentType, String name, Contract.AgentComponent element, int index) {
4270    if (element == null) 
4271      return;
4272    Complex t;
4273    if (Utilities.noString(parentType))
4274      t = parent;
4275    else {
4276      t = parent.predicate("fhir:"+parentType+'.'+name);
4277    }
4278    composeBackboneElement(t, "agent", name, element, index);
4279    if (element.hasActor())
4280      composeReference(t, "Contract", "actor", element.getActor(), -1);
4281    for (int i = 0; i < element.getRole().size(); i++)
4282      composeCodeableConcept(t, "Contract", "role", element.getRole().get(i), i);
4283  }
4284
4285  protected void composeContractSignatoryComponent(Complex parent, String parentType, String name, Contract.SignatoryComponent element, int index) {
4286    if (element == null) 
4287      return;
4288    Complex t;
4289    if (Utilities.noString(parentType))
4290      t = parent;
4291    else {
4292      t = parent.predicate("fhir:"+parentType+'.'+name);
4293    }
4294    composeBackboneElement(t, "signer", name, element, index);
4295    if (element.hasType())
4296      composeCoding(t, "Contract", "type", element.getType(), -1);
4297    if (element.hasParty())
4298      composeReference(t, "Contract", "party", element.getParty(), -1);
4299    for (int i = 0; i < element.getSignature().size(); i++)
4300      composeSignature(t, "Contract", "signature", element.getSignature().get(i), i);
4301  }
4302
4303  protected void composeContractValuedItemComponent(Complex parent, String parentType, String name, Contract.ValuedItemComponent element, int index) {
4304    if (element == null) 
4305      return;
4306    Complex t;
4307    if (Utilities.noString(parentType))
4308      t = parent;
4309    else {
4310      t = parent.predicate("fhir:"+parentType+'.'+name);
4311    }
4312    composeBackboneElement(t, "valuedItem", name, element, index);
4313    if (element.hasEntity())
4314      composeType(t, "Contract", "entity", element.getEntity(), -1);
4315    if (element.hasIdentifier())
4316      composeIdentifier(t, "Contract", "identifier", element.getIdentifier(), -1);
4317    if (element.hasEffectiveTimeElement())
4318      composeDateTime(t, "Contract", "effectiveTime", element.getEffectiveTimeElement(), -1);
4319    if (element.hasQuantity())
4320      composeQuantity(t, "Contract", "quantity", element.getQuantity(), -1);
4321    if (element.hasUnitPrice())
4322      composeMoney(t, "Contract", "unitPrice", element.getUnitPrice(), -1);
4323    if (element.hasFactorElement())
4324      composeDecimal(t, "Contract", "factor", element.getFactorElement(), -1);
4325    if (element.hasPointsElement())
4326      composeDecimal(t, "Contract", "points", element.getPointsElement(), -1);
4327    if (element.hasNet())
4328      composeMoney(t, "Contract", "net", element.getNet(), -1);
4329  }
4330
4331  protected void composeContractTermComponent(Complex parent, String parentType, String name, Contract.TermComponent element, int index) {
4332    if (element == null) 
4333      return;
4334    Complex t;
4335    if (Utilities.noString(parentType))
4336      t = parent;
4337    else {
4338      t = parent.predicate("fhir:"+parentType+'.'+name);
4339    }
4340    composeBackboneElement(t, "term", name, element, index);
4341    if (element.hasIdentifier())
4342      composeIdentifier(t, "Contract", "identifier", element.getIdentifier(), -1);
4343    if (element.hasIssuedElement())
4344      composeDateTime(t, "Contract", "issued", element.getIssuedElement(), -1);
4345    if (element.hasApplies())
4346      composePeriod(t, "Contract", "applies", element.getApplies(), -1);
4347    if (element.hasType())
4348      composeCodeableConcept(t, "Contract", "type", element.getType(), -1);
4349    if (element.hasSubType())
4350      composeCodeableConcept(t, "Contract", "subType", element.getSubType(), -1);
4351    for (int i = 0; i < element.getTopic().size(); i++)
4352      composeReference(t, "Contract", "topic", element.getTopic().get(i), i);
4353    for (int i = 0; i < element.getAction().size(); i++)
4354      composeCodeableConcept(t, "Contract", "action", element.getAction().get(i), i);
4355    for (int i = 0; i < element.getActionReason().size(); i++)
4356      composeCodeableConcept(t, "Contract", "actionReason", element.getActionReason().get(i), i);
4357    for (int i = 0; i < element.getSecurityLabel().size(); i++)
4358      composeCoding(t, "Contract", "securityLabel", element.getSecurityLabel().get(i), i);
4359    for (int i = 0; i < element.getAgent().size(); i++)
4360      composeContractTermAgentComponent(t, "Contract", "agent", element.getAgent().get(i), i);
4361    if (element.hasTextElement())
4362      composeString(t, "Contract", "text", element.getTextElement(), -1);
4363    for (int i = 0; i < element.getValuedItem().size(); i++)
4364      composeContractTermValuedItemComponent(t, "Contract", "valuedItem", element.getValuedItem().get(i), i);
4365    for (int i = 0; i < element.getGroup().size(); i++)
4366      composeContractTermComponent(t, "Contract", "group", element.getGroup().get(i), i);
4367  }
4368
4369  protected void composeContractTermAgentComponent(Complex parent, String parentType, String name, Contract.TermAgentComponent element, int index) {
4370    if (element == null) 
4371      return;
4372    Complex t;
4373    if (Utilities.noString(parentType))
4374      t = parent;
4375    else {
4376      t = parent.predicate("fhir:"+parentType+'.'+name);
4377    }
4378    composeBackboneElement(t, "agent", name, element, index);
4379    if (element.hasActor())
4380      composeReference(t, "Contract", "actor", element.getActor(), -1);
4381    for (int i = 0; i < element.getRole().size(); i++)
4382      composeCodeableConcept(t, "Contract", "role", element.getRole().get(i), i);
4383  }
4384
4385  protected void composeContractTermValuedItemComponent(Complex parent, String parentType, String name, Contract.TermValuedItemComponent element, int index) {
4386    if (element == null) 
4387      return;
4388    Complex t;
4389    if (Utilities.noString(parentType))
4390      t = parent;
4391    else {
4392      t = parent.predicate("fhir:"+parentType+'.'+name);
4393    }
4394    composeBackboneElement(t, "valuedItem", name, element, index);
4395    if (element.hasEntity())
4396      composeType(t, "Contract", "entity", element.getEntity(), -1);
4397    if (element.hasIdentifier())
4398      composeIdentifier(t, "Contract", "identifier", element.getIdentifier(), -1);
4399    if (element.hasEffectiveTimeElement())
4400      composeDateTime(t, "Contract", "effectiveTime", element.getEffectiveTimeElement(), -1);
4401    if (element.hasQuantity())
4402      composeQuantity(t, "Contract", "quantity", element.getQuantity(), -1);
4403    if (element.hasUnitPrice())
4404      composeMoney(t, "Contract", "unitPrice", element.getUnitPrice(), -1);
4405    if (element.hasFactorElement())
4406      composeDecimal(t, "Contract", "factor", element.getFactorElement(), -1);
4407    if (element.hasPointsElement())
4408      composeDecimal(t, "Contract", "points", element.getPointsElement(), -1);
4409    if (element.hasNet())
4410      composeMoney(t, "Contract", "net", element.getNet(), -1);
4411  }
4412
4413  protected void composeContractFriendlyLanguageComponent(Complex parent, String parentType, String name, Contract.FriendlyLanguageComponent element, int index) {
4414    if (element == null) 
4415      return;
4416    Complex t;
4417    if (Utilities.noString(parentType))
4418      t = parent;
4419    else {
4420      t = parent.predicate("fhir:"+parentType+'.'+name);
4421    }
4422    composeBackboneElement(t, "friendly", name, element, index);
4423    if (element.hasContent())
4424      composeType(t, "Contract", "content", element.getContent(), -1);
4425  }
4426
4427  protected void composeContractLegalLanguageComponent(Complex parent, String parentType, String name, Contract.LegalLanguageComponent element, int index) {
4428    if (element == null) 
4429      return;
4430    Complex t;
4431    if (Utilities.noString(parentType))
4432      t = parent;
4433    else {
4434      t = parent.predicate("fhir:"+parentType+'.'+name);
4435    }
4436    composeBackboneElement(t, "legal", name, element, index);
4437    if (element.hasContent())
4438      composeType(t, "Contract", "content", element.getContent(), -1);
4439  }
4440
4441  protected void composeContractComputableLanguageComponent(Complex parent, String parentType, String name, Contract.ComputableLanguageComponent element, int index) {
4442    if (element == null) 
4443      return;
4444    Complex t;
4445    if (Utilities.noString(parentType))
4446      t = parent;
4447    else {
4448      t = parent.predicate("fhir:"+parentType+'.'+name);
4449    }
4450    composeBackboneElement(t, "rule", name, element, index);
4451    if (element.hasContent())
4452      composeType(t, "Contract", "content", element.getContent(), -1);
4453  }
4454
4455  protected void composeCoverage(Complex parent, String parentType, String name, Coverage element, int index) {
4456    if (element == null) 
4457      return;
4458    Complex t;
4459    if (Utilities.noString(parentType))
4460      t = parent;
4461    else {
4462      t = parent.predicate("fhir:"+parentType+'.'+name);
4463    }
4464    composeDomainResource(t, "Coverage", name, element, index);
4465    for (int i = 0; i < element.getIdentifier().size(); i++)
4466      composeIdentifier(t, "Coverage", "identifier", element.getIdentifier().get(i), i);
4467    if (element.hasStatusElement())
4468      composeEnum(t, "Coverage", "status", element.getStatusElement(), -1);
4469    if (element.hasType())
4470      composeCodeableConcept(t, "Coverage", "type", element.getType(), -1);
4471    if (element.hasPolicyHolder())
4472      composeReference(t, "Coverage", "policyHolder", element.getPolicyHolder(), -1);
4473    if (element.hasSubscriber())
4474      composeReference(t, "Coverage", "subscriber", element.getSubscriber(), -1);
4475    if (element.hasSubscriberIdElement())
4476      composeString(t, "Coverage", "subscriberId", element.getSubscriberIdElement(), -1);
4477    if (element.hasBeneficiary())
4478      composeReference(t, "Coverage", "beneficiary", element.getBeneficiary(), -1);
4479    if (element.hasRelationship())
4480      composeCodeableConcept(t, "Coverage", "relationship", element.getRelationship(), -1);
4481    if (element.hasPeriod())
4482      composePeriod(t, "Coverage", "period", element.getPeriod(), -1);
4483    for (int i = 0; i < element.getPayor().size(); i++)
4484      composeReference(t, "Coverage", "payor", element.getPayor().get(i), i);
4485    if (element.hasGrouping())
4486      composeCoverageGroupComponent(t, "Coverage", "grouping", element.getGrouping(), -1);
4487    if (element.hasDependentElement())
4488      composeString(t, "Coverage", "dependent", element.getDependentElement(), -1);
4489    if (element.hasSequenceElement())
4490      composeString(t, "Coverage", "sequence", element.getSequenceElement(), -1);
4491    if (element.hasOrderElement())
4492      composePositiveInt(t, "Coverage", "order", element.getOrderElement(), -1);
4493    if (element.hasNetworkElement())
4494      composeString(t, "Coverage", "network", element.getNetworkElement(), -1);
4495    for (int i = 0; i < element.getContract().size(); i++)
4496      composeReference(t, "Coverage", "contract", element.getContract().get(i), i);
4497  }
4498
4499  protected void composeCoverageGroupComponent(Complex parent, String parentType, String name, Coverage.GroupComponent element, int index) {
4500    if (element == null) 
4501      return;
4502    Complex t;
4503    if (Utilities.noString(parentType))
4504      t = parent;
4505    else {
4506      t = parent.predicate("fhir:"+parentType+'.'+name);
4507    }
4508    composeBackboneElement(t, "grouping", name, element, index);
4509    if (element.hasGroupElement())
4510      composeString(t, "Coverage", "group", element.getGroupElement(), -1);
4511    if (element.hasGroupDisplayElement())
4512      composeString(t, "Coverage", "groupDisplay", element.getGroupDisplayElement(), -1);
4513    if (element.hasSubGroupElement())
4514      composeString(t, "Coverage", "subGroup", element.getSubGroupElement(), -1);
4515    if (element.hasSubGroupDisplayElement())
4516      composeString(t, "Coverage", "subGroupDisplay", element.getSubGroupDisplayElement(), -1);
4517    if (element.hasPlanElement())
4518      composeString(t, "Coverage", "plan", element.getPlanElement(), -1);
4519    if (element.hasPlanDisplayElement())
4520      composeString(t, "Coverage", "planDisplay", element.getPlanDisplayElement(), -1);
4521    if (element.hasSubPlanElement())
4522      composeString(t, "Coverage", "subPlan", element.getSubPlanElement(), -1);
4523    if (element.hasSubPlanDisplayElement())
4524      composeString(t, "Coverage", "subPlanDisplay", element.getSubPlanDisplayElement(), -1);
4525    if (element.hasClass_Element())
4526      composeString(t, "Coverage", "class", element.getClass_Element(), -1);
4527    if (element.hasClassDisplayElement())
4528      composeString(t, "Coverage", "classDisplay", element.getClassDisplayElement(), -1);
4529    if (element.hasSubClassElement())
4530      composeString(t, "Coverage", "subClass", element.getSubClassElement(), -1);
4531    if (element.hasSubClassDisplayElement())
4532      composeString(t, "Coverage", "subClassDisplay", element.getSubClassDisplayElement(), -1);
4533  }
4534
4535  protected void composeDataElement(Complex parent, String parentType, String name, DataElement element, int index) {
4536    if (element == null) 
4537      return;
4538    Complex t;
4539    if (Utilities.noString(parentType))
4540      t = parent;
4541    else {
4542      t = parent.predicate("fhir:"+parentType+'.'+name);
4543    }
4544    composeDomainResource(t, "DataElement", name, element, index);
4545    if (element.hasUrlElement())
4546      composeUri(t, "DataElement", "url", element.getUrlElement(), -1);
4547    for (int i = 0; i < element.getIdentifier().size(); i++)
4548      composeIdentifier(t, "DataElement", "identifier", element.getIdentifier().get(i), i);
4549    if (element.hasVersionElement())
4550      composeString(t, "DataElement", "version", element.getVersionElement(), -1);
4551    if (element.hasStatusElement())
4552      composeEnum(t, "DataElement", "status", element.getStatusElement(), -1);
4553    if (element.hasExperimentalElement())
4554      composeBoolean(t, "DataElement", "experimental", element.getExperimentalElement(), -1);
4555    if (element.hasDateElement())
4556      composeDateTime(t, "DataElement", "date", element.getDateElement(), -1);
4557    if (element.hasPublisherElement())
4558      composeString(t, "DataElement", "publisher", element.getPublisherElement(), -1);
4559    if (element.hasNameElement())
4560      composeString(t, "DataElement", "name", element.getNameElement(), -1);
4561    if (element.hasTitleElement())
4562      composeString(t, "DataElement", "title", element.getTitleElement(), -1);
4563    for (int i = 0; i < element.getContact().size(); i++)
4564      composeContactDetail(t, "DataElement", "contact", element.getContact().get(i), i);
4565    for (int i = 0; i < element.getUseContext().size(); i++)
4566      composeUsageContext(t, "DataElement", "useContext", element.getUseContext().get(i), i);
4567    for (int i = 0; i < element.getJurisdiction().size(); i++)
4568      composeCodeableConcept(t, "DataElement", "jurisdiction", element.getJurisdiction().get(i), i);
4569    if (element.hasCopyrightElement())
4570      composeMarkdown(t, "DataElement", "copyright", element.getCopyrightElement(), -1);
4571    if (element.hasStringencyElement())
4572      composeEnum(t, "DataElement", "stringency", element.getStringencyElement(), -1);
4573    for (int i = 0; i < element.getMapping().size(); i++)
4574      composeDataElementDataElementMappingComponent(t, "DataElement", "mapping", element.getMapping().get(i), i);
4575    for (int i = 0; i < element.getElement().size(); i++)
4576      composeElementDefinition(t, "DataElement", "element", element.getElement().get(i), i);
4577  }
4578
4579  protected void composeDataElementDataElementMappingComponent(Complex parent, String parentType, String name, DataElement.DataElementMappingComponent element, int index) {
4580    if (element == null) 
4581      return;
4582    Complex t;
4583    if (Utilities.noString(parentType))
4584      t = parent;
4585    else {
4586      t = parent.predicate("fhir:"+parentType+'.'+name);
4587    }
4588    composeBackboneElement(t, "mapping", name, element, index);
4589    if (element.hasIdentityElement())
4590      composeId(t, "DataElement", "identity", element.getIdentityElement(), -1);
4591    if (element.hasUriElement())
4592      composeUri(t, "DataElement", "uri", element.getUriElement(), -1);
4593    if (element.hasNameElement())
4594      composeString(t, "DataElement", "name", element.getNameElement(), -1);
4595    if (element.hasCommentElement())
4596      composeString(t, "DataElement", "comment", element.getCommentElement(), -1);
4597  }
4598
4599  protected void composeDetectedIssue(Complex parent, String parentType, String name, DetectedIssue element, int index) {
4600    if (element == null) 
4601      return;
4602    Complex t;
4603    if (Utilities.noString(parentType))
4604      t = parent;
4605    else {
4606      t = parent.predicate("fhir:"+parentType+'.'+name);
4607    }
4608    composeDomainResource(t, "DetectedIssue", name, element, index);
4609    if (element.hasIdentifier())
4610      composeIdentifier(t, "DetectedIssue", "identifier", element.getIdentifier(), -1);
4611    if (element.hasStatusElement())
4612      composeEnum(t, "DetectedIssue", "status", element.getStatusElement(), -1);
4613    if (element.hasCategory())
4614      composeCodeableConcept(t, "DetectedIssue", "category", element.getCategory(), -1);
4615    if (element.hasSeverityElement())
4616      composeEnum(t, "DetectedIssue", "severity", element.getSeverityElement(), -1);
4617    if (element.hasPatient())
4618      composeReference(t, "DetectedIssue", "patient", element.getPatient(), -1);
4619    if (element.hasDateElement())
4620      composeDateTime(t, "DetectedIssue", "date", element.getDateElement(), -1);
4621    if (element.hasAuthor())
4622      composeReference(t, "DetectedIssue", "author", element.getAuthor(), -1);
4623    for (int i = 0; i < element.getImplicated().size(); i++)
4624      composeReference(t, "DetectedIssue", "implicated", element.getImplicated().get(i), i);
4625    if (element.hasDetailElement())
4626      composeString(t, "DetectedIssue", "detail", element.getDetailElement(), -1);
4627    if (element.hasReferenceElement())
4628      composeUri(t, "DetectedIssue", "reference", element.getReferenceElement(), -1);
4629    for (int i = 0; i < element.getMitigation().size(); i++)
4630      composeDetectedIssueDetectedIssueMitigationComponent(t, "DetectedIssue", "mitigation", element.getMitigation().get(i), i);
4631  }
4632
4633  protected void composeDetectedIssueDetectedIssueMitigationComponent(Complex parent, String parentType, String name, DetectedIssue.DetectedIssueMitigationComponent element, int index) {
4634    if (element == null) 
4635      return;
4636    Complex t;
4637    if (Utilities.noString(parentType))
4638      t = parent;
4639    else {
4640      t = parent.predicate("fhir:"+parentType+'.'+name);
4641    }
4642    composeBackboneElement(t, "mitigation", name, element, index);
4643    if (element.hasAction())
4644      composeCodeableConcept(t, "DetectedIssue", "action", element.getAction(), -1);
4645    if (element.hasDateElement())
4646      composeDateTime(t, "DetectedIssue", "date", element.getDateElement(), -1);
4647    if (element.hasAuthor())
4648      composeReference(t, "DetectedIssue", "author", element.getAuthor(), -1);
4649  }
4650
4651  protected void composeDevice(Complex parent, String parentType, String name, Device element, int index) {
4652    if (element == null) 
4653      return;
4654    Complex t;
4655    if (Utilities.noString(parentType))
4656      t = parent;
4657    else {
4658      t = parent.predicate("fhir:"+parentType+'.'+name);
4659    }
4660    composeDomainResource(t, "Device", name, element, index);
4661    for (int i = 0; i < element.getIdentifier().size(); i++)
4662      composeIdentifier(t, "Device", "identifier", element.getIdentifier().get(i), i);
4663    if (element.hasUdi())
4664      composeDeviceDeviceUdiComponent(t, "Device", "udi", element.getUdi(), -1);
4665    if (element.hasStatusElement())
4666      composeEnum(t, "Device", "status", element.getStatusElement(), -1);
4667    if (element.hasType())
4668      composeCodeableConcept(t, "Device", "type", element.getType(), -1);
4669    if (element.hasLotNumberElement())
4670      composeString(t, "Device", "lotNumber", element.getLotNumberElement(), -1);
4671    if (element.hasManufacturerElement())
4672      composeString(t, "Device", "manufacturer", element.getManufacturerElement(), -1);
4673    if (element.hasManufactureDateElement())
4674      composeDateTime(t, "Device", "manufactureDate", element.getManufactureDateElement(), -1);
4675    if (element.hasExpirationDateElement())
4676      composeDateTime(t, "Device", "expirationDate", element.getExpirationDateElement(), -1);
4677    if (element.hasModelElement())
4678      composeString(t, "Device", "model", element.getModelElement(), -1);
4679    if (element.hasVersionElement())
4680      composeString(t, "Device", "version", element.getVersionElement(), -1);
4681    if (element.hasPatient())
4682      composeReference(t, "Device", "patient", element.getPatient(), -1);
4683    if (element.hasOwner())
4684      composeReference(t, "Device", "owner", element.getOwner(), -1);
4685    for (int i = 0; i < element.getContact().size(); i++)
4686      composeContactPoint(t, "Device", "contact", element.getContact().get(i), i);
4687    if (element.hasLocation())
4688      composeReference(t, "Device", "location", element.getLocation(), -1);
4689    if (element.hasUrlElement())
4690      composeUri(t, "Device", "url", element.getUrlElement(), -1);
4691    for (int i = 0; i < element.getNote().size(); i++)
4692      composeAnnotation(t, "Device", "note", element.getNote().get(i), i);
4693    for (int i = 0; i < element.getSafety().size(); i++)
4694      composeCodeableConcept(t, "Device", "safety", element.getSafety().get(i), i);
4695  }
4696
4697  protected void composeDeviceDeviceUdiComponent(Complex parent, String parentType, String name, Device.DeviceUdiComponent element, int index) {
4698    if (element == null) 
4699      return;
4700    Complex t;
4701    if (Utilities.noString(parentType))
4702      t = parent;
4703    else {
4704      t = parent.predicate("fhir:"+parentType+'.'+name);
4705    }
4706    composeBackboneElement(t, "udi", name, element, index);
4707    if (element.hasDeviceIdentifierElement())
4708      composeString(t, "Device", "deviceIdentifier", element.getDeviceIdentifierElement(), -1);
4709    if (element.hasNameElement())
4710      composeString(t, "Device", "name", element.getNameElement(), -1);
4711    if (element.hasJurisdictionElement())
4712      composeUri(t, "Device", "jurisdiction", element.getJurisdictionElement(), -1);
4713    if (element.hasCarrierHRFElement())
4714      composeString(t, "Device", "carrierHRF", element.getCarrierHRFElement(), -1);
4715    if (element.hasCarrierAIDCElement())
4716      composeBase64Binary(t, "Device", "carrierAIDC", element.getCarrierAIDCElement(), -1);
4717    if (element.hasIssuerElement())
4718      composeUri(t, "Device", "issuer", element.getIssuerElement(), -1);
4719    if (element.hasEntryTypeElement())
4720      composeEnum(t, "Device", "entryType", element.getEntryTypeElement(), -1);
4721  }
4722
4723  protected void composeDeviceComponent(Complex parent, String parentType, String name, DeviceComponent element, int index) {
4724    if (element == null) 
4725      return;
4726    Complex t;
4727    if (Utilities.noString(parentType))
4728      t = parent;
4729    else {
4730      t = parent.predicate("fhir:"+parentType+'.'+name);
4731    }
4732    composeDomainResource(t, "DeviceComponent", name, element, index);
4733    if (element.hasIdentifier())
4734      composeIdentifier(t, "DeviceComponent", "identifier", element.getIdentifier(), -1);
4735    if (element.hasType())
4736      composeCodeableConcept(t, "DeviceComponent", "type", element.getType(), -1);
4737    if (element.hasLastSystemChangeElement())
4738      composeInstant(t, "DeviceComponent", "lastSystemChange", element.getLastSystemChangeElement(), -1);
4739    if (element.hasSource())
4740      composeReference(t, "DeviceComponent", "source", element.getSource(), -1);
4741    if (element.hasParent())
4742      composeReference(t, "DeviceComponent", "parent", element.getParent(), -1);
4743    for (int i = 0; i < element.getOperationalStatus().size(); i++)
4744      composeCodeableConcept(t, "DeviceComponent", "operationalStatus", element.getOperationalStatus().get(i), i);
4745    if (element.hasParameterGroup())
4746      composeCodeableConcept(t, "DeviceComponent", "parameterGroup", element.getParameterGroup(), -1);
4747    if (element.hasMeasurementPrincipleElement())
4748      composeEnum(t, "DeviceComponent", "measurementPrinciple", element.getMeasurementPrincipleElement(), -1);
4749    for (int i = 0; i < element.getProductionSpecification().size(); i++)
4750      composeDeviceComponentDeviceComponentProductionSpecificationComponent(t, "DeviceComponent", "productionSpecification", element.getProductionSpecification().get(i), i);
4751    if (element.hasLanguageCode())
4752      composeCodeableConcept(t, "DeviceComponent", "languageCode", element.getLanguageCode(), -1);
4753  }
4754
4755  protected void composeDeviceComponentDeviceComponentProductionSpecificationComponent(Complex parent, String parentType, String name, DeviceComponent.DeviceComponentProductionSpecificationComponent element, int index) {
4756    if (element == null) 
4757      return;
4758    Complex t;
4759    if (Utilities.noString(parentType))
4760      t = parent;
4761    else {
4762      t = parent.predicate("fhir:"+parentType+'.'+name);
4763    }
4764    composeBackboneElement(t, "productionSpecification", name, element, index);
4765    if (element.hasSpecType())
4766      composeCodeableConcept(t, "DeviceComponent", "specType", element.getSpecType(), -1);
4767    if (element.hasComponentId())
4768      composeIdentifier(t, "DeviceComponent", "componentId", element.getComponentId(), -1);
4769    if (element.hasProductionSpecElement())
4770      composeString(t, "DeviceComponent", "productionSpec", element.getProductionSpecElement(), -1);
4771  }
4772
4773  protected void composeDeviceMetric(Complex parent, String parentType, String name, DeviceMetric element, int index) {
4774    if (element == null) 
4775      return;
4776    Complex t;
4777    if (Utilities.noString(parentType))
4778      t = parent;
4779    else {
4780      t = parent.predicate("fhir:"+parentType+'.'+name);
4781    }
4782    composeDomainResource(t, "DeviceMetric", name, element, index);
4783    if (element.hasIdentifier())
4784      composeIdentifier(t, "DeviceMetric", "identifier", element.getIdentifier(), -1);
4785    if (element.hasType())
4786      composeCodeableConcept(t, "DeviceMetric", "type", element.getType(), -1);
4787    if (element.hasUnit())
4788      composeCodeableConcept(t, "DeviceMetric", "unit", element.getUnit(), -1);
4789    if (element.hasSource())
4790      composeReference(t, "DeviceMetric", "source", element.getSource(), -1);
4791    if (element.hasParent())
4792      composeReference(t, "DeviceMetric", "parent", element.getParent(), -1);
4793    if (element.hasOperationalStatusElement())
4794      composeEnum(t, "DeviceMetric", "operationalStatus", element.getOperationalStatusElement(), -1);
4795    if (element.hasColorElement())
4796      composeEnum(t, "DeviceMetric", "color", element.getColorElement(), -1);
4797    if (element.hasCategoryElement())
4798      composeEnum(t, "DeviceMetric", "category", element.getCategoryElement(), -1);
4799    if (element.hasMeasurementPeriod())
4800      composeTiming(t, "DeviceMetric", "measurementPeriod", element.getMeasurementPeriod(), -1);
4801    for (int i = 0; i < element.getCalibration().size(); i++)
4802      composeDeviceMetricDeviceMetricCalibrationComponent(t, "DeviceMetric", "calibration", element.getCalibration().get(i), i);
4803  }
4804
4805  protected void composeDeviceMetricDeviceMetricCalibrationComponent(Complex parent, String parentType, String name, DeviceMetric.DeviceMetricCalibrationComponent element, int index) {
4806    if (element == null) 
4807      return;
4808    Complex t;
4809    if (Utilities.noString(parentType))
4810      t = parent;
4811    else {
4812      t = parent.predicate("fhir:"+parentType+'.'+name);
4813    }
4814    composeBackboneElement(t, "calibration", name, element, index);
4815    if (element.hasTypeElement())
4816      composeEnum(t, "DeviceMetric", "type", element.getTypeElement(), -1);
4817    if (element.hasStateElement())
4818      composeEnum(t, "DeviceMetric", "state", element.getStateElement(), -1);
4819    if (element.hasTimeElement())
4820      composeInstant(t, "DeviceMetric", "time", element.getTimeElement(), -1);
4821  }
4822
4823  protected void composeDeviceRequest(Complex parent, String parentType, String name, DeviceRequest element, int index) {
4824    if (element == null) 
4825      return;
4826    Complex t;
4827    if (Utilities.noString(parentType))
4828      t = parent;
4829    else {
4830      t = parent.predicate("fhir:"+parentType+'.'+name);
4831    }
4832    composeDomainResource(t, "DeviceRequest", name, element, index);
4833    for (int i = 0; i < element.getIdentifier().size(); i++)
4834      composeIdentifier(t, "DeviceRequest", "identifier", element.getIdentifier().get(i), i);
4835    for (int i = 0; i < element.getDefinition().size(); i++)
4836      composeReference(t, "DeviceRequest", "definition", element.getDefinition().get(i), i);
4837    for (int i = 0; i < element.getBasedOn().size(); i++)
4838      composeReference(t, "DeviceRequest", "basedOn", element.getBasedOn().get(i), i);
4839    for (int i = 0; i < element.getPriorRequest().size(); i++)
4840      composeReference(t, "DeviceRequest", "priorRequest", element.getPriorRequest().get(i), i);
4841    if (element.hasGroupIdentifier())
4842      composeIdentifier(t, "DeviceRequest", "groupIdentifier", element.getGroupIdentifier(), -1);
4843    if (element.hasStatusElement())
4844      composeEnum(t, "DeviceRequest", "status", element.getStatusElement(), -1);
4845    if (element.hasIntent())
4846      composeCodeableConcept(t, "DeviceRequest", "intent", element.getIntent(), -1);
4847    if (element.hasPriorityElement())
4848      composeEnum(t, "DeviceRequest", "priority", element.getPriorityElement(), -1);
4849    if (element.hasCode())
4850      composeType(t, "DeviceRequest", "code", element.getCode(), -1);
4851    if (element.hasSubject())
4852      composeReference(t, "DeviceRequest", "subject", element.getSubject(), -1);
4853    if (element.hasContext())
4854      composeReference(t, "DeviceRequest", "context", element.getContext(), -1);
4855    if (element.hasOccurrence())
4856      composeType(t, "DeviceRequest", "occurrence", element.getOccurrence(), -1);
4857    if (element.hasAuthoredOnElement())
4858      composeDateTime(t, "DeviceRequest", "authoredOn", element.getAuthoredOnElement(), -1);
4859    if (element.hasRequester())
4860      composeDeviceRequestDeviceRequestRequesterComponent(t, "DeviceRequest", "requester", element.getRequester(), -1);
4861    if (element.hasPerformerType())
4862      composeCodeableConcept(t, "DeviceRequest", "performerType", element.getPerformerType(), -1);
4863    if (element.hasPerformer())
4864      composeReference(t, "DeviceRequest", "performer", element.getPerformer(), -1);
4865    for (int i = 0; i < element.getReasonCode().size(); i++)
4866      composeCodeableConcept(t, "DeviceRequest", "reasonCode", element.getReasonCode().get(i), i);
4867    for (int i = 0; i < element.getReasonReference().size(); i++)
4868      composeReference(t, "DeviceRequest", "reasonReference", element.getReasonReference().get(i), i);
4869    for (int i = 0; i < element.getSupportingInfo().size(); i++)
4870      composeReference(t, "DeviceRequest", "supportingInfo", element.getSupportingInfo().get(i), i);
4871    for (int i = 0; i < element.getNote().size(); i++)
4872      composeAnnotation(t, "DeviceRequest", "note", element.getNote().get(i), i);
4873    for (int i = 0; i < element.getRelevantHistory().size(); i++)
4874      composeReference(t, "DeviceRequest", "relevantHistory", element.getRelevantHistory().get(i), i);
4875  }
4876
4877  protected void composeDeviceRequestDeviceRequestRequesterComponent(Complex parent, String parentType, String name, DeviceRequest.DeviceRequestRequesterComponent element, int index) {
4878    if (element == null) 
4879      return;
4880    Complex t;
4881    if (Utilities.noString(parentType))
4882      t = parent;
4883    else {
4884      t = parent.predicate("fhir:"+parentType+'.'+name);
4885    }
4886    composeBackboneElement(t, "requester", name, element, index);
4887    if (element.hasAgent())
4888      composeReference(t, "DeviceRequest", "agent", element.getAgent(), -1);
4889    if (element.hasOnBehalfOf())
4890      composeReference(t, "DeviceRequest", "onBehalfOf", element.getOnBehalfOf(), -1);
4891  }
4892
4893  protected void composeDeviceUseStatement(Complex parent, String parentType, String name, DeviceUseStatement element, int index) {
4894    if (element == null) 
4895      return;
4896    Complex t;
4897    if (Utilities.noString(parentType))
4898      t = parent;
4899    else {
4900      t = parent.predicate("fhir:"+parentType+'.'+name);
4901    }
4902    composeDomainResource(t, "DeviceUseStatement", name, element, index);
4903    for (int i = 0; i < element.getIdentifier().size(); i++)
4904      composeIdentifier(t, "DeviceUseStatement", "identifier", element.getIdentifier().get(i), i);
4905    if (element.hasStatusElement())
4906      composeEnum(t, "DeviceUseStatement", "status", element.getStatusElement(), -1);
4907    if (element.hasSubject())
4908      composeReference(t, "DeviceUseStatement", "subject", element.getSubject(), -1);
4909    if (element.hasWhenUsed())
4910      composePeriod(t, "DeviceUseStatement", "whenUsed", element.getWhenUsed(), -1);
4911    if (element.hasTiming())
4912      composeType(t, "DeviceUseStatement", "timing", element.getTiming(), -1);
4913    if (element.hasRecordedOnElement())
4914      composeDateTime(t, "DeviceUseStatement", "recordedOn", element.getRecordedOnElement(), -1);
4915    if (element.hasSource())
4916      composeReference(t, "DeviceUseStatement", "source", element.getSource(), -1);
4917    if (element.hasDevice())
4918      composeReference(t, "DeviceUseStatement", "device", element.getDevice(), -1);
4919    for (int i = 0; i < element.getIndication().size(); i++)
4920      composeCodeableConcept(t, "DeviceUseStatement", "indication", element.getIndication().get(i), i);
4921    if (element.hasBodySite())
4922      composeCodeableConcept(t, "DeviceUseStatement", "bodySite", element.getBodySite(), -1);
4923    for (int i = 0; i < element.getNote().size(); i++)
4924      composeAnnotation(t, "DeviceUseStatement", "note", element.getNote().get(i), i);
4925  }
4926
4927  protected void composeDiagnosticReport(Complex parent, String parentType, String name, DiagnosticReport element, int index) {
4928    if (element == null) 
4929      return;
4930    Complex t;
4931    if (Utilities.noString(parentType))
4932      t = parent;
4933    else {
4934      t = parent.predicate("fhir:"+parentType+'.'+name);
4935    }
4936    composeDomainResource(t, "DiagnosticReport", name, element, index);
4937    for (int i = 0; i < element.getIdentifier().size(); i++)
4938      composeIdentifier(t, "DiagnosticReport", "identifier", element.getIdentifier().get(i), i);
4939    for (int i = 0; i < element.getBasedOn().size(); i++)
4940      composeReference(t, "DiagnosticReport", "basedOn", element.getBasedOn().get(i), i);
4941    if (element.hasStatusElement())
4942      composeEnum(t, "DiagnosticReport", "status", element.getStatusElement(), -1);
4943    if (element.hasCategory())
4944      composeCodeableConcept(t, "DiagnosticReport", "category", element.getCategory(), -1);
4945    if (element.hasCode())
4946      composeCodeableConcept(t, "DiagnosticReport", "code", element.getCode(), -1);
4947    if (element.hasSubject())
4948      composeReference(t, "DiagnosticReport", "subject", element.getSubject(), -1);
4949    if (element.hasContext())
4950      composeReference(t, "DiagnosticReport", "context", element.getContext(), -1);
4951    if (element.hasEffective())
4952      composeType(t, "DiagnosticReport", "effective", element.getEffective(), -1);
4953    if (element.hasIssuedElement())
4954      composeInstant(t, "DiagnosticReport", "issued", element.getIssuedElement(), -1);
4955    for (int i = 0; i < element.getPerformer().size(); i++)
4956      composeDiagnosticReportDiagnosticReportPerformerComponent(t, "DiagnosticReport", "performer", element.getPerformer().get(i), i);
4957    for (int i = 0; i < element.getSpecimen().size(); i++)
4958      composeReference(t, "DiagnosticReport", "specimen", element.getSpecimen().get(i), i);
4959    for (int i = 0; i < element.getResult().size(); i++)
4960      composeReference(t, "DiagnosticReport", "result", element.getResult().get(i), i);
4961    for (int i = 0; i < element.getImagingStudy().size(); i++)
4962      composeReference(t, "DiagnosticReport", "imagingStudy", element.getImagingStudy().get(i), i);
4963    for (int i = 0; i < element.getImage().size(); i++)
4964      composeDiagnosticReportDiagnosticReportImageComponent(t, "DiagnosticReport", "image", element.getImage().get(i), i);
4965    if (element.hasConclusionElement())
4966      composeString(t, "DiagnosticReport", "conclusion", element.getConclusionElement(), -1);
4967    for (int i = 0; i < element.getCodedDiagnosis().size(); i++)
4968      composeCodeableConcept(t, "DiagnosticReport", "codedDiagnosis", element.getCodedDiagnosis().get(i), i);
4969    for (int i = 0; i < element.getPresentedForm().size(); i++)
4970      composeAttachment(t, "DiagnosticReport", "presentedForm", element.getPresentedForm().get(i), i);
4971  }
4972
4973  protected void composeDiagnosticReportDiagnosticReportPerformerComponent(Complex parent, String parentType, String name, DiagnosticReport.DiagnosticReportPerformerComponent element, int index) {
4974    if (element == null) 
4975      return;
4976    Complex t;
4977    if (Utilities.noString(parentType))
4978      t = parent;
4979    else {
4980      t = parent.predicate("fhir:"+parentType+'.'+name);
4981    }
4982    composeBackboneElement(t, "performer", name, element, index);
4983    if (element.hasRole())
4984      composeCodeableConcept(t, "DiagnosticReport", "role", element.getRole(), -1);
4985    if (element.hasActor())
4986      composeReference(t, "DiagnosticReport", "actor", element.getActor(), -1);
4987  }
4988
4989  protected void composeDiagnosticReportDiagnosticReportImageComponent(Complex parent, String parentType, String name, DiagnosticReport.DiagnosticReportImageComponent element, int index) {
4990    if (element == null) 
4991      return;
4992    Complex t;
4993    if (Utilities.noString(parentType))
4994      t = parent;
4995    else {
4996      t = parent.predicate("fhir:"+parentType+'.'+name);
4997    }
4998    composeBackboneElement(t, "image", name, element, index);
4999    if (element.hasCommentElement())
5000      composeString(t, "DiagnosticReport", "comment", element.getCommentElement(), -1);
5001    if (element.hasLink())
5002      composeReference(t, "DiagnosticReport", "link", element.getLink(), -1);
5003  }
5004
5005  protected void composeDocumentManifest(Complex parent, String parentType, String name, DocumentManifest element, int index) {
5006    if (element == null) 
5007      return;
5008    Complex t;
5009    if (Utilities.noString(parentType))
5010      t = parent;
5011    else {
5012      t = parent.predicate("fhir:"+parentType+'.'+name);
5013    }
5014    composeDomainResource(t, "DocumentManifest", name, element, index);
5015    if (element.hasMasterIdentifier())
5016      composeIdentifier(t, "DocumentManifest", "masterIdentifier", element.getMasterIdentifier(), -1);
5017    for (int i = 0; i < element.getIdentifier().size(); i++)
5018      composeIdentifier(t, "DocumentManifest", "identifier", element.getIdentifier().get(i), i);
5019    if (element.hasStatusElement())
5020      composeEnum(t, "DocumentManifest", "status", element.getStatusElement(), -1);
5021    if (element.hasType())
5022      composeCodeableConcept(t, "DocumentManifest", "type", element.getType(), -1);
5023    if (element.hasSubject())
5024      composeReference(t, "DocumentManifest", "subject", element.getSubject(), -1);
5025    if (element.hasCreatedElement())
5026      composeDateTime(t, "DocumentManifest", "created", element.getCreatedElement(), -1);
5027    for (int i = 0; i < element.getAuthor().size(); i++)
5028      composeReference(t, "DocumentManifest", "author", element.getAuthor().get(i), i);
5029    for (int i = 0; i < element.getRecipient().size(); i++)
5030      composeReference(t, "DocumentManifest", "recipient", element.getRecipient().get(i), i);
5031    if (element.hasSourceElement())
5032      composeUri(t, "DocumentManifest", "source", element.getSourceElement(), -1);
5033    if (element.hasDescriptionElement())
5034      composeString(t, "DocumentManifest", "description", element.getDescriptionElement(), -1);
5035    for (int i = 0; i < element.getContent().size(); i++)
5036      composeDocumentManifestDocumentManifestContentComponent(t, "DocumentManifest", "content", element.getContent().get(i), i);
5037    for (int i = 0; i < element.getRelated().size(); i++)
5038      composeDocumentManifestDocumentManifestRelatedComponent(t, "DocumentManifest", "related", element.getRelated().get(i), i);
5039  }
5040
5041  protected void composeDocumentManifestDocumentManifestContentComponent(Complex parent, String parentType, String name, DocumentManifest.DocumentManifestContentComponent element, int index) {
5042    if (element == null) 
5043      return;
5044    Complex t;
5045    if (Utilities.noString(parentType))
5046      t = parent;
5047    else {
5048      t = parent.predicate("fhir:"+parentType+'.'+name);
5049    }
5050    composeBackboneElement(t, "content", name, element, index);
5051    if (element.hasP())
5052      composeType(t, "DocumentManifest", "p", element.getP(), -1);
5053  }
5054
5055  protected void composeDocumentManifestDocumentManifestRelatedComponent(Complex parent, String parentType, String name, DocumentManifest.DocumentManifestRelatedComponent element, int index) {
5056    if (element == null) 
5057      return;
5058    Complex t;
5059    if (Utilities.noString(parentType))
5060      t = parent;
5061    else {
5062      t = parent.predicate("fhir:"+parentType+'.'+name);
5063    }
5064    composeBackboneElement(t, "related", name, element, index);
5065    if (element.hasIdentifier())
5066      composeIdentifier(t, "DocumentManifest", "identifier", element.getIdentifier(), -1);
5067    if (element.hasRef())
5068      composeReference(t, "DocumentManifest", "ref", element.getRef(), -1);
5069  }
5070
5071  protected void composeDocumentReference(Complex parent, String parentType, String name, DocumentReference element, int index) {
5072    if (element == null) 
5073      return;
5074    Complex t;
5075    if (Utilities.noString(parentType))
5076      t = parent;
5077    else {
5078      t = parent.predicate("fhir:"+parentType+'.'+name);
5079    }
5080    composeDomainResource(t, "DocumentReference", name, element, index);
5081    if (element.hasMasterIdentifier())
5082      composeIdentifier(t, "DocumentReference", "masterIdentifier", element.getMasterIdentifier(), -1);
5083    for (int i = 0; i < element.getIdentifier().size(); i++)
5084      composeIdentifier(t, "DocumentReference", "identifier", element.getIdentifier().get(i), i);
5085    if (element.hasStatusElement())
5086      composeEnum(t, "DocumentReference", "status", element.getStatusElement(), -1);
5087    if (element.hasDocStatusElement())
5088      composeEnum(t, "DocumentReference", "docStatus", element.getDocStatusElement(), -1);
5089    if (element.hasType())
5090      composeCodeableConcept(t, "DocumentReference", "type", element.getType(), -1);
5091    if (element.hasClass_())
5092      composeCodeableConcept(t, "DocumentReference", "class", element.getClass_(), -1);
5093    if (element.hasSubject())
5094      composeReference(t, "DocumentReference", "subject", element.getSubject(), -1);
5095    if (element.hasCreatedElement())
5096      composeDateTime(t, "DocumentReference", "created", element.getCreatedElement(), -1);
5097    if (element.hasIndexedElement())
5098      composeInstant(t, "DocumentReference", "indexed", element.getIndexedElement(), -1);
5099    for (int i = 0; i < element.getAuthor().size(); i++)
5100      composeReference(t, "DocumentReference", "author", element.getAuthor().get(i), i);
5101    if (element.hasAuthenticator())
5102      composeReference(t, "DocumentReference", "authenticator", element.getAuthenticator(), -1);
5103    if (element.hasCustodian())
5104      composeReference(t, "DocumentReference", "custodian", element.getCustodian(), -1);
5105    for (int i = 0; i < element.getRelatesTo().size(); i++)
5106      composeDocumentReferenceDocumentReferenceRelatesToComponent(t, "DocumentReference", "relatesTo", element.getRelatesTo().get(i), i);
5107    if (element.hasDescriptionElement())
5108      composeString(t, "DocumentReference", "description", element.getDescriptionElement(), -1);
5109    for (int i = 0; i < element.getSecurityLabel().size(); i++)
5110      composeCodeableConcept(t, "DocumentReference", "securityLabel", element.getSecurityLabel().get(i), i);
5111    for (int i = 0; i < element.getContent().size(); i++)
5112      composeDocumentReferenceDocumentReferenceContentComponent(t, "DocumentReference", "content", element.getContent().get(i), i);
5113    if (element.hasContext())
5114      composeDocumentReferenceDocumentReferenceContextComponent(t, "DocumentReference", "context", element.getContext(), -1);
5115  }
5116
5117  protected void composeDocumentReferenceDocumentReferenceRelatesToComponent(Complex parent, String parentType, String name, DocumentReference.DocumentReferenceRelatesToComponent element, int index) {
5118    if (element == null) 
5119      return;
5120    Complex t;
5121    if (Utilities.noString(parentType))
5122      t = parent;
5123    else {
5124      t = parent.predicate("fhir:"+parentType+'.'+name);
5125    }
5126    composeBackboneElement(t, "relatesTo", name, element, index);
5127    if (element.hasCodeElement())
5128      composeEnum(t, "DocumentReference", "code", element.getCodeElement(), -1);
5129    if (element.hasTarget())
5130      composeReference(t, "DocumentReference", "target", element.getTarget(), -1);
5131  }
5132
5133  protected void composeDocumentReferenceDocumentReferenceContentComponent(Complex parent, String parentType, String name, DocumentReference.DocumentReferenceContentComponent element, int index) {
5134    if (element == null) 
5135      return;
5136    Complex t;
5137    if (Utilities.noString(parentType))
5138      t = parent;
5139    else {
5140      t = parent.predicate("fhir:"+parentType+'.'+name);
5141    }
5142    composeBackboneElement(t, "content", name, element, index);
5143    if (element.hasAttachment())
5144      composeAttachment(t, "DocumentReference", "attachment", element.getAttachment(), -1);
5145    if (element.hasFormat())
5146      composeCoding(t, "DocumentReference", "format", element.getFormat(), -1);
5147  }
5148
5149  protected void composeDocumentReferenceDocumentReferenceContextComponent(Complex parent, String parentType, String name, DocumentReference.DocumentReferenceContextComponent element, int index) {
5150    if (element == null) 
5151      return;
5152    Complex t;
5153    if (Utilities.noString(parentType))
5154      t = parent;
5155    else {
5156      t = parent.predicate("fhir:"+parentType+'.'+name);
5157    }
5158    composeBackboneElement(t, "context", name, element, index);
5159    if (element.hasEncounter())
5160      composeReference(t, "DocumentReference", "encounter", element.getEncounter(), -1);
5161    for (int i = 0; i < element.getEvent().size(); i++)
5162      composeCodeableConcept(t, "DocumentReference", "event", element.getEvent().get(i), i);
5163    if (element.hasPeriod())
5164      composePeriod(t, "DocumentReference", "period", element.getPeriod(), -1);
5165    if (element.hasFacilityType())
5166      composeCodeableConcept(t, "DocumentReference", "facilityType", element.getFacilityType(), -1);
5167    if (element.hasPracticeSetting())
5168      composeCodeableConcept(t, "DocumentReference", "practiceSetting", element.getPracticeSetting(), -1);
5169    if (element.hasSourcePatientInfo())
5170      composeReference(t, "DocumentReference", "sourcePatientInfo", element.getSourcePatientInfo(), -1);
5171    for (int i = 0; i < element.getRelated().size(); i++)
5172      composeDocumentReferenceDocumentReferenceContextRelatedComponent(t, "DocumentReference", "related", element.getRelated().get(i), i);
5173  }
5174
5175  protected void composeDocumentReferenceDocumentReferenceContextRelatedComponent(Complex parent, String parentType, String name, DocumentReference.DocumentReferenceContextRelatedComponent element, int index) {
5176    if (element == null) 
5177      return;
5178    Complex t;
5179    if (Utilities.noString(parentType))
5180      t = parent;
5181    else {
5182      t = parent.predicate("fhir:"+parentType+'.'+name);
5183    }
5184    composeBackboneElement(t, "related", name, element, index);
5185    if (element.hasIdentifier())
5186      composeIdentifier(t, "DocumentReference", "identifier", element.getIdentifier(), -1);
5187    if (element.hasRef())
5188      composeReference(t, "DocumentReference", "ref", element.getRef(), -1);
5189  }
5190
5191  protected void composeEligibilityRequest(Complex parent, String parentType, String name, EligibilityRequest element, int index) {
5192    if (element == null) 
5193      return;
5194    Complex t;
5195    if (Utilities.noString(parentType))
5196      t = parent;
5197    else {
5198      t = parent.predicate("fhir:"+parentType+'.'+name);
5199    }
5200    composeDomainResource(t, "EligibilityRequest", name, element, index);
5201    for (int i = 0; i < element.getIdentifier().size(); i++)
5202      composeIdentifier(t, "EligibilityRequest", "identifier", element.getIdentifier().get(i), i);
5203    if (element.hasStatusElement())
5204      composeEnum(t, "EligibilityRequest", "status", element.getStatusElement(), -1);
5205    if (element.hasPriority())
5206      composeCodeableConcept(t, "EligibilityRequest", "priority", element.getPriority(), -1);
5207    if (element.hasPatient())
5208      composeReference(t, "EligibilityRequest", "patient", element.getPatient(), -1);
5209    if (element.hasServiced())
5210      composeType(t, "EligibilityRequest", "serviced", element.getServiced(), -1);
5211    if (element.hasCreatedElement())
5212      composeDateTime(t, "EligibilityRequest", "created", element.getCreatedElement(), -1);
5213    if (element.hasEnterer())
5214      composeReference(t, "EligibilityRequest", "enterer", element.getEnterer(), -1);
5215    if (element.hasProvider())
5216      composeReference(t, "EligibilityRequest", "provider", element.getProvider(), -1);
5217    if (element.hasOrganization())
5218      composeReference(t, "EligibilityRequest", "organization", element.getOrganization(), -1);
5219    if (element.hasInsurer())
5220      composeReference(t, "EligibilityRequest", "insurer", element.getInsurer(), -1);
5221    if (element.hasFacility())
5222      composeReference(t, "EligibilityRequest", "facility", element.getFacility(), -1);
5223    if (element.hasCoverage())
5224      composeReference(t, "EligibilityRequest", "coverage", element.getCoverage(), -1);
5225    if (element.hasBusinessArrangementElement())
5226      composeString(t, "EligibilityRequest", "businessArrangement", element.getBusinessArrangementElement(), -1);
5227    if (element.hasBenefitCategory())
5228      composeCodeableConcept(t, "EligibilityRequest", "benefitCategory", element.getBenefitCategory(), -1);
5229    if (element.hasBenefitSubCategory())
5230      composeCodeableConcept(t, "EligibilityRequest", "benefitSubCategory", element.getBenefitSubCategory(), -1);
5231  }
5232
5233  protected void composeEligibilityResponse(Complex parent, String parentType, String name, EligibilityResponse element, int index) {
5234    if (element == null) 
5235      return;
5236    Complex t;
5237    if (Utilities.noString(parentType))
5238      t = parent;
5239    else {
5240      t = parent.predicate("fhir:"+parentType+'.'+name);
5241    }
5242    composeDomainResource(t, "EligibilityResponse", name, element, index);
5243    for (int i = 0; i < element.getIdentifier().size(); i++)
5244      composeIdentifier(t, "EligibilityResponse", "identifier", element.getIdentifier().get(i), i);
5245    if (element.hasStatusElement())
5246      composeEnum(t, "EligibilityResponse", "status", element.getStatusElement(), -1);
5247    if (element.hasCreatedElement())
5248      composeDateTime(t, "EligibilityResponse", "created", element.getCreatedElement(), -1);
5249    if (element.hasRequestProvider())
5250      composeReference(t, "EligibilityResponse", "requestProvider", element.getRequestProvider(), -1);
5251    if (element.hasRequestOrganization())
5252      composeReference(t, "EligibilityResponse", "requestOrganization", element.getRequestOrganization(), -1);
5253    if (element.hasRequest())
5254      composeReference(t, "EligibilityResponse", "request", element.getRequest(), -1);
5255    if (element.hasOutcome())
5256      composeCodeableConcept(t, "EligibilityResponse", "outcome", element.getOutcome(), -1);
5257    if (element.hasDispositionElement())
5258      composeString(t, "EligibilityResponse", "disposition", element.getDispositionElement(), -1);
5259    if (element.hasInsurer())
5260      composeReference(t, "EligibilityResponse", "insurer", element.getInsurer(), -1);
5261    if (element.hasInforceElement())
5262      composeBoolean(t, "EligibilityResponse", "inforce", element.getInforceElement(), -1);
5263    for (int i = 0; i < element.getInsurance().size(); i++)
5264      composeEligibilityResponseInsuranceComponent(t, "EligibilityResponse", "insurance", element.getInsurance().get(i), i);
5265    if (element.hasForm())
5266      composeCodeableConcept(t, "EligibilityResponse", "form", element.getForm(), -1);
5267    for (int i = 0; i < element.getError().size(); i++)
5268      composeEligibilityResponseErrorsComponent(t, "EligibilityResponse", "error", element.getError().get(i), i);
5269  }
5270
5271  protected void composeEligibilityResponseInsuranceComponent(Complex parent, String parentType, String name, EligibilityResponse.InsuranceComponent element, int index) {
5272    if (element == null) 
5273      return;
5274    Complex t;
5275    if (Utilities.noString(parentType))
5276      t = parent;
5277    else {
5278      t = parent.predicate("fhir:"+parentType+'.'+name);
5279    }
5280    composeBackboneElement(t, "insurance", name, element, index);
5281    if (element.hasCoverage())
5282      composeReference(t, "EligibilityResponse", "coverage", element.getCoverage(), -1);
5283    if (element.hasContract())
5284      composeReference(t, "EligibilityResponse", "contract", element.getContract(), -1);
5285    for (int i = 0; i < element.getBenefitBalance().size(); i++)
5286      composeEligibilityResponseBenefitsComponent(t, "EligibilityResponse", "benefitBalance", element.getBenefitBalance().get(i), i);
5287  }
5288
5289  protected void composeEligibilityResponseBenefitsComponent(Complex parent, String parentType, String name, EligibilityResponse.BenefitsComponent element, int index) {
5290    if (element == null) 
5291      return;
5292    Complex t;
5293    if (Utilities.noString(parentType))
5294      t = parent;
5295    else {
5296      t = parent.predicate("fhir:"+parentType+'.'+name);
5297    }
5298    composeBackboneElement(t, "benefitBalance", name, element, index);
5299    if (element.hasCategory())
5300      composeCodeableConcept(t, "EligibilityResponse", "category", element.getCategory(), -1);
5301    if (element.hasSubCategory())
5302      composeCodeableConcept(t, "EligibilityResponse", "subCategory", element.getSubCategory(), -1);
5303    if (element.hasExcludedElement())
5304      composeBoolean(t, "EligibilityResponse", "excluded", element.getExcludedElement(), -1);
5305    if (element.hasNameElement())
5306      composeString(t, "EligibilityResponse", "name", element.getNameElement(), -1);
5307    if (element.hasDescriptionElement())
5308      composeString(t, "EligibilityResponse", "description", element.getDescriptionElement(), -1);
5309    if (element.hasNetwork())
5310      composeCodeableConcept(t, "EligibilityResponse", "network", element.getNetwork(), -1);
5311    if (element.hasUnit())
5312      composeCodeableConcept(t, "EligibilityResponse", "unit", element.getUnit(), -1);
5313    if (element.hasTerm())
5314      composeCodeableConcept(t, "EligibilityResponse", "term", element.getTerm(), -1);
5315    for (int i = 0; i < element.getFinancial().size(); i++)
5316      composeEligibilityResponseBenefitComponent(t, "EligibilityResponse", "financial", element.getFinancial().get(i), i);
5317  }
5318
5319  protected void composeEligibilityResponseBenefitComponent(Complex parent, String parentType, String name, EligibilityResponse.BenefitComponent element, int index) {
5320    if (element == null) 
5321      return;
5322    Complex t;
5323    if (Utilities.noString(parentType))
5324      t = parent;
5325    else {
5326      t = parent.predicate("fhir:"+parentType+'.'+name);
5327    }
5328    composeBackboneElement(t, "financial", name, element, index);
5329    if (element.hasType())
5330      composeCodeableConcept(t, "EligibilityResponse", "type", element.getType(), -1);
5331    if (element.hasAllowed())
5332      composeType(t, "EligibilityResponse", "allowed", element.getAllowed(), -1);
5333    if (element.hasUsed())
5334      composeType(t, "EligibilityResponse", "used", element.getUsed(), -1);
5335  }
5336
5337  protected void composeEligibilityResponseErrorsComponent(Complex parent, String parentType, String name, EligibilityResponse.ErrorsComponent element, int index) {
5338    if (element == null) 
5339      return;
5340    Complex t;
5341    if (Utilities.noString(parentType))
5342      t = parent;
5343    else {
5344      t = parent.predicate("fhir:"+parentType+'.'+name);
5345    }
5346    composeBackboneElement(t, "error", name, element, index);
5347    if (element.hasCode())
5348      composeCodeableConcept(t, "EligibilityResponse", "code", element.getCode(), -1);
5349  }
5350
5351  protected void composeEncounter(Complex parent, String parentType, String name, Encounter element, int index) {
5352    if (element == null) 
5353      return;
5354    Complex t;
5355    if (Utilities.noString(parentType))
5356      t = parent;
5357    else {
5358      t = parent.predicate("fhir:"+parentType+'.'+name);
5359    }
5360    composeDomainResource(t, "Encounter", name, element, index);
5361    for (int i = 0; i < element.getIdentifier().size(); i++)
5362      composeIdentifier(t, "Encounter", "identifier", element.getIdentifier().get(i), i);
5363    if (element.hasStatusElement())
5364      composeEnum(t, "Encounter", "status", element.getStatusElement(), -1);
5365    for (int i = 0; i < element.getStatusHistory().size(); i++)
5366      composeEncounterStatusHistoryComponent(t, "Encounter", "statusHistory", element.getStatusHistory().get(i), i);
5367    if (element.hasClass_())
5368      composeCoding(t, "Encounter", "class", element.getClass_(), -1);
5369    for (int i = 0; i < element.getClassHistory().size(); i++)
5370      composeEncounterClassHistoryComponent(t, "Encounter", "classHistory", element.getClassHistory().get(i), i);
5371    for (int i = 0; i < element.getType().size(); i++)
5372      composeCodeableConcept(t, "Encounter", "type", element.getType().get(i), i);
5373    if (element.hasPriority())
5374      composeCodeableConcept(t, "Encounter", "priority", element.getPriority(), -1);
5375    if (element.hasSubject())
5376      composeReference(t, "Encounter", "subject", element.getSubject(), -1);
5377    for (int i = 0; i < element.getEpisodeOfCare().size(); i++)
5378      composeReference(t, "Encounter", "episodeOfCare", element.getEpisodeOfCare().get(i), i);
5379    for (int i = 0; i < element.getIncomingReferral().size(); i++)
5380      composeReference(t, "Encounter", "incomingReferral", element.getIncomingReferral().get(i), i);
5381    for (int i = 0; i < element.getParticipant().size(); i++)
5382      composeEncounterEncounterParticipantComponent(t, "Encounter", "participant", element.getParticipant().get(i), i);
5383    if (element.hasAppointment())
5384      composeReference(t, "Encounter", "appointment", element.getAppointment(), -1);
5385    if (element.hasPeriod())
5386      composePeriod(t, "Encounter", "period", element.getPeriod(), -1);
5387    if (element.hasLength())
5388      composeDuration(t, "Encounter", "length", element.getLength(), -1);
5389    for (int i = 0; i < element.getReason().size(); i++)
5390      composeCodeableConcept(t, "Encounter", "reason", element.getReason().get(i), i);
5391    for (int i = 0; i < element.getDiagnosis().size(); i++)
5392      composeEncounterDiagnosisComponent(t, "Encounter", "diagnosis", element.getDiagnosis().get(i), i);
5393    for (int i = 0; i < element.getAccount().size(); i++)
5394      composeReference(t, "Encounter", "account", element.getAccount().get(i), i);
5395    if (element.hasHospitalization())
5396      composeEncounterEncounterHospitalizationComponent(t, "Encounter", "hospitalization", element.getHospitalization(), -1);
5397    for (int i = 0; i < element.getLocation().size(); i++)
5398      composeEncounterEncounterLocationComponent(t, "Encounter", "location", element.getLocation().get(i), i);
5399    if (element.hasServiceProvider())
5400      composeReference(t, "Encounter", "serviceProvider", element.getServiceProvider(), -1);
5401    if (element.hasPartOf())
5402      composeReference(t, "Encounter", "partOf", element.getPartOf(), -1);
5403  }
5404
5405  protected void composeEncounterStatusHistoryComponent(Complex parent, String parentType, String name, Encounter.StatusHistoryComponent element, int index) {
5406    if (element == null) 
5407      return;
5408    Complex t;
5409    if (Utilities.noString(parentType))
5410      t = parent;
5411    else {
5412      t = parent.predicate("fhir:"+parentType+'.'+name);
5413    }
5414    composeBackboneElement(t, "statusHistory", name, element, index);
5415    if (element.hasStatusElement())
5416      composeEnum(t, "Encounter", "status", element.getStatusElement(), -1);
5417    if (element.hasPeriod())
5418      composePeriod(t, "Encounter", "period", element.getPeriod(), -1);
5419  }
5420
5421  protected void composeEncounterClassHistoryComponent(Complex parent, String parentType, String name, Encounter.ClassHistoryComponent element, int index) {
5422    if (element == null) 
5423      return;
5424    Complex t;
5425    if (Utilities.noString(parentType))
5426      t = parent;
5427    else {
5428      t = parent.predicate("fhir:"+parentType+'.'+name);
5429    }
5430    composeBackboneElement(t, "classHistory", name, element, index);
5431    if (element.hasClass_())
5432      composeCoding(t, "Encounter", "class", element.getClass_(), -1);
5433    if (element.hasPeriod())
5434      composePeriod(t, "Encounter", "period", element.getPeriod(), -1);
5435  }
5436
5437  protected void composeEncounterEncounterParticipantComponent(Complex parent, String parentType, String name, Encounter.EncounterParticipantComponent element, int index) {
5438    if (element == null) 
5439      return;
5440    Complex t;
5441    if (Utilities.noString(parentType))
5442      t = parent;
5443    else {
5444      t = parent.predicate("fhir:"+parentType+'.'+name);
5445    }
5446    composeBackboneElement(t, "participant", name, element, index);
5447    for (int i = 0; i < element.getType().size(); i++)
5448      composeCodeableConcept(t, "Encounter", "type", element.getType().get(i), i);
5449    if (element.hasPeriod())
5450      composePeriod(t, "Encounter", "period", element.getPeriod(), -1);
5451    if (element.hasIndividual())
5452      composeReference(t, "Encounter", "individual", element.getIndividual(), -1);
5453  }
5454
5455  protected void composeEncounterDiagnosisComponent(Complex parent, String parentType, String name, Encounter.DiagnosisComponent element, int index) {
5456    if (element == null) 
5457      return;
5458    Complex t;
5459    if (Utilities.noString(parentType))
5460      t = parent;
5461    else {
5462      t = parent.predicate("fhir:"+parentType+'.'+name);
5463    }
5464    composeBackboneElement(t, "diagnosis", name, element, index);
5465    if (element.hasCondition())
5466      composeReference(t, "Encounter", "condition", element.getCondition(), -1);
5467    if (element.hasRole())
5468      composeCodeableConcept(t, "Encounter", "role", element.getRole(), -1);
5469    if (element.hasRankElement())
5470      composePositiveInt(t, "Encounter", "rank", element.getRankElement(), -1);
5471  }
5472
5473  protected void composeEncounterEncounterHospitalizationComponent(Complex parent, String parentType, String name, Encounter.EncounterHospitalizationComponent element, int index) {
5474    if (element == null) 
5475      return;
5476    Complex t;
5477    if (Utilities.noString(parentType))
5478      t = parent;
5479    else {
5480      t = parent.predicate("fhir:"+parentType+'.'+name);
5481    }
5482    composeBackboneElement(t, "hospitalization", name, element, index);
5483    if (element.hasPreAdmissionIdentifier())
5484      composeIdentifier(t, "Encounter", "preAdmissionIdentifier", element.getPreAdmissionIdentifier(), -1);
5485    if (element.hasOrigin())
5486      composeReference(t, "Encounter", "origin", element.getOrigin(), -1);
5487    if (element.hasAdmitSource())
5488      composeCodeableConcept(t, "Encounter", "admitSource", element.getAdmitSource(), -1);
5489    if (element.hasReAdmission())
5490      composeCodeableConcept(t, "Encounter", "reAdmission", element.getReAdmission(), -1);
5491    for (int i = 0; i < element.getDietPreference().size(); i++)
5492      composeCodeableConcept(t, "Encounter", "dietPreference", element.getDietPreference().get(i), i);
5493    for (int i = 0; i < element.getSpecialCourtesy().size(); i++)
5494      composeCodeableConcept(t, "Encounter", "specialCourtesy", element.getSpecialCourtesy().get(i), i);
5495    for (int i = 0; i < element.getSpecialArrangement().size(); i++)
5496      composeCodeableConcept(t, "Encounter", "specialArrangement", element.getSpecialArrangement().get(i), i);
5497    if (element.hasDestination())
5498      composeReference(t, "Encounter", "destination", element.getDestination(), -1);
5499    if (element.hasDischargeDisposition())
5500      composeCodeableConcept(t, "Encounter", "dischargeDisposition", element.getDischargeDisposition(), -1);
5501  }
5502
5503  protected void composeEncounterEncounterLocationComponent(Complex parent, String parentType, String name, Encounter.EncounterLocationComponent 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, "location", name, element, index);
5513    if (element.hasLocation())
5514      composeReference(t, "Encounter", "location", element.getLocation(), -1);
5515    if (element.hasStatusElement())
5516      composeEnum(t, "Encounter", "status", element.getStatusElement(), -1);
5517    if (element.hasPeriod())
5518      composePeriod(t, "Encounter", "period", element.getPeriod(), -1);
5519  }
5520
5521  protected void composeEndpoint(Complex parent, String parentType, String name, Endpoint element, int index) {
5522    if (element == null) 
5523      return;
5524    Complex t;
5525    if (Utilities.noString(parentType))
5526      t = parent;
5527    else {
5528      t = parent.predicate("fhir:"+parentType+'.'+name);
5529    }
5530    composeDomainResource(t, "Endpoint", name, element, index);
5531    for (int i = 0; i < element.getIdentifier().size(); i++)
5532      composeIdentifier(t, "Endpoint", "identifier", element.getIdentifier().get(i), i);
5533    if (element.hasStatusElement())
5534      composeEnum(t, "Endpoint", "status", element.getStatusElement(), -1);
5535    if (element.hasConnectionType())
5536      composeCoding(t, "Endpoint", "connectionType", element.getConnectionType(), -1);
5537    if (element.hasNameElement())
5538      composeString(t, "Endpoint", "name", element.getNameElement(), -1);
5539    if (element.hasManagingOrganization())
5540      composeReference(t, "Endpoint", "managingOrganization", element.getManagingOrganization(), -1);
5541    for (int i = 0; i < element.getContact().size(); i++)
5542      composeContactPoint(t, "Endpoint", "contact", element.getContact().get(i), i);
5543    if (element.hasPeriod())
5544      composePeriod(t, "Endpoint", "period", element.getPeriod(), -1);
5545    for (int i = 0; i < element.getPayloadType().size(); i++)
5546      composeCodeableConcept(t, "Endpoint", "payloadType", element.getPayloadType().get(i), i);
5547    for (int i = 0; i < element.getPayloadMimeType().size(); i++)
5548      composeCode(t, "Endpoint", "payloadMimeType", element.getPayloadMimeType().get(i), i);
5549    if (element.hasAddressElement())
5550      composeUri(t, "Endpoint", "address", element.getAddressElement(), -1);
5551    for (int i = 0; i < element.getHeader().size(); i++)
5552      composeString(t, "Endpoint", "header", element.getHeader().get(i), i);
5553  }
5554
5555  protected void composeEnrollmentRequest(Complex parent, String parentType, String name, EnrollmentRequest element, int index) {
5556    if (element == null) 
5557      return;
5558    Complex t;
5559    if (Utilities.noString(parentType))
5560      t = parent;
5561    else {
5562      t = parent.predicate("fhir:"+parentType+'.'+name);
5563    }
5564    composeDomainResource(t, "EnrollmentRequest", name, element, index);
5565    for (int i = 0; i < element.getIdentifier().size(); i++)
5566      composeIdentifier(t, "EnrollmentRequest", "identifier", element.getIdentifier().get(i), i);
5567    if (element.hasStatusElement())
5568      composeEnum(t, "EnrollmentRequest", "status", element.getStatusElement(), -1);
5569    if (element.hasCreatedElement())
5570      composeDateTime(t, "EnrollmentRequest", "created", element.getCreatedElement(), -1);
5571    if (element.hasInsurer())
5572      composeReference(t, "EnrollmentRequest", "insurer", element.getInsurer(), -1);
5573    if (element.hasProvider())
5574      composeReference(t, "EnrollmentRequest", "provider", element.getProvider(), -1);
5575    if (element.hasOrganization())
5576      composeReference(t, "EnrollmentRequest", "organization", element.getOrganization(), -1);
5577    if (element.hasSubject())
5578      composeReference(t, "EnrollmentRequest", "subject", element.getSubject(), -1);
5579    if (element.hasCoverage())
5580      composeReference(t, "EnrollmentRequest", "coverage", element.getCoverage(), -1);
5581  }
5582
5583  protected void composeEnrollmentResponse(Complex parent, String parentType, String name, EnrollmentResponse element, int index) {
5584    if (element == null) 
5585      return;
5586    Complex t;
5587    if (Utilities.noString(parentType))
5588      t = parent;
5589    else {
5590      t = parent.predicate("fhir:"+parentType+'.'+name);
5591    }
5592    composeDomainResource(t, "EnrollmentResponse", name, element, index);
5593    for (int i = 0; i < element.getIdentifier().size(); i++)
5594      composeIdentifier(t, "EnrollmentResponse", "identifier", element.getIdentifier().get(i), i);
5595    if (element.hasStatusElement())
5596      composeEnum(t, "EnrollmentResponse", "status", element.getStatusElement(), -1);
5597    if (element.hasRequest())
5598      composeReference(t, "EnrollmentResponse", "request", element.getRequest(), -1);
5599    if (element.hasOutcome())
5600      composeCodeableConcept(t, "EnrollmentResponse", "outcome", element.getOutcome(), -1);
5601    if (element.hasDispositionElement())
5602      composeString(t, "EnrollmentResponse", "disposition", element.getDispositionElement(), -1);
5603    if (element.hasCreatedElement())
5604      composeDateTime(t, "EnrollmentResponse", "created", element.getCreatedElement(), -1);
5605    if (element.hasOrganization())
5606      composeReference(t, "EnrollmentResponse", "organization", element.getOrganization(), -1);
5607    if (element.hasRequestProvider())
5608      composeReference(t, "EnrollmentResponse", "requestProvider", element.getRequestProvider(), -1);
5609    if (element.hasRequestOrganization())
5610      composeReference(t, "EnrollmentResponse", "requestOrganization", element.getRequestOrganization(), -1);
5611  }
5612
5613  protected void composeEpisodeOfCare(Complex parent, String parentType, String name, EpisodeOfCare element, int index) {
5614    if (element == null) 
5615      return;
5616    Complex t;
5617    if (Utilities.noString(parentType))
5618      t = parent;
5619    else {
5620      t = parent.predicate("fhir:"+parentType+'.'+name);
5621    }
5622    composeDomainResource(t, "EpisodeOfCare", name, element, index);
5623    for (int i = 0; i < element.getIdentifier().size(); i++)
5624      composeIdentifier(t, "EpisodeOfCare", "identifier", element.getIdentifier().get(i), i);
5625    if (element.hasStatusElement())
5626      composeEnum(t, "EpisodeOfCare", "status", element.getStatusElement(), -1);
5627    for (int i = 0; i < element.getStatusHistory().size(); i++)
5628      composeEpisodeOfCareEpisodeOfCareStatusHistoryComponent(t, "EpisodeOfCare", "statusHistory", element.getStatusHistory().get(i), i);
5629    for (int i = 0; i < element.getType().size(); i++)
5630      composeCodeableConcept(t, "EpisodeOfCare", "type", element.getType().get(i), i);
5631    for (int i = 0; i < element.getDiagnosis().size(); i++)
5632      composeEpisodeOfCareDiagnosisComponent(t, "EpisodeOfCare", "diagnosis", element.getDiagnosis().get(i), i);
5633    if (element.hasPatient())
5634      composeReference(t, "EpisodeOfCare", "patient", element.getPatient(), -1);
5635    if (element.hasManagingOrganization())
5636      composeReference(t, "EpisodeOfCare", "managingOrganization", element.getManagingOrganization(), -1);
5637    if (element.hasPeriod())
5638      composePeriod(t, "EpisodeOfCare", "period", element.getPeriod(), -1);
5639    for (int i = 0; i < element.getReferralRequest().size(); i++)
5640      composeReference(t, "EpisodeOfCare", "referralRequest", element.getReferralRequest().get(i), i);
5641    if (element.hasCareManager())
5642      composeReference(t, "EpisodeOfCare", "careManager", element.getCareManager(), -1);
5643    for (int i = 0; i < element.getTeam().size(); i++)
5644      composeReference(t, "EpisodeOfCare", "team", element.getTeam().get(i), i);
5645    for (int i = 0; i < element.getAccount().size(); i++)
5646      composeReference(t, "EpisodeOfCare", "account", element.getAccount().get(i), i);
5647  }
5648
5649  protected void composeEpisodeOfCareEpisodeOfCareStatusHistoryComponent(Complex parent, String parentType, String name, EpisodeOfCare.EpisodeOfCareStatusHistoryComponent element, int index) {
5650    if (element == null) 
5651      return;
5652    Complex t;
5653    if (Utilities.noString(parentType))
5654      t = parent;
5655    else {
5656      t = parent.predicate("fhir:"+parentType+'.'+name);
5657    }
5658    composeBackboneElement(t, "statusHistory", name, element, index);
5659    if (element.hasStatusElement())
5660      composeEnum(t, "EpisodeOfCare", "status", element.getStatusElement(), -1);
5661    if (element.hasPeriod())
5662      composePeriod(t, "EpisodeOfCare", "period", element.getPeriod(), -1);
5663  }
5664
5665  protected void composeEpisodeOfCareDiagnosisComponent(Complex parent, String parentType, String name, EpisodeOfCare.DiagnosisComponent element, int index) {
5666    if (element == null) 
5667      return;
5668    Complex t;
5669    if (Utilities.noString(parentType))
5670      t = parent;
5671    else {
5672      t = parent.predicate("fhir:"+parentType+'.'+name);
5673    }
5674    composeBackboneElement(t, "diagnosis", name, element, index);
5675    if (element.hasCondition())
5676      composeReference(t, "EpisodeOfCare", "condition", element.getCondition(), -1);
5677    if (element.hasRole())
5678      composeCodeableConcept(t, "EpisodeOfCare", "role", element.getRole(), -1);
5679    if (element.hasRankElement())
5680      composePositiveInt(t, "EpisodeOfCare", "rank", element.getRankElement(), -1);
5681  }
5682
5683  protected void composeExpansionProfile(Complex parent, String parentType, String name, ExpansionProfile element, int index) {
5684    if (element == null) 
5685      return;
5686    Complex t;
5687    if (Utilities.noString(parentType))
5688      t = parent;
5689    else {
5690      t = parent.predicate("fhir:"+parentType+'.'+name);
5691    }
5692    composeDomainResource(t, "ExpansionProfile", name, element, index);
5693    if (element.hasUrlElement())
5694      composeUri(t, "ExpansionProfile", "url", element.getUrlElement(), -1);
5695    if (element.hasIdentifier())
5696      composeIdentifier(t, "ExpansionProfile", "identifier", element.getIdentifier(), -1);
5697    if (element.hasVersionElement())
5698      composeString(t, "ExpansionProfile", "version", element.getVersionElement(), -1);
5699    if (element.hasNameElement())
5700      composeString(t, "ExpansionProfile", "name", element.getNameElement(), -1);
5701    if (element.hasStatusElement())
5702      composeEnum(t, "ExpansionProfile", "status", element.getStatusElement(), -1);
5703    if (element.hasExperimentalElement())
5704      composeBoolean(t, "ExpansionProfile", "experimental", element.getExperimentalElement(), -1);
5705    if (element.hasDateElement())
5706      composeDateTime(t, "ExpansionProfile", "date", element.getDateElement(), -1);
5707    if (element.hasPublisherElement())
5708      composeString(t, "ExpansionProfile", "publisher", element.getPublisherElement(), -1);
5709    for (int i = 0; i < element.getContact().size(); i++)
5710      composeContactDetail(t, "ExpansionProfile", "contact", element.getContact().get(i), i);
5711    if (element.hasDescriptionElement())
5712      composeMarkdown(t, "ExpansionProfile", "description", element.getDescriptionElement(), -1);
5713    for (int i = 0; i < element.getUseContext().size(); i++)
5714      composeUsageContext(t, "ExpansionProfile", "useContext", element.getUseContext().get(i), i);
5715    for (int i = 0; i < element.getJurisdiction().size(); i++)
5716      composeCodeableConcept(t, "ExpansionProfile", "jurisdiction", element.getJurisdiction().get(i), i);
5717    for (int i = 0; i < element.getFixedVersion().size(); i++)
5718      composeExpansionProfileExpansionProfileFixedVersionComponent(t, "ExpansionProfile", "fixedVersion", element.getFixedVersion().get(i), i);
5719    if (element.hasExcludedSystem())
5720      composeExpansionProfileExpansionProfileExcludedSystemComponent(t, "ExpansionProfile", "excludedSystem", element.getExcludedSystem(), -1);
5721    if (element.hasIncludeDesignationsElement())
5722      composeBoolean(t, "ExpansionProfile", "includeDesignations", element.getIncludeDesignationsElement(), -1);
5723    if (element.hasDesignation())
5724      composeExpansionProfileExpansionProfileDesignationComponent(t, "ExpansionProfile", "designation", element.getDesignation(), -1);
5725    if (element.hasIncludeDefinitionElement())
5726      composeBoolean(t, "ExpansionProfile", "includeDefinition", element.getIncludeDefinitionElement(), -1);
5727    if (element.hasActiveOnlyElement())
5728      composeBoolean(t, "ExpansionProfile", "activeOnly", element.getActiveOnlyElement(), -1);
5729    if (element.hasExcludeNestedElement())
5730      composeBoolean(t, "ExpansionProfile", "excludeNested", element.getExcludeNestedElement(), -1);
5731    if (element.hasExcludeNotForUIElement())
5732      composeBoolean(t, "ExpansionProfile", "excludeNotForUI", element.getExcludeNotForUIElement(), -1);
5733    if (element.hasExcludePostCoordinatedElement())
5734      composeBoolean(t, "ExpansionProfile", "excludePostCoordinated", element.getExcludePostCoordinatedElement(), -1);
5735    if (element.hasDisplayLanguageElement())
5736      composeCode(t, "ExpansionProfile", "displayLanguage", element.getDisplayLanguageElement(), -1);
5737    if (element.hasLimitedExpansionElement())
5738      composeBoolean(t, "ExpansionProfile", "limitedExpansion", element.getLimitedExpansionElement(), -1);
5739  }
5740
5741  protected void composeExpansionProfileExpansionProfileFixedVersionComponent(Complex parent, String parentType, String name, ExpansionProfile.ExpansionProfileFixedVersionComponent element, int index) {
5742    if (element == null) 
5743      return;
5744    Complex t;
5745    if (Utilities.noString(parentType))
5746      t = parent;
5747    else {
5748      t = parent.predicate("fhir:"+parentType+'.'+name);
5749    }
5750    composeBackboneElement(t, "fixedVersion", name, element, index);
5751    if (element.hasSystemElement())
5752      composeUri(t, "ExpansionProfile", "system", element.getSystemElement(), -1);
5753    if (element.hasVersionElement())
5754      composeString(t, "ExpansionProfile", "version", element.getVersionElement(), -1);
5755    if (element.hasModeElement())
5756      composeEnum(t, "ExpansionProfile", "mode", element.getModeElement(), -1);
5757  }
5758
5759  protected void composeExpansionProfileExpansionProfileExcludedSystemComponent(Complex parent, String parentType, String name, ExpansionProfile.ExpansionProfileExcludedSystemComponent element, int index) {
5760    if (element == null) 
5761      return;
5762    Complex t;
5763    if (Utilities.noString(parentType))
5764      t = parent;
5765    else {
5766      t = parent.predicate("fhir:"+parentType+'.'+name);
5767    }
5768    composeBackboneElement(t, "excludedSystem", name, element, index);
5769    if (element.hasSystemElement())
5770      composeUri(t, "ExpansionProfile", "system", element.getSystemElement(), -1);
5771    if (element.hasVersionElement())
5772      composeString(t, "ExpansionProfile", "version", element.getVersionElement(), -1);
5773  }
5774
5775  protected void composeExpansionProfileExpansionProfileDesignationComponent(Complex parent, String parentType, String name, ExpansionProfile.ExpansionProfileDesignationComponent element, int index) {
5776    if (element == null) 
5777      return;
5778    Complex t;
5779    if (Utilities.noString(parentType))
5780      t = parent;
5781    else {
5782      t = parent.predicate("fhir:"+parentType+'.'+name);
5783    }
5784    composeBackboneElement(t, "designation", name, element, index);
5785    if (element.hasInclude())
5786      composeExpansionProfileDesignationIncludeComponent(t, "ExpansionProfile", "include", element.getInclude(), -1);
5787    if (element.hasExclude())
5788      composeExpansionProfileDesignationExcludeComponent(t, "ExpansionProfile", "exclude", element.getExclude(), -1);
5789  }
5790
5791  protected void composeExpansionProfileDesignationIncludeComponent(Complex parent, String parentType, String name, ExpansionProfile.DesignationIncludeComponent element, int index) {
5792    if (element == null) 
5793      return;
5794    Complex t;
5795    if (Utilities.noString(parentType))
5796      t = parent;
5797    else {
5798      t = parent.predicate("fhir:"+parentType+'.'+name);
5799    }
5800    composeBackboneElement(t, "include", name, element, index);
5801    for (int i = 0; i < element.getDesignation().size(); i++)
5802      composeExpansionProfileDesignationIncludeDesignationComponent(t, "ExpansionProfile", "designation", element.getDesignation().get(i), i);
5803  }
5804
5805  protected void composeExpansionProfileDesignationIncludeDesignationComponent(Complex parent, String parentType, String name, ExpansionProfile.DesignationIncludeDesignationComponent element, int index) {
5806    if (element == null) 
5807      return;
5808    Complex t;
5809    if (Utilities.noString(parentType))
5810      t = parent;
5811    else {
5812      t = parent.predicate("fhir:"+parentType+'.'+name);
5813    }
5814    composeBackboneElement(t, "designation", name, element, index);
5815    if (element.hasLanguageElement())
5816      composeCode(t, "ExpansionProfile", "language", element.getLanguageElement(), -1);
5817    if (element.hasUse())
5818      composeCoding(t, "ExpansionProfile", "use", element.getUse(), -1);
5819  }
5820
5821  protected void composeExpansionProfileDesignationExcludeComponent(Complex parent, String parentType, String name, ExpansionProfile.DesignationExcludeComponent element, int index) {
5822    if (element == null) 
5823      return;
5824    Complex t;
5825    if (Utilities.noString(parentType))
5826      t = parent;
5827    else {
5828      t = parent.predicate("fhir:"+parentType+'.'+name);
5829    }
5830    composeBackboneElement(t, "exclude", name, element, index);
5831    for (int i = 0; i < element.getDesignation().size(); i++)
5832      composeExpansionProfileDesignationExcludeDesignationComponent(t, "ExpansionProfile", "designation", element.getDesignation().get(i), i);
5833  }
5834
5835  protected void composeExpansionProfileDesignationExcludeDesignationComponent(Complex parent, String parentType, String name, ExpansionProfile.DesignationExcludeDesignationComponent element, int index) {
5836    if (element == null) 
5837      return;
5838    Complex t;
5839    if (Utilities.noString(parentType))
5840      t = parent;
5841    else {
5842      t = parent.predicate("fhir:"+parentType+'.'+name);
5843    }
5844    composeBackboneElement(t, "designation", name, element, index);
5845    if (element.hasLanguageElement())
5846      composeCode(t, "ExpansionProfile", "language", element.getLanguageElement(), -1);
5847    if (element.hasUse())
5848      composeCoding(t, "ExpansionProfile", "use", element.getUse(), -1);
5849  }
5850
5851  protected void composeExplanationOfBenefit(Complex parent, String parentType, String name, ExplanationOfBenefit element, int index) {
5852    if (element == null) 
5853      return;
5854    Complex t;
5855    if (Utilities.noString(parentType))
5856      t = parent;
5857    else {
5858      t = parent.predicate("fhir:"+parentType+'.'+name);
5859    }
5860    composeDomainResource(t, "ExplanationOfBenefit", name, element, index);
5861    for (int i = 0; i < element.getIdentifier().size(); i++)
5862      composeIdentifier(t, "ExplanationOfBenefit", "identifier", element.getIdentifier().get(i), i);
5863    if (element.hasStatusElement())
5864      composeEnum(t, "ExplanationOfBenefit", "status", element.getStatusElement(), -1);
5865    if (element.hasType())
5866      composeCodeableConcept(t, "ExplanationOfBenefit", "type", element.getType(), -1);
5867    for (int i = 0; i < element.getSubType().size(); i++)
5868      composeCodeableConcept(t, "ExplanationOfBenefit", "subType", element.getSubType().get(i), i);
5869    if (element.hasPatient())
5870      composeReference(t, "ExplanationOfBenefit", "patient", element.getPatient(), -1);
5871    if (element.hasBillablePeriod())
5872      composePeriod(t, "ExplanationOfBenefit", "billablePeriod", element.getBillablePeriod(), -1);
5873    if (element.hasCreatedElement())
5874      composeDateTime(t, "ExplanationOfBenefit", "created", element.getCreatedElement(), -1);
5875    if (element.hasEnterer())
5876      composeReference(t, "ExplanationOfBenefit", "enterer", element.getEnterer(), -1);
5877    if (element.hasInsurer())
5878      composeReference(t, "ExplanationOfBenefit", "insurer", element.getInsurer(), -1);
5879    if (element.hasProvider())
5880      composeReference(t, "ExplanationOfBenefit", "provider", element.getProvider(), -1);
5881    if (element.hasOrganization())
5882      composeReference(t, "ExplanationOfBenefit", "organization", element.getOrganization(), -1);
5883    if (element.hasReferral())
5884      composeReference(t, "ExplanationOfBenefit", "referral", element.getReferral(), -1);
5885    if (element.hasFacility())
5886      composeReference(t, "ExplanationOfBenefit", "facility", element.getFacility(), -1);
5887    if (element.hasClaim())
5888      composeReference(t, "ExplanationOfBenefit", "claim", element.getClaim(), -1);
5889    if (element.hasClaimResponse())
5890      composeReference(t, "ExplanationOfBenefit", "claimResponse", element.getClaimResponse(), -1);
5891    if (element.hasOutcome())
5892      composeCodeableConcept(t, "ExplanationOfBenefit", "outcome", element.getOutcome(), -1);
5893    if (element.hasDispositionElement())
5894      composeString(t, "ExplanationOfBenefit", "disposition", element.getDispositionElement(), -1);
5895    for (int i = 0; i < element.getRelated().size(); i++)
5896      composeExplanationOfBenefitRelatedClaimComponent(t, "ExplanationOfBenefit", "related", element.getRelated().get(i), i);
5897    if (element.hasPrescription())
5898      composeReference(t, "ExplanationOfBenefit", "prescription", element.getPrescription(), -1);
5899    if (element.hasOriginalPrescription())
5900      composeReference(t, "ExplanationOfBenefit", "originalPrescription", element.getOriginalPrescription(), -1);
5901    if (element.hasPayee())
5902      composeExplanationOfBenefitPayeeComponent(t, "ExplanationOfBenefit", "payee", element.getPayee(), -1);
5903    for (int i = 0; i < element.getInformation().size(); i++)
5904      composeExplanationOfBenefitSupportingInformationComponent(t, "ExplanationOfBenefit", "information", element.getInformation().get(i), i);
5905    for (int i = 0; i < element.getCareTeam().size(); i++)
5906      composeExplanationOfBenefitCareTeamComponent(t, "ExplanationOfBenefit", "careTeam", element.getCareTeam().get(i), i);
5907    for (int i = 0; i < element.getDiagnosis().size(); i++)
5908      composeExplanationOfBenefitDiagnosisComponent(t, "ExplanationOfBenefit", "diagnosis", element.getDiagnosis().get(i), i);
5909    for (int i = 0; i < element.getProcedure().size(); i++)
5910      composeExplanationOfBenefitProcedureComponent(t, "ExplanationOfBenefit", "procedure", element.getProcedure().get(i), i);
5911    if (element.hasPrecedenceElement())
5912      composePositiveInt(t, "ExplanationOfBenefit", "precedence", element.getPrecedenceElement(), -1);
5913    if (element.hasInsurance())
5914      composeExplanationOfBenefitInsuranceComponent(t, "ExplanationOfBenefit", "insurance", element.getInsurance(), -1);
5915    if (element.hasAccident())
5916      composeExplanationOfBenefitAccidentComponent(t, "ExplanationOfBenefit", "accident", element.getAccident(), -1);
5917    if (element.hasEmploymentImpacted())
5918      composePeriod(t, "ExplanationOfBenefit", "employmentImpacted", element.getEmploymentImpacted(), -1);
5919    if (element.hasHospitalization())
5920      composePeriod(t, "ExplanationOfBenefit", "hospitalization", element.getHospitalization(), -1);
5921    for (int i = 0; i < element.getItem().size(); i++)
5922      composeExplanationOfBenefitItemComponent(t, "ExplanationOfBenefit", "item", element.getItem().get(i), i);
5923    for (int i = 0; i < element.getAddItem().size(); i++)
5924      composeExplanationOfBenefitAddedItemComponent(t, "ExplanationOfBenefit", "addItem", element.getAddItem().get(i), i);
5925    if (element.hasTotalCost())
5926      composeMoney(t, "ExplanationOfBenefit", "totalCost", element.getTotalCost(), -1);
5927    if (element.hasUnallocDeductable())
5928      composeMoney(t, "ExplanationOfBenefit", "unallocDeductable", element.getUnallocDeductable(), -1);
5929    if (element.hasTotalBenefit())
5930      composeMoney(t, "ExplanationOfBenefit", "totalBenefit", element.getTotalBenefit(), -1);
5931    if (element.hasPayment())
5932      composeExplanationOfBenefitPaymentComponent(t, "ExplanationOfBenefit", "payment", element.getPayment(), -1);
5933    if (element.hasForm())
5934      composeCodeableConcept(t, "ExplanationOfBenefit", "form", element.getForm(), -1);
5935    for (int i = 0; i < element.getProcessNote().size(); i++)
5936      composeExplanationOfBenefitNoteComponent(t, "ExplanationOfBenefit", "processNote", element.getProcessNote().get(i), i);
5937    for (int i = 0; i < element.getBenefitBalance().size(); i++)
5938      composeExplanationOfBenefitBenefitBalanceComponent(t, "ExplanationOfBenefit", "benefitBalance", element.getBenefitBalance().get(i), i);
5939  }
5940
5941  protected void composeExplanationOfBenefitRelatedClaimComponent(Complex parent, String parentType, String name, ExplanationOfBenefit.RelatedClaimComponent element, int index) {
5942    if (element == null) 
5943      return;
5944    Complex t;
5945    if (Utilities.noString(parentType))
5946      t = parent;
5947    else {
5948      t = parent.predicate("fhir:"+parentType+'.'+name);
5949    }
5950    composeBackboneElement(t, "related", name, element, index);
5951    if (element.hasClaim())
5952      composeReference(t, "ExplanationOfBenefit", "claim", element.getClaim(), -1);
5953    if (element.hasRelationship())
5954      composeCodeableConcept(t, "ExplanationOfBenefit", "relationship", element.getRelationship(), -1);
5955    if (element.hasReference())
5956      composeIdentifier(t, "ExplanationOfBenefit", "reference", element.getReference(), -1);
5957  }
5958
5959  protected void composeExplanationOfBenefitPayeeComponent(Complex parent, String parentType, String name, ExplanationOfBenefit.PayeeComponent element, int index) {
5960    if (element == null) 
5961      return;
5962    Complex t;
5963    if (Utilities.noString(parentType))
5964      t = parent;
5965    else {
5966      t = parent.predicate("fhir:"+parentType+'.'+name);
5967    }
5968    composeBackboneElement(t, "payee", name, element, index);
5969    if (element.hasType())
5970      composeCodeableConcept(t, "ExplanationOfBenefit", "type", element.getType(), -1);
5971    if (element.hasResourceType())
5972      composeCodeableConcept(t, "ExplanationOfBenefit", "resourceType", element.getResourceType(), -1);
5973    if (element.hasParty())
5974      composeReference(t, "ExplanationOfBenefit", "party", element.getParty(), -1);
5975  }
5976
5977  protected void composeExplanationOfBenefitSupportingInformationComponent(Complex parent, String parentType, String name, ExplanationOfBenefit.SupportingInformationComponent element, int index) {
5978    if (element == null) 
5979      return;
5980    Complex t;
5981    if (Utilities.noString(parentType))
5982      t = parent;
5983    else {
5984      t = parent.predicate("fhir:"+parentType+'.'+name);
5985    }
5986    composeBackboneElement(t, "information", name, element, index);
5987    if (element.hasSequenceElement())
5988      composePositiveInt(t, "ExplanationOfBenefit", "sequence", element.getSequenceElement(), -1);
5989    if (element.hasCategory())
5990      composeCodeableConcept(t, "ExplanationOfBenefit", "category", element.getCategory(), -1);
5991    if (element.hasCode())
5992      composeCodeableConcept(t, "ExplanationOfBenefit", "code", element.getCode(), -1);
5993    if (element.hasTiming())
5994      composeType(t, "ExplanationOfBenefit", "timing", element.getTiming(), -1);
5995    if (element.hasValue())
5996      composeType(t, "ExplanationOfBenefit", "value", element.getValue(), -1);
5997    if (element.hasReason())
5998      composeCoding(t, "ExplanationOfBenefit", "reason", element.getReason(), -1);
5999  }
6000
6001  protected void composeExplanationOfBenefitCareTeamComponent(Complex parent, String parentType, String name, ExplanationOfBenefit.CareTeamComponent element, int index) {
6002    if (element == null) 
6003      return;
6004    Complex t;
6005    if (Utilities.noString(parentType))
6006      t = parent;
6007    else {
6008      t = parent.predicate("fhir:"+parentType+'.'+name);
6009    }
6010    composeBackboneElement(t, "careTeam", name, element, index);
6011    if (element.hasSequenceElement())
6012      composePositiveInt(t, "ExplanationOfBenefit", "sequence", element.getSequenceElement(), -1);
6013    if (element.hasProvider())
6014      composeReference(t, "ExplanationOfBenefit", "provider", element.getProvider(), -1);
6015    if (element.hasResponsibleElement())
6016      composeBoolean(t, "ExplanationOfBenefit", "responsible", element.getResponsibleElement(), -1);
6017    if (element.hasRole())
6018      composeCodeableConcept(t, "ExplanationOfBenefit", "role", element.getRole(), -1);
6019    if (element.hasQualification())
6020      composeCodeableConcept(t, "ExplanationOfBenefit", "qualification", element.getQualification(), -1);
6021  }
6022
6023  protected void composeExplanationOfBenefitDiagnosisComponent(Complex parent, String parentType, String name, ExplanationOfBenefit.DiagnosisComponent element, int index) {
6024    if (element == null) 
6025      return;
6026    Complex t;
6027    if (Utilities.noString(parentType))
6028      t = parent;
6029    else {
6030      t = parent.predicate("fhir:"+parentType+'.'+name);
6031    }
6032    composeBackboneElement(t, "diagnosis", name, element, index);
6033    if (element.hasSequenceElement())
6034      composePositiveInt(t, "ExplanationOfBenefit", "sequence", element.getSequenceElement(), -1);
6035    if (element.hasDiagnosis())
6036      composeType(t, "ExplanationOfBenefit", "diagnosis", element.getDiagnosis(), -1);
6037    for (int i = 0; i < element.getType().size(); i++)
6038      composeCodeableConcept(t, "ExplanationOfBenefit", "type", element.getType().get(i), i);
6039    if (element.hasPackageCode())
6040      composeCodeableConcept(t, "ExplanationOfBenefit", "packageCode", element.getPackageCode(), -1);
6041  }
6042
6043  protected void composeExplanationOfBenefitProcedureComponent(Complex parent, String parentType, String name, ExplanationOfBenefit.ProcedureComponent element, int index) {
6044    if (element == null) 
6045      return;
6046    Complex t;
6047    if (Utilities.noString(parentType))
6048      t = parent;
6049    else {
6050      t = parent.predicate("fhir:"+parentType+'.'+name);
6051    }
6052    composeBackboneElement(t, "procedure", name, element, index);
6053    if (element.hasSequenceElement())
6054      composePositiveInt(t, "ExplanationOfBenefit", "sequence", element.getSequenceElement(), -1);
6055    if (element.hasDateElement())
6056      composeDateTime(t, "ExplanationOfBenefit", "date", element.getDateElement(), -1);
6057    if (element.hasProcedure())
6058      composeType(t, "ExplanationOfBenefit", "procedure", element.getProcedure(), -1);
6059  }
6060
6061  protected void composeExplanationOfBenefitInsuranceComponent(Complex parent, String parentType, String name, ExplanationOfBenefit.InsuranceComponent element, int index) {
6062    if (element == null) 
6063      return;
6064    Complex t;
6065    if (Utilities.noString(parentType))
6066      t = parent;
6067    else {
6068      t = parent.predicate("fhir:"+parentType+'.'+name);
6069    }
6070    composeBackboneElement(t, "insurance", name, element, index);
6071    if (element.hasCoverage())
6072      composeReference(t, "ExplanationOfBenefit", "coverage", element.getCoverage(), -1);
6073    for (int i = 0; i < element.getPreAuthRef().size(); i++)
6074      composeString(t, "ExplanationOfBenefit", "preAuthRef", element.getPreAuthRef().get(i), i);
6075  }
6076
6077  protected void composeExplanationOfBenefitAccidentComponent(Complex parent, String parentType, String name, ExplanationOfBenefit.AccidentComponent element, int index) {
6078    if (element == null) 
6079      return;
6080    Complex t;
6081    if (Utilities.noString(parentType))
6082      t = parent;
6083    else {
6084      t = parent.predicate("fhir:"+parentType+'.'+name);
6085    }
6086    composeBackboneElement(t, "accident", name, element, index);
6087    if (element.hasDateElement())
6088      composeDate(t, "ExplanationOfBenefit", "date", element.getDateElement(), -1);
6089    if (element.hasType())
6090      composeCodeableConcept(t, "ExplanationOfBenefit", "type", element.getType(), -1);
6091    if (element.hasLocation())
6092      composeType(t, "ExplanationOfBenefit", "location", element.getLocation(), -1);
6093  }
6094
6095  protected void composeExplanationOfBenefitItemComponent(Complex parent, String parentType, String name, ExplanationOfBenefit.ItemComponent element, int index) {
6096    if (element == null) 
6097      return;
6098    Complex t;
6099    if (Utilities.noString(parentType))
6100      t = parent;
6101    else {
6102      t = parent.predicate("fhir:"+parentType+'.'+name);
6103    }
6104    composeBackboneElement(t, "item", name, element, index);
6105    if (element.hasSequenceElement())
6106      composePositiveInt(t, "ExplanationOfBenefit", "sequence", element.getSequenceElement(), -1);
6107    for (int i = 0; i < element.getCareTeamLinkId().size(); i++)
6108      composePositiveInt(t, "ExplanationOfBenefit", "careTeamLinkId", element.getCareTeamLinkId().get(i), i);
6109    for (int i = 0; i < element.getDiagnosisLinkId().size(); i++)
6110      composePositiveInt(t, "ExplanationOfBenefit", "diagnosisLinkId", element.getDiagnosisLinkId().get(i), i);
6111    for (int i = 0; i < element.getProcedureLinkId().size(); i++)
6112      composePositiveInt(t, "ExplanationOfBenefit", "procedureLinkId", element.getProcedureLinkId().get(i), i);
6113    for (int i = 0; i < element.getInformationLinkId().size(); i++)
6114      composePositiveInt(t, "ExplanationOfBenefit", "informationLinkId", element.getInformationLinkId().get(i), i);
6115    if (element.hasRevenue())
6116      composeCodeableConcept(t, "ExplanationOfBenefit", "revenue", element.getRevenue(), -1);
6117    if (element.hasCategory())
6118      composeCodeableConcept(t, "ExplanationOfBenefit", "category", element.getCategory(), -1);
6119    if (element.hasService())
6120      composeCodeableConcept(t, "ExplanationOfBenefit", "service", element.getService(), -1);
6121    for (int i = 0; i < element.getModifier().size(); i++)
6122      composeCodeableConcept(t, "ExplanationOfBenefit", "modifier", element.getModifier().get(i), i);
6123    for (int i = 0; i < element.getProgramCode().size(); i++)
6124      composeCodeableConcept(t, "ExplanationOfBenefit", "programCode", element.getProgramCode().get(i), i);
6125    if (element.hasServiced())
6126      composeType(t, "ExplanationOfBenefit", "serviced", element.getServiced(), -1);
6127    if (element.hasLocation())
6128      composeType(t, "ExplanationOfBenefit", "location", element.getLocation(), -1);
6129    if (element.hasQuantity())
6130      composeQuantity(t, "ExplanationOfBenefit", "quantity", element.getQuantity(), -1);
6131    if (element.hasUnitPrice())
6132      composeMoney(t, "ExplanationOfBenefit", "unitPrice", element.getUnitPrice(), -1);
6133    if (element.hasFactorElement())
6134      composeDecimal(t, "ExplanationOfBenefit", "factor", element.getFactorElement(), -1);
6135    if (element.hasNet())
6136      composeMoney(t, "ExplanationOfBenefit", "net", element.getNet(), -1);
6137    for (int i = 0; i < element.getUdi().size(); i++)
6138      composeReference(t, "ExplanationOfBenefit", "udi", element.getUdi().get(i), i);
6139    if (element.hasBodySite())
6140      composeCodeableConcept(t, "ExplanationOfBenefit", "bodySite", element.getBodySite(), -1);
6141    for (int i = 0; i < element.getSubSite().size(); i++)
6142      composeCodeableConcept(t, "ExplanationOfBenefit", "subSite", element.getSubSite().get(i), i);
6143    for (int i = 0; i < element.getEncounter().size(); i++)
6144      composeReference(t, "ExplanationOfBenefit", "encounter", element.getEncounter().get(i), i);
6145    for (int i = 0; i < element.getNoteNumber().size(); i++)
6146      composePositiveInt(t, "ExplanationOfBenefit", "noteNumber", element.getNoteNumber().get(i), i);
6147    for (int i = 0; i < element.getAdjudication().size(); i++)
6148      composeExplanationOfBenefitAdjudicationComponent(t, "ExplanationOfBenefit", "adjudication", element.getAdjudication().get(i), i);
6149    for (int i = 0; i < element.getDetail().size(); i++)
6150      composeExplanationOfBenefitDetailComponent(t, "ExplanationOfBenefit", "detail", element.getDetail().get(i), i);
6151  }
6152
6153  protected void composeExplanationOfBenefitAdjudicationComponent(Complex parent, String parentType, String name, ExplanationOfBenefit.AdjudicationComponent element, int index) {
6154    if (element == null) 
6155      return;
6156    Complex t;
6157    if (Utilities.noString(parentType))
6158      t = parent;
6159    else {
6160      t = parent.predicate("fhir:"+parentType+'.'+name);
6161    }
6162    composeBackboneElement(t, "adjudication", name, element, index);
6163    if (element.hasCategory())
6164      composeCodeableConcept(t, "ExplanationOfBenefit", "category", element.getCategory(), -1);
6165    if (element.hasReason())
6166      composeCodeableConcept(t, "ExplanationOfBenefit", "reason", element.getReason(), -1);
6167    if (element.hasAmount())
6168      composeMoney(t, "ExplanationOfBenefit", "amount", element.getAmount(), -1);
6169    if (element.hasValueElement())
6170      composeDecimal(t, "ExplanationOfBenefit", "value", element.getValueElement(), -1);
6171  }
6172
6173  protected void composeExplanationOfBenefitDetailComponent(Complex parent, String parentType, String name, ExplanationOfBenefit.DetailComponent element, int index) {
6174    if (element == null) 
6175      return;
6176    Complex t;
6177    if (Utilities.noString(parentType))
6178      t = parent;
6179    else {
6180      t = parent.predicate("fhir:"+parentType+'.'+name);
6181    }
6182    composeBackboneElement(t, "detail", name, element, index);
6183    if (element.hasSequenceElement())
6184      composePositiveInt(t, "ExplanationOfBenefit", "sequence", element.getSequenceElement(), -1);
6185    if (element.hasType())
6186      composeCodeableConcept(t, "ExplanationOfBenefit", "type", element.getType(), -1);
6187    if (element.hasRevenue())
6188      composeCodeableConcept(t, "ExplanationOfBenefit", "revenue", element.getRevenue(), -1);
6189    if (element.hasCategory())
6190      composeCodeableConcept(t, "ExplanationOfBenefit", "category", element.getCategory(), -1);
6191    if (element.hasService())
6192      composeCodeableConcept(t, "ExplanationOfBenefit", "service", element.getService(), -1);
6193    for (int i = 0; i < element.getModifier().size(); i++)
6194      composeCodeableConcept(t, "ExplanationOfBenefit", "modifier", element.getModifier().get(i), i);
6195    for (int i = 0; i < element.getProgramCode().size(); i++)
6196      composeCodeableConcept(t, "ExplanationOfBenefit", "programCode", element.getProgramCode().get(i), i);
6197    if (element.hasQuantity())
6198      composeQuantity(t, "ExplanationOfBenefit", "quantity", element.getQuantity(), -1);
6199    if (element.hasUnitPrice())
6200      composeMoney(t, "ExplanationOfBenefit", "unitPrice", element.getUnitPrice(), -1);
6201    if (element.hasFactorElement())
6202      composeDecimal(t, "ExplanationOfBenefit", "factor", element.getFactorElement(), -1);
6203    if (element.hasNet())
6204      composeMoney(t, "ExplanationOfBenefit", "net", element.getNet(), -1);
6205    for (int i = 0; i < element.getUdi().size(); i++)
6206      composeReference(t, "ExplanationOfBenefit", "udi", element.getUdi().get(i), i);
6207    for (int i = 0; i < element.getNoteNumber().size(); i++)
6208      composePositiveInt(t, "ExplanationOfBenefit", "noteNumber", element.getNoteNumber().get(i), i);
6209    for (int i = 0; i < element.getAdjudication().size(); i++)
6210      composeExplanationOfBenefitAdjudicationComponent(t, "ExplanationOfBenefit", "adjudication", element.getAdjudication().get(i), i);
6211    for (int i = 0; i < element.getSubDetail().size(); i++)
6212      composeExplanationOfBenefitSubDetailComponent(t, "ExplanationOfBenefit", "subDetail", element.getSubDetail().get(i), i);
6213  }
6214
6215  protected void composeExplanationOfBenefitSubDetailComponent(Complex parent, String parentType, String name, ExplanationOfBenefit.SubDetailComponent element, int index) {
6216    if (element == null) 
6217      return;
6218    Complex t;
6219    if (Utilities.noString(parentType))
6220      t = parent;
6221    else {
6222      t = parent.predicate("fhir:"+parentType+'.'+name);
6223    }
6224    composeBackboneElement(t, "subDetail", name, element, index);
6225    if (element.hasSequenceElement())
6226      composePositiveInt(t, "ExplanationOfBenefit", "sequence", element.getSequenceElement(), -1);
6227    if (element.hasType())
6228      composeCodeableConcept(t, "ExplanationOfBenefit", "type", element.getType(), -1);
6229    if (element.hasRevenue())
6230      composeCodeableConcept(t, "ExplanationOfBenefit", "revenue", element.getRevenue(), -1);
6231    if (element.hasCategory())
6232      composeCodeableConcept(t, "ExplanationOfBenefit", "category", element.getCategory(), -1);
6233    if (element.hasService())
6234      composeCodeableConcept(t, "ExplanationOfBenefit", "service", element.getService(), -1);
6235    for (int i = 0; i < element.getModifier().size(); i++)
6236      composeCodeableConcept(t, "ExplanationOfBenefit", "modifier", element.getModifier().get(i), i);
6237    for (int i = 0; i < element.getProgramCode().size(); i++)
6238      composeCodeableConcept(t, "ExplanationOfBenefit", "programCode", element.getProgramCode().get(i), i);
6239    if (element.hasQuantity())
6240      composeQuantity(t, "ExplanationOfBenefit", "quantity", element.getQuantity(), -1);
6241    if (element.hasUnitPrice())
6242      composeMoney(t, "ExplanationOfBenefit", "unitPrice", element.getUnitPrice(), -1);
6243    if (element.hasFactorElement())
6244      composeDecimal(t, "ExplanationOfBenefit", "factor", element.getFactorElement(), -1);
6245    if (element.hasNet())
6246      composeMoney(t, "ExplanationOfBenefit", "net", element.getNet(), -1);
6247    for (int i = 0; i < element.getUdi().size(); i++)
6248      composeReference(t, "ExplanationOfBenefit", "udi", element.getUdi().get(i), i);
6249    for (int i = 0; i < element.getNoteNumber().size(); i++)
6250      composePositiveInt(t, "ExplanationOfBenefit", "noteNumber", element.getNoteNumber().get(i), i);
6251    for (int i = 0; i < element.getAdjudication().size(); i++)
6252      composeExplanationOfBenefitAdjudicationComponent(t, "ExplanationOfBenefit", "adjudication", element.getAdjudication().get(i), i);
6253  }
6254
6255  protected void composeExplanationOfBenefitAddedItemComponent(Complex parent, String parentType, String name, ExplanationOfBenefit.AddedItemComponent element, int index) {
6256    if (element == null) 
6257      return;
6258    Complex t;
6259    if (Utilities.noString(parentType))
6260      t = parent;
6261    else {
6262      t = parent.predicate("fhir:"+parentType+'.'+name);
6263    }
6264    composeBackboneElement(t, "addItem", name, element, index);
6265    for (int i = 0; i < element.getSequenceLinkId().size(); i++)
6266      composePositiveInt(t, "ExplanationOfBenefit", "sequenceLinkId", element.getSequenceLinkId().get(i), i);
6267    if (element.hasRevenue())
6268      composeCodeableConcept(t, "ExplanationOfBenefit", "revenue", element.getRevenue(), -1);
6269    if (element.hasCategory())
6270      composeCodeableConcept(t, "ExplanationOfBenefit", "category", element.getCategory(), -1);
6271    if (element.hasService())
6272      composeCodeableConcept(t, "ExplanationOfBenefit", "service", element.getService(), -1);
6273    for (int i = 0; i < element.getModifier().size(); i++)
6274      composeCodeableConcept(t, "ExplanationOfBenefit", "modifier", element.getModifier().get(i), i);
6275    if (element.hasFee())
6276      composeMoney(t, "ExplanationOfBenefit", "fee", element.getFee(), -1);
6277    for (int i = 0; i < element.getNoteNumber().size(); i++)
6278      composePositiveInt(t, "ExplanationOfBenefit", "noteNumber", element.getNoteNumber().get(i), i);
6279    for (int i = 0; i < element.getAdjudication().size(); i++)
6280      composeExplanationOfBenefitAdjudicationComponent(t, "ExplanationOfBenefit", "adjudication", element.getAdjudication().get(i), i);
6281    for (int i = 0; i < element.getDetail().size(); i++)
6282      composeExplanationOfBenefitAddedItemsDetailComponent(t, "ExplanationOfBenefit", "detail", element.getDetail().get(i), i);
6283  }
6284
6285  protected void composeExplanationOfBenefitAddedItemsDetailComponent(Complex parent, String parentType, String name, ExplanationOfBenefit.AddedItemsDetailComponent element, int index) {
6286    if (element == null) 
6287      return;
6288    Complex t;
6289    if (Utilities.noString(parentType))
6290      t = parent;
6291    else {
6292      t = parent.predicate("fhir:"+parentType+'.'+name);
6293    }
6294    composeBackboneElement(t, "detail", name, element, index);
6295    if (element.hasRevenue())
6296      composeCodeableConcept(t, "ExplanationOfBenefit", "revenue", element.getRevenue(), -1);
6297    if (element.hasCategory())
6298      composeCodeableConcept(t, "ExplanationOfBenefit", "category", element.getCategory(), -1);
6299    if (element.hasService())
6300      composeCodeableConcept(t, "ExplanationOfBenefit", "service", element.getService(), -1);
6301    for (int i = 0; i < element.getModifier().size(); i++)
6302      composeCodeableConcept(t, "ExplanationOfBenefit", "modifier", element.getModifier().get(i), i);
6303    if (element.hasFee())
6304      composeMoney(t, "ExplanationOfBenefit", "fee", element.getFee(), -1);
6305    for (int i = 0; i < element.getNoteNumber().size(); i++)
6306      composePositiveInt(t, "ExplanationOfBenefit", "noteNumber", element.getNoteNumber().get(i), i);
6307    for (int i = 0; i < element.getAdjudication().size(); i++)
6308      composeExplanationOfBenefitAdjudicationComponent(t, "ExplanationOfBenefit", "adjudication", element.getAdjudication().get(i), i);
6309  }
6310
6311  protected void composeExplanationOfBenefitPaymentComponent(Complex parent, String parentType, String name, ExplanationOfBenefit.PaymentComponent element, int index) {
6312    if (element == null) 
6313      return;
6314    Complex t;
6315    if (Utilities.noString(parentType))
6316      t = parent;
6317    else {
6318      t = parent.predicate("fhir:"+parentType+'.'+name);
6319    }
6320    composeBackboneElement(t, "payment", name, element, index);
6321    if (element.hasType())
6322      composeCodeableConcept(t, "ExplanationOfBenefit", "type", element.getType(), -1);
6323    if (element.hasAdjustment())
6324      composeMoney(t, "ExplanationOfBenefit", "adjustment", element.getAdjustment(), -1);
6325    if (element.hasAdjustmentReason())
6326      composeCodeableConcept(t, "ExplanationOfBenefit", "adjustmentReason", element.getAdjustmentReason(), -1);
6327    if (element.hasDateElement())
6328      composeDate(t, "ExplanationOfBenefit", "date", element.getDateElement(), -1);
6329    if (element.hasAmount())
6330      composeMoney(t, "ExplanationOfBenefit", "amount", element.getAmount(), -1);
6331    if (element.hasIdentifier())
6332      composeIdentifier(t, "ExplanationOfBenefit", "identifier", element.getIdentifier(), -1);
6333  }
6334
6335  protected void composeExplanationOfBenefitNoteComponent(Complex parent, String parentType, String name, ExplanationOfBenefit.NoteComponent element, int index) {
6336    if (element == null) 
6337      return;
6338    Complex t;
6339    if (Utilities.noString(parentType))
6340      t = parent;
6341    else {
6342      t = parent.predicate("fhir:"+parentType+'.'+name);
6343    }
6344    composeBackboneElement(t, "processNote", name, element, index);
6345    if (element.hasNumberElement())
6346      composePositiveInt(t, "ExplanationOfBenefit", "number", element.getNumberElement(), -1);
6347    if (element.hasType())
6348      composeCodeableConcept(t, "ExplanationOfBenefit", "type", element.getType(), -1);
6349    if (element.hasTextElement())
6350      composeString(t, "ExplanationOfBenefit", "text", element.getTextElement(), -1);
6351    if (element.hasLanguage())
6352      composeCodeableConcept(t, "ExplanationOfBenefit", "language", element.getLanguage(), -1);
6353  }
6354
6355  protected void composeExplanationOfBenefitBenefitBalanceComponent(Complex parent, String parentType, String name, ExplanationOfBenefit.BenefitBalanceComponent element, int index) {
6356    if (element == null) 
6357      return;
6358    Complex t;
6359    if (Utilities.noString(parentType))
6360      t = parent;
6361    else {
6362      t = parent.predicate("fhir:"+parentType+'.'+name);
6363    }
6364    composeBackboneElement(t, "benefitBalance", name, element, index);
6365    if (element.hasCategory())
6366      composeCodeableConcept(t, "ExplanationOfBenefit", "category", element.getCategory(), -1);
6367    if (element.hasSubCategory())
6368      composeCodeableConcept(t, "ExplanationOfBenefit", "subCategory", element.getSubCategory(), -1);
6369    if (element.hasExcludedElement())
6370      composeBoolean(t, "ExplanationOfBenefit", "excluded", element.getExcludedElement(), -1);
6371    if (element.hasNameElement())
6372      composeString(t, "ExplanationOfBenefit", "name", element.getNameElement(), -1);
6373    if (element.hasDescriptionElement())
6374      composeString(t, "ExplanationOfBenefit", "description", element.getDescriptionElement(), -1);
6375    if (element.hasNetwork())
6376      composeCodeableConcept(t, "ExplanationOfBenefit", "network", element.getNetwork(), -1);
6377    if (element.hasUnit())
6378      composeCodeableConcept(t, "ExplanationOfBenefit", "unit", element.getUnit(), -1);
6379    if (element.hasTerm())
6380      composeCodeableConcept(t, "ExplanationOfBenefit", "term", element.getTerm(), -1);
6381    for (int i = 0; i < element.getFinancial().size(); i++)
6382      composeExplanationOfBenefitBenefitComponent(t, "ExplanationOfBenefit", "financial", element.getFinancial().get(i), i);
6383  }
6384
6385  protected void composeExplanationOfBenefitBenefitComponent(Complex parent, String parentType, String name, ExplanationOfBenefit.BenefitComponent 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, "financial", name, element, index);
6395    if (element.hasType())
6396      composeCodeableConcept(t, "ExplanationOfBenefit", "type", element.getType(), -1);
6397    if (element.hasAllowed())
6398      composeType(t, "ExplanationOfBenefit", "allowed", element.getAllowed(), -1);
6399    if (element.hasUsed())
6400      composeType(t, "ExplanationOfBenefit", "used", element.getUsed(), -1);
6401  }
6402
6403  protected void composeFamilyMemberHistory(Complex parent, String parentType, String name, FamilyMemberHistory element, int index) {
6404    if (element == null) 
6405      return;
6406    Complex t;
6407    if (Utilities.noString(parentType))
6408      t = parent;
6409    else {
6410      t = parent.predicate("fhir:"+parentType+'.'+name);
6411    }
6412    composeDomainResource(t, "FamilyMemberHistory", name, element, index);
6413    for (int i = 0; i < element.getIdentifier().size(); i++)
6414      composeIdentifier(t, "FamilyMemberHistory", "identifier", element.getIdentifier().get(i), i);
6415    for (int i = 0; i < element.getDefinition().size(); i++)
6416      composeReference(t, "FamilyMemberHistory", "definition", element.getDefinition().get(i), i);
6417    if (element.hasStatusElement())
6418      composeEnum(t, "FamilyMemberHistory", "status", element.getStatusElement(), -1);
6419    if (element.hasNotDoneElement())
6420      composeBoolean(t, "FamilyMemberHistory", "notDone", element.getNotDoneElement(), -1);
6421    if (element.hasNotDoneReason())
6422      composeCodeableConcept(t, "FamilyMemberHistory", "notDoneReason", element.getNotDoneReason(), -1);
6423    if (element.hasPatient())
6424      composeReference(t, "FamilyMemberHistory", "patient", element.getPatient(), -1);
6425    if (element.hasDateElement())
6426      composeDateTime(t, "FamilyMemberHistory", "date", element.getDateElement(), -1);
6427    if (element.hasNameElement())
6428      composeString(t, "FamilyMemberHistory", "name", element.getNameElement(), -1);
6429    if (element.hasRelationship())
6430      composeCodeableConcept(t, "FamilyMemberHistory", "relationship", element.getRelationship(), -1);
6431    if (element.hasGenderElement())
6432      composeEnum(t, "FamilyMemberHistory", "gender", element.getGenderElement(), -1);
6433    if (element.hasBorn())
6434      composeType(t, "FamilyMemberHistory", "born", element.getBorn(), -1);
6435    if (element.hasAge())
6436      composeType(t, "FamilyMemberHistory", "age", element.getAge(), -1);
6437    if (element.hasEstimatedAgeElement())
6438      composeBoolean(t, "FamilyMemberHistory", "estimatedAge", element.getEstimatedAgeElement(), -1);
6439    if (element.hasDeceased())
6440      composeType(t, "FamilyMemberHistory", "deceased", element.getDeceased(), -1);
6441    for (int i = 0; i < element.getReasonCode().size(); i++)
6442      composeCodeableConcept(t, "FamilyMemberHistory", "reasonCode", element.getReasonCode().get(i), i);
6443    for (int i = 0; i < element.getReasonReference().size(); i++)
6444      composeReference(t, "FamilyMemberHistory", "reasonReference", element.getReasonReference().get(i), i);
6445    for (int i = 0; i < element.getNote().size(); i++)
6446      composeAnnotation(t, "FamilyMemberHistory", "note", element.getNote().get(i), i);
6447    for (int i = 0; i < element.getCondition().size(); i++)
6448      composeFamilyMemberHistoryFamilyMemberHistoryConditionComponent(t, "FamilyMemberHistory", "condition", element.getCondition().get(i), i);
6449  }
6450
6451  protected void composeFamilyMemberHistoryFamilyMemberHistoryConditionComponent(Complex parent, String parentType, String name, FamilyMemberHistory.FamilyMemberHistoryConditionComponent element, int index) {
6452    if (element == null) 
6453      return;
6454    Complex t;
6455    if (Utilities.noString(parentType))
6456      t = parent;
6457    else {
6458      t = parent.predicate("fhir:"+parentType+'.'+name);
6459    }
6460    composeBackboneElement(t, "condition", name, element, index);
6461    if (element.hasCode())
6462      composeCodeableConcept(t, "FamilyMemberHistory", "code", element.getCode(), -1);
6463    if (element.hasOutcome())
6464      composeCodeableConcept(t, "FamilyMemberHistory", "outcome", element.getOutcome(), -1);
6465    if (element.hasOnset())
6466      composeType(t, "FamilyMemberHistory", "onset", element.getOnset(), -1);
6467    for (int i = 0; i < element.getNote().size(); i++)
6468      composeAnnotation(t, "FamilyMemberHistory", "note", element.getNote().get(i), i);
6469  }
6470
6471  protected void composeFlag(Complex parent, String parentType, String name, Flag element, int index) {
6472    if (element == null) 
6473      return;
6474    Complex t;
6475    if (Utilities.noString(parentType))
6476      t = parent;
6477    else {
6478      t = parent.predicate("fhir:"+parentType+'.'+name);
6479    }
6480    composeDomainResource(t, "Flag", name, element, index);
6481    for (int i = 0; i < element.getIdentifier().size(); i++)
6482      composeIdentifier(t, "Flag", "identifier", element.getIdentifier().get(i), i);
6483    if (element.hasStatusElement())
6484      composeEnum(t, "Flag", "status", element.getStatusElement(), -1);
6485    if (element.hasCategory())
6486      composeCodeableConcept(t, "Flag", "category", element.getCategory(), -1);
6487    if (element.hasCode())
6488      composeCodeableConcept(t, "Flag", "code", element.getCode(), -1);
6489    if (element.hasSubject())
6490      composeReference(t, "Flag", "subject", element.getSubject(), -1);
6491    if (element.hasPeriod())
6492      composePeriod(t, "Flag", "period", element.getPeriod(), -1);
6493    if (element.hasEncounter())
6494      composeReference(t, "Flag", "encounter", element.getEncounter(), -1);
6495    if (element.hasAuthor())
6496      composeReference(t, "Flag", "author", element.getAuthor(), -1);
6497  }
6498
6499  protected void composeGoal(Complex parent, String parentType, String name, Goal element, int index) {
6500    if (element == null) 
6501      return;
6502    Complex t;
6503    if (Utilities.noString(parentType))
6504      t = parent;
6505    else {
6506      t = parent.predicate("fhir:"+parentType+'.'+name);
6507    }
6508    composeDomainResource(t, "Goal", name, element, index);
6509    for (int i = 0; i < element.getIdentifier().size(); i++)
6510      composeIdentifier(t, "Goal", "identifier", element.getIdentifier().get(i), i);
6511    if (element.hasStatusElement())
6512      composeEnum(t, "Goal", "status", element.getStatusElement(), -1);
6513    for (int i = 0; i < element.getCategory().size(); i++)
6514      composeCodeableConcept(t, "Goal", "category", element.getCategory().get(i), i);
6515    if (element.hasPriority())
6516      composeCodeableConcept(t, "Goal", "priority", element.getPriority(), -1);
6517    if (element.hasDescription())
6518      composeCodeableConcept(t, "Goal", "description", element.getDescription(), -1);
6519    if (element.hasSubject())
6520      composeReference(t, "Goal", "subject", element.getSubject(), -1);
6521    if (element.hasStart())
6522      composeType(t, "Goal", "start", element.getStart(), -1);
6523    if (element.hasTarget())
6524      composeGoalGoalTargetComponent(t, "Goal", "target", element.getTarget(), -1);
6525    if (element.hasStatusDateElement())
6526      composeDate(t, "Goal", "statusDate", element.getStatusDateElement(), -1);
6527    if (element.hasStatusReasonElement())
6528      composeString(t, "Goal", "statusReason", element.getStatusReasonElement(), -1);
6529    if (element.hasExpressedBy())
6530      composeReference(t, "Goal", "expressedBy", element.getExpressedBy(), -1);
6531    for (int i = 0; i < element.getAddresses().size(); i++)
6532      composeReference(t, "Goal", "addresses", element.getAddresses().get(i), i);
6533    for (int i = 0; i < element.getNote().size(); i++)
6534      composeAnnotation(t, "Goal", "note", element.getNote().get(i), i);
6535    for (int i = 0; i < element.getOutcomeCode().size(); i++)
6536      composeCodeableConcept(t, "Goal", "outcomeCode", element.getOutcomeCode().get(i), i);
6537    for (int i = 0; i < element.getOutcomeReference().size(); i++)
6538      composeReference(t, "Goal", "outcomeReference", element.getOutcomeReference().get(i), i);
6539  }
6540
6541  protected void composeGoalGoalTargetComponent(Complex parent, String parentType, String name, Goal.GoalTargetComponent element, int index) {
6542    if (element == null) 
6543      return;
6544    Complex t;
6545    if (Utilities.noString(parentType))
6546      t = parent;
6547    else {
6548      t = parent.predicate("fhir:"+parentType+'.'+name);
6549    }
6550    composeBackboneElement(t, "target", name, element, index);
6551    if (element.hasMeasure())
6552      composeCodeableConcept(t, "Goal", "measure", element.getMeasure(), -1);
6553    if (element.hasDetail())
6554      composeType(t, "Goal", "detail", element.getDetail(), -1);
6555    if (element.hasDue())
6556      composeType(t, "Goal", "due", element.getDue(), -1);
6557  }
6558
6559  protected void composeGraphDefinition(Complex parent, String parentType, String name, GraphDefinition element, int index) {
6560    if (element == null) 
6561      return;
6562    Complex t;
6563    if (Utilities.noString(parentType))
6564      t = parent;
6565    else {
6566      t = parent.predicate("fhir:"+parentType+'.'+name);
6567    }
6568    composeDomainResource(t, "GraphDefinition", name, element, index);
6569    if (element.hasUrlElement())
6570      composeUri(t, "GraphDefinition", "url", element.getUrlElement(), -1);
6571    if (element.hasVersionElement())
6572      composeString(t, "GraphDefinition", "version", element.getVersionElement(), -1);
6573    if (element.hasNameElement())
6574      composeString(t, "GraphDefinition", "name", element.getNameElement(), -1);
6575    if (element.hasStatusElement())
6576      composeEnum(t, "GraphDefinition", "status", element.getStatusElement(), -1);
6577    if (element.hasExperimentalElement())
6578      composeBoolean(t, "GraphDefinition", "experimental", element.getExperimentalElement(), -1);
6579    if (element.hasDateElement())
6580      composeDateTime(t, "GraphDefinition", "date", element.getDateElement(), -1);
6581    if (element.hasPublisherElement())
6582      composeString(t, "GraphDefinition", "publisher", element.getPublisherElement(), -1);
6583    for (int i = 0; i < element.getContact().size(); i++)
6584      composeContactDetail(t, "GraphDefinition", "contact", element.getContact().get(i), i);
6585    if (element.hasDescriptionElement())
6586      composeMarkdown(t, "GraphDefinition", "description", element.getDescriptionElement(), -1);
6587    for (int i = 0; i < element.getUseContext().size(); i++)
6588      composeUsageContext(t, "GraphDefinition", "useContext", element.getUseContext().get(i), i);
6589    for (int i = 0; i < element.getJurisdiction().size(); i++)
6590      composeCodeableConcept(t, "GraphDefinition", "jurisdiction", element.getJurisdiction().get(i), i);
6591    if (element.hasPurposeElement())
6592      composeMarkdown(t, "GraphDefinition", "purpose", element.getPurposeElement(), -1);
6593    if (element.hasStartElement())
6594      composeCode(t, "GraphDefinition", "start", element.getStartElement(), -1);
6595    if (element.hasProfileElement())
6596      composeUri(t, "GraphDefinition", "profile", element.getProfileElement(), -1);
6597    for (int i = 0; i < element.getLink().size(); i++)
6598      composeGraphDefinitionGraphDefinitionLinkComponent(t, "GraphDefinition", "link", element.getLink().get(i), i);
6599  }
6600
6601  protected void composeGraphDefinitionGraphDefinitionLinkComponent(Complex parent, String parentType, String name, GraphDefinition.GraphDefinitionLinkComponent element, int index) {
6602    if (element == null) 
6603      return;
6604    Complex t;
6605    if (Utilities.noString(parentType))
6606      t = parent;
6607    else {
6608      t = parent.predicate("fhir:"+parentType+'.'+name);
6609    }
6610    composeBackboneElement(t, "link", name, element, index);
6611    if (element.hasPathElement())
6612      composeString(t, "GraphDefinition", "path", element.getPathElement(), -1);
6613    if (element.hasSliceNameElement())
6614      composeString(t, "GraphDefinition", "sliceName", element.getSliceNameElement(), -1);
6615    if (element.hasMinElement())
6616      composeInteger(t, "GraphDefinition", "min", element.getMinElement(), -1);
6617    if (element.hasMaxElement())
6618      composeString(t, "GraphDefinition", "max", element.getMaxElement(), -1);
6619    if (element.hasDescriptionElement())
6620      composeString(t, "GraphDefinition", "description", element.getDescriptionElement(), -1);
6621    for (int i = 0; i < element.getTarget().size(); i++)
6622      composeGraphDefinitionGraphDefinitionLinkTargetComponent(t, "GraphDefinition", "target", element.getTarget().get(i), i);
6623  }
6624
6625  protected void composeGraphDefinitionGraphDefinitionLinkTargetComponent(Complex parent, String parentType, String name, GraphDefinition.GraphDefinitionLinkTargetComponent element, int index) {
6626    if (element == null) 
6627      return;
6628    Complex t;
6629    if (Utilities.noString(parentType))
6630      t = parent;
6631    else {
6632      t = parent.predicate("fhir:"+parentType+'.'+name);
6633    }
6634    composeBackboneElement(t, "target", name, element, index);
6635    if (element.hasTypeElement())
6636      composeCode(t, "GraphDefinition", "type", element.getTypeElement(), -1);
6637    if (element.hasProfileElement())
6638      composeUri(t, "GraphDefinition", "profile", element.getProfileElement(), -1);
6639    for (int i = 0; i < element.getCompartment().size(); i++)
6640      composeGraphDefinitionGraphDefinitionLinkTargetCompartmentComponent(t, "GraphDefinition", "compartment", element.getCompartment().get(i), i);
6641    for (int i = 0; i < element.getLink().size(); i++)
6642      composeGraphDefinitionGraphDefinitionLinkComponent(t, "GraphDefinition", "link", element.getLink().get(i), i);
6643  }
6644
6645  protected void composeGraphDefinitionGraphDefinitionLinkTargetCompartmentComponent(Complex parent, String parentType, String name, GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent element, int index) {
6646    if (element == null) 
6647      return;
6648    Complex t;
6649    if (Utilities.noString(parentType))
6650      t = parent;
6651    else {
6652      t = parent.predicate("fhir:"+parentType+'.'+name);
6653    }
6654    composeBackboneElement(t, "compartment", name, element, index);
6655    if (element.hasCodeElement())
6656      composeEnum(t, "GraphDefinition", "code", element.getCodeElement(), -1);
6657    if (element.hasRuleElement())
6658      composeEnum(t, "GraphDefinition", "rule", element.getRuleElement(), -1);
6659    if (element.hasExpressionElement())
6660      composeString(t, "GraphDefinition", "expression", element.getExpressionElement(), -1);
6661    if (element.hasDescriptionElement())
6662      composeString(t, "GraphDefinition", "description", element.getDescriptionElement(), -1);
6663  }
6664
6665  protected void composeGroup(Complex parent, String parentType, String name, Group element, int index) {
6666    if (element == null) 
6667      return;
6668    Complex t;
6669    if (Utilities.noString(parentType))
6670      t = parent;
6671    else {
6672      t = parent.predicate("fhir:"+parentType+'.'+name);
6673    }
6674    composeDomainResource(t, "Group", name, element, index);
6675    for (int i = 0; i < element.getIdentifier().size(); i++)
6676      composeIdentifier(t, "Group", "identifier", element.getIdentifier().get(i), i);
6677    if (element.hasActiveElement())
6678      composeBoolean(t, "Group", "active", element.getActiveElement(), -1);
6679    if (element.hasTypeElement())
6680      composeEnum(t, "Group", "type", element.getTypeElement(), -1);
6681    if (element.hasActualElement())
6682      composeBoolean(t, "Group", "actual", element.getActualElement(), -1);
6683    if (element.hasCode())
6684      composeCodeableConcept(t, "Group", "code", element.getCode(), -1);
6685    if (element.hasNameElement())
6686      composeString(t, "Group", "name", element.getNameElement(), -1);
6687    if (element.hasQuantityElement())
6688      composeUnsignedInt(t, "Group", "quantity", element.getQuantityElement(), -1);
6689    for (int i = 0; i < element.getCharacteristic().size(); i++)
6690      composeGroupGroupCharacteristicComponent(t, "Group", "characteristic", element.getCharacteristic().get(i), i);
6691    for (int i = 0; i < element.getMember().size(); i++)
6692      composeGroupGroupMemberComponent(t, "Group", "member", element.getMember().get(i), i);
6693  }
6694
6695  protected void composeGroupGroupCharacteristicComponent(Complex parent, String parentType, String name, Group.GroupCharacteristicComponent element, int index) {
6696    if (element == null) 
6697      return;
6698    Complex t;
6699    if (Utilities.noString(parentType))
6700      t = parent;
6701    else {
6702      t = parent.predicate("fhir:"+parentType+'.'+name);
6703    }
6704    composeBackboneElement(t, "characteristic", name, element, index);
6705    if (element.hasCode())
6706      composeCodeableConcept(t, "Group", "code", element.getCode(), -1);
6707    if (element.hasValue())
6708      composeType(t, "Group", "value", element.getValue(), -1);
6709    if (element.hasExcludeElement())
6710      composeBoolean(t, "Group", "exclude", element.getExcludeElement(), -1);
6711    if (element.hasPeriod())
6712      composePeriod(t, "Group", "period", element.getPeriod(), -1);
6713  }
6714
6715  protected void composeGroupGroupMemberComponent(Complex parent, String parentType, String name, Group.GroupMemberComponent element, int index) {
6716    if (element == null) 
6717      return;
6718    Complex t;
6719    if (Utilities.noString(parentType))
6720      t = parent;
6721    else {
6722      t = parent.predicate("fhir:"+parentType+'.'+name);
6723    }
6724    composeBackboneElement(t, "member", name, element, index);
6725    if (element.hasEntity())
6726      composeReference(t, "Group", "entity", element.getEntity(), -1);
6727    if (element.hasPeriod())
6728      composePeriod(t, "Group", "period", element.getPeriod(), -1);
6729    if (element.hasInactiveElement())
6730      composeBoolean(t, "Group", "inactive", element.getInactiveElement(), -1);
6731  }
6732
6733  protected void composeGuidanceResponse(Complex parent, String parentType, String name, GuidanceResponse element, int index) {
6734    if (element == null) 
6735      return;
6736    Complex t;
6737    if (Utilities.noString(parentType))
6738      t = parent;
6739    else {
6740      t = parent.predicate("fhir:"+parentType+'.'+name);
6741    }
6742    composeDomainResource(t, "GuidanceResponse", name, element, index);
6743    if (element.hasRequestIdElement())
6744      composeId(t, "GuidanceResponse", "requestId", element.getRequestIdElement(), -1);
6745    if (element.hasIdentifier())
6746      composeIdentifier(t, "GuidanceResponse", "identifier", element.getIdentifier(), -1);
6747    if (element.hasModule())
6748      composeReference(t, "GuidanceResponse", "module", element.getModule(), -1);
6749    if (element.hasStatusElement())
6750      composeEnum(t, "GuidanceResponse", "status", element.getStatusElement(), -1);
6751    if (element.hasSubject())
6752      composeReference(t, "GuidanceResponse", "subject", element.getSubject(), -1);
6753    if (element.hasContext())
6754      composeReference(t, "GuidanceResponse", "context", element.getContext(), -1);
6755    if (element.hasOccurrenceDateTimeElement())
6756      composeDateTime(t, "GuidanceResponse", "occurrenceDateTime", element.getOccurrenceDateTimeElement(), -1);
6757    if (element.hasPerformer())
6758      composeReference(t, "GuidanceResponse", "performer", element.getPerformer(), -1);
6759    if (element.hasReason())
6760      composeType(t, "GuidanceResponse", "reason", element.getReason(), -1);
6761    for (int i = 0; i < element.getNote().size(); i++)
6762      composeAnnotation(t, "GuidanceResponse", "note", element.getNote().get(i), i);
6763    for (int i = 0; i < element.getEvaluationMessage().size(); i++)
6764      composeReference(t, "GuidanceResponse", "evaluationMessage", element.getEvaluationMessage().get(i), i);
6765    if (element.hasOutputParameters())
6766      composeReference(t, "GuidanceResponse", "outputParameters", element.getOutputParameters(), -1);
6767    if (element.hasResult())
6768      composeReference(t, "GuidanceResponse", "result", element.getResult(), -1);
6769    for (int i = 0; i < element.getDataRequirement().size(); i++)
6770      composeDataRequirement(t, "GuidanceResponse", "dataRequirement", element.getDataRequirement().get(i), i);
6771  }
6772
6773  protected void composeHealthcareService(Complex parent, String parentType, String name, HealthcareService element, int index) {
6774    if (element == null) 
6775      return;
6776    Complex t;
6777    if (Utilities.noString(parentType))
6778      t = parent;
6779    else {
6780      t = parent.predicate("fhir:"+parentType+'.'+name);
6781    }
6782    composeDomainResource(t, "HealthcareService", name, element, index);
6783    for (int i = 0; i < element.getIdentifier().size(); i++)
6784      composeIdentifier(t, "HealthcareService", "identifier", element.getIdentifier().get(i), i);
6785    if (element.hasActiveElement())
6786      composeBoolean(t, "HealthcareService", "active", element.getActiveElement(), -1);
6787    if (element.hasProvidedBy())
6788      composeReference(t, "HealthcareService", "providedBy", element.getProvidedBy(), -1);
6789    if (element.hasCategory())
6790      composeCodeableConcept(t, "HealthcareService", "category", element.getCategory(), -1);
6791    for (int i = 0; i < element.getType().size(); i++)
6792      composeCodeableConcept(t, "HealthcareService", "type", element.getType().get(i), i);
6793    for (int i = 0; i < element.getSpecialty().size(); i++)
6794      composeCodeableConcept(t, "HealthcareService", "specialty", element.getSpecialty().get(i), i);
6795    for (int i = 0; i < element.getLocation().size(); i++)
6796      composeReference(t, "HealthcareService", "location", element.getLocation().get(i), i);
6797    if (element.hasNameElement())
6798      composeString(t, "HealthcareService", "name", element.getNameElement(), -1);
6799    if (element.hasCommentElement())
6800      composeString(t, "HealthcareService", "comment", element.getCommentElement(), -1);
6801    if (element.hasExtraDetailsElement())
6802      composeString(t, "HealthcareService", "extraDetails", element.getExtraDetailsElement(), -1);
6803    if (element.hasPhoto())
6804      composeAttachment(t, "HealthcareService", "photo", element.getPhoto(), -1);
6805    for (int i = 0; i < element.getTelecom().size(); i++)
6806      composeContactPoint(t, "HealthcareService", "telecom", element.getTelecom().get(i), i);
6807    for (int i = 0; i < element.getCoverageArea().size(); i++)
6808      composeReference(t, "HealthcareService", "coverageArea", element.getCoverageArea().get(i), i);
6809    for (int i = 0; i < element.getServiceProvisionCode().size(); i++)
6810      composeCodeableConcept(t, "HealthcareService", "serviceProvisionCode", element.getServiceProvisionCode().get(i), i);
6811    if (element.hasEligibility())
6812      composeCodeableConcept(t, "HealthcareService", "eligibility", element.getEligibility(), -1);
6813    if (element.hasEligibilityNoteElement())
6814      composeString(t, "HealthcareService", "eligibilityNote", element.getEligibilityNoteElement(), -1);
6815    for (int i = 0; i < element.getProgramName().size(); i++)
6816      composeString(t, "HealthcareService", "programName", element.getProgramName().get(i), i);
6817    for (int i = 0; i < element.getCharacteristic().size(); i++)
6818      composeCodeableConcept(t, "HealthcareService", "characteristic", element.getCharacteristic().get(i), i);
6819    for (int i = 0; i < element.getReferralMethod().size(); i++)
6820      composeCodeableConcept(t, "HealthcareService", "referralMethod", element.getReferralMethod().get(i), i);
6821    if (element.hasAppointmentRequiredElement())
6822      composeBoolean(t, "HealthcareService", "appointmentRequired", element.getAppointmentRequiredElement(), -1);
6823    for (int i = 0; i < element.getAvailableTime().size(); i++)
6824      composeHealthcareServiceHealthcareServiceAvailableTimeComponent(t, "HealthcareService", "availableTime", element.getAvailableTime().get(i), i);
6825    for (int i = 0; i < element.getNotAvailable().size(); i++)
6826      composeHealthcareServiceHealthcareServiceNotAvailableComponent(t, "HealthcareService", "notAvailable", element.getNotAvailable().get(i), i);
6827    if (element.hasAvailabilityExceptionsElement())
6828      composeString(t, "HealthcareService", "availabilityExceptions", element.getAvailabilityExceptionsElement(), -1);
6829    for (int i = 0; i < element.getEndpoint().size(); i++)
6830      composeReference(t, "HealthcareService", "endpoint", element.getEndpoint().get(i), i);
6831  }
6832
6833  protected void composeHealthcareServiceHealthcareServiceAvailableTimeComponent(Complex parent, String parentType, String name, HealthcareService.HealthcareServiceAvailableTimeComponent element, int index) {
6834    if (element == null) 
6835      return;
6836    Complex t;
6837    if (Utilities.noString(parentType))
6838      t = parent;
6839    else {
6840      t = parent.predicate("fhir:"+parentType+'.'+name);
6841    }
6842    composeBackboneElement(t, "availableTime", name, element, index);
6843    for (int i = 0; i < element.getDaysOfWeek().size(); i++)
6844      composeEnum(t, "HealthcareService", "daysOfWeek", element.getDaysOfWeek().get(i), i);
6845    if (element.hasAllDayElement())
6846      composeBoolean(t, "HealthcareService", "allDay", element.getAllDayElement(), -1);
6847    if (element.hasAvailableStartTimeElement())
6848      composeTime(t, "HealthcareService", "availableStartTime", element.getAvailableStartTimeElement(), -1);
6849    if (element.hasAvailableEndTimeElement())
6850      composeTime(t, "HealthcareService", "availableEndTime", element.getAvailableEndTimeElement(), -1);
6851  }
6852
6853  protected void composeHealthcareServiceHealthcareServiceNotAvailableComponent(Complex parent, String parentType, String name, HealthcareService.HealthcareServiceNotAvailableComponent element, int index) {
6854    if (element == null) 
6855      return;
6856    Complex t;
6857    if (Utilities.noString(parentType))
6858      t = parent;
6859    else {
6860      t = parent.predicate("fhir:"+parentType+'.'+name);
6861    }
6862    composeBackboneElement(t, "notAvailable", name, element, index);
6863    if (element.hasDescriptionElement())
6864      composeString(t, "HealthcareService", "description", element.getDescriptionElement(), -1);
6865    if (element.hasDuring())
6866      composePeriod(t, "HealthcareService", "during", element.getDuring(), -1);
6867  }
6868
6869  protected void composeImagingManifest(Complex parent, String parentType, String name, ImagingManifest element, int index) {
6870    if (element == null) 
6871      return;
6872    Complex t;
6873    if (Utilities.noString(parentType))
6874      t = parent;
6875    else {
6876      t = parent.predicate("fhir:"+parentType+'.'+name);
6877    }
6878    composeDomainResource(t, "ImagingManifest", name, element, index);
6879    if (element.hasIdentifier())
6880      composeIdentifier(t, "ImagingManifest", "identifier", element.getIdentifier(), -1);
6881    if (element.hasPatient())
6882      composeReference(t, "ImagingManifest", "patient", element.getPatient(), -1);
6883    if (element.hasAuthoringTimeElement())
6884      composeDateTime(t, "ImagingManifest", "authoringTime", element.getAuthoringTimeElement(), -1);
6885    if (element.hasAuthor())
6886      composeReference(t, "ImagingManifest", "author", element.getAuthor(), -1);
6887    if (element.hasDescriptionElement())
6888      composeString(t, "ImagingManifest", "description", element.getDescriptionElement(), -1);
6889    for (int i = 0; i < element.getStudy().size(); i++)
6890      composeImagingManifestStudyComponent(t, "ImagingManifest", "study", element.getStudy().get(i), i);
6891  }
6892
6893  protected void composeImagingManifestStudyComponent(Complex parent, String parentType, String name, ImagingManifest.StudyComponent element, int index) {
6894    if (element == null) 
6895      return;
6896    Complex t;
6897    if (Utilities.noString(parentType))
6898      t = parent;
6899    else {
6900      t = parent.predicate("fhir:"+parentType+'.'+name);
6901    }
6902    composeBackboneElement(t, "study", name, element, index);
6903    if (element.hasUidElement())
6904      composeOid(t, "ImagingManifest", "uid", element.getUidElement(), -1);
6905    if (element.hasImagingStudy())
6906      composeReference(t, "ImagingManifest", "imagingStudy", element.getImagingStudy(), -1);
6907    for (int i = 0; i < element.getEndpoint().size(); i++)
6908      composeReference(t, "ImagingManifest", "endpoint", element.getEndpoint().get(i), i);
6909    for (int i = 0; i < element.getSeries().size(); i++)
6910      composeImagingManifestSeriesComponent(t, "ImagingManifest", "series", element.getSeries().get(i), i);
6911  }
6912
6913  protected void composeImagingManifestSeriesComponent(Complex parent, String parentType, String name, ImagingManifest.SeriesComponent element, int index) {
6914    if (element == null) 
6915      return;
6916    Complex t;
6917    if (Utilities.noString(parentType))
6918      t = parent;
6919    else {
6920      t = parent.predicate("fhir:"+parentType+'.'+name);
6921    }
6922    composeBackboneElement(t, "series", name, element, index);
6923    if (element.hasUidElement())
6924      composeOid(t, "ImagingManifest", "uid", element.getUidElement(), -1);
6925    for (int i = 0; i < element.getEndpoint().size(); i++)
6926      composeReference(t, "ImagingManifest", "endpoint", element.getEndpoint().get(i), i);
6927    for (int i = 0; i < element.getInstance().size(); i++)
6928      composeImagingManifestInstanceComponent(t, "ImagingManifest", "instance", element.getInstance().get(i), i);
6929  }
6930
6931  protected void composeImagingManifestInstanceComponent(Complex parent, String parentType, String name, ImagingManifest.InstanceComponent element, int index) {
6932    if (element == null) 
6933      return;
6934    Complex t;
6935    if (Utilities.noString(parentType))
6936      t = parent;
6937    else {
6938      t = parent.predicate("fhir:"+parentType+'.'+name);
6939    }
6940    composeBackboneElement(t, "instance", name, element, index);
6941    if (element.hasSopClassElement())
6942      composeOid(t, "ImagingManifest", "sopClass", element.getSopClassElement(), -1);
6943    if (element.hasUidElement())
6944      composeOid(t, "ImagingManifest", "uid", element.getUidElement(), -1);
6945  }
6946
6947  protected void composeImagingStudy(Complex parent, String parentType, String name, ImagingStudy element, int index) {
6948    if (element == null) 
6949      return;
6950    Complex t;
6951    if (Utilities.noString(parentType))
6952      t = parent;
6953    else {
6954      t = parent.predicate("fhir:"+parentType+'.'+name);
6955    }
6956    composeDomainResource(t, "ImagingStudy", name, element, index);
6957    if (element.hasUidElement())
6958      composeOid(t, "ImagingStudy", "uid", element.getUidElement(), -1);
6959    if (element.hasAccession())
6960      composeIdentifier(t, "ImagingStudy", "accession", element.getAccession(), -1);
6961    for (int i = 0; i < element.getIdentifier().size(); i++)
6962      composeIdentifier(t, "ImagingStudy", "identifier", element.getIdentifier().get(i), i);
6963    if (element.hasAvailabilityElement())
6964      composeEnum(t, "ImagingStudy", "availability", element.getAvailabilityElement(), -1);
6965    for (int i = 0; i < element.getModalityList().size(); i++)
6966      composeCoding(t, "ImagingStudy", "modalityList", element.getModalityList().get(i), i);
6967    if (element.hasPatient())
6968      composeReference(t, "ImagingStudy", "patient", element.getPatient(), -1);
6969    if (element.hasContext())
6970      composeReference(t, "ImagingStudy", "context", element.getContext(), -1);
6971    if (element.hasStartedElement())
6972      composeDateTime(t, "ImagingStudy", "started", element.getStartedElement(), -1);
6973    for (int i = 0; i < element.getBasedOn().size(); i++)
6974      composeReference(t, "ImagingStudy", "basedOn", element.getBasedOn().get(i), i);
6975    if (element.hasReferrer())
6976      composeReference(t, "ImagingStudy", "referrer", element.getReferrer(), -1);
6977    for (int i = 0; i < element.getInterpreter().size(); i++)
6978      composeReference(t, "ImagingStudy", "interpreter", element.getInterpreter().get(i), i);
6979    for (int i = 0; i < element.getEndpoint().size(); i++)
6980      composeReference(t, "ImagingStudy", "endpoint", element.getEndpoint().get(i), i);
6981    if (element.hasNumberOfSeriesElement())
6982      composeUnsignedInt(t, "ImagingStudy", "numberOfSeries", element.getNumberOfSeriesElement(), -1);
6983    if (element.hasNumberOfInstancesElement())
6984      composeUnsignedInt(t, "ImagingStudy", "numberOfInstances", element.getNumberOfInstancesElement(), -1);
6985    for (int i = 0; i < element.getProcedureReference().size(); i++)
6986      composeReference(t, "ImagingStudy", "procedureReference", element.getProcedureReference().get(i), i);
6987    for (int i = 0; i < element.getProcedureCode().size(); i++)
6988      composeCodeableConcept(t, "ImagingStudy", "procedureCode", element.getProcedureCode().get(i), i);
6989    if (element.hasReason())
6990      composeCodeableConcept(t, "ImagingStudy", "reason", element.getReason(), -1);
6991    if (element.hasDescriptionElement())
6992      composeString(t, "ImagingStudy", "description", element.getDescriptionElement(), -1);
6993    for (int i = 0; i < element.getSeries().size(); i++)
6994      composeImagingStudyImagingStudySeriesComponent(t, "ImagingStudy", "series", element.getSeries().get(i), i);
6995  }
6996
6997  protected void composeImagingStudyImagingStudySeriesComponent(Complex parent, String parentType, String name, ImagingStudy.ImagingStudySeriesComponent element, int index) {
6998    if (element == null) 
6999      return;
7000    Complex t;
7001    if (Utilities.noString(parentType))
7002      t = parent;
7003    else {
7004      t = parent.predicate("fhir:"+parentType+'.'+name);
7005    }
7006    composeBackboneElement(t, "series", name, element, index);
7007    if (element.hasUidElement())
7008      composeOid(t, "ImagingStudy", "uid", element.getUidElement(), -1);
7009    if (element.hasNumberElement())
7010      composeUnsignedInt(t, "ImagingStudy", "number", element.getNumberElement(), -1);
7011    if (element.hasModality())
7012      composeCoding(t, "ImagingStudy", "modality", element.getModality(), -1);
7013    if (element.hasDescriptionElement())
7014      composeString(t, "ImagingStudy", "description", element.getDescriptionElement(), -1);
7015    if (element.hasNumberOfInstancesElement())
7016      composeUnsignedInt(t, "ImagingStudy", "numberOfInstances", element.getNumberOfInstancesElement(), -1);
7017    if (element.hasAvailabilityElement())
7018      composeEnum(t, "ImagingStudy", "availability", element.getAvailabilityElement(), -1);
7019    for (int i = 0; i < element.getEndpoint().size(); i++)
7020      composeReference(t, "ImagingStudy", "endpoint", element.getEndpoint().get(i), i);
7021    if (element.hasBodySite())
7022      composeCoding(t, "ImagingStudy", "bodySite", element.getBodySite(), -1);
7023    if (element.hasLaterality())
7024      composeCoding(t, "ImagingStudy", "laterality", element.getLaterality(), -1);
7025    if (element.hasStartedElement())
7026      composeDateTime(t, "ImagingStudy", "started", element.getStartedElement(), -1);
7027    for (int i = 0; i < element.getPerformer().size(); i++)
7028      composeReference(t, "ImagingStudy", "performer", element.getPerformer().get(i), i);
7029    for (int i = 0; i < element.getInstance().size(); i++)
7030      composeImagingStudyImagingStudySeriesInstanceComponent(t, "ImagingStudy", "instance", element.getInstance().get(i), i);
7031  }
7032
7033  protected void composeImagingStudyImagingStudySeriesInstanceComponent(Complex parent, String parentType, String name, ImagingStudy.ImagingStudySeriesInstanceComponent element, int index) {
7034    if (element == null) 
7035      return;
7036    Complex t;
7037    if (Utilities.noString(parentType))
7038      t = parent;
7039    else {
7040      t = parent.predicate("fhir:"+parentType+'.'+name);
7041    }
7042    composeBackboneElement(t, "instance", name, element, index);
7043    if (element.hasUidElement())
7044      composeOid(t, "ImagingStudy", "uid", element.getUidElement(), -1);
7045    if (element.hasNumberElement())
7046      composeUnsignedInt(t, "ImagingStudy", "number", element.getNumberElement(), -1);
7047    if (element.hasSopClassElement())
7048      composeOid(t, "ImagingStudy", "sopClass", element.getSopClassElement(), -1);
7049    if (element.hasTitleElement())
7050      composeString(t, "ImagingStudy", "title", element.getTitleElement(), -1);
7051  }
7052
7053  protected void composeImmunization(Complex parent, String parentType, String name, Immunization element, int index) {
7054    if (element == null) 
7055      return;
7056    Complex t;
7057    if (Utilities.noString(parentType))
7058      t = parent;
7059    else {
7060      t = parent.predicate("fhir:"+parentType+'.'+name);
7061    }
7062    composeDomainResource(t, "Immunization", name, element, index);
7063    for (int i = 0; i < element.getIdentifier().size(); i++)
7064      composeIdentifier(t, "Immunization", "identifier", element.getIdentifier().get(i), i);
7065    if (element.hasStatusElement())
7066      composeEnum(t, "Immunization", "status", element.getStatusElement(), -1);
7067    if (element.hasNotGivenElement())
7068      composeBoolean(t, "Immunization", "notGiven", element.getNotGivenElement(), -1);
7069    if (element.hasVaccineCode())
7070      composeCodeableConcept(t, "Immunization", "vaccineCode", element.getVaccineCode(), -1);
7071    if (element.hasPatient())
7072      composeReference(t, "Immunization", "patient", element.getPatient(), -1);
7073    if (element.hasEncounter())
7074      composeReference(t, "Immunization", "encounter", element.getEncounter(), -1);
7075    if (element.hasDateElement())
7076      composeDateTime(t, "Immunization", "date", element.getDateElement(), -1);
7077    if (element.hasPrimarySourceElement())
7078      composeBoolean(t, "Immunization", "primarySource", element.getPrimarySourceElement(), -1);
7079    if (element.hasReportOrigin())
7080      composeCodeableConcept(t, "Immunization", "reportOrigin", element.getReportOrigin(), -1);
7081    if (element.hasLocation())
7082      composeReference(t, "Immunization", "location", element.getLocation(), -1);
7083    if (element.hasManufacturer())
7084      composeReference(t, "Immunization", "manufacturer", element.getManufacturer(), -1);
7085    if (element.hasLotNumberElement())
7086      composeString(t, "Immunization", "lotNumber", element.getLotNumberElement(), -1);
7087    if (element.hasExpirationDateElement())
7088      composeDate(t, "Immunization", "expirationDate", element.getExpirationDateElement(), -1);
7089    if (element.hasSite())
7090      composeCodeableConcept(t, "Immunization", "site", element.getSite(), -1);
7091    if (element.hasRoute())
7092      composeCodeableConcept(t, "Immunization", "route", element.getRoute(), -1);
7093    if (element.hasDoseQuantity())
7094      composeQuantity(t, "Immunization", "doseQuantity", element.getDoseQuantity(), -1);
7095    for (int i = 0; i < element.getPractitioner().size(); i++)
7096      composeImmunizationImmunizationPractitionerComponent(t, "Immunization", "practitioner", element.getPractitioner().get(i), i);
7097    for (int i = 0; i < element.getNote().size(); i++)
7098      composeAnnotation(t, "Immunization", "note", element.getNote().get(i), i);
7099    if (element.hasExplanation())
7100      composeImmunizationImmunizationExplanationComponent(t, "Immunization", "explanation", element.getExplanation(), -1);
7101    for (int i = 0; i < element.getReaction().size(); i++)
7102      composeImmunizationImmunizationReactionComponent(t, "Immunization", "reaction", element.getReaction().get(i), i);
7103    for (int i = 0; i < element.getVaccinationProtocol().size(); i++)
7104      composeImmunizationImmunizationVaccinationProtocolComponent(t, "Immunization", "vaccinationProtocol", element.getVaccinationProtocol().get(i), i);
7105  }
7106
7107  protected void composeImmunizationImmunizationPractitionerComponent(Complex parent, String parentType, String name, Immunization.ImmunizationPractitionerComponent element, int index) {
7108    if (element == null) 
7109      return;
7110    Complex t;
7111    if (Utilities.noString(parentType))
7112      t = parent;
7113    else {
7114      t = parent.predicate("fhir:"+parentType+'.'+name);
7115    }
7116    composeBackboneElement(t, "practitioner", name, element, index);
7117    if (element.hasRole())
7118      composeCodeableConcept(t, "Immunization", "role", element.getRole(), -1);
7119    if (element.hasActor())
7120      composeReference(t, "Immunization", "actor", element.getActor(), -1);
7121  }
7122
7123  protected void composeImmunizationImmunizationExplanationComponent(Complex parent, String parentType, String name, Immunization.ImmunizationExplanationComponent 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, "explanation", name, element, index);
7133    for (int i = 0; i < element.getReason().size(); i++)
7134      composeCodeableConcept(t, "Immunization", "reason", element.getReason().get(i), i);
7135    for (int i = 0; i < element.getReasonNotGiven().size(); i++)
7136      composeCodeableConcept(t, "Immunization", "reasonNotGiven", element.getReasonNotGiven().get(i), i);
7137  }
7138
7139  protected void composeImmunizationImmunizationReactionComponent(Complex parent, String parentType, String name, Immunization.ImmunizationReactionComponent element, int index) {
7140    if (element == null) 
7141      return;
7142    Complex t;
7143    if (Utilities.noString(parentType))
7144      t = parent;
7145    else {
7146      t = parent.predicate("fhir:"+parentType+'.'+name);
7147    }
7148    composeBackboneElement(t, "reaction", name, element, index);
7149    if (element.hasDateElement())
7150      composeDateTime(t, "Immunization", "date", element.getDateElement(), -1);
7151    if (element.hasDetail())
7152      composeReference(t, "Immunization", "detail", element.getDetail(), -1);
7153    if (element.hasReportedElement())
7154      composeBoolean(t, "Immunization", "reported", element.getReportedElement(), -1);
7155  }
7156
7157  protected void composeImmunizationImmunizationVaccinationProtocolComponent(Complex parent, String parentType, String name, Immunization.ImmunizationVaccinationProtocolComponent element, int index) {
7158    if (element == null) 
7159      return;
7160    Complex t;
7161    if (Utilities.noString(parentType))
7162      t = parent;
7163    else {
7164      t = parent.predicate("fhir:"+parentType+'.'+name);
7165    }
7166    composeBackboneElement(t, "vaccinationProtocol", name, element, index);
7167    if (element.hasDoseSequenceElement())
7168      composePositiveInt(t, "Immunization", "doseSequence", element.getDoseSequenceElement(), -1);
7169    if (element.hasDescriptionElement())
7170      composeString(t, "Immunization", "description", element.getDescriptionElement(), -1);
7171    if (element.hasAuthority())
7172      composeReference(t, "Immunization", "authority", element.getAuthority(), -1);
7173    if (element.hasSeriesElement())
7174      composeString(t, "Immunization", "series", element.getSeriesElement(), -1);
7175    if (element.hasSeriesDosesElement())
7176      composePositiveInt(t, "Immunization", "seriesDoses", element.getSeriesDosesElement(), -1);
7177    for (int i = 0; i < element.getTargetDisease().size(); i++)
7178      composeCodeableConcept(t, "Immunization", "targetDisease", element.getTargetDisease().get(i), i);
7179    if (element.hasDoseStatus())
7180      composeCodeableConcept(t, "Immunization", "doseStatus", element.getDoseStatus(), -1);
7181    if (element.hasDoseStatusReason())
7182      composeCodeableConcept(t, "Immunization", "doseStatusReason", element.getDoseStatusReason(), -1);
7183  }
7184
7185  protected void composeImmunizationRecommendation(Complex parent, String parentType, String name, ImmunizationRecommendation element, int index) {
7186    if (element == null) 
7187      return;
7188    Complex t;
7189    if (Utilities.noString(parentType))
7190      t = parent;
7191    else {
7192      t = parent.predicate("fhir:"+parentType+'.'+name);
7193    }
7194    composeDomainResource(t, "ImmunizationRecommendation", name, element, index);
7195    for (int i = 0; i < element.getIdentifier().size(); i++)
7196      composeIdentifier(t, "ImmunizationRecommendation", "identifier", element.getIdentifier().get(i), i);
7197    if (element.hasPatient())
7198      composeReference(t, "ImmunizationRecommendation", "patient", element.getPatient(), -1);
7199    for (int i = 0; i < element.getRecommendation().size(); i++)
7200      composeImmunizationRecommendationImmunizationRecommendationRecommendationComponent(t, "ImmunizationRecommendation", "recommendation", element.getRecommendation().get(i), i);
7201  }
7202
7203  protected void composeImmunizationRecommendationImmunizationRecommendationRecommendationComponent(Complex parent, String parentType, String name, ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent element, int index) {
7204    if (element == null) 
7205      return;
7206    Complex t;
7207    if (Utilities.noString(parentType))
7208      t = parent;
7209    else {
7210      t = parent.predicate("fhir:"+parentType+'.'+name);
7211    }
7212    composeBackboneElement(t, "recommendation", name, element, index);
7213    if (element.hasDateElement())
7214      composeDateTime(t, "ImmunizationRecommendation", "date", element.getDateElement(), -1);
7215    if (element.hasVaccineCode())
7216      composeCodeableConcept(t, "ImmunizationRecommendation", "vaccineCode", element.getVaccineCode(), -1);
7217    if (element.hasTargetDisease())
7218      composeCodeableConcept(t, "ImmunizationRecommendation", "targetDisease", element.getTargetDisease(), -1);
7219    if (element.hasDoseNumberElement())
7220      composePositiveInt(t, "ImmunizationRecommendation", "doseNumber", element.getDoseNumberElement(), -1);
7221    if (element.hasForecastStatus())
7222      composeCodeableConcept(t, "ImmunizationRecommendation", "forecastStatus", element.getForecastStatus(), -1);
7223    for (int i = 0; i < element.getDateCriterion().size(); i++)
7224      composeImmunizationRecommendationImmunizationRecommendationRecommendationDateCriterionComponent(t, "ImmunizationRecommendation", "dateCriterion", element.getDateCriterion().get(i), i);
7225    if (element.hasProtocol())
7226      composeImmunizationRecommendationImmunizationRecommendationRecommendationProtocolComponent(t, "ImmunizationRecommendation", "protocol", element.getProtocol(), -1);
7227    for (int i = 0; i < element.getSupportingImmunization().size(); i++)
7228      composeReference(t, "ImmunizationRecommendation", "supportingImmunization", element.getSupportingImmunization().get(i), i);
7229    for (int i = 0; i < element.getSupportingPatientInformation().size(); i++)
7230      composeReference(t, "ImmunizationRecommendation", "supportingPatientInformation", element.getSupportingPatientInformation().get(i), i);
7231  }
7232
7233  protected void composeImmunizationRecommendationImmunizationRecommendationRecommendationDateCriterionComponent(Complex parent, String parentType, String name, ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent element, int index) {
7234    if (element == null) 
7235      return;
7236    Complex t;
7237    if (Utilities.noString(parentType))
7238      t = parent;
7239    else {
7240      t = parent.predicate("fhir:"+parentType+'.'+name);
7241    }
7242    composeBackboneElement(t, "dateCriterion", name, element, index);
7243    if (element.hasCode())
7244      composeCodeableConcept(t, "ImmunizationRecommendation", "code", element.getCode(), -1);
7245    if (element.hasValueElement())
7246      composeDateTime(t, "ImmunizationRecommendation", "value", element.getValueElement(), -1);
7247  }
7248
7249  protected void composeImmunizationRecommendationImmunizationRecommendationRecommendationProtocolComponent(Complex parent, String parentType, String name, ImmunizationRecommendation.ImmunizationRecommendationRecommendationProtocolComponent element, int index) {
7250    if (element == null) 
7251      return;
7252    Complex t;
7253    if (Utilities.noString(parentType))
7254      t = parent;
7255    else {
7256      t = parent.predicate("fhir:"+parentType+'.'+name);
7257    }
7258    composeBackboneElement(t, "protocol", name, element, index);
7259    if (element.hasDoseSequenceElement())
7260      composePositiveInt(t, "ImmunizationRecommendation", "doseSequence", element.getDoseSequenceElement(), -1);
7261    if (element.hasDescriptionElement())
7262      composeString(t, "ImmunizationRecommendation", "description", element.getDescriptionElement(), -1);
7263    if (element.hasAuthority())
7264      composeReference(t, "ImmunizationRecommendation", "authority", element.getAuthority(), -1);
7265    if (element.hasSeriesElement())
7266      composeString(t, "ImmunizationRecommendation", "series", element.getSeriesElement(), -1);
7267  }
7268
7269  protected void composeImplementationGuide(Complex parent, String parentType, String name, ImplementationGuide element, int index) {
7270    if (element == null) 
7271      return;
7272    Complex t;
7273    if (Utilities.noString(parentType))
7274      t = parent;
7275    else {
7276      t = parent.predicate("fhir:"+parentType+'.'+name);
7277    }
7278    composeDomainResource(t, "ImplementationGuide", name, element, index);
7279    if (element.hasUrlElement())
7280      composeUri(t, "ImplementationGuide", "url", element.getUrlElement(), -1);
7281    if (element.hasVersionElement())
7282      composeString(t, "ImplementationGuide", "version", element.getVersionElement(), -1);
7283    if (element.hasNameElement())
7284      composeString(t, "ImplementationGuide", "name", element.getNameElement(), -1);
7285    if (element.hasStatusElement())
7286      composeEnum(t, "ImplementationGuide", "status", element.getStatusElement(), -1);
7287    if (element.hasExperimentalElement())
7288      composeBoolean(t, "ImplementationGuide", "experimental", element.getExperimentalElement(), -1);
7289    if (element.hasDateElement())
7290      composeDateTime(t, "ImplementationGuide", "date", element.getDateElement(), -1);
7291    if (element.hasPublisherElement())
7292      composeString(t, "ImplementationGuide", "publisher", element.getPublisherElement(), -1);
7293    for (int i = 0; i < element.getContact().size(); i++)
7294      composeContactDetail(t, "ImplementationGuide", "contact", element.getContact().get(i), i);
7295    if (element.hasDescriptionElement())
7296      composeMarkdown(t, "ImplementationGuide", "description", element.getDescriptionElement(), -1);
7297    for (int i = 0; i < element.getUseContext().size(); i++)
7298      composeUsageContext(t, "ImplementationGuide", "useContext", element.getUseContext().get(i), i);
7299    for (int i = 0; i < element.getJurisdiction().size(); i++)
7300      composeCodeableConcept(t, "ImplementationGuide", "jurisdiction", element.getJurisdiction().get(i), i);
7301    if (element.hasCopyrightElement())
7302      composeMarkdown(t, "ImplementationGuide", "copyright", element.getCopyrightElement(), -1);
7303    if (element.hasFhirVersionElement())
7304      composeId(t, "ImplementationGuide", "fhirVersion", element.getFhirVersionElement(), -1);
7305    for (int i = 0; i < element.getDependency().size(); i++)
7306      composeImplementationGuideImplementationGuideDependencyComponent(t, "ImplementationGuide", "dependency", element.getDependency().get(i), i);
7307    for (int i = 0; i < element.getPackage().size(); i++)
7308      composeImplementationGuideImplementationGuidePackageComponent(t, "ImplementationGuide", "package", element.getPackage().get(i), i);
7309    for (int i = 0; i < element.getGlobal().size(); i++)
7310      composeImplementationGuideImplementationGuideGlobalComponent(t, "ImplementationGuide", "global", element.getGlobal().get(i), i);
7311    for (int i = 0; i < element.getBinary().size(); i++)
7312      composeUri(t, "ImplementationGuide", "binary", element.getBinary().get(i), i);
7313    if (element.hasPage())
7314      composeImplementationGuideImplementationGuidePageComponent(t, "ImplementationGuide", "page", element.getPage(), -1);
7315  }
7316
7317  protected void composeImplementationGuideImplementationGuideDependencyComponent(Complex parent, String parentType, String name, ImplementationGuide.ImplementationGuideDependencyComponent element, int index) {
7318    if (element == null) 
7319      return;
7320    Complex t;
7321    if (Utilities.noString(parentType))
7322      t = parent;
7323    else {
7324      t = parent.predicate("fhir:"+parentType+'.'+name);
7325    }
7326    composeBackboneElement(t, "dependency", name, element, index);
7327    if (element.hasTypeElement())
7328      composeEnum(t, "ImplementationGuide", "type", element.getTypeElement(), -1);
7329    if (element.hasUriElement())
7330      composeUri(t, "ImplementationGuide", "uri", element.getUriElement(), -1);
7331  }
7332
7333  protected void composeImplementationGuideImplementationGuidePackageComponent(Complex parent, String parentType, String name, ImplementationGuide.ImplementationGuidePackageComponent element, int index) {
7334    if (element == null) 
7335      return;
7336    Complex t;
7337    if (Utilities.noString(parentType))
7338      t = parent;
7339    else {
7340      t = parent.predicate("fhir:"+parentType+'.'+name);
7341    }
7342    composeBackboneElement(t, "package", name, element, index);
7343    if (element.hasNameElement())
7344      composeString(t, "ImplementationGuide", "name", element.getNameElement(), -1);
7345    if (element.hasDescriptionElement())
7346      composeString(t, "ImplementationGuide", "description", element.getDescriptionElement(), -1);
7347    for (int i = 0; i < element.getResource().size(); i++)
7348      composeImplementationGuideImplementationGuidePackageResourceComponent(t, "ImplementationGuide", "resource", element.getResource().get(i), i);
7349  }
7350
7351  protected void composeImplementationGuideImplementationGuidePackageResourceComponent(Complex parent, String parentType, String name, ImplementationGuide.ImplementationGuidePackageResourceComponent 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, "resource", name, element, index);
7361    if (element.hasExampleElement())
7362      composeBoolean(t, "ImplementationGuide", "example", element.getExampleElement(), -1);
7363    if (element.hasNameElement())
7364      composeString(t, "ImplementationGuide", "name", element.getNameElement(), -1);
7365    if (element.hasDescriptionElement())
7366      composeString(t, "ImplementationGuide", "description", element.getDescriptionElement(), -1);
7367    if (element.hasAcronymElement())
7368      composeString(t, "ImplementationGuide", "acronym", element.getAcronymElement(), -1);
7369    if (element.hasSource())
7370      composeType(t, "ImplementationGuide", "source", element.getSource(), -1);
7371    if (element.hasExampleFor())
7372      composeReference(t, "ImplementationGuide", "exampleFor", element.getExampleFor(), -1);
7373  }
7374
7375  protected void composeImplementationGuideImplementationGuideGlobalComponent(Complex parent, String parentType, String name, ImplementationGuide.ImplementationGuideGlobalComponent element, int index) {
7376    if (element == null) 
7377      return;
7378    Complex t;
7379    if (Utilities.noString(parentType))
7380      t = parent;
7381    else {
7382      t = parent.predicate("fhir:"+parentType+'.'+name);
7383    }
7384    composeBackboneElement(t, "global", name, element, index);
7385    if (element.hasTypeElement())
7386      composeCode(t, "ImplementationGuide", "type", element.getTypeElement(), -1);
7387    if (element.hasProfile())
7388      composeReference(t, "ImplementationGuide", "profile", element.getProfile(), -1);
7389  }
7390
7391  protected void composeImplementationGuideImplementationGuidePageComponent(Complex parent, String parentType, String name, ImplementationGuide.ImplementationGuidePageComponent element, int index) {
7392    if (element == null) 
7393      return;
7394    Complex t;
7395    if (Utilities.noString(parentType))
7396      t = parent;
7397    else {
7398      t = parent.predicate("fhir:"+parentType+'.'+name);
7399    }
7400    composeBackboneElement(t, "page", name, element, index);
7401    if (element.hasSourceElement())
7402      composeUri(t, "ImplementationGuide", "source", element.getSourceElement(), -1);
7403    if (element.hasTitleElement())
7404      composeString(t, "ImplementationGuide", "title", element.getTitleElement(), -1);
7405    if (element.hasKindElement())
7406      composeEnum(t, "ImplementationGuide", "kind", element.getKindElement(), -1);
7407    for (int i = 0; i < element.getType().size(); i++)
7408      composeCode(t, "ImplementationGuide", "type", element.getType().get(i), i);
7409    for (int i = 0; i < element.getPackage().size(); i++)
7410      composeString(t, "ImplementationGuide", "package", element.getPackage().get(i), i);
7411    if (element.hasFormatElement())
7412      composeCode(t, "ImplementationGuide", "format", element.getFormatElement(), -1);
7413    for (int i = 0; i < element.getPage().size(); i++)
7414      composeImplementationGuideImplementationGuidePageComponent(t, "ImplementationGuide", "page", element.getPage().get(i), i);
7415  }
7416
7417  protected void composeLibrary(Complex parent, String parentType, String name, Library element, int index) {
7418    if (element == null) 
7419      return;
7420    Complex t;
7421    if (Utilities.noString(parentType))
7422      t = parent;
7423    else {
7424      t = parent.predicate("fhir:"+parentType+'.'+name);
7425    }
7426    composeDomainResource(t, "Library", name, element, index);
7427    if (element.hasUrlElement())
7428      composeUri(t, "Library", "url", element.getUrlElement(), -1);
7429    for (int i = 0; i < element.getIdentifier().size(); i++)
7430      composeIdentifier(t, "Library", "identifier", element.getIdentifier().get(i), i);
7431    if (element.hasVersionElement())
7432      composeString(t, "Library", "version", element.getVersionElement(), -1);
7433    if (element.hasNameElement())
7434      composeString(t, "Library", "name", element.getNameElement(), -1);
7435    if (element.hasTitleElement())
7436      composeString(t, "Library", "title", element.getTitleElement(), -1);
7437    if (element.hasStatusElement())
7438      composeEnum(t, "Library", "status", element.getStatusElement(), -1);
7439    if (element.hasExperimentalElement())
7440      composeBoolean(t, "Library", "experimental", element.getExperimentalElement(), -1);
7441    if (element.hasType())
7442      composeCodeableConcept(t, "Library", "type", element.getType(), -1);
7443    if (element.hasDateElement())
7444      composeDateTime(t, "Library", "date", element.getDateElement(), -1);
7445    if (element.hasPublisherElement())
7446      composeString(t, "Library", "publisher", element.getPublisherElement(), -1);
7447    if (element.hasDescriptionElement())
7448      composeMarkdown(t, "Library", "description", element.getDescriptionElement(), -1);
7449    if (element.hasPurposeElement())
7450      composeMarkdown(t, "Library", "purpose", element.getPurposeElement(), -1);
7451    if (element.hasUsageElement())
7452      composeString(t, "Library", "usage", element.getUsageElement(), -1);
7453    if (element.hasApprovalDateElement())
7454      composeDate(t, "Library", "approvalDate", element.getApprovalDateElement(), -1);
7455    if (element.hasLastReviewDateElement())
7456      composeDate(t, "Library", "lastReviewDate", element.getLastReviewDateElement(), -1);
7457    if (element.hasEffectivePeriod())
7458      composePeriod(t, "Library", "effectivePeriod", element.getEffectivePeriod(), -1);
7459    for (int i = 0; i < element.getUseContext().size(); i++)
7460      composeUsageContext(t, "Library", "useContext", element.getUseContext().get(i), i);
7461    for (int i = 0; i < element.getJurisdiction().size(); i++)
7462      composeCodeableConcept(t, "Library", "jurisdiction", element.getJurisdiction().get(i), i);
7463    for (int i = 0; i < element.getTopic().size(); i++)
7464      composeCodeableConcept(t, "Library", "topic", element.getTopic().get(i), i);
7465    for (int i = 0; i < element.getContributor().size(); i++)
7466      composeContributor(t, "Library", "contributor", element.getContributor().get(i), i);
7467    for (int i = 0; i < element.getContact().size(); i++)
7468      composeContactDetail(t, "Library", "contact", element.getContact().get(i), i);
7469    if (element.hasCopyrightElement())
7470      composeMarkdown(t, "Library", "copyright", element.getCopyrightElement(), -1);
7471    for (int i = 0; i < element.getRelatedArtifact().size(); i++)
7472      composeRelatedArtifact(t, "Library", "relatedArtifact", element.getRelatedArtifact().get(i), i);
7473    for (int i = 0; i < element.getParameter().size(); i++)
7474      composeParameterDefinition(t, "Library", "parameter", element.getParameter().get(i), i);
7475    for (int i = 0; i < element.getDataRequirement().size(); i++)
7476      composeDataRequirement(t, "Library", "dataRequirement", element.getDataRequirement().get(i), i);
7477    for (int i = 0; i < element.getContent().size(); i++)
7478      composeAttachment(t, "Library", "content", element.getContent().get(i), i);
7479  }
7480
7481  protected void composeLinkage(Complex parent, String parentType, String name, Linkage element, int index) {
7482    if (element == null) 
7483      return;
7484    Complex t;
7485    if (Utilities.noString(parentType))
7486      t = parent;
7487    else {
7488      t = parent.predicate("fhir:"+parentType+'.'+name);
7489    }
7490    composeDomainResource(t, "Linkage", name, element, index);
7491    if (element.hasActiveElement())
7492      composeBoolean(t, "Linkage", "active", element.getActiveElement(), -1);
7493    if (element.hasAuthor())
7494      composeReference(t, "Linkage", "author", element.getAuthor(), -1);
7495    for (int i = 0; i < element.getItem().size(); i++)
7496      composeLinkageLinkageItemComponent(t, "Linkage", "item", element.getItem().get(i), i);
7497  }
7498
7499  protected void composeLinkageLinkageItemComponent(Complex parent, String parentType, String name, Linkage.LinkageItemComponent element, int index) {
7500    if (element == null) 
7501      return;
7502    Complex t;
7503    if (Utilities.noString(parentType))
7504      t = parent;
7505    else {
7506      t = parent.predicate("fhir:"+parentType+'.'+name);
7507    }
7508    composeBackboneElement(t, "item", name, element, index);
7509    if (element.hasTypeElement())
7510      composeEnum(t, "Linkage", "type", element.getTypeElement(), -1);
7511    if (element.hasResource())
7512      composeReference(t, "Linkage", "resource", element.getResource(), -1);
7513  }
7514
7515  protected void composeListResource(Complex parent, String parentType, String name, ListResource element, int index) {
7516    if (element == null) 
7517      return;
7518    Complex t;
7519    if (Utilities.noString(parentType))
7520      t = parent;
7521    else {
7522      t = parent.predicate("fhir:"+parentType+'.'+name);
7523    }
7524    composeDomainResource(t, "List", name, element, index);
7525    for (int i = 0; i < element.getIdentifier().size(); i++)
7526      composeIdentifier(t, "List", "identifier", element.getIdentifier().get(i), i);
7527    if (element.hasStatusElement())
7528      composeEnum(t, "List", "status", element.getStatusElement(), -1);
7529    if (element.hasModeElement())
7530      composeEnum(t, "List", "mode", element.getModeElement(), -1);
7531    if (element.hasTitleElement())
7532      composeString(t, "List", "title", element.getTitleElement(), -1);
7533    if (element.hasCode())
7534      composeCodeableConcept(t, "List", "code", element.getCode(), -1);
7535    if (element.hasSubject())
7536      composeReference(t, "List", "subject", element.getSubject(), -1);
7537    if (element.hasEncounter())
7538      composeReference(t, "List", "encounter", element.getEncounter(), -1);
7539    if (element.hasDateElement())
7540      composeDateTime(t, "List", "date", element.getDateElement(), -1);
7541    if (element.hasSource())
7542      composeReference(t, "List", "source", element.getSource(), -1);
7543    if (element.hasOrderedBy())
7544      composeCodeableConcept(t, "List", "orderedBy", element.getOrderedBy(), -1);
7545    for (int i = 0; i < element.getNote().size(); i++)
7546      composeAnnotation(t, "List", "note", element.getNote().get(i), i);
7547    for (int i = 0; i < element.getEntry().size(); i++)
7548      composeListResourceListEntryComponent(t, "List", "entry", element.getEntry().get(i), i);
7549    if (element.hasEmptyReason())
7550      composeCodeableConcept(t, "List", "emptyReason", element.getEmptyReason(), -1);
7551  }
7552
7553  protected void composeListResourceListEntryComponent(Complex parent, String parentType, String name, ListResource.ListEntryComponent element, int index) {
7554    if (element == null) 
7555      return;
7556    Complex t;
7557    if (Utilities.noString(parentType))
7558      t = parent;
7559    else {
7560      t = parent.predicate("fhir:"+parentType+'.'+name);
7561    }
7562    composeBackboneElement(t, "entry", name, element, index);
7563    if (element.hasFlag())
7564      composeCodeableConcept(t, "List", "flag", element.getFlag(), -1);
7565    if (element.hasDeletedElement())
7566      composeBoolean(t, "List", "deleted", element.getDeletedElement(), -1);
7567    if (element.hasDateElement())
7568      composeDateTime(t, "List", "date", element.getDateElement(), -1);
7569    if (element.hasItem())
7570      composeReference(t, "List", "item", element.getItem(), -1);
7571  }
7572
7573  protected void composeLocation(Complex parent, String parentType, String name, Location element, int index) {
7574    if (element == null) 
7575      return;
7576    Complex t;
7577    if (Utilities.noString(parentType))
7578      t = parent;
7579    else {
7580      t = parent.predicate("fhir:"+parentType+'.'+name);
7581    }
7582    composeDomainResource(t, "Location", name, element, index);
7583    for (int i = 0; i < element.getIdentifier().size(); i++)
7584      composeIdentifier(t, "Location", "identifier", element.getIdentifier().get(i), i);
7585    if (element.hasStatusElement())
7586      composeEnum(t, "Location", "status", element.getStatusElement(), -1);
7587    if (element.hasOperationalStatus())
7588      composeCoding(t, "Location", "operationalStatus", element.getOperationalStatus(), -1);
7589    if (element.hasNameElement())
7590      composeString(t, "Location", "name", element.getNameElement(), -1);
7591    for (int i = 0; i < element.getAlias().size(); i++)
7592      composeString(t, "Location", "alias", element.getAlias().get(i), i);
7593    if (element.hasDescriptionElement())
7594      composeString(t, "Location", "description", element.getDescriptionElement(), -1);
7595    if (element.hasModeElement())
7596      composeEnum(t, "Location", "mode", element.getModeElement(), -1);
7597    if (element.hasType())
7598      composeCodeableConcept(t, "Location", "type", element.getType(), -1);
7599    for (int i = 0; i < element.getTelecom().size(); i++)
7600      composeContactPoint(t, "Location", "telecom", element.getTelecom().get(i), i);
7601    if (element.hasAddress())
7602      composeAddress(t, "Location", "address", element.getAddress(), -1);
7603    if (element.hasPhysicalType())
7604      composeCodeableConcept(t, "Location", "physicalType", element.getPhysicalType(), -1);
7605    if (element.hasPosition())
7606      composeLocationLocationPositionComponent(t, "Location", "position", element.getPosition(), -1);
7607    if (element.hasManagingOrganization())
7608      composeReference(t, "Location", "managingOrganization", element.getManagingOrganization(), -1);
7609    if (element.hasPartOf())
7610      composeReference(t, "Location", "partOf", element.getPartOf(), -1);
7611    for (int i = 0; i < element.getEndpoint().size(); i++)
7612      composeReference(t, "Location", "endpoint", element.getEndpoint().get(i), i);
7613  }
7614
7615  protected void composeLocationLocationPositionComponent(Complex parent, String parentType, String name, Location.LocationPositionComponent element, int index) {
7616    if (element == null) 
7617      return;
7618    Complex t;
7619    if (Utilities.noString(parentType))
7620      t = parent;
7621    else {
7622      t = parent.predicate("fhir:"+parentType+'.'+name);
7623    }
7624    composeBackboneElement(t, "position", name, element, index);
7625    if (element.hasLongitudeElement())
7626      composeDecimal(t, "Location", "longitude", element.getLongitudeElement(), -1);
7627    if (element.hasLatitudeElement())
7628      composeDecimal(t, "Location", "latitude", element.getLatitudeElement(), -1);
7629    if (element.hasAltitudeElement())
7630      composeDecimal(t, "Location", "altitude", element.getAltitudeElement(), -1);
7631  }
7632
7633  protected void composeMeasure(Complex parent, String parentType, String name, Measure element, int index) {
7634    if (element == null) 
7635      return;
7636    Complex t;
7637    if (Utilities.noString(parentType))
7638      t = parent;
7639    else {
7640      t = parent.predicate("fhir:"+parentType+'.'+name);
7641    }
7642    composeDomainResource(t, "Measure", name, element, index);
7643    if (element.hasUrlElement())
7644      composeUri(t, "Measure", "url", element.getUrlElement(), -1);
7645    for (int i = 0; i < element.getIdentifier().size(); i++)
7646      composeIdentifier(t, "Measure", "identifier", element.getIdentifier().get(i), i);
7647    if (element.hasVersionElement())
7648      composeString(t, "Measure", "version", element.getVersionElement(), -1);
7649    if (element.hasNameElement())
7650      composeString(t, "Measure", "name", element.getNameElement(), -1);
7651    if (element.hasTitleElement())
7652      composeString(t, "Measure", "title", element.getTitleElement(), -1);
7653    if (element.hasStatusElement())
7654      composeEnum(t, "Measure", "status", element.getStatusElement(), -1);
7655    if (element.hasExperimentalElement())
7656      composeBoolean(t, "Measure", "experimental", element.getExperimentalElement(), -1);
7657    if (element.hasDateElement())
7658      composeDateTime(t, "Measure", "date", element.getDateElement(), -1);
7659    if (element.hasPublisherElement())
7660      composeString(t, "Measure", "publisher", element.getPublisherElement(), -1);
7661    if (element.hasDescriptionElement())
7662      composeMarkdown(t, "Measure", "description", element.getDescriptionElement(), -1);
7663    if (element.hasPurposeElement())
7664      composeMarkdown(t, "Measure", "purpose", element.getPurposeElement(), -1);
7665    if (element.hasUsageElement())
7666      composeString(t, "Measure", "usage", element.getUsageElement(), -1);
7667    if (element.hasApprovalDateElement())
7668      composeDate(t, "Measure", "approvalDate", element.getApprovalDateElement(), -1);
7669    if (element.hasLastReviewDateElement())
7670      composeDate(t, "Measure", "lastReviewDate", element.getLastReviewDateElement(), -1);
7671    if (element.hasEffectivePeriod())
7672      composePeriod(t, "Measure", "effectivePeriod", element.getEffectivePeriod(), -1);
7673    for (int i = 0; i < element.getUseContext().size(); i++)
7674      composeUsageContext(t, "Measure", "useContext", element.getUseContext().get(i), i);
7675    for (int i = 0; i < element.getJurisdiction().size(); i++)
7676      composeCodeableConcept(t, "Measure", "jurisdiction", element.getJurisdiction().get(i), i);
7677    for (int i = 0; i < element.getTopic().size(); i++)
7678      composeCodeableConcept(t, "Measure", "topic", element.getTopic().get(i), i);
7679    for (int i = 0; i < element.getContributor().size(); i++)
7680      composeContributor(t, "Measure", "contributor", element.getContributor().get(i), i);
7681    for (int i = 0; i < element.getContact().size(); i++)
7682      composeContactDetail(t, "Measure", "contact", element.getContact().get(i), i);
7683    if (element.hasCopyrightElement())
7684      composeMarkdown(t, "Measure", "copyright", element.getCopyrightElement(), -1);
7685    for (int i = 0; i < element.getRelatedArtifact().size(); i++)
7686      composeRelatedArtifact(t, "Measure", "relatedArtifact", element.getRelatedArtifact().get(i), i);
7687    for (int i = 0; i < element.getLibrary().size(); i++)
7688      composeReference(t, "Measure", "library", element.getLibrary().get(i), i);
7689    if (element.hasDisclaimerElement())
7690      composeMarkdown(t, "Measure", "disclaimer", element.getDisclaimerElement(), -1);
7691    if (element.hasScoring())
7692      composeCodeableConcept(t, "Measure", "scoring", element.getScoring(), -1);
7693    if (element.hasCompositeScoring())
7694      composeCodeableConcept(t, "Measure", "compositeScoring", element.getCompositeScoring(), -1);
7695    for (int i = 0; i < element.getType().size(); i++)
7696      composeCodeableConcept(t, "Measure", "type", element.getType().get(i), i);
7697    if (element.hasRiskAdjustmentElement())
7698      composeString(t, "Measure", "riskAdjustment", element.getRiskAdjustmentElement(), -1);
7699    if (element.hasRateAggregationElement())
7700      composeString(t, "Measure", "rateAggregation", element.getRateAggregationElement(), -1);
7701    if (element.hasRationaleElement())
7702      composeMarkdown(t, "Measure", "rationale", element.getRationaleElement(), -1);
7703    if (element.hasClinicalRecommendationStatementElement())
7704      composeMarkdown(t, "Measure", "clinicalRecommendationStatement", element.getClinicalRecommendationStatementElement(), -1);
7705    if (element.hasImprovementNotationElement())
7706      composeString(t, "Measure", "improvementNotation", element.getImprovementNotationElement(), -1);
7707    for (int i = 0; i < element.getDefinition().size(); i++)
7708      composeMarkdown(t, "Measure", "definition", element.getDefinition().get(i), i);
7709    if (element.hasGuidanceElement())
7710      composeMarkdown(t, "Measure", "guidance", element.getGuidanceElement(), -1);
7711    if (element.hasSetElement())
7712      composeString(t, "Measure", "set", element.getSetElement(), -1);
7713    for (int i = 0; i < element.getGroup().size(); i++)
7714      composeMeasureMeasureGroupComponent(t, "Measure", "group", element.getGroup().get(i), i);
7715    for (int i = 0; i < element.getSupplementalData().size(); i++)
7716      composeMeasureMeasureSupplementalDataComponent(t, "Measure", "supplementalData", element.getSupplementalData().get(i), i);
7717  }
7718
7719  protected void composeMeasureMeasureGroupComponent(Complex parent, String parentType, String name, Measure.MeasureGroupComponent element, int index) {
7720    if (element == null) 
7721      return;
7722    Complex t;
7723    if (Utilities.noString(parentType))
7724      t = parent;
7725    else {
7726      t = parent.predicate("fhir:"+parentType+'.'+name);
7727    }
7728    composeBackboneElement(t, "group", name, element, index);
7729    if (element.hasIdentifier())
7730      composeIdentifier(t, "Measure", "identifier", element.getIdentifier(), -1);
7731    if (element.hasNameElement())
7732      composeString(t, "Measure", "name", element.getNameElement(), -1);
7733    if (element.hasDescriptionElement())
7734      composeString(t, "Measure", "description", element.getDescriptionElement(), -1);
7735    for (int i = 0; i < element.getPopulation().size(); i++)
7736      composeMeasureMeasureGroupPopulationComponent(t, "Measure", "population", element.getPopulation().get(i), i);
7737    for (int i = 0; i < element.getStratifier().size(); i++)
7738      composeMeasureMeasureGroupStratifierComponent(t, "Measure", "stratifier", element.getStratifier().get(i), i);
7739  }
7740
7741  protected void composeMeasureMeasureGroupPopulationComponent(Complex parent, String parentType, String name, Measure.MeasureGroupPopulationComponent element, int index) {
7742    if (element == null) 
7743      return;
7744    Complex t;
7745    if (Utilities.noString(parentType))
7746      t = parent;
7747    else {
7748      t = parent.predicate("fhir:"+parentType+'.'+name);
7749    }
7750    composeBackboneElement(t, "population", name, element, index);
7751    if (element.hasIdentifier())
7752      composeIdentifier(t, "Measure", "identifier", element.getIdentifier(), -1);
7753    if (element.hasCode())
7754      composeCodeableConcept(t, "Measure", "code", element.getCode(), -1);
7755    if (element.hasNameElement())
7756      composeString(t, "Measure", "name", element.getNameElement(), -1);
7757    if (element.hasDescriptionElement())
7758      composeString(t, "Measure", "description", element.getDescriptionElement(), -1);
7759    if (element.hasCriteriaElement())
7760      composeString(t, "Measure", "criteria", element.getCriteriaElement(), -1);
7761  }
7762
7763  protected void composeMeasureMeasureGroupStratifierComponent(Complex parent, String parentType, String name, Measure.MeasureGroupStratifierComponent element, int index) {
7764    if (element == null) 
7765      return;
7766    Complex t;
7767    if (Utilities.noString(parentType))
7768      t = parent;
7769    else {
7770      t = parent.predicate("fhir:"+parentType+'.'+name);
7771    }
7772    composeBackboneElement(t, "stratifier", name, element, index);
7773    if (element.hasIdentifier())
7774      composeIdentifier(t, "Measure", "identifier", element.getIdentifier(), -1);
7775    if (element.hasCriteriaElement())
7776      composeString(t, "Measure", "criteria", element.getCriteriaElement(), -1);
7777    if (element.hasPathElement())
7778      composeString(t, "Measure", "path", element.getPathElement(), -1);
7779  }
7780
7781  protected void composeMeasureMeasureSupplementalDataComponent(Complex parent, String parentType, String name, Measure.MeasureSupplementalDataComponent element, int index) {
7782    if (element == null) 
7783      return;
7784    Complex t;
7785    if (Utilities.noString(parentType))
7786      t = parent;
7787    else {
7788      t = parent.predicate("fhir:"+parentType+'.'+name);
7789    }
7790    composeBackboneElement(t, "supplementalData", name, element, index);
7791    if (element.hasIdentifier())
7792      composeIdentifier(t, "Measure", "identifier", element.getIdentifier(), -1);
7793    for (int i = 0; i < element.getUsage().size(); i++)
7794      composeCodeableConcept(t, "Measure", "usage", element.getUsage().get(i), i);
7795    if (element.hasCriteriaElement())
7796      composeString(t, "Measure", "criteria", element.getCriteriaElement(), -1);
7797    if (element.hasPathElement())
7798      composeString(t, "Measure", "path", element.getPathElement(), -1);
7799  }
7800
7801  protected void composeMeasureReport(Complex parent, String parentType, String name, MeasureReport 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    composeDomainResource(t, "MeasureReport", name, element, index);
7811    if (element.hasIdentifier())
7812      composeIdentifier(t, "MeasureReport", "identifier", element.getIdentifier(), -1);
7813    if (element.hasStatusElement())
7814      composeEnum(t, "MeasureReport", "status", element.getStatusElement(), -1);
7815    if (element.hasTypeElement())
7816      composeEnum(t, "MeasureReport", "type", element.getTypeElement(), -1);
7817    if (element.hasMeasure())
7818      composeReference(t, "MeasureReport", "measure", element.getMeasure(), -1);
7819    if (element.hasPatient())
7820      composeReference(t, "MeasureReport", "patient", element.getPatient(), -1);
7821    if (element.hasDateElement())
7822      composeDateTime(t, "MeasureReport", "date", element.getDateElement(), -1);
7823    if (element.hasReportingOrganization())
7824      composeReference(t, "MeasureReport", "reportingOrganization", element.getReportingOrganization(), -1);
7825    if (element.hasPeriod())
7826      composePeriod(t, "MeasureReport", "period", element.getPeriod(), -1);
7827    for (int i = 0; i < element.getGroup().size(); i++)
7828      composeMeasureReportMeasureReportGroupComponent(t, "MeasureReport", "group", element.getGroup().get(i), i);
7829    if (element.hasEvaluatedResources())
7830      composeReference(t, "MeasureReport", "evaluatedResources", element.getEvaluatedResources(), -1);
7831  }
7832
7833  protected void composeMeasureReportMeasureReportGroupComponent(Complex parent, String parentType, String name, MeasureReport.MeasureReportGroupComponent element, int index) {
7834    if (element == null) 
7835      return;
7836    Complex t;
7837    if (Utilities.noString(parentType))
7838      t = parent;
7839    else {
7840      t = parent.predicate("fhir:"+parentType+'.'+name);
7841    }
7842    composeBackboneElement(t, "group", name, element, index);
7843    if (element.hasIdentifier())
7844      composeIdentifier(t, "MeasureReport", "identifier", element.getIdentifier(), -1);
7845    for (int i = 0; i < element.getPopulation().size(); i++)
7846      composeMeasureReportMeasureReportGroupPopulationComponent(t, "MeasureReport", "population", element.getPopulation().get(i), i);
7847    if (element.hasMeasureScoreElement())
7848      composeDecimal(t, "MeasureReport", "measureScore", element.getMeasureScoreElement(), -1);
7849    for (int i = 0; i < element.getStratifier().size(); i++)
7850      composeMeasureReportMeasureReportGroupStratifierComponent(t, "MeasureReport", "stratifier", element.getStratifier().get(i), i);
7851  }
7852
7853  protected void composeMeasureReportMeasureReportGroupPopulationComponent(Complex parent, String parentType, String name, MeasureReport.MeasureReportGroupPopulationComponent element, int index) {
7854    if (element == null) 
7855      return;
7856    Complex t;
7857    if (Utilities.noString(parentType))
7858      t = parent;
7859    else {
7860      t = parent.predicate("fhir:"+parentType+'.'+name);
7861    }
7862    composeBackboneElement(t, "population", name, element, index);
7863    if (element.hasIdentifier())
7864      composeIdentifier(t, "MeasureReport", "identifier", element.getIdentifier(), -1);
7865    if (element.hasCode())
7866      composeCodeableConcept(t, "MeasureReport", "code", element.getCode(), -1);
7867    if (element.hasCountElement())
7868      composeInteger(t, "MeasureReport", "count", element.getCountElement(), -1);
7869    if (element.hasPatients())
7870      composeReference(t, "MeasureReport", "patients", element.getPatients(), -1);
7871  }
7872
7873  protected void composeMeasureReportMeasureReportGroupStratifierComponent(Complex parent, String parentType, String name, MeasureReport.MeasureReportGroupStratifierComponent element, int index) {
7874    if (element == null) 
7875      return;
7876    Complex t;
7877    if (Utilities.noString(parentType))
7878      t = parent;
7879    else {
7880      t = parent.predicate("fhir:"+parentType+'.'+name);
7881    }
7882    composeBackboneElement(t, "stratifier", name, element, index);
7883    if (element.hasIdentifier())
7884      composeIdentifier(t, "MeasureReport", "identifier", element.getIdentifier(), -1);
7885    for (int i = 0; i < element.getStratum().size(); i++)
7886      composeMeasureReportStratifierGroupComponent(t, "MeasureReport", "stratum", element.getStratum().get(i), i);
7887  }
7888
7889  protected void composeMeasureReportStratifierGroupComponent(Complex parent, String parentType, String name, MeasureReport.StratifierGroupComponent element, int index) {
7890    if (element == null) 
7891      return;
7892    Complex t;
7893    if (Utilities.noString(parentType))
7894      t = parent;
7895    else {
7896      t = parent.predicate("fhir:"+parentType+'.'+name);
7897    }
7898    composeBackboneElement(t, "stratum", name, element, index);
7899    if (element.hasValueElement())
7900      composeString(t, "MeasureReport", "value", element.getValueElement(), -1);
7901    for (int i = 0; i < element.getPopulation().size(); i++)
7902      composeMeasureReportStratifierGroupPopulationComponent(t, "MeasureReport", "population", element.getPopulation().get(i), i);
7903    if (element.hasMeasureScoreElement())
7904      composeDecimal(t, "MeasureReport", "measureScore", element.getMeasureScoreElement(), -1);
7905  }
7906
7907  protected void composeMeasureReportStratifierGroupPopulationComponent(Complex parent, String parentType, String name, MeasureReport.StratifierGroupPopulationComponent element, int index) {
7908    if (element == null) 
7909      return;
7910    Complex t;
7911    if (Utilities.noString(parentType))
7912      t = parent;
7913    else {
7914      t = parent.predicate("fhir:"+parentType+'.'+name);
7915    }
7916    composeBackboneElement(t, "population", name, element, index);
7917    if (element.hasIdentifier())
7918      composeIdentifier(t, "MeasureReport", "identifier", element.getIdentifier(), -1);
7919    if (element.hasCode())
7920      composeCodeableConcept(t, "MeasureReport", "code", element.getCode(), -1);
7921    if (element.hasCountElement())
7922      composeInteger(t, "MeasureReport", "count", element.getCountElement(), -1);
7923    if (element.hasPatients())
7924      composeReference(t, "MeasureReport", "patients", element.getPatients(), -1);
7925  }
7926
7927  protected void composeMedia(Complex parent, String parentType, String name, Media element, int index) {
7928    if (element == null) 
7929      return;
7930    Complex t;
7931    if (Utilities.noString(parentType))
7932      t = parent;
7933    else {
7934      t = parent.predicate("fhir:"+parentType+'.'+name);
7935    }
7936    composeDomainResource(t, "Media", name, element, index);
7937    for (int i = 0; i < element.getIdentifier().size(); i++)
7938      composeIdentifier(t, "Media", "identifier", element.getIdentifier().get(i), i);
7939    for (int i = 0; i < element.getBasedOn().size(); i++)
7940      composeReference(t, "Media", "basedOn", element.getBasedOn().get(i), i);
7941    if (element.hasTypeElement())
7942      composeEnum(t, "Media", "type", element.getTypeElement(), -1);
7943    if (element.hasSubtype())
7944      composeCodeableConcept(t, "Media", "subtype", element.getSubtype(), -1);
7945    if (element.hasView())
7946      composeCodeableConcept(t, "Media", "view", element.getView(), -1);
7947    if (element.hasSubject())
7948      composeReference(t, "Media", "subject", element.getSubject(), -1);
7949    if (element.hasContext())
7950      composeReference(t, "Media", "context", element.getContext(), -1);
7951    if (element.hasOccurrence())
7952      composeType(t, "Media", "occurrence", element.getOccurrence(), -1);
7953    if (element.hasOperator())
7954      composeReference(t, "Media", "operator", element.getOperator(), -1);
7955    for (int i = 0; i < element.getReasonCode().size(); i++)
7956      composeCodeableConcept(t, "Media", "reasonCode", element.getReasonCode().get(i), i);
7957    if (element.hasBodySite())
7958      composeCodeableConcept(t, "Media", "bodySite", element.getBodySite(), -1);
7959    if (element.hasDevice())
7960      composeReference(t, "Media", "device", element.getDevice(), -1);
7961    if (element.hasHeightElement())
7962      composePositiveInt(t, "Media", "height", element.getHeightElement(), -1);
7963    if (element.hasWidthElement())
7964      composePositiveInt(t, "Media", "width", element.getWidthElement(), -1);
7965    if (element.hasFramesElement())
7966      composePositiveInt(t, "Media", "frames", element.getFramesElement(), -1);
7967    if (element.hasDurationElement())
7968      composeUnsignedInt(t, "Media", "duration", element.getDurationElement(), -1);
7969    if (element.hasContent())
7970      composeAttachment(t, "Media", "content", element.getContent(), -1);
7971    for (int i = 0; i < element.getNote().size(); i++)
7972      composeAnnotation(t, "Media", "note", element.getNote().get(i), i);
7973  }
7974
7975  protected void composeMedication(Complex parent, String parentType, String name, Medication element, int index) {
7976    if (element == null) 
7977      return;
7978    Complex t;
7979    if (Utilities.noString(parentType))
7980      t = parent;
7981    else {
7982      t = parent.predicate("fhir:"+parentType+'.'+name);
7983    }
7984    composeDomainResource(t, "Medication", name, element, index);
7985    if (element.hasCode())
7986      composeCodeableConcept(t, "Medication", "code", element.getCode(), -1);
7987    if (element.hasStatusElement())
7988      composeEnum(t, "Medication", "status", element.getStatusElement(), -1);
7989    if (element.hasIsBrandElement())
7990      composeBoolean(t, "Medication", "isBrand", element.getIsBrandElement(), -1);
7991    if (element.hasIsOverTheCounterElement())
7992      composeBoolean(t, "Medication", "isOverTheCounter", element.getIsOverTheCounterElement(), -1);
7993    if (element.hasManufacturer())
7994      composeReference(t, "Medication", "manufacturer", element.getManufacturer(), -1);
7995    if (element.hasForm())
7996      composeCodeableConcept(t, "Medication", "form", element.getForm(), -1);
7997    for (int i = 0; i < element.getIngredient().size(); i++)
7998      composeMedicationMedicationIngredientComponent(t, "Medication", "ingredient", element.getIngredient().get(i), i);
7999    if (element.hasPackage())
8000      composeMedicationMedicationPackageComponent(t, "Medication", "package", element.getPackage(), -1);
8001    for (int i = 0; i < element.getImage().size(); i++)
8002      composeAttachment(t, "Medication", "image", element.getImage().get(i), i);
8003  }
8004
8005  protected void composeMedicationMedicationIngredientComponent(Complex parent, String parentType, String name, Medication.MedicationIngredientComponent element, int index) {
8006    if (element == null) 
8007      return;
8008    Complex t;
8009    if (Utilities.noString(parentType))
8010      t = parent;
8011    else {
8012      t = parent.predicate("fhir:"+parentType+'.'+name);
8013    }
8014    composeBackboneElement(t, "ingredient", name, element, index);
8015    if (element.hasItem())
8016      composeType(t, "Medication", "item", element.getItem(), -1);
8017    if (element.hasIsActiveElement())
8018      composeBoolean(t, "Medication", "isActive", element.getIsActiveElement(), -1);
8019    if (element.hasAmount())
8020      composeRatio(t, "Medication", "amount", element.getAmount(), -1);
8021  }
8022
8023  protected void composeMedicationMedicationPackageComponent(Complex parent, String parentType, String name, Medication.MedicationPackageComponent 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, "package", name, element, index);
8033    if (element.hasContainer())
8034      composeCodeableConcept(t, "Medication", "container", element.getContainer(), -1);
8035    for (int i = 0; i < element.getContent().size(); i++)
8036      composeMedicationMedicationPackageContentComponent(t, "Medication", "content", element.getContent().get(i), i);
8037    for (int i = 0; i < element.getBatch().size(); i++)
8038      composeMedicationMedicationPackageBatchComponent(t, "Medication", "batch", element.getBatch().get(i), i);
8039  }
8040
8041  protected void composeMedicationMedicationPackageContentComponent(Complex parent, String parentType, String name, Medication.MedicationPackageContentComponent element, int index) {
8042    if (element == null) 
8043      return;
8044    Complex t;
8045    if (Utilities.noString(parentType))
8046      t = parent;
8047    else {
8048      t = parent.predicate("fhir:"+parentType+'.'+name);
8049    }
8050    composeBackboneElement(t, "content", name, element, index);
8051    if (element.hasItem())
8052      composeType(t, "Medication", "item", element.getItem(), -1);
8053    if (element.hasAmount())
8054      composeQuantity(t, "Medication", "amount", element.getAmount(), -1);
8055  }
8056
8057  protected void composeMedicationMedicationPackageBatchComponent(Complex parent, String parentType, String name, Medication.MedicationPackageBatchComponent element, int index) {
8058    if (element == null) 
8059      return;
8060    Complex t;
8061    if (Utilities.noString(parentType))
8062      t = parent;
8063    else {
8064      t = parent.predicate("fhir:"+parentType+'.'+name);
8065    }
8066    composeBackboneElement(t, "batch", name, element, index);
8067    if (element.hasLotNumberElement())
8068      composeString(t, "Medication", "lotNumber", element.getLotNumberElement(), -1);
8069    if (element.hasExpirationDateElement())
8070      composeDateTime(t, "Medication", "expirationDate", element.getExpirationDateElement(), -1);
8071  }
8072
8073  protected void composeMedicationAdministration(Complex parent, String parentType, String name, MedicationAdministration element, int index) {
8074    if (element == null) 
8075      return;
8076    Complex t;
8077    if (Utilities.noString(parentType))
8078      t = parent;
8079    else {
8080      t = parent.predicate("fhir:"+parentType+'.'+name);
8081    }
8082    composeDomainResource(t, "MedicationAdministration", name, element, index);
8083    for (int i = 0; i < element.getIdentifier().size(); i++)
8084      composeIdentifier(t, "MedicationAdministration", "identifier", element.getIdentifier().get(i), i);
8085    for (int i = 0; i < element.getDefinition().size(); i++)
8086      composeReference(t, "MedicationAdministration", "definition", element.getDefinition().get(i), i);
8087    for (int i = 0; i < element.getPartOf().size(); i++)
8088      composeReference(t, "MedicationAdministration", "partOf", element.getPartOf().get(i), i);
8089    if (element.hasStatusElement())
8090      composeEnum(t, "MedicationAdministration", "status", element.getStatusElement(), -1);
8091    if (element.hasCategory())
8092      composeCodeableConcept(t, "MedicationAdministration", "category", element.getCategory(), -1);
8093    if (element.hasMedication())
8094      composeType(t, "MedicationAdministration", "medication", element.getMedication(), -1);
8095    if (element.hasSubject())
8096      composeReference(t, "MedicationAdministration", "subject", element.getSubject(), -1);
8097    if (element.hasContext())
8098      composeReference(t, "MedicationAdministration", "context", element.getContext(), -1);
8099    for (int i = 0; i < element.getSupportingInformation().size(); i++)
8100      composeReference(t, "MedicationAdministration", "supportingInformation", element.getSupportingInformation().get(i), i);
8101    if (element.hasEffective())
8102      composeType(t, "MedicationAdministration", "effective", element.getEffective(), -1);
8103    for (int i = 0; i < element.getPerformer().size(); i++)
8104      composeMedicationAdministrationMedicationAdministrationPerformerComponent(t, "MedicationAdministration", "performer", element.getPerformer().get(i), i);
8105    if (element.hasNotGivenElement())
8106      composeBoolean(t, "MedicationAdministration", "notGiven", element.getNotGivenElement(), -1);
8107    for (int i = 0; i < element.getReasonNotGiven().size(); i++)
8108      composeCodeableConcept(t, "MedicationAdministration", "reasonNotGiven", element.getReasonNotGiven().get(i), i);
8109    for (int i = 0; i < element.getReasonCode().size(); i++)
8110      composeCodeableConcept(t, "MedicationAdministration", "reasonCode", element.getReasonCode().get(i), i);
8111    for (int i = 0; i < element.getReasonReference().size(); i++)
8112      composeReference(t, "MedicationAdministration", "reasonReference", element.getReasonReference().get(i), i);
8113    if (element.hasPrescription())
8114      composeReference(t, "MedicationAdministration", "prescription", element.getPrescription(), -1);
8115    for (int i = 0; i < element.getDevice().size(); i++)
8116      composeReference(t, "MedicationAdministration", "device", element.getDevice().get(i), i);
8117    for (int i = 0; i < element.getNote().size(); i++)
8118      composeAnnotation(t, "MedicationAdministration", "note", element.getNote().get(i), i);
8119    if (element.hasDosage())
8120      composeMedicationAdministrationMedicationAdministrationDosageComponent(t, "MedicationAdministration", "dosage", element.getDosage(), -1);
8121    for (int i = 0; i < element.getEventHistory().size(); i++)
8122      composeReference(t, "MedicationAdministration", "eventHistory", element.getEventHistory().get(i), i);
8123  }
8124
8125  protected void composeMedicationAdministrationMedicationAdministrationPerformerComponent(Complex parent, String parentType, String name, MedicationAdministration.MedicationAdministrationPerformerComponent 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, "performer", name, element, index);
8135    if (element.hasActor())
8136      composeReference(t, "MedicationAdministration", "actor", element.getActor(), -1);
8137    if (element.hasOnBehalfOf())
8138      composeReference(t, "MedicationAdministration", "onBehalfOf", element.getOnBehalfOf(), -1);
8139  }
8140
8141  protected void composeMedicationAdministrationMedicationAdministrationDosageComponent(Complex parent, String parentType, String name, MedicationAdministration.MedicationAdministrationDosageComponent element, int index) {
8142    if (element == null) 
8143      return;
8144    Complex t;
8145    if (Utilities.noString(parentType))
8146      t = parent;
8147    else {
8148      t = parent.predicate("fhir:"+parentType+'.'+name);
8149    }
8150    composeBackboneElement(t, "dosage", name, element, index);
8151    if (element.hasTextElement())
8152      composeString(t, "MedicationAdministration", "text", element.getTextElement(), -1);
8153    if (element.hasSite())
8154      composeCodeableConcept(t, "MedicationAdministration", "site", element.getSite(), -1);
8155    if (element.hasRoute())
8156      composeCodeableConcept(t, "MedicationAdministration", "route", element.getRoute(), -1);
8157    if (element.hasMethod())
8158      composeCodeableConcept(t, "MedicationAdministration", "method", element.getMethod(), -1);
8159    if (element.hasDose())
8160      composeQuantity(t, "MedicationAdministration", "dose", element.getDose(), -1);
8161    if (element.hasRate())
8162      composeType(t, "MedicationAdministration", "rate", element.getRate(), -1);
8163  }
8164
8165  protected void composeMedicationDispense(Complex parent, String parentType, String name, MedicationDispense element, int index) {
8166    if (element == null) 
8167      return;
8168    Complex t;
8169    if (Utilities.noString(parentType))
8170      t = parent;
8171    else {
8172      t = parent.predicate("fhir:"+parentType+'.'+name);
8173    }
8174    composeDomainResource(t, "MedicationDispense", name, element, index);
8175    for (int i = 0; i < element.getIdentifier().size(); i++)
8176      composeIdentifier(t, "MedicationDispense", "identifier", element.getIdentifier().get(i), i);
8177    for (int i = 0; i < element.getPartOf().size(); i++)
8178      composeReference(t, "MedicationDispense", "partOf", element.getPartOf().get(i), i);
8179    if (element.hasStatusElement())
8180      composeEnum(t, "MedicationDispense", "status", element.getStatusElement(), -1);
8181    if (element.hasCategory())
8182      composeCodeableConcept(t, "MedicationDispense", "category", element.getCategory(), -1);
8183    if (element.hasMedication())
8184      composeType(t, "MedicationDispense", "medication", element.getMedication(), -1);
8185    if (element.hasSubject())
8186      composeReference(t, "MedicationDispense", "subject", element.getSubject(), -1);
8187    if (element.hasContext())
8188      composeReference(t, "MedicationDispense", "context", element.getContext(), -1);
8189    for (int i = 0; i < element.getSupportingInformation().size(); i++)
8190      composeReference(t, "MedicationDispense", "supportingInformation", element.getSupportingInformation().get(i), i);
8191    for (int i = 0; i < element.getPerformer().size(); i++)
8192      composeMedicationDispenseMedicationDispensePerformerComponent(t, "MedicationDispense", "performer", element.getPerformer().get(i), i);
8193    for (int i = 0; i < element.getAuthorizingPrescription().size(); i++)
8194      composeReference(t, "MedicationDispense", "authorizingPrescription", element.getAuthorizingPrescription().get(i), i);
8195    if (element.hasType())
8196      composeCodeableConcept(t, "MedicationDispense", "type", element.getType(), -1);
8197    if (element.hasQuantity())
8198      composeQuantity(t, "MedicationDispense", "quantity", element.getQuantity(), -1);
8199    if (element.hasDaysSupply())
8200      composeQuantity(t, "MedicationDispense", "daysSupply", element.getDaysSupply(), -1);
8201    if (element.hasWhenPreparedElement())
8202      composeDateTime(t, "MedicationDispense", "whenPrepared", element.getWhenPreparedElement(), -1);
8203    if (element.hasWhenHandedOverElement())
8204      composeDateTime(t, "MedicationDispense", "whenHandedOver", element.getWhenHandedOverElement(), -1);
8205    if (element.hasDestination())
8206      composeReference(t, "MedicationDispense", "destination", element.getDestination(), -1);
8207    for (int i = 0; i < element.getReceiver().size(); i++)
8208      composeReference(t, "MedicationDispense", "receiver", element.getReceiver().get(i), i);
8209    for (int i = 0; i < element.getNote().size(); i++)
8210      composeAnnotation(t, "MedicationDispense", "note", element.getNote().get(i), i);
8211    for (int i = 0; i < element.getDosageInstruction().size(); i++)
8212      composeDosage(t, "MedicationDispense", "dosageInstruction", element.getDosageInstruction().get(i), i);
8213    if (element.hasSubstitution())
8214      composeMedicationDispenseMedicationDispenseSubstitutionComponent(t, "MedicationDispense", "substitution", element.getSubstitution(), -1);
8215    for (int i = 0; i < element.getDetectedIssue().size(); i++)
8216      composeReference(t, "MedicationDispense", "detectedIssue", element.getDetectedIssue().get(i), i);
8217    if (element.hasNotDoneElement())
8218      composeBoolean(t, "MedicationDispense", "notDone", element.getNotDoneElement(), -1);
8219    if (element.hasNotDoneReason())
8220      composeType(t, "MedicationDispense", "notDoneReason", element.getNotDoneReason(), -1);
8221    for (int i = 0; i < element.getEventHistory().size(); i++)
8222      composeReference(t, "MedicationDispense", "eventHistory", element.getEventHistory().get(i), i);
8223  }
8224
8225  protected void composeMedicationDispenseMedicationDispensePerformerComponent(Complex parent, String parentType, String name, MedicationDispense.MedicationDispensePerformerComponent element, int index) {
8226    if (element == null) 
8227      return;
8228    Complex t;
8229    if (Utilities.noString(parentType))
8230      t = parent;
8231    else {
8232      t = parent.predicate("fhir:"+parentType+'.'+name);
8233    }
8234    composeBackboneElement(t, "performer", name, element, index);
8235    if (element.hasActor())
8236      composeReference(t, "MedicationDispense", "actor", element.getActor(), -1);
8237    if (element.hasOnBehalfOf())
8238      composeReference(t, "MedicationDispense", "onBehalfOf", element.getOnBehalfOf(), -1);
8239  }
8240
8241  protected void composeMedicationDispenseMedicationDispenseSubstitutionComponent(Complex parent, String parentType, String name, MedicationDispense.MedicationDispenseSubstitutionComponent element, int index) {
8242    if (element == null) 
8243      return;
8244    Complex t;
8245    if (Utilities.noString(parentType))
8246      t = parent;
8247    else {
8248      t = parent.predicate("fhir:"+parentType+'.'+name);
8249    }
8250    composeBackboneElement(t, "substitution", name, element, index);
8251    if (element.hasWasSubstitutedElement())
8252      composeBoolean(t, "MedicationDispense", "wasSubstituted", element.getWasSubstitutedElement(), -1);
8253    if (element.hasType())
8254      composeCodeableConcept(t, "MedicationDispense", "type", element.getType(), -1);
8255    for (int i = 0; i < element.getReason().size(); i++)
8256      composeCodeableConcept(t, "MedicationDispense", "reason", element.getReason().get(i), i);
8257    for (int i = 0; i < element.getResponsibleParty().size(); i++)
8258      composeReference(t, "MedicationDispense", "responsibleParty", element.getResponsibleParty().get(i), i);
8259  }
8260
8261  protected void composeMedicationRequest(Complex parent, String parentType, String name, MedicationRequest element, int index) {
8262    if (element == null) 
8263      return;
8264    Complex t;
8265    if (Utilities.noString(parentType))
8266      t = parent;
8267    else {
8268      t = parent.predicate("fhir:"+parentType+'.'+name);
8269    }
8270    composeDomainResource(t, "MedicationRequest", name, element, index);
8271    for (int i = 0; i < element.getIdentifier().size(); i++)
8272      composeIdentifier(t, "MedicationRequest", "identifier", element.getIdentifier().get(i), i);
8273    for (int i = 0; i < element.getDefinition().size(); i++)
8274      composeReference(t, "MedicationRequest", "definition", element.getDefinition().get(i), i);
8275    for (int i = 0; i < element.getBasedOn().size(); i++)
8276      composeReference(t, "MedicationRequest", "basedOn", element.getBasedOn().get(i), i);
8277    if (element.hasGroupIdentifier())
8278      composeIdentifier(t, "MedicationRequest", "groupIdentifier", element.getGroupIdentifier(), -1);
8279    if (element.hasStatusElement())
8280      composeEnum(t, "MedicationRequest", "status", element.getStatusElement(), -1);
8281    if (element.hasIntentElement())
8282      composeEnum(t, "MedicationRequest", "intent", element.getIntentElement(), -1);
8283    if (element.hasCategory())
8284      composeCodeableConcept(t, "MedicationRequest", "category", element.getCategory(), -1);
8285    if (element.hasPriorityElement())
8286      composeEnum(t, "MedicationRequest", "priority", element.getPriorityElement(), -1);
8287    if (element.hasMedication())
8288      composeType(t, "MedicationRequest", "medication", element.getMedication(), -1);
8289    if (element.hasSubject())
8290      composeReference(t, "MedicationRequest", "subject", element.getSubject(), -1);
8291    if (element.hasContext())
8292      composeReference(t, "MedicationRequest", "context", element.getContext(), -1);
8293    for (int i = 0; i < element.getSupportingInformation().size(); i++)
8294      composeReference(t, "MedicationRequest", "supportingInformation", element.getSupportingInformation().get(i), i);
8295    if (element.hasAuthoredOnElement())
8296      composeDateTime(t, "MedicationRequest", "authoredOn", element.getAuthoredOnElement(), -1);
8297    if (element.hasRequester())
8298      composeMedicationRequestMedicationRequestRequesterComponent(t, "MedicationRequest", "requester", element.getRequester(), -1);
8299    if (element.hasRecorder())
8300      composeReference(t, "MedicationRequest", "recorder", element.getRecorder(), -1);
8301    for (int i = 0; i < element.getReasonCode().size(); i++)
8302      composeCodeableConcept(t, "MedicationRequest", "reasonCode", element.getReasonCode().get(i), i);
8303    for (int i = 0; i < element.getReasonReference().size(); i++)
8304      composeReference(t, "MedicationRequest", "reasonReference", element.getReasonReference().get(i), i);
8305    for (int i = 0; i < element.getNote().size(); i++)
8306      composeAnnotation(t, "MedicationRequest", "note", element.getNote().get(i), i);
8307    for (int i = 0; i < element.getDosageInstruction().size(); i++)
8308      composeDosage(t, "MedicationRequest", "dosageInstruction", element.getDosageInstruction().get(i), i);
8309    if (element.hasDispenseRequest())
8310      composeMedicationRequestMedicationRequestDispenseRequestComponent(t, "MedicationRequest", "dispenseRequest", element.getDispenseRequest(), -1);
8311    if (element.hasSubstitution())
8312      composeMedicationRequestMedicationRequestSubstitutionComponent(t, "MedicationRequest", "substitution", element.getSubstitution(), -1);
8313    if (element.hasPriorPrescription())
8314      composeReference(t, "MedicationRequest", "priorPrescription", element.getPriorPrescription(), -1);
8315    for (int i = 0; i < element.getDetectedIssue().size(); i++)
8316      composeReference(t, "MedicationRequest", "detectedIssue", element.getDetectedIssue().get(i), i);
8317    for (int i = 0; i < element.getEventHistory().size(); i++)
8318      composeReference(t, "MedicationRequest", "eventHistory", element.getEventHistory().get(i), i);
8319  }
8320
8321  protected void composeMedicationRequestMedicationRequestRequesterComponent(Complex parent, String parentType, String name, MedicationRequest.MedicationRequestRequesterComponent element, int index) {
8322    if (element == null) 
8323      return;
8324    Complex t;
8325    if (Utilities.noString(parentType))
8326      t = parent;
8327    else {
8328      t = parent.predicate("fhir:"+parentType+'.'+name);
8329    }
8330    composeBackboneElement(t, "requester", name, element, index);
8331    if (element.hasAgent())
8332      composeReference(t, "MedicationRequest", "agent", element.getAgent(), -1);
8333    if (element.hasOnBehalfOf())
8334      composeReference(t, "MedicationRequest", "onBehalfOf", element.getOnBehalfOf(), -1);
8335  }
8336
8337  protected void composeMedicationRequestMedicationRequestDispenseRequestComponent(Complex parent, String parentType, String name, MedicationRequest.MedicationRequestDispenseRequestComponent element, int index) {
8338    if (element == null) 
8339      return;
8340    Complex t;
8341    if (Utilities.noString(parentType))
8342      t = parent;
8343    else {
8344      t = parent.predicate("fhir:"+parentType+'.'+name);
8345    }
8346    composeBackboneElement(t, "dispenseRequest", name, element, index);
8347    if (element.hasValidityPeriod())
8348      composePeriod(t, "MedicationRequest", "validityPeriod", element.getValidityPeriod(), -1);
8349    if (element.hasNumberOfRepeatsAllowedElement())
8350      composePositiveInt(t, "MedicationRequest", "numberOfRepeatsAllowed", element.getNumberOfRepeatsAllowedElement(), -1);
8351    if (element.hasQuantity())
8352      composeQuantity(t, "MedicationRequest", "quantity", element.getQuantity(), -1);
8353    if (element.hasExpectedSupplyDuration())
8354      composeDuration(t, "MedicationRequest", "expectedSupplyDuration", element.getExpectedSupplyDuration(), -1);
8355    if (element.hasPerformer())
8356      composeReference(t, "MedicationRequest", "performer", element.getPerformer(), -1);
8357  }
8358
8359  protected void composeMedicationRequestMedicationRequestSubstitutionComponent(Complex parent, String parentType, String name, MedicationRequest.MedicationRequestSubstitutionComponent element, int index) {
8360    if (element == null) 
8361      return;
8362    Complex t;
8363    if (Utilities.noString(parentType))
8364      t = parent;
8365    else {
8366      t = parent.predicate("fhir:"+parentType+'.'+name);
8367    }
8368    composeBackboneElement(t, "substitution", name, element, index);
8369    if (element.hasAllowedElement())
8370      composeBoolean(t, "MedicationRequest", "allowed", element.getAllowedElement(), -1);
8371    if (element.hasReason())
8372      composeCodeableConcept(t, "MedicationRequest", "reason", element.getReason(), -1);
8373  }
8374
8375  protected void composeMedicationStatement(Complex parent, String parentType, String name, MedicationStatement element, int index) {
8376    if (element == null) 
8377      return;
8378    Complex t;
8379    if (Utilities.noString(parentType))
8380      t = parent;
8381    else {
8382      t = parent.predicate("fhir:"+parentType+'.'+name);
8383    }
8384    composeDomainResource(t, "MedicationStatement", name, element, index);
8385    for (int i = 0; i < element.getIdentifier().size(); i++)
8386      composeIdentifier(t, "MedicationStatement", "identifier", element.getIdentifier().get(i), i);
8387    for (int i = 0; i < element.getBasedOn().size(); i++)
8388      composeReference(t, "MedicationStatement", "basedOn", element.getBasedOn().get(i), i);
8389    for (int i = 0; i < element.getPartOf().size(); i++)
8390      composeReference(t, "MedicationStatement", "partOf", element.getPartOf().get(i), i);
8391    if (element.hasContext())
8392      composeReference(t, "MedicationStatement", "context", element.getContext(), -1);
8393    if (element.hasStatusElement())
8394      composeEnum(t, "MedicationStatement", "status", element.getStatusElement(), -1);
8395    if (element.hasCategory())
8396      composeCodeableConcept(t, "MedicationStatement", "category", element.getCategory(), -1);
8397    if (element.hasMedication())
8398      composeType(t, "MedicationStatement", "medication", element.getMedication(), -1);
8399    if (element.hasEffective())
8400      composeType(t, "MedicationStatement", "effective", element.getEffective(), -1);
8401    if (element.hasDateAssertedElement())
8402      composeDateTime(t, "MedicationStatement", "dateAsserted", element.getDateAssertedElement(), -1);
8403    if (element.hasInformationSource())
8404      composeReference(t, "MedicationStatement", "informationSource", element.getInformationSource(), -1);
8405    if (element.hasSubject())
8406      composeReference(t, "MedicationStatement", "subject", element.getSubject(), -1);
8407    for (int i = 0; i < element.getDerivedFrom().size(); i++)
8408      composeReference(t, "MedicationStatement", "derivedFrom", element.getDerivedFrom().get(i), i);
8409    if (element.hasTakenElement())
8410      composeEnum(t, "MedicationStatement", "taken", element.getTakenElement(), -1);
8411    for (int i = 0; i < element.getReasonNotTaken().size(); i++)
8412      composeCodeableConcept(t, "MedicationStatement", "reasonNotTaken", element.getReasonNotTaken().get(i), i);
8413    for (int i = 0; i < element.getReasonCode().size(); i++)
8414      composeCodeableConcept(t, "MedicationStatement", "reasonCode", element.getReasonCode().get(i), i);
8415    for (int i = 0; i < element.getReasonReference().size(); i++)
8416      composeReference(t, "MedicationStatement", "reasonReference", element.getReasonReference().get(i), i);
8417    for (int i = 0; i < element.getNote().size(); i++)
8418      composeAnnotation(t, "MedicationStatement", "note", element.getNote().get(i), i);
8419    for (int i = 0; i < element.getDosage().size(); i++)
8420      composeDosage(t, "MedicationStatement", "dosage", element.getDosage().get(i), i);
8421  }
8422
8423  protected void composeMessageDefinition(Complex parent, String parentType, String name, MessageDefinition element, int index) {
8424    if (element == null) 
8425      return;
8426    Complex t;
8427    if (Utilities.noString(parentType))
8428      t = parent;
8429    else {
8430      t = parent.predicate("fhir:"+parentType+'.'+name);
8431    }
8432    composeDomainResource(t, "MessageDefinition", name, element, index);
8433    if (element.hasUrlElement())
8434      composeUri(t, "MessageDefinition", "url", element.getUrlElement(), -1);
8435    if (element.hasIdentifier())
8436      composeIdentifier(t, "MessageDefinition", "identifier", element.getIdentifier(), -1);
8437    if (element.hasVersionElement())
8438      composeString(t, "MessageDefinition", "version", element.getVersionElement(), -1);
8439    if (element.hasNameElement())
8440      composeString(t, "MessageDefinition", "name", element.getNameElement(), -1);
8441    if (element.hasTitleElement())
8442      composeString(t, "MessageDefinition", "title", element.getTitleElement(), -1);
8443    if (element.hasStatusElement())
8444      composeEnum(t, "MessageDefinition", "status", element.getStatusElement(), -1);
8445    if (element.hasExperimentalElement())
8446      composeBoolean(t, "MessageDefinition", "experimental", element.getExperimentalElement(), -1);
8447    if (element.hasDateElement())
8448      composeDateTime(t, "MessageDefinition", "date", element.getDateElement(), -1);
8449    if (element.hasPublisherElement())
8450      composeString(t, "MessageDefinition", "publisher", element.getPublisherElement(), -1);
8451    for (int i = 0; i < element.getContact().size(); i++)
8452      composeContactDetail(t, "MessageDefinition", "contact", element.getContact().get(i), i);
8453    if (element.hasDescriptionElement())
8454      composeMarkdown(t, "MessageDefinition", "description", element.getDescriptionElement(), -1);
8455    for (int i = 0; i < element.getUseContext().size(); i++)
8456      composeUsageContext(t, "MessageDefinition", "useContext", element.getUseContext().get(i), i);
8457    for (int i = 0; i < element.getJurisdiction().size(); i++)
8458      composeCodeableConcept(t, "MessageDefinition", "jurisdiction", element.getJurisdiction().get(i), i);
8459    if (element.hasPurposeElement())
8460      composeMarkdown(t, "MessageDefinition", "purpose", element.getPurposeElement(), -1);
8461    if (element.hasCopyrightElement())
8462      composeMarkdown(t, "MessageDefinition", "copyright", element.getCopyrightElement(), -1);
8463    if (element.hasBase())
8464      composeReference(t, "MessageDefinition", "base", element.getBase(), -1);
8465    for (int i = 0; i < element.getParent().size(); i++)
8466      composeReference(t, "MessageDefinition", "parent", element.getParent().get(i), i);
8467    for (int i = 0; i < element.getReplaces().size(); i++)
8468      composeReference(t, "MessageDefinition", "replaces", element.getReplaces().get(i), i);
8469    if (element.hasEvent())
8470      composeCoding(t, "MessageDefinition", "event", element.getEvent(), -1);
8471    if (element.hasCategoryElement())
8472      composeEnum(t, "MessageDefinition", "category", element.getCategoryElement(), -1);
8473    for (int i = 0; i < element.getFocus().size(); i++)
8474      composeMessageDefinitionMessageDefinitionFocusComponent(t, "MessageDefinition", "focus", element.getFocus().get(i), i);
8475    if (element.hasResponseRequiredElement())
8476      composeBoolean(t, "MessageDefinition", "responseRequired", element.getResponseRequiredElement(), -1);
8477    for (int i = 0; i < element.getAllowedResponse().size(); i++)
8478      composeMessageDefinitionMessageDefinitionAllowedResponseComponent(t, "MessageDefinition", "allowedResponse", element.getAllowedResponse().get(i), i);
8479  }
8480
8481  protected void composeMessageDefinitionMessageDefinitionFocusComponent(Complex parent, String parentType, String name, MessageDefinition.MessageDefinitionFocusComponent element, int index) {
8482    if (element == null) 
8483      return;
8484    Complex t;
8485    if (Utilities.noString(parentType))
8486      t = parent;
8487    else {
8488      t = parent.predicate("fhir:"+parentType+'.'+name);
8489    }
8490    composeBackboneElement(t, "focus", name, element, index);
8491    if (element.hasCodeElement())
8492      composeCode(t, "MessageDefinition", "code", element.getCodeElement(), -1);
8493    if (element.hasProfile())
8494      composeReference(t, "MessageDefinition", "profile", element.getProfile(), -1);
8495    if (element.hasMinElement())
8496      composeUnsignedInt(t, "MessageDefinition", "min", element.getMinElement(), -1);
8497    if (element.hasMaxElement())
8498      composeString(t, "MessageDefinition", "max", element.getMaxElement(), -1);
8499  }
8500
8501  protected void composeMessageDefinitionMessageDefinitionAllowedResponseComponent(Complex parent, String parentType, String name, MessageDefinition.MessageDefinitionAllowedResponseComponent element, int index) {
8502    if (element == null) 
8503      return;
8504    Complex t;
8505    if (Utilities.noString(parentType))
8506      t = parent;
8507    else {
8508      t = parent.predicate("fhir:"+parentType+'.'+name);
8509    }
8510    composeBackboneElement(t, "allowedResponse", name, element, index);
8511    if (element.hasMessage())
8512      composeReference(t, "MessageDefinition", "message", element.getMessage(), -1);
8513    if (element.hasSituationElement())
8514      composeMarkdown(t, "MessageDefinition", "situation", element.getSituationElement(), -1);
8515  }
8516
8517  protected void composeMessageHeader(Complex parent, String parentType, String name, MessageHeader element, int index) {
8518    if (element == null) 
8519      return;
8520    Complex t;
8521    if (Utilities.noString(parentType))
8522      t = parent;
8523    else {
8524      t = parent.predicate("fhir:"+parentType+'.'+name);
8525    }
8526    composeDomainResource(t, "MessageHeader", name, element, index);
8527    if (element.hasEvent())
8528      composeCoding(t, "MessageHeader", "event", element.getEvent(), -1);
8529    for (int i = 0; i < element.getDestination().size(); i++)
8530      composeMessageHeaderMessageDestinationComponent(t, "MessageHeader", "destination", element.getDestination().get(i), i);
8531    if (element.hasReceiver())
8532      composeReference(t, "MessageHeader", "receiver", element.getReceiver(), -1);
8533    if (element.hasSender())
8534      composeReference(t, "MessageHeader", "sender", element.getSender(), -1);
8535    if (element.hasTimestampElement())
8536      composeInstant(t, "MessageHeader", "timestamp", element.getTimestampElement(), -1);
8537    if (element.hasEnterer())
8538      composeReference(t, "MessageHeader", "enterer", element.getEnterer(), -1);
8539    if (element.hasAuthor())
8540      composeReference(t, "MessageHeader", "author", element.getAuthor(), -1);
8541    if (element.hasSource())
8542      composeMessageHeaderMessageSourceComponent(t, "MessageHeader", "source", element.getSource(), -1);
8543    if (element.hasResponsible())
8544      composeReference(t, "MessageHeader", "responsible", element.getResponsible(), -1);
8545    if (element.hasReason())
8546      composeCodeableConcept(t, "MessageHeader", "reason", element.getReason(), -1);
8547    if (element.hasResponse())
8548      composeMessageHeaderMessageHeaderResponseComponent(t, "MessageHeader", "response", element.getResponse(), -1);
8549    for (int i = 0; i < element.getFocus().size(); i++)
8550      composeReference(t, "MessageHeader", "focus", element.getFocus().get(i), i);
8551  }
8552
8553  protected void composeMessageHeaderMessageDestinationComponent(Complex parent, String parentType, String name, MessageHeader.MessageDestinationComponent element, int index) {
8554    if (element == null) 
8555      return;
8556    Complex t;
8557    if (Utilities.noString(parentType))
8558      t = parent;
8559    else {
8560      t = parent.predicate("fhir:"+parentType+'.'+name);
8561    }
8562    composeBackboneElement(t, "destination", name, element, index);
8563    if (element.hasNameElement())
8564      composeString(t, "MessageHeader", "name", element.getNameElement(), -1);
8565    if (element.hasTarget())
8566      composeReference(t, "MessageHeader", "target", element.getTarget(), -1);
8567    if (element.hasEndpointElement())
8568      composeUri(t, "MessageHeader", "endpoint", element.getEndpointElement(), -1);
8569  }
8570
8571  protected void composeMessageHeaderMessageSourceComponent(Complex parent, String parentType, String name, MessageHeader.MessageSourceComponent element, int index) {
8572    if (element == null) 
8573      return;
8574    Complex t;
8575    if (Utilities.noString(parentType))
8576      t = parent;
8577    else {
8578      t = parent.predicate("fhir:"+parentType+'.'+name);
8579    }
8580    composeBackboneElement(t, "source", name, element, index);
8581    if (element.hasNameElement())
8582      composeString(t, "MessageHeader", "name", element.getNameElement(), -1);
8583    if (element.hasSoftwareElement())
8584      composeString(t, "MessageHeader", "software", element.getSoftwareElement(), -1);
8585    if (element.hasVersionElement())
8586      composeString(t, "MessageHeader", "version", element.getVersionElement(), -1);
8587    if (element.hasContact())
8588      composeContactPoint(t, "MessageHeader", "contact", element.getContact(), -1);
8589    if (element.hasEndpointElement())
8590      composeUri(t, "MessageHeader", "endpoint", element.getEndpointElement(), -1);
8591  }
8592
8593  protected void composeMessageHeaderMessageHeaderResponseComponent(Complex parent, String parentType, String name, MessageHeader.MessageHeaderResponseComponent element, int index) {
8594    if (element == null) 
8595      return;
8596    Complex t;
8597    if (Utilities.noString(parentType))
8598      t = parent;
8599    else {
8600      t = parent.predicate("fhir:"+parentType+'.'+name);
8601    }
8602    composeBackboneElement(t, "response", name, element, index);
8603    if (element.hasIdentifierElement())
8604      composeId(t, "MessageHeader", "identifier", element.getIdentifierElement(), -1);
8605    if (element.hasCodeElement())
8606      composeEnum(t, "MessageHeader", "code", element.getCodeElement(), -1);
8607    if (element.hasDetails())
8608      composeReference(t, "MessageHeader", "details", element.getDetails(), -1);
8609  }
8610
8611  protected void composeNamingSystem(Complex parent, String parentType, String name, NamingSystem element, int index) {
8612    if (element == null) 
8613      return;
8614    Complex t;
8615    if (Utilities.noString(parentType))
8616      t = parent;
8617    else {
8618      t = parent.predicate("fhir:"+parentType+'.'+name);
8619    }
8620    composeDomainResource(t, "NamingSystem", name, element, index);
8621    if (element.hasNameElement())
8622      composeString(t, "NamingSystem", "name", element.getNameElement(), -1);
8623    if (element.hasStatusElement())
8624      composeEnum(t, "NamingSystem", "status", element.getStatusElement(), -1);
8625    if (element.hasKindElement())
8626      composeEnum(t, "NamingSystem", "kind", element.getKindElement(), -1);
8627    if (element.hasDateElement())
8628      composeDateTime(t, "NamingSystem", "date", element.getDateElement(), -1);
8629    if (element.hasPublisherElement())
8630      composeString(t, "NamingSystem", "publisher", element.getPublisherElement(), -1);
8631    for (int i = 0; i < element.getContact().size(); i++)
8632      composeContactDetail(t, "NamingSystem", "contact", element.getContact().get(i), i);
8633    if (element.hasResponsibleElement())
8634      composeString(t, "NamingSystem", "responsible", element.getResponsibleElement(), -1);
8635    if (element.hasType())
8636      composeCodeableConcept(t, "NamingSystem", "type", element.getType(), -1);
8637    if (element.hasDescriptionElement())
8638      composeMarkdown(t, "NamingSystem", "description", element.getDescriptionElement(), -1);
8639    for (int i = 0; i < element.getUseContext().size(); i++)
8640      composeUsageContext(t, "NamingSystem", "useContext", element.getUseContext().get(i), i);
8641    for (int i = 0; i < element.getJurisdiction().size(); i++)
8642      composeCodeableConcept(t, "NamingSystem", "jurisdiction", element.getJurisdiction().get(i), i);
8643    if (element.hasUsageElement())
8644      composeString(t, "NamingSystem", "usage", element.getUsageElement(), -1);
8645    for (int i = 0; i < element.getUniqueId().size(); i++)
8646      composeNamingSystemNamingSystemUniqueIdComponent(t, "NamingSystem", "uniqueId", element.getUniqueId().get(i), i);
8647    if (element.hasReplacedBy())
8648      composeReference(t, "NamingSystem", "replacedBy", element.getReplacedBy(), -1);
8649  }
8650
8651  protected void composeNamingSystemNamingSystemUniqueIdComponent(Complex parent, String parentType, String name, NamingSystem.NamingSystemUniqueIdComponent element, int index) {
8652    if (element == null) 
8653      return;
8654    Complex t;
8655    if (Utilities.noString(parentType))
8656      t = parent;
8657    else {
8658      t = parent.predicate("fhir:"+parentType+'.'+name);
8659    }
8660    composeBackboneElement(t, "uniqueId", name, element, index);
8661    if (element.hasTypeElement())
8662      composeEnum(t, "NamingSystem", "type", element.getTypeElement(), -1);
8663    if (element.hasValueElement())
8664      composeString(t, "NamingSystem", "value", element.getValueElement(), -1);
8665    if (element.hasPreferredElement())
8666      composeBoolean(t, "NamingSystem", "preferred", element.getPreferredElement(), -1);
8667    if (element.hasCommentElement())
8668      composeString(t, "NamingSystem", "comment", element.getCommentElement(), -1);
8669    if (element.hasPeriod())
8670      composePeriod(t, "NamingSystem", "period", element.getPeriod(), -1);
8671  }
8672
8673  protected void composeNutritionOrder(Complex parent, String parentType, String name, NutritionOrder element, int index) {
8674    if (element == null) 
8675      return;
8676    Complex t;
8677    if (Utilities.noString(parentType))
8678      t = parent;
8679    else {
8680      t = parent.predicate("fhir:"+parentType+'.'+name);
8681    }
8682    composeDomainResource(t, "NutritionOrder", name, element, index);
8683    for (int i = 0; i < element.getIdentifier().size(); i++)
8684      composeIdentifier(t, "NutritionOrder", "identifier", element.getIdentifier().get(i), i);
8685    if (element.hasStatusElement())
8686      composeEnum(t, "NutritionOrder", "status", element.getStatusElement(), -1);
8687    if (element.hasPatient())
8688      composeReference(t, "NutritionOrder", "patient", element.getPatient(), -1);
8689    if (element.hasEncounter())
8690      composeReference(t, "NutritionOrder", "encounter", element.getEncounter(), -1);
8691    if (element.hasDateTimeElement())
8692      composeDateTime(t, "NutritionOrder", "dateTime", element.getDateTimeElement(), -1);
8693    if (element.hasOrderer())
8694      composeReference(t, "NutritionOrder", "orderer", element.getOrderer(), -1);
8695    for (int i = 0; i < element.getAllergyIntolerance().size(); i++)
8696      composeReference(t, "NutritionOrder", "allergyIntolerance", element.getAllergyIntolerance().get(i), i);
8697    for (int i = 0; i < element.getFoodPreferenceModifier().size(); i++)
8698      composeCodeableConcept(t, "NutritionOrder", "foodPreferenceModifier", element.getFoodPreferenceModifier().get(i), i);
8699    for (int i = 0; i < element.getExcludeFoodModifier().size(); i++)
8700      composeCodeableConcept(t, "NutritionOrder", "excludeFoodModifier", element.getExcludeFoodModifier().get(i), i);
8701    if (element.hasOralDiet())
8702      composeNutritionOrderNutritionOrderOralDietComponent(t, "NutritionOrder", "oralDiet", element.getOralDiet(), -1);
8703    for (int i = 0; i < element.getSupplement().size(); i++)
8704      composeNutritionOrderNutritionOrderSupplementComponent(t, "NutritionOrder", "supplement", element.getSupplement().get(i), i);
8705    if (element.hasEnteralFormula())
8706      composeNutritionOrderNutritionOrderEnteralFormulaComponent(t, "NutritionOrder", "enteralFormula", element.getEnteralFormula(), -1);
8707  }
8708
8709  protected void composeNutritionOrderNutritionOrderOralDietComponent(Complex parent, String parentType, String name, NutritionOrder.NutritionOrderOralDietComponent element, int index) {
8710    if (element == null) 
8711      return;
8712    Complex t;
8713    if (Utilities.noString(parentType))
8714      t = parent;
8715    else {
8716      t = parent.predicate("fhir:"+parentType+'.'+name);
8717    }
8718    composeBackboneElement(t, "oralDiet", name, element, index);
8719    for (int i = 0; i < element.getType().size(); i++)
8720      composeCodeableConcept(t, "NutritionOrder", "type", element.getType().get(i), i);
8721    for (int i = 0; i < element.getSchedule().size(); i++)
8722      composeTiming(t, "NutritionOrder", "schedule", element.getSchedule().get(i), i);
8723    for (int i = 0; i < element.getNutrient().size(); i++)
8724      composeNutritionOrderNutritionOrderOralDietNutrientComponent(t, "NutritionOrder", "nutrient", element.getNutrient().get(i), i);
8725    for (int i = 0; i < element.getTexture().size(); i++)
8726      composeNutritionOrderNutritionOrderOralDietTextureComponent(t, "NutritionOrder", "texture", element.getTexture().get(i), i);
8727    for (int i = 0; i < element.getFluidConsistencyType().size(); i++)
8728      composeCodeableConcept(t, "NutritionOrder", "fluidConsistencyType", element.getFluidConsistencyType().get(i), i);
8729    if (element.hasInstructionElement())
8730      composeString(t, "NutritionOrder", "instruction", element.getInstructionElement(), -1);
8731  }
8732
8733  protected void composeNutritionOrderNutritionOrderOralDietNutrientComponent(Complex parent, String parentType, String name, NutritionOrder.NutritionOrderOralDietNutrientComponent element, int index) {
8734    if (element == null) 
8735      return;
8736    Complex t;
8737    if (Utilities.noString(parentType))
8738      t = parent;
8739    else {
8740      t = parent.predicate("fhir:"+parentType+'.'+name);
8741    }
8742    composeBackboneElement(t, "nutrient", name, element, index);
8743    if (element.hasModifier())
8744      composeCodeableConcept(t, "NutritionOrder", "modifier", element.getModifier(), -1);
8745    if (element.hasAmount())
8746      composeQuantity(t, "NutritionOrder", "amount", element.getAmount(), -1);
8747  }
8748
8749  protected void composeNutritionOrderNutritionOrderOralDietTextureComponent(Complex parent, String parentType, String name, NutritionOrder.NutritionOrderOralDietTextureComponent element, int index) {
8750    if (element == null) 
8751      return;
8752    Complex t;
8753    if (Utilities.noString(parentType))
8754      t = parent;
8755    else {
8756      t = parent.predicate("fhir:"+parentType+'.'+name);
8757    }
8758    composeBackboneElement(t, "texture", name, element, index);
8759    if (element.hasModifier())
8760      composeCodeableConcept(t, "NutritionOrder", "modifier", element.getModifier(), -1);
8761    if (element.hasFoodType())
8762      composeCodeableConcept(t, "NutritionOrder", "foodType", element.getFoodType(), -1);
8763  }
8764
8765  protected void composeNutritionOrderNutritionOrderSupplementComponent(Complex parent, String parentType, String name, NutritionOrder.NutritionOrderSupplementComponent element, int index) {
8766    if (element == null) 
8767      return;
8768    Complex t;
8769    if (Utilities.noString(parentType))
8770      t = parent;
8771    else {
8772      t = parent.predicate("fhir:"+parentType+'.'+name);
8773    }
8774    composeBackboneElement(t, "supplement", name, element, index);
8775    if (element.hasType())
8776      composeCodeableConcept(t, "NutritionOrder", "type", element.getType(), -1);
8777    if (element.hasProductNameElement())
8778      composeString(t, "NutritionOrder", "productName", element.getProductNameElement(), -1);
8779    for (int i = 0; i < element.getSchedule().size(); i++)
8780      composeTiming(t, "NutritionOrder", "schedule", element.getSchedule().get(i), i);
8781    if (element.hasQuantity())
8782      composeQuantity(t, "NutritionOrder", "quantity", element.getQuantity(), -1);
8783    if (element.hasInstructionElement())
8784      composeString(t, "NutritionOrder", "instruction", element.getInstructionElement(), -1);
8785  }
8786
8787  protected void composeNutritionOrderNutritionOrderEnteralFormulaComponent(Complex parent, String parentType, String name, NutritionOrder.NutritionOrderEnteralFormulaComponent element, int index) {
8788    if (element == null) 
8789      return;
8790    Complex t;
8791    if (Utilities.noString(parentType))
8792      t = parent;
8793    else {
8794      t = parent.predicate("fhir:"+parentType+'.'+name);
8795    }
8796    composeBackboneElement(t, "enteralFormula", name, element, index);
8797    if (element.hasBaseFormulaType())
8798      composeCodeableConcept(t, "NutritionOrder", "baseFormulaType", element.getBaseFormulaType(), -1);
8799    if (element.hasBaseFormulaProductNameElement())
8800      composeString(t, "NutritionOrder", "baseFormulaProductName", element.getBaseFormulaProductNameElement(), -1);
8801    if (element.hasAdditiveType())
8802      composeCodeableConcept(t, "NutritionOrder", "additiveType", element.getAdditiveType(), -1);
8803    if (element.hasAdditiveProductNameElement())
8804      composeString(t, "NutritionOrder", "additiveProductName", element.getAdditiveProductNameElement(), -1);
8805    if (element.hasCaloricDensity())
8806      composeQuantity(t, "NutritionOrder", "caloricDensity", element.getCaloricDensity(), -1);
8807    if (element.hasRouteofAdministration())
8808      composeCodeableConcept(t, "NutritionOrder", "routeofAdministration", element.getRouteofAdministration(), -1);
8809    for (int i = 0; i < element.getAdministration().size(); i++)
8810      composeNutritionOrderNutritionOrderEnteralFormulaAdministrationComponent(t, "NutritionOrder", "administration", element.getAdministration().get(i), i);
8811    if (element.hasMaxVolumeToDeliver())
8812      composeQuantity(t, "NutritionOrder", "maxVolumeToDeliver", element.getMaxVolumeToDeliver(), -1);
8813    if (element.hasAdministrationInstructionElement())
8814      composeString(t, "NutritionOrder", "administrationInstruction", element.getAdministrationInstructionElement(), -1);
8815  }
8816
8817  protected void composeNutritionOrderNutritionOrderEnteralFormulaAdministrationComponent(Complex parent, String parentType, String name, NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent element, int index) {
8818    if (element == null) 
8819      return;
8820    Complex t;
8821    if (Utilities.noString(parentType))
8822      t = parent;
8823    else {
8824      t = parent.predicate("fhir:"+parentType+'.'+name);
8825    }
8826    composeBackboneElement(t, "administration", name, element, index);
8827    if (element.hasSchedule())
8828      composeTiming(t, "NutritionOrder", "schedule", element.getSchedule(), -1);
8829    if (element.hasQuantity())
8830      composeQuantity(t, "NutritionOrder", "quantity", element.getQuantity(), -1);
8831    if (element.hasRate())
8832      composeType(t, "NutritionOrder", "rate", element.getRate(), -1);
8833  }
8834
8835  protected void composeObservation(Complex parent, String parentType, String name, Observation element, int index) {
8836    if (element == null) 
8837      return;
8838    Complex t;
8839    if (Utilities.noString(parentType))
8840      t = parent;
8841    else {
8842      t = parent.predicate("fhir:"+parentType+'.'+name);
8843    }
8844    composeDomainResource(t, "Observation", name, element, index);
8845    for (int i = 0; i < element.getIdentifier().size(); i++)
8846      composeIdentifier(t, "Observation", "identifier", element.getIdentifier().get(i), i);
8847    for (int i = 0; i < element.getBasedOn().size(); i++)
8848      composeReference(t, "Observation", "basedOn", element.getBasedOn().get(i), i);
8849    if (element.hasStatusElement())
8850      composeEnum(t, "Observation", "status", element.getStatusElement(), -1);
8851    for (int i = 0; i < element.getCategory().size(); i++)
8852      composeCodeableConcept(t, "Observation", "category", element.getCategory().get(i), i);
8853    if (element.hasCode())
8854      composeCodeableConcept(t, "Observation", "code", element.getCode(), -1);
8855    if (element.hasSubject())
8856      composeReference(t, "Observation", "subject", element.getSubject(), -1);
8857    if (element.hasContext())
8858      composeReference(t, "Observation", "context", element.getContext(), -1);
8859    if (element.hasEffective())
8860      composeType(t, "Observation", "effective", element.getEffective(), -1);
8861    if (element.hasIssuedElement())
8862      composeInstant(t, "Observation", "issued", element.getIssuedElement(), -1);
8863    for (int i = 0; i < element.getPerformer().size(); i++)
8864      composeReference(t, "Observation", "performer", element.getPerformer().get(i), i);
8865    if (element.hasValue())
8866      composeType(t, "Observation", "value", element.getValue(), -1);
8867    if (element.hasDataAbsentReason())
8868      composeCodeableConcept(t, "Observation", "dataAbsentReason", element.getDataAbsentReason(), -1);
8869    if (element.hasInterpretation())
8870      composeCodeableConcept(t, "Observation", "interpretation", element.getInterpretation(), -1);
8871    if (element.hasCommentElement())
8872      composeString(t, "Observation", "comment", element.getCommentElement(), -1);
8873    if (element.hasBodySite())
8874      composeCodeableConcept(t, "Observation", "bodySite", element.getBodySite(), -1);
8875    if (element.hasMethod())
8876      composeCodeableConcept(t, "Observation", "method", element.getMethod(), -1);
8877    if (element.hasSpecimen())
8878      composeReference(t, "Observation", "specimen", element.getSpecimen(), -1);
8879    if (element.hasDevice())
8880      composeReference(t, "Observation", "device", element.getDevice(), -1);
8881    for (int i = 0; i < element.getReferenceRange().size(); i++)
8882      composeObservationObservationReferenceRangeComponent(t, "Observation", "referenceRange", element.getReferenceRange().get(i), i);
8883    for (int i = 0; i < element.getRelated().size(); i++)
8884      composeObservationObservationRelatedComponent(t, "Observation", "related", element.getRelated().get(i), i);
8885    for (int i = 0; i < element.getComponent().size(); i++)
8886      composeObservationObservationComponentComponent(t, "Observation", "component", element.getComponent().get(i), i);
8887  }
8888
8889  protected void composeObservationObservationReferenceRangeComponent(Complex parent, String parentType, String name, Observation.ObservationReferenceRangeComponent element, int index) {
8890    if (element == null) 
8891      return;
8892    Complex t;
8893    if (Utilities.noString(parentType))
8894      t = parent;
8895    else {
8896      t = parent.predicate("fhir:"+parentType+'.'+name);
8897    }
8898    composeBackboneElement(t, "referenceRange", name, element, index);
8899    if (element.hasLow())
8900      composeQuantity(t, "Observation", "low", element.getLow(), -1);
8901    if (element.hasHigh())
8902      composeQuantity(t, "Observation", "high", element.getHigh(), -1);
8903    if (element.hasType())
8904      composeCodeableConcept(t, "Observation", "type", element.getType(), -1);
8905    for (int i = 0; i < element.getAppliesTo().size(); i++)
8906      composeCodeableConcept(t, "Observation", "appliesTo", element.getAppliesTo().get(i), i);
8907    if (element.hasAge())
8908      composeRange(t, "Observation", "age", element.getAge(), -1);
8909    if (element.hasTextElement())
8910      composeString(t, "Observation", "text", element.getTextElement(), -1);
8911  }
8912
8913  protected void composeObservationObservationRelatedComponent(Complex parent, String parentType, String name, Observation.ObservationRelatedComponent element, int index) {
8914    if (element == null) 
8915      return;
8916    Complex t;
8917    if (Utilities.noString(parentType))
8918      t = parent;
8919    else {
8920      t = parent.predicate("fhir:"+parentType+'.'+name);
8921    }
8922    composeBackboneElement(t, "related", name, element, index);
8923    if (element.hasTypeElement())
8924      composeEnum(t, "Observation", "type", element.getTypeElement(), -1);
8925    if (element.hasTarget())
8926      composeReference(t, "Observation", "target", element.getTarget(), -1);
8927  }
8928
8929  protected void composeObservationObservationComponentComponent(Complex parent, String parentType, String name, Observation.ObservationComponentComponent element, int index) {
8930    if (element == null) 
8931      return;
8932    Complex t;
8933    if (Utilities.noString(parentType))
8934      t = parent;
8935    else {
8936      t = parent.predicate("fhir:"+parentType+'.'+name);
8937    }
8938    composeBackboneElement(t, "component", name, element, index);
8939    if (element.hasCode())
8940      composeCodeableConcept(t, "Observation", "code", element.getCode(), -1);
8941    if (element.hasValue())
8942      composeType(t, "Observation", "value", element.getValue(), -1);
8943    if (element.hasDataAbsentReason())
8944      composeCodeableConcept(t, "Observation", "dataAbsentReason", element.getDataAbsentReason(), -1);
8945    if (element.hasInterpretation())
8946      composeCodeableConcept(t, "Observation", "interpretation", element.getInterpretation(), -1);
8947    for (int i = 0; i < element.getReferenceRange().size(); i++)
8948      composeObservationObservationReferenceRangeComponent(t, "Observation", "referenceRange", element.getReferenceRange().get(i), i);
8949  }
8950
8951  protected void composeOperationDefinition(Complex parent, String parentType, String name, OperationDefinition element, int index) {
8952    if (element == null) 
8953      return;
8954    Complex t;
8955    if (Utilities.noString(parentType))
8956      t = parent;
8957    else {
8958      t = parent.predicate("fhir:"+parentType+'.'+name);
8959    }
8960    composeDomainResource(t, "OperationDefinition", name, element, index);
8961    if (element.hasUrlElement())
8962      composeUri(t, "OperationDefinition", "url", element.getUrlElement(), -1);
8963    if (element.hasVersionElement())
8964      composeString(t, "OperationDefinition", "version", element.getVersionElement(), -1);
8965    if (element.hasNameElement())
8966      composeString(t, "OperationDefinition", "name", element.getNameElement(), -1);
8967    if (element.hasStatusElement())
8968      composeEnum(t, "OperationDefinition", "status", element.getStatusElement(), -1);
8969    if (element.hasKindElement())
8970      composeEnum(t, "OperationDefinition", "kind", element.getKindElement(), -1);
8971    if (element.hasExperimentalElement())
8972      composeBoolean(t, "OperationDefinition", "experimental", element.getExperimentalElement(), -1);
8973    if (element.hasDateElement())
8974      composeDateTime(t, "OperationDefinition", "date", element.getDateElement(), -1);
8975    if (element.hasPublisherElement())
8976      composeString(t, "OperationDefinition", "publisher", element.getPublisherElement(), -1);
8977    for (int i = 0; i < element.getContact().size(); i++)
8978      composeContactDetail(t, "OperationDefinition", "contact", element.getContact().get(i), i);
8979    if (element.hasDescriptionElement())
8980      composeMarkdown(t, "OperationDefinition", "description", element.getDescriptionElement(), -1);
8981    for (int i = 0; i < element.getUseContext().size(); i++)
8982      composeUsageContext(t, "OperationDefinition", "useContext", element.getUseContext().get(i), i);
8983    for (int i = 0; i < element.getJurisdiction().size(); i++)
8984      composeCodeableConcept(t, "OperationDefinition", "jurisdiction", element.getJurisdiction().get(i), i);
8985    if (element.hasPurposeElement())
8986      composeMarkdown(t, "OperationDefinition", "purpose", element.getPurposeElement(), -1);
8987    if (element.hasIdempotentElement())
8988      composeBoolean(t, "OperationDefinition", "idempotent", element.getIdempotentElement(), -1);
8989    if (element.hasCodeElement())
8990      composeCode(t, "OperationDefinition", "code", element.getCodeElement(), -1);
8991    if (element.hasCommentElement())
8992      composeString(t, "OperationDefinition", "comment", element.getCommentElement(), -1);
8993    if (element.hasBase())
8994      composeReference(t, "OperationDefinition", "base", element.getBase(), -1);
8995    for (int i = 0; i < element.getResource().size(); i++)
8996      composeCode(t, "OperationDefinition", "resource", element.getResource().get(i), i);
8997    if (element.hasSystemElement())
8998      composeBoolean(t, "OperationDefinition", "system", element.getSystemElement(), -1);
8999    if (element.hasTypeElement())
9000      composeBoolean(t, "OperationDefinition", "type", element.getTypeElement(), -1);
9001    if (element.hasInstanceElement())
9002      composeBoolean(t, "OperationDefinition", "instance", element.getInstanceElement(), -1);
9003    for (int i = 0; i < element.getParameter().size(); i++)
9004      composeOperationDefinitionOperationDefinitionParameterComponent(t, "OperationDefinition", "parameter", element.getParameter().get(i), i);
9005    for (int i = 0; i < element.getOverload().size(); i++)
9006      composeOperationDefinitionOperationDefinitionOverloadComponent(t, "OperationDefinition", "overload", element.getOverload().get(i), i);
9007  }
9008
9009  protected void composeOperationDefinitionOperationDefinitionParameterComponent(Complex parent, String parentType, String name, OperationDefinition.OperationDefinitionParameterComponent element, int index) {
9010    if (element == null) 
9011      return;
9012    Complex t;
9013    if (Utilities.noString(parentType))
9014      t = parent;
9015    else {
9016      t = parent.predicate("fhir:"+parentType+'.'+name);
9017    }
9018    composeBackboneElement(t, "parameter", name, element, index);
9019    if (element.hasNameElement())
9020      composeCode(t, "OperationDefinition", "name", element.getNameElement(), -1);
9021    if (element.hasUseElement())
9022      composeEnum(t, "OperationDefinition", "use", element.getUseElement(), -1);
9023    if (element.hasMinElement())
9024      composeInteger(t, "OperationDefinition", "min", element.getMinElement(), -1);
9025    if (element.hasMaxElement())
9026      composeString(t, "OperationDefinition", "max", element.getMaxElement(), -1);
9027    if (element.hasDocumentationElement())
9028      composeString(t, "OperationDefinition", "documentation", element.getDocumentationElement(), -1);
9029    if (element.hasTypeElement())
9030      composeCode(t, "OperationDefinition", "type", element.getTypeElement(), -1);
9031    if (element.hasSearchTypeElement())
9032      composeEnum(t, "OperationDefinition", "searchType", element.getSearchTypeElement(), -1);
9033    if (element.hasProfile())
9034      composeReference(t, "OperationDefinition", "profile", element.getProfile(), -1);
9035    if (element.hasBinding())
9036      composeOperationDefinitionOperationDefinitionParameterBindingComponent(t, "OperationDefinition", "binding", element.getBinding(), -1);
9037    for (int i = 0; i < element.getPart().size(); i++)
9038      composeOperationDefinitionOperationDefinitionParameterComponent(t, "OperationDefinition", "part", element.getPart().get(i), i);
9039  }
9040
9041  protected void composeOperationDefinitionOperationDefinitionParameterBindingComponent(Complex parent, String parentType, String name, OperationDefinition.OperationDefinitionParameterBindingComponent element, int index) {
9042    if (element == null) 
9043      return;
9044    Complex t;
9045    if (Utilities.noString(parentType))
9046      t = parent;
9047    else {
9048      t = parent.predicate("fhir:"+parentType+'.'+name);
9049    }
9050    composeBackboneElement(t, "binding", name, element, index);
9051    if (element.hasStrengthElement())
9052      composeEnum(t, "OperationDefinition", "strength", element.getStrengthElement(), -1);
9053    if (element.hasValueSet())
9054      composeType(t, "OperationDefinition", "valueSet", element.getValueSet(), -1);
9055  }
9056
9057  protected void composeOperationDefinitionOperationDefinitionOverloadComponent(Complex parent, String parentType, String name, OperationDefinition.OperationDefinitionOverloadComponent element, int index) {
9058    if (element == null) 
9059      return;
9060    Complex t;
9061    if (Utilities.noString(parentType))
9062      t = parent;
9063    else {
9064      t = parent.predicate("fhir:"+parentType+'.'+name);
9065    }
9066    composeBackboneElement(t, "overload", name, element, index);
9067    for (int i = 0; i < element.getParameterName().size(); i++)
9068      composeString(t, "OperationDefinition", "parameterName", element.getParameterName().get(i), i);
9069    if (element.hasCommentElement())
9070      composeString(t, "OperationDefinition", "comment", element.getCommentElement(), -1);
9071  }
9072
9073  protected void composeOperationOutcome(Complex parent, String parentType, String name, OperationOutcome element, int index) {
9074    if (element == null) 
9075      return;
9076    Complex t;
9077    if (Utilities.noString(parentType))
9078      t = parent;
9079    else {
9080      t = parent.predicate("fhir:"+parentType+'.'+name);
9081    }
9082    composeDomainResource(t, "OperationOutcome", name, element, index);
9083    for (int i = 0; i < element.getIssue().size(); i++)
9084      composeOperationOutcomeOperationOutcomeIssueComponent(t, "OperationOutcome", "issue", element.getIssue().get(i), i);
9085  }
9086
9087  protected void composeOperationOutcomeOperationOutcomeIssueComponent(Complex parent, String parentType, String name, OperationOutcome.OperationOutcomeIssueComponent element, int index) {
9088    if (element == null) 
9089      return;
9090    Complex t;
9091    if (Utilities.noString(parentType))
9092      t = parent;
9093    else {
9094      t = parent.predicate("fhir:"+parentType+'.'+name);
9095    }
9096    composeBackboneElement(t, "issue", name, element, index);
9097    if (element.hasSeverityElement())
9098      composeEnum(t, "OperationOutcome", "severity", element.getSeverityElement(), -1);
9099    if (element.hasCodeElement())
9100      composeEnum(t, "OperationOutcome", "code", element.getCodeElement(), -1);
9101    if (element.hasDetails())
9102      composeCodeableConcept(t, "OperationOutcome", "details", element.getDetails(), -1);
9103    if (element.hasDiagnosticsElement())
9104      composeString(t, "OperationOutcome", "diagnostics", element.getDiagnosticsElement(), -1);
9105    for (int i = 0; i < element.getLocation().size(); i++)
9106      composeString(t, "OperationOutcome", "location", element.getLocation().get(i), i);
9107    for (int i = 0; i < element.getExpression().size(); i++)
9108      composeString(t, "OperationOutcome", "expression", element.getExpression().get(i), i);
9109  }
9110
9111  protected void composeOrganization(Complex parent, String parentType, String name, Organization element, int index) {
9112    if (element == null) 
9113      return;
9114    Complex t;
9115    if (Utilities.noString(parentType))
9116      t = parent;
9117    else {
9118      t = parent.predicate("fhir:"+parentType+'.'+name);
9119    }
9120    composeDomainResource(t, "Organization", name, element, index);
9121    for (int i = 0; i < element.getIdentifier().size(); i++)
9122      composeIdentifier(t, "Organization", "identifier", element.getIdentifier().get(i), i);
9123    if (element.hasActiveElement())
9124      composeBoolean(t, "Organization", "active", element.getActiveElement(), -1);
9125    for (int i = 0; i < element.getType().size(); i++)
9126      composeCodeableConcept(t, "Organization", "type", element.getType().get(i), i);
9127    if (element.hasNameElement())
9128      composeString(t, "Organization", "name", element.getNameElement(), -1);
9129    for (int i = 0; i < element.getAlias().size(); i++)
9130      composeString(t, "Organization", "alias", element.getAlias().get(i), i);
9131    for (int i = 0; i < element.getTelecom().size(); i++)
9132      composeContactPoint(t, "Organization", "telecom", element.getTelecom().get(i), i);
9133    for (int i = 0; i < element.getAddress().size(); i++)
9134      composeAddress(t, "Organization", "address", element.getAddress().get(i), i);
9135    if (element.hasPartOf())
9136      composeReference(t, "Organization", "partOf", element.getPartOf(), -1);
9137    for (int i = 0; i < element.getContact().size(); i++)
9138      composeOrganizationOrganizationContactComponent(t, "Organization", "contact", element.getContact().get(i), i);
9139    for (int i = 0; i < element.getEndpoint().size(); i++)
9140      composeReference(t, "Organization", "endpoint", element.getEndpoint().get(i), i);
9141  }
9142
9143  protected void composeOrganizationOrganizationContactComponent(Complex parent, String parentType, String name, Organization.OrganizationContactComponent element, int index) {
9144    if (element == null) 
9145      return;
9146    Complex t;
9147    if (Utilities.noString(parentType))
9148      t = parent;
9149    else {
9150      t = parent.predicate("fhir:"+parentType+'.'+name);
9151    }
9152    composeBackboneElement(t, "contact", name, element, index);
9153    if (element.hasPurpose())
9154      composeCodeableConcept(t, "Organization", "purpose", element.getPurpose(), -1);
9155    if (element.hasName())
9156      composeHumanName(t, "Organization", "name", element.getName(), -1);
9157    for (int i = 0; i < element.getTelecom().size(); i++)
9158      composeContactPoint(t, "Organization", "telecom", element.getTelecom().get(i), i);
9159    if (element.hasAddress())
9160      composeAddress(t, "Organization", "address", element.getAddress(), -1);
9161  }
9162
9163  protected void composePatient(Complex parent, String parentType, String name, Patient element, int index) {
9164    if (element == null) 
9165      return;
9166    Complex t;
9167    if (Utilities.noString(parentType))
9168      t = parent;
9169    else {
9170      t = parent.predicate("fhir:"+parentType+'.'+name);
9171    }
9172    composeDomainResource(t, "Patient", name, element, index);
9173    for (int i = 0; i < element.getIdentifier().size(); i++)
9174      composeIdentifier(t, "Patient", "identifier", element.getIdentifier().get(i), i);
9175    if (element.hasActiveElement())
9176      composeBoolean(t, "Patient", "active", element.getActiveElement(), -1);
9177    for (int i = 0; i < element.getName().size(); i++)
9178      composeHumanName(t, "Patient", "name", element.getName().get(i), i);
9179    for (int i = 0; i < element.getTelecom().size(); i++)
9180      composeContactPoint(t, "Patient", "telecom", element.getTelecom().get(i), i);
9181    if (element.hasGenderElement())
9182      composeEnum(t, "Patient", "gender", element.getGenderElement(), -1);
9183    if (element.hasBirthDateElement())
9184      composeDate(t, "Patient", "birthDate", element.getBirthDateElement(), -1);
9185    if (element.hasDeceased())
9186      composeType(t, "Patient", "deceased", element.getDeceased(), -1);
9187    for (int i = 0; i < element.getAddress().size(); i++)
9188      composeAddress(t, "Patient", "address", element.getAddress().get(i), i);
9189    if (element.hasMaritalStatus())
9190      composeCodeableConcept(t, "Patient", "maritalStatus", element.getMaritalStatus(), -1);
9191    if (element.hasMultipleBirth())
9192      composeType(t, "Patient", "multipleBirth", element.getMultipleBirth(), -1);
9193    for (int i = 0; i < element.getPhoto().size(); i++)
9194      composeAttachment(t, "Patient", "photo", element.getPhoto().get(i), i);
9195    for (int i = 0; i < element.getContact().size(); i++)
9196      composePatientContactComponent(t, "Patient", "contact", element.getContact().get(i), i);
9197    if (element.hasAnimal())
9198      composePatientAnimalComponent(t, "Patient", "animal", element.getAnimal(), -1);
9199    for (int i = 0; i < element.getCommunication().size(); i++)
9200      composePatientPatientCommunicationComponent(t, "Patient", "communication", element.getCommunication().get(i), i);
9201    for (int i = 0; i < element.getGeneralPractitioner().size(); i++)
9202      composeReference(t, "Patient", "generalPractitioner", element.getGeneralPractitioner().get(i), i);
9203    if (element.hasManagingOrganization())
9204      composeReference(t, "Patient", "managingOrganization", element.getManagingOrganization(), -1);
9205    for (int i = 0; i < element.getLink().size(); i++)
9206      composePatientPatientLinkComponent(t, "Patient", "link", element.getLink().get(i), i);
9207  }
9208
9209  protected void composePatientContactComponent(Complex parent, String parentType, String name, Patient.ContactComponent element, int index) {
9210    if (element == null) 
9211      return;
9212    Complex t;
9213    if (Utilities.noString(parentType))
9214      t = parent;
9215    else {
9216      t = parent.predicate("fhir:"+parentType+'.'+name);
9217    }
9218    composeBackboneElement(t, "contact", name, element, index);
9219    for (int i = 0; i < element.getRelationship().size(); i++)
9220      composeCodeableConcept(t, "Patient", "relationship", element.getRelationship().get(i), i);
9221    if (element.hasName())
9222      composeHumanName(t, "Patient", "name", element.getName(), -1);
9223    for (int i = 0; i < element.getTelecom().size(); i++)
9224      composeContactPoint(t, "Patient", "telecom", element.getTelecom().get(i), i);
9225    if (element.hasAddress())
9226      composeAddress(t, "Patient", "address", element.getAddress(), -1);
9227    if (element.hasGenderElement())
9228      composeEnum(t, "Patient", "gender", element.getGenderElement(), -1);
9229    if (element.hasOrganization())
9230      composeReference(t, "Patient", "organization", element.getOrganization(), -1);
9231    if (element.hasPeriod())
9232      composePeriod(t, "Patient", "period", element.getPeriod(), -1);
9233  }
9234
9235  protected void composePatientAnimalComponent(Complex parent, String parentType, String name, Patient.AnimalComponent element, int index) {
9236    if (element == null) 
9237      return;
9238    Complex t;
9239    if (Utilities.noString(parentType))
9240      t = parent;
9241    else {
9242      t = parent.predicate("fhir:"+parentType+'.'+name);
9243    }
9244    composeBackboneElement(t, "animal", name, element, index);
9245    if (element.hasSpecies())
9246      composeCodeableConcept(t, "Patient", "species", element.getSpecies(), -1);
9247    if (element.hasBreed())
9248      composeCodeableConcept(t, "Patient", "breed", element.getBreed(), -1);
9249    if (element.hasGenderStatus())
9250      composeCodeableConcept(t, "Patient", "genderStatus", element.getGenderStatus(), -1);
9251  }
9252
9253  protected void composePatientPatientCommunicationComponent(Complex parent, String parentType, String name, Patient.PatientCommunicationComponent element, int index) {
9254    if (element == null) 
9255      return;
9256    Complex t;
9257    if (Utilities.noString(parentType))
9258      t = parent;
9259    else {
9260      t = parent.predicate("fhir:"+parentType+'.'+name);
9261    }
9262    composeBackboneElement(t, "communication", name, element, index);
9263    if (element.hasLanguage())
9264      composeCodeableConcept(t, "Patient", "language", element.getLanguage(), -1);
9265    if (element.hasPreferredElement())
9266      composeBoolean(t, "Patient", "preferred", element.getPreferredElement(), -1);
9267  }
9268
9269  protected void composePatientPatientLinkComponent(Complex parent, String parentType, String name, Patient.PatientLinkComponent element, int index) {
9270    if (element == null) 
9271      return;
9272    Complex t;
9273    if (Utilities.noString(parentType))
9274      t = parent;
9275    else {
9276      t = parent.predicate("fhir:"+parentType+'.'+name);
9277    }
9278    composeBackboneElement(t, "link", name, element, index);
9279    if (element.hasOther())
9280      composeReference(t, "Patient", "other", element.getOther(), -1);
9281    if (element.hasTypeElement())
9282      composeEnum(t, "Patient", "type", element.getTypeElement(), -1);
9283  }
9284
9285  protected void composePaymentNotice(Complex parent, String parentType, String name, PaymentNotice element, int index) {
9286    if (element == null) 
9287      return;
9288    Complex t;
9289    if (Utilities.noString(parentType))
9290      t = parent;
9291    else {
9292      t = parent.predicate("fhir:"+parentType+'.'+name);
9293    }
9294    composeDomainResource(t, "PaymentNotice", name, element, index);
9295    for (int i = 0; i < element.getIdentifier().size(); i++)
9296      composeIdentifier(t, "PaymentNotice", "identifier", element.getIdentifier().get(i), i);
9297    if (element.hasStatusElement())
9298      composeEnum(t, "PaymentNotice", "status", element.getStatusElement(), -1);
9299    if (element.hasRequest())
9300      composeReference(t, "PaymentNotice", "request", element.getRequest(), -1);
9301    if (element.hasResponse())
9302      composeReference(t, "PaymentNotice", "response", element.getResponse(), -1);
9303    if (element.hasStatusDateElement())
9304      composeDate(t, "PaymentNotice", "statusDate", element.getStatusDateElement(), -1);
9305    if (element.hasCreatedElement())
9306      composeDateTime(t, "PaymentNotice", "created", element.getCreatedElement(), -1);
9307    if (element.hasTarget())
9308      composeReference(t, "PaymentNotice", "target", element.getTarget(), -1);
9309    if (element.hasProvider())
9310      composeReference(t, "PaymentNotice", "provider", element.getProvider(), -1);
9311    if (element.hasOrganization())
9312      composeReference(t, "PaymentNotice", "organization", element.getOrganization(), -1);
9313    if (element.hasPaymentStatus())
9314      composeCodeableConcept(t, "PaymentNotice", "paymentStatus", element.getPaymentStatus(), -1);
9315  }
9316
9317  protected void composePaymentReconciliation(Complex parent, String parentType, String name, PaymentReconciliation element, int index) {
9318    if (element == null) 
9319      return;
9320    Complex t;
9321    if (Utilities.noString(parentType))
9322      t = parent;
9323    else {
9324      t = parent.predicate("fhir:"+parentType+'.'+name);
9325    }
9326    composeDomainResource(t, "PaymentReconciliation", name, element, index);
9327    for (int i = 0; i < element.getIdentifier().size(); i++)
9328      composeIdentifier(t, "PaymentReconciliation", "identifier", element.getIdentifier().get(i), i);
9329    if (element.hasStatusElement())
9330      composeEnum(t, "PaymentReconciliation", "status", element.getStatusElement(), -1);
9331    if (element.hasPeriod())
9332      composePeriod(t, "PaymentReconciliation", "period", element.getPeriod(), -1);
9333    if (element.hasCreatedElement())
9334      composeDateTime(t, "PaymentReconciliation", "created", element.getCreatedElement(), -1);
9335    if (element.hasOrganization())
9336      composeReference(t, "PaymentReconciliation", "organization", element.getOrganization(), -1);
9337    if (element.hasRequest())
9338      composeReference(t, "PaymentReconciliation", "request", element.getRequest(), -1);
9339    if (element.hasOutcome())
9340      composeCodeableConcept(t, "PaymentReconciliation", "outcome", element.getOutcome(), -1);
9341    if (element.hasDispositionElement())
9342      composeString(t, "PaymentReconciliation", "disposition", element.getDispositionElement(), -1);
9343    if (element.hasRequestProvider())
9344      composeReference(t, "PaymentReconciliation", "requestProvider", element.getRequestProvider(), -1);
9345    if (element.hasRequestOrganization())
9346      composeReference(t, "PaymentReconciliation", "requestOrganization", element.getRequestOrganization(), -1);
9347    for (int i = 0; i < element.getDetail().size(); i++)
9348      composePaymentReconciliationDetailsComponent(t, "PaymentReconciliation", "detail", element.getDetail().get(i), i);
9349    if (element.hasForm())
9350      composeCodeableConcept(t, "PaymentReconciliation", "form", element.getForm(), -1);
9351    if (element.hasTotal())
9352      composeMoney(t, "PaymentReconciliation", "total", element.getTotal(), -1);
9353    for (int i = 0; i < element.getProcessNote().size(); i++)
9354      composePaymentReconciliationNotesComponent(t, "PaymentReconciliation", "processNote", element.getProcessNote().get(i), i);
9355  }
9356
9357  protected void composePaymentReconciliationDetailsComponent(Complex parent, String parentType, String name, PaymentReconciliation.DetailsComponent element, int index) {
9358    if (element == null) 
9359      return;
9360    Complex t;
9361    if (Utilities.noString(parentType))
9362      t = parent;
9363    else {
9364      t = parent.predicate("fhir:"+parentType+'.'+name);
9365    }
9366    composeBackboneElement(t, "detail", name, element, index);
9367    if (element.hasType())
9368      composeCodeableConcept(t, "PaymentReconciliation", "type", element.getType(), -1);
9369    if (element.hasRequest())
9370      composeReference(t, "PaymentReconciliation", "request", element.getRequest(), -1);
9371    if (element.hasResponse())
9372      composeReference(t, "PaymentReconciliation", "response", element.getResponse(), -1);
9373    if (element.hasSubmitter())
9374      composeReference(t, "PaymentReconciliation", "submitter", element.getSubmitter(), -1);
9375    if (element.hasPayee())
9376      composeReference(t, "PaymentReconciliation", "payee", element.getPayee(), -1);
9377    if (element.hasDateElement())
9378      composeDate(t, "PaymentReconciliation", "date", element.getDateElement(), -1);
9379    if (element.hasAmount())
9380      composeMoney(t, "PaymentReconciliation", "amount", element.getAmount(), -1);
9381  }
9382
9383  protected void composePaymentReconciliationNotesComponent(Complex parent, String parentType, String name, PaymentReconciliation.NotesComponent element, int index) {
9384    if (element == null) 
9385      return;
9386    Complex t;
9387    if (Utilities.noString(parentType))
9388      t = parent;
9389    else {
9390      t = parent.predicate("fhir:"+parentType+'.'+name);
9391    }
9392    composeBackboneElement(t, "processNote", name, element, index);
9393    if (element.hasType())
9394      composeCodeableConcept(t, "PaymentReconciliation", "type", element.getType(), -1);
9395    if (element.hasTextElement())
9396      composeString(t, "PaymentReconciliation", "text", element.getTextElement(), -1);
9397  }
9398
9399  protected void composePerson(Complex parent, String parentType, String name, Person element, int index) {
9400    if (element == null) 
9401      return;
9402    Complex t;
9403    if (Utilities.noString(parentType))
9404      t = parent;
9405    else {
9406      t = parent.predicate("fhir:"+parentType+'.'+name);
9407    }
9408    composeDomainResource(t, "Person", name, element, index);
9409    for (int i = 0; i < element.getIdentifier().size(); i++)
9410      composeIdentifier(t, "Person", "identifier", element.getIdentifier().get(i), i);
9411    for (int i = 0; i < element.getName().size(); i++)
9412      composeHumanName(t, "Person", "name", element.getName().get(i), i);
9413    for (int i = 0; i < element.getTelecom().size(); i++)
9414      composeContactPoint(t, "Person", "telecom", element.getTelecom().get(i), i);
9415    if (element.hasGenderElement())
9416      composeEnum(t, "Person", "gender", element.getGenderElement(), -1);
9417    if (element.hasBirthDateElement())
9418      composeDate(t, "Person", "birthDate", element.getBirthDateElement(), -1);
9419    for (int i = 0; i < element.getAddress().size(); i++)
9420      composeAddress(t, "Person", "address", element.getAddress().get(i), i);
9421    if (element.hasPhoto())
9422      composeAttachment(t, "Person", "photo", element.getPhoto(), -1);
9423    if (element.hasManagingOrganization())
9424      composeReference(t, "Person", "managingOrganization", element.getManagingOrganization(), -1);
9425    if (element.hasActiveElement())
9426      composeBoolean(t, "Person", "active", element.getActiveElement(), -1);
9427    for (int i = 0; i < element.getLink().size(); i++)
9428      composePersonPersonLinkComponent(t, "Person", "link", element.getLink().get(i), i);
9429  }
9430
9431  protected void composePersonPersonLinkComponent(Complex parent, String parentType, String name, Person.PersonLinkComponent element, int index) {
9432    if (element == null) 
9433      return;
9434    Complex t;
9435    if (Utilities.noString(parentType))
9436      t = parent;
9437    else {
9438      t = parent.predicate("fhir:"+parentType+'.'+name);
9439    }
9440    composeBackboneElement(t, "link", name, element, index);
9441    if (element.hasTarget())
9442      composeReference(t, "Person", "target", element.getTarget(), -1);
9443    if (element.hasAssuranceElement())
9444      composeEnum(t, "Person", "assurance", element.getAssuranceElement(), -1);
9445  }
9446
9447  protected void composePlanDefinition(Complex parent, String parentType, String name, PlanDefinition element, int index) {
9448    if (element == null) 
9449      return;
9450    Complex t;
9451    if (Utilities.noString(parentType))
9452      t = parent;
9453    else {
9454      t = parent.predicate("fhir:"+parentType+'.'+name);
9455    }
9456    composeDomainResource(t, "PlanDefinition", name, element, index);
9457    if (element.hasUrlElement())
9458      composeUri(t, "PlanDefinition", "url", element.getUrlElement(), -1);
9459    for (int i = 0; i < element.getIdentifier().size(); i++)
9460      composeIdentifier(t, "PlanDefinition", "identifier", element.getIdentifier().get(i), i);
9461    if (element.hasVersionElement())
9462      composeString(t, "PlanDefinition", "version", element.getVersionElement(), -1);
9463    if (element.hasNameElement())
9464      composeString(t, "PlanDefinition", "name", element.getNameElement(), -1);
9465    if (element.hasTitleElement())
9466      composeString(t, "PlanDefinition", "title", element.getTitleElement(), -1);
9467    if (element.hasType())
9468      composeCodeableConcept(t, "PlanDefinition", "type", element.getType(), -1);
9469    if (element.hasStatusElement())
9470      composeEnum(t, "PlanDefinition", "status", element.getStatusElement(), -1);
9471    if (element.hasExperimentalElement())
9472      composeBoolean(t, "PlanDefinition", "experimental", element.getExperimentalElement(), -1);
9473    if (element.hasDateElement())
9474      composeDateTime(t, "PlanDefinition", "date", element.getDateElement(), -1);
9475    if (element.hasPublisherElement())
9476      composeString(t, "PlanDefinition", "publisher", element.getPublisherElement(), -1);
9477    if (element.hasDescriptionElement())
9478      composeMarkdown(t, "PlanDefinition", "description", element.getDescriptionElement(), -1);
9479    if (element.hasPurposeElement())
9480      composeMarkdown(t, "PlanDefinition", "purpose", element.getPurposeElement(), -1);
9481    if (element.hasUsageElement())
9482      composeString(t, "PlanDefinition", "usage", element.getUsageElement(), -1);
9483    if (element.hasApprovalDateElement())
9484      composeDate(t, "PlanDefinition", "approvalDate", element.getApprovalDateElement(), -1);
9485    if (element.hasLastReviewDateElement())
9486      composeDate(t, "PlanDefinition", "lastReviewDate", element.getLastReviewDateElement(), -1);
9487    if (element.hasEffectivePeriod())
9488      composePeriod(t, "PlanDefinition", "effectivePeriod", element.getEffectivePeriod(), -1);
9489    for (int i = 0; i < element.getUseContext().size(); i++)
9490      composeUsageContext(t, "PlanDefinition", "useContext", element.getUseContext().get(i), i);
9491    for (int i = 0; i < element.getJurisdiction().size(); i++)
9492      composeCodeableConcept(t, "PlanDefinition", "jurisdiction", element.getJurisdiction().get(i), i);
9493    for (int i = 0; i < element.getTopic().size(); i++)
9494      composeCodeableConcept(t, "PlanDefinition", "topic", element.getTopic().get(i), i);
9495    for (int i = 0; i < element.getContributor().size(); i++)
9496      composeContributor(t, "PlanDefinition", "contributor", element.getContributor().get(i), i);
9497    for (int i = 0; i < element.getContact().size(); i++)
9498      composeContactDetail(t, "PlanDefinition", "contact", element.getContact().get(i), i);
9499    if (element.hasCopyrightElement())
9500      composeMarkdown(t, "PlanDefinition", "copyright", element.getCopyrightElement(), -1);
9501    for (int i = 0; i < element.getRelatedArtifact().size(); i++)
9502      composeRelatedArtifact(t, "PlanDefinition", "relatedArtifact", element.getRelatedArtifact().get(i), i);
9503    for (int i = 0; i < element.getLibrary().size(); i++)
9504      composeReference(t, "PlanDefinition", "library", element.getLibrary().get(i), i);
9505    for (int i = 0; i < element.getGoal().size(); i++)
9506      composePlanDefinitionPlanDefinitionGoalComponent(t, "PlanDefinition", "goal", element.getGoal().get(i), i);
9507    for (int i = 0; i < element.getAction().size(); i++)
9508      composePlanDefinitionPlanDefinitionActionComponent(t, "PlanDefinition", "action", element.getAction().get(i), i);
9509  }
9510
9511  protected void composePlanDefinitionPlanDefinitionGoalComponent(Complex parent, String parentType, String name, PlanDefinition.PlanDefinitionGoalComponent element, int index) {
9512    if (element == null) 
9513      return;
9514    Complex t;
9515    if (Utilities.noString(parentType))
9516      t = parent;
9517    else {
9518      t = parent.predicate("fhir:"+parentType+'.'+name);
9519    }
9520    composeBackboneElement(t, "goal", name, element, index);
9521    if (element.hasCategory())
9522      composeCodeableConcept(t, "PlanDefinition", "category", element.getCategory(), -1);
9523    if (element.hasDescription())
9524      composeCodeableConcept(t, "PlanDefinition", "description", element.getDescription(), -1);
9525    if (element.hasPriority())
9526      composeCodeableConcept(t, "PlanDefinition", "priority", element.getPriority(), -1);
9527    if (element.hasStart())
9528      composeCodeableConcept(t, "PlanDefinition", "start", element.getStart(), -1);
9529    for (int i = 0; i < element.getAddresses().size(); i++)
9530      composeCodeableConcept(t, "PlanDefinition", "addresses", element.getAddresses().get(i), i);
9531    for (int i = 0; i < element.getDocumentation().size(); i++)
9532      composeRelatedArtifact(t, "PlanDefinition", "documentation", element.getDocumentation().get(i), i);
9533    for (int i = 0; i < element.getTarget().size(); i++)
9534      composePlanDefinitionPlanDefinitionGoalTargetComponent(t, "PlanDefinition", "target", element.getTarget().get(i), i);
9535  }
9536
9537  protected void composePlanDefinitionPlanDefinitionGoalTargetComponent(Complex parent, String parentType, String name, PlanDefinition.PlanDefinitionGoalTargetComponent element, int index) {
9538    if (element == null) 
9539      return;
9540    Complex t;
9541    if (Utilities.noString(parentType))
9542      t = parent;
9543    else {
9544      t = parent.predicate("fhir:"+parentType+'.'+name);
9545    }
9546    composeBackboneElement(t, "target", name, element, index);
9547    if (element.hasMeasure())
9548      composeCodeableConcept(t, "PlanDefinition", "measure", element.getMeasure(), -1);
9549    if (element.hasDetail())
9550      composeType(t, "PlanDefinition", "detail", element.getDetail(), -1);
9551    if (element.hasDue())
9552      composeDuration(t, "PlanDefinition", "due", element.getDue(), -1);
9553  }
9554
9555  protected void composePlanDefinitionPlanDefinitionActionComponent(Complex parent, String parentType, String name, PlanDefinition.PlanDefinitionActionComponent element, int index) {
9556    if (element == null) 
9557      return;
9558    Complex t;
9559    if (Utilities.noString(parentType))
9560      t = parent;
9561    else {
9562      t = parent.predicate("fhir:"+parentType+'.'+name);
9563    }
9564    composeBackboneElement(t, "action", name, element, index);
9565    if (element.hasLabelElement())
9566      composeString(t, "PlanDefinition", "label", element.getLabelElement(), -1);
9567    if (element.hasTitleElement())
9568      composeString(t, "PlanDefinition", "title", element.getTitleElement(), -1);
9569    if (element.hasDescriptionElement())
9570      composeString(t, "PlanDefinition", "description", element.getDescriptionElement(), -1);
9571    if (element.hasTextEquivalentElement())
9572      composeString(t, "PlanDefinition", "textEquivalent", element.getTextEquivalentElement(), -1);
9573    for (int i = 0; i < element.getCode().size(); i++)
9574      composeCodeableConcept(t, "PlanDefinition", "code", element.getCode().get(i), i);
9575    for (int i = 0; i < element.getReason().size(); i++)
9576      composeCodeableConcept(t, "PlanDefinition", "reason", element.getReason().get(i), i);
9577    for (int i = 0; i < element.getDocumentation().size(); i++)
9578      composeRelatedArtifact(t, "PlanDefinition", "documentation", element.getDocumentation().get(i), i);
9579    for (int i = 0; i < element.getGoalId().size(); i++)
9580      composeId(t, "PlanDefinition", "goalId", element.getGoalId().get(i), i);
9581    for (int i = 0; i < element.getTriggerDefinition().size(); i++)
9582      composeTriggerDefinition(t, "PlanDefinition", "triggerDefinition", element.getTriggerDefinition().get(i), i);
9583    for (int i = 0; i < element.getCondition().size(); i++)
9584      composePlanDefinitionPlanDefinitionActionConditionComponent(t, "PlanDefinition", "condition", element.getCondition().get(i), i);
9585    for (int i = 0; i < element.getInput().size(); i++)
9586      composeDataRequirement(t, "PlanDefinition", "input", element.getInput().get(i), i);
9587    for (int i = 0; i < element.getOutput().size(); i++)
9588      composeDataRequirement(t, "PlanDefinition", "output", element.getOutput().get(i), i);
9589    for (int i = 0; i < element.getRelatedAction().size(); i++)
9590      composePlanDefinitionPlanDefinitionActionRelatedActionComponent(t, "PlanDefinition", "relatedAction", element.getRelatedAction().get(i), i);
9591    if (element.hasTiming())
9592      composeType(t, "PlanDefinition", "timing", element.getTiming(), -1);
9593    for (int i = 0; i < element.getParticipant().size(); i++)
9594      composePlanDefinitionPlanDefinitionActionParticipantComponent(t, "PlanDefinition", "participant", element.getParticipant().get(i), i);
9595    if (element.hasType())
9596      composeCoding(t, "PlanDefinition", "type", element.getType(), -1);
9597    if (element.hasGroupingBehaviorElement())
9598      composeEnum(t, "PlanDefinition", "groupingBehavior", element.getGroupingBehaviorElement(), -1);
9599    if (element.hasSelectionBehaviorElement())
9600      composeEnum(t, "PlanDefinition", "selectionBehavior", element.getSelectionBehaviorElement(), -1);
9601    if (element.hasRequiredBehaviorElement())
9602      composeEnum(t, "PlanDefinition", "requiredBehavior", element.getRequiredBehaviorElement(), -1);
9603    if (element.hasPrecheckBehaviorElement())
9604      composeEnum(t, "PlanDefinition", "precheckBehavior", element.getPrecheckBehaviorElement(), -1);
9605    if (element.hasCardinalityBehaviorElement())
9606      composeEnum(t, "PlanDefinition", "cardinalityBehavior", element.getCardinalityBehaviorElement(), -1);
9607    if (element.hasDefinition())
9608      composeReference(t, "PlanDefinition", "definition", element.getDefinition(), -1);
9609    if (element.hasTransform())
9610      composeReference(t, "PlanDefinition", "transform", element.getTransform(), -1);
9611    for (int i = 0; i < element.getDynamicValue().size(); i++)
9612      composePlanDefinitionPlanDefinitionActionDynamicValueComponent(t, "PlanDefinition", "dynamicValue", element.getDynamicValue().get(i), i);
9613    for (int i = 0; i < element.getAction().size(); i++)
9614      composePlanDefinitionPlanDefinitionActionComponent(t, "PlanDefinition", "action", element.getAction().get(i), i);
9615  }
9616
9617  protected void composePlanDefinitionPlanDefinitionActionConditionComponent(Complex parent, String parentType, String name, PlanDefinition.PlanDefinitionActionConditionComponent element, int index) {
9618    if (element == null) 
9619      return;
9620    Complex t;
9621    if (Utilities.noString(parentType))
9622      t = parent;
9623    else {
9624      t = parent.predicate("fhir:"+parentType+'.'+name);
9625    }
9626    composeBackboneElement(t, "condition", name, element, index);
9627    if (element.hasKindElement())
9628      composeEnum(t, "PlanDefinition", "kind", element.getKindElement(), -1);
9629    if (element.hasDescriptionElement())
9630      composeString(t, "PlanDefinition", "description", element.getDescriptionElement(), -1);
9631    if (element.hasLanguageElement())
9632      composeString(t, "PlanDefinition", "language", element.getLanguageElement(), -1);
9633    if (element.hasExpressionElement())
9634      composeString(t, "PlanDefinition", "expression", element.getExpressionElement(), -1);
9635  }
9636
9637  protected void composePlanDefinitionPlanDefinitionActionRelatedActionComponent(Complex parent, String parentType, String name, PlanDefinition.PlanDefinitionActionRelatedActionComponent element, int index) {
9638    if (element == null) 
9639      return;
9640    Complex t;
9641    if (Utilities.noString(parentType))
9642      t = parent;
9643    else {
9644      t = parent.predicate("fhir:"+parentType+'.'+name);
9645    }
9646    composeBackboneElement(t, "relatedAction", name, element, index);
9647    if (element.hasActionIdElement())
9648      composeId(t, "PlanDefinition", "actionId", element.getActionIdElement(), -1);
9649    if (element.hasRelationshipElement())
9650      composeEnum(t, "PlanDefinition", "relationship", element.getRelationshipElement(), -1);
9651    if (element.hasOffset())
9652      composeType(t, "PlanDefinition", "offset", element.getOffset(), -1);
9653  }
9654
9655  protected void composePlanDefinitionPlanDefinitionActionParticipantComponent(Complex parent, String parentType, String name, PlanDefinition.PlanDefinitionActionParticipantComponent element, int index) {
9656    if (element == null) 
9657      return;
9658    Complex t;
9659    if (Utilities.noString(parentType))
9660      t = parent;
9661    else {
9662      t = parent.predicate("fhir:"+parentType+'.'+name);
9663    }
9664    composeBackboneElement(t, "participant", name, element, index);
9665    if (element.hasTypeElement())
9666      composeEnum(t, "PlanDefinition", "type", element.getTypeElement(), -1);
9667    if (element.hasRole())
9668      composeCodeableConcept(t, "PlanDefinition", "role", element.getRole(), -1);
9669  }
9670
9671  protected void composePlanDefinitionPlanDefinitionActionDynamicValueComponent(Complex parent, String parentType, String name, PlanDefinition.PlanDefinitionActionDynamicValueComponent element, int index) {
9672    if (element == null) 
9673      return;
9674    Complex t;
9675    if (Utilities.noString(parentType))
9676      t = parent;
9677    else {
9678      t = parent.predicate("fhir:"+parentType+'.'+name);
9679    }
9680    composeBackboneElement(t, "dynamicValue", name, element, index);
9681    if (element.hasDescriptionElement())
9682      composeString(t, "PlanDefinition", "description", element.getDescriptionElement(), -1);
9683    if (element.hasPathElement())
9684      composeString(t, "PlanDefinition", "path", element.getPathElement(), -1);
9685    if (element.hasLanguageElement())
9686      composeString(t, "PlanDefinition", "language", element.getLanguageElement(), -1);
9687    if (element.hasExpressionElement())
9688      composeString(t, "PlanDefinition", "expression", element.getExpressionElement(), -1);
9689  }
9690
9691  protected void composePractitioner(Complex parent, String parentType, String name, Practitioner element, int index) {
9692    if (element == null) 
9693      return;
9694    Complex t;
9695    if (Utilities.noString(parentType))
9696      t = parent;
9697    else {
9698      t = parent.predicate("fhir:"+parentType+'.'+name);
9699    }
9700    composeDomainResource(t, "Practitioner", name, element, index);
9701    for (int i = 0; i < element.getIdentifier().size(); i++)
9702      composeIdentifier(t, "Practitioner", "identifier", element.getIdentifier().get(i), i);
9703    if (element.hasActiveElement())
9704      composeBoolean(t, "Practitioner", "active", element.getActiveElement(), -1);
9705    for (int i = 0; i < element.getName().size(); i++)
9706      composeHumanName(t, "Practitioner", "name", element.getName().get(i), i);
9707    for (int i = 0; i < element.getTelecom().size(); i++)
9708      composeContactPoint(t, "Practitioner", "telecom", element.getTelecom().get(i), i);
9709    for (int i = 0; i < element.getAddress().size(); i++)
9710      composeAddress(t, "Practitioner", "address", element.getAddress().get(i), i);
9711    if (element.hasGenderElement())
9712      composeEnum(t, "Practitioner", "gender", element.getGenderElement(), -1);
9713    if (element.hasBirthDateElement())
9714      composeDate(t, "Practitioner", "birthDate", element.getBirthDateElement(), -1);
9715    for (int i = 0; i < element.getPhoto().size(); i++)
9716      composeAttachment(t, "Practitioner", "photo", element.getPhoto().get(i), i);
9717    for (int i = 0; i < element.getQualification().size(); i++)
9718      composePractitionerPractitionerQualificationComponent(t, "Practitioner", "qualification", element.getQualification().get(i), i);
9719    for (int i = 0; i < element.getCommunication().size(); i++)
9720      composeCodeableConcept(t, "Practitioner", "communication", element.getCommunication().get(i), i);
9721  }
9722
9723  protected void composePractitionerPractitionerQualificationComponent(Complex parent, String parentType, String name, Practitioner.PractitionerQualificationComponent element, int index) {
9724    if (element == null) 
9725      return;
9726    Complex t;
9727    if (Utilities.noString(parentType))
9728      t = parent;
9729    else {
9730      t = parent.predicate("fhir:"+parentType+'.'+name);
9731    }
9732    composeBackboneElement(t, "qualification", name, element, index);
9733    for (int i = 0; i < element.getIdentifier().size(); i++)
9734      composeIdentifier(t, "Practitioner", "identifier", element.getIdentifier().get(i), i);
9735    if (element.hasCode())
9736      composeCodeableConcept(t, "Practitioner", "code", element.getCode(), -1);
9737    if (element.hasPeriod())
9738      composePeriod(t, "Practitioner", "period", element.getPeriod(), -1);
9739    if (element.hasIssuer())
9740      composeReference(t, "Practitioner", "issuer", element.getIssuer(), -1);
9741  }
9742
9743  protected void composePractitionerRole(Complex parent, String parentType, String name, PractitionerRole element, int index) {
9744    if (element == null) 
9745      return;
9746    Complex t;
9747    if (Utilities.noString(parentType))
9748      t = parent;
9749    else {
9750      t = parent.predicate("fhir:"+parentType+'.'+name);
9751    }
9752    composeDomainResource(t, "PractitionerRole", name, element, index);
9753    for (int i = 0; i < element.getIdentifier().size(); i++)
9754      composeIdentifier(t, "PractitionerRole", "identifier", element.getIdentifier().get(i), i);
9755    if (element.hasActiveElement())
9756      composeBoolean(t, "PractitionerRole", "active", element.getActiveElement(), -1);
9757    if (element.hasPeriod())
9758      composePeriod(t, "PractitionerRole", "period", element.getPeriod(), -1);
9759    if (element.hasPractitioner())
9760      composeReference(t, "PractitionerRole", "practitioner", element.getPractitioner(), -1);
9761    if (element.hasOrganization())
9762      composeReference(t, "PractitionerRole", "organization", element.getOrganization(), -1);
9763    for (int i = 0; i < element.getCode().size(); i++)
9764      composeCodeableConcept(t, "PractitionerRole", "code", element.getCode().get(i), i);
9765    for (int i = 0; i < element.getSpecialty().size(); i++)
9766      composeCodeableConcept(t, "PractitionerRole", "specialty", element.getSpecialty().get(i), i);
9767    for (int i = 0; i < element.getLocation().size(); i++)
9768      composeReference(t, "PractitionerRole", "location", element.getLocation().get(i), i);
9769    for (int i = 0; i < element.getHealthcareService().size(); i++)
9770      composeReference(t, "PractitionerRole", "healthcareService", element.getHealthcareService().get(i), i);
9771    for (int i = 0; i < element.getTelecom().size(); i++)
9772      composeContactPoint(t, "PractitionerRole", "telecom", element.getTelecom().get(i), i);
9773    for (int i = 0; i < element.getAvailableTime().size(); i++)
9774      composePractitionerRolePractitionerRoleAvailableTimeComponent(t, "PractitionerRole", "availableTime", element.getAvailableTime().get(i), i);
9775    for (int i = 0; i < element.getNotAvailable().size(); i++)
9776      composePractitionerRolePractitionerRoleNotAvailableComponent(t, "PractitionerRole", "notAvailable", element.getNotAvailable().get(i), i);
9777    if (element.hasAvailabilityExceptionsElement())
9778      composeString(t, "PractitionerRole", "availabilityExceptions", element.getAvailabilityExceptionsElement(), -1);
9779    for (int i = 0; i < element.getEndpoint().size(); i++)
9780      composeReference(t, "PractitionerRole", "endpoint", element.getEndpoint().get(i), i);
9781  }
9782
9783  protected void composePractitionerRolePractitionerRoleAvailableTimeComponent(Complex parent, String parentType, String name, PractitionerRole.PractitionerRoleAvailableTimeComponent element, int index) {
9784    if (element == null) 
9785      return;
9786    Complex t;
9787    if (Utilities.noString(parentType))
9788      t = parent;
9789    else {
9790      t = parent.predicate("fhir:"+parentType+'.'+name);
9791    }
9792    composeBackboneElement(t, "availableTime", name, element, index);
9793    for (int i = 0; i < element.getDaysOfWeek().size(); i++)
9794      composeEnum(t, "PractitionerRole", "daysOfWeek", element.getDaysOfWeek().get(i), i);
9795    if (element.hasAllDayElement())
9796      composeBoolean(t, "PractitionerRole", "allDay", element.getAllDayElement(), -1);
9797    if (element.hasAvailableStartTimeElement())
9798      composeTime(t, "PractitionerRole", "availableStartTime", element.getAvailableStartTimeElement(), -1);
9799    if (element.hasAvailableEndTimeElement())
9800      composeTime(t, "PractitionerRole", "availableEndTime", element.getAvailableEndTimeElement(), -1);
9801  }
9802
9803  protected void composePractitionerRolePractitionerRoleNotAvailableComponent(Complex parent, String parentType, String name, PractitionerRole.PractitionerRoleNotAvailableComponent element, int index) {
9804    if (element == null) 
9805      return;
9806    Complex t;
9807    if (Utilities.noString(parentType))
9808      t = parent;
9809    else {
9810      t = parent.predicate("fhir:"+parentType+'.'+name);
9811    }
9812    composeBackboneElement(t, "notAvailable", name, element, index);
9813    if (element.hasDescriptionElement())
9814      composeString(t, "PractitionerRole", "description", element.getDescriptionElement(), -1);
9815    if (element.hasDuring())
9816      composePeriod(t, "PractitionerRole", "during", element.getDuring(), -1);
9817  }
9818
9819  protected void composeProcedure(Complex parent, String parentType, String name, Procedure element, int index) {
9820    if (element == null) 
9821      return;
9822    Complex t;
9823    if (Utilities.noString(parentType))
9824      t = parent;
9825    else {
9826      t = parent.predicate("fhir:"+parentType+'.'+name);
9827    }
9828    composeDomainResource(t, "Procedure", name, element, index);
9829    for (int i = 0; i < element.getIdentifier().size(); i++)
9830      composeIdentifier(t, "Procedure", "identifier", element.getIdentifier().get(i), i);
9831    for (int i = 0; i < element.getDefinition().size(); i++)
9832      composeReference(t, "Procedure", "definition", element.getDefinition().get(i), i);
9833    for (int i = 0; i < element.getBasedOn().size(); i++)
9834      composeReference(t, "Procedure", "basedOn", element.getBasedOn().get(i), i);
9835    for (int i = 0; i < element.getPartOf().size(); i++)
9836      composeReference(t, "Procedure", "partOf", element.getPartOf().get(i), i);
9837    if (element.hasStatusElement())
9838      composeEnum(t, "Procedure", "status", element.getStatusElement(), -1);
9839    if (element.hasNotDoneElement())
9840      composeBoolean(t, "Procedure", "notDone", element.getNotDoneElement(), -1);
9841    if (element.hasNotDoneReason())
9842      composeCodeableConcept(t, "Procedure", "notDoneReason", element.getNotDoneReason(), -1);
9843    if (element.hasCategory())
9844      composeCodeableConcept(t, "Procedure", "category", element.getCategory(), -1);
9845    if (element.hasCode())
9846      composeCodeableConcept(t, "Procedure", "code", element.getCode(), -1);
9847    if (element.hasSubject())
9848      composeReference(t, "Procedure", "subject", element.getSubject(), -1);
9849    if (element.hasContext())
9850      composeReference(t, "Procedure", "context", element.getContext(), -1);
9851    if (element.hasPerformed())
9852      composeType(t, "Procedure", "performed", element.getPerformed(), -1);
9853    for (int i = 0; i < element.getPerformer().size(); i++)
9854      composeProcedureProcedurePerformerComponent(t, "Procedure", "performer", element.getPerformer().get(i), i);
9855    if (element.hasLocation())
9856      composeReference(t, "Procedure", "location", element.getLocation(), -1);
9857    for (int i = 0; i < element.getReasonCode().size(); i++)
9858      composeCodeableConcept(t, "Procedure", "reasonCode", element.getReasonCode().get(i), i);
9859    for (int i = 0; i < element.getReasonReference().size(); i++)
9860      composeReference(t, "Procedure", "reasonReference", element.getReasonReference().get(i), i);
9861    for (int i = 0; i < element.getBodySite().size(); i++)
9862      composeCodeableConcept(t, "Procedure", "bodySite", element.getBodySite().get(i), i);
9863    if (element.hasOutcome())
9864      composeCodeableConcept(t, "Procedure", "outcome", element.getOutcome(), -1);
9865    for (int i = 0; i < element.getReport().size(); i++)
9866      composeReference(t, "Procedure", "report", element.getReport().get(i), i);
9867    for (int i = 0; i < element.getComplication().size(); i++)
9868      composeCodeableConcept(t, "Procedure", "complication", element.getComplication().get(i), i);
9869    for (int i = 0; i < element.getComplicationDetail().size(); i++)
9870      composeReference(t, "Procedure", "complicationDetail", element.getComplicationDetail().get(i), i);
9871    for (int i = 0; i < element.getFollowUp().size(); i++)
9872      composeCodeableConcept(t, "Procedure", "followUp", element.getFollowUp().get(i), i);
9873    for (int i = 0; i < element.getNote().size(); i++)
9874      composeAnnotation(t, "Procedure", "note", element.getNote().get(i), i);
9875    for (int i = 0; i < element.getFocalDevice().size(); i++)
9876      composeProcedureProcedureFocalDeviceComponent(t, "Procedure", "focalDevice", element.getFocalDevice().get(i), i);
9877    for (int i = 0; i < element.getUsedReference().size(); i++)
9878      composeReference(t, "Procedure", "usedReference", element.getUsedReference().get(i), i);
9879    for (int i = 0; i < element.getUsedCode().size(); i++)
9880      composeCodeableConcept(t, "Procedure", "usedCode", element.getUsedCode().get(i), i);
9881  }
9882
9883  protected void composeProcedureProcedurePerformerComponent(Complex parent, String parentType, String name, Procedure.ProcedurePerformerComponent element, int index) {
9884    if (element == null) 
9885      return;
9886    Complex t;
9887    if (Utilities.noString(parentType))
9888      t = parent;
9889    else {
9890      t = parent.predicate("fhir:"+parentType+'.'+name);
9891    }
9892    composeBackboneElement(t, "performer", name, element, index);
9893    if (element.hasRole())
9894      composeCodeableConcept(t, "Procedure", "role", element.getRole(), -1);
9895    if (element.hasActor())
9896      composeReference(t, "Procedure", "actor", element.getActor(), -1);
9897    if (element.hasOnBehalfOf())
9898      composeReference(t, "Procedure", "onBehalfOf", element.getOnBehalfOf(), -1);
9899  }
9900
9901  protected void composeProcedureProcedureFocalDeviceComponent(Complex parent, String parentType, String name, Procedure.ProcedureFocalDeviceComponent element, int index) {
9902    if (element == null) 
9903      return;
9904    Complex t;
9905    if (Utilities.noString(parentType))
9906      t = parent;
9907    else {
9908      t = parent.predicate("fhir:"+parentType+'.'+name);
9909    }
9910    composeBackboneElement(t, "focalDevice", name, element, index);
9911    if (element.hasAction())
9912      composeCodeableConcept(t, "Procedure", "action", element.getAction(), -1);
9913    if (element.hasManipulated())
9914      composeReference(t, "Procedure", "manipulated", element.getManipulated(), -1);
9915  }
9916
9917  protected void composeProcedureRequest(Complex parent, String parentType, String name, ProcedureRequest element, int index) {
9918    if (element == null) 
9919      return;
9920    Complex t;
9921    if (Utilities.noString(parentType))
9922      t = parent;
9923    else {
9924      t = parent.predicate("fhir:"+parentType+'.'+name);
9925    }
9926    composeDomainResource(t, "ProcedureRequest", name, element, index);
9927    for (int i = 0; i < element.getIdentifier().size(); i++)
9928      composeIdentifier(t, "ProcedureRequest", "identifier", element.getIdentifier().get(i), i);
9929    for (int i = 0; i < element.getDefinition().size(); i++)
9930      composeReference(t, "ProcedureRequest", "definition", element.getDefinition().get(i), i);
9931    for (int i = 0; i < element.getBasedOn().size(); i++)
9932      composeReference(t, "ProcedureRequest", "basedOn", element.getBasedOn().get(i), i);
9933    for (int i = 0; i < element.getReplaces().size(); i++)
9934      composeReference(t, "ProcedureRequest", "replaces", element.getReplaces().get(i), i);
9935    if (element.hasRequisition())
9936      composeIdentifier(t, "ProcedureRequest", "requisition", element.getRequisition(), -1);
9937    if (element.hasStatusElement())
9938      composeEnum(t, "ProcedureRequest", "status", element.getStatusElement(), -1);
9939    if (element.hasIntentElement())
9940      composeEnum(t, "ProcedureRequest", "intent", element.getIntentElement(), -1);
9941    if (element.hasPriorityElement())
9942      composeEnum(t, "ProcedureRequest", "priority", element.getPriorityElement(), -1);
9943    if (element.hasDoNotPerformElement())
9944      composeBoolean(t, "ProcedureRequest", "doNotPerform", element.getDoNotPerformElement(), -1);
9945    for (int i = 0; i < element.getCategory().size(); i++)
9946      composeCodeableConcept(t, "ProcedureRequest", "category", element.getCategory().get(i), i);
9947    if (element.hasCode())
9948      composeCodeableConcept(t, "ProcedureRequest", "code", element.getCode(), -1);
9949    if (element.hasSubject())
9950      composeReference(t, "ProcedureRequest", "subject", element.getSubject(), -1);
9951    if (element.hasContext())
9952      composeReference(t, "ProcedureRequest", "context", element.getContext(), -1);
9953    if (element.hasOccurrence())
9954      composeType(t, "ProcedureRequest", "occurrence", element.getOccurrence(), -1);
9955    if (element.hasAsNeeded())
9956      composeType(t, "ProcedureRequest", "asNeeded", element.getAsNeeded(), -1);
9957    if (element.hasAuthoredOnElement())
9958      composeDateTime(t, "ProcedureRequest", "authoredOn", element.getAuthoredOnElement(), -1);
9959    if (element.hasRequester())
9960      composeProcedureRequestProcedureRequestRequesterComponent(t, "ProcedureRequest", "requester", element.getRequester(), -1);
9961    if (element.hasPerformerType())
9962      composeCodeableConcept(t, "ProcedureRequest", "performerType", element.getPerformerType(), -1);
9963    if (element.hasPerformer())
9964      composeReference(t, "ProcedureRequest", "performer", element.getPerformer(), -1);
9965    for (int i = 0; i < element.getReasonCode().size(); i++)
9966      composeCodeableConcept(t, "ProcedureRequest", "reasonCode", element.getReasonCode().get(i), i);
9967    for (int i = 0; i < element.getReasonReference().size(); i++)
9968      composeReference(t, "ProcedureRequest", "reasonReference", element.getReasonReference().get(i), i);
9969    for (int i = 0; i < element.getSupportingInfo().size(); i++)
9970      composeReference(t, "ProcedureRequest", "supportingInfo", element.getSupportingInfo().get(i), i);
9971    for (int i = 0; i < element.getSpecimen().size(); i++)
9972      composeReference(t, "ProcedureRequest", "specimen", element.getSpecimen().get(i), i);
9973    for (int i = 0; i < element.getBodySite().size(); i++)
9974      composeCodeableConcept(t, "ProcedureRequest", "bodySite", element.getBodySite().get(i), i);
9975    for (int i = 0; i < element.getNote().size(); i++)
9976      composeAnnotation(t, "ProcedureRequest", "note", element.getNote().get(i), i);
9977    for (int i = 0; i < element.getRelevantHistory().size(); i++)
9978      composeReference(t, "ProcedureRequest", "relevantHistory", element.getRelevantHistory().get(i), i);
9979  }
9980
9981  protected void composeProcedureRequestProcedureRequestRequesterComponent(Complex parent, String parentType, String name, ProcedureRequest.ProcedureRequestRequesterComponent element, int index) {
9982    if (element == null) 
9983      return;
9984    Complex t;
9985    if (Utilities.noString(parentType))
9986      t = parent;
9987    else {
9988      t = parent.predicate("fhir:"+parentType+'.'+name);
9989    }
9990    composeBackboneElement(t, "requester", name, element, index);
9991    if (element.hasAgent())
9992      composeReference(t, "ProcedureRequest", "agent", element.getAgent(), -1);
9993    if (element.hasOnBehalfOf())
9994      composeReference(t, "ProcedureRequest", "onBehalfOf", element.getOnBehalfOf(), -1);
9995  }
9996
9997  protected void composeProcessRequest(Complex parent, String parentType, String name, ProcessRequest element, int index) {
9998    if (element == null) 
9999      return;
10000    Complex t;
10001    if (Utilities.noString(parentType))
10002      t = parent;
10003    else {
10004      t = parent.predicate("fhir:"+parentType+'.'+name);
10005    }
10006    composeDomainResource(t, "ProcessRequest", name, element, index);
10007    for (int i = 0; i < element.getIdentifier().size(); i++)
10008      composeIdentifier(t, "ProcessRequest", "identifier", element.getIdentifier().get(i), i);
10009    if (element.hasStatusElement())
10010      composeEnum(t, "ProcessRequest", "status", element.getStatusElement(), -1);
10011    if (element.hasActionElement())
10012      composeEnum(t, "ProcessRequest", "action", element.getActionElement(), -1);
10013    if (element.hasTarget())
10014      composeReference(t, "ProcessRequest", "target", element.getTarget(), -1);
10015    if (element.hasCreatedElement())
10016      composeDateTime(t, "ProcessRequest", "created", element.getCreatedElement(), -1);
10017    if (element.hasProvider())
10018      composeReference(t, "ProcessRequest", "provider", element.getProvider(), -1);
10019    if (element.hasOrganization())
10020      composeReference(t, "ProcessRequest", "organization", element.getOrganization(), -1);
10021    if (element.hasRequest())
10022      composeReference(t, "ProcessRequest", "request", element.getRequest(), -1);
10023    if (element.hasResponse())
10024      composeReference(t, "ProcessRequest", "response", element.getResponse(), -1);
10025    if (element.hasNullifyElement())
10026      composeBoolean(t, "ProcessRequest", "nullify", element.getNullifyElement(), -1);
10027    if (element.hasReferenceElement())
10028      composeString(t, "ProcessRequest", "reference", element.getReferenceElement(), -1);
10029    for (int i = 0; i < element.getItem().size(); i++)
10030      composeProcessRequestItemsComponent(t, "ProcessRequest", "item", element.getItem().get(i), i);
10031    for (int i = 0; i < element.getInclude().size(); i++)
10032      composeString(t, "ProcessRequest", "include", element.getInclude().get(i), i);
10033    for (int i = 0; i < element.getExclude().size(); i++)
10034      composeString(t, "ProcessRequest", "exclude", element.getExclude().get(i), i);
10035    if (element.hasPeriod())
10036      composePeriod(t, "ProcessRequest", "period", element.getPeriod(), -1);
10037  }
10038
10039  protected void composeProcessRequestItemsComponent(Complex parent, String parentType, String name, ProcessRequest.ItemsComponent element, int index) {
10040    if (element == null) 
10041      return;
10042    Complex t;
10043    if (Utilities.noString(parentType))
10044      t = parent;
10045    else {
10046      t = parent.predicate("fhir:"+parentType+'.'+name);
10047    }
10048    composeBackboneElement(t, "item", name, element, index);
10049    if (element.hasSequenceLinkIdElement())
10050      composeInteger(t, "ProcessRequest", "sequenceLinkId", element.getSequenceLinkIdElement(), -1);
10051  }
10052
10053  protected void composeProcessResponse(Complex parent, String parentType, String name, ProcessResponse element, int index) {
10054    if (element == null) 
10055      return;
10056    Complex t;
10057    if (Utilities.noString(parentType))
10058      t = parent;
10059    else {
10060      t = parent.predicate("fhir:"+parentType+'.'+name);
10061    }
10062    composeDomainResource(t, "ProcessResponse", name, element, index);
10063    for (int i = 0; i < element.getIdentifier().size(); i++)
10064      composeIdentifier(t, "ProcessResponse", "identifier", element.getIdentifier().get(i), i);
10065    if (element.hasStatusElement())
10066      composeEnum(t, "ProcessResponse", "status", element.getStatusElement(), -1);
10067    if (element.hasCreatedElement())
10068      composeDateTime(t, "ProcessResponse", "created", element.getCreatedElement(), -1);
10069    if (element.hasOrganization())
10070      composeReference(t, "ProcessResponse", "organization", element.getOrganization(), -1);
10071    if (element.hasRequest())
10072      composeReference(t, "ProcessResponse", "request", element.getRequest(), -1);
10073    if (element.hasOutcome())
10074      composeCodeableConcept(t, "ProcessResponse", "outcome", element.getOutcome(), -1);
10075    if (element.hasDispositionElement())
10076      composeString(t, "ProcessResponse", "disposition", element.getDispositionElement(), -1);
10077    if (element.hasRequestProvider())
10078      composeReference(t, "ProcessResponse", "requestProvider", element.getRequestProvider(), -1);
10079    if (element.hasRequestOrganization())
10080      composeReference(t, "ProcessResponse", "requestOrganization", element.getRequestOrganization(), -1);
10081    if (element.hasForm())
10082      composeCodeableConcept(t, "ProcessResponse", "form", element.getForm(), -1);
10083    for (int i = 0; i < element.getProcessNote().size(); i++)
10084      composeProcessResponseProcessResponseProcessNoteComponent(t, "ProcessResponse", "processNote", element.getProcessNote().get(i), i);
10085    for (int i = 0; i < element.getError().size(); i++)
10086      composeCodeableConcept(t, "ProcessResponse", "error", element.getError().get(i), i);
10087    for (int i = 0; i < element.getCommunicationRequest().size(); i++)
10088      composeReference(t, "ProcessResponse", "communicationRequest", element.getCommunicationRequest().get(i), i);
10089  }
10090
10091  protected void composeProcessResponseProcessResponseProcessNoteComponent(Complex parent, String parentType, String name, ProcessResponse.ProcessResponseProcessNoteComponent element, int index) {
10092    if (element == null) 
10093      return;
10094    Complex t;
10095    if (Utilities.noString(parentType))
10096      t = parent;
10097    else {
10098      t = parent.predicate("fhir:"+parentType+'.'+name);
10099    }
10100    composeBackboneElement(t, "processNote", name, element, index);
10101    if (element.hasType())
10102      composeCodeableConcept(t, "ProcessResponse", "type", element.getType(), -1);
10103    if (element.hasTextElement())
10104      composeString(t, "ProcessResponse", "text", element.getTextElement(), -1);
10105  }
10106
10107  protected void composeProvenance(Complex parent, String parentType, String name, Provenance element, int index) {
10108    if (element == null) 
10109      return;
10110    Complex t;
10111    if (Utilities.noString(parentType))
10112      t = parent;
10113    else {
10114      t = parent.predicate("fhir:"+parentType+'.'+name);
10115    }
10116    composeDomainResource(t, "Provenance", name, element, index);
10117    for (int i = 0; i < element.getTarget().size(); i++)
10118      composeReference(t, "Provenance", "target", element.getTarget().get(i), i);
10119    if (element.hasPeriod())
10120      composePeriod(t, "Provenance", "period", element.getPeriod(), -1);
10121    if (element.hasRecordedElement())
10122      composeInstant(t, "Provenance", "recorded", element.getRecordedElement(), -1);
10123    for (int i = 0; i < element.getPolicy().size(); i++)
10124      composeUri(t, "Provenance", "policy", element.getPolicy().get(i), i);
10125    if (element.hasLocation())
10126      composeReference(t, "Provenance", "location", element.getLocation(), -1);
10127    for (int i = 0; i < element.getReason().size(); i++)
10128      composeCoding(t, "Provenance", "reason", element.getReason().get(i), i);
10129    if (element.hasActivity())
10130      composeCoding(t, "Provenance", "activity", element.getActivity(), -1);
10131    for (int i = 0; i < element.getAgent().size(); i++)
10132      composeProvenanceProvenanceAgentComponent(t, "Provenance", "agent", element.getAgent().get(i), i);
10133    for (int i = 0; i < element.getEntity().size(); i++)
10134      composeProvenanceProvenanceEntityComponent(t, "Provenance", "entity", element.getEntity().get(i), i);
10135    for (int i = 0; i < element.getSignature().size(); i++)
10136      composeSignature(t, "Provenance", "signature", element.getSignature().get(i), i);
10137  }
10138
10139  protected void composeProvenanceProvenanceAgentComponent(Complex parent, String parentType, String name, Provenance.ProvenanceAgentComponent element, int index) {
10140    if (element == null) 
10141      return;
10142    Complex t;
10143    if (Utilities.noString(parentType))
10144      t = parent;
10145    else {
10146      t = parent.predicate("fhir:"+parentType+'.'+name);
10147    }
10148    composeBackboneElement(t, "agent", name, element, index);
10149    for (int i = 0; i < element.getRole().size(); i++)
10150      composeCodeableConcept(t, "Provenance", "role", element.getRole().get(i), i);
10151    if (element.hasWho())
10152      composeType(t, "Provenance", "who", element.getWho(), -1);
10153    if (element.hasOnBehalfOf())
10154      composeType(t, "Provenance", "onBehalfOf", element.getOnBehalfOf(), -1);
10155    if (element.hasRelatedAgentType())
10156      composeCodeableConcept(t, "Provenance", "relatedAgentType", element.getRelatedAgentType(), -1);
10157  }
10158
10159  protected void composeProvenanceProvenanceEntityComponent(Complex parent, String parentType, String name, Provenance.ProvenanceEntityComponent element, int index) {
10160    if (element == null) 
10161      return;
10162    Complex t;
10163    if (Utilities.noString(parentType))
10164      t = parent;
10165    else {
10166      t = parent.predicate("fhir:"+parentType+'.'+name);
10167    }
10168    composeBackboneElement(t, "entity", name, element, index);
10169    if (element.hasRoleElement())
10170      composeEnum(t, "Provenance", "role", element.getRoleElement(), -1);
10171    if (element.hasWhat())
10172      composeType(t, "Provenance", "what", element.getWhat(), -1);
10173    for (int i = 0; i < element.getAgent().size(); i++)
10174      composeProvenanceProvenanceAgentComponent(t, "Provenance", "agent", element.getAgent().get(i), i);
10175  }
10176
10177  protected void composeQuestionnaire(Complex parent, String parentType, String name, Questionnaire element, int index) {
10178    if (element == null) 
10179      return;
10180    Complex t;
10181    if (Utilities.noString(parentType))
10182      t = parent;
10183    else {
10184      t = parent.predicate("fhir:"+parentType+'.'+name);
10185    }
10186    composeDomainResource(t, "Questionnaire", name, element, index);
10187    if (element.hasUrlElement())
10188      composeUri(t, "Questionnaire", "url", element.getUrlElement(), -1);
10189    for (int i = 0; i < element.getIdentifier().size(); i++)
10190      composeIdentifier(t, "Questionnaire", "identifier", element.getIdentifier().get(i), i);
10191    if (element.hasVersionElement())
10192      composeString(t, "Questionnaire", "version", element.getVersionElement(), -1);
10193    if (element.hasNameElement())
10194      composeString(t, "Questionnaire", "name", element.getNameElement(), -1);
10195    if (element.hasTitleElement())
10196      composeString(t, "Questionnaire", "title", element.getTitleElement(), -1);
10197    if (element.hasStatusElement())
10198      composeEnum(t, "Questionnaire", "status", element.getStatusElement(), -1);
10199    if (element.hasExperimentalElement())
10200      composeBoolean(t, "Questionnaire", "experimental", element.getExperimentalElement(), -1);
10201    if (element.hasDateElement())
10202      composeDateTime(t, "Questionnaire", "date", element.getDateElement(), -1);
10203    if (element.hasPublisherElement())
10204      composeString(t, "Questionnaire", "publisher", element.getPublisherElement(), -1);
10205    if (element.hasDescriptionElement())
10206      composeMarkdown(t, "Questionnaire", "description", element.getDescriptionElement(), -1);
10207    if (element.hasPurposeElement())
10208      composeMarkdown(t, "Questionnaire", "purpose", element.getPurposeElement(), -1);
10209    if (element.hasApprovalDateElement())
10210      composeDate(t, "Questionnaire", "approvalDate", element.getApprovalDateElement(), -1);
10211    if (element.hasLastReviewDateElement())
10212      composeDate(t, "Questionnaire", "lastReviewDate", element.getLastReviewDateElement(), -1);
10213    if (element.hasEffectivePeriod())
10214      composePeriod(t, "Questionnaire", "effectivePeriod", element.getEffectivePeriod(), -1);
10215    for (int i = 0; i < element.getUseContext().size(); i++)
10216      composeUsageContext(t, "Questionnaire", "useContext", element.getUseContext().get(i), i);
10217    for (int i = 0; i < element.getJurisdiction().size(); i++)
10218      composeCodeableConcept(t, "Questionnaire", "jurisdiction", element.getJurisdiction().get(i), i);
10219    for (int i = 0; i < element.getContact().size(); i++)
10220      composeContactDetail(t, "Questionnaire", "contact", element.getContact().get(i), i);
10221    if (element.hasCopyrightElement())
10222      composeMarkdown(t, "Questionnaire", "copyright", element.getCopyrightElement(), -1);
10223    for (int i = 0; i < element.getCode().size(); i++)
10224      composeCoding(t, "Questionnaire", "code", element.getCode().get(i), i);
10225    for (int i = 0; i < element.getSubjectType().size(); i++)
10226      composeCode(t, "Questionnaire", "subjectType", element.getSubjectType().get(i), i);
10227    for (int i = 0; i < element.getItem().size(); i++)
10228      composeQuestionnaireQuestionnaireItemComponent(t, "Questionnaire", "item", element.getItem().get(i), i);
10229  }
10230
10231  protected void composeQuestionnaireQuestionnaireItemComponent(Complex parent, String parentType, String name, Questionnaire.QuestionnaireItemComponent element, int index) {
10232    if (element == null) 
10233      return;
10234    Complex t;
10235    if (Utilities.noString(parentType))
10236      t = parent;
10237    else {
10238      t = parent.predicate("fhir:"+parentType+'.'+name);
10239    }
10240    composeBackboneElement(t, "item", name, element, index);
10241    if (element.hasLinkIdElement())
10242      composeString(t, "Questionnaire", "linkId", element.getLinkIdElement(), -1);
10243    if (element.hasDefinitionElement())
10244      composeUri(t, "Questionnaire", "definition", element.getDefinitionElement(), -1);
10245    for (int i = 0; i < element.getCode().size(); i++)
10246      composeCoding(t, "Questionnaire", "code", element.getCode().get(i), i);
10247    if (element.hasPrefixElement())
10248      composeString(t, "Questionnaire", "prefix", element.getPrefixElement(), -1);
10249    if (element.hasTextElement())
10250      composeString(t, "Questionnaire", "text", element.getTextElement(), -1);
10251    if (element.hasTypeElement())
10252      composeEnum(t, "Questionnaire", "type", element.getTypeElement(), -1);
10253    for (int i = 0; i < element.getEnableWhen().size(); i++)
10254      composeQuestionnaireQuestionnaireItemEnableWhenComponent(t, "Questionnaire", "enableWhen", element.getEnableWhen().get(i), i);
10255    if (element.hasRequiredElement())
10256      composeBoolean(t, "Questionnaire", "required", element.getRequiredElement(), -1);
10257    if (element.hasRepeatsElement())
10258      composeBoolean(t, "Questionnaire", "repeats", element.getRepeatsElement(), -1);
10259    if (element.hasReadOnlyElement())
10260      composeBoolean(t, "Questionnaire", "readOnly", element.getReadOnlyElement(), -1);
10261    if (element.hasMaxLengthElement())
10262      composeInteger(t, "Questionnaire", "maxLength", element.getMaxLengthElement(), -1);
10263    if (element.hasOptions())
10264      composeReference(t, "Questionnaire", "options", element.getOptions(), -1);
10265    for (int i = 0; i < element.getOption().size(); i++)
10266      composeQuestionnaireQuestionnaireItemOptionComponent(t, "Questionnaire", "option", element.getOption().get(i), i);
10267    if (element.hasInitial())
10268      composeType(t, "Questionnaire", "initial", element.getInitial(), -1);
10269    for (int i = 0; i < element.getItem().size(); i++)
10270      composeQuestionnaireQuestionnaireItemComponent(t, "Questionnaire", "item", element.getItem().get(i), i);
10271  }
10272
10273  protected void composeQuestionnaireQuestionnaireItemEnableWhenComponent(Complex parent, String parentType, String name, Questionnaire.QuestionnaireItemEnableWhenComponent element, int index) {
10274    if (element == null) 
10275      return;
10276    Complex t;
10277    if (Utilities.noString(parentType))
10278      t = parent;
10279    else {
10280      t = parent.predicate("fhir:"+parentType+'.'+name);
10281    }
10282    composeBackboneElement(t, "enableWhen", name, element, index);
10283    if (element.hasQuestionElement())
10284      composeString(t, "Questionnaire", "question", element.getQuestionElement(), -1);
10285    if (element.hasHasAnswerElement())
10286      composeBoolean(t, "Questionnaire", "hasAnswer", element.getHasAnswerElement(), -1);
10287    if (element.hasAnswer())
10288      composeType(t, "Questionnaire", "answer", element.getAnswer(), -1);
10289  }
10290
10291  protected void composeQuestionnaireQuestionnaireItemOptionComponent(Complex parent, String parentType, String name, Questionnaire.QuestionnaireItemOptionComponent element, int index) {
10292    if (element == null) 
10293      return;
10294    Complex t;
10295    if (Utilities.noString(parentType))
10296      t = parent;
10297    else {
10298      t = parent.predicate("fhir:"+parentType+'.'+name);
10299    }
10300    composeBackboneElement(t, "option", name, element, index);
10301    if (element.hasValue())
10302      composeType(t, "Questionnaire", "value", element.getValue(), -1);
10303  }
10304
10305  protected void composeQuestionnaireResponse(Complex parent, String parentType, String name, QuestionnaireResponse element, int index) {
10306    if (element == null) 
10307      return;
10308    Complex t;
10309    if (Utilities.noString(parentType))
10310      t = parent;
10311    else {
10312      t = parent.predicate("fhir:"+parentType+'.'+name);
10313    }
10314    composeDomainResource(t, "QuestionnaireResponse", name, element, index);
10315    if (element.hasIdentifier())
10316      composeIdentifier(t, "QuestionnaireResponse", "identifier", element.getIdentifier(), -1);
10317    for (int i = 0; i < element.getBasedOn().size(); i++)
10318      composeReference(t, "QuestionnaireResponse", "basedOn", element.getBasedOn().get(i), i);
10319    for (int i = 0; i < element.getParent().size(); i++)
10320      composeReference(t, "QuestionnaireResponse", "parent", element.getParent().get(i), i);
10321    if (element.hasQuestionnaire())
10322      composeReference(t, "QuestionnaireResponse", "questionnaire", element.getQuestionnaire(), -1);
10323    if (element.hasStatusElement())
10324      composeEnum(t, "QuestionnaireResponse", "status", element.getStatusElement(), -1);
10325    if (element.hasSubject())
10326      composeReference(t, "QuestionnaireResponse", "subject", element.getSubject(), -1);
10327    if (element.hasContext())
10328      composeReference(t, "QuestionnaireResponse", "context", element.getContext(), -1);
10329    if (element.hasAuthoredElement())
10330      composeDateTime(t, "QuestionnaireResponse", "authored", element.getAuthoredElement(), -1);
10331    if (element.hasAuthor())
10332      composeReference(t, "QuestionnaireResponse", "author", element.getAuthor(), -1);
10333    if (element.hasSource())
10334      composeReference(t, "QuestionnaireResponse", "source", element.getSource(), -1);
10335    for (int i = 0; i < element.getItem().size(); i++)
10336      composeQuestionnaireResponseQuestionnaireResponseItemComponent(t, "QuestionnaireResponse", "item", element.getItem().get(i), i);
10337  }
10338
10339  protected void composeQuestionnaireResponseQuestionnaireResponseItemComponent(Complex parent, String parentType, String name, QuestionnaireResponse.QuestionnaireResponseItemComponent element, int index) {
10340    if (element == null) 
10341      return;
10342    Complex t;
10343    if (Utilities.noString(parentType))
10344      t = parent;
10345    else {
10346      t = parent.predicate("fhir:"+parentType+'.'+name);
10347    }
10348    composeBackboneElement(t, "item", name, element, index);
10349    if (element.hasLinkIdElement())
10350      composeString(t, "QuestionnaireResponse", "linkId", element.getLinkIdElement(), -1);
10351    if (element.hasDefinitionElement())
10352      composeUri(t, "QuestionnaireResponse", "definition", element.getDefinitionElement(), -1);
10353    if (element.hasTextElement())
10354      composeString(t, "QuestionnaireResponse", "text", element.getTextElement(), -1);
10355    if (element.hasSubject())
10356      composeReference(t, "QuestionnaireResponse", "subject", element.getSubject(), -1);
10357    for (int i = 0; i < element.getAnswer().size(); i++)
10358      composeQuestionnaireResponseQuestionnaireResponseItemAnswerComponent(t, "QuestionnaireResponse", "answer", element.getAnswer().get(i), i);
10359    for (int i = 0; i < element.getItem().size(); i++)
10360      composeQuestionnaireResponseQuestionnaireResponseItemComponent(t, "QuestionnaireResponse", "item", element.getItem().get(i), i);
10361  }
10362
10363  protected void composeQuestionnaireResponseQuestionnaireResponseItemAnswerComponent(Complex parent, String parentType, String name, QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent element, int index) {
10364    if (element == null) 
10365      return;
10366    Complex t;
10367    if (Utilities.noString(parentType))
10368      t = parent;
10369    else {
10370      t = parent.predicate("fhir:"+parentType+'.'+name);
10371    }
10372    composeBackboneElement(t, "answer", name, element, index);
10373    if (element.hasValue())
10374      composeType(t, "QuestionnaireResponse", "value", element.getValue(), -1);
10375    for (int i = 0; i < element.getItem().size(); i++)
10376      composeQuestionnaireResponseQuestionnaireResponseItemComponent(t, "QuestionnaireResponse", "item", element.getItem().get(i), i);
10377  }
10378
10379  protected void composeReferralRequest(Complex parent, String parentType, String name, ReferralRequest element, int index) {
10380    if (element == null) 
10381      return;
10382    Complex t;
10383    if (Utilities.noString(parentType))
10384      t = parent;
10385    else {
10386      t = parent.predicate("fhir:"+parentType+'.'+name);
10387    }
10388    composeDomainResource(t, "ReferralRequest", name, element, index);
10389    for (int i = 0; i < element.getIdentifier().size(); i++)
10390      composeIdentifier(t, "ReferralRequest", "identifier", element.getIdentifier().get(i), i);
10391    for (int i = 0; i < element.getDefinition().size(); i++)
10392      composeReference(t, "ReferralRequest", "definition", element.getDefinition().get(i), i);
10393    for (int i = 0; i < element.getBasedOn().size(); i++)
10394      composeReference(t, "ReferralRequest", "basedOn", element.getBasedOn().get(i), i);
10395    for (int i = 0; i < element.getReplaces().size(); i++)
10396      composeReference(t, "ReferralRequest", "replaces", element.getReplaces().get(i), i);
10397    if (element.hasGroupIdentifier())
10398      composeIdentifier(t, "ReferralRequest", "groupIdentifier", element.getGroupIdentifier(), -1);
10399    if (element.hasStatusElement())
10400      composeEnum(t, "ReferralRequest", "status", element.getStatusElement(), -1);
10401    if (element.hasIntentElement())
10402      composeEnum(t, "ReferralRequest", "intent", element.getIntentElement(), -1);
10403    if (element.hasType())
10404      composeCodeableConcept(t, "ReferralRequest", "type", element.getType(), -1);
10405    if (element.hasPriorityElement())
10406      composeEnum(t, "ReferralRequest", "priority", element.getPriorityElement(), -1);
10407    for (int i = 0; i < element.getServiceRequested().size(); i++)
10408      composeCodeableConcept(t, "ReferralRequest", "serviceRequested", element.getServiceRequested().get(i), i);
10409    if (element.hasSubject())
10410      composeReference(t, "ReferralRequest", "subject", element.getSubject(), -1);
10411    if (element.hasContext())
10412      composeReference(t, "ReferralRequest", "context", element.getContext(), -1);
10413    if (element.hasOccurrence())
10414      composeType(t, "ReferralRequest", "occurrence", element.getOccurrence(), -1);
10415    if (element.hasAuthoredOnElement())
10416      composeDateTime(t, "ReferralRequest", "authoredOn", element.getAuthoredOnElement(), -1);
10417    if (element.hasRequester())
10418      composeReferralRequestReferralRequestRequesterComponent(t, "ReferralRequest", "requester", element.getRequester(), -1);
10419    if (element.hasSpecialty())
10420      composeCodeableConcept(t, "ReferralRequest", "specialty", element.getSpecialty(), -1);
10421    for (int i = 0; i < element.getRecipient().size(); i++)
10422      composeReference(t, "ReferralRequest", "recipient", element.getRecipient().get(i), i);
10423    for (int i = 0; i < element.getReasonCode().size(); i++)
10424      composeCodeableConcept(t, "ReferralRequest", "reasonCode", element.getReasonCode().get(i), i);
10425    for (int i = 0; i < element.getReasonReference().size(); i++)
10426      composeReference(t, "ReferralRequest", "reasonReference", element.getReasonReference().get(i), i);
10427    if (element.hasDescriptionElement())
10428      composeString(t, "ReferralRequest", "description", element.getDescriptionElement(), -1);
10429    for (int i = 0; i < element.getSupportingInfo().size(); i++)
10430      composeReference(t, "ReferralRequest", "supportingInfo", element.getSupportingInfo().get(i), i);
10431    for (int i = 0; i < element.getNote().size(); i++)
10432      composeAnnotation(t, "ReferralRequest", "note", element.getNote().get(i), i);
10433    for (int i = 0; i < element.getRelevantHistory().size(); i++)
10434      composeReference(t, "ReferralRequest", "relevantHistory", element.getRelevantHistory().get(i), i);
10435  }
10436
10437  protected void composeReferralRequestReferralRequestRequesterComponent(Complex parent, String parentType, String name, ReferralRequest.ReferralRequestRequesterComponent element, int index) {
10438    if (element == null) 
10439      return;
10440    Complex t;
10441    if (Utilities.noString(parentType))
10442      t = parent;
10443    else {
10444      t = parent.predicate("fhir:"+parentType+'.'+name);
10445    }
10446    composeBackboneElement(t, "requester", name, element, index);
10447    if (element.hasAgent())
10448      composeReference(t, "ReferralRequest", "agent", element.getAgent(), -1);
10449    if (element.hasOnBehalfOf())
10450      composeReference(t, "ReferralRequest", "onBehalfOf", element.getOnBehalfOf(), -1);
10451  }
10452
10453  protected void composeRelatedPerson(Complex parent, String parentType, String name, RelatedPerson element, int index) {
10454    if (element == null) 
10455      return;
10456    Complex t;
10457    if (Utilities.noString(parentType))
10458      t = parent;
10459    else {
10460      t = parent.predicate("fhir:"+parentType+'.'+name);
10461    }
10462    composeDomainResource(t, "RelatedPerson", name, element, index);
10463    for (int i = 0; i < element.getIdentifier().size(); i++)
10464      composeIdentifier(t, "RelatedPerson", "identifier", element.getIdentifier().get(i), i);
10465    if (element.hasActiveElement())
10466      composeBoolean(t, "RelatedPerson", "active", element.getActiveElement(), -1);
10467    if (element.hasPatient())
10468      composeReference(t, "RelatedPerson", "patient", element.getPatient(), -1);
10469    if (element.hasRelationship())
10470      composeCodeableConcept(t, "RelatedPerson", "relationship", element.getRelationship(), -1);
10471    for (int i = 0; i < element.getName().size(); i++)
10472      composeHumanName(t, "RelatedPerson", "name", element.getName().get(i), i);
10473    for (int i = 0; i < element.getTelecom().size(); i++)
10474      composeContactPoint(t, "RelatedPerson", "telecom", element.getTelecom().get(i), i);
10475    if (element.hasGenderElement())
10476      composeEnum(t, "RelatedPerson", "gender", element.getGenderElement(), -1);
10477    if (element.hasBirthDateElement())
10478      composeDate(t, "RelatedPerson", "birthDate", element.getBirthDateElement(), -1);
10479    for (int i = 0; i < element.getAddress().size(); i++)
10480      composeAddress(t, "RelatedPerson", "address", element.getAddress().get(i), i);
10481    for (int i = 0; i < element.getPhoto().size(); i++)
10482      composeAttachment(t, "RelatedPerson", "photo", element.getPhoto().get(i), i);
10483    if (element.hasPeriod())
10484      composePeriod(t, "RelatedPerson", "period", element.getPeriod(), -1);
10485  }
10486
10487  protected void composeRequestGroup(Complex parent, String parentType, String name, RequestGroup element, int index) {
10488    if (element == null) 
10489      return;
10490    Complex t;
10491    if (Utilities.noString(parentType))
10492      t = parent;
10493    else {
10494      t = parent.predicate("fhir:"+parentType+'.'+name);
10495    }
10496    composeDomainResource(t, "RequestGroup", name, element, index);
10497    for (int i = 0; i < element.getIdentifier().size(); i++)
10498      composeIdentifier(t, "RequestGroup", "identifier", element.getIdentifier().get(i), i);
10499    for (int i = 0; i < element.getDefinition().size(); i++)
10500      composeReference(t, "RequestGroup", "definition", element.getDefinition().get(i), i);
10501    for (int i = 0; i < element.getBasedOn().size(); i++)
10502      composeReference(t, "RequestGroup", "basedOn", element.getBasedOn().get(i), i);
10503    for (int i = 0; i < element.getReplaces().size(); i++)
10504      composeReference(t, "RequestGroup", "replaces", element.getReplaces().get(i), i);
10505    if (element.hasGroupIdentifier())
10506      composeIdentifier(t, "RequestGroup", "groupIdentifier", element.getGroupIdentifier(), -1);
10507    if (element.hasStatusElement())
10508      composeEnum(t, "RequestGroup", "status", element.getStatusElement(), -1);
10509    if (element.hasIntentElement())
10510      composeEnum(t, "RequestGroup", "intent", element.getIntentElement(), -1);
10511    if (element.hasPriorityElement())
10512      composeEnum(t, "RequestGroup", "priority", element.getPriorityElement(), -1);
10513    if (element.hasSubject())
10514      composeReference(t, "RequestGroup", "subject", element.getSubject(), -1);
10515    if (element.hasContext())
10516      composeReference(t, "RequestGroup", "context", element.getContext(), -1);
10517    if (element.hasAuthoredOnElement())
10518      composeDateTime(t, "RequestGroup", "authoredOn", element.getAuthoredOnElement(), -1);
10519    if (element.hasAuthor())
10520      composeReference(t, "RequestGroup", "author", element.getAuthor(), -1);
10521    if (element.hasReason())
10522      composeType(t, "RequestGroup", "reason", element.getReason(), -1);
10523    for (int i = 0; i < element.getNote().size(); i++)
10524      composeAnnotation(t, "RequestGroup", "note", element.getNote().get(i), i);
10525    for (int i = 0; i < element.getAction().size(); i++)
10526      composeRequestGroupRequestGroupActionComponent(t, "RequestGroup", "action", element.getAction().get(i), i);
10527  }
10528
10529  protected void composeRequestGroupRequestGroupActionComponent(Complex parent, String parentType, String name, RequestGroup.RequestGroupActionComponent element, int index) {
10530    if (element == null) 
10531      return;
10532    Complex t;
10533    if (Utilities.noString(parentType))
10534      t = parent;
10535    else {
10536      t = parent.predicate("fhir:"+parentType+'.'+name);
10537    }
10538    composeBackboneElement(t, "action", name, element, index);
10539    if (element.hasLabelElement())
10540      composeString(t, "RequestGroup", "label", element.getLabelElement(), -1);
10541    if (element.hasTitleElement())
10542      composeString(t, "RequestGroup", "title", element.getTitleElement(), -1);
10543    if (element.hasDescriptionElement())
10544      composeString(t, "RequestGroup", "description", element.getDescriptionElement(), -1);
10545    if (element.hasTextEquivalentElement())
10546      composeString(t, "RequestGroup", "textEquivalent", element.getTextEquivalentElement(), -1);
10547    for (int i = 0; i < element.getCode().size(); i++)
10548      composeCodeableConcept(t, "RequestGroup", "code", element.getCode().get(i), i);
10549    for (int i = 0; i < element.getDocumentation().size(); i++)
10550      composeRelatedArtifact(t, "RequestGroup", "documentation", element.getDocumentation().get(i), i);
10551    for (int i = 0; i < element.getCondition().size(); i++)
10552      composeRequestGroupRequestGroupActionConditionComponent(t, "RequestGroup", "condition", element.getCondition().get(i), i);
10553    for (int i = 0; i < element.getRelatedAction().size(); i++)
10554      composeRequestGroupRequestGroupActionRelatedActionComponent(t, "RequestGroup", "relatedAction", element.getRelatedAction().get(i), i);
10555    if (element.hasTiming())
10556      composeType(t, "RequestGroup", "timing", element.getTiming(), -1);
10557    for (int i = 0; i < element.getParticipant().size(); i++)
10558      composeReference(t, "RequestGroup", "participant", element.getParticipant().get(i), i);
10559    if (element.hasType())
10560      composeCoding(t, "RequestGroup", "type", element.getType(), -1);
10561    if (element.hasGroupingBehaviorElement())
10562      composeEnum(t, "RequestGroup", "groupingBehavior", element.getGroupingBehaviorElement(), -1);
10563    if (element.hasSelectionBehaviorElement())
10564      composeEnum(t, "RequestGroup", "selectionBehavior", element.getSelectionBehaviorElement(), -1);
10565    if (element.hasRequiredBehaviorElement())
10566      composeEnum(t, "RequestGroup", "requiredBehavior", element.getRequiredBehaviorElement(), -1);
10567    if (element.hasPrecheckBehaviorElement())
10568      composeEnum(t, "RequestGroup", "precheckBehavior", element.getPrecheckBehaviorElement(), -1);
10569    if (element.hasCardinalityBehaviorElement())
10570      composeEnum(t, "RequestGroup", "cardinalityBehavior", element.getCardinalityBehaviorElement(), -1);
10571    if (element.hasResource())
10572      composeReference(t, "RequestGroup", "resource", element.getResource(), -1);
10573    for (int i = 0; i < element.getAction().size(); i++)
10574      composeRequestGroupRequestGroupActionComponent(t, "RequestGroup", "action", element.getAction().get(i), i);
10575  }
10576
10577  protected void composeRequestGroupRequestGroupActionConditionComponent(Complex parent, String parentType, String name, RequestGroup.RequestGroupActionConditionComponent element, int index) {
10578    if (element == null) 
10579      return;
10580    Complex t;
10581    if (Utilities.noString(parentType))
10582      t = parent;
10583    else {
10584      t = parent.predicate("fhir:"+parentType+'.'+name);
10585    }
10586    composeBackboneElement(t, "condition", name, element, index);
10587    if (element.hasKindElement())
10588      composeEnum(t, "RequestGroup", "kind", element.getKindElement(), -1);
10589    if (element.hasDescriptionElement())
10590      composeString(t, "RequestGroup", "description", element.getDescriptionElement(), -1);
10591    if (element.hasLanguageElement())
10592      composeString(t, "RequestGroup", "language", element.getLanguageElement(), -1);
10593    if (element.hasExpressionElement())
10594      composeString(t, "RequestGroup", "expression", element.getExpressionElement(), -1);
10595  }
10596
10597  protected void composeRequestGroupRequestGroupActionRelatedActionComponent(Complex parent, String parentType, String name, RequestGroup.RequestGroupActionRelatedActionComponent element, int index) {
10598    if (element == null) 
10599      return;
10600    Complex t;
10601    if (Utilities.noString(parentType))
10602      t = parent;
10603    else {
10604      t = parent.predicate("fhir:"+parentType+'.'+name);
10605    }
10606    composeBackboneElement(t, "relatedAction", name, element, index);
10607    if (element.hasActionIdElement())
10608      composeId(t, "RequestGroup", "actionId", element.getActionIdElement(), -1);
10609    if (element.hasRelationshipElement())
10610      composeEnum(t, "RequestGroup", "relationship", element.getRelationshipElement(), -1);
10611    if (element.hasOffset())
10612      composeType(t, "RequestGroup", "offset", element.getOffset(), -1);
10613  }
10614
10615  protected void composeResearchStudy(Complex parent, String parentType, String name, ResearchStudy element, int index) {
10616    if (element == null) 
10617      return;
10618    Complex t;
10619    if (Utilities.noString(parentType))
10620      t = parent;
10621    else {
10622      t = parent.predicate("fhir:"+parentType+'.'+name);
10623    }
10624    composeDomainResource(t, "ResearchStudy", name, element, index);
10625    for (int i = 0; i < element.getIdentifier().size(); i++)
10626      composeIdentifier(t, "ResearchStudy", "identifier", element.getIdentifier().get(i), i);
10627    if (element.hasTitleElement())
10628      composeString(t, "ResearchStudy", "title", element.getTitleElement(), -1);
10629    for (int i = 0; i < element.getProtocol().size(); i++)
10630      composeReference(t, "ResearchStudy", "protocol", element.getProtocol().get(i), i);
10631    for (int i = 0; i < element.getPartOf().size(); i++)
10632      composeReference(t, "ResearchStudy", "partOf", element.getPartOf().get(i), i);
10633    if (element.hasStatusElement())
10634      composeEnum(t, "ResearchStudy", "status", element.getStatusElement(), -1);
10635    for (int i = 0; i < element.getCategory().size(); i++)
10636      composeCodeableConcept(t, "ResearchStudy", "category", element.getCategory().get(i), i);
10637    for (int i = 0; i < element.getFocus().size(); i++)
10638      composeCodeableConcept(t, "ResearchStudy", "focus", element.getFocus().get(i), i);
10639    for (int i = 0; i < element.getContact().size(); i++)
10640      composeContactDetail(t, "ResearchStudy", "contact", element.getContact().get(i), i);
10641    for (int i = 0; i < element.getRelatedArtifact().size(); i++)
10642      composeRelatedArtifact(t, "ResearchStudy", "relatedArtifact", element.getRelatedArtifact().get(i), i);
10643    for (int i = 0; i < element.getKeyword().size(); i++)
10644      composeCodeableConcept(t, "ResearchStudy", "keyword", element.getKeyword().get(i), i);
10645    for (int i = 0; i < element.getJurisdiction().size(); i++)
10646      composeCodeableConcept(t, "ResearchStudy", "jurisdiction", element.getJurisdiction().get(i), i);
10647    if (element.hasDescriptionElement())
10648      composeMarkdown(t, "ResearchStudy", "description", element.getDescriptionElement(), -1);
10649    for (int i = 0; i < element.getEnrollment().size(); i++)
10650      composeReference(t, "ResearchStudy", "enrollment", element.getEnrollment().get(i), i);
10651    if (element.hasPeriod())
10652      composePeriod(t, "ResearchStudy", "period", element.getPeriod(), -1);
10653    if (element.hasSponsor())
10654      composeReference(t, "ResearchStudy", "sponsor", element.getSponsor(), -1);
10655    if (element.hasPrincipalInvestigator())
10656      composeReference(t, "ResearchStudy", "principalInvestigator", element.getPrincipalInvestigator(), -1);
10657    for (int i = 0; i < element.getSite().size(); i++)
10658      composeReference(t, "ResearchStudy", "site", element.getSite().get(i), i);
10659    if (element.hasReasonStopped())
10660      composeCodeableConcept(t, "ResearchStudy", "reasonStopped", element.getReasonStopped(), -1);
10661    for (int i = 0; i < element.getNote().size(); i++)
10662      composeAnnotation(t, "ResearchStudy", "note", element.getNote().get(i), i);
10663    for (int i = 0; i < element.getArm().size(); i++)
10664      composeResearchStudyResearchStudyArmComponent(t, "ResearchStudy", "arm", element.getArm().get(i), i);
10665  }
10666
10667  protected void composeResearchStudyResearchStudyArmComponent(Complex parent, String parentType, String name, ResearchStudy.ResearchStudyArmComponent element, int index) {
10668    if (element == null) 
10669      return;
10670    Complex t;
10671    if (Utilities.noString(parentType))
10672      t = parent;
10673    else {
10674      t = parent.predicate("fhir:"+parentType+'.'+name);
10675    }
10676    composeBackboneElement(t, "arm", name, element, index);
10677    if (element.hasNameElement())
10678      composeString(t, "ResearchStudy", "name", element.getNameElement(), -1);
10679    if (element.hasCode())
10680      composeCodeableConcept(t, "ResearchStudy", "code", element.getCode(), -1);
10681    if (element.hasDescriptionElement())
10682      composeString(t, "ResearchStudy", "description", element.getDescriptionElement(), -1);
10683  }
10684
10685  protected void composeResearchSubject(Complex parent, String parentType, String name, ResearchSubject element, int index) {
10686    if (element == null) 
10687      return;
10688    Complex t;
10689    if (Utilities.noString(parentType))
10690      t = parent;
10691    else {
10692      t = parent.predicate("fhir:"+parentType+'.'+name);
10693    }
10694    composeDomainResource(t, "ResearchSubject", name, element, index);
10695    if (element.hasIdentifier())
10696      composeIdentifier(t, "ResearchSubject", "identifier", element.getIdentifier(), -1);
10697    if (element.hasStatusElement())
10698      composeEnum(t, "ResearchSubject", "status", element.getStatusElement(), -1);
10699    if (element.hasPeriod())
10700      composePeriod(t, "ResearchSubject", "period", element.getPeriod(), -1);
10701    if (element.hasStudy())
10702      composeReference(t, "ResearchSubject", "study", element.getStudy(), -1);
10703    if (element.hasIndividual())
10704      composeReference(t, "ResearchSubject", "individual", element.getIndividual(), -1);
10705    if (element.hasAssignedArmElement())
10706      composeString(t, "ResearchSubject", "assignedArm", element.getAssignedArmElement(), -1);
10707    if (element.hasActualArmElement())
10708      composeString(t, "ResearchSubject", "actualArm", element.getActualArmElement(), -1);
10709    if (element.hasConsent())
10710      composeReference(t, "ResearchSubject", "consent", element.getConsent(), -1);
10711  }
10712
10713  protected void composeRiskAssessment(Complex parent, String parentType, String name, RiskAssessment element, int index) {
10714    if (element == null) 
10715      return;
10716    Complex t;
10717    if (Utilities.noString(parentType))
10718      t = parent;
10719    else {
10720      t = parent.predicate("fhir:"+parentType+'.'+name);
10721    }
10722    composeDomainResource(t, "RiskAssessment", name, element, index);
10723    if (element.hasIdentifier())
10724      composeIdentifier(t, "RiskAssessment", "identifier", element.getIdentifier(), -1);
10725    if (element.hasBasedOn())
10726      composeReference(t, "RiskAssessment", "basedOn", element.getBasedOn(), -1);
10727    if (element.hasParent())
10728      composeReference(t, "RiskAssessment", "parent", element.getParent(), -1);
10729    if (element.hasStatusElement())
10730      composeEnum(t, "RiskAssessment", "status", element.getStatusElement(), -1);
10731    if (element.hasMethod())
10732      composeCodeableConcept(t, "RiskAssessment", "method", element.getMethod(), -1);
10733    if (element.hasCode())
10734      composeCodeableConcept(t, "RiskAssessment", "code", element.getCode(), -1);
10735    if (element.hasSubject())
10736      composeReference(t, "RiskAssessment", "subject", element.getSubject(), -1);
10737    if (element.hasContext())
10738      composeReference(t, "RiskAssessment", "context", element.getContext(), -1);
10739    if (element.hasOccurrence())
10740      composeType(t, "RiskAssessment", "occurrence", element.getOccurrence(), -1);
10741    if (element.hasCondition())
10742      composeReference(t, "RiskAssessment", "condition", element.getCondition(), -1);
10743    if (element.hasPerformer())
10744      composeReference(t, "RiskAssessment", "performer", element.getPerformer(), -1);
10745    if (element.hasReason())
10746      composeType(t, "RiskAssessment", "reason", element.getReason(), -1);
10747    for (int i = 0; i < element.getBasis().size(); i++)
10748      composeReference(t, "RiskAssessment", "basis", element.getBasis().get(i), i);
10749    for (int i = 0; i < element.getPrediction().size(); i++)
10750      composeRiskAssessmentRiskAssessmentPredictionComponent(t, "RiskAssessment", "prediction", element.getPrediction().get(i), i);
10751    if (element.hasMitigationElement())
10752      composeString(t, "RiskAssessment", "mitigation", element.getMitigationElement(), -1);
10753    if (element.hasCommentElement())
10754      composeString(t, "RiskAssessment", "comment", element.getCommentElement(), -1);
10755  }
10756
10757  protected void composeRiskAssessmentRiskAssessmentPredictionComponent(Complex parent, String parentType, String name, RiskAssessment.RiskAssessmentPredictionComponent element, int index) {
10758    if (element == null) 
10759      return;
10760    Complex t;
10761    if (Utilities.noString(parentType))
10762      t = parent;
10763    else {
10764      t = parent.predicate("fhir:"+parentType+'.'+name);
10765    }
10766    composeBackboneElement(t, "prediction", name, element, index);
10767    if (element.hasOutcome())
10768      composeCodeableConcept(t, "RiskAssessment", "outcome", element.getOutcome(), -1);
10769    if (element.hasProbability())
10770      composeType(t, "RiskAssessment", "probability", element.getProbability(), -1);
10771    if (element.hasQualitativeRisk())
10772      composeCodeableConcept(t, "RiskAssessment", "qualitativeRisk", element.getQualitativeRisk(), -1);
10773    if (element.hasRelativeRiskElement())
10774      composeDecimal(t, "RiskAssessment", "relativeRisk", element.getRelativeRiskElement(), -1);
10775    if (element.hasWhen())
10776      composeType(t, "RiskAssessment", "when", element.getWhen(), -1);
10777    if (element.hasRationaleElement())
10778      composeString(t, "RiskAssessment", "rationale", element.getRationaleElement(), -1);
10779  }
10780
10781  protected void composeSchedule(Complex parent, String parentType, String name, Schedule element, int index) {
10782    if (element == null) 
10783      return;
10784    Complex t;
10785    if (Utilities.noString(parentType))
10786      t = parent;
10787    else {
10788      t = parent.predicate("fhir:"+parentType+'.'+name);
10789    }
10790    composeDomainResource(t, "Schedule", name, element, index);
10791    for (int i = 0; i < element.getIdentifier().size(); i++)
10792      composeIdentifier(t, "Schedule", "identifier", element.getIdentifier().get(i), i);
10793    if (element.hasActiveElement())
10794      composeBoolean(t, "Schedule", "active", element.getActiveElement(), -1);
10795    if (element.hasServiceCategory())
10796      composeCodeableConcept(t, "Schedule", "serviceCategory", element.getServiceCategory(), -1);
10797    for (int i = 0; i < element.getServiceType().size(); i++)
10798      composeCodeableConcept(t, "Schedule", "serviceType", element.getServiceType().get(i), i);
10799    for (int i = 0; i < element.getSpecialty().size(); i++)
10800      composeCodeableConcept(t, "Schedule", "specialty", element.getSpecialty().get(i), i);
10801    for (int i = 0; i < element.getActor().size(); i++)
10802      composeReference(t, "Schedule", "actor", element.getActor().get(i), i);
10803    if (element.hasPlanningHorizon())
10804      composePeriod(t, "Schedule", "planningHorizon", element.getPlanningHorizon(), -1);
10805    if (element.hasCommentElement())
10806      composeString(t, "Schedule", "comment", element.getCommentElement(), -1);
10807  }
10808
10809  protected void composeSearchParameter(Complex parent, String parentType, String name, SearchParameter element, int index) {
10810    if (element == null) 
10811      return;
10812    Complex t;
10813    if (Utilities.noString(parentType))
10814      t = parent;
10815    else {
10816      t = parent.predicate("fhir:"+parentType+'.'+name);
10817    }
10818    composeDomainResource(t, "SearchParameter", name, element, index);
10819    if (element.hasUrlElement())
10820      composeUri(t, "SearchParameter", "url", element.getUrlElement(), -1);
10821    if (element.hasVersionElement())
10822      composeString(t, "SearchParameter", "version", element.getVersionElement(), -1);
10823    if (element.hasNameElement())
10824      composeString(t, "SearchParameter", "name", element.getNameElement(), -1);
10825    if (element.hasStatusElement())
10826      composeEnum(t, "SearchParameter", "status", element.getStatusElement(), -1);
10827    if (element.hasExperimentalElement())
10828      composeBoolean(t, "SearchParameter", "experimental", element.getExperimentalElement(), -1);
10829    if (element.hasDateElement())
10830      composeDateTime(t, "SearchParameter", "date", element.getDateElement(), -1);
10831    if (element.hasPublisherElement())
10832      composeString(t, "SearchParameter", "publisher", element.getPublisherElement(), -1);
10833    for (int i = 0; i < element.getContact().size(); i++)
10834      composeContactDetail(t, "SearchParameter", "contact", element.getContact().get(i), i);
10835    for (int i = 0; i < element.getUseContext().size(); i++)
10836      composeUsageContext(t, "SearchParameter", "useContext", element.getUseContext().get(i), i);
10837    for (int i = 0; i < element.getJurisdiction().size(); i++)
10838      composeCodeableConcept(t, "SearchParameter", "jurisdiction", element.getJurisdiction().get(i), i);
10839    if (element.hasPurposeElement())
10840      composeMarkdown(t, "SearchParameter", "purpose", element.getPurposeElement(), -1);
10841    if (element.hasCodeElement())
10842      composeCode(t, "SearchParameter", "code", element.getCodeElement(), -1);
10843    for (int i = 0; i < element.getBase().size(); i++)
10844      composeCode(t, "SearchParameter", "base", element.getBase().get(i), i);
10845    if (element.hasTypeElement())
10846      composeEnum(t, "SearchParameter", "type", element.getTypeElement(), -1);
10847    if (element.hasDerivedFromElement())
10848      composeUri(t, "SearchParameter", "derivedFrom", element.getDerivedFromElement(), -1);
10849    if (element.hasDescriptionElement())
10850      composeMarkdown(t, "SearchParameter", "description", element.getDescriptionElement(), -1);
10851    if (element.hasExpressionElement())
10852      composeString(t, "SearchParameter", "expression", element.getExpressionElement(), -1);
10853    if (element.hasXpathElement())
10854      composeString(t, "SearchParameter", "xpath", element.getXpathElement(), -1);
10855    if (element.hasXpathUsageElement())
10856      composeEnum(t, "SearchParameter", "xpathUsage", element.getXpathUsageElement(), -1);
10857    for (int i = 0; i < element.getTarget().size(); i++)
10858      composeCode(t, "SearchParameter", "target", element.getTarget().get(i), i);
10859    for (int i = 0; i < element.getComparator().size(); i++)
10860      composeEnum(t, "SearchParameter", "comparator", element.getComparator().get(i), i);
10861    for (int i = 0; i < element.getModifier().size(); i++)
10862      composeEnum(t, "SearchParameter", "modifier", element.getModifier().get(i), i);
10863    for (int i = 0; i < element.getChain().size(); i++)
10864      composeString(t, "SearchParameter", "chain", element.getChain().get(i), i);
10865    for (int i = 0; i < element.getComponent().size(); i++)
10866      composeSearchParameterSearchParameterComponentComponent(t, "SearchParameter", "component", element.getComponent().get(i), i);
10867  }
10868
10869  protected void composeSearchParameterSearchParameterComponentComponent(Complex parent, String parentType, String name, SearchParameter.SearchParameterComponentComponent element, int index) {
10870    if (element == null) 
10871      return;
10872    Complex t;
10873    if (Utilities.noString(parentType))
10874      t = parent;
10875    else {
10876      t = parent.predicate("fhir:"+parentType+'.'+name);
10877    }
10878    composeBackboneElement(t, "component", name, element, index);
10879    if (element.hasDefinition())
10880      composeReference(t, "SearchParameter", "definition", element.getDefinition(), -1);
10881    if (element.hasExpressionElement())
10882      composeString(t, "SearchParameter", "expression", element.getExpressionElement(), -1);
10883  }
10884
10885  protected void composeSequence(Complex parent, String parentType, String name, Sequence element, int index) {
10886    if (element == null) 
10887      return;
10888    Complex t;
10889    if (Utilities.noString(parentType))
10890      t = parent;
10891    else {
10892      t = parent.predicate("fhir:"+parentType+'.'+name);
10893    }
10894    composeDomainResource(t, "Sequence", name, element, index);
10895    for (int i = 0; i < element.getIdentifier().size(); i++)
10896      composeIdentifier(t, "Sequence", "identifier", element.getIdentifier().get(i), i);
10897    if (element.hasTypeElement())
10898      composeEnum(t, "Sequence", "type", element.getTypeElement(), -1);
10899    if (element.hasCoordinateSystemElement())
10900      composeInteger(t, "Sequence", "coordinateSystem", element.getCoordinateSystemElement(), -1);
10901    if (element.hasPatient())
10902      composeReference(t, "Sequence", "patient", element.getPatient(), -1);
10903    if (element.hasSpecimen())
10904      composeReference(t, "Sequence", "specimen", element.getSpecimen(), -1);
10905    if (element.hasDevice())
10906      composeReference(t, "Sequence", "device", element.getDevice(), -1);
10907    if (element.hasPerformer())
10908      composeReference(t, "Sequence", "performer", element.getPerformer(), -1);
10909    if (element.hasQuantity())
10910      composeQuantity(t, "Sequence", "quantity", element.getQuantity(), -1);
10911    if (element.hasReferenceSeq())
10912      composeSequenceSequenceReferenceSeqComponent(t, "Sequence", "referenceSeq", element.getReferenceSeq(), -1);
10913    for (int i = 0; i < element.getVariant().size(); i++)
10914      composeSequenceSequenceVariantComponent(t, "Sequence", "variant", element.getVariant().get(i), i);
10915    if (element.hasObservedSeqElement())
10916      composeString(t, "Sequence", "observedSeq", element.getObservedSeqElement(), -1);
10917    for (int i = 0; i < element.getQuality().size(); i++)
10918      composeSequenceSequenceQualityComponent(t, "Sequence", "quality", element.getQuality().get(i), i);
10919    if (element.hasReadCoverageElement())
10920      composeInteger(t, "Sequence", "readCoverage", element.getReadCoverageElement(), -1);
10921    for (int i = 0; i < element.getRepository().size(); i++)
10922      composeSequenceSequenceRepositoryComponent(t, "Sequence", "repository", element.getRepository().get(i), i);
10923    for (int i = 0; i < element.getPointer().size(); i++)
10924      composeReference(t, "Sequence", "pointer", element.getPointer().get(i), i);
10925  }
10926
10927  protected void composeSequenceSequenceReferenceSeqComponent(Complex parent, String parentType, String name, Sequence.SequenceReferenceSeqComponent element, int index) {
10928    if (element == null) 
10929      return;
10930    Complex t;
10931    if (Utilities.noString(parentType))
10932      t = parent;
10933    else {
10934      t = parent.predicate("fhir:"+parentType+'.'+name);
10935    }
10936    composeBackboneElement(t, "referenceSeq", name, element, index);
10937    if (element.hasChromosome())
10938      composeCodeableConcept(t, "Sequence", "chromosome", element.getChromosome(), -1);
10939    if (element.hasGenomeBuildElement())
10940      composeString(t, "Sequence", "genomeBuild", element.getGenomeBuildElement(), -1);
10941    if (element.hasReferenceSeqId())
10942      composeCodeableConcept(t, "Sequence", "referenceSeqId", element.getReferenceSeqId(), -1);
10943    if (element.hasReferenceSeqPointer())
10944      composeReference(t, "Sequence", "referenceSeqPointer", element.getReferenceSeqPointer(), -1);
10945    if (element.hasReferenceSeqStringElement())
10946      composeString(t, "Sequence", "referenceSeqString", element.getReferenceSeqStringElement(), -1);
10947    if (element.hasStrandElement())
10948      composeInteger(t, "Sequence", "strand", element.getStrandElement(), -1);
10949    if (element.hasWindowStartElement())
10950      composeInteger(t, "Sequence", "windowStart", element.getWindowStartElement(), -1);
10951    if (element.hasWindowEndElement())
10952      composeInteger(t, "Sequence", "windowEnd", element.getWindowEndElement(), -1);
10953  }
10954
10955  protected void composeSequenceSequenceVariantComponent(Complex parent, String parentType, String name, Sequence.SequenceVariantComponent element, int index) {
10956    if (element == null) 
10957      return;
10958    Complex t;
10959    if (Utilities.noString(parentType))
10960      t = parent;
10961    else {
10962      t = parent.predicate("fhir:"+parentType+'.'+name);
10963    }
10964    composeBackboneElement(t, "variant", name, element, index);
10965    if (element.hasStartElement())
10966      composeInteger(t, "Sequence", "start", element.getStartElement(), -1);
10967    if (element.hasEndElement())
10968      composeInteger(t, "Sequence", "end", element.getEndElement(), -1);
10969    if (element.hasObservedAlleleElement())
10970      composeString(t, "Sequence", "observedAllele", element.getObservedAlleleElement(), -1);
10971    if (element.hasReferenceAlleleElement())
10972      composeString(t, "Sequence", "referenceAllele", element.getReferenceAlleleElement(), -1);
10973    if (element.hasCigarElement())
10974      composeString(t, "Sequence", "cigar", element.getCigarElement(), -1);
10975    if (element.hasVariantPointer())
10976      composeReference(t, "Sequence", "variantPointer", element.getVariantPointer(), -1);
10977  }
10978
10979  protected void composeSequenceSequenceQualityComponent(Complex parent, String parentType, String name, Sequence.SequenceQualityComponent element, int index) {
10980    if (element == null) 
10981      return;
10982    Complex t;
10983    if (Utilities.noString(parentType))
10984      t = parent;
10985    else {
10986      t = parent.predicate("fhir:"+parentType+'.'+name);
10987    }
10988    composeBackboneElement(t, "quality", name, element, index);
10989    if (element.hasTypeElement())
10990      composeEnum(t, "Sequence", "type", element.getTypeElement(), -1);
10991    if (element.hasStandardSequence())
10992      composeCodeableConcept(t, "Sequence", "standardSequence", element.getStandardSequence(), -1);
10993    if (element.hasStartElement())
10994      composeInteger(t, "Sequence", "start", element.getStartElement(), -1);
10995    if (element.hasEndElement())
10996      composeInteger(t, "Sequence", "end", element.getEndElement(), -1);
10997    if (element.hasScore())
10998      composeQuantity(t, "Sequence", "score", element.getScore(), -1);
10999    if (element.hasMethod())
11000      composeCodeableConcept(t, "Sequence", "method", element.getMethod(), -1);
11001    if (element.hasTruthTPElement())
11002      composeDecimal(t, "Sequence", "truthTP", element.getTruthTPElement(), -1);
11003    if (element.hasQueryTPElement())
11004      composeDecimal(t, "Sequence", "queryTP", element.getQueryTPElement(), -1);
11005    if (element.hasTruthFNElement())
11006      composeDecimal(t, "Sequence", "truthFN", element.getTruthFNElement(), -1);
11007    if (element.hasQueryFPElement())
11008      composeDecimal(t, "Sequence", "queryFP", element.getQueryFPElement(), -1);
11009    if (element.hasGtFPElement())
11010      composeDecimal(t, "Sequence", "gtFP", element.getGtFPElement(), -1);
11011    if (element.hasPrecisionElement())
11012      composeDecimal(t, "Sequence", "precision", element.getPrecisionElement(), -1);
11013    if (element.hasRecallElement())
11014      composeDecimal(t, "Sequence", "recall", element.getRecallElement(), -1);
11015    if (element.hasFScoreElement())
11016      composeDecimal(t, "Sequence", "fScore", element.getFScoreElement(), -1);
11017  }
11018
11019  protected void composeSequenceSequenceRepositoryComponent(Complex parent, String parentType, String name, Sequence.SequenceRepositoryComponent element, int index) {
11020    if (element == null) 
11021      return;
11022    Complex t;
11023    if (Utilities.noString(parentType))
11024      t = parent;
11025    else {
11026      t = parent.predicate("fhir:"+parentType+'.'+name);
11027    }
11028    composeBackboneElement(t, "repository", name, element, index);
11029    if (element.hasTypeElement())
11030      composeEnum(t, "Sequence", "type", element.getTypeElement(), -1);
11031    if (element.hasUrlElement())
11032      composeUri(t, "Sequence", "url", element.getUrlElement(), -1);
11033    if (element.hasNameElement())
11034      composeString(t, "Sequence", "name", element.getNameElement(), -1);
11035    if (element.hasDatasetIdElement())
11036      composeString(t, "Sequence", "datasetId", element.getDatasetIdElement(), -1);
11037    if (element.hasVariantsetIdElement())
11038      composeString(t, "Sequence", "variantsetId", element.getVariantsetIdElement(), -1);
11039    if (element.hasReadsetIdElement())
11040      composeString(t, "Sequence", "readsetId", element.getReadsetIdElement(), -1);
11041  }
11042
11043  protected void composeServiceDefinition(Complex parent, String parentType, String name, ServiceDefinition element, int index) {
11044    if (element == null) 
11045      return;
11046    Complex t;
11047    if (Utilities.noString(parentType))
11048      t = parent;
11049    else {
11050      t = parent.predicate("fhir:"+parentType+'.'+name);
11051    }
11052    composeDomainResource(t, "ServiceDefinition", name, element, index);
11053    if (element.hasUrlElement())
11054      composeUri(t, "ServiceDefinition", "url", element.getUrlElement(), -1);
11055    for (int i = 0; i < element.getIdentifier().size(); i++)
11056      composeIdentifier(t, "ServiceDefinition", "identifier", element.getIdentifier().get(i), i);
11057    if (element.hasVersionElement())
11058      composeString(t, "ServiceDefinition", "version", element.getVersionElement(), -1);
11059    if (element.hasNameElement())
11060      composeString(t, "ServiceDefinition", "name", element.getNameElement(), -1);
11061    if (element.hasTitleElement())
11062      composeString(t, "ServiceDefinition", "title", element.getTitleElement(), -1);
11063    if (element.hasStatusElement())
11064      composeEnum(t, "ServiceDefinition", "status", element.getStatusElement(), -1);
11065    if (element.hasExperimentalElement())
11066      composeBoolean(t, "ServiceDefinition", "experimental", element.getExperimentalElement(), -1);
11067    if (element.hasDateElement())
11068      composeDateTime(t, "ServiceDefinition", "date", element.getDateElement(), -1);
11069    if (element.hasPublisherElement())
11070      composeString(t, "ServiceDefinition", "publisher", element.getPublisherElement(), -1);
11071    if (element.hasDescriptionElement())
11072      composeMarkdown(t, "ServiceDefinition", "description", element.getDescriptionElement(), -1);
11073    if (element.hasPurposeElement())
11074      composeMarkdown(t, "ServiceDefinition", "purpose", element.getPurposeElement(), -1);
11075    if (element.hasUsageElement())
11076      composeString(t, "ServiceDefinition", "usage", element.getUsageElement(), -1);
11077    if (element.hasApprovalDateElement())
11078      composeDate(t, "ServiceDefinition", "approvalDate", element.getApprovalDateElement(), -1);
11079    if (element.hasLastReviewDateElement())
11080      composeDate(t, "ServiceDefinition", "lastReviewDate", element.getLastReviewDateElement(), -1);
11081    if (element.hasEffectivePeriod())
11082      composePeriod(t, "ServiceDefinition", "effectivePeriod", element.getEffectivePeriod(), -1);
11083    for (int i = 0; i < element.getUseContext().size(); i++)
11084      composeUsageContext(t, "ServiceDefinition", "useContext", element.getUseContext().get(i), i);
11085    for (int i = 0; i < element.getJurisdiction().size(); i++)
11086      composeCodeableConcept(t, "ServiceDefinition", "jurisdiction", element.getJurisdiction().get(i), i);
11087    for (int i = 0; i < element.getTopic().size(); i++)
11088      composeCodeableConcept(t, "ServiceDefinition", "topic", element.getTopic().get(i), i);
11089    for (int i = 0; i < element.getContributor().size(); i++)
11090      composeContributor(t, "ServiceDefinition", "contributor", element.getContributor().get(i), i);
11091    for (int i = 0; i < element.getContact().size(); i++)
11092      composeContactDetail(t, "ServiceDefinition", "contact", element.getContact().get(i), i);
11093    if (element.hasCopyrightElement())
11094      composeMarkdown(t, "ServiceDefinition", "copyright", element.getCopyrightElement(), -1);
11095    for (int i = 0; i < element.getRelatedArtifact().size(); i++)
11096      composeRelatedArtifact(t, "ServiceDefinition", "relatedArtifact", element.getRelatedArtifact().get(i), i);
11097    for (int i = 0; i < element.getTrigger().size(); i++)
11098      composeTriggerDefinition(t, "ServiceDefinition", "trigger", element.getTrigger().get(i), i);
11099    for (int i = 0; i < element.getDataRequirement().size(); i++)
11100      composeDataRequirement(t, "ServiceDefinition", "dataRequirement", element.getDataRequirement().get(i), i);
11101    if (element.hasOperationDefinition())
11102      composeReference(t, "ServiceDefinition", "operationDefinition", element.getOperationDefinition(), -1);
11103  }
11104
11105  protected void composeSlot(Complex parent, String parentType, String name, Slot element, int index) {
11106    if (element == null) 
11107      return;
11108    Complex t;
11109    if (Utilities.noString(parentType))
11110      t = parent;
11111    else {
11112      t = parent.predicate("fhir:"+parentType+'.'+name);
11113    }
11114    composeDomainResource(t, "Slot", name, element, index);
11115    for (int i = 0; i < element.getIdentifier().size(); i++)
11116      composeIdentifier(t, "Slot", "identifier", element.getIdentifier().get(i), i);
11117    if (element.hasServiceCategory())
11118      composeCodeableConcept(t, "Slot", "serviceCategory", element.getServiceCategory(), -1);
11119    for (int i = 0; i < element.getServiceType().size(); i++)
11120      composeCodeableConcept(t, "Slot", "serviceType", element.getServiceType().get(i), i);
11121    for (int i = 0; i < element.getSpecialty().size(); i++)
11122      composeCodeableConcept(t, "Slot", "specialty", element.getSpecialty().get(i), i);
11123    if (element.hasAppointmentType())
11124      composeCodeableConcept(t, "Slot", "appointmentType", element.getAppointmentType(), -1);
11125    if (element.hasSchedule())
11126      composeReference(t, "Slot", "schedule", element.getSchedule(), -1);
11127    if (element.hasStatusElement())
11128      composeEnum(t, "Slot", "status", element.getStatusElement(), -1);
11129    if (element.hasStartElement())
11130      composeInstant(t, "Slot", "start", element.getStartElement(), -1);
11131    if (element.hasEndElement())
11132      composeInstant(t, "Slot", "end", element.getEndElement(), -1);
11133    if (element.hasOverbookedElement())
11134      composeBoolean(t, "Slot", "overbooked", element.getOverbookedElement(), -1);
11135    if (element.hasCommentElement())
11136      composeString(t, "Slot", "comment", element.getCommentElement(), -1);
11137  }
11138
11139  protected void composeSpecimen(Complex parent, String parentType, String name, Specimen element, int index) {
11140    if (element == null) 
11141      return;
11142    Complex t;
11143    if (Utilities.noString(parentType))
11144      t = parent;
11145    else {
11146      t = parent.predicate("fhir:"+parentType+'.'+name);
11147    }
11148    composeDomainResource(t, "Specimen", name, element, index);
11149    for (int i = 0; i < element.getIdentifier().size(); i++)
11150      composeIdentifier(t, "Specimen", "identifier", element.getIdentifier().get(i), i);
11151    if (element.hasAccessionIdentifier())
11152      composeIdentifier(t, "Specimen", "accessionIdentifier", element.getAccessionIdentifier(), -1);
11153    if (element.hasStatusElement())
11154      composeEnum(t, "Specimen", "status", element.getStatusElement(), -1);
11155    if (element.hasType())
11156      composeCodeableConcept(t, "Specimen", "type", element.getType(), -1);
11157    if (element.hasSubject())
11158      composeReference(t, "Specimen", "subject", element.getSubject(), -1);
11159    if (element.hasReceivedTimeElement())
11160      composeDateTime(t, "Specimen", "receivedTime", element.getReceivedTimeElement(), -1);
11161    for (int i = 0; i < element.getParent().size(); i++)
11162      composeReference(t, "Specimen", "parent", element.getParent().get(i), i);
11163    for (int i = 0; i < element.getRequest().size(); i++)
11164      composeReference(t, "Specimen", "request", element.getRequest().get(i), i);
11165    if (element.hasCollection())
11166      composeSpecimenSpecimenCollectionComponent(t, "Specimen", "collection", element.getCollection(), -1);
11167    for (int i = 0; i < element.getProcessing().size(); i++)
11168      composeSpecimenSpecimenProcessingComponent(t, "Specimen", "processing", element.getProcessing().get(i), i);
11169    for (int i = 0; i < element.getContainer().size(); i++)
11170      composeSpecimenSpecimenContainerComponent(t, "Specimen", "container", element.getContainer().get(i), i);
11171    for (int i = 0; i < element.getNote().size(); i++)
11172      composeAnnotation(t, "Specimen", "note", element.getNote().get(i), i);
11173  }
11174
11175  protected void composeSpecimenSpecimenCollectionComponent(Complex parent, String parentType, String name, Specimen.SpecimenCollectionComponent element, int index) {
11176    if (element == null) 
11177      return;
11178    Complex t;
11179    if (Utilities.noString(parentType))
11180      t = parent;
11181    else {
11182      t = parent.predicate("fhir:"+parentType+'.'+name);
11183    }
11184    composeBackboneElement(t, "collection", name, element, index);
11185    if (element.hasCollector())
11186      composeReference(t, "Specimen", "collector", element.getCollector(), -1);
11187    if (element.hasCollected())
11188      composeType(t, "Specimen", "collected", element.getCollected(), -1);
11189    if (element.hasQuantity())
11190      composeQuantity(t, "Specimen", "quantity", element.getQuantity(), -1);
11191    if (element.hasMethod())
11192      composeCodeableConcept(t, "Specimen", "method", element.getMethod(), -1);
11193    if (element.hasBodySite())
11194      composeCodeableConcept(t, "Specimen", "bodySite", element.getBodySite(), -1);
11195  }
11196
11197  protected void composeSpecimenSpecimenProcessingComponent(Complex parent, String parentType, String name, Specimen.SpecimenProcessingComponent element, int index) {
11198    if (element == null) 
11199      return;
11200    Complex t;
11201    if (Utilities.noString(parentType))
11202      t = parent;
11203    else {
11204      t = parent.predicate("fhir:"+parentType+'.'+name);
11205    }
11206    composeBackboneElement(t, "processing", name, element, index);
11207    if (element.hasDescriptionElement())
11208      composeString(t, "Specimen", "description", element.getDescriptionElement(), -1);
11209    if (element.hasProcedure())
11210      composeCodeableConcept(t, "Specimen", "procedure", element.getProcedure(), -1);
11211    for (int i = 0; i < element.getAdditive().size(); i++)
11212      composeReference(t, "Specimen", "additive", element.getAdditive().get(i), i);
11213    if (element.hasTime())
11214      composeType(t, "Specimen", "time", element.getTime(), -1);
11215  }
11216
11217  protected void composeSpecimenSpecimenContainerComponent(Complex parent, String parentType, String name, Specimen.SpecimenContainerComponent element, int index) {
11218    if (element == null) 
11219      return;
11220    Complex t;
11221    if (Utilities.noString(parentType))
11222      t = parent;
11223    else {
11224      t = parent.predicate("fhir:"+parentType+'.'+name);
11225    }
11226    composeBackboneElement(t, "container", name, element, index);
11227    for (int i = 0; i < element.getIdentifier().size(); i++)
11228      composeIdentifier(t, "Specimen", "identifier", element.getIdentifier().get(i), i);
11229    if (element.hasDescriptionElement())
11230      composeString(t, "Specimen", "description", element.getDescriptionElement(), -1);
11231    if (element.hasType())
11232      composeCodeableConcept(t, "Specimen", "type", element.getType(), -1);
11233    if (element.hasCapacity())
11234      composeQuantity(t, "Specimen", "capacity", element.getCapacity(), -1);
11235    if (element.hasSpecimenQuantity())
11236      composeQuantity(t, "Specimen", "specimenQuantity", element.getSpecimenQuantity(), -1);
11237    if (element.hasAdditive())
11238      composeType(t, "Specimen", "additive", element.getAdditive(), -1);
11239  }
11240
11241  protected void composeStructureDefinition(Complex parent, String parentType, String name, StructureDefinition element, int index) {
11242    if (element == null) 
11243      return;
11244    Complex t;
11245    if (Utilities.noString(parentType))
11246      t = parent;
11247    else {
11248      t = parent.predicate("fhir:"+parentType+'.'+name);
11249    }
11250    composeDomainResource(t, "StructureDefinition", name, element, index);
11251    if (element.hasUrlElement())
11252      composeUri(t, "StructureDefinition", "url", element.getUrlElement(), -1);
11253    for (int i = 0; i < element.getIdentifier().size(); i++)
11254      composeIdentifier(t, "StructureDefinition", "identifier", element.getIdentifier().get(i), i);
11255    if (element.hasVersionElement())
11256      composeString(t, "StructureDefinition", "version", element.getVersionElement(), -1);
11257    if (element.hasNameElement())
11258      composeString(t, "StructureDefinition", "name", element.getNameElement(), -1);
11259    if (element.hasTitleElement())
11260      composeString(t, "StructureDefinition", "title", element.getTitleElement(), -1);
11261    if (element.hasStatusElement())
11262      composeEnum(t, "StructureDefinition", "status", element.getStatusElement(), -1);
11263    if (element.hasExperimentalElement())
11264      composeBoolean(t, "StructureDefinition", "experimental", element.getExperimentalElement(), -1);
11265    if (element.hasDateElement())
11266      composeDateTime(t, "StructureDefinition", "date", element.getDateElement(), -1);
11267    if (element.hasPublisherElement())
11268      composeString(t, "StructureDefinition", "publisher", element.getPublisherElement(), -1);
11269    for (int i = 0; i < element.getContact().size(); i++)
11270      composeContactDetail(t, "StructureDefinition", "contact", element.getContact().get(i), i);
11271    if (element.hasDescriptionElement())
11272      composeMarkdown(t, "StructureDefinition", "description", element.getDescriptionElement(), -1);
11273    for (int i = 0; i < element.getUseContext().size(); i++)
11274      composeUsageContext(t, "StructureDefinition", "useContext", element.getUseContext().get(i), i);
11275    for (int i = 0; i < element.getJurisdiction().size(); i++)
11276      composeCodeableConcept(t, "StructureDefinition", "jurisdiction", element.getJurisdiction().get(i), i);
11277    if (element.hasPurposeElement())
11278      composeMarkdown(t, "StructureDefinition", "purpose", element.getPurposeElement(), -1);
11279    if (element.hasCopyrightElement())
11280      composeMarkdown(t, "StructureDefinition", "copyright", element.getCopyrightElement(), -1);
11281    for (int i = 0; i < element.getKeyword().size(); i++)
11282      composeCoding(t, "StructureDefinition", "keyword", element.getKeyword().get(i), i);
11283    if (element.hasFhirVersionElement())
11284      composeId(t, "StructureDefinition", "fhirVersion", element.getFhirVersionElement(), -1);
11285    for (int i = 0; i < element.getMapping().size(); i++)
11286      composeStructureDefinitionStructureDefinitionMappingComponent(t, "StructureDefinition", "mapping", element.getMapping().get(i), i);
11287    if (element.hasKindElement())
11288      composeEnum(t, "StructureDefinition", "kind", element.getKindElement(), -1);
11289    if (element.hasAbstractElement())
11290      composeBoolean(t, "StructureDefinition", "abstract", element.getAbstractElement(), -1);
11291    if (element.hasContextTypeElement())
11292      composeEnum(t, "StructureDefinition", "contextType", element.getContextTypeElement(), -1);
11293    for (int i = 0; i < element.getContext().size(); i++)
11294      composeString(t, "StructureDefinition", "context", element.getContext().get(i), i);
11295    for (int i = 0; i < element.getContextInvariant().size(); i++)
11296      composeString(t, "StructureDefinition", "contextInvariant", element.getContextInvariant().get(i), i);
11297    if (element.hasTypeElement())
11298      composeCode(t, "StructureDefinition", "type", element.getTypeElement(), -1);
11299    if (element.hasBaseDefinitionElement())
11300      composeUri(t, "StructureDefinition", "baseDefinition", element.getBaseDefinitionElement(), -1);
11301    if (element.hasDerivationElement())
11302      composeEnum(t, "StructureDefinition", "derivation", element.getDerivationElement(), -1);
11303    if (element.hasSnapshot())
11304      composeStructureDefinitionStructureDefinitionSnapshotComponent(t, "StructureDefinition", "snapshot", element.getSnapshot(), -1);
11305    if (element.hasDifferential())
11306      composeStructureDefinitionStructureDefinitionDifferentialComponent(t, "StructureDefinition", "differential", element.getDifferential(), -1);
11307  }
11308
11309  protected void composeStructureDefinitionStructureDefinitionMappingComponent(Complex parent, String parentType, String name, StructureDefinition.StructureDefinitionMappingComponent element, int index) {
11310    if (element == null) 
11311      return;
11312    Complex t;
11313    if (Utilities.noString(parentType))
11314      t = parent;
11315    else {
11316      t = parent.predicate("fhir:"+parentType+'.'+name);
11317    }
11318    composeBackboneElement(t, "mapping", name, element, index);
11319    if (element.hasIdentityElement())
11320      composeId(t, "StructureDefinition", "identity", element.getIdentityElement(), -1);
11321    if (element.hasUriElement())
11322      composeUri(t, "StructureDefinition", "uri", element.getUriElement(), -1);
11323    if (element.hasNameElement())
11324      composeString(t, "StructureDefinition", "name", element.getNameElement(), -1);
11325    if (element.hasCommentElement())
11326      composeString(t, "StructureDefinition", "comment", element.getCommentElement(), -1);
11327  }
11328
11329  protected void composeStructureDefinitionStructureDefinitionSnapshotComponent(Complex parent, String parentType, String name, StructureDefinition.StructureDefinitionSnapshotComponent element, int index) {
11330    if (element == null) 
11331      return;
11332    Complex t;
11333    if (Utilities.noString(parentType))
11334      t = parent;
11335    else {
11336      t = parent.predicate("fhir:"+parentType+'.'+name);
11337    }
11338    composeBackboneElement(t, "snapshot", name, element, index);
11339    for (int i = 0; i < element.getElement().size(); i++)
11340      composeElementDefinition(t, "StructureDefinition", "element", element.getElement().get(i), i);
11341  }
11342
11343  protected void composeStructureDefinitionStructureDefinitionDifferentialComponent(Complex parent, String parentType, String name, StructureDefinition.StructureDefinitionDifferentialComponent element, int index) {
11344    if (element == null) 
11345      return;
11346    Complex t;
11347    if (Utilities.noString(parentType))
11348      t = parent;
11349    else {
11350      t = parent.predicate("fhir:"+parentType+'.'+name);
11351    }
11352    composeBackboneElement(t, "differential", name, element, index);
11353    for (int i = 0; i < element.getElement().size(); i++)
11354      composeElementDefinition(t, "StructureDefinition", "element", element.getElement().get(i), i);
11355  }
11356
11357  protected void composeStructureMap(Complex parent, String parentType, String name, StructureMap element, int index) {
11358    if (element == null) 
11359      return;
11360    Complex t;
11361    if (Utilities.noString(parentType))
11362      t = parent;
11363    else {
11364      t = parent.predicate("fhir:"+parentType+'.'+name);
11365    }
11366    composeDomainResource(t, "StructureMap", name, element, index);
11367    if (element.hasUrlElement())
11368      composeUri(t, "StructureMap", "url", element.getUrlElement(), -1);
11369    for (int i = 0; i < element.getIdentifier().size(); i++)
11370      composeIdentifier(t, "StructureMap", "identifier", element.getIdentifier().get(i), i);
11371    if (element.hasVersionElement())
11372      composeString(t, "StructureMap", "version", element.getVersionElement(), -1);
11373    if (element.hasNameElement())
11374      composeString(t, "StructureMap", "name", element.getNameElement(), -1);
11375    if (element.hasTitleElement())
11376      composeString(t, "StructureMap", "title", element.getTitleElement(), -1);
11377    if (element.hasStatusElement())
11378      composeEnum(t, "StructureMap", "status", element.getStatusElement(), -1);
11379    if (element.hasExperimentalElement())
11380      composeBoolean(t, "StructureMap", "experimental", element.getExperimentalElement(), -1);
11381    if (element.hasDateElement())
11382      composeDateTime(t, "StructureMap", "date", element.getDateElement(), -1);
11383    if (element.hasPublisherElement())
11384      composeString(t, "StructureMap", "publisher", element.getPublisherElement(), -1);
11385    for (int i = 0; i < element.getContact().size(); i++)
11386      composeContactDetail(t, "StructureMap", "contact", element.getContact().get(i), i);
11387    if (element.hasDescriptionElement())
11388      composeMarkdown(t, "StructureMap", "description", element.getDescriptionElement(), -1);
11389    for (int i = 0; i < element.getUseContext().size(); i++)
11390      composeUsageContext(t, "StructureMap", "useContext", element.getUseContext().get(i), i);
11391    for (int i = 0; i < element.getJurisdiction().size(); i++)
11392      composeCodeableConcept(t, "StructureMap", "jurisdiction", element.getJurisdiction().get(i), i);
11393    if (element.hasPurposeElement())
11394      composeMarkdown(t, "StructureMap", "purpose", element.getPurposeElement(), -1);
11395    if (element.hasCopyrightElement())
11396      composeMarkdown(t, "StructureMap", "copyright", element.getCopyrightElement(), -1);
11397    for (int i = 0; i < element.getStructure().size(); i++)
11398      composeStructureMapStructureMapStructureComponent(t, "StructureMap", "structure", element.getStructure().get(i), i);
11399    for (int i = 0; i < element.getImport().size(); i++)
11400      composeUri(t, "StructureMap", "import", element.getImport().get(i), i);
11401    for (int i = 0; i < element.getGroup().size(); i++)
11402      composeStructureMapStructureMapGroupComponent(t, "StructureMap", "group", element.getGroup().get(i), i);
11403  }
11404
11405  protected void composeStructureMapStructureMapStructureComponent(Complex parent, String parentType, String name, StructureMap.StructureMapStructureComponent element, int index) {
11406    if (element == null) 
11407      return;
11408    Complex t;
11409    if (Utilities.noString(parentType))
11410      t = parent;
11411    else {
11412      t = parent.predicate("fhir:"+parentType+'.'+name);
11413    }
11414    composeBackboneElement(t, "structure", name, element, index);
11415    if (element.hasUrlElement())
11416      composeUri(t, "StructureMap", "url", element.getUrlElement(), -1);
11417    if (element.hasModeElement())
11418      composeEnum(t, "StructureMap", "mode", element.getModeElement(), -1);
11419    if (element.hasAliasElement())
11420      composeString(t, "StructureMap", "alias", element.getAliasElement(), -1);
11421    if (element.hasDocumentationElement())
11422      composeString(t, "StructureMap", "documentation", element.getDocumentationElement(), -1);
11423  }
11424
11425  protected void composeStructureMapStructureMapGroupComponent(Complex parent, String parentType, String name, StructureMap.StructureMapGroupComponent element, int index) {
11426    if (element == null) 
11427      return;
11428    Complex t;
11429    if (Utilities.noString(parentType))
11430      t = parent;
11431    else {
11432      t = parent.predicate("fhir:"+parentType+'.'+name);
11433    }
11434    composeBackboneElement(t, "group", name, element, index);
11435    if (element.hasNameElement())
11436      composeId(t, "StructureMap", "name", element.getNameElement(), -1);
11437    if (element.hasExtendsElement())
11438      composeId(t, "StructureMap", "extends", element.getExtendsElement(), -1);
11439    if (element.hasTypeModeElement())
11440      composeEnum(t, "StructureMap", "typeMode", element.getTypeModeElement(), -1);
11441    if (element.hasDocumentationElement())
11442      composeString(t, "StructureMap", "documentation", element.getDocumentationElement(), -1);
11443    for (int i = 0; i < element.getInput().size(); i++)
11444      composeStructureMapStructureMapGroupInputComponent(t, "StructureMap", "input", element.getInput().get(i), i);
11445    for (int i = 0; i < element.getRule().size(); i++)
11446      composeStructureMapStructureMapGroupRuleComponent(t, "StructureMap", "rule", element.getRule().get(i), i);
11447  }
11448
11449  protected void composeStructureMapStructureMapGroupInputComponent(Complex parent, String parentType, String name, StructureMap.StructureMapGroupInputComponent element, int index) {
11450    if (element == null) 
11451      return;
11452    Complex t;
11453    if (Utilities.noString(parentType))
11454      t = parent;
11455    else {
11456      t = parent.predicate("fhir:"+parentType+'.'+name);
11457    }
11458    composeBackboneElement(t, "input", name, element, index);
11459    if (element.hasNameElement())
11460      composeId(t, "StructureMap", "name", element.getNameElement(), -1);
11461    if (element.hasTypeElement())
11462      composeString(t, "StructureMap", "type", element.getTypeElement(), -1);
11463    if (element.hasModeElement())
11464      composeEnum(t, "StructureMap", "mode", element.getModeElement(), -1);
11465    if (element.hasDocumentationElement())
11466      composeString(t, "StructureMap", "documentation", element.getDocumentationElement(), -1);
11467  }
11468
11469  protected void composeStructureMapStructureMapGroupRuleComponent(Complex parent, String parentType, String name, StructureMap.StructureMapGroupRuleComponent element, int index) {
11470    if (element == null) 
11471      return;
11472    Complex t;
11473    if (Utilities.noString(parentType))
11474      t = parent;
11475    else {
11476      t = parent.predicate("fhir:"+parentType+'.'+name);
11477    }
11478    composeBackboneElement(t, "rule", name, element, index);
11479    if (element.hasNameElement())
11480      composeId(t, "StructureMap", "name", element.getNameElement(), -1);
11481    for (int i = 0; i < element.getSource().size(); i++)
11482      composeStructureMapStructureMapGroupRuleSourceComponent(t, "StructureMap", "source", element.getSource().get(i), i);
11483    for (int i = 0; i < element.getTarget().size(); i++)
11484      composeStructureMapStructureMapGroupRuleTargetComponent(t, "StructureMap", "target", element.getTarget().get(i), i);
11485    for (int i = 0; i < element.getRule().size(); i++)
11486      composeStructureMapStructureMapGroupRuleComponent(t, "StructureMap", "rule", element.getRule().get(i), i);
11487    for (int i = 0; i < element.getDependent().size(); i++)
11488      composeStructureMapStructureMapGroupRuleDependentComponent(t, "StructureMap", "dependent", element.getDependent().get(i), i);
11489    if (element.hasDocumentationElement())
11490      composeString(t, "StructureMap", "documentation", element.getDocumentationElement(), -1);
11491  }
11492
11493  protected void composeStructureMapStructureMapGroupRuleSourceComponent(Complex parent, String parentType, String name, StructureMap.StructureMapGroupRuleSourceComponent element, int index) {
11494    if (element == null) 
11495      return;
11496    Complex t;
11497    if (Utilities.noString(parentType))
11498      t = parent;
11499    else {
11500      t = parent.predicate("fhir:"+parentType+'.'+name);
11501    }
11502    composeBackboneElement(t, "source", name, element, index);
11503    if (element.hasContextElement())
11504      composeId(t, "StructureMap", "context", element.getContextElement(), -1);
11505    if (element.hasMinElement())
11506      composeInteger(t, "StructureMap", "min", element.getMinElement(), -1);
11507    if (element.hasMaxElement())
11508      composeString(t, "StructureMap", "max", element.getMaxElement(), -1);
11509    if (element.hasTypeElement())
11510      composeString(t, "StructureMap", "type", element.getTypeElement(), -1);
11511    if (element.hasDefaultValue())
11512      composeType(t, "StructureMap", "defaultValue", element.getDefaultValue(), -1);
11513    if (element.hasElementElement())
11514      composeString(t, "StructureMap", "element", element.getElementElement(), -1);
11515    if (element.hasListModeElement())
11516      composeEnum(t, "StructureMap", "listMode", element.getListModeElement(), -1);
11517    if (element.hasVariableElement())
11518      composeId(t, "StructureMap", "variable", element.getVariableElement(), -1);
11519    if (element.hasConditionElement())
11520      composeString(t, "StructureMap", "condition", element.getConditionElement(), -1);
11521    if (element.hasCheckElement())
11522      composeString(t, "StructureMap", "check", element.getCheckElement(), -1);
11523  }
11524
11525  protected void composeStructureMapStructureMapGroupRuleTargetComponent(Complex parent, String parentType, String name, StructureMap.StructureMapGroupRuleTargetComponent element, int index) {
11526    if (element == null) 
11527      return;
11528    Complex t;
11529    if (Utilities.noString(parentType))
11530      t = parent;
11531    else {
11532      t = parent.predicate("fhir:"+parentType+'.'+name);
11533    }
11534    composeBackboneElement(t, "target", name, element, index);
11535    if (element.hasContextElement())
11536      composeId(t, "StructureMap", "context", element.getContextElement(), -1);
11537    if (element.hasContextTypeElement())
11538      composeEnum(t, "StructureMap", "contextType", element.getContextTypeElement(), -1);
11539    if (element.hasElementElement())
11540      composeString(t, "StructureMap", "element", element.getElementElement(), -1);
11541    if (element.hasVariableElement())
11542      composeId(t, "StructureMap", "variable", element.getVariableElement(), -1);
11543    for (int i = 0; i < element.getListMode().size(); i++)
11544      composeEnum(t, "StructureMap", "listMode", element.getListMode().get(i), i);
11545    if (element.hasListRuleIdElement())
11546      composeId(t, "StructureMap", "listRuleId", element.getListRuleIdElement(), -1);
11547    if (element.hasTransformElement())
11548      composeEnum(t, "StructureMap", "transform", element.getTransformElement(), -1);
11549    for (int i = 0; i < element.getParameter().size(); i++)
11550      composeStructureMapStructureMapGroupRuleTargetParameterComponent(t, "StructureMap", "parameter", element.getParameter().get(i), i);
11551  }
11552
11553  protected void composeStructureMapStructureMapGroupRuleTargetParameterComponent(Complex parent, String parentType, String name, StructureMap.StructureMapGroupRuleTargetParameterComponent element, int index) {
11554    if (element == null) 
11555      return;
11556    Complex t;
11557    if (Utilities.noString(parentType))
11558      t = parent;
11559    else {
11560      t = parent.predicate("fhir:"+parentType+'.'+name);
11561    }
11562    composeBackboneElement(t, "parameter", name, element, index);
11563    if (element.hasValue())
11564      composeType(t, "StructureMap", "value", element.getValue(), -1);
11565  }
11566
11567  protected void composeStructureMapStructureMapGroupRuleDependentComponent(Complex parent, String parentType, String name, StructureMap.StructureMapGroupRuleDependentComponent element, int index) {
11568    if (element == null) 
11569      return;
11570    Complex t;
11571    if (Utilities.noString(parentType))
11572      t = parent;
11573    else {
11574      t = parent.predicate("fhir:"+parentType+'.'+name);
11575    }
11576    composeBackboneElement(t, "dependent", name, element, index);
11577    if (element.hasNameElement())
11578      composeId(t, "StructureMap", "name", element.getNameElement(), -1);
11579    for (int i = 0; i < element.getVariable().size(); i++)
11580      composeString(t, "StructureMap", "variable", element.getVariable().get(i), i);
11581  }
11582
11583  protected void composeSubscription(Complex parent, String parentType, String name, Subscription element, int index) {
11584    if (element == null) 
11585      return;
11586    Complex t;
11587    if (Utilities.noString(parentType))
11588      t = parent;
11589    else {
11590      t = parent.predicate("fhir:"+parentType+'.'+name);
11591    }
11592    composeDomainResource(t, "Subscription", name, element, index);
11593    if (element.hasStatusElement())
11594      composeEnum(t, "Subscription", "status", element.getStatusElement(), -1);
11595    for (int i = 0; i < element.getContact().size(); i++)
11596      composeContactPoint(t, "Subscription", "contact", element.getContact().get(i), i);
11597    if (element.hasEndElement())
11598      composeInstant(t, "Subscription", "end", element.getEndElement(), -1);
11599    if (element.hasReasonElement())
11600      composeString(t, "Subscription", "reason", element.getReasonElement(), -1);
11601    if (element.hasCriteriaElement())
11602      composeString(t, "Subscription", "criteria", element.getCriteriaElement(), -1);
11603    if (element.hasErrorElement())
11604      composeString(t, "Subscription", "error", element.getErrorElement(), -1);
11605    if (element.hasChannel())
11606      composeSubscriptionSubscriptionChannelComponent(t, "Subscription", "channel", element.getChannel(), -1);
11607    for (int i = 0; i < element.getTag().size(); i++)
11608      composeCoding(t, "Subscription", "tag", element.getTag().get(i), i);
11609  }
11610
11611  protected void composeSubscriptionSubscriptionChannelComponent(Complex parent, String parentType, String name, Subscription.SubscriptionChannelComponent element, int index) {
11612    if (element == null) 
11613      return;
11614    Complex t;
11615    if (Utilities.noString(parentType))
11616      t = parent;
11617    else {
11618      t = parent.predicate("fhir:"+parentType+'.'+name);
11619    }
11620    composeBackboneElement(t, "channel", name, element, index);
11621    if (element.hasTypeElement())
11622      composeEnum(t, "Subscription", "type", element.getTypeElement(), -1);
11623    if (element.hasEndpointElement())
11624      composeUri(t, "Subscription", "endpoint", element.getEndpointElement(), -1);
11625    if (element.hasPayloadElement())
11626      composeString(t, "Subscription", "payload", element.getPayloadElement(), -1);
11627    for (int i = 0; i < element.getHeader().size(); i++)
11628      composeString(t, "Subscription", "header", element.getHeader().get(i), i);
11629  }
11630
11631  protected void composeSubstance(Complex parent, String parentType, String name, Substance element, int index) {
11632    if (element == null) 
11633      return;
11634    Complex t;
11635    if (Utilities.noString(parentType))
11636      t = parent;
11637    else {
11638      t = parent.predicate("fhir:"+parentType+'.'+name);
11639    }
11640    composeDomainResource(t, "Substance", name, element, index);
11641    for (int i = 0; i < element.getIdentifier().size(); i++)
11642      composeIdentifier(t, "Substance", "identifier", element.getIdentifier().get(i), i);
11643    if (element.hasStatusElement())
11644      composeEnum(t, "Substance", "status", element.getStatusElement(), -1);
11645    for (int i = 0; i < element.getCategory().size(); i++)
11646      composeCodeableConcept(t, "Substance", "category", element.getCategory().get(i), i);
11647    if (element.hasCode())
11648      composeCodeableConcept(t, "Substance", "code", element.getCode(), -1);
11649    if (element.hasDescriptionElement())
11650      composeString(t, "Substance", "description", element.getDescriptionElement(), -1);
11651    for (int i = 0; i < element.getInstance().size(); i++)
11652      composeSubstanceSubstanceInstanceComponent(t, "Substance", "instance", element.getInstance().get(i), i);
11653    for (int i = 0; i < element.getIngredient().size(); i++)
11654      composeSubstanceSubstanceIngredientComponent(t, "Substance", "ingredient", element.getIngredient().get(i), i);
11655  }
11656
11657  protected void composeSubstanceSubstanceInstanceComponent(Complex parent, String parentType, String name, Substance.SubstanceInstanceComponent element, int index) {
11658    if (element == null) 
11659      return;
11660    Complex t;
11661    if (Utilities.noString(parentType))
11662      t = parent;
11663    else {
11664      t = parent.predicate("fhir:"+parentType+'.'+name);
11665    }
11666    composeBackboneElement(t, "instance", name, element, index);
11667    if (element.hasIdentifier())
11668      composeIdentifier(t, "Substance", "identifier", element.getIdentifier(), -1);
11669    if (element.hasExpiryElement())
11670      composeDateTime(t, "Substance", "expiry", element.getExpiryElement(), -1);
11671    if (element.hasQuantity())
11672      composeQuantity(t, "Substance", "quantity", element.getQuantity(), -1);
11673  }
11674
11675  protected void composeSubstanceSubstanceIngredientComponent(Complex parent, String parentType, String name, Substance.SubstanceIngredientComponent element, int index) {
11676    if (element == null) 
11677      return;
11678    Complex t;
11679    if (Utilities.noString(parentType))
11680      t = parent;
11681    else {
11682      t = parent.predicate("fhir:"+parentType+'.'+name);
11683    }
11684    composeBackboneElement(t, "ingredient", name, element, index);
11685    if (element.hasQuantity())
11686      composeRatio(t, "Substance", "quantity", element.getQuantity(), -1);
11687    if (element.hasSubstance())
11688      composeType(t, "Substance", "substance", element.getSubstance(), -1);
11689  }
11690
11691  protected void composeSupplyDelivery(Complex parent, String parentType, String name, SupplyDelivery element, int index) {
11692    if (element == null) 
11693      return;
11694    Complex t;
11695    if (Utilities.noString(parentType))
11696      t = parent;
11697    else {
11698      t = parent.predicate("fhir:"+parentType+'.'+name);
11699    }
11700    composeDomainResource(t, "SupplyDelivery", name, element, index);
11701    if (element.hasIdentifier())
11702      composeIdentifier(t, "SupplyDelivery", "identifier", element.getIdentifier(), -1);
11703    for (int i = 0; i < element.getBasedOn().size(); i++)
11704      composeReference(t, "SupplyDelivery", "basedOn", element.getBasedOn().get(i), i);
11705    for (int i = 0; i < element.getPartOf().size(); i++)
11706      composeReference(t, "SupplyDelivery", "partOf", element.getPartOf().get(i), i);
11707    if (element.hasStatusElement())
11708      composeEnum(t, "SupplyDelivery", "status", element.getStatusElement(), -1);
11709    if (element.hasPatient())
11710      composeReference(t, "SupplyDelivery", "patient", element.getPatient(), -1);
11711    if (element.hasType())
11712      composeCodeableConcept(t, "SupplyDelivery", "type", element.getType(), -1);
11713    if (element.hasSuppliedItem())
11714      composeSupplyDeliverySupplyDeliverySuppliedItemComponent(t, "SupplyDelivery", "suppliedItem", element.getSuppliedItem(), -1);
11715    if (element.hasOccurrence())
11716      composeType(t, "SupplyDelivery", "occurrence", element.getOccurrence(), -1);
11717    if (element.hasSupplier())
11718      composeReference(t, "SupplyDelivery", "supplier", element.getSupplier(), -1);
11719    if (element.hasDestination())
11720      composeReference(t, "SupplyDelivery", "destination", element.getDestination(), -1);
11721    for (int i = 0; i < element.getReceiver().size(); i++)
11722      composeReference(t, "SupplyDelivery", "receiver", element.getReceiver().get(i), i);
11723  }
11724
11725  protected void composeSupplyDeliverySupplyDeliverySuppliedItemComponent(Complex parent, String parentType, String name, SupplyDelivery.SupplyDeliverySuppliedItemComponent element, int index) {
11726    if (element == null) 
11727      return;
11728    Complex t;
11729    if (Utilities.noString(parentType))
11730      t = parent;
11731    else {
11732      t = parent.predicate("fhir:"+parentType+'.'+name);
11733    }
11734    composeBackboneElement(t, "suppliedItem", name, element, index);
11735    if (element.hasQuantity())
11736      composeQuantity(t, "SupplyDelivery", "quantity", element.getQuantity(), -1);
11737    if (element.hasItem())
11738      composeType(t, "SupplyDelivery", "item", element.getItem(), -1);
11739  }
11740
11741  protected void composeSupplyRequest(Complex parent, String parentType, String name, SupplyRequest element, int index) {
11742    if (element == null) 
11743      return;
11744    Complex t;
11745    if (Utilities.noString(parentType))
11746      t = parent;
11747    else {
11748      t = parent.predicate("fhir:"+parentType+'.'+name);
11749    }
11750    composeDomainResource(t, "SupplyRequest", name, element, index);
11751    if (element.hasIdentifier())
11752      composeIdentifier(t, "SupplyRequest", "identifier", element.getIdentifier(), -1);
11753    if (element.hasStatusElement())
11754      composeEnum(t, "SupplyRequest", "status", element.getStatusElement(), -1);
11755    if (element.hasCategory())
11756      composeCodeableConcept(t, "SupplyRequest", "category", element.getCategory(), -1);
11757    if (element.hasPriorityElement())
11758      composeEnum(t, "SupplyRequest", "priority", element.getPriorityElement(), -1);
11759    if (element.hasOrderedItem())
11760      composeSupplyRequestSupplyRequestOrderedItemComponent(t, "SupplyRequest", "orderedItem", element.getOrderedItem(), -1);
11761    if (element.hasOccurrence())
11762      composeType(t, "SupplyRequest", "occurrence", element.getOccurrence(), -1);
11763    if (element.hasAuthoredOnElement())
11764      composeDateTime(t, "SupplyRequest", "authoredOn", element.getAuthoredOnElement(), -1);
11765    if (element.hasRequester())
11766      composeSupplyRequestSupplyRequestRequesterComponent(t, "SupplyRequest", "requester", element.getRequester(), -1);
11767    for (int i = 0; i < element.getSupplier().size(); i++)
11768      composeReference(t, "SupplyRequest", "supplier", element.getSupplier().get(i), i);
11769    if (element.hasReason())
11770      composeType(t, "SupplyRequest", "reason", element.getReason(), -1);
11771    if (element.hasDeliverFrom())
11772      composeReference(t, "SupplyRequest", "deliverFrom", element.getDeliverFrom(), -1);
11773    if (element.hasDeliverTo())
11774      composeReference(t, "SupplyRequest", "deliverTo", element.getDeliverTo(), -1);
11775  }
11776
11777  protected void composeSupplyRequestSupplyRequestOrderedItemComponent(Complex parent, String parentType, String name, SupplyRequest.SupplyRequestOrderedItemComponent element, int index) {
11778    if (element == null) 
11779      return;
11780    Complex t;
11781    if (Utilities.noString(parentType))
11782      t = parent;
11783    else {
11784      t = parent.predicate("fhir:"+parentType+'.'+name);
11785    }
11786    composeBackboneElement(t, "orderedItem", name, element, index);
11787    if (element.hasQuantity())
11788      composeQuantity(t, "SupplyRequest", "quantity", element.getQuantity(), -1);
11789    if (element.hasItem())
11790      composeType(t, "SupplyRequest", "item", element.getItem(), -1);
11791  }
11792
11793  protected void composeSupplyRequestSupplyRequestRequesterComponent(Complex parent, String parentType, String name, SupplyRequest.SupplyRequestRequesterComponent element, int index) {
11794    if (element == null) 
11795      return;
11796    Complex t;
11797    if (Utilities.noString(parentType))
11798      t = parent;
11799    else {
11800      t = parent.predicate("fhir:"+parentType+'.'+name);
11801    }
11802    composeBackboneElement(t, "requester", name, element, index);
11803    if (element.hasAgent())
11804      composeReference(t, "SupplyRequest", "agent", element.getAgent(), -1);
11805    if (element.hasOnBehalfOf())
11806      composeReference(t, "SupplyRequest", "onBehalfOf", element.getOnBehalfOf(), -1);
11807  }
11808
11809  protected void composeTask(Complex parent, String parentType, String name, Task element, int index) {
11810    if (element == null) 
11811      return;
11812    Complex t;
11813    if (Utilities.noString(parentType))
11814      t = parent;
11815    else {
11816      t = parent.predicate("fhir:"+parentType+'.'+name);
11817    }
11818    composeDomainResource(t, "Task", name, element, index);
11819    for (int i = 0; i < element.getIdentifier().size(); i++)
11820      composeIdentifier(t, "Task", "identifier", element.getIdentifier().get(i), i);
11821    if (element.hasDefinition())
11822      composeType(t, "Task", "definition", element.getDefinition(), -1);
11823    for (int i = 0; i < element.getBasedOn().size(); i++)
11824      composeReference(t, "Task", "basedOn", element.getBasedOn().get(i), i);
11825    if (element.hasGroupIdentifier())
11826      composeIdentifier(t, "Task", "groupIdentifier", element.getGroupIdentifier(), -1);
11827    for (int i = 0; i < element.getPartOf().size(); i++)
11828      composeReference(t, "Task", "partOf", element.getPartOf().get(i), i);
11829    if (element.hasStatusElement())
11830      composeEnum(t, "Task", "status", element.getStatusElement(), -1);
11831    if (element.hasStatusReason())
11832      composeCodeableConcept(t, "Task", "statusReason", element.getStatusReason(), -1);
11833    if (element.hasBusinessStatus())
11834      composeCodeableConcept(t, "Task", "businessStatus", element.getBusinessStatus(), -1);
11835    if (element.hasIntentElement())
11836      composeEnum(t, "Task", "intent", element.getIntentElement(), -1);
11837    if (element.hasPriorityElement())
11838      composeEnum(t, "Task", "priority", element.getPriorityElement(), -1);
11839    if (element.hasCode())
11840      composeCodeableConcept(t, "Task", "code", element.getCode(), -1);
11841    if (element.hasDescriptionElement())
11842      composeString(t, "Task", "description", element.getDescriptionElement(), -1);
11843    if (element.hasFocus())
11844      composeReference(t, "Task", "focus", element.getFocus(), -1);
11845    if (element.hasFor())
11846      composeReference(t, "Task", "for", element.getFor(), -1);
11847    if (element.hasContext())
11848      composeReference(t, "Task", "context", element.getContext(), -1);
11849    if (element.hasExecutionPeriod())
11850      composePeriod(t, "Task", "executionPeriod", element.getExecutionPeriod(), -1);
11851    if (element.hasAuthoredOnElement())
11852      composeDateTime(t, "Task", "authoredOn", element.getAuthoredOnElement(), -1);
11853    if (element.hasLastModifiedElement())
11854      composeDateTime(t, "Task", "lastModified", element.getLastModifiedElement(), -1);
11855    if (element.hasRequester())
11856      composeTaskTaskRequesterComponent(t, "Task", "requester", element.getRequester(), -1);
11857    for (int i = 0; i < element.getPerformerType().size(); i++)
11858      composeCodeableConcept(t, "Task", "performerType", element.getPerformerType().get(i), i);
11859    if (element.hasOwner())
11860      composeReference(t, "Task", "owner", element.getOwner(), -1);
11861    if (element.hasReason())
11862      composeCodeableConcept(t, "Task", "reason", element.getReason(), -1);
11863    for (int i = 0; i < element.getNote().size(); i++)
11864      composeAnnotation(t, "Task", "note", element.getNote().get(i), i);
11865    for (int i = 0; i < element.getRelevantHistory().size(); i++)
11866      composeReference(t, "Task", "relevantHistory", element.getRelevantHistory().get(i), i);
11867    if (element.hasRestriction())
11868      composeTaskTaskRestrictionComponent(t, "Task", "restriction", element.getRestriction(), -1);
11869    for (int i = 0; i < element.getInput().size(); i++)
11870      composeTaskParameterComponent(t, "Task", "input", element.getInput().get(i), i);
11871    for (int i = 0; i < element.getOutput().size(); i++)
11872      composeTaskTaskOutputComponent(t, "Task", "output", element.getOutput().get(i), i);
11873  }
11874
11875  protected void composeTaskTaskRequesterComponent(Complex parent, String parentType, String name, Task.TaskRequesterComponent element, int index) {
11876    if (element == null) 
11877      return;
11878    Complex t;
11879    if (Utilities.noString(parentType))
11880      t = parent;
11881    else {
11882      t = parent.predicate("fhir:"+parentType+'.'+name);
11883    }
11884    composeBackboneElement(t, "requester", name, element, index);
11885    if (element.hasAgent())
11886      composeReference(t, "Task", "agent", element.getAgent(), -1);
11887    if (element.hasOnBehalfOf())
11888      composeReference(t, "Task", "onBehalfOf", element.getOnBehalfOf(), -1);
11889  }
11890
11891  protected void composeTaskTaskRestrictionComponent(Complex parent, String parentType, String name, Task.TaskRestrictionComponent element, int index) {
11892    if (element == null) 
11893      return;
11894    Complex t;
11895    if (Utilities.noString(parentType))
11896      t = parent;
11897    else {
11898      t = parent.predicate("fhir:"+parentType+'.'+name);
11899    }
11900    composeBackboneElement(t, "restriction", name, element, index);
11901    if (element.hasRepetitionsElement())
11902      composePositiveInt(t, "Task", "repetitions", element.getRepetitionsElement(), -1);
11903    if (element.hasPeriod())
11904      composePeriod(t, "Task", "period", element.getPeriod(), -1);
11905    for (int i = 0; i < element.getRecipient().size(); i++)
11906      composeReference(t, "Task", "recipient", element.getRecipient().get(i), i);
11907  }
11908
11909  protected void composeTaskParameterComponent(Complex parent, String parentType, String name, Task.ParameterComponent element, int index) {
11910    if (element == null) 
11911      return;
11912    Complex t;
11913    if (Utilities.noString(parentType))
11914      t = parent;
11915    else {
11916      t = parent.predicate("fhir:"+parentType+'.'+name);
11917    }
11918    composeBackboneElement(t, "input", name, element, index);
11919    if (element.hasType())
11920      composeCodeableConcept(t, "Task", "type", element.getType(), -1);
11921    if (element.hasValue())
11922      composeType(t, "Task", "value", element.getValue(), -1);
11923  }
11924
11925  protected void composeTaskTaskOutputComponent(Complex parent, String parentType, String name, Task.TaskOutputComponent element, int index) {
11926    if (element == null) 
11927      return;
11928    Complex t;
11929    if (Utilities.noString(parentType))
11930      t = parent;
11931    else {
11932      t = parent.predicate("fhir:"+parentType+'.'+name);
11933    }
11934    composeBackboneElement(t, "output", name, element, index);
11935    if (element.hasType())
11936      composeCodeableConcept(t, "Task", "type", element.getType(), -1);
11937    if (element.hasValue())
11938      composeType(t, "Task", "value", element.getValue(), -1);
11939  }
11940
11941  protected void composeTestReport(Complex parent, String parentType, String name, TestReport element, int index) {
11942    if (element == null) 
11943      return;
11944    Complex t;
11945    if (Utilities.noString(parentType))
11946      t = parent;
11947    else {
11948      t = parent.predicate("fhir:"+parentType+'.'+name);
11949    }
11950    composeDomainResource(t, "TestReport", name, element, index);
11951    if (element.hasIdentifier())
11952      composeIdentifier(t, "TestReport", "identifier", element.getIdentifier(), -1);
11953    if (element.hasNameElement())
11954      composeString(t, "TestReport", "name", element.getNameElement(), -1);
11955    if (element.hasStatusElement())
11956      composeEnum(t, "TestReport", "status", element.getStatusElement(), -1);
11957    if (element.hasTestScript())
11958      composeReference(t, "TestReport", "testScript", element.getTestScript(), -1);
11959    if (element.hasResultElement())
11960      composeEnum(t, "TestReport", "result", element.getResultElement(), -1);
11961    if (element.hasScoreElement())
11962      composeDecimal(t, "TestReport", "score", element.getScoreElement(), -1);
11963    if (element.hasTesterElement())
11964      composeString(t, "TestReport", "tester", element.getTesterElement(), -1);
11965    if (element.hasIssuedElement())
11966      composeDateTime(t, "TestReport", "issued", element.getIssuedElement(), -1);
11967    for (int i = 0; i < element.getParticipant().size(); i++)
11968      composeTestReportTestReportParticipantComponent(t, "TestReport", "participant", element.getParticipant().get(i), i);
11969    if (element.hasSetup())
11970      composeTestReportTestReportSetupComponent(t, "TestReport", "setup", element.getSetup(), -1);
11971    for (int i = 0; i < element.getTest().size(); i++)
11972      composeTestReportTestReportTestComponent(t, "TestReport", "test", element.getTest().get(i), i);
11973    if (element.hasTeardown())
11974      composeTestReportTestReportTeardownComponent(t, "TestReport", "teardown", element.getTeardown(), -1);
11975  }
11976
11977  protected void composeTestReportTestReportParticipantComponent(Complex parent, String parentType, String name, TestReport.TestReportParticipantComponent element, int index) {
11978    if (element == null) 
11979      return;
11980    Complex t;
11981    if (Utilities.noString(parentType))
11982      t = parent;
11983    else {
11984      t = parent.predicate("fhir:"+parentType+'.'+name);
11985    }
11986    composeBackboneElement(t, "participant", name, element, index);
11987    if (element.hasTypeElement())
11988      composeEnum(t, "TestReport", "type", element.getTypeElement(), -1);
11989    if (element.hasUriElement())
11990      composeUri(t, "TestReport", "uri", element.getUriElement(), -1);
11991    if (element.hasDisplayElement())
11992      composeString(t, "TestReport", "display", element.getDisplayElement(), -1);
11993  }
11994
11995  protected void composeTestReportTestReportSetupComponent(Complex parent, String parentType, String name, TestReport.TestReportSetupComponent element, int index) {
11996    if (element == null) 
11997      return;
11998    Complex t;
11999    if (Utilities.noString(parentType))
12000      t = parent;
12001    else {
12002      t = parent.predicate("fhir:"+parentType+'.'+name);
12003    }
12004    composeBackboneElement(t, "setup", name, element, index);
12005    for (int i = 0; i < element.getAction().size(); i++)
12006      composeTestReportSetupActionComponent(t, "TestReport", "action", element.getAction().get(i), i);
12007  }
12008
12009  protected void composeTestReportSetupActionComponent(Complex parent, String parentType, String name, TestReport.SetupActionComponent element, int index) {
12010    if (element == null) 
12011      return;
12012    Complex t;
12013    if (Utilities.noString(parentType))
12014      t = parent;
12015    else {
12016      t = parent.predicate("fhir:"+parentType+'.'+name);
12017    }
12018    composeBackboneElement(t, "action", name, element, index);
12019    if (element.hasOperation())
12020      composeTestReportSetupActionOperationComponent(t, "TestReport", "operation", element.getOperation(), -1);
12021    if (element.hasAssert())
12022      composeTestReportSetupActionAssertComponent(t, "TestReport", "assert", element.getAssert(), -1);
12023  }
12024
12025  protected void composeTestReportSetupActionOperationComponent(Complex parent, String parentType, String name, TestReport.SetupActionOperationComponent element, int index) {
12026    if (element == null) 
12027      return;
12028    Complex t;
12029    if (Utilities.noString(parentType))
12030      t = parent;
12031    else {
12032      t = parent.predicate("fhir:"+parentType+'.'+name);
12033    }
12034    composeBackboneElement(t, "operation", name, element, index);
12035    if (element.hasResultElement())
12036      composeEnum(t, "TestReport", "result", element.getResultElement(), -1);
12037    if (element.hasMessageElement())
12038      composeMarkdown(t, "TestReport", "message", element.getMessageElement(), -1);
12039    if (element.hasDetailElement())
12040      composeUri(t, "TestReport", "detail", element.getDetailElement(), -1);
12041  }
12042
12043  protected void composeTestReportSetupActionAssertComponent(Complex parent, String parentType, String name, TestReport.SetupActionAssertComponent element, int index) {
12044    if (element == null) 
12045      return;
12046    Complex t;
12047    if (Utilities.noString(parentType))
12048      t = parent;
12049    else {
12050      t = parent.predicate("fhir:"+parentType+'.'+name);
12051    }
12052    composeBackboneElement(t, "assert", name, element, index);
12053    if (element.hasResultElement())
12054      composeEnum(t, "TestReport", "result", element.getResultElement(), -1);
12055    if (element.hasMessageElement())
12056      composeMarkdown(t, "TestReport", "message", element.getMessageElement(), -1);
12057    if (element.hasDetailElement())
12058      composeString(t, "TestReport", "detail", element.getDetailElement(), -1);
12059  }
12060
12061  protected void composeTestReportTestReportTestComponent(Complex parent, String parentType, String name, TestReport.TestReportTestComponent element, int index) {
12062    if (element == null) 
12063      return;
12064    Complex t;
12065    if (Utilities.noString(parentType))
12066      t = parent;
12067    else {
12068      t = parent.predicate("fhir:"+parentType+'.'+name);
12069    }
12070    composeBackboneElement(t, "test", name, element, index);
12071    if (element.hasNameElement())
12072      composeString(t, "TestReport", "name", element.getNameElement(), -1);
12073    if (element.hasDescriptionElement())
12074      composeString(t, "TestReport", "description", element.getDescriptionElement(), -1);
12075    for (int i = 0; i < element.getAction().size(); i++)
12076      composeTestReportTestActionComponent(t, "TestReport", "action", element.getAction().get(i), i);
12077  }
12078
12079  protected void composeTestReportTestActionComponent(Complex parent, String parentType, String name, TestReport.TestActionComponent element, int index) {
12080    if (element == null) 
12081      return;
12082    Complex t;
12083    if (Utilities.noString(parentType))
12084      t = parent;
12085    else {
12086      t = parent.predicate("fhir:"+parentType+'.'+name);
12087    }
12088    composeBackboneElement(t, "action", name, element, index);
12089    if (element.hasOperation())
12090      composeTestReportSetupActionOperationComponent(t, "TestReport", "operation", element.getOperation(), -1);
12091    if (element.hasAssert())
12092      composeTestReportSetupActionAssertComponent(t, "TestReport", "assert", element.getAssert(), -1);
12093  }
12094
12095  protected void composeTestReportTestReportTeardownComponent(Complex parent, String parentType, String name, TestReport.TestReportTeardownComponent element, int index) {
12096    if (element == null) 
12097      return;
12098    Complex t;
12099    if (Utilities.noString(parentType))
12100      t = parent;
12101    else {
12102      t = parent.predicate("fhir:"+parentType+'.'+name);
12103    }
12104    composeBackboneElement(t, "teardown", name, element, index);
12105    for (int i = 0; i < element.getAction().size(); i++)
12106      composeTestReportTeardownActionComponent(t, "TestReport", "action", element.getAction().get(i), i);
12107  }
12108
12109  protected void composeTestReportTeardownActionComponent(Complex parent, String parentType, String name, TestReport.TeardownActionComponent element, int index) {
12110    if (element == null) 
12111      return;
12112    Complex t;
12113    if (Utilities.noString(parentType))
12114      t = parent;
12115    else {
12116      t = parent.predicate("fhir:"+parentType+'.'+name);
12117    }
12118    composeBackboneElement(t, "action", name, element, index);
12119    if (element.hasOperation())
12120      composeTestReportSetupActionOperationComponent(t, "TestReport", "operation", element.getOperation(), -1);
12121  }
12122
12123  protected void composeTestScript(Complex parent, String parentType, String name, TestScript element, int index) {
12124    if (element == null) 
12125      return;
12126    Complex t;
12127    if (Utilities.noString(parentType))
12128      t = parent;
12129    else {
12130      t = parent.predicate("fhir:"+parentType+'.'+name);
12131    }
12132    composeDomainResource(t, "TestScript", name, element, index);
12133    if (element.hasUrlElement())
12134      composeUri(t, "TestScript", "url", element.getUrlElement(), -1);
12135    if (element.hasIdentifier())
12136      composeIdentifier(t, "TestScript", "identifier", element.getIdentifier(), -1);
12137    if (element.hasVersionElement())
12138      composeString(t, "TestScript", "version", element.getVersionElement(), -1);
12139    if (element.hasNameElement())
12140      composeString(t, "TestScript", "name", element.getNameElement(), -1);
12141    if (element.hasTitleElement())
12142      composeString(t, "TestScript", "title", element.getTitleElement(), -1);
12143    if (element.hasStatusElement())
12144      composeEnum(t, "TestScript", "status", element.getStatusElement(), -1);
12145    if (element.hasExperimentalElement())
12146      composeBoolean(t, "TestScript", "experimental", element.getExperimentalElement(), -1);
12147    if (element.hasDateElement())
12148      composeDateTime(t, "TestScript", "date", element.getDateElement(), -1);
12149    if (element.hasPublisherElement())
12150      composeString(t, "TestScript", "publisher", element.getPublisherElement(), -1);
12151    for (int i = 0; i < element.getContact().size(); i++)
12152      composeContactDetail(t, "TestScript", "contact", element.getContact().get(i), i);
12153    if (element.hasDescriptionElement())
12154      composeMarkdown(t, "TestScript", "description", element.getDescriptionElement(), -1);
12155    for (int i = 0; i < element.getUseContext().size(); i++)
12156      composeUsageContext(t, "TestScript", "useContext", element.getUseContext().get(i), i);
12157    for (int i = 0; i < element.getJurisdiction().size(); i++)
12158      composeCodeableConcept(t, "TestScript", "jurisdiction", element.getJurisdiction().get(i), i);
12159    if (element.hasPurposeElement())
12160      composeMarkdown(t, "TestScript", "purpose", element.getPurposeElement(), -1);
12161    if (element.hasCopyrightElement())
12162      composeMarkdown(t, "TestScript", "copyright", element.getCopyrightElement(), -1);
12163    for (int i = 0; i < element.getOrigin().size(); i++)
12164      composeTestScriptTestScriptOriginComponent(t, "TestScript", "origin", element.getOrigin().get(i), i);
12165    for (int i = 0; i < element.getDestination().size(); i++)
12166      composeTestScriptTestScriptDestinationComponent(t, "TestScript", "destination", element.getDestination().get(i), i);
12167    if (element.hasMetadata())
12168      composeTestScriptTestScriptMetadataComponent(t, "TestScript", "metadata", element.getMetadata(), -1);
12169    for (int i = 0; i < element.getFixture().size(); i++)
12170      composeTestScriptTestScriptFixtureComponent(t, "TestScript", "fixture", element.getFixture().get(i), i);
12171    for (int i = 0; i < element.getProfile().size(); i++)
12172      composeReference(t, "TestScript", "profile", element.getProfile().get(i), i);
12173    for (int i = 0; i < element.getVariable().size(); i++)
12174      composeTestScriptTestScriptVariableComponent(t, "TestScript", "variable", element.getVariable().get(i), i);
12175    for (int i = 0; i < element.getRule().size(); i++)
12176      composeTestScriptTestScriptRuleComponent(t, "TestScript", "rule", element.getRule().get(i), i);
12177    for (int i = 0; i < element.getRuleset().size(); i++)
12178      composeTestScriptTestScriptRulesetComponent(t, "TestScript", "ruleset", element.getRuleset().get(i), i);
12179    if (element.hasSetup())
12180      composeTestScriptTestScriptSetupComponent(t, "TestScript", "setup", element.getSetup(), -1);
12181    for (int i = 0; i < element.getTest().size(); i++)
12182      composeTestScriptTestScriptTestComponent(t, "TestScript", "test", element.getTest().get(i), i);
12183    if (element.hasTeardown())
12184      composeTestScriptTestScriptTeardownComponent(t, "TestScript", "teardown", element.getTeardown(), -1);
12185  }
12186
12187  protected void composeTestScriptTestScriptOriginComponent(Complex parent, String parentType, String name, TestScript.TestScriptOriginComponent element, int index) {
12188    if (element == null) 
12189      return;
12190    Complex t;
12191    if (Utilities.noString(parentType))
12192      t = parent;
12193    else {
12194      t = parent.predicate("fhir:"+parentType+'.'+name);
12195    }
12196    composeBackboneElement(t, "origin", name, element, index);
12197    if (element.hasIndexElement())
12198      composeInteger(t, "TestScript", "index", element.getIndexElement(), -1);
12199    if (element.hasProfile())
12200      composeCoding(t, "TestScript", "profile", element.getProfile(), -1);
12201  }
12202
12203  protected void composeTestScriptTestScriptDestinationComponent(Complex parent, String parentType, String name, TestScript.TestScriptDestinationComponent element, int index) {
12204    if (element == null) 
12205      return;
12206    Complex t;
12207    if (Utilities.noString(parentType))
12208      t = parent;
12209    else {
12210      t = parent.predicate("fhir:"+parentType+'.'+name);
12211    }
12212    composeBackboneElement(t, "destination", name, element, index);
12213    if (element.hasIndexElement())
12214      composeInteger(t, "TestScript", "index", element.getIndexElement(), -1);
12215    if (element.hasProfile())
12216      composeCoding(t, "TestScript", "profile", element.getProfile(), -1);
12217  }
12218
12219  protected void composeTestScriptTestScriptMetadataComponent(Complex parent, String parentType, String name, TestScript.TestScriptMetadataComponent element, int index) {
12220    if (element == null) 
12221      return;
12222    Complex t;
12223    if (Utilities.noString(parentType))
12224      t = parent;
12225    else {
12226      t = parent.predicate("fhir:"+parentType+'.'+name);
12227    }
12228    composeBackboneElement(t, "metadata", name, element, index);
12229    for (int i = 0; i < element.getLink().size(); i++)
12230      composeTestScriptTestScriptMetadataLinkComponent(t, "TestScript", "link", element.getLink().get(i), i);
12231    for (int i = 0; i < element.getCapability().size(); i++)
12232      composeTestScriptTestScriptMetadataCapabilityComponent(t, "TestScript", "capability", element.getCapability().get(i), i);
12233  }
12234
12235  protected void composeTestScriptTestScriptMetadataLinkComponent(Complex parent, String parentType, String name, TestScript.TestScriptMetadataLinkComponent element, int index) {
12236    if (element == null) 
12237      return;
12238    Complex t;
12239    if (Utilities.noString(parentType))
12240      t = parent;
12241    else {
12242      t = parent.predicate("fhir:"+parentType+'.'+name);
12243    }
12244    composeBackboneElement(t, "link", name, element, index);
12245    if (element.hasUrlElement())
12246      composeUri(t, "TestScript", "url", element.getUrlElement(), -1);
12247    if (element.hasDescriptionElement())
12248      composeString(t, "TestScript", "description", element.getDescriptionElement(), -1);
12249  }
12250
12251  protected void composeTestScriptTestScriptMetadataCapabilityComponent(Complex parent, String parentType, String name, TestScript.TestScriptMetadataCapabilityComponent element, int index) {
12252    if (element == null) 
12253      return;
12254    Complex t;
12255    if (Utilities.noString(parentType))
12256      t = parent;
12257    else {
12258      t = parent.predicate("fhir:"+parentType+'.'+name);
12259    }
12260    composeBackboneElement(t, "capability", name, element, index);
12261    if (element.hasRequiredElement())
12262      composeBoolean(t, "TestScript", "required", element.getRequiredElement(), -1);
12263    if (element.hasValidatedElement())
12264      composeBoolean(t, "TestScript", "validated", element.getValidatedElement(), -1);
12265    if (element.hasDescriptionElement())
12266      composeString(t, "TestScript", "description", element.getDescriptionElement(), -1);
12267    for (int i = 0; i < element.getOrigin().size(); i++)
12268      composeInteger(t, "TestScript", "origin", element.getOrigin().get(i), i);
12269    if (element.hasDestinationElement())
12270      composeInteger(t, "TestScript", "destination", element.getDestinationElement(), -1);
12271    for (int i = 0; i < element.getLink().size(); i++)
12272      composeUri(t, "TestScript", "link", element.getLink().get(i), i);
12273    if (element.hasCapabilities())
12274      composeReference(t, "TestScript", "capabilities", element.getCapabilities(), -1);
12275  }
12276
12277  protected void composeTestScriptTestScriptFixtureComponent(Complex parent, String parentType, String name, TestScript.TestScriptFixtureComponent element, int index) {
12278    if (element == null) 
12279      return;
12280    Complex t;
12281    if (Utilities.noString(parentType))
12282      t = parent;
12283    else {
12284      t = parent.predicate("fhir:"+parentType+'.'+name);
12285    }
12286    composeBackboneElement(t, "fixture", name, element, index);
12287    if (element.hasAutocreateElement())
12288      composeBoolean(t, "TestScript", "autocreate", element.getAutocreateElement(), -1);
12289    if (element.hasAutodeleteElement())
12290      composeBoolean(t, "TestScript", "autodelete", element.getAutodeleteElement(), -1);
12291    if (element.hasResource())
12292      composeReference(t, "TestScript", "resource", element.getResource(), -1);
12293  }
12294
12295  protected void composeTestScriptTestScriptVariableComponent(Complex parent, String parentType, String name, TestScript.TestScriptVariableComponent element, int index) {
12296    if (element == null) 
12297      return;
12298    Complex t;
12299    if (Utilities.noString(parentType))
12300      t = parent;
12301    else {
12302      t = parent.predicate("fhir:"+parentType+'.'+name);
12303    }
12304    composeBackboneElement(t, "variable", name, element, index);
12305    if (element.hasNameElement())
12306      composeString(t, "TestScript", "name", element.getNameElement(), -1);
12307    if (element.hasDefaultValueElement())
12308      composeString(t, "TestScript", "defaultValue", element.getDefaultValueElement(), -1);
12309    if (element.hasDescriptionElement())
12310      composeString(t, "TestScript", "description", element.getDescriptionElement(), -1);
12311    if (element.hasExpressionElement())
12312      composeString(t, "TestScript", "expression", element.getExpressionElement(), -1);
12313    if (element.hasHeaderFieldElement())
12314      composeString(t, "TestScript", "headerField", element.getHeaderFieldElement(), -1);
12315    if (element.hasHintElement())
12316      composeString(t, "TestScript", "hint", element.getHintElement(), -1);
12317    if (element.hasPathElement())
12318      composeString(t, "TestScript", "path", element.getPathElement(), -1);
12319    if (element.hasSourceIdElement())
12320      composeId(t, "TestScript", "sourceId", element.getSourceIdElement(), -1);
12321  }
12322
12323  protected void composeTestScriptTestScriptRuleComponent(Complex parent, String parentType, String name, TestScript.TestScriptRuleComponent element, int index) {
12324    if (element == null) 
12325      return;
12326    Complex t;
12327    if (Utilities.noString(parentType))
12328      t = parent;
12329    else {
12330      t = parent.predicate("fhir:"+parentType+'.'+name);
12331    }
12332    composeBackboneElement(t, "rule", name, element, index);
12333    if (element.hasResource())
12334      composeReference(t, "TestScript", "resource", element.getResource(), -1);
12335    for (int i = 0; i < element.getParam().size(); i++)
12336      composeTestScriptRuleParamComponent(t, "TestScript", "param", element.getParam().get(i), i);
12337  }
12338
12339  protected void composeTestScriptRuleParamComponent(Complex parent, String parentType, String name, TestScript.RuleParamComponent element, int index) {
12340    if (element == null) 
12341      return;
12342    Complex t;
12343    if (Utilities.noString(parentType))
12344      t = parent;
12345    else {
12346      t = parent.predicate("fhir:"+parentType+'.'+name);
12347    }
12348    composeBackboneElement(t, "param", name, element, index);
12349    if (element.hasNameElement())
12350      composeString(t, "TestScript", "name", element.getNameElement(), -1);
12351    if (element.hasValueElement())
12352      composeString(t, "TestScript", "value", element.getValueElement(), -1);
12353  }
12354
12355  protected void composeTestScriptTestScriptRulesetComponent(Complex parent, String parentType, String name, TestScript.TestScriptRulesetComponent element, int index) {
12356    if (element == null) 
12357      return;
12358    Complex t;
12359    if (Utilities.noString(parentType))
12360      t = parent;
12361    else {
12362      t = parent.predicate("fhir:"+parentType+'.'+name);
12363    }
12364    composeBackboneElement(t, "ruleset", name, element, index);
12365    if (element.hasResource())
12366      composeReference(t, "TestScript", "resource", element.getResource(), -1);
12367    for (int i = 0; i < element.getRule().size(); i++)
12368      composeTestScriptRulesetRuleComponent(t, "TestScript", "rule", element.getRule().get(i), i);
12369  }
12370
12371  protected void composeTestScriptRulesetRuleComponent(Complex parent, String parentType, String name, TestScript.RulesetRuleComponent element, int index) {
12372    if (element == null) 
12373      return;
12374    Complex t;
12375    if (Utilities.noString(parentType))
12376      t = parent;
12377    else {
12378      t = parent.predicate("fhir:"+parentType+'.'+name);
12379    }
12380    composeBackboneElement(t, "rule", name, element, index);
12381    if (element.hasRuleIdElement())
12382      composeId(t, "TestScript", "ruleId", element.getRuleIdElement(), -1);
12383    for (int i = 0; i < element.getParam().size(); i++)
12384      composeTestScriptRulesetRuleParamComponent(t, "TestScript", "param", element.getParam().get(i), i);
12385  }
12386
12387  protected void composeTestScriptRulesetRuleParamComponent(Complex parent, String parentType, String name, TestScript.RulesetRuleParamComponent element, int index) {
12388    if (element == null) 
12389      return;
12390    Complex t;
12391    if (Utilities.noString(parentType))
12392      t = parent;
12393    else {
12394      t = parent.predicate("fhir:"+parentType+'.'+name);
12395    }
12396    composeBackboneElement(t, "param", name, element, index);
12397    if (element.hasNameElement())
12398      composeString(t, "TestScript", "name", element.getNameElement(), -1);
12399    if (element.hasValueElement())
12400      composeString(t, "TestScript", "value", element.getValueElement(), -1);
12401  }
12402
12403  protected void composeTestScriptTestScriptSetupComponent(Complex parent, String parentType, String name, TestScript.TestScriptSetupComponent element, int index) {
12404    if (element == null) 
12405      return;
12406    Complex t;
12407    if (Utilities.noString(parentType))
12408      t = parent;
12409    else {
12410      t = parent.predicate("fhir:"+parentType+'.'+name);
12411    }
12412    composeBackboneElement(t, "setup", name, element, index);
12413    for (int i = 0; i < element.getAction().size(); i++)
12414      composeTestScriptSetupActionComponent(t, "TestScript", "action", element.getAction().get(i), i);
12415  }
12416
12417  protected void composeTestScriptSetupActionComponent(Complex parent, String parentType, String name, TestScript.SetupActionComponent element, int index) {
12418    if (element == null) 
12419      return;
12420    Complex t;
12421    if (Utilities.noString(parentType))
12422      t = parent;
12423    else {
12424      t = parent.predicate("fhir:"+parentType+'.'+name);
12425    }
12426    composeBackboneElement(t, "action", name, element, index);
12427    if (element.hasOperation())
12428      composeTestScriptSetupActionOperationComponent(t, "TestScript", "operation", element.getOperation(), -1);
12429    if (element.hasAssert())
12430      composeTestScriptSetupActionAssertComponent(t, "TestScript", "assert", element.getAssert(), -1);
12431  }
12432
12433  protected void composeTestScriptSetupActionOperationComponent(Complex parent, String parentType, String name, TestScript.SetupActionOperationComponent element, int index) {
12434    if (element == null) 
12435      return;
12436    Complex t;
12437    if (Utilities.noString(parentType))
12438      t = parent;
12439    else {
12440      t = parent.predicate("fhir:"+parentType+'.'+name);
12441    }
12442    composeBackboneElement(t, "operation", name, element, index);
12443    if (element.hasType())
12444      composeCoding(t, "TestScript", "type", element.getType(), -1);
12445    if (element.hasResourceElement())
12446      composeCode(t, "TestScript", "resource", element.getResourceElement(), -1);
12447    if (element.hasLabelElement())
12448      composeString(t, "TestScript", "label", element.getLabelElement(), -1);
12449    if (element.hasDescriptionElement())
12450      composeString(t, "TestScript", "description", element.getDescriptionElement(), -1);
12451    if (element.hasAcceptElement())
12452      composeEnum(t, "TestScript", "accept", element.getAcceptElement(), -1);
12453    if (element.hasContentTypeElement())
12454      composeEnum(t, "TestScript", "contentType", element.getContentTypeElement(), -1);
12455    if (element.hasDestinationElement())
12456      composeInteger(t, "TestScript", "destination", element.getDestinationElement(), -1);
12457    if (element.hasEncodeRequestUrlElement())
12458      composeBoolean(t, "TestScript", "encodeRequestUrl", element.getEncodeRequestUrlElement(), -1);
12459    if (element.hasOriginElement())
12460      composeInteger(t, "TestScript", "origin", element.getOriginElement(), -1);
12461    if (element.hasParamsElement())
12462      composeString(t, "TestScript", "params", element.getParamsElement(), -1);
12463    for (int i = 0; i < element.getRequestHeader().size(); i++)
12464      composeTestScriptSetupActionOperationRequestHeaderComponent(t, "TestScript", "requestHeader", element.getRequestHeader().get(i), i);
12465    if (element.hasRequestIdElement())
12466      composeId(t, "TestScript", "requestId", element.getRequestIdElement(), -1);
12467    if (element.hasResponseIdElement())
12468      composeId(t, "TestScript", "responseId", element.getResponseIdElement(), -1);
12469    if (element.hasSourceIdElement())
12470      composeId(t, "TestScript", "sourceId", element.getSourceIdElement(), -1);
12471    if (element.hasTargetIdElement())
12472      composeId(t, "TestScript", "targetId", element.getTargetIdElement(), -1);
12473    if (element.hasUrlElement())
12474      composeString(t, "TestScript", "url", element.getUrlElement(), -1);
12475  }
12476
12477  protected void composeTestScriptSetupActionOperationRequestHeaderComponent(Complex parent, String parentType, String name, TestScript.SetupActionOperationRequestHeaderComponent element, int index) {
12478    if (element == null) 
12479      return;
12480    Complex t;
12481    if (Utilities.noString(parentType))
12482      t = parent;
12483    else {
12484      t = parent.predicate("fhir:"+parentType+'.'+name);
12485    }
12486    composeBackboneElement(t, "requestHeader", name, element, index);
12487    if (element.hasFieldElement())
12488      composeString(t, "TestScript", "field", element.getFieldElement(), -1);
12489    if (element.hasValueElement())
12490      composeString(t, "TestScript", "value", element.getValueElement(), -1);
12491  }
12492
12493  protected void composeTestScriptSetupActionAssertComponent(Complex parent, String parentType, String name, TestScript.SetupActionAssertComponent element, int index) {
12494    if (element == null) 
12495      return;
12496    Complex t;
12497    if (Utilities.noString(parentType))
12498      t = parent;
12499    else {
12500      t = parent.predicate("fhir:"+parentType+'.'+name);
12501    }
12502    composeBackboneElement(t, "assert", name, element, index);
12503    if (element.hasLabelElement())
12504      composeString(t, "TestScript", "label", element.getLabelElement(), -1);
12505    if (element.hasDescriptionElement())
12506      composeString(t, "TestScript", "description", element.getDescriptionElement(), -1);
12507    if (element.hasDirectionElement())
12508      composeEnum(t, "TestScript", "direction", element.getDirectionElement(), -1);
12509    if (element.hasCompareToSourceIdElement())
12510      composeString(t, "TestScript", "compareToSourceId", element.getCompareToSourceIdElement(), -1);
12511    if (element.hasCompareToSourceExpressionElement())
12512      composeString(t, "TestScript", "compareToSourceExpression", element.getCompareToSourceExpressionElement(), -1);
12513    if (element.hasCompareToSourcePathElement())
12514      composeString(t, "TestScript", "compareToSourcePath", element.getCompareToSourcePathElement(), -1);
12515    if (element.hasContentTypeElement())
12516      composeEnum(t, "TestScript", "contentType", element.getContentTypeElement(), -1);
12517    if (element.hasExpressionElement())
12518      composeString(t, "TestScript", "expression", element.getExpressionElement(), -1);
12519    if (element.hasHeaderFieldElement())
12520      composeString(t, "TestScript", "headerField", element.getHeaderFieldElement(), -1);
12521    if (element.hasMinimumIdElement())
12522      composeString(t, "TestScript", "minimumId", element.getMinimumIdElement(), -1);
12523    if (element.hasNavigationLinksElement())
12524      composeBoolean(t, "TestScript", "navigationLinks", element.getNavigationLinksElement(), -1);
12525    if (element.hasOperatorElement())
12526      composeEnum(t, "TestScript", "operator", element.getOperatorElement(), -1);
12527    if (element.hasPathElement())
12528      composeString(t, "TestScript", "path", element.getPathElement(), -1);
12529    if (element.hasRequestMethodElement())
12530      composeEnum(t, "TestScript", "requestMethod", element.getRequestMethodElement(), -1);
12531    if (element.hasRequestURLElement())
12532      composeString(t, "TestScript", "requestURL", element.getRequestURLElement(), -1);
12533    if (element.hasResourceElement())
12534      composeCode(t, "TestScript", "resource", element.getResourceElement(), -1);
12535    if (element.hasResponseElement())
12536      composeEnum(t, "TestScript", "response", element.getResponseElement(), -1);
12537    if (element.hasResponseCodeElement())
12538      composeString(t, "TestScript", "responseCode", element.getResponseCodeElement(), -1);
12539    if (element.hasRule())
12540      composeTestScriptActionAssertRuleComponent(t, "TestScript", "rule", element.getRule(), -1);
12541    if (element.hasRuleset())
12542      composeTestScriptActionAssertRulesetComponent(t, "TestScript", "ruleset", element.getRuleset(), -1);
12543    if (element.hasSourceIdElement())
12544      composeId(t, "TestScript", "sourceId", element.getSourceIdElement(), -1);
12545    if (element.hasValidateProfileIdElement())
12546      composeId(t, "TestScript", "validateProfileId", element.getValidateProfileIdElement(), -1);
12547    if (element.hasValueElement())
12548      composeString(t, "TestScript", "value", element.getValueElement(), -1);
12549    if (element.hasWarningOnlyElement())
12550      composeBoolean(t, "TestScript", "warningOnly", element.getWarningOnlyElement(), -1);
12551  }
12552
12553  protected void composeTestScriptActionAssertRuleComponent(Complex parent, String parentType, String name, TestScript.ActionAssertRuleComponent element, int index) {
12554    if (element == null) 
12555      return;
12556    Complex t;
12557    if (Utilities.noString(parentType))
12558      t = parent;
12559    else {
12560      t = parent.predicate("fhir:"+parentType+'.'+name);
12561    }
12562    composeBackboneElement(t, "rule", name, element, index);
12563    if (element.hasRuleIdElement())
12564      composeId(t, "TestScript", "ruleId", element.getRuleIdElement(), -1);
12565    for (int i = 0; i < element.getParam().size(); i++)
12566      composeTestScriptActionAssertRuleParamComponent(t, "TestScript", "param", element.getParam().get(i), i);
12567  }
12568
12569  protected void composeTestScriptActionAssertRuleParamComponent(Complex parent, String parentType, String name, TestScript.ActionAssertRuleParamComponent element, int index) {
12570    if (element == null) 
12571      return;
12572    Complex t;
12573    if (Utilities.noString(parentType))
12574      t = parent;
12575    else {
12576      t = parent.predicate("fhir:"+parentType+'.'+name);
12577    }
12578    composeBackboneElement(t, "param", name, element, index);
12579    if (element.hasNameElement())
12580      composeString(t, "TestScript", "name", element.getNameElement(), -1);
12581    if (element.hasValueElement())
12582      composeString(t, "TestScript", "value", element.getValueElement(), -1);
12583  }
12584
12585  protected void composeTestScriptActionAssertRulesetComponent(Complex parent, String parentType, String name, TestScript.ActionAssertRulesetComponent element, int index) {
12586    if (element == null) 
12587      return;
12588    Complex t;
12589    if (Utilities.noString(parentType))
12590      t = parent;
12591    else {
12592      t = parent.predicate("fhir:"+parentType+'.'+name);
12593    }
12594    composeBackboneElement(t, "ruleset", name, element, index);
12595    if (element.hasRulesetIdElement())
12596      composeId(t, "TestScript", "rulesetId", element.getRulesetIdElement(), -1);
12597    for (int i = 0; i < element.getRule().size(); i++)
12598      composeTestScriptActionAssertRulesetRuleComponent(t, "TestScript", "rule", element.getRule().get(i), i);
12599  }
12600
12601  protected void composeTestScriptActionAssertRulesetRuleComponent(Complex parent, String parentType, String name, TestScript.ActionAssertRulesetRuleComponent element, int index) {
12602    if (element == null) 
12603      return;
12604    Complex t;
12605    if (Utilities.noString(parentType))
12606      t = parent;
12607    else {
12608      t = parent.predicate("fhir:"+parentType+'.'+name);
12609    }
12610    composeBackboneElement(t, "rule", name, element, index);
12611    if (element.hasRuleIdElement())
12612      composeId(t, "TestScript", "ruleId", element.getRuleIdElement(), -1);
12613    for (int i = 0; i < element.getParam().size(); i++)
12614      composeTestScriptActionAssertRulesetRuleParamComponent(t, "TestScript", "param", element.getParam().get(i), i);
12615  }
12616
12617  protected void composeTestScriptActionAssertRulesetRuleParamComponent(Complex parent, String parentType, String name, TestScript.ActionAssertRulesetRuleParamComponent element, int index) {
12618    if (element == null) 
12619      return;
12620    Complex t;
12621    if (Utilities.noString(parentType))
12622      t = parent;
12623    else {
12624      t = parent.predicate("fhir:"+parentType+'.'+name);
12625    }
12626    composeBackboneElement(t, "param", name, element, index);
12627    if (element.hasNameElement())
12628      composeString(t, "TestScript", "name", element.getNameElement(), -1);
12629    if (element.hasValueElement())
12630      composeString(t, "TestScript", "value", element.getValueElement(), -1);
12631  }
12632
12633  protected void composeTestScriptTestScriptTestComponent(Complex parent, String parentType, String name, TestScript.TestScriptTestComponent element, int index) {
12634    if (element == null) 
12635      return;
12636    Complex t;
12637    if (Utilities.noString(parentType))
12638      t = parent;
12639    else {
12640      t = parent.predicate("fhir:"+parentType+'.'+name);
12641    }
12642    composeBackboneElement(t, "test", name, element, index);
12643    if (element.hasNameElement())
12644      composeString(t, "TestScript", "name", element.getNameElement(), -1);
12645    if (element.hasDescriptionElement())
12646      composeString(t, "TestScript", "description", element.getDescriptionElement(), -1);
12647    for (int i = 0; i < element.getAction().size(); i++)
12648      composeTestScriptTestActionComponent(t, "TestScript", "action", element.getAction().get(i), i);
12649  }
12650
12651  protected void composeTestScriptTestActionComponent(Complex parent, String parentType, String name, TestScript.TestActionComponent element, int index) {
12652    if (element == null) 
12653      return;
12654    Complex t;
12655    if (Utilities.noString(parentType))
12656      t = parent;
12657    else {
12658      t = parent.predicate("fhir:"+parentType+'.'+name);
12659    }
12660    composeBackboneElement(t, "action", name, element, index);
12661    if (element.hasOperation())
12662      composeTestScriptSetupActionOperationComponent(t, "TestScript", "operation", element.getOperation(), -1);
12663    if (element.hasAssert())
12664      composeTestScriptSetupActionAssertComponent(t, "TestScript", "assert", element.getAssert(), -1);
12665  }
12666
12667  protected void composeTestScriptTestScriptTeardownComponent(Complex parent, String parentType, String name, TestScript.TestScriptTeardownComponent element, int index) {
12668    if (element == null) 
12669      return;
12670    Complex t;
12671    if (Utilities.noString(parentType))
12672      t = parent;
12673    else {
12674      t = parent.predicate("fhir:"+parentType+'.'+name);
12675    }
12676    composeBackboneElement(t, "teardown", name, element, index);
12677    for (int i = 0; i < element.getAction().size(); i++)
12678      composeTestScriptTeardownActionComponent(t, "TestScript", "action", element.getAction().get(i), i);
12679  }
12680
12681  protected void composeTestScriptTeardownActionComponent(Complex parent, String parentType, String name, TestScript.TeardownActionComponent element, int index) {
12682    if (element == null) 
12683      return;
12684    Complex t;
12685    if (Utilities.noString(parentType))
12686      t = parent;
12687    else {
12688      t = parent.predicate("fhir:"+parentType+'.'+name);
12689    }
12690    composeBackboneElement(t, "action", name, element, index);
12691    if (element.hasOperation())
12692      composeTestScriptSetupActionOperationComponent(t, "TestScript", "operation", element.getOperation(), -1);
12693  }
12694
12695  protected void composeValueSet(Complex parent, String parentType, String name, ValueSet element, int index) {
12696    if (element == null) 
12697      return;
12698    Complex t;
12699    if (Utilities.noString(parentType))
12700      t = parent;
12701    else {
12702      t = parent.predicate("fhir:"+parentType+'.'+name);
12703    }
12704    composeDomainResource(t, "ValueSet", name, element, index);
12705    if (element.hasUrlElement())
12706      composeUri(t, "ValueSet", "url", element.getUrlElement(), -1);
12707    for (int i = 0; i < element.getIdentifier().size(); i++)
12708      composeIdentifier(t, "ValueSet", "identifier", element.getIdentifier().get(i), i);
12709    if (element.hasVersionElement())
12710      composeString(t, "ValueSet", "version", element.getVersionElement(), -1);
12711    if (element.hasNameElement())
12712      composeString(t, "ValueSet", "name", element.getNameElement(), -1);
12713    if (element.hasTitleElement())
12714      composeString(t, "ValueSet", "title", element.getTitleElement(), -1);
12715    if (element.hasStatusElement())
12716      composeEnum(t, "ValueSet", "status", element.getStatusElement(), -1);
12717    if (element.hasExperimentalElement())
12718      composeBoolean(t, "ValueSet", "experimental", element.getExperimentalElement(), -1);
12719    if (element.hasDateElement())
12720      composeDateTime(t, "ValueSet", "date", element.getDateElement(), -1);
12721    if (element.hasPublisherElement())
12722      composeString(t, "ValueSet", "publisher", element.getPublisherElement(), -1);
12723    for (int i = 0; i < element.getContact().size(); i++)
12724      composeContactDetail(t, "ValueSet", "contact", element.getContact().get(i), i);
12725    if (element.hasDescriptionElement())
12726      composeMarkdown(t, "ValueSet", "description", element.getDescriptionElement(), -1);
12727    for (int i = 0; i < element.getUseContext().size(); i++)
12728      composeUsageContext(t, "ValueSet", "useContext", element.getUseContext().get(i), i);
12729    for (int i = 0; i < element.getJurisdiction().size(); i++)
12730      composeCodeableConcept(t, "ValueSet", "jurisdiction", element.getJurisdiction().get(i), i);
12731    if (element.hasImmutableElement())
12732      composeBoolean(t, "ValueSet", "immutable", element.getImmutableElement(), -1);
12733    if (element.hasPurposeElement())
12734      composeMarkdown(t, "ValueSet", "purpose", element.getPurposeElement(), -1);
12735    if (element.hasCopyrightElement())
12736      composeMarkdown(t, "ValueSet", "copyright", element.getCopyrightElement(), -1);
12737    if (element.hasExtensibleElement())
12738      composeBoolean(t, "ValueSet", "extensible", element.getExtensibleElement(), -1);
12739    if (element.hasCompose())
12740      composeValueSetValueSetComposeComponent(t, "ValueSet", "compose", element.getCompose(), -1);
12741    if (element.hasExpansion())
12742      composeValueSetValueSetExpansionComponent(t, "ValueSet", "expansion", element.getExpansion(), -1);
12743  }
12744
12745  protected void composeValueSetValueSetComposeComponent(Complex parent, String parentType, String name, ValueSet.ValueSetComposeComponent element, int index) {
12746    if (element == null) 
12747      return;
12748    Complex t;
12749    if (Utilities.noString(parentType))
12750      t = parent;
12751    else {
12752      t = parent.predicate("fhir:"+parentType+'.'+name);
12753    }
12754    composeBackboneElement(t, "compose", name, element, index);
12755    if (element.hasLockedDateElement())
12756      composeDate(t, "ValueSet", "lockedDate", element.getLockedDateElement(), -1);
12757    if (element.hasInactiveElement())
12758      composeBoolean(t, "ValueSet", "inactive", element.getInactiveElement(), -1);
12759    for (int i = 0; i < element.getInclude().size(); i++)
12760      composeValueSetConceptSetComponent(t, "ValueSet", "include", element.getInclude().get(i), i);
12761    for (int i = 0; i < element.getExclude().size(); i++)
12762      composeValueSetConceptSetComponent(t, "ValueSet", "exclude", element.getExclude().get(i), i);
12763  }
12764
12765  protected void composeValueSetConceptSetComponent(Complex parent, String parentType, String name, ValueSet.ConceptSetComponent element, int index) {
12766    if (element == null) 
12767      return;
12768    Complex t;
12769    if (Utilities.noString(parentType))
12770      t = parent;
12771    else {
12772      t = parent.predicate("fhir:"+parentType+'.'+name);
12773    }
12774    composeBackboneElement(t, "include", name, element, index);
12775    if (element.hasSystemElement())
12776      composeUri(t, "ValueSet", "system", element.getSystemElement(), -1);
12777    if (element.hasVersionElement())
12778      composeString(t, "ValueSet", "version", element.getVersionElement(), -1);
12779    for (int i = 0; i < element.getConcept().size(); i++)
12780      composeValueSetConceptReferenceComponent(t, "ValueSet", "concept", element.getConcept().get(i), i);
12781    for (int i = 0; i < element.getFilter().size(); i++)
12782      composeValueSetConceptSetFilterComponent(t, "ValueSet", "filter", element.getFilter().get(i), i);
12783    for (int i = 0; i < element.getValueSet().size(); i++)
12784      composeUri(t, "ValueSet", "valueSet", element.getValueSet().get(i), i);
12785  }
12786
12787  protected void composeValueSetConceptReferenceComponent(Complex parent, String parentType, String name, ValueSet.ConceptReferenceComponent element, int index) {
12788    if (element == null) 
12789      return;
12790    Complex t;
12791    if (Utilities.noString(parentType))
12792      t = parent;
12793    else {
12794      t = parent.predicate("fhir:"+parentType+'.'+name);
12795    }
12796    composeBackboneElement(t, "concept", name, element, index);
12797    if (element.hasCodeElement())
12798      composeCode(t, "ValueSet", "code", element.getCodeElement(), -1);
12799    if (element.hasDisplayElement())
12800      composeString(t, "ValueSet", "display", element.getDisplayElement(), -1);
12801    for (int i = 0; i < element.getDesignation().size(); i++)
12802      composeValueSetConceptReferenceDesignationComponent(t, "ValueSet", "designation", element.getDesignation().get(i), i);
12803  }
12804
12805  protected void composeValueSetConceptReferenceDesignationComponent(Complex parent, String parentType, String name, ValueSet.ConceptReferenceDesignationComponent element, int index) {
12806    if (element == null) 
12807      return;
12808    Complex t;
12809    if (Utilities.noString(parentType))
12810      t = parent;
12811    else {
12812      t = parent.predicate("fhir:"+parentType+'.'+name);
12813    }
12814    composeBackboneElement(t, "designation", name, element, index);
12815    if (element.hasLanguageElement())
12816      composeCode(t, "ValueSet", "language", element.getLanguageElement(), -1);
12817    if (element.hasUse())
12818      composeCoding(t, "ValueSet", "use", element.getUse(), -1);
12819    if (element.hasValueElement())
12820      composeString(t, "ValueSet", "value", element.getValueElement(), -1);
12821  }
12822
12823  protected void composeValueSetConceptSetFilterComponent(Complex parent, String parentType, String name, ValueSet.ConceptSetFilterComponent element, int index) {
12824    if (element == null) 
12825      return;
12826    Complex t;
12827    if (Utilities.noString(parentType))
12828      t = parent;
12829    else {
12830      t = parent.predicate("fhir:"+parentType+'.'+name);
12831    }
12832    composeBackboneElement(t, "filter", name, element, index);
12833    if (element.hasPropertyElement())
12834      composeCode(t, "ValueSet", "property", element.getPropertyElement(), -1);
12835    if (element.hasOpElement())
12836      composeEnum(t, "ValueSet", "op", element.getOpElement(), -1);
12837    if (element.hasValueElement())
12838      composeCode(t, "ValueSet", "value", element.getValueElement(), -1);
12839  }
12840
12841  protected void composeValueSetValueSetExpansionComponent(Complex parent, String parentType, String name, ValueSet.ValueSetExpansionComponent element, int index) {
12842    if (element == null) 
12843      return;
12844    Complex t;
12845    if (Utilities.noString(parentType))
12846      t = parent;
12847    else {
12848      t = parent.predicate("fhir:"+parentType+'.'+name);
12849    }
12850    composeBackboneElement(t, "expansion", name, element, index);
12851    if (element.hasIdentifierElement())
12852      composeUri(t, "ValueSet", "identifier", element.getIdentifierElement(), -1);
12853    if (element.hasTimestampElement())
12854      composeDateTime(t, "ValueSet", "timestamp", element.getTimestampElement(), -1);
12855    if (element.hasTotalElement())
12856      composeInteger(t, "ValueSet", "total", element.getTotalElement(), -1);
12857    if (element.hasOffsetElement())
12858      composeInteger(t, "ValueSet", "offset", element.getOffsetElement(), -1);
12859    for (int i = 0; i < element.getParameter().size(); i++)
12860      composeValueSetValueSetExpansionParameterComponent(t, "ValueSet", "parameter", element.getParameter().get(i), i);
12861    for (int i = 0; i < element.getContains().size(); i++)
12862      composeValueSetValueSetExpansionContainsComponent(t, "ValueSet", "contains", element.getContains().get(i), i);
12863  }
12864
12865  protected void composeValueSetValueSetExpansionParameterComponent(Complex parent, String parentType, String name, ValueSet.ValueSetExpansionParameterComponent element, int index) {
12866    if (element == null) 
12867      return;
12868    Complex t;
12869    if (Utilities.noString(parentType))
12870      t = parent;
12871    else {
12872      t = parent.predicate("fhir:"+parentType+'.'+name);
12873    }
12874    composeBackboneElement(t, "parameter", name, element, index);
12875    if (element.hasNameElement())
12876      composeString(t, "ValueSet", "name", element.getNameElement(), -1);
12877    if (element.hasValue())
12878      composeType(t, "ValueSet", "value", element.getValue(), -1);
12879  }
12880
12881  protected void composeValueSetValueSetExpansionContainsComponent(Complex parent, String parentType, String name, ValueSet.ValueSetExpansionContainsComponent element, int index) {
12882    if (element == null) 
12883      return;
12884    Complex t;
12885    if (Utilities.noString(parentType))
12886      t = parent;
12887    else {
12888      t = parent.predicate("fhir:"+parentType+'.'+name);
12889    }
12890    composeBackboneElement(t, "contains", name, element, index);
12891    if (element.hasSystemElement())
12892      composeUri(t, "ValueSet", "system", element.getSystemElement(), -1);
12893    if (element.hasAbstractElement())
12894      composeBoolean(t, "ValueSet", "abstract", element.getAbstractElement(), -1);
12895    if (element.hasInactiveElement())
12896      composeBoolean(t, "ValueSet", "inactive", element.getInactiveElement(), -1);
12897    if (element.hasVersionElement())
12898      composeString(t, "ValueSet", "version", element.getVersionElement(), -1);
12899    if (element.hasCodeElement())
12900      composeCode(t, "ValueSet", "code", element.getCodeElement(), -1);
12901    if (element.hasDisplayElement())
12902      composeString(t, "ValueSet", "display", element.getDisplayElement(), -1);
12903    for (int i = 0; i < element.getDesignation().size(); i++)
12904      composeValueSetConceptReferenceDesignationComponent(t, "ValueSet", "designation", element.getDesignation().get(i), i);
12905    for (int i = 0; i < element.getContains().size(); i++)
12906      composeValueSetValueSetExpansionContainsComponent(t, "ValueSet", "contains", element.getContains().get(i), i);
12907  }
12908
12909  protected void composeVisionPrescription(Complex parent, String parentType, String name, VisionPrescription element, int index) {
12910    if (element == null) 
12911      return;
12912    Complex t;
12913    if (Utilities.noString(parentType))
12914      t = parent;
12915    else {
12916      t = parent.predicate("fhir:"+parentType+'.'+name);
12917    }
12918    composeDomainResource(t, "VisionPrescription", name, element, index);
12919    for (int i = 0; i < element.getIdentifier().size(); i++)
12920      composeIdentifier(t, "VisionPrescription", "identifier", element.getIdentifier().get(i), i);
12921    if (element.hasStatusElement())
12922      composeEnum(t, "VisionPrescription", "status", element.getStatusElement(), -1);
12923    if (element.hasPatient())
12924      composeReference(t, "VisionPrescription", "patient", element.getPatient(), -1);
12925    if (element.hasEncounter())
12926      composeReference(t, "VisionPrescription", "encounter", element.getEncounter(), -1);
12927    if (element.hasDateWrittenElement())
12928      composeDateTime(t, "VisionPrescription", "dateWritten", element.getDateWrittenElement(), -1);
12929    if (element.hasPrescriber())
12930      composeReference(t, "VisionPrescription", "prescriber", element.getPrescriber(), -1);
12931    if (element.hasReason())
12932      composeType(t, "VisionPrescription", "reason", element.getReason(), -1);
12933    for (int i = 0; i < element.getDispense().size(); i++)
12934      composeVisionPrescriptionVisionPrescriptionDispenseComponent(t, "VisionPrescription", "dispense", element.getDispense().get(i), i);
12935  }
12936
12937  protected void composeVisionPrescriptionVisionPrescriptionDispenseComponent(Complex parent, String parentType, String name, VisionPrescription.VisionPrescriptionDispenseComponent element, int index) {
12938    if (element == null) 
12939      return;
12940    Complex t;
12941    if (Utilities.noString(parentType))
12942      t = parent;
12943    else {
12944      t = parent.predicate("fhir:"+parentType+'.'+name);
12945    }
12946    composeBackboneElement(t, "dispense", name, element, index);
12947    if (element.hasProduct())
12948      composeCodeableConcept(t, "VisionPrescription", "product", element.getProduct(), -1);
12949    if (element.hasEyeElement())
12950      composeEnum(t, "VisionPrescription", "eye", element.getEyeElement(), -1);
12951    if (element.hasSphereElement())
12952      composeDecimal(t, "VisionPrescription", "sphere", element.getSphereElement(), -1);
12953    if (element.hasCylinderElement())
12954      composeDecimal(t, "VisionPrescription", "cylinder", element.getCylinderElement(), -1);
12955    if (element.hasAxisElement())
12956      composeInteger(t, "VisionPrescription", "axis", element.getAxisElement(), -1);
12957    if (element.hasPrismElement())
12958      composeDecimal(t, "VisionPrescription", "prism", element.getPrismElement(), -1);
12959    if (element.hasBaseElement())
12960      composeEnum(t, "VisionPrescription", "base", element.getBaseElement(), -1);
12961    if (element.hasAddElement())
12962      composeDecimal(t, "VisionPrescription", "add", element.getAddElement(), -1);
12963    if (element.hasPowerElement())
12964      composeDecimal(t, "VisionPrescription", "power", element.getPowerElement(), -1);
12965    if (element.hasBackCurveElement())
12966      composeDecimal(t, "VisionPrescription", "backCurve", element.getBackCurveElement(), -1);
12967    if (element.hasDiameterElement())
12968      composeDecimal(t, "VisionPrescription", "diameter", element.getDiameterElement(), -1);
12969    if (element.hasDuration())
12970      composeQuantity(t, "VisionPrescription", "duration", element.getDuration(), -1);
12971    if (element.hasColorElement())
12972      composeString(t, "VisionPrescription", "color", element.getColorElement(), -1);
12973    if (element.hasBrandElement())
12974      composeString(t, "VisionPrescription", "brand", element.getBrandElement(), -1);
12975    for (int i = 0; i < element.getNote().size(); i++)
12976      composeAnnotation(t, "VisionPrescription", "note", element.getNote().get(i), i);
12977  }
12978
12979  @Override
12980  protected void composeResource(Complex parent, Resource resource) {
12981    if (resource instanceof Parameters)
12982      composeParameters(parent, null, "Parameters", (Parameters)resource, -1);
12983    else if (resource instanceof Account)
12984      composeAccount(parent, null, "Account", (Account)resource, -1);
12985    else if (resource instanceof ActivityDefinition)
12986      composeActivityDefinition(parent, null, "ActivityDefinition", (ActivityDefinition)resource, -1);
12987    else if (resource instanceof AdverseEvent)
12988      composeAdverseEvent(parent, null, "AdverseEvent", (AdverseEvent)resource, -1);
12989    else if (resource instanceof AllergyIntolerance)
12990      composeAllergyIntolerance(parent, null, "AllergyIntolerance", (AllergyIntolerance)resource, -1);
12991    else if (resource instanceof Appointment)
12992      composeAppointment(parent, null, "Appointment", (Appointment)resource, -1);
12993    else if (resource instanceof AppointmentResponse)
12994      composeAppointmentResponse(parent, null, "AppointmentResponse", (AppointmentResponse)resource, -1);
12995    else if (resource instanceof AuditEvent)
12996      composeAuditEvent(parent, null, "AuditEvent", (AuditEvent)resource, -1);
12997    else if (resource instanceof Basic)
12998      composeBasic(parent, null, "Basic", (Basic)resource, -1);
12999    else if (resource instanceof Binary)
13000      composeBinary(parent, null, "Binary", (Binary)resource, -1);
13001    else if (resource instanceof BodySite)
13002      composeBodySite(parent, null, "BodySite", (BodySite)resource, -1);
13003    else if (resource instanceof Bundle)
13004      composeBundle(parent, null, "Bundle", (Bundle)resource, -1);
13005    else if (resource instanceof CapabilityStatement)
13006      composeCapabilityStatement(parent, null, "CapabilityStatement", (CapabilityStatement)resource, -1);
13007    else if (resource instanceof CarePlan)
13008      composeCarePlan(parent, null, "CarePlan", (CarePlan)resource, -1);
13009    else if (resource instanceof CareTeam)
13010      composeCareTeam(parent, null, "CareTeam", (CareTeam)resource, -1);
13011    else if (resource instanceof ChargeItem)
13012      composeChargeItem(parent, null, "ChargeItem", (ChargeItem)resource, -1);
13013    else if (resource instanceof Claim)
13014      composeClaim(parent, null, "Claim", (Claim)resource, -1);
13015    else if (resource instanceof ClaimResponse)
13016      composeClaimResponse(parent, null, "ClaimResponse", (ClaimResponse)resource, -1);
13017    else if (resource instanceof ClinicalImpression)
13018      composeClinicalImpression(parent, null, "ClinicalImpression", (ClinicalImpression)resource, -1);
13019    else if (resource instanceof CodeSystem)
13020      composeCodeSystem(parent, null, "CodeSystem", (CodeSystem)resource, -1);
13021    else if (resource instanceof Communication)
13022      composeCommunication(parent, null, "Communication", (Communication)resource, -1);
13023    else if (resource instanceof CommunicationRequest)
13024      composeCommunicationRequest(parent, null, "CommunicationRequest", (CommunicationRequest)resource, -1);
13025    else if (resource instanceof CompartmentDefinition)
13026      composeCompartmentDefinition(parent, null, "CompartmentDefinition", (CompartmentDefinition)resource, -1);
13027    else if (resource instanceof Composition)
13028      composeComposition(parent, null, "Composition", (Composition)resource, -1);
13029    else if (resource instanceof ConceptMap)
13030      composeConceptMap(parent, null, "ConceptMap", (ConceptMap)resource, -1);
13031    else if (resource instanceof Condition)
13032      composeCondition(parent, null, "Condition", (Condition)resource, -1);
13033    else if (resource instanceof Consent)
13034      composeConsent(parent, null, "Consent", (Consent)resource, -1);
13035    else if (resource instanceof Contract)
13036      composeContract(parent, null, "Contract", (Contract)resource, -1);
13037    else if (resource instanceof Coverage)
13038      composeCoverage(parent, null, "Coverage", (Coverage)resource, -1);
13039    else if (resource instanceof DataElement)
13040      composeDataElement(parent, null, "DataElement", (DataElement)resource, -1);
13041    else if (resource instanceof DetectedIssue)
13042      composeDetectedIssue(parent, null, "DetectedIssue", (DetectedIssue)resource, -1);
13043    else if (resource instanceof Device)
13044      composeDevice(parent, null, "Device", (Device)resource, -1);
13045    else if (resource instanceof DeviceComponent)
13046      composeDeviceComponent(parent, null, "DeviceComponent", (DeviceComponent)resource, -1);
13047    else if (resource instanceof DeviceMetric)
13048      composeDeviceMetric(parent, null, "DeviceMetric", (DeviceMetric)resource, -1);
13049    else if (resource instanceof DeviceRequest)
13050      composeDeviceRequest(parent, null, "DeviceRequest", (DeviceRequest)resource, -1);
13051    else if (resource instanceof DeviceUseStatement)
13052      composeDeviceUseStatement(parent, null, "DeviceUseStatement", (DeviceUseStatement)resource, -1);
13053    else if (resource instanceof DiagnosticReport)
13054      composeDiagnosticReport(parent, null, "DiagnosticReport", (DiagnosticReport)resource, -1);
13055    else if (resource instanceof DocumentManifest)
13056      composeDocumentManifest(parent, null, "DocumentManifest", (DocumentManifest)resource, -1);
13057    else if (resource instanceof DocumentReference)
13058      composeDocumentReference(parent, null, "DocumentReference", (DocumentReference)resource, -1);
13059    else if (resource instanceof EligibilityRequest)
13060      composeEligibilityRequest(parent, null, "EligibilityRequest", (EligibilityRequest)resource, -1);
13061    else if (resource instanceof EligibilityResponse)
13062      composeEligibilityResponse(parent, null, "EligibilityResponse", (EligibilityResponse)resource, -1);
13063    else if (resource instanceof Encounter)
13064      composeEncounter(parent, null, "Encounter", (Encounter)resource, -1);
13065    else if (resource instanceof Endpoint)
13066      composeEndpoint(parent, null, "Endpoint", (Endpoint)resource, -1);
13067    else if (resource instanceof EnrollmentRequest)
13068      composeEnrollmentRequest(parent, null, "EnrollmentRequest", (EnrollmentRequest)resource, -1);
13069    else if (resource instanceof EnrollmentResponse)
13070      composeEnrollmentResponse(parent, null, "EnrollmentResponse", (EnrollmentResponse)resource, -1);
13071    else if (resource instanceof EpisodeOfCare)
13072      composeEpisodeOfCare(parent, null, "EpisodeOfCare", (EpisodeOfCare)resource, -1);
13073    else if (resource instanceof ExpansionProfile)
13074      composeExpansionProfile(parent, null, "ExpansionProfile", (ExpansionProfile)resource, -1);
13075    else if (resource instanceof ExplanationOfBenefit)
13076      composeExplanationOfBenefit(parent, null, "ExplanationOfBenefit", (ExplanationOfBenefit)resource, -1);
13077    else if (resource instanceof FamilyMemberHistory)
13078      composeFamilyMemberHistory(parent, null, "FamilyMemberHistory", (FamilyMemberHistory)resource, -1);
13079    else if (resource instanceof Flag)
13080      composeFlag(parent, null, "Flag", (Flag)resource, -1);
13081    else if (resource instanceof Goal)
13082      composeGoal(parent, null, "Goal", (Goal)resource, -1);
13083    else if (resource instanceof GraphDefinition)
13084      composeGraphDefinition(parent, null, "GraphDefinition", (GraphDefinition)resource, -1);
13085    else if (resource instanceof Group)
13086      composeGroup(parent, null, "Group", (Group)resource, -1);
13087    else if (resource instanceof GuidanceResponse)
13088      composeGuidanceResponse(parent, null, "GuidanceResponse", (GuidanceResponse)resource, -1);
13089    else if (resource instanceof HealthcareService)
13090      composeHealthcareService(parent, null, "HealthcareService", (HealthcareService)resource, -1);
13091    else if (resource instanceof ImagingManifest)
13092      composeImagingManifest(parent, null, "ImagingManifest", (ImagingManifest)resource, -1);
13093    else if (resource instanceof ImagingStudy)
13094      composeImagingStudy(parent, null, "ImagingStudy", (ImagingStudy)resource, -1);
13095    else if (resource instanceof Immunization)
13096      composeImmunization(parent, null, "Immunization", (Immunization)resource, -1);
13097    else if (resource instanceof ImmunizationRecommendation)
13098      composeImmunizationRecommendation(parent, null, "ImmunizationRecommendation", (ImmunizationRecommendation)resource, -1);
13099    else if (resource instanceof ImplementationGuide)
13100      composeImplementationGuide(parent, null, "ImplementationGuide", (ImplementationGuide)resource, -1);
13101    else if (resource instanceof Library)
13102      composeLibrary(parent, null, "Library", (Library)resource, -1);
13103    else if (resource instanceof Linkage)
13104      composeLinkage(parent, null, "Linkage", (Linkage)resource, -1);
13105    else if (resource instanceof ListResource)
13106      composeListResource(parent, null, "ListResource", (ListResource)resource, -1);
13107    else if (resource instanceof Location)
13108      composeLocation(parent, null, "Location", (Location)resource, -1);
13109    else if (resource instanceof Measure)
13110      composeMeasure(parent, null, "Measure", (Measure)resource, -1);
13111    else if (resource instanceof MeasureReport)
13112      composeMeasureReport(parent, null, "MeasureReport", (MeasureReport)resource, -1);
13113    else if (resource instanceof Media)
13114      composeMedia(parent, null, "Media", (Media)resource, -1);
13115    else if (resource instanceof Medication)
13116      composeMedication(parent, null, "Medication", (Medication)resource, -1);
13117    else if (resource instanceof MedicationAdministration)
13118      composeMedicationAdministration(parent, null, "MedicationAdministration", (MedicationAdministration)resource, -1);
13119    else if (resource instanceof MedicationDispense)
13120      composeMedicationDispense(parent, null, "MedicationDispense", (MedicationDispense)resource, -1);
13121    else if (resource instanceof MedicationRequest)
13122      composeMedicationRequest(parent, null, "MedicationRequest", (MedicationRequest)resource, -1);
13123    else if (resource instanceof MedicationStatement)
13124      composeMedicationStatement(parent, null, "MedicationStatement", (MedicationStatement)resource, -1);
13125    else if (resource instanceof MessageDefinition)
13126      composeMessageDefinition(parent, null, "MessageDefinition", (MessageDefinition)resource, -1);
13127    else if (resource instanceof MessageHeader)
13128      composeMessageHeader(parent, null, "MessageHeader", (MessageHeader)resource, -1);
13129    else if (resource instanceof NamingSystem)
13130      composeNamingSystem(parent, null, "NamingSystem", (NamingSystem)resource, -1);
13131    else if (resource instanceof NutritionOrder)
13132      composeNutritionOrder(parent, null, "NutritionOrder", (NutritionOrder)resource, -1);
13133    else if (resource instanceof Observation)
13134      composeObservation(parent, null, "Observation", (Observation)resource, -1);
13135    else if (resource instanceof OperationDefinition)
13136      composeOperationDefinition(parent, null, "OperationDefinition", (OperationDefinition)resource, -1);
13137    else if (resource instanceof OperationOutcome)
13138      composeOperationOutcome(parent, null, "OperationOutcome", (OperationOutcome)resource, -1);
13139    else if (resource instanceof Organization)
13140      composeOrganization(parent, null, "Organization", (Organization)resource, -1);
13141    else if (resource instanceof Patient)
13142      composePatient(parent, null, "Patient", (Patient)resource, -1);
13143    else if (resource instanceof PaymentNotice)
13144      composePaymentNotice(parent, null, "PaymentNotice", (PaymentNotice)resource, -1);
13145    else if (resource instanceof PaymentReconciliation)
13146      composePaymentReconciliation(parent, null, "PaymentReconciliation", (PaymentReconciliation)resource, -1);
13147    else if (resource instanceof Person)
13148      composePerson(parent, null, "Person", (Person)resource, -1);
13149    else if (resource instanceof PlanDefinition)
13150      composePlanDefinition(parent, null, "PlanDefinition", (PlanDefinition)resource, -1);
13151    else if (resource instanceof Practitioner)
13152      composePractitioner(parent, null, "Practitioner", (Practitioner)resource, -1);
13153    else if (resource instanceof PractitionerRole)
13154      composePractitionerRole(parent, null, "PractitionerRole", (PractitionerRole)resource, -1);
13155    else if (resource instanceof Procedure)
13156      composeProcedure(parent, null, "Procedure", (Procedure)resource, -1);
13157    else if (resource instanceof ProcedureRequest)
13158      composeProcedureRequest(parent, null, "ProcedureRequest", (ProcedureRequest)resource, -1);
13159    else if (resource instanceof ProcessRequest)
13160      composeProcessRequest(parent, null, "ProcessRequest", (ProcessRequest)resource, -1);
13161    else if (resource instanceof ProcessResponse)
13162      composeProcessResponse(parent, null, "ProcessResponse", (ProcessResponse)resource, -1);
13163    else if (resource instanceof Provenance)
13164      composeProvenance(parent, null, "Provenance", (Provenance)resource, -1);
13165    else if (resource instanceof Questionnaire)
13166      composeQuestionnaire(parent, null, "Questionnaire", (Questionnaire)resource, -1);
13167    else if (resource instanceof QuestionnaireResponse)
13168      composeQuestionnaireResponse(parent, null, "QuestionnaireResponse", (QuestionnaireResponse)resource, -1);
13169    else if (resource instanceof ReferralRequest)
13170      composeReferralRequest(parent, null, "ReferralRequest", (ReferralRequest)resource, -1);
13171    else if (resource instanceof RelatedPerson)
13172      composeRelatedPerson(parent, null, "RelatedPerson", (RelatedPerson)resource, -1);
13173    else if (resource instanceof RequestGroup)
13174      composeRequestGroup(parent, null, "RequestGroup", (RequestGroup)resource, -1);
13175    else if (resource instanceof ResearchStudy)
13176      composeResearchStudy(parent, null, "ResearchStudy", (ResearchStudy)resource, -1);
13177    else if (resource instanceof ResearchSubject)
13178      composeResearchSubject(parent, null, "ResearchSubject", (ResearchSubject)resource, -1);
13179    else if (resource instanceof RiskAssessment)
13180      composeRiskAssessment(parent, null, "RiskAssessment", (RiskAssessment)resource, -1);
13181    else if (resource instanceof Schedule)
13182      composeSchedule(parent, null, "Schedule", (Schedule)resource, -1);
13183    else if (resource instanceof SearchParameter)
13184      composeSearchParameter(parent, null, "SearchParameter", (SearchParameter)resource, -1);
13185    else if (resource instanceof Sequence)
13186      composeSequence(parent, null, "Sequence", (Sequence)resource, -1);
13187    else if (resource instanceof ServiceDefinition)
13188      composeServiceDefinition(parent, null, "ServiceDefinition", (ServiceDefinition)resource, -1);
13189    else if (resource instanceof Slot)
13190      composeSlot(parent, null, "Slot", (Slot)resource, -1);
13191    else if (resource instanceof Specimen)
13192      composeSpecimen(parent, null, "Specimen", (Specimen)resource, -1);
13193    else if (resource instanceof StructureDefinition)
13194      composeStructureDefinition(parent, null, "StructureDefinition", (StructureDefinition)resource, -1);
13195    else if (resource instanceof StructureMap)
13196      composeStructureMap(parent, null, "StructureMap", (StructureMap)resource, -1);
13197    else if (resource instanceof Subscription)
13198      composeSubscription(parent, null, "Subscription", (Subscription)resource, -1);
13199    else if (resource instanceof Substance)
13200      composeSubstance(parent, null, "Substance", (Substance)resource, -1);
13201    else if (resource instanceof SupplyDelivery)
13202      composeSupplyDelivery(parent, null, "SupplyDelivery", (SupplyDelivery)resource, -1);
13203    else if (resource instanceof SupplyRequest)
13204      composeSupplyRequest(parent, null, "SupplyRequest", (SupplyRequest)resource, -1);
13205    else if (resource instanceof Task)
13206      composeTask(parent, null, "Task", (Task)resource, -1);
13207    else if (resource instanceof TestReport)
13208      composeTestReport(parent, null, "TestReport", (TestReport)resource, -1);
13209    else if (resource instanceof TestScript)
13210      composeTestScript(parent, null, "TestScript", (TestScript)resource, -1);
13211    else if (resource instanceof ValueSet)
13212      composeValueSet(parent, null, "ValueSet", (ValueSet)resource, -1);
13213    else if (resource instanceof VisionPrescription)
13214      composeVisionPrescription(parent, null, "VisionPrescription", (VisionPrescription)resource, -1);
13215    else
13216      throw new Error("Unhandled resource type "+resource.getClass().getName());
13217  }
13218
13219  protected void composeType(Complex parent, String parentType, String name, Type value, int index) {
13220    if (value == null)
13221      return;
13222    else if (value instanceof DateType)
13223      composeDate(parent, parentType, name, (DateType)value, index);
13224    else if (value instanceof DateTimeType)
13225      composeDateTime(parent, parentType, name, (DateTimeType)value, index);
13226    else if (value instanceof CodeType)
13227      composeCode(parent, parentType, name, (CodeType)value, index);
13228    else if (value instanceof StringType)
13229      composeString(parent, parentType, name, (StringType)value, index);
13230    else if (value instanceof IntegerType)
13231      composeInteger(parent, parentType, name, (IntegerType)value, index);
13232    else if (value instanceof OidType)
13233      composeOid(parent, parentType, name, (OidType)value, index);
13234    else if (value instanceof UriType)
13235      composeUri(parent, parentType, name, (UriType)value, index);
13236    else if (value instanceof UuidType)
13237      composeUuid(parent, parentType, name, (UuidType)value, index);
13238    else if (value instanceof InstantType)
13239      composeInstant(parent, parentType, name, (InstantType)value, index);
13240    else if (value instanceof BooleanType)
13241      composeBoolean(parent, parentType, name, (BooleanType)value, index);
13242    else if (value instanceof Base64BinaryType)
13243      composeBase64Binary(parent, parentType, name, (Base64BinaryType)value, index);
13244    else if (value instanceof UnsignedIntType)
13245      composeUnsignedInt(parent, parentType, name, (UnsignedIntType)value, index);
13246    else if (value instanceof MarkdownType)
13247      composeMarkdown(parent, parentType, name, (MarkdownType)value, index);
13248    else if (value instanceof TimeType)
13249      composeTime(parent, parentType, name, (TimeType)value, index);
13250    else if (value instanceof IdType)
13251      composeId(parent, parentType, name, (IdType)value, index);
13252    else if (value instanceof PositiveIntType)
13253      composePositiveInt(parent, parentType, name, (PositiveIntType)value, index);
13254    else if (value instanceof DecimalType)
13255      composeDecimal(parent, parentType, name, (DecimalType)value, index);
13256    else if (value instanceof Extension)
13257      composeExtension(parent, parentType, name, (Extension)value, index);
13258    else if (value instanceof Narrative)
13259      composeNarrative(parent, parentType, name, (Narrative)value, index);
13260    else if (value instanceof Reference)
13261      composeReference(parent, parentType, name, (Reference)value, index);
13262    else if (value instanceof Quantity)
13263      composeQuantity(parent, parentType, name, (Quantity)value, index);
13264    else if (value instanceof Period)
13265      composePeriod(parent, parentType, name, (Period)value, index);
13266    else if (value instanceof Attachment)
13267      composeAttachment(parent, parentType, name, (Attachment)value, index);
13268    else if (value instanceof Duration)
13269      composeDuration(parent, parentType, name, (Duration)value, index);
13270    else if (value instanceof Count)
13271      composeCount(parent, parentType, name, (Count)value, index);
13272    else if (value instanceof Range)
13273      composeRange(parent, parentType, name, (Range)value, index);
13274    else if (value instanceof Annotation)
13275      composeAnnotation(parent, parentType, name, (Annotation)value, index);
13276    else if (value instanceof Money)
13277      composeMoney(parent, parentType, name, (Money)value, index);
13278    else if (value instanceof Identifier)
13279      composeIdentifier(parent, parentType, name, (Identifier)value, index);
13280    else if (value instanceof Coding)
13281      composeCoding(parent, parentType, name, (Coding)value, index);
13282    else if (value instanceof Signature)
13283      composeSignature(parent, parentType, name, (Signature)value, index);
13284    else if (value instanceof SampledData)
13285      composeSampledData(parent, parentType, name, (SampledData)value, index);
13286    else if (value instanceof Ratio)
13287      composeRatio(parent, parentType, name, (Ratio)value, index);
13288    else if (value instanceof Distance)
13289      composeDistance(parent, parentType, name, (Distance)value, index);
13290    else if (value instanceof Age)
13291      composeAge(parent, parentType, name, (Age)value, index);
13292    else if (value instanceof CodeableConcept)
13293      composeCodeableConcept(parent, parentType, name, (CodeableConcept)value, index);
13294    else if (value instanceof Meta)
13295      composeMeta(parent, parentType, name, (Meta)value, index);
13296    else if (value instanceof Address)
13297      composeAddress(parent, parentType, name, (Address)value, index);
13298    else if (value instanceof TriggerDefinition)
13299      composeTriggerDefinition(parent, parentType, name, (TriggerDefinition)value, index);
13300    else if (value instanceof Contributor)
13301      composeContributor(parent, parentType, name, (Contributor)value, index);
13302    else if (value instanceof DataRequirement)
13303      composeDataRequirement(parent, parentType, name, (DataRequirement)value, index);
13304    else if (value instanceof Dosage)
13305      composeDosage(parent, parentType, name, (Dosage)value, index);
13306    else if (value instanceof RelatedArtifact)
13307      composeRelatedArtifact(parent, parentType, name, (RelatedArtifact)value, index);
13308    else if (value instanceof ContactDetail)
13309      composeContactDetail(parent, parentType, name, (ContactDetail)value, index);
13310    else if (value instanceof HumanName)
13311      composeHumanName(parent, parentType, name, (HumanName)value, index);
13312    else if (value instanceof ContactPoint)
13313      composeContactPoint(parent, parentType, name, (ContactPoint)value, index);
13314    else if (value instanceof UsageContext)
13315      composeUsageContext(parent, parentType, name, (UsageContext)value, index);
13316    else if (value instanceof Timing)
13317      composeTiming(parent, parentType, name, (Timing)value, index);
13318    else if (value instanceof ElementDefinition)
13319      composeElementDefinition(parent, parentType, name, (ElementDefinition)value, index);
13320    else if (value instanceof ParameterDefinition)
13321      composeParameterDefinition(parent, parentType, name, (ParameterDefinition)value, index);
13322    else
13323      throw new Error("Unhandled type");
13324  }
13325
13326}