001package org.hl7.fhir.dstu3.formats;
002
003import java.io.IOException;
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034// Generated on Mon, Apr 17, 2017 08:38+1000 for FHIR v3.0.x
035import org.hl7.fhir.dstu3.model.*;
036import org.hl7.fhir.exceptions.FHIRFormatError;
037import org.hl7.fhir.utilities.Utilities;
038import org.xmlpull.v1.XmlPullParser;
039import org.xmlpull.v1.XmlPullParserException;
040
041public class XmlParser extends XmlParserBase {
042
043  public XmlParser() {
044    super();
045  }
046
047  public XmlParser(boolean allowUnknownContent) {
048    super();
049    setAllowUnknownContent(allowUnknownContent);
050  }
051
052
053  protected boolean parseElementContent(int eventType, XmlPullParser xpp, Element res) throws XmlPullParserException, IOException, FHIRFormatError {
054    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("extension")) 
055      res.getExtension().add(parseExtension(xpp));
056    else
057      return false;
058      
059    return true;
060  }
061
062  protected boolean parseBackboneContent(int eventType, XmlPullParser xpp, BackboneElement res) throws XmlPullParserException, IOException, FHIRFormatError {
063    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifierExtension")) 
064      res.getModifierExtension().add(parseExtension(xpp));
065    else
066      return parseElementContent(eventType, xpp, res);
067      
068    return true;
069  }
070
071  @SuppressWarnings("unchecked")
072  protected <E extends Enum<E>> Enumeration<E> parseEnumeration(XmlPullParser xpp, E item, EnumFactory e) throws XmlPullParserException, IOException, FHIRFormatError {
073    Enumeration<E> res = new Enumeration<E>(e);
074    parseElementAttributes(xpp, res);
075    res.setValue((E) e.fromCode(xpp.getAttributeValue(null, "value")));
076    next(xpp);
077    int eventType = nextNoWhitespace(xpp);
078    while (eventType != XmlPullParser.END_TAG) {
079      if (!parseElementContent(eventType, xpp, res))
080        unknownContent(xpp);
081      eventType = nextNoWhitespace(xpp);
082    }
083    next(xpp);
084    parseElementClose(res);
085    return res;
086  }
087
088  protected DateType parseDate(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
089    DateType res = new DateType(xpp.getAttributeValue(null, "value"));
090    parseElementAttributes(xpp, res);
091    next(xpp);
092    int eventType = nextNoWhitespace(xpp);
093    while (eventType != XmlPullParser.END_TAG) {
094      if (!parseElementContent(eventType, xpp, res))
095        unknownContent(xpp);
096      eventType = nextNoWhitespace(xpp);
097    }
098    next(xpp);
099    parseElementClose(res);
100    return res;
101  }
102
103  protected DateTimeType parseDateTime(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
104    DateTimeType res = new DateTimeType(xpp.getAttributeValue(null, "value"));
105    parseElementAttributes(xpp, res);
106    next(xpp);
107    int eventType = nextNoWhitespace(xpp);
108    while (eventType != XmlPullParser.END_TAG) {
109      if (!parseElementContent(eventType, xpp, res))
110        unknownContent(xpp);
111      eventType = nextNoWhitespace(xpp);
112    }
113    next(xpp);
114    parseElementClose(res);
115    return res;
116  }
117
118  protected CodeType parseCode(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
119    CodeType res = new CodeType(xpp.getAttributeValue(null, "value"));
120    parseElementAttributes(xpp, res);
121    next(xpp);
122    int eventType = nextNoWhitespace(xpp);
123    while (eventType != XmlPullParser.END_TAG) {
124      if (!parseElementContent(eventType, xpp, res))
125        unknownContent(xpp);
126      eventType = nextNoWhitespace(xpp);
127    }
128    next(xpp);
129    parseElementClose(res);
130    return res;
131  }
132
133  protected StringType parseString(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
134    StringType res = new StringType(xpp.getAttributeValue(null, "value"));
135    parseElementAttributes(xpp, res);
136    next(xpp);
137    int eventType = nextNoWhitespace(xpp);
138    while (eventType != XmlPullParser.END_TAG) {
139      if (!parseElementContent(eventType, xpp, res))
140        unknownContent(xpp);
141      eventType = nextNoWhitespace(xpp);
142    }
143    next(xpp);
144    parseElementClose(res);
145    return res;
146  }
147
148  protected IntegerType parseInteger(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
149    IntegerType res = new IntegerType(xpp.getAttributeValue(null, "value"));
150    parseElementAttributes(xpp, res);
151    next(xpp);
152    int eventType = nextNoWhitespace(xpp);
153    while (eventType != XmlPullParser.END_TAG) {
154      if (!parseElementContent(eventType, xpp, res))
155        unknownContent(xpp);
156      eventType = nextNoWhitespace(xpp);
157    }
158    next(xpp);
159    parseElementClose(res);
160    return res;
161  }
162
163  protected OidType parseOid(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
164    OidType res = new OidType(xpp.getAttributeValue(null, "value"));
165    parseElementAttributes(xpp, res);
166    next(xpp);
167    int eventType = nextNoWhitespace(xpp);
168    while (eventType != XmlPullParser.END_TAG) {
169      if (!parseElementContent(eventType, xpp, res))
170        unknownContent(xpp);
171      eventType = nextNoWhitespace(xpp);
172    }
173    next(xpp);
174    parseElementClose(res);
175    return res;
176  }
177
178  protected UriType parseUri(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
179    UriType res = new UriType(xpp.getAttributeValue(null, "value"));
180    parseElementAttributes(xpp, res);
181    next(xpp);
182    int eventType = nextNoWhitespace(xpp);
183    while (eventType != XmlPullParser.END_TAG) {
184      if (!parseElementContent(eventType, xpp, res))
185        unknownContent(xpp);
186      eventType = nextNoWhitespace(xpp);
187    }
188    next(xpp);
189    parseElementClose(res);
190    return res;
191  }
192
193  protected UuidType parseUuid(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
194    UuidType res = new UuidType(xpp.getAttributeValue(null, "value"));
195    parseElementAttributes(xpp, res);
196    next(xpp);
197    int eventType = nextNoWhitespace(xpp);
198    while (eventType != XmlPullParser.END_TAG) {
199      if (!parseElementContent(eventType, xpp, res))
200        unknownContent(xpp);
201      eventType = nextNoWhitespace(xpp);
202    }
203    next(xpp);
204    parseElementClose(res);
205    return res;
206  }
207
208  protected InstantType parseInstant(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
209    InstantType res = new InstantType(xpp.getAttributeValue(null, "value"));
210    parseElementAttributes(xpp, res);
211    next(xpp);
212    int eventType = nextNoWhitespace(xpp);
213    while (eventType != XmlPullParser.END_TAG) {
214      if (!parseElementContent(eventType, xpp, res))
215        unknownContent(xpp);
216      eventType = nextNoWhitespace(xpp);
217    }
218    next(xpp);
219    parseElementClose(res);
220    return res;
221  }
222
223  protected BooleanType parseBoolean(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
224    BooleanType res = new BooleanType(xpp.getAttributeValue(null, "value"));
225    parseElementAttributes(xpp, res);
226    next(xpp);
227    int eventType = nextNoWhitespace(xpp);
228    while (eventType != XmlPullParser.END_TAG) {
229      if (!parseElementContent(eventType, xpp, res))
230        unknownContent(xpp);
231      eventType = nextNoWhitespace(xpp);
232    }
233    next(xpp);
234    parseElementClose(res);
235    return res;
236  }
237
238  protected Base64BinaryType parseBase64Binary(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
239    Base64BinaryType res = new Base64BinaryType(xpp.getAttributeValue(null, "value"));
240    parseElementAttributes(xpp, res);
241    next(xpp);
242    int eventType = nextNoWhitespace(xpp);
243    while (eventType != XmlPullParser.END_TAG) {
244      if (!parseElementContent(eventType, xpp, res))
245        unknownContent(xpp);
246      eventType = nextNoWhitespace(xpp);
247    }
248    next(xpp);
249    parseElementClose(res);
250    return res;
251  }
252
253  protected UnsignedIntType parseUnsignedInt(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
254    UnsignedIntType res = new UnsignedIntType(xpp.getAttributeValue(null, "value"));
255    parseElementAttributes(xpp, res);
256    next(xpp);
257    int eventType = nextNoWhitespace(xpp);
258    while (eventType != XmlPullParser.END_TAG) {
259      if (!parseElementContent(eventType, xpp, res))
260        unknownContent(xpp);
261      eventType = nextNoWhitespace(xpp);
262    }
263    next(xpp);
264    parseElementClose(res);
265    return res;
266  }
267
268  protected MarkdownType parseMarkdown(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
269    MarkdownType res = new MarkdownType(xpp.getAttributeValue(null, "value"));
270    parseElementAttributes(xpp, res);
271    next(xpp);
272    int eventType = nextNoWhitespace(xpp);
273    while (eventType != XmlPullParser.END_TAG) {
274      if (!parseElementContent(eventType, xpp, res))
275        unknownContent(xpp);
276      eventType = nextNoWhitespace(xpp);
277    }
278    next(xpp);
279    parseElementClose(res);
280    return res;
281  }
282
283  protected TimeType parseTime(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
284    TimeType res = new TimeType(xpp.getAttributeValue(null, "value"));
285    parseElementAttributes(xpp, res);
286    next(xpp);
287    int eventType = nextNoWhitespace(xpp);
288    while (eventType != XmlPullParser.END_TAG) {
289      if (!parseElementContent(eventType, xpp, res))
290        unknownContent(xpp);
291      eventType = nextNoWhitespace(xpp);
292    }
293    next(xpp);
294    parseElementClose(res);
295    return res;
296  }
297
298  protected IdType parseId(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
299    IdType res = new IdType(xpp.getAttributeValue(null, "value"));
300    parseElementAttributes(xpp, res);
301    next(xpp);
302    int eventType = nextNoWhitespace(xpp);
303    while (eventType != XmlPullParser.END_TAG) {
304      if (!parseElementContent(eventType, xpp, res))
305        unknownContent(xpp);
306      eventType = nextNoWhitespace(xpp);
307    }
308    next(xpp);
309    parseElementClose(res);
310    return res;
311  }
312
313  protected PositiveIntType parsePositiveInt(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
314    PositiveIntType res = new PositiveIntType(xpp.getAttributeValue(null, "value"));
315    parseElementAttributes(xpp, res);
316    next(xpp);
317    int eventType = nextNoWhitespace(xpp);
318    while (eventType != XmlPullParser.END_TAG) {
319      if (!parseElementContent(eventType, xpp, res))
320        unknownContent(xpp);
321      eventType = nextNoWhitespace(xpp);
322    }
323    next(xpp);
324    parseElementClose(res);
325    return res;
326  }
327
328  protected DecimalType parseDecimal(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
329    DecimalType res = new DecimalType(xpp.getAttributeValue(null, "value"));
330    parseElementAttributes(xpp, res);
331    next(xpp);
332    int eventType = nextNoWhitespace(xpp);
333    while (eventType != XmlPullParser.END_TAG) {
334      if (!parseElementContent(eventType, xpp, res))
335        unknownContent(xpp);
336      eventType = nextNoWhitespace(xpp);
337    }
338    next(xpp);
339    parseElementClose(res);
340    return res;
341  }
342
343  protected Extension parseExtension(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
344    Extension res = new Extension();
345    parseElementAttributes(xpp, res);
346    if (xpp.getAttributeValue(null, "url") != null)
347        res.setUrl(xpp.getAttributeValue(null, "url"));
348    next(xpp);
349    int eventType = nextNoWhitespace(xpp);
350    while (eventType != XmlPullParser.END_TAG) {
351  if (!parseExtensionContent(eventType, xpp, res))
352        unknownContent(xpp);
353      eventType = nextNoWhitespace(xpp);
354    }
355    next(xpp);
356    parseElementClose(res);
357    return res;
358  }
359
360  protected boolean parseExtensionContent(int eventType, XmlPullParser xpp, Extension res) throws XmlPullParserException, IOException, FHIRFormatError {
361      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
362        res.setValue(parseType("value", xpp));
363      } else if (!parseElementContent(eventType, xpp, res))
364        return false;
365    return true;
366  }
367
368  protected Narrative parseNarrative(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
369    Narrative res = new Narrative();
370    parseElementAttributes(xpp, res);
371    next(xpp);
372    int eventType = nextNoWhitespace(xpp);
373    while (eventType != XmlPullParser.END_TAG) {
374  if (!parseNarrativeContent(eventType, xpp, res))
375        unknownContent(xpp);
376      eventType = nextNoWhitespace(xpp);
377    }
378    next(xpp);
379    parseElementClose(res);
380    return res;
381  }
382
383  protected boolean parseNarrativeContent(int eventType, XmlPullParser xpp, Narrative res) throws XmlPullParserException, IOException, FHIRFormatError {
384      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
385        res.setStatusElement(parseEnumeration(xpp, Narrative.NarrativeStatus.NULL, new Narrative.NarrativeStatusEnumFactory()));
386      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("div")) {
387        res.setDiv(parseXhtml(xpp));
388      } else if (!parseElementContent(eventType, xpp, res))
389        return false;
390    return true;
391  }
392
393  protected Reference parseReference(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
394    Reference res = new Reference();
395    parseTypeAttributes(xpp, res);
396    next(xpp);
397    int eventType = nextNoWhitespace(xpp);
398    while (eventType != XmlPullParser.END_TAG) {
399  if (!parseReferenceContent(eventType, xpp, res))
400        unknownContent(xpp);
401      eventType = nextNoWhitespace(xpp);
402    }
403    next(xpp);
404    parseElementClose(res);
405    return res;
406  }
407
408  protected boolean parseReferenceContent(int eventType, XmlPullParser xpp, Reference res) throws XmlPullParserException, IOException, FHIRFormatError {
409      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
410        res.setReferenceElement(parseString(xpp));
411      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
412        res.setIdentifier(parseIdentifier(xpp));
413      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
414        res.setDisplayElement(parseString(xpp));
415      } else if (!parseElementContent(eventType, xpp, res))
416        return false;
417    return true;
418  }
419
420  protected Quantity parseQuantity(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
421    Quantity res = new Quantity();
422    parseTypeAttributes(xpp, res);
423    next(xpp);
424    int eventType = nextNoWhitespace(xpp);
425    while (eventType != XmlPullParser.END_TAG) {
426  if (!parseQuantityContent(eventType, xpp, res))
427        unknownContent(xpp);
428      eventType = nextNoWhitespace(xpp);
429    }
430    next(xpp);
431    parseElementClose(res);
432    return res;
433  }
434
435  protected boolean parseQuantityContent(int eventType, XmlPullParser xpp, Quantity res) throws XmlPullParserException, IOException, FHIRFormatError {
436      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
437        res.setValueElement(parseDecimal(xpp));
438      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comparator")) {
439        res.setComparatorElement(parseEnumeration(xpp, Quantity.QuantityComparator.NULL, new Quantity.QuantityComparatorEnumFactory()));
440      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unit")) {
441        res.setUnitElement(parseString(xpp));
442      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
443        res.setSystemElement(parseUri(xpp));
444      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
445        res.setCodeElement(parseCode(xpp));
446      } else if (!parseElementContent(eventType, xpp, res))
447        return false;
448    return true;
449  }
450
451  protected Period parsePeriod(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
452    Period res = new Period();
453    parseTypeAttributes(xpp, res);
454    next(xpp);
455    int eventType = nextNoWhitespace(xpp);
456    while (eventType != XmlPullParser.END_TAG) {
457  if (!parsePeriodContent(eventType, xpp, res))
458        unknownContent(xpp);
459      eventType = nextNoWhitespace(xpp);
460    }
461    next(xpp);
462    parseElementClose(res);
463    return res;
464  }
465
466  protected boolean parsePeriodContent(int eventType, XmlPullParser xpp, Period res) throws XmlPullParserException, IOException, FHIRFormatError {
467      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("start")) {
468        res.setStartElement(parseDateTime(xpp));
469      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("end")) {
470        res.setEndElement(parseDateTime(xpp));
471      } else if (!parseElementContent(eventType, xpp, res))
472        return false;
473    return true;
474  }
475
476  protected Attachment parseAttachment(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
477    Attachment res = new Attachment();
478    parseTypeAttributes(xpp, res);
479    next(xpp);
480    int eventType = nextNoWhitespace(xpp);
481    while (eventType != XmlPullParser.END_TAG) {
482  if (!parseAttachmentContent(eventType, xpp, res))
483        unknownContent(xpp);
484      eventType = nextNoWhitespace(xpp);
485    }
486    next(xpp);
487    parseElementClose(res);
488    return res;
489  }
490
491  protected boolean parseAttachmentContent(int eventType, XmlPullParser xpp, Attachment res) throws XmlPullParserException, IOException, FHIRFormatError {
492      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contentType")) {
493        res.setContentTypeElement(parseCode(xpp));
494      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
495        res.setLanguageElement(parseCode(xpp));
496      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("data")) {
497        res.setDataElement(parseBase64Binary(xpp));
498      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
499        res.setUrlElement(parseUri(xpp));
500      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("size")) {
501        res.setSizeElement(parseUnsignedInt(xpp));
502      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("hash")) {
503        res.setHashElement(parseBase64Binary(xpp));
504      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
505        res.setTitleElement(parseString(xpp));
506      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("creation")) {
507        res.setCreationElement(parseDateTime(xpp));
508      } else if (!parseElementContent(eventType, xpp, res))
509        return false;
510    return true;
511  }
512
513  protected Duration parseDuration(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
514    Duration res = new Duration();
515    parseTypeAttributes(xpp, res);
516    next(xpp);
517    int eventType = nextNoWhitespace(xpp);
518    while (eventType != XmlPullParser.END_TAG) {
519  if (!parseDurationContent(eventType, xpp, res))
520        unknownContent(xpp);
521      eventType = nextNoWhitespace(xpp);
522    }
523    next(xpp);
524    parseElementClose(res);
525    return res;
526  }
527
528  protected boolean parseDurationContent(int eventType, XmlPullParser xpp, Duration res) throws XmlPullParserException, IOException, FHIRFormatError {
529      if (!parseQuantityContent(eventType, xpp, res))
530        return false;
531    return true;
532  }
533
534  protected Count parseCount(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
535    Count res = new Count();
536    parseTypeAttributes(xpp, res);
537    next(xpp);
538    int eventType = nextNoWhitespace(xpp);
539    while (eventType != XmlPullParser.END_TAG) {
540  if (!parseCountContent(eventType, xpp, res))
541        unknownContent(xpp);
542      eventType = nextNoWhitespace(xpp);
543    }
544    next(xpp);
545    parseElementClose(res);
546    return res;
547  }
548
549  protected boolean parseCountContent(int eventType, XmlPullParser xpp, Count res) throws XmlPullParserException, IOException, FHIRFormatError {
550      if (!parseQuantityContent(eventType, xpp, res))
551        return false;
552    return true;
553  }
554
555  protected Range parseRange(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
556    Range res = new Range();
557    parseTypeAttributes(xpp, res);
558    next(xpp);
559    int eventType = nextNoWhitespace(xpp);
560    while (eventType != XmlPullParser.END_TAG) {
561  if (!parseRangeContent(eventType, xpp, res))
562        unknownContent(xpp);
563      eventType = nextNoWhitespace(xpp);
564    }
565    next(xpp);
566    parseElementClose(res);
567    return res;
568  }
569
570  protected boolean parseRangeContent(int eventType, XmlPullParser xpp, Range res) throws XmlPullParserException, IOException, FHIRFormatError {
571      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("low")) {
572        res.setLow(parseSimpleQuantity(xpp));
573      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("high")) {
574        res.setHigh(parseSimpleQuantity(xpp));
575      } else if (!parseElementContent(eventType, xpp, res))
576        return false;
577    return true;
578  }
579
580  protected Annotation parseAnnotation(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
581    Annotation res = new Annotation();
582    parseTypeAttributes(xpp, res);
583    next(xpp);
584    int eventType = nextNoWhitespace(xpp);
585    while (eventType != XmlPullParser.END_TAG) {
586  if (!parseAnnotationContent(eventType, xpp, res))
587        unknownContent(xpp);
588      eventType = nextNoWhitespace(xpp);
589    }
590    next(xpp);
591    parseElementClose(res);
592    return res;
593  }
594
595  protected boolean parseAnnotationContent(int eventType, XmlPullParser xpp, Annotation res) throws XmlPullParserException, IOException, FHIRFormatError {
596      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "author")) {
597        res.setAuthor(parseType("author", xpp));
598      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("time")) {
599        res.setTimeElement(parseDateTime(xpp));
600      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
601        res.setTextElement(parseString(xpp));
602      } else if (!parseElementContent(eventType, xpp, res))
603        return false;
604    return true;
605  }
606
607  protected Money parseMoney(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
608    Money res = new Money();
609    parseTypeAttributes(xpp, res);
610    next(xpp);
611    int eventType = nextNoWhitespace(xpp);
612    while (eventType != XmlPullParser.END_TAG) {
613  if (!parseMoneyContent(eventType, xpp, res))
614        unknownContent(xpp);
615      eventType = nextNoWhitespace(xpp);
616    }
617    next(xpp);
618    parseElementClose(res);
619    return res;
620  }
621
622  protected boolean parseMoneyContent(int eventType, XmlPullParser xpp, Money res) throws XmlPullParserException, IOException, FHIRFormatError {
623      if (!parseQuantityContent(eventType, xpp, res))
624        return false;
625    return true;
626  }
627
628  protected Identifier parseIdentifier(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
629    Identifier res = new Identifier();
630    parseTypeAttributes(xpp, res);
631    next(xpp);
632    int eventType = nextNoWhitespace(xpp);
633    while (eventType != XmlPullParser.END_TAG) {
634  if (!parseIdentifierContent(eventType, xpp, res))
635        unknownContent(xpp);
636      eventType = nextNoWhitespace(xpp);
637    }
638    next(xpp);
639    parseElementClose(res);
640    return res;
641  }
642
643  protected boolean parseIdentifierContent(int eventType, XmlPullParser xpp, Identifier res) throws XmlPullParserException, IOException, FHIRFormatError {
644      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
645        res.setUseElement(parseEnumeration(xpp, Identifier.IdentifierUse.NULL, new Identifier.IdentifierUseEnumFactory()));
646      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
647        res.setType(parseCodeableConcept(xpp));
648      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
649        res.setSystemElement(parseUri(xpp));
650      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
651        res.setValueElement(parseString(xpp));
652      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
653        res.setPeriod(parsePeriod(xpp));
654      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("assigner")) {
655        res.setAssigner(parseReference(xpp));
656      } else if (!parseElementContent(eventType, xpp, res))
657        return false;
658    return true;
659  }
660
661  protected Coding parseCoding(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
662    Coding res = new Coding();
663    parseTypeAttributes(xpp, res);
664    next(xpp);
665    int eventType = nextNoWhitespace(xpp);
666    while (eventType != XmlPullParser.END_TAG) {
667  if (!parseCodingContent(eventType, xpp, res))
668        unknownContent(xpp);
669      eventType = nextNoWhitespace(xpp);
670    }
671    next(xpp);
672    parseElementClose(res);
673    return res;
674  }
675
676  protected boolean parseCodingContent(int eventType, XmlPullParser xpp, Coding res) throws XmlPullParserException, IOException, FHIRFormatError {
677      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
678        res.setSystemElement(parseUri(xpp));
679      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
680        res.setVersionElement(parseString(xpp));
681      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
682        res.setCodeElement(parseCode(xpp));
683      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
684        res.setDisplayElement(parseString(xpp));
685      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("userSelected")) {
686        res.setUserSelectedElement(parseBoolean(xpp));
687      } else if (!parseElementContent(eventType, xpp, res))
688        return false;
689    return true;
690  }
691
692  protected Signature parseSignature(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
693    Signature res = new Signature();
694    parseTypeAttributes(xpp, res);
695    next(xpp);
696    int eventType = nextNoWhitespace(xpp);
697    while (eventType != XmlPullParser.END_TAG) {
698  if (!parseSignatureContent(eventType, xpp, res))
699        unknownContent(xpp);
700      eventType = nextNoWhitespace(xpp);
701    }
702    next(xpp);
703    parseElementClose(res);
704    return res;
705  }
706
707  protected boolean parseSignatureContent(int eventType, XmlPullParser xpp, Signature res) throws XmlPullParserException, IOException, FHIRFormatError {
708      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
709        res.getType().add(parseCoding(xpp));
710      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("when")) {
711        res.setWhenElement(parseInstant(xpp));
712      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "who")) {
713        res.setWho(parseType("who", xpp));
714      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "onBehalfOf")) {
715        res.setOnBehalfOf(parseType("onBehalfOf", xpp));
716      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contentType")) {
717        res.setContentTypeElement(parseCode(xpp));
718      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("blob")) {
719        res.setBlobElement(parseBase64Binary(xpp));
720      } else if (!parseElementContent(eventType, xpp, res))
721        return false;
722    return true;
723  }
724
725  protected SampledData parseSampledData(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
726    SampledData res = new SampledData();
727    parseTypeAttributes(xpp, res);
728    next(xpp);
729    int eventType = nextNoWhitespace(xpp);
730    while (eventType != XmlPullParser.END_TAG) {
731  if (!parseSampledDataContent(eventType, xpp, res))
732        unknownContent(xpp);
733      eventType = nextNoWhitespace(xpp);
734    }
735    next(xpp);
736    parseElementClose(res);
737    return res;
738  }
739
740  protected boolean parseSampledDataContent(int eventType, XmlPullParser xpp, SampledData res) throws XmlPullParserException, IOException, FHIRFormatError {
741      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("origin")) {
742        res.setOrigin(parseSimpleQuantity(xpp));
743      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
744        res.setPeriodElement(parseDecimal(xpp));
745      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
746        res.setFactorElement(parseDecimal(xpp));
747      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lowerLimit")) {
748        res.setLowerLimitElement(parseDecimal(xpp));
749      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("upperLimit")) {
750        res.setUpperLimitElement(parseDecimal(xpp));
751      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dimensions")) {
752        res.setDimensionsElement(parsePositiveInt(xpp));
753      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("data")) {
754        res.setDataElement(parseString(xpp));
755      } else if (!parseElementContent(eventType, xpp, res))
756        return false;
757    return true;
758  }
759
760  protected Ratio parseRatio(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
761    Ratio res = new Ratio();
762    parseTypeAttributes(xpp, res);
763    next(xpp);
764    int eventType = nextNoWhitespace(xpp);
765    while (eventType != XmlPullParser.END_TAG) {
766  if (!parseRatioContent(eventType, xpp, res))
767        unknownContent(xpp);
768      eventType = nextNoWhitespace(xpp);
769    }
770    next(xpp);
771    parseElementClose(res);
772    return res;
773  }
774
775  protected boolean parseRatioContent(int eventType, XmlPullParser xpp, Ratio res) throws XmlPullParserException, IOException, FHIRFormatError {
776      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("numerator")) {
777        res.setNumerator(parseQuantity(xpp));
778      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("denominator")) {
779        res.setDenominator(parseQuantity(xpp));
780      } else if (!parseElementContent(eventType, xpp, res))
781        return false;
782    return true;
783  }
784
785  protected Distance parseDistance(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
786    Distance res = new Distance();
787    parseTypeAttributes(xpp, res);
788    next(xpp);
789    int eventType = nextNoWhitespace(xpp);
790    while (eventType != XmlPullParser.END_TAG) {
791  if (!parseDistanceContent(eventType, xpp, res))
792        unknownContent(xpp);
793      eventType = nextNoWhitespace(xpp);
794    }
795    next(xpp);
796    parseElementClose(res);
797    return res;
798  }
799
800  protected boolean parseDistanceContent(int eventType, XmlPullParser xpp, Distance res) throws XmlPullParserException, IOException, FHIRFormatError {
801      if (!parseQuantityContent(eventType, xpp, res))
802        return false;
803    return true;
804  }
805
806  protected Age parseAge(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
807    Age res = new Age();
808    parseTypeAttributes(xpp, res);
809    next(xpp);
810    int eventType = nextNoWhitespace(xpp);
811    while (eventType != XmlPullParser.END_TAG) {
812  if (!parseAgeContent(eventType, xpp, res))
813        unknownContent(xpp);
814      eventType = nextNoWhitespace(xpp);
815    }
816    next(xpp);
817    parseElementClose(res);
818    return res;
819  }
820
821  protected boolean parseAgeContent(int eventType, XmlPullParser xpp, Age res) throws XmlPullParserException, IOException, FHIRFormatError {
822      if (!parseQuantityContent(eventType, xpp, res))
823        return false;
824    return true;
825  }
826
827  protected CodeableConcept parseCodeableConcept(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
828    CodeableConcept res = new CodeableConcept();
829    parseTypeAttributes(xpp, res);
830    next(xpp);
831    int eventType = nextNoWhitespace(xpp);
832    while (eventType != XmlPullParser.END_TAG) {
833  if (!parseCodeableConceptContent(eventType, xpp, res))
834        unknownContent(xpp);
835      eventType = nextNoWhitespace(xpp);
836    }
837    next(xpp);
838    parseElementClose(res);
839    return res;
840  }
841
842  protected boolean parseCodeableConceptContent(int eventType, XmlPullParser xpp, CodeableConcept res) throws XmlPullParserException, IOException, FHIRFormatError {
843      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coding")) {
844        res.getCoding().add(parseCoding(xpp));
845      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
846        res.setTextElement(parseString(xpp));
847      } else if (!parseElementContent(eventType, xpp, res))
848        return false;
849    return true;
850  }
851
852  protected SimpleQuantity parseSimpleQuantity(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
853    SimpleQuantity res = new SimpleQuantity();
854    parseElementAttributes(xpp, res);
855    next(xpp);
856    int eventType = nextNoWhitespace(xpp);
857    while (eventType != XmlPullParser.END_TAG) {
858  if (!parseSimpleQuantityContent(eventType, xpp, res))
859        unknownContent(xpp);
860      eventType = nextNoWhitespace(xpp);
861    }
862    next(xpp);
863    parseElementClose(res);
864    return res;
865  }
866
867  protected boolean parseSimpleQuantityContent(int eventType, XmlPullParser xpp, SimpleQuantity res) throws XmlPullParserException, IOException, FHIRFormatError {
868      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
869        res.setValueElement(parseDecimal(xpp));
870      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comparator")) {
871        res.setComparatorElement(parseEnumeration(xpp, Quantity.QuantityComparator.NULL, new Quantity.QuantityComparatorEnumFactory()));
872      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unit")) {
873        res.setUnitElement(parseString(xpp));
874      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
875        res.setSystemElement(parseUri(xpp));
876      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
877        res.setCodeElement(parseCode(xpp));
878      } else if (!parseElementContent(eventType, xpp, res))
879        return false;
880    return true;
881  }
882
883  protected Meta parseMeta(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
884    Meta res = new Meta();
885    parseElementAttributes(xpp, res);
886    next(xpp);
887    int eventType = nextNoWhitespace(xpp);
888    while (eventType != XmlPullParser.END_TAG) {
889  if (!parseMetaContent(eventType, xpp, res))
890        unknownContent(xpp);
891      eventType = nextNoWhitespace(xpp);
892    }
893    next(xpp);
894    parseElementClose(res);
895    return res;
896  }
897
898  protected boolean parseMetaContent(int eventType, XmlPullParser xpp, Meta res) throws XmlPullParserException, IOException, FHIRFormatError {
899      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("versionId")) {
900        res.setVersionIdElement(parseId(xpp));
901      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastUpdated")) {
902        res.setLastUpdatedElement(parseInstant(xpp));
903      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
904        res.getProfile().add(parseUri(xpp));
905      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("security")) {
906        res.getSecurity().add(parseCoding(xpp));
907      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("tag")) {
908        res.getTag().add(parseCoding(xpp));
909      } else if (!parseElementContent(eventType, xpp, res))
910        return false;
911    return true;
912  }
913
914  protected Address parseAddress(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
915    Address res = new Address();
916    parseElementAttributes(xpp, res);
917    next(xpp);
918    int eventType = nextNoWhitespace(xpp);
919    while (eventType != XmlPullParser.END_TAG) {
920  if (!parseAddressContent(eventType, xpp, res))
921        unknownContent(xpp);
922      eventType = nextNoWhitespace(xpp);
923    }
924    next(xpp);
925    parseElementClose(res);
926    return res;
927  }
928
929  protected boolean parseAddressContent(int eventType, XmlPullParser xpp, Address res) throws XmlPullParserException, IOException, FHIRFormatError {
930      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
931        res.setUseElement(parseEnumeration(xpp, Address.AddressUse.NULL, new Address.AddressUseEnumFactory()));
932      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
933        res.setTypeElement(parseEnumeration(xpp, Address.AddressType.NULL, new Address.AddressTypeEnumFactory()));
934      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
935        res.setTextElement(parseString(xpp));
936      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("line")) {
937        res.getLine().add(parseString(xpp));
938      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("city")) {
939        res.setCityElement(parseString(xpp));
940      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("district")) {
941        res.setDistrictElement(parseString(xpp));
942      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("state")) {
943        res.setStateElement(parseString(xpp));
944      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("postalCode")) {
945        res.setPostalCodeElement(parseString(xpp));
946      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("country")) {
947        res.setCountryElement(parseString(xpp));
948      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
949        res.setPeriod(parsePeriod(xpp));
950      } else if (!parseElementContent(eventType, xpp, res))
951        return false;
952    return true;
953  }
954
955  protected TriggerDefinition parseTriggerDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
956    TriggerDefinition res = new TriggerDefinition();
957    parseElementAttributes(xpp, res);
958    next(xpp);
959    int eventType = nextNoWhitespace(xpp);
960    while (eventType != XmlPullParser.END_TAG) {
961  if (!parseTriggerDefinitionContent(eventType, xpp, res))
962        unknownContent(xpp);
963      eventType = nextNoWhitespace(xpp);
964    }
965    next(xpp);
966    parseElementClose(res);
967    return res;
968  }
969
970  protected boolean parseTriggerDefinitionContent(int eventType, XmlPullParser xpp, TriggerDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
971      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
972        res.setTypeElement(parseEnumeration(xpp, TriggerDefinition.TriggerType.NULL, new TriggerDefinition.TriggerTypeEnumFactory()));
973      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("eventName")) {
974        res.setEventNameElement(parseString(xpp));
975      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "eventTiming")) {
976        res.setEventTiming(parseType("eventTiming", xpp));
977      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("eventData")) {
978        res.setEventData(parseDataRequirement(xpp));
979      } else if (!parseElementContent(eventType, xpp, res))
980        return false;
981    return true;
982  }
983
984  protected Contributor parseContributor(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
985    Contributor res = new Contributor();
986    parseElementAttributes(xpp, res);
987    next(xpp);
988    int eventType = nextNoWhitespace(xpp);
989    while (eventType != XmlPullParser.END_TAG) {
990  if (!parseContributorContent(eventType, xpp, res))
991        unknownContent(xpp);
992      eventType = nextNoWhitespace(xpp);
993    }
994    next(xpp);
995    parseElementClose(res);
996    return res;
997  }
998
999  protected boolean parseContributorContent(int eventType, XmlPullParser xpp, Contributor res) throws XmlPullParserException, IOException, FHIRFormatError {
1000      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1001        res.setTypeElement(parseEnumeration(xpp, Contributor.ContributorType.NULL, new Contributor.ContributorTypeEnumFactory()));
1002      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
1003        res.setNameElement(parseString(xpp));
1004      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
1005        res.getContact().add(parseContactDetail(xpp));
1006      } else if (!parseElementContent(eventType, xpp, res))
1007        return false;
1008    return true;
1009  }
1010
1011  protected DataRequirement parseDataRequirement(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1012    DataRequirement res = new DataRequirement();
1013    parseElementAttributes(xpp, res);
1014    next(xpp);
1015    int eventType = nextNoWhitespace(xpp);
1016    while (eventType != XmlPullParser.END_TAG) {
1017  if (!parseDataRequirementContent(eventType, xpp, res))
1018        unknownContent(xpp);
1019      eventType = nextNoWhitespace(xpp);
1020    }
1021    next(xpp);
1022    parseElementClose(res);
1023    return res;
1024  }
1025
1026  protected boolean parseDataRequirementContent(int eventType, XmlPullParser xpp, DataRequirement res) throws XmlPullParserException, IOException, FHIRFormatError {
1027      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1028        res.setTypeElement(parseCode(xpp));
1029      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
1030        res.getProfile().add(parseUri(xpp));
1031      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mustSupport")) {
1032        res.getMustSupport().add(parseString(xpp));
1033      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("codeFilter")) {
1034        res.getCodeFilter().add(parseDataRequirementDataRequirementCodeFilterComponent(xpp, res));
1035      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dateFilter")) {
1036        res.getDateFilter().add(parseDataRequirementDataRequirementDateFilterComponent(xpp, res));
1037      } else if (!parseElementContent(eventType, xpp, res))
1038        return false;
1039    return true;
1040  }
1041
1042  protected DataRequirement.DataRequirementCodeFilterComponent parseDataRequirementDataRequirementCodeFilterComponent(XmlPullParser xpp, DataRequirement owner) throws XmlPullParserException, IOException, FHIRFormatError {
1043    DataRequirement.DataRequirementCodeFilterComponent res = new DataRequirement.DataRequirementCodeFilterComponent();
1044    parseElementAttributes(xpp, res);
1045    next(xpp);
1046    int eventType = nextNoWhitespace(xpp);
1047    while (eventType != XmlPullParser.END_TAG) {
1048  if (!parseDataRequirementDataRequirementCodeFilterComponentContent(eventType, xpp, owner, res))
1049        unknownContent(xpp);
1050      eventType = nextNoWhitespace(xpp);
1051    }
1052    next(xpp);
1053    parseElementClose(res);
1054    return res;
1055  }
1056
1057  protected boolean parseDataRequirementDataRequirementCodeFilterComponentContent(int eventType, XmlPullParser xpp, DataRequirement owner, DataRequirement.DataRequirementCodeFilterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1058      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
1059        res.setPathElement(parseString(xpp));
1060      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "valueSet")) {
1061        res.setValueSet(parseType("valueSet", xpp));
1062      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueCode")) {
1063        res.getValueCode().add(parseCode(xpp));
1064      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueCoding")) {
1065        res.getValueCoding().add(parseCoding(xpp));
1066      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueCodeableConcept")) {
1067        res.getValueCodeableConcept().add(parseCodeableConcept(xpp));
1068      } else if (!parseElementContent(eventType, xpp, res))
1069        return false;
1070    return true;
1071  }
1072
1073  protected DataRequirement.DataRequirementDateFilterComponent parseDataRequirementDataRequirementDateFilterComponent(XmlPullParser xpp, DataRequirement owner) throws XmlPullParserException, IOException, FHIRFormatError {
1074    DataRequirement.DataRequirementDateFilterComponent res = new DataRequirement.DataRequirementDateFilterComponent();
1075    parseElementAttributes(xpp, res);
1076    next(xpp);
1077    int eventType = nextNoWhitespace(xpp);
1078    while (eventType != XmlPullParser.END_TAG) {
1079  if (!parseDataRequirementDataRequirementDateFilterComponentContent(eventType, xpp, owner, res))
1080        unknownContent(xpp);
1081      eventType = nextNoWhitespace(xpp);
1082    }
1083    next(xpp);
1084    parseElementClose(res);
1085    return res;
1086  }
1087
1088  protected boolean parseDataRequirementDataRequirementDateFilterComponentContent(int eventType, XmlPullParser xpp, DataRequirement owner, DataRequirement.DataRequirementDateFilterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1089      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
1090        res.setPathElement(parseString(xpp));
1091      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
1092        res.setValue(parseType("value", xpp));
1093      } else if (!parseElementContent(eventType, xpp, res))
1094        return false;
1095    return true;
1096  }
1097
1098  protected Dosage parseDosage(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1099    Dosage res = new Dosage();
1100    parseElementAttributes(xpp, res);
1101    next(xpp);
1102    int eventType = nextNoWhitespace(xpp);
1103    while (eventType != XmlPullParser.END_TAG) {
1104  if (!parseDosageContent(eventType, xpp, res))
1105        unknownContent(xpp);
1106      eventType = nextNoWhitespace(xpp);
1107    }
1108    next(xpp);
1109    parseElementClose(res);
1110    return res;
1111  }
1112
1113  protected boolean parseDosageContent(int eventType, XmlPullParser xpp, Dosage res) throws XmlPullParserException, IOException, FHIRFormatError {
1114      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
1115        res.setSequenceElement(parseInteger(xpp));
1116      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
1117        res.setTextElement(parseString(xpp));
1118      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("additionalInstruction")) {
1119        res.getAdditionalInstruction().add(parseCodeableConcept(xpp));
1120      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patientInstruction")) {
1121        res.setPatientInstructionElement(parseString(xpp));
1122      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("timing")) {
1123        res.setTiming(parseTiming(xpp));
1124      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "asNeeded")) {
1125        res.setAsNeeded(parseType("asNeeded", xpp));
1126      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("site")) {
1127        res.setSite(parseCodeableConcept(xpp));
1128      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("route")) {
1129        res.setRoute(parseCodeableConcept(xpp));
1130      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("method")) {
1131        res.setMethod(parseCodeableConcept(xpp));
1132      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "dose")) {
1133        res.setDose(parseType("dose", xpp));
1134      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxDosePerPeriod")) {
1135        res.setMaxDosePerPeriod(parseRatio(xpp));
1136      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxDosePerAdministration")) {
1137        res.setMaxDosePerAdministration(parseSimpleQuantity(xpp));
1138      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxDosePerLifetime")) {
1139        res.setMaxDosePerLifetime(parseSimpleQuantity(xpp));
1140      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "rate")) {
1141        res.setRate(parseType("rate", xpp));
1142      } else if (!parseElementContent(eventType, xpp, res))
1143        return false;
1144    return true;
1145  }
1146
1147  protected RelatedArtifact parseRelatedArtifact(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1148    RelatedArtifact res = new RelatedArtifact();
1149    parseElementAttributes(xpp, res);
1150    next(xpp);
1151    int eventType = nextNoWhitespace(xpp);
1152    while (eventType != XmlPullParser.END_TAG) {
1153  if (!parseRelatedArtifactContent(eventType, xpp, res))
1154        unknownContent(xpp);
1155      eventType = nextNoWhitespace(xpp);
1156    }
1157    next(xpp);
1158    parseElementClose(res);
1159    return res;
1160  }
1161
1162  protected boolean parseRelatedArtifactContent(int eventType, XmlPullParser xpp, RelatedArtifact res) throws XmlPullParserException, IOException, FHIRFormatError {
1163      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1164        res.setTypeElement(parseEnumeration(xpp, RelatedArtifact.RelatedArtifactType.NULL, new RelatedArtifact.RelatedArtifactTypeEnumFactory()));
1165      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
1166        res.setDisplayElement(parseString(xpp));
1167      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("citation")) {
1168        res.setCitationElement(parseString(xpp));
1169      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
1170        res.setUrlElement(parseUri(xpp));
1171      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("document")) {
1172        res.setDocument(parseAttachment(xpp));
1173      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
1174        res.setResource(parseReference(xpp));
1175      } else if (!parseElementContent(eventType, xpp, res))
1176        return false;
1177    return true;
1178  }
1179
1180  protected ContactDetail parseContactDetail(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1181    ContactDetail res = new ContactDetail();
1182    parseElementAttributes(xpp, res);
1183    next(xpp);
1184    int eventType = nextNoWhitespace(xpp);
1185    while (eventType != XmlPullParser.END_TAG) {
1186  if (!parseContactDetailContent(eventType, xpp, res))
1187        unknownContent(xpp);
1188      eventType = nextNoWhitespace(xpp);
1189    }
1190    next(xpp);
1191    parseElementClose(res);
1192    return res;
1193  }
1194
1195  protected boolean parseContactDetailContent(int eventType, XmlPullParser xpp, ContactDetail res) throws XmlPullParserException, IOException, FHIRFormatError {
1196      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
1197        res.setNameElement(parseString(xpp));
1198      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("telecom")) {
1199        res.getTelecom().add(parseContactPoint(xpp));
1200      } else if (!parseElementContent(eventType, xpp, res))
1201        return false;
1202    return true;
1203  }
1204
1205  protected HumanName parseHumanName(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1206    HumanName res = new HumanName();
1207    parseElementAttributes(xpp, res);
1208    next(xpp);
1209    int eventType = nextNoWhitespace(xpp);
1210    while (eventType != XmlPullParser.END_TAG) {
1211  if (!parseHumanNameContent(eventType, xpp, res))
1212        unknownContent(xpp);
1213      eventType = nextNoWhitespace(xpp);
1214    }
1215    next(xpp);
1216    parseElementClose(res);
1217    return res;
1218  }
1219
1220  protected boolean parseHumanNameContent(int eventType, XmlPullParser xpp, HumanName res) throws XmlPullParserException, IOException, FHIRFormatError {
1221      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
1222        res.setUseElement(parseEnumeration(xpp, HumanName.NameUse.NULL, new HumanName.NameUseEnumFactory()));
1223      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
1224        res.setTextElement(parseString(xpp));
1225      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("family")) {
1226        res.setFamilyElement(parseString(xpp));
1227      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("given")) {
1228        res.getGiven().add(parseString(xpp));
1229      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prefix")) {
1230        res.getPrefix().add(parseString(xpp));
1231      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("suffix")) {
1232        res.getSuffix().add(parseString(xpp));
1233      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
1234        res.setPeriod(parsePeriod(xpp));
1235      } else if (!parseElementContent(eventType, xpp, res))
1236        return false;
1237    return true;
1238  }
1239
1240  protected ContactPoint parseContactPoint(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1241    ContactPoint res = new ContactPoint();
1242    parseElementAttributes(xpp, res);
1243    next(xpp);
1244    int eventType = nextNoWhitespace(xpp);
1245    while (eventType != XmlPullParser.END_TAG) {
1246  if (!parseContactPointContent(eventType, xpp, res))
1247        unknownContent(xpp);
1248      eventType = nextNoWhitespace(xpp);
1249    }
1250    next(xpp);
1251    parseElementClose(res);
1252    return res;
1253  }
1254
1255  protected boolean parseContactPointContent(int eventType, XmlPullParser xpp, ContactPoint res) throws XmlPullParserException, IOException, FHIRFormatError {
1256      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
1257        res.setSystemElement(parseEnumeration(xpp, ContactPoint.ContactPointSystem.NULL, new ContactPoint.ContactPointSystemEnumFactory()));
1258      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
1259        res.setValueElement(parseString(xpp));
1260      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
1261        res.setUseElement(parseEnumeration(xpp, ContactPoint.ContactPointUse.NULL, new ContactPoint.ContactPointUseEnumFactory()));
1262      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rank")) {
1263        res.setRankElement(parsePositiveInt(xpp));
1264      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
1265        res.setPeriod(parsePeriod(xpp));
1266      } else if (!parseElementContent(eventType, xpp, res))
1267        return false;
1268    return true;
1269  }
1270
1271  protected UsageContext parseUsageContext(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1272    UsageContext res = new UsageContext();
1273    parseElementAttributes(xpp, res);
1274    next(xpp);
1275    int eventType = nextNoWhitespace(xpp);
1276    while (eventType != XmlPullParser.END_TAG) {
1277  if (!parseUsageContextContent(eventType, xpp, res))
1278        unknownContent(xpp);
1279      eventType = nextNoWhitespace(xpp);
1280    }
1281    next(xpp);
1282    parseElementClose(res);
1283    return res;
1284  }
1285
1286  protected boolean parseUsageContextContent(int eventType, XmlPullParser xpp, UsageContext res) throws XmlPullParserException, IOException, FHIRFormatError {
1287      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
1288        res.setCode(parseCoding(xpp));
1289      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
1290        res.setValue(parseType("value", xpp));
1291      } else if (!parseElementContent(eventType, xpp, res))
1292        return false;
1293    return true;
1294  }
1295
1296  protected Timing parseTiming(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1297    Timing res = new Timing();
1298    parseElementAttributes(xpp, res);
1299    next(xpp);
1300    int eventType = nextNoWhitespace(xpp);
1301    while (eventType != XmlPullParser.END_TAG) {
1302  if (!parseTimingContent(eventType, xpp, res))
1303        unknownContent(xpp);
1304      eventType = nextNoWhitespace(xpp);
1305    }
1306    next(xpp);
1307    parseElementClose(res);
1308    return res;
1309  }
1310
1311  protected boolean parseTimingContent(int eventType, XmlPullParser xpp, Timing res) throws XmlPullParserException, IOException, FHIRFormatError {
1312      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("event")) {
1313        res.getEvent().add(parseDateTime(xpp));
1314      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("repeat")) {
1315        res.setRepeat(parseTimingTimingRepeatComponent(xpp, res));
1316      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
1317        res.setCode(parseCodeableConcept(xpp));
1318      } else if (!parseElementContent(eventType, xpp, res))
1319        return false;
1320    return true;
1321  }
1322
1323  protected Timing.TimingRepeatComponent parseTimingTimingRepeatComponent(XmlPullParser xpp, Timing owner) throws XmlPullParserException, IOException, FHIRFormatError {
1324    Timing.TimingRepeatComponent res = new Timing.TimingRepeatComponent();
1325    parseElementAttributes(xpp, res);
1326    next(xpp);
1327    int eventType = nextNoWhitespace(xpp);
1328    while (eventType != XmlPullParser.END_TAG) {
1329  if (!parseTimingTimingRepeatComponentContent(eventType, xpp, owner, res))
1330        unknownContent(xpp);
1331      eventType = nextNoWhitespace(xpp);
1332    }
1333    next(xpp);
1334    parseElementClose(res);
1335    return res;
1336  }
1337
1338  protected boolean parseTimingTimingRepeatComponentContent(int eventType, XmlPullParser xpp, Timing owner, Timing.TimingRepeatComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1339      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "bounds")) {
1340        res.setBounds(parseType("bounds", xpp));
1341      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("count")) {
1342        res.setCountElement(parseInteger(xpp));
1343      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("countMax")) {
1344        res.setCountMaxElement(parseInteger(xpp));
1345      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("duration")) {
1346        res.setDurationElement(parseDecimal(xpp));
1347      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("durationMax")) {
1348        res.setDurationMaxElement(parseDecimal(xpp));
1349      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("durationUnit")) {
1350        res.setDurationUnitElement(parseEnumeration(xpp, Timing.UnitsOfTime.NULL, new Timing.UnitsOfTimeEnumFactory()));
1351      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("frequency")) {
1352        res.setFrequencyElement(parseInteger(xpp));
1353      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("frequencyMax")) {
1354        res.setFrequencyMaxElement(parseInteger(xpp));
1355      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
1356        res.setPeriodElement(parseDecimal(xpp));
1357      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("periodMax")) {
1358        res.setPeriodMaxElement(parseDecimal(xpp));
1359      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("periodUnit")) {
1360        res.setPeriodUnitElement(parseEnumeration(xpp, Timing.UnitsOfTime.NULL, new Timing.UnitsOfTimeEnumFactory()));
1361      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dayOfWeek")) {
1362        res.getDayOfWeek().add(parseEnumeration(xpp, Timing.DayOfWeek.NULL, new Timing.DayOfWeekEnumFactory()));
1363      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("timeOfDay")) {
1364        res.getTimeOfDay().add(parseTime(xpp));
1365      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("when")) {
1366        res.getWhen().add(parseEnumeration(xpp, Timing.EventTiming.NULL, new Timing.EventTimingEnumFactory()));
1367      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("offset")) {
1368        res.setOffsetElement(parseUnsignedInt(xpp));
1369      } else if (!parseElementContent(eventType, xpp, res))
1370        return false;
1371    return true;
1372  }
1373
1374  protected ElementDefinition parseElementDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1375    ElementDefinition res = new ElementDefinition();
1376    parseElementAttributes(xpp, res);
1377    next(xpp);
1378    int eventType = nextNoWhitespace(xpp);
1379    while (eventType != XmlPullParser.END_TAG) {
1380  if (!parseElementDefinitionContent(eventType, xpp, res))
1381        unknownContent(xpp);
1382      eventType = nextNoWhitespace(xpp);
1383    }
1384    next(xpp);
1385    parseElementClose(res);
1386    return res;
1387  }
1388
1389  protected boolean parseElementDefinitionContent(int eventType, XmlPullParser xpp, ElementDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
1390      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
1391        res.setPathElement(parseString(xpp));
1392      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("representation")) {
1393        res.getRepresentation().add(parseEnumeration(xpp, ElementDefinition.PropertyRepresentation.NULL, new ElementDefinition.PropertyRepresentationEnumFactory()));
1394      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sliceName")) {
1395        res.setSliceNameElement(parseString(xpp));
1396      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("label")) {
1397        res.setLabelElement(parseString(xpp));
1398      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
1399        res.getCode().add(parseCoding(xpp));
1400      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("slicing")) {
1401        res.setSlicing(parseElementDefinitionElementDefinitionSlicingComponent(xpp, res));
1402      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("short")) {
1403        res.setShortElement(parseString(xpp));
1404      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
1405        res.setDefinitionElement(parseMarkdown(xpp));
1406      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
1407        res.setCommentElement(parseMarkdown(xpp));
1408      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requirements")) {
1409        res.setRequirementsElement(parseMarkdown(xpp));
1410      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("alias")) {
1411        res.getAlias().add(parseString(xpp));
1412      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("min")) {
1413        res.setMinElement(parseUnsignedInt(xpp));
1414      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("max")) {
1415        res.setMaxElement(parseString(xpp));
1416      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("base")) {
1417        res.setBase(parseElementDefinitionElementDefinitionBaseComponent(xpp, res));
1418      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contentReference")) {
1419        res.setContentReferenceElement(parseUri(xpp));
1420      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1421        res.getType().add(parseElementDefinitionTypeRefComponent(xpp, res));
1422      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "defaultValue")) {
1423        res.setDefaultValue(parseType("defaultValue", xpp));
1424      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("meaningWhenMissing")) {
1425        res.setMeaningWhenMissingElement(parseMarkdown(xpp));
1426      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("orderMeaning")) {
1427        res.setOrderMeaningElement(parseString(xpp));
1428      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "fixed")) {
1429        res.setFixed(parseType("fixed", xpp));
1430      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "pattern")) {
1431        res.setPattern(parseType("pattern", xpp));
1432      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("example")) {
1433        res.getExample().add(parseElementDefinitionElementDefinitionExampleComponent(xpp, res));
1434      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "minValue")) {
1435        res.setMinValue(parseType("minValue", xpp));
1436      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "maxValue")) {
1437        res.setMaxValue(parseType("maxValue", xpp));
1438      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxLength")) {
1439        res.setMaxLengthElement(parseInteger(xpp));
1440      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("condition")) {
1441        res.getCondition().add(parseId(xpp));
1442      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("constraint")) {
1443        res.getConstraint().add(parseElementDefinitionElementDefinitionConstraintComponent(xpp, res));
1444      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mustSupport")) {
1445        res.setMustSupportElement(parseBoolean(xpp));
1446      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("isModifier")) {
1447        res.setIsModifierElement(parseBoolean(xpp));
1448      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("isSummary")) {
1449        res.setIsSummaryElement(parseBoolean(xpp));
1450      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("binding")) {
1451        res.setBinding(parseElementDefinitionElementDefinitionBindingComponent(xpp, res));
1452      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mapping")) {
1453        res.getMapping().add(parseElementDefinitionElementDefinitionMappingComponent(xpp, res));
1454      } else if (!parseElementContent(eventType, xpp, res))
1455        return false;
1456    return true;
1457  }
1458
1459  protected ElementDefinition.ElementDefinitionSlicingComponent parseElementDefinitionElementDefinitionSlicingComponent(XmlPullParser xpp, ElementDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
1460    ElementDefinition.ElementDefinitionSlicingComponent res = new ElementDefinition.ElementDefinitionSlicingComponent();
1461    parseElementAttributes(xpp, res);
1462    next(xpp);
1463    int eventType = nextNoWhitespace(xpp);
1464    while (eventType != XmlPullParser.END_TAG) {
1465  if (!parseElementDefinitionElementDefinitionSlicingComponentContent(eventType, xpp, owner, res))
1466        unknownContent(xpp);
1467      eventType = nextNoWhitespace(xpp);
1468    }
1469    next(xpp);
1470    parseElementClose(res);
1471    return res;
1472  }
1473
1474  protected boolean parseElementDefinitionElementDefinitionSlicingComponentContent(int eventType, XmlPullParser xpp, ElementDefinition owner, ElementDefinition.ElementDefinitionSlicingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1475      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("discriminator")) {
1476        res.getDiscriminator().add(parseElementDefinitionElementDefinitionSlicingDiscriminatorComponent(xpp, owner));
1477      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
1478        res.setDescriptionElement(parseString(xpp));
1479      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ordered")) {
1480        res.setOrderedElement(parseBoolean(xpp));
1481      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rules")) {
1482        res.setRulesElement(parseEnumeration(xpp, ElementDefinition.SlicingRules.NULL, new ElementDefinition.SlicingRulesEnumFactory()));
1483      } else if (!parseElementContent(eventType, xpp, res))
1484        return false;
1485    return true;
1486  }
1487
1488  protected ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent parseElementDefinitionElementDefinitionSlicingDiscriminatorComponent(XmlPullParser xpp, ElementDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
1489    ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent res = new ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent();
1490    parseElementAttributes(xpp, res);
1491    next(xpp);
1492    int eventType = nextNoWhitespace(xpp);
1493    while (eventType != XmlPullParser.END_TAG) {
1494  if (!parseElementDefinitionElementDefinitionSlicingDiscriminatorComponentContent(eventType, xpp, owner, res))
1495        unknownContent(xpp);
1496      eventType = nextNoWhitespace(xpp);
1497    }
1498    next(xpp);
1499    parseElementClose(res);
1500    return res;
1501  }
1502
1503  protected boolean parseElementDefinitionElementDefinitionSlicingDiscriminatorComponentContent(int eventType, XmlPullParser xpp, ElementDefinition owner, ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1504      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1505        res.setTypeElement(parseEnumeration(xpp, ElementDefinition.DiscriminatorType.NULL, new ElementDefinition.DiscriminatorTypeEnumFactory()));
1506      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
1507        res.setPathElement(parseString(xpp));
1508      } else if (!parseElementContent(eventType, xpp, res))
1509        return false;
1510    return true;
1511  }
1512
1513  protected ElementDefinition.ElementDefinitionBaseComponent parseElementDefinitionElementDefinitionBaseComponent(XmlPullParser xpp, ElementDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
1514    ElementDefinition.ElementDefinitionBaseComponent res = new ElementDefinition.ElementDefinitionBaseComponent();
1515    parseElementAttributes(xpp, res);
1516    next(xpp);
1517    int eventType = nextNoWhitespace(xpp);
1518    while (eventType != XmlPullParser.END_TAG) {
1519  if (!parseElementDefinitionElementDefinitionBaseComponentContent(eventType, xpp, owner, res))
1520        unknownContent(xpp);
1521      eventType = nextNoWhitespace(xpp);
1522    }
1523    next(xpp);
1524    parseElementClose(res);
1525    return res;
1526  }
1527
1528  protected boolean parseElementDefinitionElementDefinitionBaseComponentContent(int eventType, XmlPullParser xpp, ElementDefinition owner, ElementDefinition.ElementDefinitionBaseComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1529      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
1530        res.setPathElement(parseString(xpp));
1531      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("min")) {
1532        res.setMinElement(parseUnsignedInt(xpp));
1533      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("max")) {
1534        res.setMaxElement(parseString(xpp));
1535      } else if (!parseElementContent(eventType, xpp, res))
1536        return false;
1537    return true;
1538  }
1539
1540  protected ElementDefinition.TypeRefComponent parseElementDefinitionTypeRefComponent(XmlPullParser xpp, ElementDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
1541    ElementDefinition.TypeRefComponent res = new ElementDefinition.TypeRefComponent();
1542    parseElementAttributes(xpp, res);
1543    next(xpp);
1544    int eventType = nextNoWhitespace(xpp);
1545    while (eventType != XmlPullParser.END_TAG) {
1546  if (!parseElementDefinitionTypeRefComponentContent(eventType, xpp, owner, res))
1547        unknownContent(xpp);
1548      eventType = nextNoWhitespace(xpp);
1549    }
1550    next(xpp);
1551    parseElementClose(res);
1552    return res;
1553  }
1554
1555  protected boolean parseElementDefinitionTypeRefComponentContent(int eventType, XmlPullParser xpp, ElementDefinition owner, ElementDefinition.TypeRefComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1556      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
1557        res.setCodeElement(parseUri(xpp));
1558      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
1559        res.setProfileElement(parseUri(xpp));
1560      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("targetProfile")) {
1561        res.setTargetProfileElement(parseUri(xpp));
1562      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("aggregation")) {
1563        res.getAggregation().add(parseEnumeration(xpp, ElementDefinition.AggregationMode.NULL, new ElementDefinition.AggregationModeEnumFactory()));
1564      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("versioning")) {
1565        res.setVersioningElement(parseEnumeration(xpp, ElementDefinition.ReferenceVersionRules.NULL, new ElementDefinition.ReferenceVersionRulesEnumFactory()));
1566      } else if (!parseElementContent(eventType, xpp, res))
1567        return false;
1568    return true;
1569  }
1570
1571  protected ElementDefinition.ElementDefinitionExampleComponent parseElementDefinitionElementDefinitionExampleComponent(XmlPullParser xpp, ElementDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
1572    ElementDefinition.ElementDefinitionExampleComponent res = new ElementDefinition.ElementDefinitionExampleComponent();
1573    parseElementAttributes(xpp, res);
1574    next(xpp);
1575    int eventType = nextNoWhitespace(xpp);
1576    while (eventType != XmlPullParser.END_TAG) {
1577  if (!parseElementDefinitionElementDefinitionExampleComponentContent(eventType, xpp, owner, res))
1578        unknownContent(xpp);
1579      eventType = nextNoWhitespace(xpp);
1580    }
1581    next(xpp);
1582    parseElementClose(res);
1583    return res;
1584  }
1585
1586  protected boolean parseElementDefinitionElementDefinitionExampleComponentContent(int eventType, XmlPullParser xpp, ElementDefinition owner, ElementDefinition.ElementDefinitionExampleComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1587      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("label")) {
1588        res.setLabelElement(parseString(xpp));
1589      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
1590        res.setValue(parseType("value", xpp));
1591      } else if (!parseElementContent(eventType, xpp, res))
1592        return false;
1593    return true;
1594  }
1595
1596  protected ElementDefinition.ElementDefinitionConstraintComponent parseElementDefinitionElementDefinitionConstraintComponent(XmlPullParser xpp, ElementDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
1597    ElementDefinition.ElementDefinitionConstraintComponent res = new ElementDefinition.ElementDefinitionConstraintComponent();
1598    parseElementAttributes(xpp, res);
1599    next(xpp);
1600    int eventType = nextNoWhitespace(xpp);
1601    while (eventType != XmlPullParser.END_TAG) {
1602  if (!parseElementDefinitionElementDefinitionConstraintComponentContent(eventType, xpp, owner, res))
1603        unknownContent(xpp);
1604      eventType = nextNoWhitespace(xpp);
1605    }
1606    next(xpp);
1607    parseElementClose(res);
1608    return res;
1609  }
1610
1611  protected boolean parseElementDefinitionElementDefinitionConstraintComponentContent(int eventType, XmlPullParser xpp, ElementDefinition owner, ElementDefinition.ElementDefinitionConstraintComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1612      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("key")) {
1613        res.setKeyElement(parseId(xpp));
1614      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requirements")) {
1615        res.setRequirementsElement(parseString(xpp));
1616      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("severity")) {
1617        res.setSeverityElement(parseEnumeration(xpp, ElementDefinition.ConstraintSeverity.NULL, new ElementDefinition.ConstraintSeverityEnumFactory()));
1618      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("human")) {
1619        res.setHumanElement(parseString(xpp));
1620      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expression")) {
1621        res.setExpressionElement(parseString(xpp));
1622      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("xpath")) {
1623        res.setXpathElement(parseString(xpp));
1624      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
1625        res.setSourceElement(parseUri(xpp));
1626      } else if (!parseElementContent(eventType, xpp, res))
1627        return false;
1628    return true;
1629  }
1630
1631  protected ElementDefinition.ElementDefinitionBindingComponent parseElementDefinitionElementDefinitionBindingComponent(XmlPullParser xpp, ElementDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
1632    ElementDefinition.ElementDefinitionBindingComponent res = new ElementDefinition.ElementDefinitionBindingComponent();
1633    parseElementAttributes(xpp, res);
1634    next(xpp);
1635    int eventType = nextNoWhitespace(xpp);
1636    while (eventType != XmlPullParser.END_TAG) {
1637  if (!parseElementDefinitionElementDefinitionBindingComponentContent(eventType, xpp, owner, res))
1638        unknownContent(xpp);
1639      eventType = nextNoWhitespace(xpp);
1640    }
1641    next(xpp);
1642    parseElementClose(res);
1643    return res;
1644  }
1645
1646  protected boolean parseElementDefinitionElementDefinitionBindingComponentContent(int eventType, XmlPullParser xpp, ElementDefinition owner, ElementDefinition.ElementDefinitionBindingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1647      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("strength")) {
1648        res.setStrengthElement(parseEnumeration(xpp, Enumerations.BindingStrength.NULL, new Enumerations.BindingStrengthEnumFactory()));
1649      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
1650        res.setDescriptionElement(parseString(xpp));
1651      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "valueSet")) {
1652        res.setValueSet(parseType("valueSet", xpp));
1653      } else if (!parseElementContent(eventType, xpp, res))
1654        return false;
1655    return true;
1656  }
1657
1658  protected ElementDefinition.ElementDefinitionMappingComponent parseElementDefinitionElementDefinitionMappingComponent(XmlPullParser xpp, ElementDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
1659    ElementDefinition.ElementDefinitionMappingComponent res = new ElementDefinition.ElementDefinitionMappingComponent();
1660    parseElementAttributes(xpp, res);
1661    next(xpp);
1662    int eventType = nextNoWhitespace(xpp);
1663    while (eventType != XmlPullParser.END_TAG) {
1664  if (!parseElementDefinitionElementDefinitionMappingComponentContent(eventType, xpp, owner, res))
1665        unknownContent(xpp);
1666      eventType = nextNoWhitespace(xpp);
1667    }
1668    next(xpp);
1669    parseElementClose(res);
1670    return res;
1671  }
1672
1673  protected boolean parseElementDefinitionElementDefinitionMappingComponentContent(int eventType, XmlPullParser xpp, ElementDefinition owner, ElementDefinition.ElementDefinitionMappingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1674      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identity")) {
1675        res.setIdentityElement(parseId(xpp));
1676      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
1677        res.setLanguageElement(parseCode(xpp));
1678      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("map")) {
1679        res.setMapElement(parseString(xpp));
1680      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
1681        res.setCommentElement(parseString(xpp));
1682      } else if (!parseElementContent(eventType, xpp, res))
1683        return false;
1684    return true;
1685  }
1686
1687  protected ParameterDefinition parseParameterDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1688    ParameterDefinition res = new ParameterDefinition();
1689    parseElementAttributes(xpp, res);
1690    next(xpp);
1691    int eventType = nextNoWhitespace(xpp);
1692    while (eventType != XmlPullParser.END_TAG) {
1693  if (!parseParameterDefinitionContent(eventType, xpp, res))
1694        unknownContent(xpp);
1695      eventType = nextNoWhitespace(xpp);
1696    }
1697    next(xpp);
1698    parseElementClose(res);
1699    return res;
1700  }
1701
1702  protected boolean parseParameterDefinitionContent(int eventType, XmlPullParser xpp, ParameterDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
1703      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
1704        res.setNameElement(parseCode(xpp));
1705      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
1706        res.setUseElement(parseEnumeration(xpp, ParameterDefinition.ParameterUse.NULL, new ParameterDefinition.ParameterUseEnumFactory()));
1707      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("min")) {
1708        res.setMinElement(parseInteger(xpp));
1709      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("max")) {
1710        res.setMaxElement(parseString(xpp));
1711      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
1712        res.setDocumentationElement(parseString(xpp));
1713      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1714        res.setTypeElement(parseCode(xpp));
1715      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
1716        res.setProfile(parseReference(xpp));
1717      } else if (!parseElementContent(eventType, xpp, res))
1718        return false;
1719    return true;
1720  }
1721
1722  protected void parseDomainResourceAttributes(XmlPullParser xpp, DomainResource res) throws XmlPullParserException, IOException, FHIRFormatError {
1723    parseResourceAttributes(xpp, res);
1724  }
1725
1726  protected boolean parseDomainResourceContent(int eventType, XmlPullParser xpp, DomainResource res) throws XmlPullParserException, IOException, FHIRFormatError {
1727      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
1728        res.setText(parseNarrative(xpp));
1729      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contained")) {
1730        res.getContained().add(parseResourceContained(xpp));
1731      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("extension")) {
1732        res.getExtension().add(parseExtension(xpp));
1733      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifierExtension")) {
1734        res.getModifierExtension().add(parseExtension(xpp));
1735    } else
1736    return parseResourceContent(eventType, xpp, res);
1737    return true;
1738  }
1739
1740  protected Parameters parseParameters(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1741    Parameters res = new Parameters();
1742    parseResourceAttributes(xpp, res);
1743    next(xpp);
1744    int eventType = nextNoWhitespace(xpp);
1745    while (eventType != XmlPullParser.END_TAG) {
1746  if (!parseParametersContent(eventType, xpp, res))
1747        unknownContent(xpp);
1748      eventType = nextNoWhitespace(xpp);
1749    }
1750    next(xpp);
1751    parseElementClose(res);
1752    return res;
1753  }
1754
1755  protected boolean parseParametersContent(int eventType, XmlPullParser xpp, Parameters res) throws XmlPullParserException, IOException, FHIRFormatError {
1756      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("parameter")) {
1757        res.getParameter().add(parseParametersParametersParameterComponent(xpp, res));
1758      } else if (!parseResourceContent(eventType, xpp, res))
1759        return false;
1760    return true;
1761  }
1762
1763  protected Parameters.ParametersParameterComponent parseParametersParametersParameterComponent(XmlPullParser xpp, Parameters owner) throws XmlPullParserException, IOException, FHIRFormatError {
1764    Parameters.ParametersParameterComponent res = new Parameters.ParametersParameterComponent();
1765    parseBackboneAttributes(xpp, res);
1766    next(xpp);
1767    int eventType = nextNoWhitespace(xpp);
1768    while (eventType != XmlPullParser.END_TAG) {
1769  if (!parseParametersParametersParameterComponentContent(eventType, xpp, owner, res))
1770        unknownContent(xpp);
1771      eventType = nextNoWhitespace(xpp);
1772    }
1773    next(xpp);
1774    parseElementClose(res);
1775    return res;
1776  }
1777
1778  protected boolean parseParametersParametersParameterComponentContent(int eventType, XmlPullParser xpp, Parameters owner, Parameters.ParametersParameterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1779      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
1780        res.setNameElement(parseString(xpp));
1781      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
1782        res.setValue(parseType("value", xpp));
1783      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
1784        res.setResource(parseResourceContained(xpp));
1785      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("part")) {
1786        res.getPart().add(parseParametersParametersParameterComponent(xpp, owner));
1787      } else if (!parseBackboneContent(eventType, xpp, res))
1788        return false;
1789    return true;
1790  }
1791
1792  protected void parseResourceAttributes(XmlPullParser xpp, Resource res) throws XmlPullParserException, IOException, FHIRFormatError {
1793    if (!comments.isEmpty()) {
1794      res.getFormatCommentsPre().addAll(comments);
1795      comments.clear();
1796     }
1797  }
1798
1799  protected boolean parseResourceContent(int eventType, XmlPullParser xpp, Resource res) throws XmlPullParserException, IOException, FHIRFormatError {
1800      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("id")) {
1801        res.setIdElement(parseId(xpp));
1802      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("meta")) {
1803        res.setMeta(parseMeta(xpp));
1804      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("implicitRules")) {
1805        res.setImplicitRulesElement(parseUri(xpp));
1806      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
1807        res.setLanguageElement(parseCode(xpp));
1808    } else
1809        return false;
1810    return true;
1811  }
1812
1813  protected Account parseAccount(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1814    Account res = new Account();
1815    parseDomainResourceAttributes(xpp, res);
1816    next(xpp);
1817    int eventType = nextNoWhitespace(xpp);
1818    while (eventType != XmlPullParser.END_TAG) {
1819  if (!parseAccountContent(eventType, xpp, res))
1820        unknownContent(xpp);
1821      eventType = nextNoWhitespace(xpp);
1822    }
1823    next(xpp);
1824    parseElementClose(res);
1825    return res;
1826  }
1827
1828  protected boolean parseAccountContent(int eventType, XmlPullParser xpp, Account res) throws XmlPullParserException, IOException, FHIRFormatError {
1829      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
1830        res.getIdentifier().add(parseIdentifier(xpp));
1831      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
1832        res.setStatusElement(parseEnumeration(xpp, Account.AccountStatus.NULL, new Account.AccountStatusEnumFactory()));
1833      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1834        res.setType(parseCodeableConcept(xpp));
1835      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
1836        res.setNameElement(parseString(xpp));
1837      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
1838        res.setSubject(parseReference(xpp));
1839      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
1840        res.setPeriod(parsePeriod(xpp));
1841      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("active")) {
1842        res.setActive(parsePeriod(xpp));
1843      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("balance")) {
1844        res.setBalance(parseMoney(xpp));
1845      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
1846        res.getCoverage().add(parseAccountCoverageComponent(xpp, res));
1847      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("owner")) {
1848        res.setOwner(parseReference(xpp));
1849      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
1850        res.setDescriptionElement(parseString(xpp));
1851      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("guarantor")) {
1852        res.getGuarantor().add(parseAccountGuarantorComponent(xpp, res));
1853      } else if (!parseDomainResourceContent(eventType, xpp, res))
1854        return false;
1855    return true;
1856  }
1857
1858  protected Account.CoverageComponent parseAccountCoverageComponent(XmlPullParser xpp, Account owner) throws XmlPullParserException, IOException, FHIRFormatError {
1859    Account.CoverageComponent res = new Account.CoverageComponent();
1860    parseBackboneAttributes(xpp, res);
1861    next(xpp);
1862    int eventType = nextNoWhitespace(xpp);
1863    while (eventType != XmlPullParser.END_TAG) {
1864  if (!parseAccountCoverageComponentContent(eventType, xpp, owner, res))
1865        unknownContent(xpp);
1866      eventType = nextNoWhitespace(xpp);
1867    }
1868    next(xpp);
1869    parseElementClose(res);
1870    return res;
1871  }
1872
1873  protected boolean parseAccountCoverageComponentContent(int eventType, XmlPullParser xpp, Account owner, Account.CoverageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1874      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
1875        res.setCoverage(parseReference(xpp));
1876      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
1877        res.setPriorityElement(parsePositiveInt(xpp));
1878      } else if (!parseBackboneContent(eventType, xpp, res))
1879        return false;
1880    return true;
1881  }
1882
1883  protected Account.GuarantorComponent parseAccountGuarantorComponent(XmlPullParser xpp, Account owner) throws XmlPullParserException, IOException, FHIRFormatError {
1884    Account.GuarantorComponent res = new Account.GuarantorComponent();
1885    parseBackboneAttributes(xpp, res);
1886    next(xpp);
1887    int eventType = nextNoWhitespace(xpp);
1888    while (eventType != XmlPullParser.END_TAG) {
1889  if (!parseAccountGuarantorComponentContent(eventType, xpp, owner, res))
1890        unknownContent(xpp);
1891      eventType = nextNoWhitespace(xpp);
1892    }
1893    next(xpp);
1894    parseElementClose(res);
1895    return res;
1896  }
1897
1898  protected boolean parseAccountGuarantorComponentContent(int eventType, XmlPullParser xpp, Account owner, Account.GuarantorComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1899      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("party")) {
1900        res.setParty(parseReference(xpp));
1901      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onHold")) {
1902        res.setOnHoldElement(parseBoolean(xpp));
1903      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
1904        res.setPeriod(parsePeriod(xpp));
1905      } else if (!parseBackboneContent(eventType, xpp, res))
1906        return false;
1907    return true;
1908  }
1909
1910  protected ActivityDefinition parseActivityDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1911    ActivityDefinition res = new ActivityDefinition();
1912    parseDomainResourceAttributes(xpp, res);
1913    next(xpp);
1914    int eventType = nextNoWhitespace(xpp);
1915    while (eventType != XmlPullParser.END_TAG) {
1916  if (!parseActivityDefinitionContent(eventType, xpp, res))
1917        unknownContent(xpp);
1918      eventType = nextNoWhitespace(xpp);
1919    }
1920    next(xpp);
1921    parseElementClose(res);
1922    return res;
1923  }
1924
1925  protected boolean parseActivityDefinitionContent(int eventType, XmlPullParser xpp, ActivityDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
1926      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
1927        res.setUrlElement(parseUri(xpp));
1928      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
1929        res.getIdentifier().add(parseIdentifier(xpp));
1930      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
1931        res.setVersionElement(parseString(xpp));
1932      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
1933        res.setNameElement(parseString(xpp));
1934      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
1935        res.setTitleElement(parseString(xpp));
1936      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
1937        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
1938      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
1939        res.setExperimentalElement(parseBoolean(xpp));
1940      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
1941        res.setDateElement(parseDateTime(xpp));
1942      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
1943        res.setPublisherElement(parseString(xpp));
1944      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
1945        res.setDescriptionElement(parseMarkdown(xpp));
1946      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
1947        res.setPurposeElement(parseMarkdown(xpp));
1948      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("usage")) {
1949        res.setUsageElement(parseString(xpp));
1950      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("approvalDate")) {
1951        res.setApprovalDateElement(parseDate(xpp));
1952      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastReviewDate")) {
1953        res.setLastReviewDateElement(parseDate(xpp));
1954      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("effectivePeriod")) {
1955        res.setEffectivePeriod(parsePeriod(xpp));
1956      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
1957        res.getUseContext().add(parseUsageContext(xpp));
1958      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
1959        res.getJurisdiction().add(parseCodeableConcept(xpp));
1960      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("topic")) {
1961        res.getTopic().add(parseCodeableConcept(xpp));
1962      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contributor")) {
1963        res.getContributor().add(parseContributor(xpp));
1964      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
1965        res.getContact().add(parseContactDetail(xpp));
1966      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
1967        res.setCopyrightElement(parseMarkdown(xpp));
1968      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatedArtifact")) {
1969        res.getRelatedArtifact().add(parseRelatedArtifact(xpp));
1970      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("library")) {
1971        res.getLibrary().add(parseReference(xpp));
1972      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("kind")) {
1973        res.setKindElement(parseEnumeration(xpp, ActivityDefinition.ActivityDefinitionKind.NULL, new ActivityDefinition.ActivityDefinitionKindEnumFactory()));
1974      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
1975        res.setCode(parseCodeableConcept(xpp));
1976      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "timing")) {
1977        res.setTiming(parseType("timing", xpp));
1978      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
1979        res.setLocation(parseReference(xpp));
1980      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
1981        res.getParticipant().add(parseActivityDefinitionActivityDefinitionParticipantComponent(xpp, res));
1982      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "product")) {
1983        res.setProduct(parseType("product", xpp));
1984      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
1985        res.setQuantity(parseSimpleQuantity(xpp));
1986      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dosage")) {
1987        res.getDosage().add(parseDosage(xpp));
1988      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodySite")) {
1989        res.getBodySite().add(parseCodeableConcept(xpp));
1990      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("transform")) {
1991        res.setTransform(parseReference(xpp));
1992      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dynamicValue")) {
1993        res.getDynamicValue().add(parseActivityDefinitionActivityDefinitionDynamicValueComponent(xpp, res));
1994      } else if (!parseDomainResourceContent(eventType, xpp, res))
1995        return false;
1996    return true;
1997  }
1998
1999  protected ActivityDefinition.ActivityDefinitionParticipantComponent parseActivityDefinitionActivityDefinitionParticipantComponent(XmlPullParser xpp, ActivityDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
2000    ActivityDefinition.ActivityDefinitionParticipantComponent res = new ActivityDefinition.ActivityDefinitionParticipantComponent();
2001    parseBackboneAttributes(xpp, res);
2002    next(xpp);
2003    int eventType = nextNoWhitespace(xpp);
2004    while (eventType != XmlPullParser.END_TAG) {
2005  if (!parseActivityDefinitionActivityDefinitionParticipantComponentContent(eventType, xpp, owner, res))
2006        unknownContent(xpp);
2007      eventType = nextNoWhitespace(xpp);
2008    }
2009    next(xpp);
2010    parseElementClose(res);
2011    return res;
2012  }
2013
2014  protected boolean parseActivityDefinitionActivityDefinitionParticipantComponentContent(int eventType, XmlPullParser xpp, ActivityDefinition owner, ActivityDefinition.ActivityDefinitionParticipantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2015      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2016        res.setTypeElement(parseEnumeration(xpp, ActivityDefinition.ActivityParticipantType.NULL, new ActivityDefinition.ActivityParticipantTypeEnumFactory()));
2017      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
2018        res.setRole(parseCodeableConcept(xpp));
2019      } else if (!parseBackboneContent(eventType, xpp, res))
2020        return false;
2021    return true;
2022  }
2023
2024  protected ActivityDefinition.ActivityDefinitionDynamicValueComponent parseActivityDefinitionActivityDefinitionDynamicValueComponent(XmlPullParser xpp, ActivityDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
2025    ActivityDefinition.ActivityDefinitionDynamicValueComponent res = new ActivityDefinition.ActivityDefinitionDynamicValueComponent();
2026    parseBackboneAttributes(xpp, res);
2027    next(xpp);
2028    int eventType = nextNoWhitespace(xpp);
2029    while (eventType != XmlPullParser.END_TAG) {
2030  if (!parseActivityDefinitionActivityDefinitionDynamicValueComponentContent(eventType, xpp, owner, res))
2031        unknownContent(xpp);
2032      eventType = nextNoWhitespace(xpp);
2033    }
2034    next(xpp);
2035    parseElementClose(res);
2036    return res;
2037  }
2038
2039  protected boolean parseActivityDefinitionActivityDefinitionDynamicValueComponentContent(int eventType, XmlPullParser xpp, ActivityDefinition owner, ActivityDefinition.ActivityDefinitionDynamicValueComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2040      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2041        res.setDescriptionElement(parseString(xpp));
2042      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
2043        res.setPathElement(parseString(xpp));
2044      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
2045        res.setLanguageElement(parseString(xpp));
2046      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expression")) {
2047        res.setExpressionElement(parseString(xpp));
2048      } else if (!parseBackboneContent(eventType, xpp, res))
2049        return false;
2050    return true;
2051  }
2052
2053  protected AdverseEvent parseAdverseEvent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2054    AdverseEvent res = new AdverseEvent();
2055    parseDomainResourceAttributes(xpp, res);
2056    next(xpp);
2057    int eventType = nextNoWhitespace(xpp);
2058    while (eventType != XmlPullParser.END_TAG) {
2059  if (!parseAdverseEventContent(eventType, xpp, res))
2060        unknownContent(xpp);
2061      eventType = nextNoWhitespace(xpp);
2062    }
2063    next(xpp);
2064    parseElementClose(res);
2065    return res;
2066  }
2067
2068  protected boolean parseAdverseEventContent(int eventType, XmlPullParser xpp, AdverseEvent res) throws XmlPullParserException, IOException, FHIRFormatError {
2069      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2070        res.setIdentifier(parseIdentifier(xpp));
2071      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
2072        res.setCategoryElement(parseEnumeration(xpp, AdverseEvent.AdverseEventCategory.NULL, new AdverseEvent.AdverseEventCategoryEnumFactory()));
2073      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2074        res.setType(parseCodeableConcept(xpp));
2075      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
2076        res.setSubject(parseReference(xpp));
2077      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
2078        res.setDateElement(parseDateTime(xpp));
2079      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reaction")) {
2080        res.getReaction().add(parseReference(xpp));
2081      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
2082        res.setLocation(parseReference(xpp));
2083      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("seriousness")) {
2084        res.setSeriousness(parseCodeableConcept(xpp));
2085      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
2086        res.setOutcome(parseCodeableConcept(xpp));
2087      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recorder")) {
2088        res.setRecorder(parseReference(xpp));
2089      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("eventParticipant")) {
2090        res.setEventParticipant(parseReference(xpp));
2091      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2092        res.setDescriptionElement(parseString(xpp));
2093      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("suspectEntity")) {
2094        res.getSuspectEntity().add(parseAdverseEventAdverseEventSuspectEntityComponent(xpp, res));
2095      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subjectMedicalHistory")) {
2096        res.getSubjectMedicalHistory().add(parseReference(xpp));
2097      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referenceDocument")) {
2098        res.getReferenceDocument().add(parseReference(xpp));
2099      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("study")) {
2100        res.getStudy().add(parseReference(xpp));
2101      } else if (!parseDomainResourceContent(eventType, xpp, res))
2102        return false;
2103    return true;
2104  }
2105
2106  protected AdverseEvent.AdverseEventSuspectEntityComponent parseAdverseEventAdverseEventSuspectEntityComponent(XmlPullParser xpp, AdverseEvent owner) throws XmlPullParserException, IOException, FHIRFormatError {
2107    AdverseEvent.AdverseEventSuspectEntityComponent res = new AdverseEvent.AdverseEventSuspectEntityComponent();
2108    parseBackboneAttributes(xpp, res);
2109    next(xpp);
2110    int eventType = nextNoWhitespace(xpp);
2111    while (eventType != XmlPullParser.END_TAG) {
2112  if (!parseAdverseEventAdverseEventSuspectEntityComponentContent(eventType, xpp, owner, res))
2113        unknownContent(xpp);
2114      eventType = nextNoWhitespace(xpp);
2115    }
2116    next(xpp);
2117    parseElementClose(res);
2118    return res;
2119  }
2120
2121  protected boolean parseAdverseEventAdverseEventSuspectEntityComponentContent(int eventType, XmlPullParser xpp, AdverseEvent owner, AdverseEvent.AdverseEventSuspectEntityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2122      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instance")) {
2123        res.setInstance(parseReference(xpp));
2124      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("causality")) {
2125        res.setCausalityElement(parseEnumeration(xpp, AdverseEvent.AdverseEventCausality.NULL, new AdverseEvent.AdverseEventCausalityEnumFactory()));
2126      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("causalityAssessment")) {
2127        res.setCausalityAssessment(parseCodeableConcept(xpp));
2128      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("causalityProductRelatedness")) {
2129        res.setCausalityProductRelatednessElement(parseString(xpp));
2130      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("causalityMethod")) {
2131        res.setCausalityMethod(parseCodeableConcept(xpp));
2132      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("causalityAuthor")) {
2133        res.setCausalityAuthor(parseReference(xpp));
2134      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("causalityResult")) {
2135        res.setCausalityResult(parseCodeableConcept(xpp));
2136      } else if (!parseBackboneContent(eventType, xpp, res))
2137        return false;
2138    return true;
2139  }
2140
2141  protected AllergyIntolerance parseAllergyIntolerance(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2142    AllergyIntolerance res = new AllergyIntolerance();
2143    parseDomainResourceAttributes(xpp, res);
2144    next(xpp);
2145    int eventType = nextNoWhitespace(xpp);
2146    while (eventType != XmlPullParser.END_TAG) {
2147  if (!parseAllergyIntoleranceContent(eventType, xpp, res))
2148        unknownContent(xpp);
2149      eventType = nextNoWhitespace(xpp);
2150    }
2151    next(xpp);
2152    parseElementClose(res);
2153    return res;
2154  }
2155
2156  protected boolean parseAllergyIntoleranceContent(int eventType, XmlPullParser xpp, AllergyIntolerance res) throws XmlPullParserException, IOException, FHIRFormatError {
2157      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2158        res.getIdentifier().add(parseIdentifier(xpp));
2159      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("clinicalStatus")) {
2160        res.setClinicalStatusElement(parseEnumeration(xpp, AllergyIntolerance.AllergyIntoleranceClinicalStatus.NULL, new AllergyIntolerance.AllergyIntoleranceClinicalStatusEnumFactory()));
2161      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("verificationStatus")) {
2162        res.setVerificationStatusElement(parseEnumeration(xpp, AllergyIntolerance.AllergyIntoleranceVerificationStatus.NULL, new AllergyIntolerance.AllergyIntoleranceVerificationStatusEnumFactory()));
2163      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2164        res.setTypeElement(parseEnumeration(xpp, AllergyIntolerance.AllergyIntoleranceType.NULL, new AllergyIntolerance.AllergyIntoleranceTypeEnumFactory()));
2165      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
2166        res.getCategory().add(parseEnumeration(xpp, AllergyIntolerance.AllergyIntoleranceCategory.NULL, new AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory()));
2167      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("criticality")) {
2168        res.setCriticalityElement(parseEnumeration(xpp, AllergyIntolerance.AllergyIntoleranceCriticality.NULL, new AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory()));
2169      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
2170        res.setCode(parseCodeableConcept(xpp));
2171      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
2172        res.setPatient(parseReference(xpp));
2173      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "onset")) {
2174        res.setOnset(parseType("onset", xpp));
2175      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("assertedDate")) {
2176        res.setAssertedDateElement(parseDateTime(xpp));
2177      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recorder")) {
2178        res.setRecorder(parseReference(xpp));
2179      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("asserter")) {
2180        res.setAsserter(parseReference(xpp));
2181      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastOccurrence")) {
2182        res.setLastOccurrenceElement(parseDateTime(xpp));
2183      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
2184        res.getNote().add(parseAnnotation(xpp));
2185      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reaction")) {
2186        res.getReaction().add(parseAllergyIntoleranceAllergyIntoleranceReactionComponent(xpp, res));
2187      } else if (!parseDomainResourceContent(eventType, xpp, res))
2188        return false;
2189    return true;
2190  }
2191
2192  protected AllergyIntolerance.AllergyIntoleranceReactionComponent parseAllergyIntoleranceAllergyIntoleranceReactionComponent(XmlPullParser xpp, AllergyIntolerance owner) throws XmlPullParserException, IOException, FHIRFormatError {
2193    AllergyIntolerance.AllergyIntoleranceReactionComponent res = new AllergyIntolerance.AllergyIntoleranceReactionComponent();
2194    parseBackboneAttributes(xpp, res);
2195    next(xpp);
2196    int eventType = nextNoWhitespace(xpp);
2197    while (eventType != XmlPullParser.END_TAG) {
2198  if (!parseAllergyIntoleranceAllergyIntoleranceReactionComponentContent(eventType, xpp, owner, res))
2199        unknownContent(xpp);
2200      eventType = nextNoWhitespace(xpp);
2201    }
2202    next(xpp);
2203    parseElementClose(res);
2204    return res;
2205  }
2206
2207  protected boolean parseAllergyIntoleranceAllergyIntoleranceReactionComponentContent(int eventType, XmlPullParser xpp, AllergyIntolerance owner, AllergyIntolerance.AllergyIntoleranceReactionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2208      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("substance")) {
2209        res.setSubstance(parseCodeableConcept(xpp));
2210      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("manifestation")) {
2211        res.getManifestation().add(parseCodeableConcept(xpp));
2212      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2213        res.setDescriptionElement(parseString(xpp));
2214      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onset")) {
2215        res.setOnsetElement(parseDateTime(xpp));
2216      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("severity")) {
2217        res.setSeverityElement(parseEnumeration(xpp, AllergyIntolerance.AllergyIntoleranceSeverity.NULL, new AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory()));
2218      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("exposureRoute")) {
2219        res.setExposureRoute(parseCodeableConcept(xpp));
2220      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
2221        res.getNote().add(parseAnnotation(xpp));
2222      } else if (!parseBackboneContent(eventType, xpp, res))
2223        return false;
2224    return true;
2225  }
2226
2227  protected Appointment parseAppointment(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2228    Appointment res = new Appointment();
2229    parseDomainResourceAttributes(xpp, res);
2230    next(xpp);
2231    int eventType = nextNoWhitespace(xpp);
2232    while (eventType != XmlPullParser.END_TAG) {
2233  if (!parseAppointmentContent(eventType, xpp, res))
2234        unknownContent(xpp);
2235      eventType = nextNoWhitespace(xpp);
2236    }
2237    next(xpp);
2238    parseElementClose(res);
2239    return res;
2240  }
2241
2242  protected boolean parseAppointmentContent(int eventType, XmlPullParser xpp, Appointment res) throws XmlPullParserException, IOException, FHIRFormatError {
2243      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2244        res.getIdentifier().add(parseIdentifier(xpp));
2245      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
2246        res.setStatusElement(parseEnumeration(xpp, Appointment.AppointmentStatus.NULL, new Appointment.AppointmentStatusEnumFactory()));
2247      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("serviceCategory")) {
2248        res.setServiceCategory(parseCodeableConcept(xpp));
2249      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("serviceType")) {
2250        res.getServiceType().add(parseCodeableConcept(xpp));
2251      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specialty")) {
2252        res.getSpecialty().add(parseCodeableConcept(xpp));
2253      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("appointmentType")) {
2254        res.setAppointmentType(parseCodeableConcept(xpp));
2255      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
2256        res.getReason().add(parseCodeableConcept(xpp));
2257      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("indication")) {
2258        res.getIndication().add(parseReference(xpp));
2259      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
2260        res.setPriorityElement(parseUnsignedInt(xpp));
2261      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2262        res.setDescriptionElement(parseString(xpp));
2263      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInformation")) {
2264        res.getSupportingInformation().add(parseReference(xpp));
2265      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("start")) {
2266        res.setStartElement(parseInstant(xpp));
2267      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("end")) {
2268        res.setEndElement(parseInstant(xpp));
2269      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("minutesDuration")) {
2270        res.setMinutesDurationElement(parsePositiveInt(xpp));
2271      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("slot")) {
2272        res.getSlot().add(parseReference(xpp));
2273      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
2274        res.setCreatedElement(parseDateTime(xpp));
2275      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
2276        res.setCommentElement(parseString(xpp));
2277      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("incomingReferral")) {
2278        res.getIncomingReferral().add(parseReference(xpp));
2279      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
2280        res.getParticipant().add(parseAppointmentAppointmentParticipantComponent(xpp, res));
2281      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestedPeriod")) {
2282        res.getRequestedPeriod().add(parsePeriod(xpp));
2283      } else if (!parseDomainResourceContent(eventType, xpp, res))
2284        return false;
2285    return true;
2286  }
2287
2288  protected Appointment.AppointmentParticipantComponent parseAppointmentAppointmentParticipantComponent(XmlPullParser xpp, Appointment owner) throws XmlPullParserException, IOException, FHIRFormatError {
2289    Appointment.AppointmentParticipantComponent res = new Appointment.AppointmentParticipantComponent();
2290    parseBackboneAttributes(xpp, res);
2291    next(xpp);
2292    int eventType = nextNoWhitespace(xpp);
2293    while (eventType != XmlPullParser.END_TAG) {
2294  if (!parseAppointmentAppointmentParticipantComponentContent(eventType, xpp, owner, res))
2295        unknownContent(xpp);
2296      eventType = nextNoWhitespace(xpp);
2297    }
2298    next(xpp);
2299    parseElementClose(res);
2300    return res;
2301  }
2302
2303  protected boolean parseAppointmentAppointmentParticipantComponentContent(int eventType, XmlPullParser xpp, Appointment owner, Appointment.AppointmentParticipantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2304      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2305        res.getType().add(parseCodeableConcept(xpp));
2306      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
2307        res.setActor(parseReference(xpp));
2308      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("required")) {
2309        res.setRequiredElement(parseEnumeration(xpp, Appointment.ParticipantRequired.NULL, new Appointment.ParticipantRequiredEnumFactory()));
2310      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
2311        res.setStatusElement(parseEnumeration(xpp, Appointment.ParticipationStatus.NULL, new Appointment.ParticipationStatusEnumFactory()));
2312      } else if (!parseBackboneContent(eventType, xpp, res))
2313        return false;
2314    return true;
2315  }
2316
2317  protected AppointmentResponse parseAppointmentResponse(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2318    AppointmentResponse res = new AppointmentResponse();
2319    parseDomainResourceAttributes(xpp, res);
2320    next(xpp);
2321    int eventType = nextNoWhitespace(xpp);
2322    while (eventType != XmlPullParser.END_TAG) {
2323  if (!parseAppointmentResponseContent(eventType, xpp, res))
2324        unknownContent(xpp);
2325      eventType = nextNoWhitespace(xpp);
2326    }
2327    next(xpp);
2328    parseElementClose(res);
2329    return res;
2330  }
2331
2332  protected boolean parseAppointmentResponseContent(int eventType, XmlPullParser xpp, AppointmentResponse res) throws XmlPullParserException, IOException, FHIRFormatError {
2333      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2334        res.getIdentifier().add(parseIdentifier(xpp));
2335      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("appointment")) {
2336        res.setAppointment(parseReference(xpp));
2337      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("start")) {
2338        res.setStartElement(parseInstant(xpp));
2339      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("end")) {
2340        res.setEndElement(parseInstant(xpp));
2341      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participantType")) {
2342        res.getParticipantType().add(parseCodeableConcept(xpp));
2343      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
2344        res.setActor(parseReference(xpp));
2345      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participantStatus")) {
2346        res.setParticipantStatusElement(parseEnumeration(xpp, AppointmentResponse.ParticipantStatus.NULL, new AppointmentResponse.ParticipantStatusEnumFactory()));
2347      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
2348        res.setCommentElement(parseString(xpp));
2349      } else if (!parseDomainResourceContent(eventType, xpp, res))
2350        return false;
2351    return true;
2352  }
2353
2354  protected AuditEvent parseAuditEvent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2355    AuditEvent res = new AuditEvent();
2356    parseDomainResourceAttributes(xpp, res);
2357    next(xpp);
2358    int eventType = nextNoWhitespace(xpp);
2359    while (eventType != XmlPullParser.END_TAG) {
2360  if (!parseAuditEventContent(eventType, xpp, res))
2361        unknownContent(xpp);
2362      eventType = nextNoWhitespace(xpp);
2363    }
2364    next(xpp);
2365    parseElementClose(res);
2366    return res;
2367  }
2368
2369  protected boolean parseAuditEventContent(int eventType, XmlPullParser xpp, AuditEvent res) throws XmlPullParserException, IOException, FHIRFormatError {
2370      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2371        res.setType(parseCoding(xpp));
2372      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subtype")) {
2373        res.getSubtype().add(parseCoding(xpp));
2374      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
2375        res.setActionElement(parseEnumeration(xpp, AuditEvent.AuditEventAction.NULL, new AuditEvent.AuditEventActionEnumFactory()));
2376      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recorded")) {
2377        res.setRecordedElement(parseInstant(xpp));
2378      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
2379        res.setOutcomeElement(parseEnumeration(xpp, AuditEvent.AuditEventOutcome.NULL, new AuditEvent.AuditEventOutcomeEnumFactory()));
2380      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcomeDesc")) {
2381        res.setOutcomeDescElement(parseString(xpp));
2382      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purposeOfEvent")) {
2383        res.getPurposeOfEvent().add(parseCodeableConcept(xpp));
2384      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("agent")) {
2385        res.getAgent().add(parseAuditEventAuditEventAgentComponent(xpp, res));
2386      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
2387        res.setSource(parseAuditEventAuditEventSourceComponent(xpp, res));
2388      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("entity")) {
2389        res.getEntity().add(parseAuditEventAuditEventEntityComponent(xpp, res));
2390      } else if (!parseDomainResourceContent(eventType, xpp, res))
2391        return false;
2392    return true;
2393  }
2394
2395  protected AuditEvent.AuditEventAgentComponent parseAuditEventAuditEventAgentComponent(XmlPullParser xpp, AuditEvent owner) throws XmlPullParserException, IOException, FHIRFormatError {
2396    AuditEvent.AuditEventAgentComponent res = new AuditEvent.AuditEventAgentComponent();
2397    parseBackboneAttributes(xpp, res);
2398    next(xpp);
2399    int eventType = nextNoWhitespace(xpp);
2400    while (eventType != XmlPullParser.END_TAG) {
2401  if (!parseAuditEventAuditEventAgentComponentContent(eventType, xpp, owner, res))
2402        unknownContent(xpp);
2403      eventType = nextNoWhitespace(xpp);
2404    }
2405    next(xpp);
2406    parseElementClose(res);
2407    return res;
2408  }
2409
2410  protected boolean parseAuditEventAuditEventAgentComponentContent(int eventType, XmlPullParser xpp, AuditEvent owner, AuditEvent.AuditEventAgentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2411      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
2412        res.getRole().add(parseCodeableConcept(xpp));
2413      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
2414        res.setReference(parseReference(xpp));
2415      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("userId")) {
2416        res.setUserId(parseIdentifier(xpp));
2417      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("altId")) {
2418        res.setAltIdElement(parseString(xpp));
2419      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
2420        res.setNameElement(parseString(xpp));
2421      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestor")) {
2422        res.setRequestorElement(parseBoolean(xpp));
2423      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
2424        res.setLocation(parseReference(xpp));
2425      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("policy")) {
2426        res.getPolicy().add(parseUri(xpp));
2427      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("media")) {
2428        res.setMedia(parseCoding(xpp));
2429      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("network")) {
2430        res.setNetwork(parseAuditEventAuditEventAgentNetworkComponent(xpp, owner));
2431      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purposeOfUse")) {
2432        res.getPurposeOfUse().add(parseCodeableConcept(xpp));
2433      } else if (!parseBackboneContent(eventType, xpp, res))
2434        return false;
2435    return true;
2436  }
2437
2438  protected AuditEvent.AuditEventAgentNetworkComponent parseAuditEventAuditEventAgentNetworkComponent(XmlPullParser xpp, AuditEvent owner) throws XmlPullParserException, IOException, FHIRFormatError {
2439    AuditEvent.AuditEventAgentNetworkComponent res = new AuditEvent.AuditEventAgentNetworkComponent();
2440    parseBackboneAttributes(xpp, res);
2441    next(xpp);
2442    int eventType = nextNoWhitespace(xpp);
2443    while (eventType != XmlPullParser.END_TAG) {
2444  if (!parseAuditEventAuditEventAgentNetworkComponentContent(eventType, xpp, owner, res))
2445        unknownContent(xpp);
2446      eventType = nextNoWhitespace(xpp);
2447    }
2448    next(xpp);
2449    parseElementClose(res);
2450    return res;
2451  }
2452
2453  protected boolean parseAuditEventAuditEventAgentNetworkComponentContent(int eventType, XmlPullParser xpp, AuditEvent owner, AuditEvent.AuditEventAgentNetworkComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2454      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("address")) {
2455        res.setAddressElement(parseString(xpp));
2456      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2457        res.setTypeElement(parseEnumeration(xpp, AuditEvent.AuditEventAgentNetworkType.NULL, new AuditEvent.AuditEventAgentNetworkTypeEnumFactory()));
2458      } else if (!parseBackboneContent(eventType, xpp, res))
2459        return false;
2460    return true;
2461  }
2462
2463  protected AuditEvent.AuditEventSourceComponent parseAuditEventAuditEventSourceComponent(XmlPullParser xpp, AuditEvent owner) throws XmlPullParserException, IOException, FHIRFormatError {
2464    AuditEvent.AuditEventSourceComponent res = new AuditEvent.AuditEventSourceComponent();
2465    parseBackboneAttributes(xpp, res);
2466    next(xpp);
2467    int eventType = nextNoWhitespace(xpp);
2468    while (eventType != XmlPullParser.END_TAG) {
2469  if (!parseAuditEventAuditEventSourceComponentContent(eventType, xpp, owner, res))
2470        unknownContent(xpp);
2471      eventType = nextNoWhitespace(xpp);
2472    }
2473    next(xpp);
2474    parseElementClose(res);
2475    return res;
2476  }
2477
2478  protected boolean parseAuditEventAuditEventSourceComponentContent(int eventType, XmlPullParser xpp, AuditEvent owner, AuditEvent.AuditEventSourceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2479      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("site")) {
2480        res.setSiteElement(parseString(xpp));
2481      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2482        res.setIdentifier(parseIdentifier(xpp));
2483      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2484        res.getType().add(parseCoding(xpp));
2485      } else if (!parseBackboneContent(eventType, xpp, res))
2486        return false;
2487    return true;
2488  }
2489
2490  protected AuditEvent.AuditEventEntityComponent parseAuditEventAuditEventEntityComponent(XmlPullParser xpp, AuditEvent owner) throws XmlPullParserException, IOException, FHIRFormatError {
2491    AuditEvent.AuditEventEntityComponent res = new AuditEvent.AuditEventEntityComponent();
2492    parseBackboneAttributes(xpp, res);
2493    next(xpp);
2494    int eventType = nextNoWhitespace(xpp);
2495    while (eventType != XmlPullParser.END_TAG) {
2496  if (!parseAuditEventAuditEventEntityComponentContent(eventType, xpp, owner, res))
2497        unknownContent(xpp);
2498      eventType = nextNoWhitespace(xpp);
2499    }
2500    next(xpp);
2501    parseElementClose(res);
2502    return res;
2503  }
2504
2505  protected boolean parseAuditEventAuditEventEntityComponentContent(int eventType, XmlPullParser xpp, AuditEvent owner, AuditEvent.AuditEventEntityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2506      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2507        res.setIdentifier(parseIdentifier(xpp));
2508      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
2509        res.setReference(parseReference(xpp));
2510      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2511        res.setType(parseCoding(xpp));
2512      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
2513        res.setRole(parseCoding(xpp));
2514      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lifecycle")) {
2515        res.setLifecycle(parseCoding(xpp));
2516      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("securityLabel")) {
2517        res.getSecurityLabel().add(parseCoding(xpp));
2518      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
2519        res.setNameElement(parseString(xpp));
2520      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2521        res.setDescriptionElement(parseString(xpp));
2522      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("query")) {
2523        res.setQueryElement(parseBase64Binary(xpp));
2524      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
2525        res.getDetail().add(parseAuditEventAuditEventEntityDetailComponent(xpp, owner));
2526      } else if (!parseBackboneContent(eventType, xpp, res))
2527        return false;
2528    return true;
2529  }
2530
2531  protected AuditEvent.AuditEventEntityDetailComponent parseAuditEventAuditEventEntityDetailComponent(XmlPullParser xpp, AuditEvent owner) throws XmlPullParserException, IOException, FHIRFormatError {
2532    AuditEvent.AuditEventEntityDetailComponent res = new AuditEvent.AuditEventEntityDetailComponent();
2533    parseBackboneAttributes(xpp, res);
2534    next(xpp);
2535    int eventType = nextNoWhitespace(xpp);
2536    while (eventType != XmlPullParser.END_TAG) {
2537  if (!parseAuditEventAuditEventEntityDetailComponentContent(eventType, xpp, owner, res))
2538        unknownContent(xpp);
2539      eventType = nextNoWhitespace(xpp);
2540    }
2541    next(xpp);
2542    parseElementClose(res);
2543    return res;
2544  }
2545
2546  protected boolean parseAuditEventAuditEventEntityDetailComponentContent(int eventType, XmlPullParser xpp, AuditEvent owner, AuditEvent.AuditEventEntityDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2547      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2548        res.setTypeElement(parseString(xpp));
2549      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
2550        res.setValueElement(parseBase64Binary(xpp));
2551      } else if (!parseBackboneContent(eventType, xpp, res))
2552        return false;
2553    return true;
2554  }
2555
2556  protected Basic parseBasic(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2557    Basic res = new Basic();
2558    parseDomainResourceAttributes(xpp, res);
2559    next(xpp);
2560    int eventType = nextNoWhitespace(xpp);
2561    while (eventType != XmlPullParser.END_TAG) {
2562  if (!parseBasicContent(eventType, xpp, res))
2563        unknownContent(xpp);
2564      eventType = nextNoWhitespace(xpp);
2565    }
2566    next(xpp);
2567    parseElementClose(res);
2568    return res;
2569  }
2570
2571  protected boolean parseBasicContent(int eventType, XmlPullParser xpp, Basic res) throws XmlPullParserException, IOException, FHIRFormatError {
2572      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2573        res.getIdentifier().add(parseIdentifier(xpp));
2574      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
2575        res.setCode(parseCodeableConcept(xpp));
2576      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
2577        res.setSubject(parseReference(xpp));
2578      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
2579        res.setCreatedElement(parseDate(xpp));
2580      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
2581        res.setAuthor(parseReference(xpp));
2582      } else if (!parseDomainResourceContent(eventType, xpp, res))
2583        return false;
2584    return true;
2585  }
2586
2587  protected Binary parseBinary(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2588    Binary res = new Binary();
2589    parseResourceAttributes(xpp, res);
2590    next(xpp);
2591    int eventType = nextNoWhitespace(xpp);
2592    while (eventType != XmlPullParser.END_TAG) {
2593  if (!parseBinaryContent(eventType, xpp, res))
2594        unknownContent(xpp);
2595      eventType = nextNoWhitespace(xpp);
2596    }
2597    next(xpp);
2598    parseElementClose(res);
2599    return res;
2600  }
2601
2602  protected boolean parseBinaryContent(int eventType, XmlPullParser xpp, Binary res) throws XmlPullParserException, IOException, FHIRFormatError {
2603      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contentType")) {
2604        res.setContentTypeElement(parseCode(xpp));
2605      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("securityContext")) {
2606        res.setSecurityContext(parseReference(xpp));
2607      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("content")) {
2608        res.setContentElement(parseBase64Binary(xpp));
2609      } else if (!parseResourceContent(eventType, xpp, res))
2610        return false;
2611    return true;
2612  }
2613
2614  protected BodySite parseBodySite(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2615    BodySite res = new BodySite();
2616    parseDomainResourceAttributes(xpp, res);
2617    next(xpp);
2618    int eventType = nextNoWhitespace(xpp);
2619    while (eventType != XmlPullParser.END_TAG) {
2620  if (!parseBodySiteContent(eventType, xpp, res))
2621        unknownContent(xpp);
2622      eventType = nextNoWhitespace(xpp);
2623    }
2624    next(xpp);
2625    parseElementClose(res);
2626    return res;
2627  }
2628
2629  protected boolean parseBodySiteContent(int eventType, XmlPullParser xpp, BodySite res) throws XmlPullParserException, IOException, FHIRFormatError {
2630      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2631        res.getIdentifier().add(parseIdentifier(xpp));
2632      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("active")) {
2633        res.setActiveElement(parseBoolean(xpp));
2634      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
2635        res.setCode(parseCodeableConcept(xpp));
2636      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("qualifier")) {
2637        res.getQualifier().add(parseCodeableConcept(xpp));
2638      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2639        res.setDescriptionElement(parseString(xpp));
2640      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("image")) {
2641        res.getImage().add(parseAttachment(xpp));
2642      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
2643        res.setPatient(parseReference(xpp));
2644      } else if (!parseDomainResourceContent(eventType, xpp, res))
2645        return false;
2646    return true;
2647  }
2648
2649  protected Bundle parseBundle(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2650    Bundle res = new Bundle();
2651    parseResourceAttributes(xpp, res);
2652    next(xpp);
2653    int eventType = nextNoWhitespace(xpp);
2654    while (eventType != XmlPullParser.END_TAG) {
2655  if (!parseBundleContent(eventType, xpp, res))
2656        unknownContent(xpp);
2657      eventType = nextNoWhitespace(xpp);
2658    }
2659    next(xpp);
2660    parseElementClose(res);
2661    return res;
2662  }
2663
2664  protected boolean parseBundleContent(int eventType, XmlPullParser xpp, Bundle res) throws XmlPullParserException, IOException, FHIRFormatError {
2665      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2666        res.setIdentifier(parseIdentifier(xpp));
2667      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2668        res.setTypeElement(parseEnumeration(xpp, Bundle.BundleType.NULL, new Bundle.BundleTypeEnumFactory()));
2669      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("total")) {
2670        res.setTotalElement(parseUnsignedInt(xpp));
2671      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("link")) {
2672        res.getLink().add(parseBundleBundleLinkComponent(xpp, res));
2673      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("entry")) {
2674        res.getEntry().add(parseBundleBundleEntryComponent(xpp, res));
2675      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("signature")) {
2676        res.setSignature(parseSignature(xpp));
2677      } else if (!parseResourceContent(eventType, xpp, res))
2678        return false;
2679    return true;
2680  }
2681
2682  protected Bundle.BundleLinkComponent parseBundleBundleLinkComponent(XmlPullParser xpp, Bundle owner) throws XmlPullParserException, IOException, FHIRFormatError {
2683    Bundle.BundleLinkComponent res = new Bundle.BundleLinkComponent();
2684    parseBackboneAttributes(xpp, res);
2685    next(xpp);
2686    int eventType = nextNoWhitespace(xpp);
2687    while (eventType != XmlPullParser.END_TAG) {
2688  if (!parseBundleBundleLinkComponentContent(eventType, xpp, owner, res))
2689        unknownContent(xpp);
2690      eventType = nextNoWhitespace(xpp);
2691    }
2692    next(xpp);
2693    parseElementClose(res);
2694    return res;
2695  }
2696
2697  protected boolean parseBundleBundleLinkComponentContent(int eventType, XmlPullParser xpp, Bundle owner, Bundle.BundleLinkComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2698      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relation")) {
2699        res.setRelationElement(parseString(xpp));
2700      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
2701        res.setUrlElement(parseUri(xpp));
2702      } else if (!parseBackboneContent(eventType, xpp, res))
2703        return false;
2704    return true;
2705  }
2706
2707  protected Bundle.BundleEntryComponent parseBundleBundleEntryComponent(XmlPullParser xpp, Bundle owner) throws XmlPullParserException, IOException, FHIRFormatError {
2708    Bundle.BundleEntryComponent res = new Bundle.BundleEntryComponent();
2709    parseBackboneAttributes(xpp, res);
2710    next(xpp);
2711    int eventType = nextNoWhitespace(xpp);
2712    while (eventType != XmlPullParser.END_TAG) {
2713  if (!parseBundleBundleEntryComponentContent(eventType, xpp, owner, res))
2714        unknownContent(xpp);
2715      eventType = nextNoWhitespace(xpp);
2716    }
2717    next(xpp);
2718    parseElementClose(res);
2719    return res;
2720  }
2721
2722  protected boolean parseBundleBundleEntryComponentContent(int eventType, XmlPullParser xpp, Bundle owner, Bundle.BundleEntryComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2723      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("link")) {
2724        res.getLink().add(parseBundleBundleLinkComponent(xpp, owner));
2725      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fullUrl")) {
2726        res.setFullUrlElement(parseUri(xpp));
2727      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
2728        res.setResource(parseResourceContained(xpp));
2729      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("search")) {
2730        res.setSearch(parseBundleBundleEntrySearchComponent(xpp, owner));
2731      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
2732        res.setRequest(parseBundleBundleEntryRequestComponent(xpp, owner));
2733      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("response")) {
2734        res.setResponse(parseBundleBundleEntryResponseComponent(xpp, owner));
2735      } else if (!parseBackboneContent(eventType, xpp, res))
2736        return false;
2737    return true;
2738  }
2739
2740  protected Bundle.BundleEntrySearchComponent parseBundleBundleEntrySearchComponent(XmlPullParser xpp, Bundle owner) throws XmlPullParserException, IOException, FHIRFormatError {
2741    Bundle.BundleEntrySearchComponent res = new Bundle.BundleEntrySearchComponent();
2742    parseBackboneAttributes(xpp, res);
2743    next(xpp);
2744    int eventType = nextNoWhitespace(xpp);
2745    while (eventType != XmlPullParser.END_TAG) {
2746  if (!parseBundleBundleEntrySearchComponentContent(eventType, xpp, owner, res))
2747        unknownContent(xpp);
2748      eventType = nextNoWhitespace(xpp);
2749    }
2750    next(xpp);
2751    parseElementClose(res);
2752    return res;
2753  }
2754
2755  protected boolean parseBundleBundleEntrySearchComponentContent(int eventType, XmlPullParser xpp, Bundle owner, Bundle.BundleEntrySearchComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2756      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
2757        res.setModeElement(parseEnumeration(xpp, Bundle.SearchEntryMode.NULL, new Bundle.SearchEntryModeEnumFactory()));
2758      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("score")) {
2759        res.setScoreElement(parseDecimal(xpp));
2760      } else if (!parseBackboneContent(eventType, xpp, res))
2761        return false;
2762    return true;
2763  }
2764
2765  protected Bundle.BundleEntryRequestComponent parseBundleBundleEntryRequestComponent(XmlPullParser xpp, Bundle owner) throws XmlPullParserException, IOException, FHIRFormatError {
2766    Bundle.BundleEntryRequestComponent res = new Bundle.BundleEntryRequestComponent();
2767    parseBackboneAttributes(xpp, res);
2768    next(xpp);
2769    int eventType = nextNoWhitespace(xpp);
2770    while (eventType != XmlPullParser.END_TAG) {
2771  if (!parseBundleBundleEntryRequestComponentContent(eventType, xpp, owner, res))
2772        unknownContent(xpp);
2773      eventType = nextNoWhitespace(xpp);
2774    }
2775    next(xpp);
2776    parseElementClose(res);
2777    return res;
2778  }
2779
2780  protected boolean parseBundleBundleEntryRequestComponentContent(int eventType, XmlPullParser xpp, Bundle owner, Bundle.BundleEntryRequestComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2781      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("method")) {
2782        res.setMethodElement(parseEnumeration(xpp, Bundle.HTTPVerb.NULL, new Bundle.HTTPVerbEnumFactory()));
2783      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
2784        res.setUrlElement(parseUri(xpp));
2785      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ifNoneMatch")) {
2786        res.setIfNoneMatchElement(parseString(xpp));
2787      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ifModifiedSince")) {
2788        res.setIfModifiedSinceElement(parseInstant(xpp));
2789      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ifMatch")) {
2790        res.setIfMatchElement(parseString(xpp));
2791      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ifNoneExist")) {
2792        res.setIfNoneExistElement(parseString(xpp));
2793      } else if (!parseBackboneContent(eventType, xpp, res))
2794        return false;
2795    return true;
2796  }
2797
2798  protected Bundle.BundleEntryResponseComponent parseBundleBundleEntryResponseComponent(XmlPullParser xpp, Bundle owner) throws XmlPullParserException, IOException, FHIRFormatError {
2799    Bundle.BundleEntryResponseComponent res = new Bundle.BundleEntryResponseComponent();
2800    parseBackboneAttributes(xpp, res);
2801    next(xpp);
2802    int eventType = nextNoWhitespace(xpp);
2803    while (eventType != XmlPullParser.END_TAG) {
2804  if (!parseBundleBundleEntryResponseComponentContent(eventType, xpp, owner, res))
2805        unknownContent(xpp);
2806      eventType = nextNoWhitespace(xpp);
2807    }
2808    next(xpp);
2809    parseElementClose(res);
2810    return res;
2811  }
2812
2813  protected boolean parseBundleBundleEntryResponseComponentContent(int eventType, XmlPullParser xpp, Bundle owner, Bundle.BundleEntryResponseComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2814      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
2815        res.setStatusElement(parseString(xpp));
2816      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
2817        res.setLocationElement(parseUri(xpp));
2818      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("etag")) {
2819        res.setEtagElement(parseString(xpp));
2820      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastModified")) {
2821        res.setLastModifiedElement(parseInstant(xpp));
2822      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
2823        res.setOutcome(parseResourceContained(xpp));
2824      } else if (!parseBackboneContent(eventType, xpp, res))
2825        return false;
2826    return true;
2827  }
2828
2829  protected CapabilityStatement parseCapabilityStatement(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2830    CapabilityStatement res = new CapabilityStatement();
2831    parseDomainResourceAttributes(xpp, res);
2832    next(xpp);
2833    int eventType = nextNoWhitespace(xpp);
2834    while (eventType != XmlPullParser.END_TAG) {
2835  if (!parseCapabilityStatementContent(eventType, xpp, res))
2836        unknownContent(xpp);
2837      eventType = nextNoWhitespace(xpp);
2838    }
2839    next(xpp);
2840    parseElementClose(res);
2841    return res;
2842  }
2843
2844  protected boolean parseCapabilityStatementContent(int eventType, XmlPullParser xpp, CapabilityStatement res) throws XmlPullParserException, IOException, FHIRFormatError {
2845      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
2846        res.setUrlElement(parseUri(xpp));
2847      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
2848        res.setVersionElement(parseString(xpp));
2849      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
2850        res.setNameElement(parseString(xpp));
2851      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
2852        res.setTitleElement(parseString(xpp));
2853      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
2854        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
2855      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
2856        res.setExperimentalElement(parseBoolean(xpp));
2857      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
2858        res.setDateElement(parseDateTime(xpp));
2859      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
2860        res.setPublisherElement(parseString(xpp));
2861      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
2862        res.getContact().add(parseContactDetail(xpp));
2863      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2864        res.setDescriptionElement(parseMarkdown(xpp));
2865      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
2866        res.getUseContext().add(parseUsageContext(xpp));
2867      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
2868        res.getJurisdiction().add(parseCodeableConcept(xpp));
2869      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
2870        res.setPurposeElement(parseMarkdown(xpp));
2871      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
2872        res.setCopyrightElement(parseMarkdown(xpp));
2873      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("kind")) {
2874        res.setKindElement(parseEnumeration(xpp, CapabilityStatement.CapabilityStatementKind.NULL, new CapabilityStatement.CapabilityStatementKindEnumFactory()));
2875      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instantiates")) {
2876        res.getInstantiates().add(parseUri(xpp));
2877      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("software")) {
2878        res.setSoftware(parseCapabilityStatementCapabilityStatementSoftwareComponent(xpp, res));
2879      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("implementation")) {
2880        res.setImplementation(parseCapabilityStatementCapabilityStatementImplementationComponent(xpp, res));
2881      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fhirVersion")) {
2882        res.setFhirVersionElement(parseId(xpp));
2883      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("acceptUnknown")) {
2884        res.setAcceptUnknownElement(parseEnumeration(xpp, CapabilityStatement.UnknownContentCode.NULL, new CapabilityStatement.UnknownContentCodeEnumFactory()));
2885      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("format")) {
2886        res.getFormat().add(parseCode(xpp));
2887      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patchFormat")) {
2888        res.getPatchFormat().add(parseCode(xpp));
2889      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("implementationGuide")) {
2890        res.getImplementationGuide().add(parseUri(xpp));
2891      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
2892        res.getProfile().add(parseReference(xpp));
2893      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rest")) {
2894        res.getRest().add(parseCapabilityStatementCapabilityStatementRestComponent(xpp, res));
2895      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("messaging")) {
2896        res.getMessaging().add(parseCapabilityStatementCapabilityStatementMessagingComponent(xpp, res));
2897      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("document")) {
2898        res.getDocument().add(parseCapabilityStatementCapabilityStatementDocumentComponent(xpp, res));
2899      } else if (!parseDomainResourceContent(eventType, xpp, res))
2900        return false;
2901    return true;
2902  }
2903
2904  protected CapabilityStatement.CapabilityStatementSoftwareComponent parseCapabilityStatementCapabilityStatementSoftwareComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
2905    CapabilityStatement.CapabilityStatementSoftwareComponent res = new CapabilityStatement.CapabilityStatementSoftwareComponent();
2906    parseBackboneAttributes(xpp, res);
2907    next(xpp);
2908    int eventType = nextNoWhitespace(xpp);
2909    while (eventType != XmlPullParser.END_TAG) {
2910  if (!parseCapabilityStatementCapabilityStatementSoftwareComponentContent(eventType, xpp, owner, res))
2911        unknownContent(xpp);
2912      eventType = nextNoWhitespace(xpp);
2913    }
2914    next(xpp);
2915    parseElementClose(res);
2916    return res;
2917  }
2918
2919  protected boolean parseCapabilityStatementCapabilityStatementSoftwareComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementSoftwareComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2920      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
2921        res.setNameElement(parseString(xpp));
2922      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
2923        res.setVersionElement(parseString(xpp));
2924      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("releaseDate")) {
2925        res.setReleaseDateElement(parseDateTime(xpp));
2926      } else if (!parseBackboneContent(eventType, xpp, res))
2927        return false;
2928    return true;
2929  }
2930
2931  protected CapabilityStatement.CapabilityStatementImplementationComponent parseCapabilityStatementCapabilityStatementImplementationComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
2932    CapabilityStatement.CapabilityStatementImplementationComponent res = new CapabilityStatement.CapabilityStatementImplementationComponent();
2933    parseBackboneAttributes(xpp, res);
2934    next(xpp);
2935    int eventType = nextNoWhitespace(xpp);
2936    while (eventType != XmlPullParser.END_TAG) {
2937  if (!parseCapabilityStatementCapabilityStatementImplementationComponentContent(eventType, xpp, owner, res))
2938        unknownContent(xpp);
2939      eventType = nextNoWhitespace(xpp);
2940    }
2941    next(xpp);
2942    parseElementClose(res);
2943    return res;
2944  }
2945
2946  protected boolean parseCapabilityStatementCapabilityStatementImplementationComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementImplementationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2947      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2948        res.setDescriptionElement(parseString(xpp));
2949      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
2950        res.setUrlElement(parseUri(xpp));
2951      } else if (!parseBackboneContent(eventType, xpp, res))
2952        return false;
2953    return true;
2954  }
2955
2956  protected CapabilityStatement.CapabilityStatementRestComponent parseCapabilityStatementCapabilityStatementRestComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
2957    CapabilityStatement.CapabilityStatementRestComponent res = new CapabilityStatement.CapabilityStatementRestComponent();
2958    parseBackboneAttributes(xpp, res);
2959    next(xpp);
2960    int eventType = nextNoWhitespace(xpp);
2961    while (eventType != XmlPullParser.END_TAG) {
2962  if (!parseCapabilityStatementCapabilityStatementRestComponentContent(eventType, xpp, owner, res))
2963        unknownContent(xpp);
2964      eventType = nextNoWhitespace(xpp);
2965    }
2966    next(xpp);
2967    parseElementClose(res);
2968    return res;
2969  }
2970
2971  protected boolean parseCapabilityStatementCapabilityStatementRestComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementRestComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2972      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
2973        res.setModeElement(parseEnumeration(xpp, CapabilityStatement.RestfulCapabilityMode.NULL, new CapabilityStatement.RestfulCapabilityModeEnumFactory()));
2974      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
2975        res.setDocumentationElement(parseString(xpp));
2976      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("security")) {
2977        res.setSecurity(parseCapabilityStatementCapabilityStatementRestSecurityComponent(xpp, owner));
2978      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
2979        res.getResource().add(parseCapabilityStatementCapabilityStatementRestResourceComponent(xpp, owner));
2980      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("interaction")) {
2981        res.getInteraction().add(parseCapabilityStatementSystemInteractionComponent(xpp, owner));
2982      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchParam")) {
2983        res.getSearchParam().add(parseCapabilityStatementCapabilityStatementRestResourceSearchParamComponent(xpp, owner));
2984      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operation")) {
2985        res.getOperation().add(parseCapabilityStatementCapabilityStatementRestOperationComponent(xpp, owner));
2986      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("compartment")) {
2987        res.getCompartment().add(parseUri(xpp));
2988      } else if (!parseBackboneContent(eventType, xpp, res))
2989        return false;
2990    return true;
2991  }
2992
2993  protected CapabilityStatement.CapabilityStatementRestSecurityComponent parseCapabilityStatementCapabilityStatementRestSecurityComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
2994    CapabilityStatement.CapabilityStatementRestSecurityComponent res = new CapabilityStatement.CapabilityStatementRestSecurityComponent();
2995    parseBackboneAttributes(xpp, res);
2996    next(xpp);
2997    int eventType = nextNoWhitespace(xpp);
2998    while (eventType != XmlPullParser.END_TAG) {
2999  if (!parseCapabilityStatementCapabilityStatementRestSecurityComponentContent(eventType, xpp, owner, res))
3000        unknownContent(xpp);
3001      eventType = nextNoWhitespace(xpp);
3002    }
3003    next(xpp);
3004    parseElementClose(res);
3005    return res;
3006  }
3007
3008  protected boolean parseCapabilityStatementCapabilityStatementRestSecurityComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementRestSecurityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3009      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("cors")) {
3010        res.setCorsElement(parseBoolean(xpp));
3011      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
3012        res.getService().add(parseCodeableConcept(xpp));
3013      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
3014        res.setDescriptionElement(parseString(xpp));
3015      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("certificate")) {
3016        res.getCertificate().add(parseCapabilityStatementCapabilityStatementRestSecurityCertificateComponent(xpp, owner));
3017      } else if (!parseBackboneContent(eventType, xpp, res))
3018        return false;
3019    return true;
3020  }
3021
3022  protected CapabilityStatement.CapabilityStatementRestSecurityCertificateComponent parseCapabilityStatementCapabilityStatementRestSecurityCertificateComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3023    CapabilityStatement.CapabilityStatementRestSecurityCertificateComponent res = new CapabilityStatement.CapabilityStatementRestSecurityCertificateComponent();
3024    parseBackboneAttributes(xpp, res);
3025    next(xpp);
3026    int eventType = nextNoWhitespace(xpp);
3027    while (eventType != XmlPullParser.END_TAG) {
3028  if (!parseCapabilityStatementCapabilityStatementRestSecurityCertificateComponentContent(eventType, xpp, owner, res))
3029        unknownContent(xpp);
3030      eventType = nextNoWhitespace(xpp);
3031    }
3032    next(xpp);
3033    parseElementClose(res);
3034    return res;
3035  }
3036
3037  protected boolean parseCapabilityStatementCapabilityStatementRestSecurityCertificateComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementRestSecurityCertificateComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3038      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3039        res.setTypeElement(parseCode(xpp));
3040      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("blob")) {
3041        res.setBlobElement(parseBase64Binary(xpp));
3042      } else if (!parseBackboneContent(eventType, xpp, res))
3043        return false;
3044    return true;
3045  }
3046
3047  protected CapabilityStatement.CapabilityStatementRestResourceComponent parseCapabilityStatementCapabilityStatementRestResourceComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3048    CapabilityStatement.CapabilityStatementRestResourceComponent res = new CapabilityStatement.CapabilityStatementRestResourceComponent();
3049    parseBackboneAttributes(xpp, res);
3050    next(xpp);
3051    int eventType = nextNoWhitespace(xpp);
3052    while (eventType != XmlPullParser.END_TAG) {
3053  if (!parseCapabilityStatementCapabilityStatementRestResourceComponentContent(eventType, xpp, owner, res))
3054        unknownContent(xpp);
3055      eventType = nextNoWhitespace(xpp);
3056    }
3057    next(xpp);
3058    parseElementClose(res);
3059    return res;
3060  }
3061
3062  protected boolean parseCapabilityStatementCapabilityStatementRestResourceComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementRestResourceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3063      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3064        res.setTypeElement(parseCode(xpp));
3065      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
3066        res.setProfile(parseReference(xpp));
3067      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
3068        res.setDocumentationElement(parseMarkdown(xpp));
3069      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("interaction")) {
3070        res.getInteraction().add(parseCapabilityStatementResourceInteractionComponent(xpp, owner));
3071      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("versioning")) {
3072        res.setVersioningElement(parseEnumeration(xpp, CapabilityStatement.ResourceVersionPolicy.NULL, new CapabilityStatement.ResourceVersionPolicyEnumFactory()));
3073      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("readHistory")) {
3074        res.setReadHistoryElement(parseBoolean(xpp));
3075      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("updateCreate")) {
3076        res.setUpdateCreateElement(parseBoolean(xpp));
3077      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("conditionalCreate")) {
3078        res.setConditionalCreateElement(parseBoolean(xpp));
3079      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("conditionalRead")) {
3080        res.setConditionalReadElement(parseEnumeration(xpp, CapabilityStatement.ConditionalReadStatus.NULL, new CapabilityStatement.ConditionalReadStatusEnumFactory()));
3081      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("conditionalUpdate")) {
3082        res.setConditionalUpdateElement(parseBoolean(xpp));
3083      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("conditionalDelete")) {
3084        res.setConditionalDeleteElement(parseEnumeration(xpp, CapabilityStatement.ConditionalDeleteStatus.NULL, new CapabilityStatement.ConditionalDeleteStatusEnumFactory()));
3085      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referencePolicy")) {
3086        res.getReferencePolicy().add(parseEnumeration(xpp, CapabilityStatement.ReferenceHandlingPolicy.NULL, new CapabilityStatement.ReferenceHandlingPolicyEnumFactory()));
3087      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchInclude")) {
3088        res.getSearchInclude().add(parseString(xpp));
3089      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchRevInclude")) {
3090        res.getSearchRevInclude().add(parseString(xpp));
3091      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchParam")) {
3092        res.getSearchParam().add(parseCapabilityStatementCapabilityStatementRestResourceSearchParamComponent(xpp, owner));
3093      } else if (!parseBackboneContent(eventType, xpp, res))
3094        return false;
3095    return true;
3096  }
3097
3098  protected CapabilityStatement.ResourceInteractionComponent parseCapabilityStatementResourceInteractionComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3099    CapabilityStatement.ResourceInteractionComponent res = new CapabilityStatement.ResourceInteractionComponent();
3100    parseBackboneAttributes(xpp, res);
3101    next(xpp);
3102    int eventType = nextNoWhitespace(xpp);
3103    while (eventType != XmlPullParser.END_TAG) {
3104  if (!parseCapabilityStatementResourceInteractionComponentContent(eventType, xpp, owner, res))
3105        unknownContent(xpp);
3106      eventType = nextNoWhitespace(xpp);
3107    }
3108    next(xpp);
3109    parseElementClose(res);
3110    return res;
3111  }
3112
3113  protected boolean parseCapabilityStatementResourceInteractionComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.ResourceInteractionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3114      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
3115        res.setCodeElement(parseEnumeration(xpp, CapabilityStatement.TypeRestfulInteraction.NULL, new CapabilityStatement.TypeRestfulInteractionEnumFactory()));
3116      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
3117        res.setDocumentationElement(parseString(xpp));
3118      } else if (!parseBackboneContent(eventType, xpp, res))
3119        return false;
3120    return true;
3121  }
3122
3123  protected CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent parseCapabilityStatementCapabilityStatementRestResourceSearchParamComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3124    CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent res = new CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent();
3125    parseBackboneAttributes(xpp, res);
3126    next(xpp);
3127    int eventType = nextNoWhitespace(xpp);
3128    while (eventType != XmlPullParser.END_TAG) {
3129  if (!parseCapabilityStatementCapabilityStatementRestResourceSearchParamComponentContent(eventType, xpp, owner, res))
3130        unknownContent(xpp);
3131      eventType = nextNoWhitespace(xpp);
3132    }
3133    next(xpp);
3134    parseElementClose(res);
3135    return res;
3136  }
3137
3138  protected boolean parseCapabilityStatementCapabilityStatementRestResourceSearchParamComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3139      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
3140        res.setNameElement(parseString(xpp));
3141      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
3142        res.setDefinitionElement(parseUri(xpp));
3143      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3144        res.setTypeElement(parseEnumeration(xpp, Enumerations.SearchParamType.NULL, new Enumerations.SearchParamTypeEnumFactory()));
3145      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
3146        res.setDocumentationElement(parseString(xpp));
3147      } else if (!parseBackboneContent(eventType, xpp, res))
3148        return false;
3149    return true;
3150  }
3151
3152  protected CapabilityStatement.SystemInteractionComponent parseCapabilityStatementSystemInteractionComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3153    CapabilityStatement.SystemInteractionComponent res = new CapabilityStatement.SystemInteractionComponent();
3154    parseBackboneAttributes(xpp, res);
3155    next(xpp);
3156    int eventType = nextNoWhitespace(xpp);
3157    while (eventType != XmlPullParser.END_TAG) {
3158  if (!parseCapabilityStatementSystemInteractionComponentContent(eventType, xpp, owner, res))
3159        unknownContent(xpp);
3160      eventType = nextNoWhitespace(xpp);
3161    }
3162    next(xpp);
3163    parseElementClose(res);
3164    return res;
3165  }
3166
3167  protected boolean parseCapabilityStatementSystemInteractionComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.SystemInteractionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3168      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
3169        res.setCodeElement(parseEnumeration(xpp, CapabilityStatement.SystemRestfulInteraction.NULL, new CapabilityStatement.SystemRestfulInteractionEnumFactory()));
3170      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
3171        res.setDocumentationElement(parseString(xpp));
3172      } else if (!parseBackboneContent(eventType, xpp, res))
3173        return false;
3174    return true;
3175  }
3176
3177  protected CapabilityStatement.CapabilityStatementRestOperationComponent parseCapabilityStatementCapabilityStatementRestOperationComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3178    CapabilityStatement.CapabilityStatementRestOperationComponent res = new CapabilityStatement.CapabilityStatementRestOperationComponent();
3179    parseBackboneAttributes(xpp, res);
3180    next(xpp);
3181    int eventType = nextNoWhitespace(xpp);
3182    while (eventType != XmlPullParser.END_TAG) {
3183  if (!parseCapabilityStatementCapabilityStatementRestOperationComponentContent(eventType, xpp, owner, res))
3184        unknownContent(xpp);
3185      eventType = nextNoWhitespace(xpp);
3186    }
3187    next(xpp);
3188    parseElementClose(res);
3189    return res;
3190  }
3191
3192  protected boolean parseCapabilityStatementCapabilityStatementRestOperationComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementRestOperationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3193      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
3194        res.setNameElement(parseString(xpp));
3195      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
3196        res.setDefinition(parseReference(xpp));
3197      } else if (!parseBackboneContent(eventType, xpp, res))
3198        return false;
3199    return true;
3200  }
3201
3202  protected CapabilityStatement.CapabilityStatementMessagingComponent parseCapabilityStatementCapabilityStatementMessagingComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3203    CapabilityStatement.CapabilityStatementMessagingComponent res = new CapabilityStatement.CapabilityStatementMessagingComponent();
3204    parseBackboneAttributes(xpp, res);
3205    next(xpp);
3206    int eventType = nextNoWhitespace(xpp);
3207    while (eventType != XmlPullParser.END_TAG) {
3208  if (!parseCapabilityStatementCapabilityStatementMessagingComponentContent(eventType, xpp, owner, res))
3209        unknownContent(xpp);
3210      eventType = nextNoWhitespace(xpp);
3211    }
3212    next(xpp);
3213    parseElementClose(res);
3214    return res;
3215  }
3216
3217  protected boolean parseCapabilityStatementCapabilityStatementMessagingComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementMessagingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3218      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("endpoint")) {
3219        res.getEndpoint().add(parseCapabilityStatementCapabilityStatementMessagingEndpointComponent(xpp, owner));
3220      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reliableCache")) {
3221        res.setReliableCacheElement(parseUnsignedInt(xpp));
3222      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
3223        res.setDocumentationElement(parseString(xpp));
3224      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportedMessage")) {
3225        res.getSupportedMessage().add(parseCapabilityStatementCapabilityStatementMessagingSupportedMessageComponent(xpp, owner));
3226      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("event")) {
3227        res.getEvent().add(parseCapabilityStatementCapabilityStatementMessagingEventComponent(xpp, owner));
3228      } else if (!parseBackboneContent(eventType, xpp, res))
3229        return false;
3230    return true;
3231  }
3232
3233  protected CapabilityStatement.CapabilityStatementMessagingEndpointComponent parseCapabilityStatementCapabilityStatementMessagingEndpointComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3234    CapabilityStatement.CapabilityStatementMessagingEndpointComponent res = new CapabilityStatement.CapabilityStatementMessagingEndpointComponent();
3235    parseBackboneAttributes(xpp, res);
3236    next(xpp);
3237    int eventType = nextNoWhitespace(xpp);
3238    while (eventType != XmlPullParser.END_TAG) {
3239  if (!parseCapabilityStatementCapabilityStatementMessagingEndpointComponentContent(eventType, xpp, owner, res))
3240        unknownContent(xpp);
3241      eventType = nextNoWhitespace(xpp);
3242    }
3243    next(xpp);
3244    parseElementClose(res);
3245    return res;
3246  }
3247
3248  protected boolean parseCapabilityStatementCapabilityStatementMessagingEndpointComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementMessagingEndpointComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3249      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("protocol")) {
3250        res.setProtocol(parseCoding(xpp));
3251      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("address")) {
3252        res.setAddressElement(parseUri(xpp));
3253      } else if (!parseBackboneContent(eventType, xpp, res))
3254        return false;
3255    return true;
3256  }
3257
3258  protected CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent parseCapabilityStatementCapabilityStatementMessagingSupportedMessageComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3259    CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent res = new CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent();
3260    parseBackboneAttributes(xpp, res);
3261    next(xpp);
3262    int eventType = nextNoWhitespace(xpp);
3263    while (eventType != XmlPullParser.END_TAG) {
3264  if (!parseCapabilityStatementCapabilityStatementMessagingSupportedMessageComponentContent(eventType, xpp, owner, res))
3265        unknownContent(xpp);
3266      eventType = nextNoWhitespace(xpp);
3267    }
3268    next(xpp);
3269    parseElementClose(res);
3270    return res;
3271  }
3272
3273  protected boolean parseCapabilityStatementCapabilityStatementMessagingSupportedMessageComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3274      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
3275        res.setModeElement(parseEnumeration(xpp, CapabilityStatement.EventCapabilityMode.NULL, new CapabilityStatement.EventCapabilityModeEnumFactory()));
3276      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
3277        res.setDefinition(parseReference(xpp));
3278      } else if (!parseBackboneContent(eventType, xpp, res))
3279        return false;
3280    return true;
3281  }
3282
3283  protected CapabilityStatement.CapabilityStatementMessagingEventComponent parseCapabilityStatementCapabilityStatementMessagingEventComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3284    CapabilityStatement.CapabilityStatementMessagingEventComponent res = new CapabilityStatement.CapabilityStatementMessagingEventComponent();
3285    parseBackboneAttributes(xpp, res);
3286    next(xpp);
3287    int eventType = nextNoWhitespace(xpp);
3288    while (eventType != XmlPullParser.END_TAG) {
3289  if (!parseCapabilityStatementCapabilityStatementMessagingEventComponentContent(eventType, xpp, owner, res))
3290        unknownContent(xpp);
3291      eventType = nextNoWhitespace(xpp);
3292    }
3293    next(xpp);
3294    parseElementClose(res);
3295    return res;
3296  }
3297
3298  protected boolean parseCapabilityStatementCapabilityStatementMessagingEventComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementMessagingEventComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3299      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
3300        res.setCode(parseCoding(xpp));
3301      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
3302        res.setCategoryElement(parseEnumeration(xpp, CapabilityStatement.MessageSignificanceCategory.NULL, new CapabilityStatement.MessageSignificanceCategoryEnumFactory()));
3303      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
3304        res.setModeElement(parseEnumeration(xpp, CapabilityStatement.EventCapabilityMode.NULL, new CapabilityStatement.EventCapabilityModeEnumFactory()));
3305      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("focus")) {
3306        res.setFocusElement(parseCode(xpp));
3307      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
3308        res.setRequest(parseReference(xpp));
3309      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("response")) {
3310        res.setResponse(parseReference(xpp));
3311      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
3312        res.setDocumentationElement(parseString(xpp));
3313      } else if (!parseBackboneContent(eventType, xpp, res))
3314        return false;
3315    return true;
3316  }
3317
3318  protected CapabilityStatement.CapabilityStatementDocumentComponent parseCapabilityStatementCapabilityStatementDocumentComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3319    CapabilityStatement.CapabilityStatementDocumentComponent res = new CapabilityStatement.CapabilityStatementDocumentComponent();
3320    parseBackboneAttributes(xpp, res);
3321    next(xpp);
3322    int eventType = nextNoWhitespace(xpp);
3323    while (eventType != XmlPullParser.END_TAG) {
3324  if (!parseCapabilityStatementCapabilityStatementDocumentComponentContent(eventType, xpp, owner, res))
3325        unknownContent(xpp);
3326      eventType = nextNoWhitespace(xpp);
3327    }
3328    next(xpp);
3329    parseElementClose(res);
3330    return res;
3331  }
3332
3333  protected boolean parseCapabilityStatementCapabilityStatementDocumentComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementDocumentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3334      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
3335        res.setModeElement(parseEnumeration(xpp, CapabilityStatement.DocumentMode.NULL, new CapabilityStatement.DocumentModeEnumFactory()));
3336      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
3337        res.setDocumentationElement(parseString(xpp));
3338      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
3339        res.setProfile(parseReference(xpp));
3340      } else if (!parseBackboneContent(eventType, xpp, res))
3341        return false;
3342    return true;
3343  }
3344
3345  protected CarePlan parseCarePlan(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3346    CarePlan res = new CarePlan();
3347    parseDomainResourceAttributes(xpp, res);
3348    next(xpp);
3349    int eventType = nextNoWhitespace(xpp);
3350    while (eventType != XmlPullParser.END_TAG) {
3351  if (!parseCarePlanContent(eventType, xpp, res))
3352        unknownContent(xpp);
3353      eventType = nextNoWhitespace(xpp);
3354    }
3355    next(xpp);
3356    parseElementClose(res);
3357    return res;
3358  }
3359
3360  protected boolean parseCarePlanContent(int eventType, XmlPullParser xpp, CarePlan res) throws XmlPullParserException, IOException, FHIRFormatError {
3361      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
3362        res.getIdentifier().add(parseIdentifier(xpp));
3363      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
3364        res.getDefinition().add(parseReference(xpp));
3365      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
3366        res.getBasedOn().add(parseReference(xpp));
3367      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("replaces")) {
3368        res.getReplaces().add(parseReference(xpp));
3369      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
3370        res.getPartOf().add(parseReference(xpp));
3371      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
3372        res.setStatusElement(parseEnumeration(xpp, CarePlan.CarePlanStatus.NULL, new CarePlan.CarePlanStatusEnumFactory()));
3373      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("intent")) {
3374        res.setIntentElement(parseEnumeration(xpp, CarePlan.CarePlanIntent.NULL, new CarePlan.CarePlanIntentEnumFactory()));
3375      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
3376        res.getCategory().add(parseCodeableConcept(xpp));
3377      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
3378        res.setTitleElement(parseString(xpp));
3379      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
3380        res.setDescriptionElement(parseString(xpp));
3381      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
3382        res.setSubject(parseReference(xpp));
3383      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
3384        res.setContext(parseReference(xpp));
3385      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
3386        res.setPeriod(parsePeriod(xpp));
3387      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
3388        res.getAuthor().add(parseReference(xpp));
3389      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("careTeam")) {
3390        res.getCareTeam().add(parseReference(xpp));
3391      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("addresses")) {
3392        res.getAddresses().add(parseReference(xpp));
3393      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInfo")) {
3394        res.getSupportingInfo().add(parseReference(xpp));
3395      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("goal")) {
3396        res.getGoal().add(parseReference(xpp));
3397      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("activity")) {
3398        res.getActivity().add(parseCarePlanCarePlanActivityComponent(xpp, res));
3399      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
3400        res.getNote().add(parseAnnotation(xpp));
3401      } else if (!parseDomainResourceContent(eventType, xpp, res))
3402        return false;
3403    return true;
3404  }
3405
3406  protected CarePlan.CarePlanActivityComponent parseCarePlanCarePlanActivityComponent(XmlPullParser xpp, CarePlan owner) throws XmlPullParserException, IOException, FHIRFormatError {
3407    CarePlan.CarePlanActivityComponent res = new CarePlan.CarePlanActivityComponent();
3408    parseBackboneAttributes(xpp, res);
3409    next(xpp);
3410    int eventType = nextNoWhitespace(xpp);
3411    while (eventType != XmlPullParser.END_TAG) {
3412  if (!parseCarePlanCarePlanActivityComponentContent(eventType, xpp, owner, res))
3413        unknownContent(xpp);
3414      eventType = nextNoWhitespace(xpp);
3415    }
3416    next(xpp);
3417    parseElementClose(res);
3418    return res;
3419  }
3420
3421  protected boolean parseCarePlanCarePlanActivityComponentContent(int eventType, XmlPullParser xpp, CarePlan owner, CarePlan.CarePlanActivityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3422      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcomeCodeableConcept")) {
3423        res.getOutcomeCodeableConcept().add(parseCodeableConcept(xpp));
3424      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcomeReference")) {
3425        res.getOutcomeReference().add(parseReference(xpp));
3426      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("progress")) {
3427        res.getProgress().add(parseAnnotation(xpp));
3428      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
3429        res.setReference(parseReference(xpp));
3430      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
3431        res.setDetail(parseCarePlanCarePlanActivityDetailComponent(xpp, owner));
3432      } else if (!parseBackboneContent(eventType, xpp, res))
3433        return false;
3434    return true;
3435  }
3436
3437  protected CarePlan.CarePlanActivityDetailComponent parseCarePlanCarePlanActivityDetailComponent(XmlPullParser xpp, CarePlan owner) throws XmlPullParserException, IOException, FHIRFormatError {
3438    CarePlan.CarePlanActivityDetailComponent res = new CarePlan.CarePlanActivityDetailComponent();
3439    parseBackboneAttributes(xpp, res);
3440    next(xpp);
3441    int eventType = nextNoWhitespace(xpp);
3442    while (eventType != XmlPullParser.END_TAG) {
3443  if (!parseCarePlanCarePlanActivityDetailComponentContent(eventType, xpp, owner, res))
3444        unknownContent(xpp);
3445      eventType = nextNoWhitespace(xpp);
3446    }
3447    next(xpp);
3448    parseElementClose(res);
3449    return res;
3450  }
3451
3452  protected boolean parseCarePlanCarePlanActivityDetailComponentContent(int eventType, XmlPullParser xpp, CarePlan owner, CarePlan.CarePlanActivityDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3453      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
3454        res.setCategory(parseCodeableConcept(xpp));
3455      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
3456        res.setDefinition(parseReference(xpp));
3457      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
3458        res.setCode(parseCodeableConcept(xpp));
3459      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonCode")) {
3460        res.getReasonCode().add(parseCodeableConcept(xpp));
3461      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonReference")) {
3462        res.getReasonReference().add(parseReference(xpp));
3463      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("goal")) {
3464        res.getGoal().add(parseReference(xpp));
3465      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
3466        res.setStatusElement(parseEnumeration(xpp, CarePlan.CarePlanActivityStatus.NULL, new CarePlan.CarePlanActivityStatusEnumFactory()));
3467      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("statusReason")) {
3468        res.setStatusReasonElement(parseString(xpp));
3469      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prohibited")) {
3470        res.setProhibitedElement(parseBoolean(xpp));
3471      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "scheduled")) {
3472        res.setScheduled(parseType("scheduled", xpp));
3473      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
3474        res.setLocation(parseReference(xpp));
3475      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performer")) {
3476        res.getPerformer().add(parseReference(xpp));
3477      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "product")) {
3478        res.setProduct(parseType("product", xpp));
3479      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dailyAmount")) {
3480        res.setDailyAmount(parseSimpleQuantity(xpp));
3481      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
3482        res.setQuantity(parseSimpleQuantity(xpp));
3483      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
3484        res.setDescriptionElement(parseString(xpp));
3485      } else if (!parseBackboneContent(eventType, xpp, res))
3486        return false;
3487    return true;
3488  }
3489
3490  protected CareTeam parseCareTeam(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3491    CareTeam res = new CareTeam();
3492    parseDomainResourceAttributes(xpp, res);
3493    next(xpp);
3494    int eventType = nextNoWhitespace(xpp);
3495    while (eventType != XmlPullParser.END_TAG) {
3496  if (!parseCareTeamContent(eventType, xpp, res))
3497        unknownContent(xpp);
3498      eventType = nextNoWhitespace(xpp);
3499    }
3500    next(xpp);
3501    parseElementClose(res);
3502    return res;
3503  }
3504
3505  protected boolean parseCareTeamContent(int eventType, XmlPullParser xpp, CareTeam res) throws XmlPullParserException, IOException, FHIRFormatError {
3506      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
3507        res.getIdentifier().add(parseIdentifier(xpp));
3508      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
3509        res.setStatusElement(parseEnumeration(xpp, CareTeam.CareTeamStatus.NULL, new CareTeam.CareTeamStatusEnumFactory()));
3510      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
3511        res.getCategory().add(parseCodeableConcept(xpp));
3512      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
3513        res.setNameElement(parseString(xpp));
3514      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
3515        res.setSubject(parseReference(xpp));
3516      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
3517        res.setContext(parseReference(xpp));
3518      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
3519        res.setPeriod(parsePeriod(xpp));
3520      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
3521        res.getParticipant().add(parseCareTeamCareTeamParticipantComponent(xpp, res));
3522      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonCode")) {
3523        res.getReasonCode().add(parseCodeableConcept(xpp));
3524      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonReference")) {
3525        res.getReasonReference().add(parseReference(xpp));
3526      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("managingOrganization")) {
3527        res.getManagingOrganization().add(parseReference(xpp));
3528      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
3529        res.getNote().add(parseAnnotation(xpp));
3530      } else if (!parseDomainResourceContent(eventType, xpp, res))
3531        return false;
3532    return true;
3533  }
3534
3535  protected CareTeam.CareTeamParticipantComponent parseCareTeamCareTeamParticipantComponent(XmlPullParser xpp, CareTeam owner) throws XmlPullParserException, IOException, FHIRFormatError {
3536    CareTeam.CareTeamParticipantComponent res = new CareTeam.CareTeamParticipantComponent();
3537    parseBackboneAttributes(xpp, res);
3538    next(xpp);
3539    int eventType = nextNoWhitespace(xpp);
3540    while (eventType != XmlPullParser.END_TAG) {
3541  if (!parseCareTeamCareTeamParticipantComponentContent(eventType, xpp, owner, res))
3542        unknownContent(xpp);
3543      eventType = nextNoWhitespace(xpp);
3544    }
3545    next(xpp);
3546    parseElementClose(res);
3547    return res;
3548  }
3549
3550  protected boolean parseCareTeamCareTeamParticipantComponentContent(int eventType, XmlPullParser xpp, CareTeam owner, CareTeam.CareTeamParticipantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3551      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
3552        res.setRole(parseCodeableConcept(xpp));
3553      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("member")) {
3554        res.setMember(parseReference(xpp));
3555      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onBehalfOf")) {
3556        res.setOnBehalfOf(parseReference(xpp));
3557      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
3558        res.setPeriod(parsePeriod(xpp));
3559      } else if (!parseBackboneContent(eventType, xpp, res))
3560        return false;
3561    return true;
3562  }
3563
3564  protected ChargeItem parseChargeItem(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3565    ChargeItem res = new ChargeItem();
3566    parseDomainResourceAttributes(xpp, res);
3567    next(xpp);
3568    int eventType = nextNoWhitespace(xpp);
3569    while (eventType != XmlPullParser.END_TAG) {
3570  if (!parseChargeItemContent(eventType, xpp, res))
3571        unknownContent(xpp);
3572      eventType = nextNoWhitespace(xpp);
3573    }
3574    next(xpp);
3575    parseElementClose(res);
3576    return res;
3577  }
3578
3579  protected boolean parseChargeItemContent(int eventType, XmlPullParser xpp, ChargeItem res) throws XmlPullParserException, IOException, FHIRFormatError {
3580      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
3581        res.setIdentifier(parseIdentifier(xpp));
3582      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
3583        res.getDefinition().add(parseUri(xpp));
3584      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
3585        res.setStatusElement(parseEnumeration(xpp, ChargeItem.ChargeItemStatus.NULL, new ChargeItem.ChargeItemStatusEnumFactory()));
3586      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
3587        res.getPartOf().add(parseReference(xpp));
3588      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
3589        res.setCode(parseCodeableConcept(xpp));
3590      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
3591        res.setSubject(parseReference(xpp));
3592      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
3593        res.setContext(parseReference(xpp));
3594      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "occurrence")) {
3595        res.setOccurrence(parseType("occurrence", xpp));
3596      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
3597        res.getParticipant().add(parseChargeItemChargeItemParticipantComponent(xpp, res));
3598      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performingOrganization")) {
3599        res.setPerformingOrganization(parseReference(xpp));
3600      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestingOrganization")) {
3601        res.setRequestingOrganization(parseReference(xpp));
3602      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
3603        res.setQuantity(parseQuantity(xpp));
3604      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodysite")) {
3605        res.getBodysite().add(parseCodeableConcept(xpp));
3606      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factorOverride")) {
3607        res.setFactorOverrideElement(parseDecimal(xpp));
3608      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priceOverride")) {
3609        res.setPriceOverride(parseMoney(xpp));
3610      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("overrideReason")) {
3611        res.setOverrideReasonElement(parseString(xpp));
3612      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("enterer")) {
3613        res.setEnterer(parseReference(xpp));
3614      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("enteredDate")) {
3615        res.setEnteredDateElement(parseDateTime(xpp));
3616      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
3617        res.getReason().add(parseCodeableConcept(xpp));
3618      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
3619        res.getService().add(parseReference(xpp));
3620      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("account")) {
3621        res.getAccount().add(parseReference(xpp));
3622      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
3623        res.getNote().add(parseAnnotation(xpp));
3624      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInformation")) {
3625        res.getSupportingInformation().add(parseReference(xpp));
3626      } else if (!parseDomainResourceContent(eventType, xpp, res))
3627        return false;
3628    return true;
3629  }
3630
3631  protected ChargeItem.ChargeItemParticipantComponent parseChargeItemChargeItemParticipantComponent(XmlPullParser xpp, ChargeItem owner) throws XmlPullParserException, IOException, FHIRFormatError {
3632    ChargeItem.ChargeItemParticipantComponent res = new ChargeItem.ChargeItemParticipantComponent();
3633    parseBackboneAttributes(xpp, res);
3634    next(xpp);
3635    int eventType = nextNoWhitespace(xpp);
3636    while (eventType != XmlPullParser.END_TAG) {
3637  if (!parseChargeItemChargeItemParticipantComponentContent(eventType, xpp, owner, res))
3638        unknownContent(xpp);
3639      eventType = nextNoWhitespace(xpp);
3640    }
3641    next(xpp);
3642    parseElementClose(res);
3643    return res;
3644  }
3645
3646  protected boolean parseChargeItemChargeItemParticipantComponentContent(int eventType, XmlPullParser xpp, ChargeItem owner, ChargeItem.ChargeItemParticipantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3647      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
3648        res.setRole(parseCodeableConcept(xpp));
3649      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
3650        res.setActor(parseReference(xpp));
3651      } else if (!parseBackboneContent(eventType, xpp, res))
3652        return false;
3653    return true;
3654  }
3655
3656  protected Claim parseClaim(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3657    Claim res = new Claim();
3658    parseDomainResourceAttributes(xpp, res);
3659    next(xpp);
3660    int eventType = nextNoWhitespace(xpp);
3661    while (eventType != XmlPullParser.END_TAG) {
3662  if (!parseClaimContent(eventType, xpp, res))
3663        unknownContent(xpp);
3664      eventType = nextNoWhitespace(xpp);
3665    }
3666    next(xpp);
3667    parseElementClose(res);
3668    return res;
3669  }
3670
3671  protected boolean parseClaimContent(int eventType, XmlPullParser xpp, Claim res) throws XmlPullParserException, IOException, FHIRFormatError {
3672      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
3673        res.getIdentifier().add(parseIdentifier(xpp));
3674      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
3675        res.setStatusElement(parseEnumeration(xpp, Claim.ClaimStatus.NULL, new Claim.ClaimStatusEnumFactory()));
3676      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3677        res.setType(parseCodeableConcept(xpp));
3678      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subType")) {
3679        res.getSubType().add(parseCodeableConcept(xpp));
3680      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
3681        res.setUseElement(parseEnumeration(xpp, Claim.Use.NULL, new Claim.UseEnumFactory()));
3682      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
3683        res.setPatient(parseReference(xpp));
3684      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("billablePeriod")) {
3685        res.setBillablePeriod(parsePeriod(xpp));
3686      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
3687        res.setCreatedElement(parseDateTime(xpp));
3688      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("enterer")) {
3689        res.setEnterer(parseReference(xpp));
3690      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurer")) {
3691        res.setInsurer(parseReference(xpp));
3692      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("provider")) {
3693        res.setProvider(parseReference(xpp));
3694      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("organization")) {
3695        res.setOrganization(parseReference(xpp));
3696      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
3697        res.setPriority(parseCodeableConcept(xpp));
3698      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fundsReserve")) {
3699        res.setFundsReserve(parseCodeableConcept(xpp));
3700      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("related")) {
3701        res.getRelated().add(parseClaimRelatedClaimComponent(xpp, res));
3702      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prescription")) {
3703        res.setPrescription(parseReference(xpp));
3704      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("originalPrescription")) {
3705        res.setOriginalPrescription(parseReference(xpp));
3706      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payee")) {
3707        res.setPayee(parseClaimPayeeComponent(xpp, res));
3708      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referral")) {
3709        res.setReferral(parseReference(xpp));
3710      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("facility")) {
3711        res.setFacility(parseReference(xpp));
3712      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("careTeam")) {
3713        res.getCareTeam().add(parseClaimCareTeamComponent(xpp, res));
3714      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("information")) {
3715        res.getInformation().add(parseClaimSpecialConditionComponent(xpp, res));
3716      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diagnosis")) {
3717        res.getDiagnosis().add(parseClaimDiagnosisComponent(xpp, res));
3718      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("procedure")) {
3719        res.getProcedure().add(parseClaimProcedureComponent(xpp, res));
3720      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurance")) {
3721        res.getInsurance().add(parseClaimInsuranceComponent(xpp, res));
3722      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("accident")) {
3723        res.setAccident(parseClaimAccidentComponent(xpp, res));
3724      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("employmentImpacted")) {
3725        res.setEmploymentImpacted(parsePeriod(xpp));
3726      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("hospitalization")) {
3727        res.setHospitalization(parsePeriod(xpp));
3728      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("item")) {
3729        res.getItem().add(parseClaimItemComponent(xpp, res));
3730      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("total")) {
3731        res.setTotal(parseMoney(xpp));
3732      } else if (!parseDomainResourceContent(eventType, xpp, res))
3733        return false;
3734    return true;
3735  }
3736
3737  protected Claim.RelatedClaimComponent parseClaimRelatedClaimComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3738    Claim.RelatedClaimComponent res = new Claim.RelatedClaimComponent();
3739    parseBackboneAttributes(xpp, res);
3740    next(xpp);
3741    int eventType = nextNoWhitespace(xpp);
3742    while (eventType != XmlPullParser.END_TAG) {
3743  if (!parseClaimRelatedClaimComponentContent(eventType, xpp, owner, res))
3744        unknownContent(xpp);
3745      eventType = nextNoWhitespace(xpp);
3746    }
3747    next(xpp);
3748    parseElementClose(res);
3749    return res;
3750  }
3751
3752  protected boolean parseClaimRelatedClaimComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.RelatedClaimComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3753      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("claim")) {
3754        res.setClaim(parseReference(xpp));
3755      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relationship")) {
3756        res.setRelationship(parseCodeableConcept(xpp));
3757      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
3758        res.setReference(parseIdentifier(xpp));
3759      } else if (!parseBackboneContent(eventType, xpp, res))
3760        return false;
3761    return true;
3762  }
3763
3764  protected Claim.PayeeComponent parseClaimPayeeComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3765    Claim.PayeeComponent res = new Claim.PayeeComponent();
3766    parseBackboneAttributes(xpp, res);
3767    next(xpp);
3768    int eventType = nextNoWhitespace(xpp);
3769    while (eventType != XmlPullParser.END_TAG) {
3770  if (!parseClaimPayeeComponentContent(eventType, xpp, owner, res))
3771        unknownContent(xpp);
3772      eventType = nextNoWhitespace(xpp);
3773    }
3774    next(xpp);
3775    parseElementClose(res);
3776    return res;
3777  }
3778
3779  protected boolean parseClaimPayeeComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.PayeeComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3780      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3781        res.setType(parseCodeableConcept(xpp));
3782      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resourceType")) {
3783        res.setResourceType(parseCoding(xpp));
3784      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("party")) {
3785        res.setParty(parseReference(xpp));
3786      } else if (!parseBackboneContent(eventType, xpp, res))
3787        return false;
3788    return true;
3789  }
3790
3791  protected Claim.CareTeamComponent parseClaimCareTeamComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3792    Claim.CareTeamComponent res = new Claim.CareTeamComponent();
3793    parseBackboneAttributes(xpp, res);
3794    next(xpp);
3795    int eventType = nextNoWhitespace(xpp);
3796    while (eventType != XmlPullParser.END_TAG) {
3797  if (!parseClaimCareTeamComponentContent(eventType, xpp, owner, res))
3798        unknownContent(xpp);
3799      eventType = nextNoWhitespace(xpp);
3800    }
3801    next(xpp);
3802    parseElementClose(res);
3803    return res;
3804  }
3805
3806  protected boolean parseClaimCareTeamComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.CareTeamComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3807      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
3808        res.setSequenceElement(parsePositiveInt(xpp));
3809      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("provider")) {
3810        res.setProvider(parseReference(xpp));
3811      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("responsible")) {
3812        res.setResponsibleElement(parseBoolean(xpp));
3813      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
3814        res.setRole(parseCodeableConcept(xpp));
3815      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("qualification")) {
3816        res.setQualification(parseCodeableConcept(xpp));
3817      } else if (!parseBackboneContent(eventType, xpp, res))
3818        return false;
3819    return true;
3820  }
3821
3822  protected Claim.SpecialConditionComponent parseClaimSpecialConditionComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3823    Claim.SpecialConditionComponent res = new Claim.SpecialConditionComponent();
3824    parseBackboneAttributes(xpp, res);
3825    next(xpp);
3826    int eventType = nextNoWhitespace(xpp);
3827    while (eventType != XmlPullParser.END_TAG) {
3828  if (!parseClaimSpecialConditionComponentContent(eventType, xpp, owner, res))
3829        unknownContent(xpp);
3830      eventType = nextNoWhitespace(xpp);
3831    }
3832    next(xpp);
3833    parseElementClose(res);
3834    return res;
3835  }
3836
3837  protected boolean parseClaimSpecialConditionComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.SpecialConditionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3838      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
3839        res.setSequenceElement(parsePositiveInt(xpp));
3840      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
3841        res.setCategory(parseCodeableConcept(xpp));
3842      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
3843        res.setCode(parseCodeableConcept(xpp));
3844      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "timing")) {
3845        res.setTiming(parseType("timing", xpp));
3846      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
3847        res.setValue(parseType("value", xpp));
3848      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
3849        res.setReason(parseCodeableConcept(xpp));
3850      } else if (!parseBackboneContent(eventType, xpp, res))
3851        return false;
3852    return true;
3853  }
3854
3855  protected Claim.DiagnosisComponent parseClaimDiagnosisComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3856    Claim.DiagnosisComponent res = new Claim.DiagnosisComponent();
3857    parseBackboneAttributes(xpp, res);
3858    next(xpp);
3859    int eventType = nextNoWhitespace(xpp);
3860    while (eventType != XmlPullParser.END_TAG) {
3861  if (!parseClaimDiagnosisComponentContent(eventType, xpp, owner, res))
3862        unknownContent(xpp);
3863      eventType = nextNoWhitespace(xpp);
3864    }
3865    next(xpp);
3866    parseElementClose(res);
3867    return res;
3868  }
3869
3870  protected boolean parseClaimDiagnosisComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.DiagnosisComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3871      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
3872        res.setSequenceElement(parsePositiveInt(xpp));
3873      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "diagnosis")) {
3874        res.setDiagnosis(parseType("diagnosis", xpp));
3875      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3876        res.getType().add(parseCodeableConcept(xpp));
3877      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("packageCode")) {
3878        res.setPackageCode(parseCodeableConcept(xpp));
3879      } else if (!parseBackboneContent(eventType, xpp, res))
3880        return false;
3881    return true;
3882  }
3883
3884  protected Claim.ProcedureComponent parseClaimProcedureComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3885    Claim.ProcedureComponent res = new Claim.ProcedureComponent();
3886    parseBackboneAttributes(xpp, res);
3887    next(xpp);
3888    int eventType = nextNoWhitespace(xpp);
3889    while (eventType != XmlPullParser.END_TAG) {
3890  if (!parseClaimProcedureComponentContent(eventType, xpp, owner, res))
3891        unknownContent(xpp);
3892      eventType = nextNoWhitespace(xpp);
3893    }
3894    next(xpp);
3895    parseElementClose(res);
3896    return res;
3897  }
3898
3899  protected boolean parseClaimProcedureComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.ProcedureComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3900      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
3901        res.setSequenceElement(parsePositiveInt(xpp));
3902      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
3903        res.setDateElement(parseDateTime(xpp));
3904      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "procedure")) {
3905        res.setProcedure(parseType("procedure", xpp));
3906      } else if (!parseBackboneContent(eventType, xpp, res))
3907        return false;
3908    return true;
3909  }
3910
3911  protected Claim.InsuranceComponent parseClaimInsuranceComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3912    Claim.InsuranceComponent res = new Claim.InsuranceComponent();
3913    parseBackboneAttributes(xpp, res);
3914    next(xpp);
3915    int eventType = nextNoWhitespace(xpp);
3916    while (eventType != XmlPullParser.END_TAG) {
3917  if (!parseClaimInsuranceComponentContent(eventType, xpp, owner, res))
3918        unknownContent(xpp);
3919      eventType = nextNoWhitespace(xpp);
3920    }
3921    next(xpp);
3922    parseElementClose(res);
3923    return res;
3924  }
3925
3926  protected boolean parseClaimInsuranceComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.InsuranceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3927      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
3928        res.setSequenceElement(parsePositiveInt(xpp));
3929      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("focal")) {
3930        res.setFocalElement(parseBoolean(xpp));
3931      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
3932        res.setCoverage(parseReference(xpp));
3933      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("businessArrangement")) {
3934        res.setBusinessArrangementElement(parseString(xpp));
3935      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("preAuthRef")) {
3936        res.getPreAuthRef().add(parseString(xpp));
3937      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("claimResponse")) {
3938        res.setClaimResponse(parseReference(xpp));
3939      } else if (!parseBackboneContent(eventType, xpp, res))
3940        return false;
3941    return true;
3942  }
3943
3944  protected Claim.AccidentComponent parseClaimAccidentComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3945    Claim.AccidentComponent res = new Claim.AccidentComponent();
3946    parseBackboneAttributes(xpp, res);
3947    next(xpp);
3948    int eventType = nextNoWhitespace(xpp);
3949    while (eventType != XmlPullParser.END_TAG) {
3950  if (!parseClaimAccidentComponentContent(eventType, xpp, owner, res))
3951        unknownContent(xpp);
3952      eventType = nextNoWhitespace(xpp);
3953    }
3954    next(xpp);
3955    parseElementClose(res);
3956    return res;
3957  }
3958
3959  protected boolean parseClaimAccidentComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.AccidentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3960      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
3961        res.setDateElement(parseDate(xpp));
3962      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3963        res.setType(parseCodeableConcept(xpp));
3964      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "location")) {
3965        res.setLocation(parseType("location", xpp));
3966      } else if (!parseBackboneContent(eventType, xpp, res))
3967        return false;
3968    return true;
3969  }
3970
3971  protected Claim.ItemComponent parseClaimItemComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3972    Claim.ItemComponent res = new Claim.ItemComponent();
3973    parseBackboneAttributes(xpp, res);
3974    next(xpp);
3975    int eventType = nextNoWhitespace(xpp);
3976    while (eventType != XmlPullParser.END_TAG) {
3977  if (!parseClaimItemComponentContent(eventType, xpp, owner, res))
3978        unknownContent(xpp);
3979      eventType = nextNoWhitespace(xpp);
3980    }
3981    next(xpp);
3982    parseElementClose(res);
3983    return res;
3984  }
3985
3986  protected boolean parseClaimItemComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.ItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3987      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
3988        res.setSequenceElement(parsePositiveInt(xpp));
3989      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("careTeamLinkId")) {
3990        res.getCareTeamLinkId().add(parsePositiveInt(xpp));
3991      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diagnosisLinkId")) {
3992        res.getDiagnosisLinkId().add(parsePositiveInt(xpp));
3993      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("procedureLinkId")) {
3994        res.getProcedureLinkId().add(parsePositiveInt(xpp));
3995      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("informationLinkId")) {
3996        res.getInformationLinkId().add(parsePositiveInt(xpp));
3997      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
3998        res.setRevenue(parseCodeableConcept(xpp));
3999      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
4000        res.setCategory(parseCodeableConcept(xpp));
4001      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
4002        res.setService(parseCodeableConcept(xpp));
4003      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
4004        res.getModifier().add(parseCodeableConcept(xpp));
4005      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("programCode")) {
4006        res.getProgramCode().add(parseCodeableConcept(xpp));
4007      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "serviced")) {
4008        res.setServiced(parseType("serviced", xpp));
4009      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "location")) {
4010        res.setLocation(parseType("location", xpp));
4011      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
4012        res.setQuantity(parseSimpleQuantity(xpp));
4013      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
4014        res.setUnitPrice(parseMoney(xpp));
4015      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
4016        res.setFactorElement(parseDecimal(xpp));
4017      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
4018        res.setNet(parseMoney(xpp));
4019      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("udi")) {
4020        res.getUdi().add(parseReference(xpp));
4021      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodySite")) {
4022        res.setBodySite(parseCodeableConcept(xpp));
4023      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subSite")) {
4024        res.getSubSite().add(parseCodeableConcept(xpp));
4025      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
4026        res.getEncounter().add(parseReference(xpp));
4027      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
4028        res.getDetail().add(parseClaimDetailComponent(xpp, owner));
4029      } else if (!parseBackboneContent(eventType, xpp, res))
4030        return false;
4031    return true;
4032  }
4033
4034  protected Claim.DetailComponent parseClaimDetailComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
4035    Claim.DetailComponent res = new Claim.DetailComponent();
4036    parseBackboneAttributes(xpp, res);
4037    next(xpp);
4038    int eventType = nextNoWhitespace(xpp);
4039    while (eventType != XmlPullParser.END_TAG) {
4040  if (!parseClaimDetailComponentContent(eventType, xpp, owner, res))
4041        unknownContent(xpp);
4042      eventType = nextNoWhitespace(xpp);
4043    }
4044    next(xpp);
4045    parseElementClose(res);
4046    return res;
4047  }
4048
4049  protected boolean parseClaimDetailComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.DetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4050      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
4051        res.setSequenceElement(parsePositiveInt(xpp));
4052      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
4053        res.setRevenue(parseCodeableConcept(xpp));
4054      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
4055        res.setCategory(parseCodeableConcept(xpp));
4056      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
4057        res.setService(parseCodeableConcept(xpp));
4058      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
4059        res.getModifier().add(parseCodeableConcept(xpp));
4060      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("programCode")) {
4061        res.getProgramCode().add(parseCodeableConcept(xpp));
4062      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
4063        res.setQuantity(parseSimpleQuantity(xpp));
4064      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
4065        res.setUnitPrice(parseMoney(xpp));
4066      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
4067        res.setFactorElement(parseDecimal(xpp));
4068      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
4069        res.setNet(parseMoney(xpp));
4070      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("udi")) {
4071        res.getUdi().add(parseReference(xpp));
4072      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subDetail")) {
4073        res.getSubDetail().add(parseClaimSubDetailComponent(xpp, owner));
4074      } else if (!parseBackboneContent(eventType, xpp, res))
4075        return false;
4076    return true;
4077  }
4078
4079  protected Claim.SubDetailComponent parseClaimSubDetailComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
4080    Claim.SubDetailComponent res = new Claim.SubDetailComponent();
4081    parseBackboneAttributes(xpp, res);
4082    next(xpp);
4083    int eventType = nextNoWhitespace(xpp);
4084    while (eventType != XmlPullParser.END_TAG) {
4085  if (!parseClaimSubDetailComponentContent(eventType, xpp, owner, res))
4086        unknownContent(xpp);
4087      eventType = nextNoWhitespace(xpp);
4088    }
4089    next(xpp);
4090    parseElementClose(res);
4091    return res;
4092  }
4093
4094  protected boolean parseClaimSubDetailComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.SubDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4095      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
4096        res.setSequenceElement(parsePositiveInt(xpp));
4097      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
4098        res.setRevenue(parseCodeableConcept(xpp));
4099      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
4100        res.setCategory(parseCodeableConcept(xpp));
4101      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
4102        res.setService(parseCodeableConcept(xpp));
4103      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
4104        res.getModifier().add(parseCodeableConcept(xpp));
4105      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("programCode")) {
4106        res.getProgramCode().add(parseCodeableConcept(xpp));
4107      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
4108        res.setQuantity(parseSimpleQuantity(xpp));
4109      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
4110        res.setUnitPrice(parseMoney(xpp));
4111      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
4112        res.setFactorElement(parseDecimal(xpp));
4113      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
4114        res.setNet(parseMoney(xpp));
4115      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("udi")) {
4116        res.getUdi().add(parseReference(xpp));
4117      } else if (!parseBackboneContent(eventType, xpp, res))
4118        return false;
4119    return true;
4120  }
4121
4122  protected ClaimResponse parseClaimResponse(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4123    ClaimResponse res = new ClaimResponse();
4124    parseDomainResourceAttributes(xpp, res);
4125    next(xpp);
4126    int eventType = nextNoWhitespace(xpp);
4127    while (eventType != XmlPullParser.END_TAG) {
4128  if (!parseClaimResponseContent(eventType, xpp, res))
4129        unknownContent(xpp);
4130      eventType = nextNoWhitespace(xpp);
4131    }
4132    next(xpp);
4133    parseElementClose(res);
4134    return res;
4135  }
4136
4137  protected boolean parseClaimResponseContent(int eventType, XmlPullParser xpp, ClaimResponse res) throws XmlPullParserException, IOException, FHIRFormatError {
4138      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4139        res.getIdentifier().add(parseIdentifier(xpp));
4140      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
4141        res.setStatusElement(parseEnumeration(xpp, ClaimResponse.ClaimResponseStatus.NULL, new ClaimResponse.ClaimResponseStatusEnumFactory()));
4142      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
4143        res.setPatient(parseReference(xpp));
4144      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
4145        res.setCreatedElement(parseDateTime(xpp));
4146      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurer")) {
4147        res.setInsurer(parseReference(xpp));
4148      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestProvider")) {
4149        res.setRequestProvider(parseReference(xpp));
4150      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestOrganization")) {
4151        res.setRequestOrganization(parseReference(xpp));
4152      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
4153        res.setRequest(parseReference(xpp));
4154      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
4155        res.setOutcome(parseCodeableConcept(xpp));
4156      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("disposition")) {
4157        res.setDispositionElement(parseString(xpp));
4158      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payeeType")) {
4159        res.setPayeeType(parseCodeableConcept(xpp));
4160      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("item")) {
4161        res.getItem().add(parseClaimResponseItemComponent(xpp, res));
4162      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("addItem")) {
4163        res.getAddItem().add(parseClaimResponseAddedItemComponent(xpp, res));
4164      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("error")) {
4165        res.getError().add(parseClaimResponseErrorComponent(xpp, res));
4166      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("totalCost")) {
4167        res.setTotalCost(parseMoney(xpp));
4168      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unallocDeductable")) {
4169        res.setUnallocDeductable(parseMoney(xpp));
4170      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("totalBenefit")) {
4171        res.setTotalBenefit(parseMoney(xpp));
4172      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payment")) {
4173        res.setPayment(parseClaimResponsePaymentComponent(xpp, res));
4174      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reserved")) {
4175        res.setReserved(parseCoding(xpp));
4176      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("form")) {
4177        res.setForm(parseCodeableConcept(xpp));
4178      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("processNote")) {
4179        res.getProcessNote().add(parseClaimResponseNoteComponent(xpp, res));
4180      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("communicationRequest")) {
4181        res.getCommunicationRequest().add(parseReference(xpp));
4182      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurance")) {
4183        res.getInsurance().add(parseClaimResponseInsuranceComponent(xpp, res));
4184      } else if (!parseDomainResourceContent(eventType, xpp, res))
4185        return false;
4186    return true;
4187  }
4188
4189  protected ClaimResponse.ItemComponent parseClaimResponseItemComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4190    ClaimResponse.ItemComponent res = new ClaimResponse.ItemComponent();
4191    parseBackboneAttributes(xpp, res);
4192    next(xpp);
4193    int eventType = nextNoWhitespace(xpp);
4194    while (eventType != XmlPullParser.END_TAG) {
4195  if (!parseClaimResponseItemComponentContent(eventType, xpp, owner, res))
4196        unknownContent(xpp);
4197      eventType = nextNoWhitespace(xpp);
4198    }
4199    next(xpp);
4200    parseElementClose(res);
4201    return res;
4202  }
4203
4204  protected boolean parseClaimResponseItemComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.ItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4205      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequenceLinkId")) {
4206        res.setSequenceLinkIdElement(parsePositiveInt(xpp));
4207      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
4208        res.getNoteNumber().add(parsePositiveInt(xpp));
4209      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
4210        res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp, owner));
4211      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
4212        res.getDetail().add(parseClaimResponseItemDetailComponent(xpp, owner));
4213      } else if (!parseBackboneContent(eventType, xpp, res))
4214        return false;
4215    return true;
4216  }
4217
4218  protected ClaimResponse.AdjudicationComponent parseClaimResponseAdjudicationComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4219    ClaimResponse.AdjudicationComponent res = new ClaimResponse.AdjudicationComponent();
4220    parseBackboneAttributes(xpp, res);
4221    next(xpp);
4222    int eventType = nextNoWhitespace(xpp);
4223    while (eventType != XmlPullParser.END_TAG) {
4224  if (!parseClaimResponseAdjudicationComponentContent(eventType, xpp, owner, res))
4225        unknownContent(xpp);
4226      eventType = nextNoWhitespace(xpp);
4227    }
4228    next(xpp);
4229    parseElementClose(res);
4230    return res;
4231  }
4232
4233  protected boolean parseClaimResponseAdjudicationComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.AdjudicationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4234      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
4235        res.setCategory(parseCodeableConcept(xpp));
4236      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
4237        res.setReason(parseCodeableConcept(xpp));
4238      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("amount")) {
4239        res.setAmount(parseMoney(xpp));
4240      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
4241        res.setValueElement(parseDecimal(xpp));
4242      } else if (!parseBackboneContent(eventType, xpp, res))
4243        return false;
4244    return true;
4245  }
4246
4247  protected ClaimResponse.ItemDetailComponent parseClaimResponseItemDetailComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4248    ClaimResponse.ItemDetailComponent res = new ClaimResponse.ItemDetailComponent();
4249    parseBackboneAttributes(xpp, res);
4250    next(xpp);
4251    int eventType = nextNoWhitespace(xpp);
4252    while (eventType != XmlPullParser.END_TAG) {
4253  if (!parseClaimResponseItemDetailComponentContent(eventType, xpp, owner, res))
4254        unknownContent(xpp);
4255      eventType = nextNoWhitespace(xpp);
4256    }
4257    next(xpp);
4258    parseElementClose(res);
4259    return res;
4260  }
4261
4262  protected boolean parseClaimResponseItemDetailComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.ItemDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4263      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequenceLinkId")) {
4264        res.setSequenceLinkIdElement(parsePositiveInt(xpp));
4265      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
4266        res.getNoteNumber().add(parsePositiveInt(xpp));
4267      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
4268        res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp, owner));
4269      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subDetail")) {
4270        res.getSubDetail().add(parseClaimResponseSubDetailComponent(xpp, owner));
4271      } else if (!parseBackboneContent(eventType, xpp, res))
4272        return false;
4273    return true;
4274  }
4275
4276  protected ClaimResponse.SubDetailComponent parseClaimResponseSubDetailComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4277    ClaimResponse.SubDetailComponent res = new ClaimResponse.SubDetailComponent();
4278    parseBackboneAttributes(xpp, res);
4279    next(xpp);
4280    int eventType = nextNoWhitespace(xpp);
4281    while (eventType != XmlPullParser.END_TAG) {
4282  if (!parseClaimResponseSubDetailComponentContent(eventType, xpp, owner, res))
4283        unknownContent(xpp);
4284      eventType = nextNoWhitespace(xpp);
4285    }
4286    next(xpp);
4287    parseElementClose(res);
4288    return res;
4289  }
4290
4291  protected boolean parseClaimResponseSubDetailComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.SubDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4292      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequenceLinkId")) {
4293        res.setSequenceLinkIdElement(parsePositiveInt(xpp));
4294      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
4295        res.getNoteNumber().add(parsePositiveInt(xpp));
4296      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
4297        res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp, owner));
4298      } else if (!parseBackboneContent(eventType, xpp, res))
4299        return false;
4300    return true;
4301  }
4302
4303  protected ClaimResponse.AddedItemComponent parseClaimResponseAddedItemComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4304    ClaimResponse.AddedItemComponent res = new ClaimResponse.AddedItemComponent();
4305    parseBackboneAttributes(xpp, res);
4306    next(xpp);
4307    int eventType = nextNoWhitespace(xpp);
4308    while (eventType != XmlPullParser.END_TAG) {
4309  if (!parseClaimResponseAddedItemComponentContent(eventType, xpp, owner, res))
4310        unknownContent(xpp);
4311      eventType = nextNoWhitespace(xpp);
4312    }
4313    next(xpp);
4314    parseElementClose(res);
4315    return res;
4316  }
4317
4318  protected boolean parseClaimResponseAddedItemComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.AddedItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4319      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequenceLinkId")) {
4320        res.getSequenceLinkId().add(parsePositiveInt(xpp));
4321      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
4322        res.setRevenue(parseCodeableConcept(xpp));
4323      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
4324        res.setCategory(parseCodeableConcept(xpp));
4325      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
4326        res.setService(parseCodeableConcept(xpp));
4327      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
4328        res.getModifier().add(parseCodeableConcept(xpp));
4329      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fee")) {
4330        res.setFee(parseMoney(xpp));
4331      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
4332        res.getNoteNumber().add(parsePositiveInt(xpp));
4333      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
4334        res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp, owner));
4335      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
4336        res.getDetail().add(parseClaimResponseAddedItemsDetailComponent(xpp, owner));
4337      } else if (!parseBackboneContent(eventType, xpp, res))
4338        return false;
4339    return true;
4340  }
4341
4342  protected ClaimResponse.AddedItemsDetailComponent parseClaimResponseAddedItemsDetailComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4343    ClaimResponse.AddedItemsDetailComponent res = new ClaimResponse.AddedItemsDetailComponent();
4344    parseBackboneAttributes(xpp, res);
4345    next(xpp);
4346    int eventType = nextNoWhitespace(xpp);
4347    while (eventType != XmlPullParser.END_TAG) {
4348  if (!parseClaimResponseAddedItemsDetailComponentContent(eventType, xpp, owner, res))
4349        unknownContent(xpp);
4350      eventType = nextNoWhitespace(xpp);
4351    }
4352    next(xpp);
4353    parseElementClose(res);
4354    return res;
4355  }
4356
4357  protected boolean parseClaimResponseAddedItemsDetailComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.AddedItemsDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4358      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
4359        res.setRevenue(parseCodeableConcept(xpp));
4360      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
4361        res.setCategory(parseCodeableConcept(xpp));
4362      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
4363        res.setService(parseCodeableConcept(xpp));
4364      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
4365        res.getModifier().add(parseCodeableConcept(xpp));
4366      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fee")) {
4367        res.setFee(parseMoney(xpp));
4368      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
4369        res.getNoteNumber().add(parsePositiveInt(xpp));
4370      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
4371        res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp, owner));
4372      } else if (!parseBackboneContent(eventType, xpp, res))
4373        return false;
4374    return true;
4375  }
4376
4377  protected ClaimResponse.ErrorComponent parseClaimResponseErrorComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4378    ClaimResponse.ErrorComponent res = new ClaimResponse.ErrorComponent();
4379    parseBackboneAttributes(xpp, res);
4380    next(xpp);
4381    int eventType = nextNoWhitespace(xpp);
4382    while (eventType != XmlPullParser.END_TAG) {
4383  if (!parseClaimResponseErrorComponentContent(eventType, xpp, owner, res))
4384        unknownContent(xpp);
4385      eventType = nextNoWhitespace(xpp);
4386    }
4387    next(xpp);
4388    parseElementClose(res);
4389    return res;
4390  }
4391
4392  protected boolean parseClaimResponseErrorComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.ErrorComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4393      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequenceLinkId")) {
4394        res.setSequenceLinkIdElement(parsePositiveInt(xpp));
4395      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detailSequenceLinkId")) {
4396        res.setDetailSequenceLinkIdElement(parsePositiveInt(xpp));
4397      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subdetailSequenceLinkId")) {
4398        res.setSubdetailSequenceLinkIdElement(parsePositiveInt(xpp));
4399      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4400        res.setCode(parseCodeableConcept(xpp));
4401      } else if (!parseBackboneContent(eventType, xpp, res))
4402        return false;
4403    return true;
4404  }
4405
4406  protected ClaimResponse.PaymentComponent parseClaimResponsePaymentComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4407    ClaimResponse.PaymentComponent res = new ClaimResponse.PaymentComponent();
4408    parseBackboneAttributes(xpp, res);
4409    next(xpp);
4410    int eventType = nextNoWhitespace(xpp);
4411    while (eventType != XmlPullParser.END_TAG) {
4412  if (!parseClaimResponsePaymentComponentContent(eventType, xpp, owner, res))
4413        unknownContent(xpp);
4414      eventType = nextNoWhitespace(xpp);
4415    }
4416    next(xpp);
4417    parseElementClose(res);
4418    return res;
4419  }
4420
4421  protected boolean parseClaimResponsePaymentComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.PaymentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4422      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
4423        res.setType(parseCodeableConcept(xpp));
4424      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjustment")) {
4425        res.setAdjustment(parseMoney(xpp));
4426      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjustmentReason")) {
4427        res.setAdjustmentReason(parseCodeableConcept(xpp));
4428      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
4429        res.setDateElement(parseDate(xpp));
4430      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("amount")) {
4431        res.setAmount(parseMoney(xpp));
4432      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4433        res.setIdentifier(parseIdentifier(xpp));
4434      } else if (!parseBackboneContent(eventType, xpp, res))
4435        return false;
4436    return true;
4437  }
4438
4439  protected ClaimResponse.NoteComponent parseClaimResponseNoteComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4440    ClaimResponse.NoteComponent res = new ClaimResponse.NoteComponent();
4441    parseBackboneAttributes(xpp, res);
4442    next(xpp);
4443    int eventType = nextNoWhitespace(xpp);
4444    while (eventType != XmlPullParser.END_TAG) {
4445  if (!parseClaimResponseNoteComponentContent(eventType, xpp, owner, res))
4446        unknownContent(xpp);
4447      eventType = nextNoWhitespace(xpp);
4448    }
4449    next(xpp);
4450    parseElementClose(res);
4451    return res;
4452  }
4453
4454  protected boolean parseClaimResponseNoteComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.NoteComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4455      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("number")) {
4456        res.setNumberElement(parsePositiveInt(xpp));
4457      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
4458        res.setType(parseCodeableConcept(xpp));
4459      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
4460        res.setTextElement(parseString(xpp));
4461      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
4462        res.setLanguage(parseCodeableConcept(xpp));
4463      } else if (!parseBackboneContent(eventType, xpp, res))
4464        return false;
4465    return true;
4466  }
4467
4468  protected ClaimResponse.InsuranceComponent parseClaimResponseInsuranceComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4469    ClaimResponse.InsuranceComponent res = new ClaimResponse.InsuranceComponent();
4470    parseBackboneAttributes(xpp, res);
4471    next(xpp);
4472    int eventType = nextNoWhitespace(xpp);
4473    while (eventType != XmlPullParser.END_TAG) {
4474  if (!parseClaimResponseInsuranceComponentContent(eventType, xpp, owner, res))
4475        unknownContent(xpp);
4476      eventType = nextNoWhitespace(xpp);
4477    }
4478    next(xpp);
4479    parseElementClose(res);
4480    return res;
4481  }
4482
4483  protected boolean parseClaimResponseInsuranceComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.InsuranceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4484      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
4485        res.setSequenceElement(parsePositiveInt(xpp));
4486      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("focal")) {
4487        res.setFocalElement(parseBoolean(xpp));
4488      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
4489        res.setCoverage(parseReference(xpp));
4490      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("businessArrangement")) {
4491        res.setBusinessArrangementElement(parseString(xpp));
4492      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("preAuthRef")) {
4493        res.getPreAuthRef().add(parseString(xpp));
4494      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("claimResponse")) {
4495        res.setClaimResponse(parseReference(xpp));
4496      } else if (!parseBackboneContent(eventType, xpp, res))
4497        return false;
4498    return true;
4499  }
4500
4501  protected ClinicalImpression parseClinicalImpression(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4502    ClinicalImpression res = new ClinicalImpression();
4503    parseDomainResourceAttributes(xpp, res);
4504    next(xpp);
4505    int eventType = nextNoWhitespace(xpp);
4506    while (eventType != XmlPullParser.END_TAG) {
4507  if (!parseClinicalImpressionContent(eventType, xpp, res))
4508        unknownContent(xpp);
4509      eventType = nextNoWhitespace(xpp);
4510    }
4511    next(xpp);
4512    parseElementClose(res);
4513    return res;
4514  }
4515
4516  protected boolean parseClinicalImpressionContent(int eventType, XmlPullParser xpp, ClinicalImpression res) throws XmlPullParserException, IOException, FHIRFormatError {
4517      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4518        res.getIdentifier().add(parseIdentifier(xpp));
4519      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
4520        res.setStatusElement(parseEnumeration(xpp, ClinicalImpression.ClinicalImpressionStatus.NULL, new ClinicalImpression.ClinicalImpressionStatusEnumFactory()));
4521      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4522        res.setCode(parseCodeableConcept(xpp));
4523      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
4524        res.setDescriptionElement(parseString(xpp));
4525      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
4526        res.setSubject(parseReference(xpp));
4527      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
4528        res.setContext(parseReference(xpp));
4529      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "effective")) {
4530        res.setEffective(parseType("effective", xpp));
4531      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
4532        res.setDateElement(parseDateTime(xpp));
4533      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("assessor")) {
4534        res.setAssessor(parseReference(xpp));
4535      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("previous")) {
4536        res.setPrevious(parseReference(xpp));
4537      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("problem")) {
4538        res.getProblem().add(parseReference(xpp));
4539      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("investigation")) {
4540        res.getInvestigation().add(parseClinicalImpressionClinicalImpressionInvestigationComponent(xpp, res));
4541      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("protocol")) {
4542        res.getProtocol().add(parseUri(xpp));
4543      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("summary")) {
4544        res.setSummaryElement(parseString(xpp));
4545      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("finding")) {
4546        res.getFinding().add(parseClinicalImpressionClinicalImpressionFindingComponent(xpp, res));
4547      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prognosisCodeableConcept")) {
4548        res.getPrognosisCodeableConcept().add(parseCodeableConcept(xpp));
4549      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prognosisReference")) {
4550        res.getPrognosisReference().add(parseReference(xpp));
4551      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
4552        res.getAction().add(parseReference(xpp));
4553      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
4554        res.getNote().add(parseAnnotation(xpp));
4555      } else if (!parseDomainResourceContent(eventType, xpp, res))
4556        return false;
4557    return true;
4558  }
4559
4560  protected ClinicalImpression.ClinicalImpressionInvestigationComponent parseClinicalImpressionClinicalImpressionInvestigationComponent(XmlPullParser xpp, ClinicalImpression owner) throws XmlPullParserException, IOException, FHIRFormatError {
4561    ClinicalImpression.ClinicalImpressionInvestigationComponent res = new ClinicalImpression.ClinicalImpressionInvestigationComponent();
4562    parseBackboneAttributes(xpp, res);
4563    next(xpp);
4564    int eventType = nextNoWhitespace(xpp);
4565    while (eventType != XmlPullParser.END_TAG) {
4566  if (!parseClinicalImpressionClinicalImpressionInvestigationComponentContent(eventType, xpp, owner, res))
4567        unknownContent(xpp);
4568      eventType = nextNoWhitespace(xpp);
4569    }
4570    next(xpp);
4571    parseElementClose(res);
4572    return res;
4573  }
4574
4575  protected boolean parseClinicalImpressionClinicalImpressionInvestigationComponentContent(int eventType, XmlPullParser xpp, ClinicalImpression owner, ClinicalImpression.ClinicalImpressionInvestigationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4576      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4577        res.setCode(parseCodeableConcept(xpp));
4578      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("item")) {
4579        res.getItem().add(parseReference(xpp));
4580      } else if (!parseBackboneContent(eventType, xpp, res))
4581        return false;
4582    return true;
4583  }
4584
4585  protected ClinicalImpression.ClinicalImpressionFindingComponent parseClinicalImpressionClinicalImpressionFindingComponent(XmlPullParser xpp, ClinicalImpression owner) throws XmlPullParserException, IOException, FHIRFormatError {
4586    ClinicalImpression.ClinicalImpressionFindingComponent res = new ClinicalImpression.ClinicalImpressionFindingComponent();
4587    parseBackboneAttributes(xpp, res);
4588    next(xpp);
4589    int eventType = nextNoWhitespace(xpp);
4590    while (eventType != XmlPullParser.END_TAG) {
4591  if (!parseClinicalImpressionClinicalImpressionFindingComponentContent(eventType, xpp, owner, res))
4592        unknownContent(xpp);
4593      eventType = nextNoWhitespace(xpp);
4594    }
4595    next(xpp);
4596    parseElementClose(res);
4597    return res;
4598  }
4599
4600  protected boolean parseClinicalImpressionClinicalImpressionFindingComponentContent(int eventType, XmlPullParser xpp, ClinicalImpression owner, ClinicalImpression.ClinicalImpressionFindingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4601      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "item")) {
4602        res.setItem(parseType("item", xpp));
4603      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basis")) {
4604        res.setBasisElement(parseString(xpp));
4605      } else if (!parseBackboneContent(eventType, xpp, res))
4606        return false;
4607    return true;
4608  }
4609
4610  protected CodeSystem parseCodeSystem(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4611    CodeSystem res = new CodeSystem();
4612    parseDomainResourceAttributes(xpp, res);
4613    next(xpp);
4614    int eventType = nextNoWhitespace(xpp);
4615    while (eventType != XmlPullParser.END_TAG) {
4616  if (!parseCodeSystemContent(eventType, xpp, res))
4617        unknownContent(xpp);
4618      eventType = nextNoWhitespace(xpp);
4619    }
4620    next(xpp);
4621    parseElementClose(res);
4622    return res;
4623  }
4624
4625  protected boolean parseCodeSystemContent(int eventType, XmlPullParser xpp, CodeSystem res) throws XmlPullParserException, IOException, FHIRFormatError {
4626      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
4627        res.setUrlElement(parseUri(xpp));
4628      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4629        res.setIdentifier(parseIdentifier(xpp));
4630      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
4631        res.setVersionElement(parseString(xpp));
4632      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
4633        res.setNameElement(parseString(xpp));
4634      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
4635        res.setTitleElement(parseString(xpp));
4636      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
4637        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
4638      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
4639        res.setExperimentalElement(parseBoolean(xpp));
4640      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
4641        res.setDateElement(parseDateTime(xpp));
4642      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
4643        res.setPublisherElement(parseString(xpp));
4644      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
4645        res.getContact().add(parseContactDetail(xpp));
4646      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
4647        res.setDescriptionElement(parseMarkdown(xpp));
4648      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
4649        res.getUseContext().add(parseUsageContext(xpp));
4650      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
4651        res.getJurisdiction().add(parseCodeableConcept(xpp));
4652      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
4653        res.setPurposeElement(parseMarkdown(xpp));
4654      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
4655        res.setCopyrightElement(parseMarkdown(xpp));
4656      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("caseSensitive")) {
4657        res.setCaseSensitiveElement(parseBoolean(xpp));
4658      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueSet")) {
4659        res.setValueSetElement(parseUri(xpp));
4660      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("hierarchyMeaning")) {
4661        res.setHierarchyMeaningElement(parseEnumeration(xpp, CodeSystem.CodeSystemHierarchyMeaning.NULL, new CodeSystem.CodeSystemHierarchyMeaningEnumFactory()));
4662      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("compositional")) {
4663        res.setCompositionalElement(parseBoolean(xpp));
4664      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("versionNeeded")) {
4665        res.setVersionNeededElement(parseBoolean(xpp));
4666      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("content")) {
4667        res.setContentElement(parseEnumeration(xpp, CodeSystem.CodeSystemContentMode.NULL, new CodeSystem.CodeSystemContentModeEnumFactory()));
4668      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("count")) {
4669        res.setCountElement(parseUnsignedInt(xpp));
4670      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("filter")) {
4671        res.getFilter().add(parseCodeSystemCodeSystemFilterComponent(xpp, res));
4672      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("property")) {
4673        res.getProperty().add(parseCodeSystemPropertyComponent(xpp, res));
4674      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("concept")) {
4675        res.getConcept().add(parseCodeSystemConceptDefinitionComponent(xpp, res));
4676      } else if (!parseDomainResourceContent(eventType, xpp, res))
4677        return false;
4678    return true;
4679  }
4680
4681  protected CodeSystem.CodeSystemFilterComponent parseCodeSystemCodeSystemFilterComponent(XmlPullParser xpp, CodeSystem owner) throws XmlPullParserException, IOException, FHIRFormatError {
4682    CodeSystem.CodeSystemFilterComponent res = new CodeSystem.CodeSystemFilterComponent();
4683    parseBackboneAttributes(xpp, res);
4684    next(xpp);
4685    int eventType = nextNoWhitespace(xpp);
4686    while (eventType != XmlPullParser.END_TAG) {
4687  if (!parseCodeSystemCodeSystemFilterComponentContent(eventType, xpp, owner, res))
4688        unknownContent(xpp);
4689      eventType = nextNoWhitespace(xpp);
4690    }
4691    next(xpp);
4692    parseElementClose(res);
4693    return res;
4694  }
4695
4696  protected boolean parseCodeSystemCodeSystemFilterComponentContent(int eventType, XmlPullParser xpp, CodeSystem owner, CodeSystem.CodeSystemFilterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4697      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4698        res.setCodeElement(parseCode(xpp));
4699      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
4700        res.setDescriptionElement(parseString(xpp));
4701      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operator")) {
4702        res.getOperator().add(parseEnumeration(xpp, CodeSystem.FilterOperator.NULL, new CodeSystem.FilterOperatorEnumFactory()));
4703      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
4704        res.setValueElement(parseString(xpp));
4705      } else if (!parseBackboneContent(eventType, xpp, res))
4706        return false;
4707    return true;
4708  }
4709
4710  protected CodeSystem.PropertyComponent parseCodeSystemPropertyComponent(XmlPullParser xpp, CodeSystem owner) throws XmlPullParserException, IOException, FHIRFormatError {
4711    CodeSystem.PropertyComponent res = new CodeSystem.PropertyComponent();
4712    parseBackboneAttributes(xpp, res);
4713    next(xpp);
4714    int eventType = nextNoWhitespace(xpp);
4715    while (eventType != XmlPullParser.END_TAG) {
4716  if (!parseCodeSystemPropertyComponentContent(eventType, xpp, owner, res))
4717        unknownContent(xpp);
4718      eventType = nextNoWhitespace(xpp);
4719    }
4720    next(xpp);
4721    parseElementClose(res);
4722    return res;
4723  }
4724
4725  protected boolean parseCodeSystemPropertyComponentContent(int eventType, XmlPullParser xpp, CodeSystem owner, CodeSystem.PropertyComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4726      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4727        res.setCodeElement(parseCode(xpp));
4728      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("uri")) {
4729        res.setUriElement(parseUri(xpp));
4730      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
4731        res.setDescriptionElement(parseString(xpp));
4732      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
4733        res.setTypeElement(parseEnumeration(xpp, CodeSystem.PropertyType.NULL, new CodeSystem.PropertyTypeEnumFactory()));
4734      } else if (!parseBackboneContent(eventType, xpp, res))
4735        return false;
4736    return true;
4737  }
4738
4739  protected CodeSystem.ConceptDefinitionComponent parseCodeSystemConceptDefinitionComponent(XmlPullParser xpp, CodeSystem owner) throws XmlPullParserException, IOException, FHIRFormatError {
4740    CodeSystem.ConceptDefinitionComponent res = new CodeSystem.ConceptDefinitionComponent();
4741    parseBackboneAttributes(xpp, res);
4742    next(xpp);
4743    int eventType = nextNoWhitespace(xpp);
4744    while (eventType != XmlPullParser.END_TAG) {
4745  if (!parseCodeSystemConceptDefinitionComponentContent(eventType, xpp, owner, res))
4746        unknownContent(xpp);
4747      eventType = nextNoWhitespace(xpp);
4748    }
4749    next(xpp);
4750    parseElementClose(res);
4751    return res;
4752  }
4753
4754  protected boolean parseCodeSystemConceptDefinitionComponentContent(int eventType, XmlPullParser xpp, CodeSystem owner, CodeSystem.ConceptDefinitionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4755      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4756        res.setCodeElement(parseCode(xpp));
4757      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
4758        res.setDisplayElement(parseString(xpp));
4759      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
4760        res.setDefinitionElement(parseString(xpp));
4761      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("designation")) {
4762        res.getDesignation().add(parseCodeSystemConceptDefinitionDesignationComponent(xpp, owner));
4763      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("property")) {
4764        res.getProperty().add(parseCodeSystemConceptPropertyComponent(xpp, owner));
4765      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("concept")) {
4766        res.getConcept().add(parseCodeSystemConceptDefinitionComponent(xpp, owner));
4767      } else if (!parseBackboneContent(eventType, xpp, res))
4768        return false;
4769    return true;
4770  }
4771
4772  protected CodeSystem.ConceptDefinitionDesignationComponent parseCodeSystemConceptDefinitionDesignationComponent(XmlPullParser xpp, CodeSystem owner) throws XmlPullParserException, IOException, FHIRFormatError {
4773    CodeSystem.ConceptDefinitionDesignationComponent res = new CodeSystem.ConceptDefinitionDesignationComponent();
4774    parseBackboneAttributes(xpp, res);
4775    next(xpp);
4776    int eventType = nextNoWhitespace(xpp);
4777    while (eventType != XmlPullParser.END_TAG) {
4778  if (!parseCodeSystemConceptDefinitionDesignationComponentContent(eventType, xpp, owner, res))
4779        unknownContent(xpp);
4780      eventType = nextNoWhitespace(xpp);
4781    }
4782    next(xpp);
4783    parseElementClose(res);
4784    return res;
4785  }
4786
4787  protected boolean parseCodeSystemConceptDefinitionDesignationComponentContent(int eventType, XmlPullParser xpp, CodeSystem owner, CodeSystem.ConceptDefinitionDesignationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4788      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
4789        res.setLanguageElement(parseCode(xpp));
4790      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
4791        res.setUse(parseCoding(xpp));
4792      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
4793        res.setValueElement(parseString(xpp));
4794      } else if (!parseBackboneContent(eventType, xpp, res))
4795        return false;
4796    return true;
4797  }
4798
4799  protected CodeSystem.ConceptPropertyComponent parseCodeSystemConceptPropertyComponent(XmlPullParser xpp, CodeSystem owner) throws XmlPullParserException, IOException, FHIRFormatError {
4800    CodeSystem.ConceptPropertyComponent res = new CodeSystem.ConceptPropertyComponent();
4801    parseBackboneAttributes(xpp, res);
4802    next(xpp);
4803    int eventType = nextNoWhitespace(xpp);
4804    while (eventType != XmlPullParser.END_TAG) {
4805  if (!parseCodeSystemConceptPropertyComponentContent(eventType, xpp, owner, res))
4806        unknownContent(xpp);
4807      eventType = nextNoWhitespace(xpp);
4808    }
4809    next(xpp);
4810    parseElementClose(res);
4811    return res;
4812  }
4813
4814  protected boolean parseCodeSystemConceptPropertyComponentContent(int eventType, XmlPullParser xpp, CodeSystem owner, CodeSystem.ConceptPropertyComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4815      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4816        res.setCodeElement(parseCode(xpp));
4817      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
4818        res.setValue(parseType("value", xpp));
4819      } else if (!parseBackboneContent(eventType, xpp, res))
4820        return false;
4821    return true;
4822  }
4823
4824  protected Communication parseCommunication(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4825    Communication res = new Communication();
4826    parseDomainResourceAttributes(xpp, res);
4827    next(xpp);
4828    int eventType = nextNoWhitespace(xpp);
4829    while (eventType != XmlPullParser.END_TAG) {
4830  if (!parseCommunicationContent(eventType, xpp, res))
4831        unknownContent(xpp);
4832      eventType = nextNoWhitespace(xpp);
4833    }
4834    next(xpp);
4835    parseElementClose(res);
4836    return res;
4837  }
4838
4839  protected boolean parseCommunicationContent(int eventType, XmlPullParser xpp, Communication res) throws XmlPullParserException, IOException, FHIRFormatError {
4840      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4841        res.getIdentifier().add(parseIdentifier(xpp));
4842      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
4843        res.getDefinition().add(parseReference(xpp));
4844      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
4845        res.getBasedOn().add(parseReference(xpp));
4846      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
4847        res.getPartOf().add(parseReference(xpp));
4848      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
4849        res.setStatusElement(parseEnumeration(xpp, Communication.CommunicationStatus.NULL, new Communication.CommunicationStatusEnumFactory()));
4850      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("notDone")) {
4851        res.setNotDoneElement(parseBoolean(xpp));
4852      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("notDoneReason")) {
4853        res.setNotDoneReason(parseCodeableConcept(xpp));
4854      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
4855        res.getCategory().add(parseCodeableConcept(xpp));
4856      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("medium")) {
4857        res.getMedium().add(parseCodeableConcept(xpp));
4858      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
4859        res.setSubject(parseReference(xpp));
4860      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recipient")) {
4861        res.getRecipient().add(parseReference(xpp));
4862      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("topic")) {
4863        res.getTopic().add(parseReference(xpp));
4864      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
4865        res.setContext(parseReference(xpp));
4866      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sent")) {
4867        res.setSentElement(parseDateTime(xpp));
4868      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("received")) {
4869        res.setReceivedElement(parseDateTime(xpp));
4870      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sender")) {
4871        res.setSender(parseReference(xpp));
4872      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonCode")) {
4873        res.getReasonCode().add(parseCodeableConcept(xpp));
4874      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonReference")) {
4875        res.getReasonReference().add(parseReference(xpp));
4876      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payload")) {
4877        res.getPayload().add(parseCommunicationCommunicationPayloadComponent(xpp, res));
4878      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
4879        res.getNote().add(parseAnnotation(xpp));
4880      } else if (!parseDomainResourceContent(eventType, xpp, res))
4881        return false;
4882    return true;
4883  }
4884
4885  protected Communication.CommunicationPayloadComponent parseCommunicationCommunicationPayloadComponent(XmlPullParser xpp, Communication owner) throws XmlPullParserException, IOException, FHIRFormatError {
4886    Communication.CommunicationPayloadComponent res = new Communication.CommunicationPayloadComponent();
4887    parseBackboneAttributes(xpp, res);
4888    next(xpp);
4889    int eventType = nextNoWhitespace(xpp);
4890    while (eventType != XmlPullParser.END_TAG) {
4891  if (!parseCommunicationCommunicationPayloadComponentContent(eventType, xpp, owner, res))
4892        unknownContent(xpp);
4893      eventType = nextNoWhitespace(xpp);
4894    }
4895    next(xpp);
4896    parseElementClose(res);
4897    return res;
4898  }
4899
4900  protected boolean parseCommunicationCommunicationPayloadComponentContent(int eventType, XmlPullParser xpp, Communication owner, Communication.CommunicationPayloadComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4901      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "content")) {
4902        res.setContent(parseType("content", xpp));
4903      } else if (!parseBackboneContent(eventType, xpp, res))
4904        return false;
4905    return true;
4906  }
4907
4908  protected CommunicationRequest parseCommunicationRequest(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4909    CommunicationRequest res = new CommunicationRequest();
4910    parseDomainResourceAttributes(xpp, res);
4911    next(xpp);
4912    int eventType = nextNoWhitespace(xpp);
4913    while (eventType != XmlPullParser.END_TAG) {
4914  if (!parseCommunicationRequestContent(eventType, xpp, res))
4915        unknownContent(xpp);
4916      eventType = nextNoWhitespace(xpp);
4917    }
4918    next(xpp);
4919    parseElementClose(res);
4920    return res;
4921  }
4922
4923  protected boolean parseCommunicationRequestContent(int eventType, XmlPullParser xpp, CommunicationRequest res) throws XmlPullParserException, IOException, FHIRFormatError {
4924      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4925        res.getIdentifier().add(parseIdentifier(xpp));
4926      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
4927        res.getBasedOn().add(parseReference(xpp));
4928      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("replaces")) {
4929        res.getReplaces().add(parseReference(xpp));
4930      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("groupIdentifier")) {
4931        res.setGroupIdentifier(parseIdentifier(xpp));
4932      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
4933        res.setStatusElement(parseEnumeration(xpp, CommunicationRequest.CommunicationRequestStatus.NULL, new CommunicationRequest.CommunicationRequestStatusEnumFactory()));
4934      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
4935        res.getCategory().add(parseCodeableConcept(xpp));
4936      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
4937        res.setPriorityElement(parseEnumeration(xpp, CommunicationRequest.CommunicationPriority.NULL, new CommunicationRequest.CommunicationPriorityEnumFactory()));
4938      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("medium")) {
4939        res.getMedium().add(parseCodeableConcept(xpp));
4940      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
4941        res.setSubject(parseReference(xpp));
4942      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recipient")) {
4943        res.getRecipient().add(parseReference(xpp));
4944      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("topic")) {
4945        res.getTopic().add(parseReference(xpp));
4946      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
4947        res.setContext(parseReference(xpp));
4948      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payload")) {
4949        res.getPayload().add(parseCommunicationRequestCommunicationRequestPayloadComponent(xpp, res));
4950      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "occurrence")) {
4951        res.setOccurrence(parseType("occurrence", xpp));
4952      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authoredOn")) {
4953        res.setAuthoredOnElement(parseDateTime(xpp));
4954      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sender")) {
4955        res.setSender(parseReference(xpp));
4956      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requester")) {
4957        res.setRequester(parseCommunicationRequestCommunicationRequestRequesterComponent(xpp, res));
4958      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonCode")) {
4959        res.getReasonCode().add(parseCodeableConcept(xpp));
4960      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonReference")) {
4961        res.getReasonReference().add(parseReference(xpp));
4962      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
4963        res.getNote().add(parseAnnotation(xpp));
4964      } else if (!parseDomainResourceContent(eventType, xpp, res))
4965        return false;
4966    return true;
4967  }
4968
4969  protected CommunicationRequest.CommunicationRequestPayloadComponent parseCommunicationRequestCommunicationRequestPayloadComponent(XmlPullParser xpp, CommunicationRequest owner) throws XmlPullParserException, IOException, FHIRFormatError {
4970    CommunicationRequest.CommunicationRequestPayloadComponent res = new CommunicationRequest.CommunicationRequestPayloadComponent();
4971    parseBackboneAttributes(xpp, res);
4972    next(xpp);
4973    int eventType = nextNoWhitespace(xpp);
4974    while (eventType != XmlPullParser.END_TAG) {
4975  if (!parseCommunicationRequestCommunicationRequestPayloadComponentContent(eventType, xpp, owner, res))
4976        unknownContent(xpp);
4977      eventType = nextNoWhitespace(xpp);
4978    }
4979    next(xpp);
4980    parseElementClose(res);
4981    return res;
4982  }
4983
4984  protected boolean parseCommunicationRequestCommunicationRequestPayloadComponentContent(int eventType, XmlPullParser xpp, CommunicationRequest owner, CommunicationRequest.CommunicationRequestPayloadComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4985      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "content")) {
4986        res.setContent(parseType("content", xpp));
4987      } else if (!parseBackboneContent(eventType, xpp, res))
4988        return false;
4989    return true;
4990  }
4991
4992  protected CommunicationRequest.CommunicationRequestRequesterComponent parseCommunicationRequestCommunicationRequestRequesterComponent(XmlPullParser xpp, CommunicationRequest owner) throws XmlPullParserException, IOException, FHIRFormatError {
4993    CommunicationRequest.CommunicationRequestRequesterComponent res = new CommunicationRequest.CommunicationRequestRequesterComponent();
4994    parseBackboneAttributes(xpp, res);
4995    next(xpp);
4996    int eventType = nextNoWhitespace(xpp);
4997    while (eventType != XmlPullParser.END_TAG) {
4998  if (!parseCommunicationRequestCommunicationRequestRequesterComponentContent(eventType, xpp, owner, res))
4999        unknownContent(xpp);
5000      eventType = nextNoWhitespace(xpp);
5001    }
5002    next(xpp);
5003    parseElementClose(res);
5004    return res;
5005  }
5006
5007  protected boolean parseCommunicationRequestCommunicationRequestRequesterComponentContent(int eventType, XmlPullParser xpp, CommunicationRequest owner, CommunicationRequest.CommunicationRequestRequesterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5008      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("agent")) {
5009        res.setAgent(parseReference(xpp));
5010      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onBehalfOf")) {
5011        res.setOnBehalfOf(parseReference(xpp));
5012      } else if (!parseBackboneContent(eventType, xpp, res))
5013        return false;
5014    return true;
5015  }
5016
5017  protected CompartmentDefinition parseCompartmentDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5018    CompartmentDefinition res = new CompartmentDefinition();
5019    parseDomainResourceAttributes(xpp, res);
5020    next(xpp);
5021    int eventType = nextNoWhitespace(xpp);
5022    while (eventType != XmlPullParser.END_TAG) {
5023  if (!parseCompartmentDefinitionContent(eventType, xpp, res))
5024        unknownContent(xpp);
5025      eventType = nextNoWhitespace(xpp);
5026    }
5027    next(xpp);
5028    parseElementClose(res);
5029    return res;
5030  }
5031
5032  protected boolean parseCompartmentDefinitionContent(int eventType, XmlPullParser xpp, CompartmentDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
5033      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
5034        res.setUrlElement(parseUri(xpp));
5035      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
5036        res.setNameElement(parseString(xpp));
5037      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
5038        res.setTitleElement(parseString(xpp));
5039      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
5040        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
5041      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
5042        res.setExperimentalElement(parseBoolean(xpp));
5043      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
5044        res.setDateElement(parseDateTime(xpp));
5045      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
5046        res.setPublisherElement(parseString(xpp));
5047      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
5048        res.getContact().add(parseContactDetail(xpp));
5049      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
5050        res.setDescriptionElement(parseMarkdown(xpp));
5051      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
5052        res.setPurposeElement(parseMarkdown(xpp));
5053      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
5054        res.getUseContext().add(parseUsageContext(xpp));
5055      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
5056        res.getJurisdiction().add(parseCodeableConcept(xpp));
5057      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5058        res.setCodeElement(parseEnumeration(xpp, CompartmentDefinition.CompartmentType.NULL, new CompartmentDefinition.CompartmentTypeEnumFactory()));
5059      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("search")) {
5060        res.setSearchElement(parseBoolean(xpp));
5061      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
5062        res.getResource().add(parseCompartmentDefinitionCompartmentDefinitionResourceComponent(xpp, res));
5063      } else if (!parseDomainResourceContent(eventType, xpp, res))
5064        return false;
5065    return true;
5066  }
5067
5068  protected CompartmentDefinition.CompartmentDefinitionResourceComponent parseCompartmentDefinitionCompartmentDefinitionResourceComponent(XmlPullParser xpp, CompartmentDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
5069    CompartmentDefinition.CompartmentDefinitionResourceComponent res = new CompartmentDefinition.CompartmentDefinitionResourceComponent();
5070    parseBackboneAttributes(xpp, res);
5071    next(xpp);
5072    int eventType = nextNoWhitespace(xpp);
5073    while (eventType != XmlPullParser.END_TAG) {
5074  if (!parseCompartmentDefinitionCompartmentDefinitionResourceComponentContent(eventType, xpp, owner, res))
5075        unknownContent(xpp);
5076      eventType = nextNoWhitespace(xpp);
5077    }
5078    next(xpp);
5079    parseElementClose(res);
5080    return res;
5081  }
5082
5083  protected boolean parseCompartmentDefinitionCompartmentDefinitionResourceComponentContent(int eventType, XmlPullParser xpp, CompartmentDefinition owner, CompartmentDefinition.CompartmentDefinitionResourceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5084      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5085        res.setCodeElement(parseCode(xpp));
5086      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("param")) {
5087        res.getParam().add(parseString(xpp));
5088      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
5089        res.setDocumentationElement(parseString(xpp));
5090      } else if (!parseBackboneContent(eventType, xpp, res))
5091        return false;
5092    return true;
5093  }
5094
5095  protected Composition parseComposition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5096    Composition res = new Composition();
5097    parseDomainResourceAttributes(xpp, res);
5098    next(xpp);
5099    int eventType = nextNoWhitespace(xpp);
5100    while (eventType != XmlPullParser.END_TAG) {
5101  if (!parseCompositionContent(eventType, xpp, res))
5102        unknownContent(xpp);
5103      eventType = nextNoWhitespace(xpp);
5104    }
5105    next(xpp);
5106    parseElementClose(res);
5107    return res;
5108  }
5109
5110  protected boolean parseCompositionContent(int eventType, XmlPullParser xpp, Composition res) throws XmlPullParserException, IOException, FHIRFormatError {
5111      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5112        res.setIdentifier(parseIdentifier(xpp));
5113      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
5114        res.setStatusElement(parseEnumeration(xpp, Composition.CompositionStatus.NULL, new Composition.CompositionStatusEnumFactory()));
5115      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5116        res.setType(parseCodeableConcept(xpp));
5117      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("class")) {
5118        res.setClass_(parseCodeableConcept(xpp));
5119      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
5120        res.setSubject(parseReference(xpp));
5121      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
5122        res.setEncounter(parseReference(xpp));
5123      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
5124        res.setDateElement(parseDateTime(xpp));
5125      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
5126        res.getAuthor().add(parseReference(xpp));
5127      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
5128        res.setTitleElement(parseString(xpp));
5129      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("confidentiality")) {
5130        res.setConfidentialityElement(parseEnumeration(xpp, Composition.DocumentConfidentiality.NULL, new Composition.DocumentConfidentialityEnumFactory()));
5131      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("attester")) {
5132        res.getAttester().add(parseCompositionCompositionAttesterComponent(xpp, res));
5133      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("custodian")) {
5134        res.setCustodian(parseReference(xpp));
5135      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatesTo")) {
5136        res.getRelatesTo().add(parseCompositionCompositionRelatesToComponent(xpp, res));
5137      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("event")) {
5138        res.getEvent().add(parseCompositionCompositionEventComponent(xpp, res));
5139      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("section")) {
5140        res.getSection().add(parseCompositionSectionComponent(xpp, res));
5141      } else if (!parseDomainResourceContent(eventType, xpp, res))
5142        return false;
5143    return true;
5144  }
5145
5146  protected Composition.CompositionAttesterComponent parseCompositionCompositionAttesterComponent(XmlPullParser xpp, Composition owner) throws XmlPullParserException, IOException, FHIRFormatError {
5147    Composition.CompositionAttesterComponent res = new Composition.CompositionAttesterComponent();
5148    parseBackboneAttributes(xpp, res);
5149    next(xpp);
5150    int eventType = nextNoWhitespace(xpp);
5151    while (eventType != XmlPullParser.END_TAG) {
5152  if (!parseCompositionCompositionAttesterComponentContent(eventType, xpp, owner, res))
5153        unknownContent(xpp);
5154      eventType = nextNoWhitespace(xpp);
5155    }
5156    next(xpp);
5157    parseElementClose(res);
5158    return res;
5159  }
5160
5161  protected boolean parseCompositionCompositionAttesterComponentContent(int eventType, XmlPullParser xpp, Composition owner, Composition.CompositionAttesterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5162      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
5163        res.getMode().add(parseEnumeration(xpp, Composition.CompositionAttestationMode.NULL, new Composition.CompositionAttestationModeEnumFactory()));
5164      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("time")) {
5165        res.setTimeElement(parseDateTime(xpp));
5166      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("party")) {
5167        res.setParty(parseReference(xpp));
5168      } else if (!parseBackboneContent(eventType, xpp, res))
5169        return false;
5170    return true;
5171  }
5172
5173  protected Composition.CompositionRelatesToComponent parseCompositionCompositionRelatesToComponent(XmlPullParser xpp, Composition owner) throws XmlPullParserException, IOException, FHIRFormatError {
5174    Composition.CompositionRelatesToComponent res = new Composition.CompositionRelatesToComponent();
5175    parseBackboneAttributes(xpp, res);
5176    next(xpp);
5177    int eventType = nextNoWhitespace(xpp);
5178    while (eventType != XmlPullParser.END_TAG) {
5179  if (!parseCompositionCompositionRelatesToComponentContent(eventType, xpp, owner, res))
5180        unknownContent(xpp);
5181      eventType = nextNoWhitespace(xpp);
5182    }
5183    next(xpp);
5184    parseElementClose(res);
5185    return res;
5186  }
5187
5188  protected boolean parseCompositionCompositionRelatesToComponentContent(int eventType, XmlPullParser xpp, Composition owner, Composition.CompositionRelatesToComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5189      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5190        res.setCodeElement(parseEnumeration(xpp, Composition.DocumentRelationshipType.NULL, new Composition.DocumentRelationshipTypeEnumFactory()));
5191      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "target")) {
5192        res.setTarget(parseType("target", xpp));
5193      } else if (!parseBackboneContent(eventType, xpp, res))
5194        return false;
5195    return true;
5196  }
5197
5198  protected Composition.CompositionEventComponent parseCompositionCompositionEventComponent(XmlPullParser xpp, Composition owner) throws XmlPullParserException, IOException, FHIRFormatError {
5199    Composition.CompositionEventComponent res = new Composition.CompositionEventComponent();
5200    parseBackboneAttributes(xpp, res);
5201    next(xpp);
5202    int eventType = nextNoWhitespace(xpp);
5203    while (eventType != XmlPullParser.END_TAG) {
5204  if (!parseCompositionCompositionEventComponentContent(eventType, xpp, owner, res))
5205        unknownContent(xpp);
5206      eventType = nextNoWhitespace(xpp);
5207    }
5208    next(xpp);
5209    parseElementClose(res);
5210    return res;
5211  }
5212
5213  protected boolean parseCompositionCompositionEventComponentContent(int eventType, XmlPullParser xpp, Composition owner, Composition.CompositionEventComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5214      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5215        res.getCode().add(parseCodeableConcept(xpp));
5216      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
5217        res.setPeriod(parsePeriod(xpp));
5218      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
5219        res.getDetail().add(parseReference(xpp));
5220      } else if (!parseBackboneContent(eventType, xpp, res))
5221        return false;
5222    return true;
5223  }
5224
5225  protected Composition.SectionComponent parseCompositionSectionComponent(XmlPullParser xpp, Composition owner) throws XmlPullParserException, IOException, FHIRFormatError {
5226    Composition.SectionComponent res = new Composition.SectionComponent();
5227    parseBackboneAttributes(xpp, res);
5228    next(xpp);
5229    int eventType = nextNoWhitespace(xpp);
5230    while (eventType != XmlPullParser.END_TAG) {
5231  if (!parseCompositionSectionComponentContent(eventType, xpp, owner, res))
5232        unknownContent(xpp);
5233      eventType = nextNoWhitespace(xpp);
5234    }
5235    next(xpp);
5236    parseElementClose(res);
5237    return res;
5238  }
5239
5240  protected boolean parseCompositionSectionComponentContent(int eventType, XmlPullParser xpp, Composition owner, Composition.SectionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5241      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
5242        res.setTitleElement(parseString(xpp));
5243      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5244        res.setCode(parseCodeableConcept(xpp));
5245      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
5246        res.setText(parseNarrative(xpp));
5247      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
5248        res.setModeElement(parseEnumeration(xpp, Composition.SectionMode.NULL, new Composition.SectionModeEnumFactory()));
5249      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("orderedBy")) {
5250        res.setOrderedBy(parseCodeableConcept(xpp));
5251      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("entry")) {
5252        res.getEntry().add(parseReference(xpp));
5253      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("emptyReason")) {
5254        res.setEmptyReason(parseCodeableConcept(xpp));
5255      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("section")) {
5256        res.getSection().add(parseCompositionSectionComponent(xpp, owner));
5257      } else if (!parseBackboneContent(eventType, xpp, res))
5258        return false;
5259    return true;
5260  }
5261
5262  protected ConceptMap parseConceptMap(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5263    ConceptMap res = new ConceptMap();
5264    parseDomainResourceAttributes(xpp, res);
5265    next(xpp);
5266    int eventType = nextNoWhitespace(xpp);
5267    while (eventType != XmlPullParser.END_TAG) {
5268  if (!parseConceptMapContent(eventType, xpp, res))
5269        unknownContent(xpp);
5270      eventType = nextNoWhitespace(xpp);
5271    }
5272    next(xpp);
5273    parseElementClose(res);
5274    return res;
5275  }
5276
5277  protected boolean parseConceptMapContent(int eventType, XmlPullParser xpp, ConceptMap res) throws XmlPullParserException, IOException, FHIRFormatError {
5278      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
5279        res.setUrlElement(parseUri(xpp));
5280      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5281        res.setIdentifier(parseIdentifier(xpp));
5282      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
5283        res.setVersionElement(parseString(xpp));
5284      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
5285        res.setNameElement(parseString(xpp));
5286      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
5287        res.setTitleElement(parseString(xpp));
5288      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
5289        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
5290      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
5291        res.setExperimentalElement(parseBoolean(xpp));
5292      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
5293        res.setDateElement(parseDateTime(xpp));
5294      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
5295        res.setPublisherElement(parseString(xpp));
5296      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
5297        res.getContact().add(parseContactDetail(xpp));
5298      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
5299        res.setDescriptionElement(parseMarkdown(xpp));
5300      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
5301        res.getUseContext().add(parseUsageContext(xpp));
5302      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
5303        res.getJurisdiction().add(parseCodeableConcept(xpp));
5304      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
5305        res.setPurposeElement(parseMarkdown(xpp));
5306      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
5307        res.setCopyrightElement(parseMarkdown(xpp));
5308      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "source")) {
5309        res.setSource(parseType("source", xpp));
5310      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "target")) {
5311        res.setTarget(parseType("target", xpp));
5312      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("group")) {
5313        res.getGroup().add(parseConceptMapConceptMapGroupComponent(xpp, res));
5314      } else if (!parseDomainResourceContent(eventType, xpp, res))
5315        return false;
5316    return true;
5317  }
5318
5319  protected ConceptMap.ConceptMapGroupComponent parseConceptMapConceptMapGroupComponent(XmlPullParser xpp, ConceptMap owner) throws XmlPullParserException, IOException, FHIRFormatError {
5320    ConceptMap.ConceptMapGroupComponent res = new ConceptMap.ConceptMapGroupComponent();
5321    parseBackboneAttributes(xpp, res);
5322    next(xpp);
5323    int eventType = nextNoWhitespace(xpp);
5324    while (eventType != XmlPullParser.END_TAG) {
5325  if (!parseConceptMapConceptMapGroupComponentContent(eventType, xpp, owner, res))
5326        unknownContent(xpp);
5327      eventType = nextNoWhitespace(xpp);
5328    }
5329    next(xpp);
5330    parseElementClose(res);
5331    return res;
5332  }
5333
5334  protected boolean parseConceptMapConceptMapGroupComponentContent(int eventType, XmlPullParser xpp, ConceptMap owner, ConceptMap.ConceptMapGroupComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5335      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
5336        res.setSourceElement(parseUri(xpp));
5337      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sourceVersion")) {
5338        res.setSourceVersionElement(parseString(xpp));
5339      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("target")) {
5340        res.setTargetElement(parseUri(xpp));
5341      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("targetVersion")) {
5342        res.setTargetVersionElement(parseString(xpp));
5343      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("element")) {
5344        res.getElement().add(parseConceptMapSourceElementComponent(xpp, owner));
5345      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unmapped")) {
5346        res.setUnmapped(parseConceptMapConceptMapGroupUnmappedComponent(xpp, owner));
5347      } else if (!parseBackboneContent(eventType, xpp, res))
5348        return false;
5349    return true;
5350  }
5351
5352  protected ConceptMap.SourceElementComponent parseConceptMapSourceElementComponent(XmlPullParser xpp, ConceptMap owner) throws XmlPullParserException, IOException, FHIRFormatError {
5353    ConceptMap.SourceElementComponent res = new ConceptMap.SourceElementComponent();
5354    parseBackboneAttributes(xpp, res);
5355    next(xpp);
5356    int eventType = nextNoWhitespace(xpp);
5357    while (eventType != XmlPullParser.END_TAG) {
5358  if (!parseConceptMapSourceElementComponentContent(eventType, xpp, owner, res))
5359        unknownContent(xpp);
5360      eventType = nextNoWhitespace(xpp);
5361    }
5362    next(xpp);
5363    parseElementClose(res);
5364    return res;
5365  }
5366
5367  protected boolean parseConceptMapSourceElementComponentContent(int eventType, XmlPullParser xpp, ConceptMap owner, ConceptMap.SourceElementComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5368      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5369        res.setCodeElement(parseCode(xpp));
5370      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
5371        res.setDisplayElement(parseString(xpp));
5372      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("target")) {
5373        res.getTarget().add(parseConceptMapTargetElementComponent(xpp, owner));
5374      } else if (!parseBackboneContent(eventType, xpp, res))
5375        return false;
5376    return true;
5377  }
5378
5379  protected ConceptMap.TargetElementComponent parseConceptMapTargetElementComponent(XmlPullParser xpp, ConceptMap owner) throws XmlPullParserException, IOException, FHIRFormatError {
5380    ConceptMap.TargetElementComponent res = new ConceptMap.TargetElementComponent();
5381    parseBackboneAttributes(xpp, res);
5382    next(xpp);
5383    int eventType = nextNoWhitespace(xpp);
5384    while (eventType != XmlPullParser.END_TAG) {
5385  if (!parseConceptMapTargetElementComponentContent(eventType, xpp, owner, res))
5386        unknownContent(xpp);
5387      eventType = nextNoWhitespace(xpp);
5388    }
5389    next(xpp);
5390    parseElementClose(res);
5391    return res;
5392  }
5393
5394  protected boolean parseConceptMapTargetElementComponentContent(int eventType, XmlPullParser xpp, ConceptMap owner, ConceptMap.TargetElementComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5395      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5396        res.setCodeElement(parseCode(xpp));
5397      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
5398        res.setDisplayElement(parseString(xpp));
5399      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("equivalence")) {
5400        res.setEquivalenceElement(parseEnumeration(xpp, Enumerations.ConceptMapEquivalence.NULL, new Enumerations.ConceptMapEquivalenceEnumFactory()));
5401      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
5402        res.setCommentElement(parseString(xpp));
5403      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dependsOn")) {
5404        res.getDependsOn().add(parseConceptMapOtherElementComponent(xpp, owner));
5405      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("product")) {
5406        res.getProduct().add(parseConceptMapOtherElementComponent(xpp, owner));
5407      } else if (!parseBackboneContent(eventType, xpp, res))
5408        return false;
5409    return true;
5410  }
5411
5412  protected ConceptMap.OtherElementComponent parseConceptMapOtherElementComponent(XmlPullParser xpp, ConceptMap owner) throws XmlPullParserException, IOException, FHIRFormatError {
5413    ConceptMap.OtherElementComponent res = new ConceptMap.OtherElementComponent();
5414    parseBackboneAttributes(xpp, res);
5415    next(xpp);
5416    int eventType = nextNoWhitespace(xpp);
5417    while (eventType != XmlPullParser.END_TAG) {
5418  if (!parseConceptMapOtherElementComponentContent(eventType, xpp, owner, res))
5419        unknownContent(xpp);
5420      eventType = nextNoWhitespace(xpp);
5421    }
5422    next(xpp);
5423    parseElementClose(res);
5424    return res;
5425  }
5426
5427  protected boolean parseConceptMapOtherElementComponentContent(int eventType, XmlPullParser xpp, ConceptMap owner, ConceptMap.OtherElementComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5428      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("property")) {
5429        res.setPropertyElement(parseUri(xpp));
5430      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
5431        res.setSystemElement(parseUri(xpp));
5432      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5433        res.setCodeElement(parseString(xpp));
5434      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
5435        res.setDisplayElement(parseString(xpp));
5436      } else if (!parseBackboneContent(eventType, xpp, res))
5437        return false;
5438    return true;
5439  }
5440
5441  protected ConceptMap.ConceptMapGroupUnmappedComponent parseConceptMapConceptMapGroupUnmappedComponent(XmlPullParser xpp, ConceptMap owner) throws XmlPullParserException, IOException, FHIRFormatError {
5442    ConceptMap.ConceptMapGroupUnmappedComponent res = new ConceptMap.ConceptMapGroupUnmappedComponent();
5443    parseBackboneAttributes(xpp, res);
5444    next(xpp);
5445    int eventType = nextNoWhitespace(xpp);
5446    while (eventType != XmlPullParser.END_TAG) {
5447  if (!parseConceptMapConceptMapGroupUnmappedComponentContent(eventType, xpp, owner, res))
5448        unknownContent(xpp);
5449      eventType = nextNoWhitespace(xpp);
5450    }
5451    next(xpp);
5452    parseElementClose(res);
5453    return res;
5454  }
5455
5456  protected boolean parseConceptMapConceptMapGroupUnmappedComponentContent(int eventType, XmlPullParser xpp, ConceptMap owner, ConceptMap.ConceptMapGroupUnmappedComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5457      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
5458        res.setModeElement(parseEnumeration(xpp, ConceptMap.ConceptMapGroupUnmappedMode.NULL, new ConceptMap.ConceptMapGroupUnmappedModeEnumFactory()));
5459      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5460        res.setCodeElement(parseCode(xpp));
5461      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
5462        res.setDisplayElement(parseString(xpp));
5463      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
5464        res.setUrlElement(parseUri(xpp));
5465      } else if (!parseBackboneContent(eventType, xpp, res))
5466        return false;
5467    return true;
5468  }
5469
5470  protected Condition parseCondition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5471    Condition res = new Condition();
5472    parseDomainResourceAttributes(xpp, res);
5473    next(xpp);
5474    int eventType = nextNoWhitespace(xpp);
5475    while (eventType != XmlPullParser.END_TAG) {
5476  if (!parseConditionContent(eventType, xpp, res))
5477        unknownContent(xpp);
5478      eventType = nextNoWhitespace(xpp);
5479    }
5480    next(xpp);
5481    parseElementClose(res);
5482    return res;
5483  }
5484
5485  protected boolean parseConditionContent(int eventType, XmlPullParser xpp, Condition res) throws XmlPullParserException, IOException, FHIRFormatError {
5486      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5487        res.getIdentifier().add(parseIdentifier(xpp));
5488      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("clinicalStatus")) {
5489        res.setClinicalStatusElement(parseEnumeration(xpp, Condition.ConditionClinicalStatus.NULL, new Condition.ConditionClinicalStatusEnumFactory()));
5490      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("verificationStatus")) {
5491        res.setVerificationStatusElement(parseEnumeration(xpp, Condition.ConditionVerificationStatus.NULL, new Condition.ConditionVerificationStatusEnumFactory()));
5492      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
5493        res.getCategory().add(parseCodeableConcept(xpp));
5494      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("severity")) {
5495        res.setSeverity(parseCodeableConcept(xpp));
5496      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5497        res.setCode(parseCodeableConcept(xpp));
5498      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodySite")) {
5499        res.getBodySite().add(parseCodeableConcept(xpp));
5500      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
5501        res.setSubject(parseReference(xpp));
5502      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
5503        res.setContext(parseReference(xpp));
5504      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "onset")) {
5505        res.setOnset(parseType("onset", xpp));
5506      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "abatement")) {
5507        res.setAbatement(parseType("abatement", xpp));
5508      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("assertedDate")) {
5509        res.setAssertedDateElement(parseDateTime(xpp));
5510      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("asserter")) {
5511        res.setAsserter(parseReference(xpp));
5512      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("stage")) {
5513        res.setStage(parseConditionConditionStageComponent(xpp, res));
5514      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("evidence")) {
5515        res.getEvidence().add(parseConditionConditionEvidenceComponent(xpp, res));
5516      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
5517        res.getNote().add(parseAnnotation(xpp));
5518      } else if (!parseDomainResourceContent(eventType, xpp, res))
5519        return false;
5520    return true;
5521  }
5522
5523  protected Condition.ConditionStageComponent parseConditionConditionStageComponent(XmlPullParser xpp, Condition owner) throws XmlPullParserException, IOException, FHIRFormatError {
5524    Condition.ConditionStageComponent res = new Condition.ConditionStageComponent();
5525    parseBackboneAttributes(xpp, res);
5526    next(xpp);
5527    int eventType = nextNoWhitespace(xpp);
5528    while (eventType != XmlPullParser.END_TAG) {
5529  if (!parseConditionConditionStageComponentContent(eventType, xpp, owner, res))
5530        unknownContent(xpp);
5531      eventType = nextNoWhitespace(xpp);
5532    }
5533    next(xpp);
5534    parseElementClose(res);
5535    return res;
5536  }
5537
5538  protected boolean parseConditionConditionStageComponentContent(int eventType, XmlPullParser xpp, Condition owner, Condition.ConditionStageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5539      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("summary")) {
5540        res.setSummary(parseCodeableConcept(xpp));
5541      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("assessment")) {
5542        res.getAssessment().add(parseReference(xpp));
5543      } else if (!parseBackboneContent(eventType, xpp, res))
5544        return false;
5545    return true;
5546  }
5547
5548  protected Condition.ConditionEvidenceComponent parseConditionConditionEvidenceComponent(XmlPullParser xpp, Condition owner) throws XmlPullParserException, IOException, FHIRFormatError {
5549    Condition.ConditionEvidenceComponent res = new Condition.ConditionEvidenceComponent();
5550    parseBackboneAttributes(xpp, res);
5551    next(xpp);
5552    int eventType = nextNoWhitespace(xpp);
5553    while (eventType != XmlPullParser.END_TAG) {
5554  if (!parseConditionConditionEvidenceComponentContent(eventType, xpp, owner, res))
5555        unknownContent(xpp);
5556      eventType = nextNoWhitespace(xpp);
5557    }
5558    next(xpp);
5559    parseElementClose(res);
5560    return res;
5561  }
5562
5563  protected boolean parseConditionConditionEvidenceComponentContent(int eventType, XmlPullParser xpp, Condition owner, Condition.ConditionEvidenceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5564      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5565        res.getCode().add(parseCodeableConcept(xpp));
5566      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
5567        res.getDetail().add(parseReference(xpp));
5568      } else if (!parseBackboneContent(eventType, xpp, res))
5569        return false;
5570    return true;
5571  }
5572
5573  protected Consent parseConsent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5574    Consent res = new Consent();
5575    parseDomainResourceAttributes(xpp, res);
5576    next(xpp);
5577    int eventType = nextNoWhitespace(xpp);
5578    while (eventType != XmlPullParser.END_TAG) {
5579  if (!parseConsentContent(eventType, xpp, res))
5580        unknownContent(xpp);
5581      eventType = nextNoWhitespace(xpp);
5582    }
5583    next(xpp);
5584    parseElementClose(res);
5585    return res;
5586  }
5587
5588  protected boolean parseConsentContent(int eventType, XmlPullParser xpp, Consent res) throws XmlPullParserException, IOException, FHIRFormatError {
5589      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5590        res.setIdentifier(parseIdentifier(xpp));
5591      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
5592        res.setStatusElement(parseEnumeration(xpp, Consent.ConsentState.NULL, new Consent.ConsentStateEnumFactory()));
5593      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
5594        res.getCategory().add(parseCodeableConcept(xpp));
5595      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
5596        res.setPatient(parseReference(xpp));
5597      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
5598        res.setPeriod(parsePeriod(xpp));
5599      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dateTime")) {
5600        res.setDateTimeElement(parseDateTime(xpp));
5601      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("consentingParty")) {
5602        res.getConsentingParty().add(parseReference(xpp));
5603      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
5604        res.getActor().add(parseConsentConsentActorComponent(xpp, res));
5605      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
5606        res.getAction().add(parseCodeableConcept(xpp));
5607      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("organization")) {
5608        res.getOrganization().add(parseReference(xpp));
5609      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "source")) {
5610        res.setSource(parseType("source", xpp));
5611      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("policy")) {
5612        res.getPolicy().add(parseConsentConsentPolicyComponent(xpp, res));
5613      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("policyRule")) {
5614        res.setPolicyRuleElement(parseUri(xpp));
5615      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("securityLabel")) {
5616        res.getSecurityLabel().add(parseCoding(xpp));
5617      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
5618        res.getPurpose().add(parseCoding(xpp));
5619      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dataPeriod")) {
5620        res.setDataPeriod(parsePeriod(xpp));
5621      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("data")) {
5622        res.getData().add(parseConsentConsentDataComponent(xpp, res));
5623      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("except")) {
5624        res.getExcept().add(parseConsentExceptComponent(xpp, res));
5625      } else if (!parseDomainResourceContent(eventType, xpp, res))
5626        return false;
5627    return true;
5628  }
5629
5630  protected Consent.ConsentActorComponent parseConsentConsentActorComponent(XmlPullParser xpp, Consent owner) throws XmlPullParserException, IOException, FHIRFormatError {
5631    Consent.ConsentActorComponent res = new Consent.ConsentActorComponent();
5632    parseBackboneAttributes(xpp, res);
5633    next(xpp);
5634    int eventType = nextNoWhitespace(xpp);
5635    while (eventType != XmlPullParser.END_TAG) {
5636  if (!parseConsentConsentActorComponentContent(eventType, xpp, owner, res))
5637        unknownContent(xpp);
5638      eventType = nextNoWhitespace(xpp);
5639    }
5640    next(xpp);
5641    parseElementClose(res);
5642    return res;
5643  }
5644
5645  protected boolean parseConsentConsentActorComponentContent(int eventType, XmlPullParser xpp, Consent owner, Consent.ConsentActorComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5646      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
5647        res.setRole(parseCodeableConcept(xpp));
5648      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
5649        res.setReference(parseReference(xpp));
5650      } else if (!parseBackboneContent(eventType, xpp, res))
5651        return false;
5652    return true;
5653  }
5654
5655  protected Consent.ConsentPolicyComponent parseConsentConsentPolicyComponent(XmlPullParser xpp, Consent owner) throws XmlPullParserException, IOException, FHIRFormatError {
5656    Consent.ConsentPolicyComponent res = new Consent.ConsentPolicyComponent();
5657    parseBackboneAttributes(xpp, res);
5658    next(xpp);
5659    int eventType = nextNoWhitespace(xpp);
5660    while (eventType != XmlPullParser.END_TAG) {
5661  if (!parseConsentConsentPolicyComponentContent(eventType, xpp, owner, res))
5662        unknownContent(xpp);
5663      eventType = nextNoWhitespace(xpp);
5664    }
5665    next(xpp);
5666    parseElementClose(res);
5667    return res;
5668  }
5669
5670  protected boolean parseConsentConsentPolicyComponentContent(int eventType, XmlPullParser xpp, Consent owner, Consent.ConsentPolicyComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5671      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authority")) {
5672        res.setAuthorityElement(parseUri(xpp));
5673      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("uri")) {
5674        res.setUriElement(parseUri(xpp));
5675      } else if (!parseBackboneContent(eventType, xpp, res))
5676        return false;
5677    return true;
5678  }
5679
5680  protected Consent.ConsentDataComponent parseConsentConsentDataComponent(XmlPullParser xpp, Consent owner) throws XmlPullParserException, IOException, FHIRFormatError {
5681    Consent.ConsentDataComponent res = new Consent.ConsentDataComponent();
5682    parseBackboneAttributes(xpp, res);
5683    next(xpp);
5684    int eventType = nextNoWhitespace(xpp);
5685    while (eventType != XmlPullParser.END_TAG) {
5686  if (!parseConsentConsentDataComponentContent(eventType, xpp, owner, res))
5687        unknownContent(xpp);
5688      eventType = nextNoWhitespace(xpp);
5689    }
5690    next(xpp);
5691    parseElementClose(res);
5692    return res;
5693  }
5694
5695  protected boolean parseConsentConsentDataComponentContent(int eventType, XmlPullParser xpp, Consent owner, Consent.ConsentDataComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5696      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("meaning")) {
5697        res.setMeaningElement(parseEnumeration(xpp, Consent.ConsentDataMeaning.NULL, new Consent.ConsentDataMeaningEnumFactory()));
5698      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
5699        res.setReference(parseReference(xpp));
5700      } else if (!parseBackboneContent(eventType, xpp, res))
5701        return false;
5702    return true;
5703  }
5704
5705  protected Consent.ExceptComponent parseConsentExceptComponent(XmlPullParser xpp, Consent owner) throws XmlPullParserException, IOException, FHIRFormatError {
5706    Consent.ExceptComponent res = new Consent.ExceptComponent();
5707    parseBackboneAttributes(xpp, res);
5708    next(xpp);
5709    int eventType = nextNoWhitespace(xpp);
5710    while (eventType != XmlPullParser.END_TAG) {
5711  if (!parseConsentExceptComponentContent(eventType, xpp, owner, res))
5712        unknownContent(xpp);
5713      eventType = nextNoWhitespace(xpp);
5714    }
5715    next(xpp);
5716    parseElementClose(res);
5717    return res;
5718  }
5719
5720  protected boolean parseConsentExceptComponentContent(int eventType, XmlPullParser xpp, Consent owner, Consent.ExceptComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5721      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5722        res.setTypeElement(parseEnumeration(xpp, Consent.ConsentExceptType.NULL, new Consent.ConsentExceptTypeEnumFactory()));
5723      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
5724        res.setPeriod(parsePeriod(xpp));
5725      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
5726        res.getActor().add(parseConsentExceptActorComponent(xpp, owner));
5727      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
5728        res.getAction().add(parseCodeableConcept(xpp));
5729      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("securityLabel")) {
5730        res.getSecurityLabel().add(parseCoding(xpp));
5731      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
5732        res.getPurpose().add(parseCoding(xpp));
5733      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("class")) {
5734        res.getClass_().add(parseCoding(xpp));
5735      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5736        res.getCode().add(parseCoding(xpp));
5737      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dataPeriod")) {
5738        res.setDataPeriod(parsePeriod(xpp));
5739      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("data")) {
5740        res.getData().add(parseConsentExceptDataComponent(xpp, owner));
5741      } else if (!parseBackboneContent(eventType, xpp, res))
5742        return false;
5743    return true;
5744  }
5745
5746  protected Consent.ExceptActorComponent parseConsentExceptActorComponent(XmlPullParser xpp, Consent owner) throws XmlPullParserException, IOException, FHIRFormatError {
5747    Consent.ExceptActorComponent res = new Consent.ExceptActorComponent();
5748    parseBackboneAttributes(xpp, res);
5749    next(xpp);
5750    int eventType = nextNoWhitespace(xpp);
5751    while (eventType != XmlPullParser.END_TAG) {
5752  if (!parseConsentExceptActorComponentContent(eventType, xpp, owner, res))
5753        unknownContent(xpp);
5754      eventType = nextNoWhitespace(xpp);
5755    }
5756    next(xpp);
5757    parseElementClose(res);
5758    return res;
5759  }
5760
5761  protected boolean parseConsentExceptActorComponentContent(int eventType, XmlPullParser xpp, Consent owner, Consent.ExceptActorComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5762      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
5763        res.setRole(parseCodeableConcept(xpp));
5764      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
5765        res.setReference(parseReference(xpp));
5766      } else if (!parseBackboneContent(eventType, xpp, res))
5767        return false;
5768    return true;
5769  }
5770
5771  protected Consent.ExceptDataComponent parseConsentExceptDataComponent(XmlPullParser xpp, Consent owner) throws XmlPullParserException, IOException, FHIRFormatError {
5772    Consent.ExceptDataComponent res = new Consent.ExceptDataComponent();
5773    parseBackboneAttributes(xpp, res);
5774    next(xpp);
5775    int eventType = nextNoWhitespace(xpp);
5776    while (eventType != XmlPullParser.END_TAG) {
5777  if (!parseConsentExceptDataComponentContent(eventType, xpp, owner, res))
5778        unknownContent(xpp);
5779      eventType = nextNoWhitespace(xpp);
5780    }
5781    next(xpp);
5782    parseElementClose(res);
5783    return res;
5784  }
5785
5786  protected boolean parseConsentExceptDataComponentContent(int eventType, XmlPullParser xpp, Consent owner, Consent.ExceptDataComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5787      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("meaning")) {
5788        res.setMeaningElement(parseEnumeration(xpp, Consent.ConsentDataMeaning.NULL, new Consent.ConsentDataMeaningEnumFactory()));
5789      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
5790        res.setReference(parseReference(xpp));
5791      } else if (!parseBackboneContent(eventType, xpp, res))
5792        return false;
5793    return true;
5794  }
5795
5796  protected Contract parseContract(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5797    Contract res = new Contract();
5798    parseDomainResourceAttributes(xpp, res);
5799    next(xpp);
5800    int eventType = nextNoWhitespace(xpp);
5801    while (eventType != XmlPullParser.END_TAG) {
5802  if (!parseContractContent(eventType, xpp, res))
5803        unknownContent(xpp);
5804      eventType = nextNoWhitespace(xpp);
5805    }
5806    next(xpp);
5807    parseElementClose(res);
5808    return res;
5809  }
5810
5811  protected boolean parseContractContent(int eventType, XmlPullParser xpp, Contract res) throws XmlPullParserException, IOException, FHIRFormatError {
5812      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5813        res.setIdentifier(parseIdentifier(xpp));
5814      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
5815        res.setStatusElement(parseEnumeration(xpp, Contract.ContractStatus.NULL, new Contract.ContractStatusEnumFactory()));
5816      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("issued")) {
5817        res.setIssuedElement(parseDateTime(xpp));
5818      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("applies")) {
5819        res.setApplies(parsePeriod(xpp));
5820      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
5821        res.getSubject().add(parseReference(xpp));
5822      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("topic")) {
5823        res.getTopic().add(parseReference(xpp));
5824      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authority")) {
5825        res.getAuthority().add(parseReference(xpp));
5826      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("domain")) {
5827        res.getDomain().add(parseReference(xpp));
5828      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5829        res.setType(parseCodeableConcept(xpp));
5830      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subType")) {
5831        res.getSubType().add(parseCodeableConcept(xpp));
5832      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
5833        res.getAction().add(parseCodeableConcept(xpp));
5834      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actionReason")) {
5835        res.getActionReason().add(parseCodeableConcept(xpp));
5836      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("decisionType")) {
5837        res.setDecisionType(parseCodeableConcept(xpp));
5838      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contentDerivative")) {
5839        res.setContentDerivative(parseCodeableConcept(xpp));
5840      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("securityLabel")) {
5841        res.getSecurityLabel().add(parseCoding(xpp));
5842      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("agent")) {
5843        res.getAgent().add(parseContractAgentComponent(xpp, res));
5844      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("signer")) {
5845        res.getSigner().add(parseContractSignatoryComponent(xpp, res));
5846      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valuedItem")) {
5847        res.getValuedItem().add(parseContractValuedItemComponent(xpp, res));
5848      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("term")) {
5849        res.getTerm().add(parseContractTermComponent(xpp, res));
5850      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "binding")) {
5851        res.setBinding(parseType("binding", xpp));
5852      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("friendly")) {
5853        res.getFriendly().add(parseContractFriendlyLanguageComponent(xpp, res));
5854      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("legal")) {
5855        res.getLegal().add(parseContractLegalLanguageComponent(xpp, res));
5856      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rule")) {
5857        res.getRule().add(parseContractComputableLanguageComponent(xpp, res));
5858      } else if (!parseDomainResourceContent(eventType, xpp, res))
5859        return false;
5860    return true;
5861  }
5862
5863  protected Contract.AgentComponent parseContractAgentComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
5864    Contract.AgentComponent res = new Contract.AgentComponent();
5865    parseBackboneAttributes(xpp, res);
5866    next(xpp);
5867    int eventType = nextNoWhitespace(xpp);
5868    while (eventType != XmlPullParser.END_TAG) {
5869  if (!parseContractAgentComponentContent(eventType, xpp, owner, res))
5870        unknownContent(xpp);
5871      eventType = nextNoWhitespace(xpp);
5872    }
5873    next(xpp);
5874    parseElementClose(res);
5875    return res;
5876  }
5877
5878  protected boolean parseContractAgentComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.AgentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5879      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
5880        res.setActor(parseReference(xpp));
5881      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
5882        res.getRole().add(parseCodeableConcept(xpp));
5883      } else if (!parseBackboneContent(eventType, xpp, res))
5884        return false;
5885    return true;
5886  }
5887
5888  protected Contract.SignatoryComponent parseContractSignatoryComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
5889    Contract.SignatoryComponent res = new Contract.SignatoryComponent();
5890    parseBackboneAttributes(xpp, res);
5891    next(xpp);
5892    int eventType = nextNoWhitespace(xpp);
5893    while (eventType != XmlPullParser.END_TAG) {
5894  if (!parseContractSignatoryComponentContent(eventType, xpp, owner, res))
5895        unknownContent(xpp);
5896      eventType = nextNoWhitespace(xpp);
5897    }
5898    next(xpp);
5899    parseElementClose(res);
5900    return res;
5901  }
5902
5903  protected boolean parseContractSignatoryComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.SignatoryComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5904      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5905        res.setType(parseCoding(xpp));
5906      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("party")) {
5907        res.setParty(parseReference(xpp));
5908      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("signature")) {
5909        res.getSignature().add(parseSignature(xpp));
5910      } else if (!parseBackboneContent(eventType, xpp, res))
5911        return false;
5912    return true;
5913  }
5914
5915  protected Contract.ValuedItemComponent parseContractValuedItemComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
5916    Contract.ValuedItemComponent res = new Contract.ValuedItemComponent();
5917    parseBackboneAttributes(xpp, res);
5918    next(xpp);
5919    int eventType = nextNoWhitespace(xpp);
5920    while (eventType != XmlPullParser.END_TAG) {
5921  if (!parseContractValuedItemComponentContent(eventType, xpp, owner, res))
5922        unknownContent(xpp);
5923      eventType = nextNoWhitespace(xpp);
5924    }
5925    next(xpp);
5926    parseElementClose(res);
5927    return res;
5928  }
5929
5930  protected boolean parseContractValuedItemComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.ValuedItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5931      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "entity")) {
5932        res.setEntity(parseType("entity", xpp));
5933      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5934        res.setIdentifier(parseIdentifier(xpp));
5935      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("effectiveTime")) {
5936        res.setEffectiveTimeElement(parseDateTime(xpp));
5937      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
5938        res.setQuantity(parseSimpleQuantity(xpp));
5939      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
5940        res.setUnitPrice(parseMoney(xpp));
5941      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
5942        res.setFactorElement(parseDecimal(xpp));
5943      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("points")) {
5944        res.setPointsElement(parseDecimal(xpp));
5945      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
5946        res.setNet(parseMoney(xpp));
5947      } else if (!parseBackboneContent(eventType, xpp, res))
5948        return false;
5949    return true;
5950  }
5951
5952  protected Contract.TermComponent parseContractTermComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
5953    Contract.TermComponent res = new Contract.TermComponent();
5954    parseBackboneAttributes(xpp, res);
5955    next(xpp);
5956    int eventType = nextNoWhitespace(xpp);
5957    while (eventType != XmlPullParser.END_TAG) {
5958  if (!parseContractTermComponentContent(eventType, xpp, owner, res))
5959        unknownContent(xpp);
5960      eventType = nextNoWhitespace(xpp);
5961    }
5962    next(xpp);
5963    parseElementClose(res);
5964    return res;
5965  }
5966
5967  protected boolean parseContractTermComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.TermComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5968      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5969        res.setIdentifier(parseIdentifier(xpp));
5970      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("issued")) {
5971        res.setIssuedElement(parseDateTime(xpp));
5972      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("applies")) {
5973        res.setApplies(parsePeriod(xpp));
5974      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5975        res.setType(parseCodeableConcept(xpp));
5976      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subType")) {
5977        res.setSubType(parseCodeableConcept(xpp));
5978      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("topic")) {
5979        res.getTopic().add(parseReference(xpp));
5980      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
5981        res.getAction().add(parseCodeableConcept(xpp));
5982      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actionReason")) {
5983        res.getActionReason().add(parseCodeableConcept(xpp));
5984      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("securityLabel")) {
5985        res.getSecurityLabel().add(parseCoding(xpp));
5986      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("agent")) {
5987        res.getAgent().add(parseContractTermAgentComponent(xpp, owner));
5988      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
5989        res.setTextElement(parseString(xpp));
5990      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valuedItem")) {
5991        res.getValuedItem().add(parseContractTermValuedItemComponent(xpp, owner));
5992      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("group")) {
5993        res.getGroup().add(parseContractTermComponent(xpp, owner));
5994      } else if (!parseBackboneContent(eventType, xpp, res))
5995        return false;
5996    return true;
5997  }
5998
5999  protected Contract.TermAgentComponent parseContractTermAgentComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
6000    Contract.TermAgentComponent res = new Contract.TermAgentComponent();
6001    parseBackboneAttributes(xpp, res);
6002    next(xpp);
6003    int eventType = nextNoWhitespace(xpp);
6004    while (eventType != XmlPullParser.END_TAG) {
6005  if (!parseContractTermAgentComponentContent(eventType, xpp, owner, res))
6006        unknownContent(xpp);
6007      eventType = nextNoWhitespace(xpp);
6008    }
6009    next(xpp);
6010    parseElementClose(res);
6011    return res;
6012  }
6013
6014  protected boolean parseContractTermAgentComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.TermAgentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6015      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
6016        res.setActor(parseReference(xpp));
6017      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
6018        res.getRole().add(parseCodeableConcept(xpp));
6019      } else if (!parseBackboneContent(eventType, xpp, res))
6020        return false;
6021    return true;
6022  }
6023
6024  protected Contract.TermValuedItemComponent parseContractTermValuedItemComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
6025    Contract.TermValuedItemComponent res = new Contract.TermValuedItemComponent();
6026    parseBackboneAttributes(xpp, res);
6027    next(xpp);
6028    int eventType = nextNoWhitespace(xpp);
6029    while (eventType != XmlPullParser.END_TAG) {
6030  if (!parseContractTermValuedItemComponentContent(eventType, xpp, owner, res))
6031        unknownContent(xpp);
6032      eventType = nextNoWhitespace(xpp);
6033    }
6034    next(xpp);
6035    parseElementClose(res);
6036    return res;
6037  }
6038
6039  protected boolean parseContractTermValuedItemComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.TermValuedItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6040      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "entity")) {
6041        res.setEntity(parseType("entity", xpp));
6042      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6043        res.setIdentifier(parseIdentifier(xpp));
6044      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("effectiveTime")) {
6045        res.setEffectiveTimeElement(parseDateTime(xpp));
6046      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
6047        res.setQuantity(parseSimpleQuantity(xpp));
6048      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
6049        res.setUnitPrice(parseMoney(xpp));
6050      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
6051        res.setFactorElement(parseDecimal(xpp));
6052      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("points")) {
6053        res.setPointsElement(parseDecimal(xpp));
6054      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
6055        res.setNet(parseMoney(xpp));
6056      } else if (!parseBackboneContent(eventType, xpp, res))
6057        return false;
6058    return true;
6059  }
6060
6061  protected Contract.FriendlyLanguageComponent parseContractFriendlyLanguageComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
6062    Contract.FriendlyLanguageComponent res = new Contract.FriendlyLanguageComponent();
6063    parseBackboneAttributes(xpp, res);
6064    next(xpp);
6065    int eventType = nextNoWhitespace(xpp);
6066    while (eventType != XmlPullParser.END_TAG) {
6067  if (!parseContractFriendlyLanguageComponentContent(eventType, xpp, owner, res))
6068        unknownContent(xpp);
6069      eventType = nextNoWhitespace(xpp);
6070    }
6071    next(xpp);
6072    parseElementClose(res);
6073    return res;
6074  }
6075
6076  protected boolean parseContractFriendlyLanguageComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.FriendlyLanguageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6077      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "content")) {
6078        res.setContent(parseType("content", xpp));
6079      } else if (!parseBackboneContent(eventType, xpp, res))
6080        return false;
6081    return true;
6082  }
6083
6084  protected Contract.LegalLanguageComponent parseContractLegalLanguageComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
6085    Contract.LegalLanguageComponent res = new Contract.LegalLanguageComponent();
6086    parseBackboneAttributes(xpp, res);
6087    next(xpp);
6088    int eventType = nextNoWhitespace(xpp);
6089    while (eventType != XmlPullParser.END_TAG) {
6090  if (!parseContractLegalLanguageComponentContent(eventType, xpp, owner, res))
6091        unknownContent(xpp);
6092      eventType = nextNoWhitespace(xpp);
6093    }
6094    next(xpp);
6095    parseElementClose(res);
6096    return res;
6097  }
6098
6099  protected boolean parseContractLegalLanguageComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.LegalLanguageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6100      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "content")) {
6101        res.setContent(parseType("content", xpp));
6102      } else if (!parseBackboneContent(eventType, xpp, res))
6103        return false;
6104    return true;
6105  }
6106
6107  protected Contract.ComputableLanguageComponent parseContractComputableLanguageComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
6108    Contract.ComputableLanguageComponent res = new Contract.ComputableLanguageComponent();
6109    parseBackboneAttributes(xpp, res);
6110    next(xpp);
6111    int eventType = nextNoWhitespace(xpp);
6112    while (eventType != XmlPullParser.END_TAG) {
6113  if (!parseContractComputableLanguageComponentContent(eventType, xpp, owner, res))
6114        unknownContent(xpp);
6115      eventType = nextNoWhitespace(xpp);
6116    }
6117    next(xpp);
6118    parseElementClose(res);
6119    return res;
6120  }
6121
6122  protected boolean parseContractComputableLanguageComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.ComputableLanguageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6123      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "content")) {
6124        res.setContent(parseType("content", xpp));
6125      } else if (!parseBackboneContent(eventType, xpp, res))
6126        return false;
6127    return true;
6128  }
6129
6130  protected Coverage parseCoverage(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6131    Coverage res = new Coverage();
6132    parseDomainResourceAttributes(xpp, res);
6133    next(xpp);
6134    int eventType = nextNoWhitespace(xpp);
6135    while (eventType != XmlPullParser.END_TAG) {
6136  if (!parseCoverageContent(eventType, xpp, res))
6137        unknownContent(xpp);
6138      eventType = nextNoWhitespace(xpp);
6139    }
6140    next(xpp);
6141    parseElementClose(res);
6142    return res;
6143  }
6144
6145  protected boolean parseCoverageContent(int eventType, XmlPullParser xpp, Coverage res) throws XmlPullParserException, IOException, FHIRFormatError {
6146      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6147        res.getIdentifier().add(parseIdentifier(xpp));
6148      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6149        res.setStatusElement(parseEnumeration(xpp, Coverage.CoverageStatus.NULL, new Coverage.CoverageStatusEnumFactory()));
6150      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6151        res.setType(parseCodeableConcept(xpp));
6152      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("policyHolder")) {
6153        res.setPolicyHolder(parseReference(xpp));
6154      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subscriber")) {
6155        res.setSubscriber(parseReference(xpp));
6156      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subscriberId")) {
6157        res.setSubscriberIdElement(parseString(xpp));
6158      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("beneficiary")) {
6159        res.setBeneficiary(parseReference(xpp));
6160      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relationship")) {
6161        res.setRelationship(parseCodeableConcept(xpp));
6162      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
6163        res.setPeriod(parsePeriod(xpp));
6164      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payor")) {
6165        res.getPayor().add(parseReference(xpp));
6166      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("grouping")) {
6167        res.setGrouping(parseCoverageGroupComponent(xpp, res));
6168      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dependent")) {
6169        res.setDependentElement(parseString(xpp));
6170      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
6171        res.setSequenceElement(parseString(xpp));
6172      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("order")) {
6173        res.setOrderElement(parsePositiveInt(xpp));
6174      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("network")) {
6175        res.setNetworkElement(parseString(xpp));
6176      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contract")) {
6177        res.getContract().add(parseReference(xpp));
6178      } else if (!parseDomainResourceContent(eventType, xpp, res))
6179        return false;
6180    return true;
6181  }
6182
6183  protected Coverage.GroupComponent parseCoverageGroupComponent(XmlPullParser xpp, Coverage owner) throws XmlPullParserException, IOException, FHIRFormatError {
6184    Coverage.GroupComponent res = new Coverage.GroupComponent();
6185    parseBackboneAttributes(xpp, res);
6186    next(xpp);
6187    int eventType = nextNoWhitespace(xpp);
6188    while (eventType != XmlPullParser.END_TAG) {
6189  if (!parseCoverageGroupComponentContent(eventType, xpp, owner, res))
6190        unknownContent(xpp);
6191      eventType = nextNoWhitespace(xpp);
6192    }
6193    next(xpp);
6194    parseElementClose(res);
6195    return res;
6196  }
6197
6198  protected boolean parseCoverageGroupComponentContent(int eventType, XmlPullParser xpp, Coverage owner, Coverage.GroupComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6199      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("group")) {
6200        res.setGroupElement(parseString(xpp));
6201      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("groupDisplay")) {
6202        res.setGroupDisplayElement(parseString(xpp));
6203      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subGroup")) {
6204        res.setSubGroupElement(parseString(xpp));
6205      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subGroupDisplay")) {
6206        res.setSubGroupDisplayElement(parseString(xpp));
6207      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("plan")) {
6208        res.setPlanElement(parseString(xpp));
6209      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("planDisplay")) {
6210        res.setPlanDisplayElement(parseString(xpp));
6211      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subPlan")) {
6212        res.setSubPlanElement(parseString(xpp));
6213      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subPlanDisplay")) {
6214        res.setSubPlanDisplayElement(parseString(xpp));
6215      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("class")) {
6216        res.setClass_Element(parseString(xpp));
6217      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("classDisplay")) {
6218        res.setClassDisplayElement(parseString(xpp));
6219      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subClass")) {
6220        res.setSubClassElement(parseString(xpp));
6221      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subClassDisplay")) {
6222        res.setSubClassDisplayElement(parseString(xpp));
6223      } else if (!parseBackboneContent(eventType, xpp, res))
6224        return false;
6225    return true;
6226  }
6227
6228  protected DataElement parseDataElement(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6229    DataElement res = new DataElement();
6230    parseDomainResourceAttributes(xpp, res);
6231    next(xpp);
6232    int eventType = nextNoWhitespace(xpp);
6233    while (eventType != XmlPullParser.END_TAG) {
6234  if (!parseDataElementContent(eventType, xpp, res))
6235        unknownContent(xpp);
6236      eventType = nextNoWhitespace(xpp);
6237    }
6238    next(xpp);
6239    parseElementClose(res);
6240    return res;
6241  }
6242
6243  protected boolean parseDataElementContent(int eventType, XmlPullParser xpp, DataElement res) throws XmlPullParserException, IOException, FHIRFormatError {
6244      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
6245        res.setUrlElement(parseUri(xpp));
6246      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6247        res.getIdentifier().add(parseIdentifier(xpp));
6248      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
6249        res.setVersionElement(parseString(xpp));
6250      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6251        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
6252      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
6253        res.setExperimentalElement(parseBoolean(xpp));
6254      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
6255        res.setDateElement(parseDateTime(xpp));
6256      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
6257        res.setPublisherElement(parseString(xpp));
6258      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
6259        res.setNameElement(parseString(xpp));
6260      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
6261        res.setTitleElement(parseString(xpp));
6262      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
6263        res.getContact().add(parseContactDetail(xpp));
6264      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
6265        res.getUseContext().add(parseUsageContext(xpp));
6266      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
6267        res.getJurisdiction().add(parseCodeableConcept(xpp));
6268      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
6269        res.setCopyrightElement(parseMarkdown(xpp));
6270      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("stringency")) {
6271        res.setStringencyElement(parseEnumeration(xpp, DataElement.DataElementStringency.NULL, new DataElement.DataElementStringencyEnumFactory()));
6272      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mapping")) {
6273        res.getMapping().add(parseDataElementDataElementMappingComponent(xpp, res));
6274      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("element")) {
6275        res.getElement().add(parseElementDefinition(xpp));
6276      } else if (!parseDomainResourceContent(eventType, xpp, res))
6277        return false;
6278    return true;
6279  }
6280
6281  protected DataElement.DataElementMappingComponent parseDataElementDataElementMappingComponent(XmlPullParser xpp, DataElement owner) throws XmlPullParserException, IOException, FHIRFormatError {
6282    DataElement.DataElementMappingComponent res = new DataElement.DataElementMappingComponent();
6283    parseBackboneAttributes(xpp, res);
6284    next(xpp);
6285    int eventType = nextNoWhitespace(xpp);
6286    while (eventType != XmlPullParser.END_TAG) {
6287  if (!parseDataElementDataElementMappingComponentContent(eventType, xpp, owner, res))
6288        unknownContent(xpp);
6289      eventType = nextNoWhitespace(xpp);
6290    }
6291    next(xpp);
6292    parseElementClose(res);
6293    return res;
6294  }
6295
6296  protected boolean parseDataElementDataElementMappingComponentContent(int eventType, XmlPullParser xpp, DataElement owner, DataElement.DataElementMappingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6297      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identity")) {
6298        res.setIdentityElement(parseId(xpp));
6299      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("uri")) {
6300        res.setUriElement(parseUri(xpp));
6301      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
6302        res.setNameElement(parseString(xpp));
6303      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
6304        res.setCommentElement(parseString(xpp));
6305      } else if (!parseBackboneContent(eventType, xpp, res))
6306        return false;
6307    return true;
6308  }
6309
6310  protected DetectedIssue parseDetectedIssue(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6311    DetectedIssue res = new DetectedIssue();
6312    parseDomainResourceAttributes(xpp, res);
6313    next(xpp);
6314    int eventType = nextNoWhitespace(xpp);
6315    while (eventType != XmlPullParser.END_TAG) {
6316  if (!parseDetectedIssueContent(eventType, xpp, res))
6317        unknownContent(xpp);
6318      eventType = nextNoWhitespace(xpp);
6319    }
6320    next(xpp);
6321    parseElementClose(res);
6322    return res;
6323  }
6324
6325  protected boolean parseDetectedIssueContent(int eventType, XmlPullParser xpp, DetectedIssue res) throws XmlPullParserException, IOException, FHIRFormatError {
6326      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6327        res.setIdentifier(parseIdentifier(xpp));
6328      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6329        res.setStatusElement(parseEnumeration(xpp, DetectedIssue.DetectedIssueStatus.NULL, new DetectedIssue.DetectedIssueStatusEnumFactory()));
6330      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
6331        res.setCategory(parseCodeableConcept(xpp));
6332      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("severity")) {
6333        res.setSeverityElement(parseEnumeration(xpp, DetectedIssue.DetectedIssueSeverity.NULL, new DetectedIssue.DetectedIssueSeverityEnumFactory()));
6334      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
6335        res.setPatient(parseReference(xpp));
6336      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
6337        res.setDateElement(parseDateTime(xpp));
6338      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
6339        res.setAuthor(parseReference(xpp));
6340      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("implicated")) {
6341        res.getImplicated().add(parseReference(xpp));
6342      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
6343        res.setDetailElement(parseString(xpp));
6344      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
6345        res.setReferenceElement(parseUri(xpp));
6346      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mitigation")) {
6347        res.getMitigation().add(parseDetectedIssueDetectedIssueMitigationComponent(xpp, res));
6348      } else if (!parseDomainResourceContent(eventType, xpp, res))
6349        return false;
6350    return true;
6351  }
6352
6353  protected DetectedIssue.DetectedIssueMitigationComponent parseDetectedIssueDetectedIssueMitigationComponent(XmlPullParser xpp, DetectedIssue owner) throws XmlPullParserException, IOException, FHIRFormatError {
6354    DetectedIssue.DetectedIssueMitigationComponent res = new DetectedIssue.DetectedIssueMitigationComponent();
6355    parseBackboneAttributes(xpp, res);
6356    next(xpp);
6357    int eventType = nextNoWhitespace(xpp);
6358    while (eventType != XmlPullParser.END_TAG) {
6359  if (!parseDetectedIssueDetectedIssueMitigationComponentContent(eventType, xpp, owner, res))
6360        unknownContent(xpp);
6361      eventType = nextNoWhitespace(xpp);
6362    }
6363    next(xpp);
6364    parseElementClose(res);
6365    return res;
6366  }
6367
6368  protected boolean parseDetectedIssueDetectedIssueMitigationComponentContent(int eventType, XmlPullParser xpp, DetectedIssue owner, DetectedIssue.DetectedIssueMitigationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6369      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
6370        res.setAction(parseCodeableConcept(xpp));
6371      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
6372        res.setDateElement(parseDateTime(xpp));
6373      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
6374        res.setAuthor(parseReference(xpp));
6375      } else if (!parseBackboneContent(eventType, xpp, res))
6376        return false;
6377    return true;
6378  }
6379
6380  protected Device parseDevice(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6381    Device res = new Device();
6382    parseDomainResourceAttributes(xpp, res);
6383    next(xpp);
6384    int eventType = nextNoWhitespace(xpp);
6385    while (eventType != XmlPullParser.END_TAG) {
6386  if (!parseDeviceContent(eventType, xpp, res))
6387        unknownContent(xpp);
6388      eventType = nextNoWhitespace(xpp);
6389    }
6390    next(xpp);
6391    parseElementClose(res);
6392    return res;
6393  }
6394
6395  protected boolean parseDeviceContent(int eventType, XmlPullParser xpp, Device res) throws XmlPullParserException, IOException, FHIRFormatError {
6396      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6397        res.getIdentifier().add(parseIdentifier(xpp));
6398      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("udi")) {
6399        res.setUdi(parseDeviceDeviceUdiComponent(xpp, res));
6400      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6401        res.setStatusElement(parseEnumeration(xpp, Device.FHIRDeviceStatus.NULL, new Device.FHIRDeviceStatusEnumFactory()));
6402      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6403        res.setType(parseCodeableConcept(xpp));
6404      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lotNumber")) {
6405        res.setLotNumberElement(parseString(xpp));
6406      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("manufacturer")) {
6407        res.setManufacturerElement(parseString(xpp));
6408      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("manufactureDate")) {
6409        res.setManufactureDateElement(parseDateTime(xpp));
6410      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expirationDate")) {
6411        res.setExpirationDateElement(parseDateTime(xpp));
6412      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("model")) {
6413        res.setModelElement(parseString(xpp));
6414      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
6415        res.setVersionElement(parseString(xpp));
6416      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
6417        res.setPatient(parseReference(xpp));
6418      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("owner")) {
6419        res.setOwner(parseReference(xpp));
6420      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
6421        res.getContact().add(parseContactPoint(xpp));
6422      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
6423        res.setLocation(parseReference(xpp));
6424      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
6425        res.setUrlElement(parseUri(xpp));
6426      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
6427        res.getNote().add(parseAnnotation(xpp));
6428      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("safety")) {
6429        res.getSafety().add(parseCodeableConcept(xpp));
6430      } else if (!parseDomainResourceContent(eventType, xpp, res))
6431        return false;
6432    return true;
6433  }
6434
6435  protected Device.DeviceUdiComponent parseDeviceDeviceUdiComponent(XmlPullParser xpp, Device owner) throws XmlPullParserException, IOException, FHIRFormatError {
6436    Device.DeviceUdiComponent res = new Device.DeviceUdiComponent();
6437    parseBackboneAttributes(xpp, res);
6438    next(xpp);
6439    int eventType = nextNoWhitespace(xpp);
6440    while (eventType != XmlPullParser.END_TAG) {
6441  if (!parseDeviceDeviceUdiComponentContent(eventType, xpp, owner, res))
6442        unknownContent(xpp);
6443      eventType = nextNoWhitespace(xpp);
6444    }
6445    next(xpp);
6446    parseElementClose(res);
6447    return res;
6448  }
6449
6450  protected boolean parseDeviceDeviceUdiComponentContent(int eventType, XmlPullParser xpp, Device owner, Device.DeviceUdiComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6451      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("deviceIdentifier")) {
6452        res.setDeviceIdentifierElement(parseString(xpp));
6453      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
6454        res.setNameElement(parseString(xpp));
6455      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
6456        res.setJurisdictionElement(parseUri(xpp));
6457      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("carrierHRF")) {
6458        res.setCarrierHRFElement(parseString(xpp));
6459      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("carrierAIDC")) {
6460        res.setCarrierAIDCElement(parseBase64Binary(xpp));
6461      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("issuer")) {
6462        res.setIssuerElement(parseUri(xpp));
6463      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("entryType")) {
6464        res.setEntryTypeElement(parseEnumeration(xpp, Device.UDIEntryType.NULL, new Device.UDIEntryTypeEnumFactory()));
6465      } else if (!parseBackboneContent(eventType, xpp, res))
6466        return false;
6467    return true;
6468  }
6469
6470  protected DeviceComponent parseDeviceComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6471    DeviceComponent res = new DeviceComponent();
6472    parseDomainResourceAttributes(xpp, res);
6473    next(xpp);
6474    int eventType = nextNoWhitespace(xpp);
6475    while (eventType != XmlPullParser.END_TAG) {
6476  if (!parseDeviceComponentContent(eventType, xpp, res))
6477        unknownContent(xpp);
6478      eventType = nextNoWhitespace(xpp);
6479    }
6480    next(xpp);
6481    parseElementClose(res);
6482    return res;
6483  }
6484
6485  protected boolean parseDeviceComponentContent(int eventType, XmlPullParser xpp, DeviceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6486      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6487        res.setIdentifier(parseIdentifier(xpp));
6488      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6489        res.setType(parseCodeableConcept(xpp));
6490      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastSystemChange")) {
6491        res.setLastSystemChangeElement(parseInstant(xpp));
6492      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
6493        res.setSource(parseReference(xpp));
6494      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("parent")) {
6495        res.setParent(parseReference(xpp));
6496      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operationalStatus")) {
6497        res.getOperationalStatus().add(parseCodeableConcept(xpp));
6498      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("parameterGroup")) {
6499        res.setParameterGroup(parseCodeableConcept(xpp));
6500      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("measurementPrinciple")) {
6501        res.setMeasurementPrincipleElement(parseEnumeration(xpp, DeviceComponent.MeasmntPrinciple.NULL, new DeviceComponent.MeasmntPrincipleEnumFactory()));
6502      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productionSpecification")) {
6503        res.getProductionSpecification().add(parseDeviceComponentDeviceComponentProductionSpecificationComponent(xpp, res));
6504      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("languageCode")) {
6505        res.setLanguageCode(parseCodeableConcept(xpp));
6506      } else if (!parseDomainResourceContent(eventType, xpp, res))
6507        return false;
6508    return true;
6509  }
6510
6511  protected DeviceComponent.DeviceComponentProductionSpecificationComponent parseDeviceComponentDeviceComponentProductionSpecificationComponent(XmlPullParser xpp, DeviceComponent owner) throws XmlPullParserException, IOException, FHIRFormatError {
6512    DeviceComponent.DeviceComponentProductionSpecificationComponent res = new DeviceComponent.DeviceComponentProductionSpecificationComponent();
6513    parseBackboneAttributes(xpp, res);
6514    next(xpp);
6515    int eventType = nextNoWhitespace(xpp);
6516    while (eventType != XmlPullParser.END_TAG) {
6517  if (!parseDeviceComponentDeviceComponentProductionSpecificationComponentContent(eventType, xpp, owner, res))
6518        unknownContent(xpp);
6519      eventType = nextNoWhitespace(xpp);
6520    }
6521    next(xpp);
6522    parseElementClose(res);
6523    return res;
6524  }
6525
6526  protected boolean parseDeviceComponentDeviceComponentProductionSpecificationComponentContent(int eventType, XmlPullParser xpp, DeviceComponent owner, DeviceComponent.DeviceComponentProductionSpecificationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6527      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specType")) {
6528        res.setSpecType(parseCodeableConcept(xpp));
6529      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("componentId")) {
6530        res.setComponentId(parseIdentifier(xpp));
6531      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productionSpec")) {
6532        res.setProductionSpecElement(parseString(xpp));
6533      } else if (!parseBackboneContent(eventType, xpp, res))
6534        return false;
6535    return true;
6536  }
6537
6538  protected DeviceMetric parseDeviceMetric(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6539    DeviceMetric res = new DeviceMetric();
6540    parseDomainResourceAttributes(xpp, res);
6541    next(xpp);
6542    int eventType = nextNoWhitespace(xpp);
6543    while (eventType != XmlPullParser.END_TAG) {
6544  if (!parseDeviceMetricContent(eventType, xpp, res))
6545        unknownContent(xpp);
6546      eventType = nextNoWhitespace(xpp);
6547    }
6548    next(xpp);
6549    parseElementClose(res);
6550    return res;
6551  }
6552
6553  protected boolean parseDeviceMetricContent(int eventType, XmlPullParser xpp, DeviceMetric res) throws XmlPullParserException, IOException, FHIRFormatError {
6554      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6555        res.setIdentifier(parseIdentifier(xpp));
6556      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6557        res.setType(parseCodeableConcept(xpp));
6558      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unit")) {
6559        res.setUnit(parseCodeableConcept(xpp));
6560      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
6561        res.setSource(parseReference(xpp));
6562      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("parent")) {
6563        res.setParent(parseReference(xpp));
6564      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operationalStatus")) {
6565        res.setOperationalStatusElement(parseEnumeration(xpp, DeviceMetric.DeviceMetricOperationalStatus.NULL, new DeviceMetric.DeviceMetricOperationalStatusEnumFactory()));
6566      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("color")) {
6567        res.setColorElement(parseEnumeration(xpp, DeviceMetric.DeviceMetricColor.NULL, new DeviceMetric.DeviceMetricColorEnumFactory()));
6568      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
6569        res.setCategoryElement(parseEnumeration(xpp, DeviceMetric.DeviceMetricCategory.NULL, new DeviceMetric.DeviceMetricCategoryEnumFactory()));
6570      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("measurementPeriod")) {
6571        res.setMeasurementPeriod(parseTiming(xpp));
6572      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("calibration")) {
6573        res.getCalibration().add(parseDeviceMetricDeviceMetricCalibrationComponent(xpp, res));
6574      } else if (!parseDomainResourceContent(eventType, xpp, res))
6575        return false;
6576    return true;
6577  }
6578
6579  protected DeviceMetric.DeviceMetricCalibrationComponent parseDeviceMetricDeviceMetricCalibrationComponent(XmlPullParser xpp, DeviceMetric owner) throws XmlPullParserException, IOException, FHIRFormatError {
6580    DeviceMetric.DeviceMetricCalibrationComponent res = new DeviceMetric.DeviceMetricCalibrationComponent();
6581    parseBackboneAttributes(xpp, res);
6582    next(xpp);
6583    int eventType = nextNoWhitespace(xpp);
6584    while (eventType != XmlPullParser.END_TAG) {
6585  if (!parseDeviceMetricDeviceMetricCalibrationComponentContent(eventType, xpp, owner, res))
6586        unknownContent(xpp);
6587      eventType = nextNoWhitespace(xpp);
6588    }
6589    next(xpp);
6590    parseElementClose(res);
6591    return res;
6592  }
6593
6594  protected boolean parseDeviceMetricDeviceMetricCalibrationComponentContent(int eventType, XmlPullParser xpp, DeviceMetric owner, DeviceMetric.DeviceMetricCalibrationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6595      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6596        res.setTypeElement(parseEnumeration(xpp, DeviceMetric.DeviceMetricCalibrationType.NULL, new DeviceMetric.DeviceMetricCalibrationTypeEnumFactory()));
6597      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("state")) {
6598        res.setStateElement(parseEnumeration(xpp, DeviceMetric.DeviceMetricCalibrationState.NULL, new DeviceMetric.DeviceMetricCalibrationStateEnumFactory()));
6599      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("time")) {
6600        res.setTimeElement(parseInstant(xpp));
6601      } else if (!parseBackboneContent(eventType, xpp, res))
6602        return false;
6603    return true;
6604  }
6605
6606  protected DeviceRequest parseDeviceRequest(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6607    DeviceRequest res = new DeviceRequest();
6608    parseDomainResourceAttributes(xpp, res);
6609    next(xpp);
6610    int eventType = nextNoWhitespace(xpp);
6611    while (eventType != XmlPullParser.END_TAG) {
6612  if (!parseDeviceRequestContent(eventType, xpp, res))
6613        unknownContent(xpp);
6614      eventType = nextNoWhitespace(xpp);
6615    }
6616    next(xpp);
6617    parseElementClose(res);
6618    return res;
6619  }
6620
6621  protected boolean parseDeviceRequestContent(int eventType, XmlPullParser xpp, DeviceRequest res) throws XmlPullParserException, IOException, FHIRFormatError {
6622      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6623        res.getIdentifier().add(parseIdentifier(xpp));
6624      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
6625        res.getDefinition().add(parseReference(xpp));
6626      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
6627        res.getBasedOn().add(parseReference(xpp));
6628      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priorRequest")) {
6629        res.getPriorRequest().add(parseReference(xpp));
6630      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("groupIdentifier")) {
6631        res.setGroupIdentifier(parseIdentifier(xpp));
6632      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6633        res.setStatusElement(parseEnumeration(xpp, DeviceRequest.DeviceRequestStatus.NULL, new DeviceRequest.DeviceRequestStatusEnumFactory()));
6634      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("intent")) {
6635        res.setIntent(parseCodeableConcept(xpp));
6636      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
6637        res.setPriorityElement(parseEnumeration(xpp, DeviceRequest.RequestPriority.NULL, new DeviceRequest.RequestPriorityEnumFactory()));
6638      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "code")) {
6639        res.setCode(parseType("code", xpp));
6640      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
6641        res.setSubject(parseReference(xpp));
6642      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
6643        res.setContext(parseReference(xpp));
6644      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "occurrence")) {
6645        res.setOccurrence(parseType("occurrence", xpp));
6646      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authoredOn")) {
6647        res.setAuthoredOnElement(parseDateTime(xpp));
6648      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requester")) {
6649        res.setRequester(parseDeviceRequestDeviceRequestRequesterComponent(xpp, res));
6650      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performerType")) {
6651        res.setPerformerType(parseCodeableConcept(xpp));
6652      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performer")) {
6653        res.setPerformer(parseReference(xpp));
6654      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonCode")) {
6655        res.getReasonCode().add(parseCodeableConcept(xpp));
6656      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonReference")) {
6657        res.getReasonReference().add(parseReference(xpp));
6658      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInfo")) {
6659        res.getSupportingInfo().add(parseReference(xpp));
6660      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
6661        res.getNote().add(parseAnnotation(xpp));
6662      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relevantHistory")) {
6663        res.getRelevantHistory().add(parseReference(xpp));
6664      } else if (!parseDomainResourceContent(eventType, xpp, res))
6665        return false;
6666    return true;
6667  }
6668
6669  protected DeviceRequest.DeviceRequestRequesterComponent parseDeviceRequestDeviceRequestRequesterComponent(XmlPullParser xpp, DeviceRequest owner) throws XmlPullParserException, IOException, FHIRFormatError {
6670    DeviceRequest.DeviceRequestRequesterComponent res = new DeviceRequest.DeviceRequestRequesterComponent();
6671    parseBackboneAttributes(xpp, res);
6672    next(xpp);
6673    int eventType = nextNoWhitespace(xpp);
6674    while (eventType != XmlPullParser.END_TAG) {
6675  if (!parseDeviceRequestDeviceRequestRequesterComponentContent(eventType, xpp, owner, res))
6676        unknownContent(xpp);
6677      eventType = nextNoWhitespace(xpp);
6678    }
6679    next(xpp);
6680    parseElementClose(res);
6681    return res;
6682  }
6683
6684  protected boolean parseDeviceRequestDeviceRequestRequesterComponentContent(int eventType, XmlPullParser xpp, DeviceRequest owner, DeviceRequest.DeviceRequestRequesterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6685      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("agent")) {
6686        res.setAgent(parseReference(xpp));
6687      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onBehalfOf")) {
6688        res.setOnBehalfOf(parseReference(xpp));
6689      } else if (!parseBackboneContent(eventType, xpp, res))
6690        return false;
6691    return true;
6692  }
6693
6694  protected DeviceUseStatement parseDeviceUseStatement(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6695    DeviceUseStatement res = new DeviceUseStatement();
6696    parseDomainResourceAttributes(xpp, res);
6697    next(xpp);
6698    int eventType = nextNoWhitespace(xpp);
6699    while (eventType != XmlPullParser.END_TAG) {
6700  if (!parseDeviceUseStatementContent(eventType, xpp, res))
6701        unknownContent(xpp);
6702      eventType = nextNoWhitespace(xpp);
6703    }
6704    next(xpp);
6705    parseElementClose(res);
6706    return res;
6707  }
6708
6709  protected boolean parseDeviceUseStatementContent(int eventType, XmlPullParser xpp, DeviceUseStatement res) throws XmlPullParserException, IOException, FHIRFormatError {
6710      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6711        res.getIdentifier().add(parseIdentifier(xpp));
6712      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6713        res.setStatusElement(parseEnumeration(xpp, DeviceUseStatement.DeviceUseStatementStatus.NULL, new DeviceUseStatement.DeviceUseStatementStatusEnumFactory()));
6714      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
6715        res.setSubject(parseReference(xpp));
6716      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("whenUsed")) {
6717        res.setWhenUsed(parsePeriod(xpp));
6718      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "timing")) {
6719        res.setTiming(parseType("timing", xpp));
6720      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recordedOn")) {
6721        res.setRecordedOnElement(parseDateTime(xpp));
6722      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
6723        res.setSource(parseReference(xpp));
6724      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("device")) {
6725        res.setDevice(parseReference(xpp));
6726      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("indication")) {
6727        res.getIndication().add(parseCodeableConcept(xpp));
6728      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodySite")) {
6729        res.setBodySite(parseCodeableConcept(xpp));
6730      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
6731        res.getNote().add(parseAnnotation(xpp));
6732      } else if (!parseDomainResourceContent(eventType, xpp, res))
6733        return false;
6734    return true;
6735  }
6736
6737  protected DiagnosticReport parseDiagnosticReport(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6738    DiagnosticReport res = new DiagnosticReport();
6739    parseDomainResourceAttributes(xpp, res);
6740    next(xpp);
6741    int eventType = nextNoWhitespace(xpp);
6742    while (eventType != XmlPullParser.END_TAG) {
6743  if (!parseDiagnosticReportContent(eventType, xpp, res))
6744        unknownContent(xpp);
6745      eventType = nextNoWhitespace(xpp);
6746    }
6747    next(xpp);
6748    parseElementClose(res);
6749    return res;
6750  }
6751
6752  protected boolean parseDiagnosticReportContent(int eventType, XmlPullParser xpp, DiagnosticReport res) throws XmlPullParserException, IOException, FHIRFormatError {
6753      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6754        res.getIdentifier().add(parseIdentifier(xpp));
6755      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
6756        res.getBasedOn().add(parseReference(xpp));
6757      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6758        res.setStatusElement(parseEnumeration(xpp, DiagnosticReport.DiagnosticReportStatus.NULL, new DiagnosticReport.DiagnosticReportStatusEnumFactory()));
6759      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
6760        res.setCategory(parseCodeableConcept(xpp));
6761      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
6762        res.setCode(parseCodeableConcept(xpp));
6763      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
6764        res.setSubject(parseReference(xpp));
6765      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
6766        res.setContext(parseReference(xpp));
6767      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "effective")) {
6768        res.setEffective(parseType("effective", xpp));
6769      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("issued")) {
6770        res.setIssuedElement(parseInstant(xpp));
6771      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performer")) {
6772        res.getPerformer().add(parseDiagnosticReportDiagnosticReportPerformerComponent(xpp, res));
6773      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specimen")) {
6774        res.getSpecimen().add(parseReference(xpp));
6775      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("result")) {
6776        res.getResult().add(parseReference(xpp));
6777      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("imagingStudy")) {
6778        res.getImagingStudy().add(parseReference(xpp));
6779      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("image")) {
6780        res.getImage().add(parseDiagnosticReportDiagnosticReportImageComponent(xpp, res));
6781      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("conclusion")) {
6782        res.setConclusionElement(parseString(xpp));
6783      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("codedDiagnosis")) {
6784        res.getCodedDiagnosis().add(parseCodeableConcept(xpp));
6785      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("presentedForm")) {
6786        res.getPresentedForm().add(parseAttachment(xpp));
6787      } else if (!parseDomainResourceContent(eventType, xpp, res))
6788        return false;
6789    return true;
6790  }
6791
6792  protected DiagnosticReport.DiagnosticReportPerformerComponent parseDiagnosticReportDiagnosticReportPerformerComponent(XmlPullParser xpp, DiagnosticReport owner) throws XmlPullParserException, IOException, FHIRFormatError {
6793    DiagnosticReport.DiagnosticReportPerformerComponent res = new DiagnosticReport.DiagnosticReportPerformerComponent();
6794    parseBackboneAttributes(xpp, res);
6795    next(xpp);
6796    int eventType = nextNoWhitespace(xpp);
6797    while (eventType != XmlPullParser.END_TAG) {
6798  if (!parseDiagnosticReportDiagnosticReportPerformerComponentContent(eventType, xpp, owner, res))
6799        unknownContent(xpp);
6800      eventType = nextNoWhitespace(xpp);
6801    }
6802    next(xpp);
6803    parseElementClose(res);
6804    return res;
6805  }
6806
6807  protected boolean parseDiagnosticReportDiagnosticReportPerformerComponentContent(int eventType, XmlPullParser xpp, DiagnosticReport owner, DiagnosticReport.DiagnosticReportPerformerComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6808      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
6809        res.setRole(parseCodeableConcept(xpp));
6810      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
6811        res.setActor(parseReference(xpp));
6812      } else if (!parseBackboneContent(eventType, xpp, res))
6813        return false;
6814    return true;
6815  }
6816
6817  protected DiagnosticReport.DiagnosticReportImageComponent parseDiagnosticReportDiagnosticReportImageComponent(XmlPullParser xpp, DiagnosticReport owner) throws XmlPullParserException, IOException, FHIRFormatError {
6818    DiagnosticReport.DiagnosticReportImageComponent res = new DiagnosticReport.DiagnosticReportImageComponent();
6819    parseBackboneAttributes(xpp, res);
6820    next(xpp);
6821    int eventType = nextNoWhitespace(xpp);
6822    while (eventType != XmlPullParser.END_TAG) {
6823  if (!parseDiagnosticReportDiagnosticReportImageComponentContent(eventType, xpp, owner, res))
6824        unknownContent(xpp);
6825      eventType = nextNoWhitespace(xpp);
6826    }
6827    next(xpp);
6828    parseElementClose(res);
6829    return res;
6830  }
6831
6832  protected boolean parseDiagnosticReportDiagnosticReportImageComponentContent(int eventType, XmlPullParser xpp, DiagnosticReport owner, DiagnosticReport.DiagnosticReportImageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6833      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
6834        res.setCommentElement(parseString(xpp));
6835      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("link")) {
6836        res.setLink(parseReference(xpp));
6837      } else if (!parseBackboneContent(eventType, xpp, res))
6838        return false;
6839    return true;
6840  }
6841
6842  protected DocumentManifest parseDocumentManifest(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6843    DocumentManifest res = new DocumentManifest();
6844    parseDomainResourceAttributes(xpp, res);
6845    next(xpp);
6846    int eventType = nextNoWhitespace(xpp);
6847    while (eventType != XmlPullParser.END_TAG) {
6848  if (!parseDocumentManifestContent(eventType, xpp, res))
6849        unknownContent(xpp);
6850      eventType = nextNoWhitespace(xpp);
6851    }
6852    next(xpp);
6853    parseElementClose(res);
6854    return res;
6855  }
6856
6857  protected boolean parseDocumentManifestContent(int eventType, XmlPullParser xpp, DocumentManifest res) throws XmlPullParserException, IOException, FHIRFormatError {
6858      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("masterIdentifier")) {
6859        res.setMasterIdentifier(parseIdentifier(xpp));
6860      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6861        res.getIdentifier().add(parseIdentifier(xpp));
6862      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6863        res.setStatusElement(parseEnumeration(xpp, Enumerations.DocumentReferenceStatus.NULL, new Enumerations.DocumentReferenceStatusEnumFactory()));
6864      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6865        res.setType(parseCodeableConcept(xpp));
6866      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
6867        res.setSubject(parseReference(xpp));
6868      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
6869        res.setCreatedElement(parseDateTime(xpp));
6870      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
6871        res.getAuthor().add(parseReference(xpp));
6872      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recipient")) {
6873        res.getRecipient().add(parseReference(xpp));
6874      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
6875        res.setSourceElement(parseUri(xpp));
6876      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
6877        res.setDescriptionElement(parseString(xpp));
6878      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("content")) {
6879        res.getContent().add(parseDocumentManifestDocumentManifestContentComponent(xpp, res));
6880      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("related")) {
6881        res.getRelated().add(parseDocumentManifestDocumentManifestRelatedComponent(xpp, res));
6882      } else if (!parseDomainResourceContent(eventType, xpp, res))
6883        return false;
6884    return true;
6885  }
6886
6887  protected DocumentManifest.DocumentManifestContentComponent parseDocumentManifestDocumentManifestContentComponent(XmlPullParser xpp, DocumentManifest owner) throws XmlPullParserException, IOException, FHIRFormatError {
6888    DocumentManifest.DocumentManifestContentComponent res = new DocumentManifest.DocumentManifestContentComponent();
6889    parseBackboneAttributes(xpp, res);
6890    next(xpp);
6891    int eventType = nextNoWhitespace(xpp);
6892    while (eventType != XmlPullParser.END_TAG) {
6893  if (!parseDocumentManifestDocumentManifestContentComponentContent(eventType, xpp, owner, res))
6894        unknownContent(xpp);
6895      eventType = nextNoWhitespace(xpp);
6896    }
6897    next(xpp);
6898    parseElementClose(res);
6899    return res;
6900  }
6901
6902  protected boolean parseDocumentManifestDocumentManifestContentComponentContent(int eventType, XmlPullParser xpp, DocumentManifest owner, DocumentManifest.DocumentManifestContentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6903      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "p")) {
6904        res.setP(parseType("p", xpp));
6905      } else if (!parseBackboneContent(eventType, xpp, res))
6906        return false;
6907    return true;
6908  }
6909
6910  protected DocumentManifest.DocumentManifestRelatedComponent parseDocumentManifestDocumentManifestRelatedComponent(XmlPullParser xpp, DocumentManifest owner) throws XmlPullParserException, IOException, FHIRFormatError {
6911    DocumentManifest.DocumentManifestRelatedComponent res = new DocumentManifest.DocumentManifestRelatedComponent();
6912    parseBackboneAttributes(xpp, res);
6913    next(xpp);
6914    int eventType = nextNoWhitespace(xpp);
6915    while (eventType != XmlPullParser.END_TAG) {
6916  if (!parseDocumentManifestDocumentManifestRelatedComponentContent(eventType, xpp, owner, res))
6917        unknownContent(xpp);
6918      eventType = nextNoWhitespace(xpp);
6919    }
6920    next(xpp);
6921    parseElementClose(res);
6922    return res;
6923  }
6924
6925  protected boolean parseDocumentManifestDocumentManifestRelatedComponentContent(int eventType, XmlPullParser xpp, DocumentManifest owner, DocumentManifest.DocumentManifestRelatedComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6926      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6927        res.setIdentifier(parseIdentifier(xpp));
6928      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ref")) {
6929        res.setRef(parseReference(xpp));
6930      } else if (!parseBackboneContent(eventType, xpp, res))
6931        return false;
6932    return true;
6933  }
6934
6935  protected DocumentReference parseDocumentReference(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6936    DocumentReference res = new DocumentReference();
6937    parseDomainResourceAttributes(xpp, res);
6938    next(xpp);
6939    int eventType = nextNoWhitespace(xpp);
6940    while (eventType != XmlPullParser.END_TAG) {
6941  if (!parseDocumentReferenceContent(eventType, xpp, res))
6942        unknownContent(xpp);
6943      eventType = nextNoWhitespace(xpp);
6944    }
6945    next(xpp);
6946    parseElementClose(res);
6947    return res;
6948  }
6949
6950  protected boolean parseDocumentReferenceContent(int eventType, XmlPullParser xpp, DocumentReference res) throws XmlPullParserException, IOException, FHIRFormatError {
6951      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("masterIdentifier")) {
6952        res.setMasterIdentifier(parseIdentifier(xpp));
6953      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6954        res.getIdentifier().add(parseIdentifier(xpp));
6955      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6956        res.setStatusElement(parseEnumeration(xpp, Enumerations.DocumentReferenceStatus.NULL, new Enumerations.DocumentReferenceStatusEnumFactory()));
6957      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("docStatus")) {
6958        res.setDocStatusElement(parseEnumeration(xpp, DocumentReference.ReferredDocumentStatus.NULL, new DocumentReference.ReferredDocumentStatusEnumFactory()));
6959      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6960        res.setType(parseCodeableConcept(xpp));
6961      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("class")) {
6962        res.setClass_(parseCodeableConcept(xpp));
6963      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
6964        res.setSubject(parseReference(xpp));
6965      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
6966        res.setCreatedElement(parseDateTime(xpp));
6967      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("indexed")) {
6968        res.setIndexedElement(parseInstant(xpp));
6969      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
6970        res.getAuthor().add(parseReference(xpp));
6971      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authenticator")) {
6972        res.setAuthenticator(parseReference(xpp));
6973      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("custodian")) {
6974        res.setCustodian(parseReference(xpp));
6975      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatesTo")) {
6976        res.getRelatesTo().add(parseDocumentReferenceDocumentReferenceRelatesToComponent(xpp, res));
6977      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
6978        res.setDescriptionElement(parseString(xpp));
6979      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("securityLabel")) {
6980        res.getSecurityLabel().add(parseCodeableConcept(xpp));
6981      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("content")) {
6982        res.getContent().add(parseDocumentReferenceDocumentReferenceContentComponent(xpp, res));
6983      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
6984        res.setContext(parseDocumentReferenceDocumentReferenceContextComponent(xpp, res));
6985      } else if (!parseDomainResourceContent(eventType, xpp, res))
6986        return false;
6987    return true;
6988  }
6989
6990  protected DocumentReference.DocumentReferenceRelatesToComponent parseDocumentReferenceDocumentReferenceRelatesToComponent(XmlPullParser xpp, DocumentReference owner) throws XmlPullParserException, IOException, FHIRFormatError {
6991    DocumentReference.DocumentReferenceRelatesToComponent res = new DocumentReference.DocumentReferenceRelatesToComponent();
6992    parseBackboneAttributes(xpp, res);
6993    next(xpp);
6994    int eventType = nextNoWhitespace(xpp);
6995    while (eventType != XmlPullParser.END_TAG) {
6996  if (!parseDocumentReferenceDocumentReferenceRelatesToComponentContent(eventType, xpp, owner, res))
6997        unknownContent(xpp);
6998      eventType = nextNoWhitespace(xpp);
6999    }
7000    next(xpp);
7001    parseElementClose(res);
7002    return res;
7003  }
7004
7005  protected boolean parseDocumentReferenceDocumentReferenceRelatesToComponentContent(int eventType, XmlPullParser xpp, DocumentReference owner, DocumentReference.DocumentReferenceRelatesToComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7006      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
7007        res.setCodeElement(parseEnumeration(xpp, DocumentReference.DocumentRelationshipType.NULL, new DocumentReference.DocumentRelationshipTypeEnumFactory()));
7008      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("target")) {
7009        res.setTarget(parseReference(xpp));
7010      } else if (!parseBackboneContent(eventType, xpp, res))
7011        return false;
7012    return true;
7013  }
7014
7015  protected DocumentReference.DocumentReferenceContentComponent parseDocumentReferenceDocumentReferenceContentComponent(XmlPullParser xpp, DocumentReference owner) throws XmlPullParserException, IOException, FHIRFormatError {
7016    DocumentReference.DocumentReferenceContentComponent res = new DocumentReference.DocumentReferenceContentComponent();
7017    parseBackboneAttributes(xpp, res);
7018    next(xpp);
7019    int eventType = nextNoWhitespace(xpp);
7020    while (eventType != XmlPullParser.END_TAG) {
7021  if (!parseDocumentReferenceDocumentReferenceContentComponentContent(eventType, xpp, owner, res))
7022        unknownContent(xpp);
7023      eventType = nextNoWhitespace(xpp);
7024    }
7025    next(xpp);
7026    parseElementClose(res);
7027    return res;
7028  }
7029
7030  protected boolean parseDocumentReferenceDocumentReferenceContentComponentContent(int eventType, XmlPullParser xpp, DocumentReference owner, DocumentReference.DocumentReferenceContentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7031      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("attachment")) {
7032        res.setAttachment(parseAttachment(xpp));
7033      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("format")) {
7034        res.setFormat(parseCoding(xpp));
7035      } else if (!parseBackboneContent(eventType, xpp, res))
7036        return false;
7037    return true;
7038  }
7039
7040  protected DocumentReference.DocumentReferenceContextComponent parseDocumentReferenceDocumentReferenceContextComponent(XmlPullParser xpp, DocumentReference owner) throws XmlPullParserException, IOException, FHIRFormatError {
7041    DocumentReference.DocumentReferenceContextComponent res = new DocumentReference.DocumentReferenceContextComponent();
7042    parseBackboneAttributes(xpp, res);
7043    next(xpp);
7044    int eventType = nextNoWhitespace(xpp);
7045    while (eventType != XmlPullParser.END_TAG) {
7046  if (!parseDocumentReferenceDocumentReferenceContextComponentContent(eventType, xpp, owner, res))
7047        unknownContent(xpp);
7048      eventType = nextNoWhitespace(xpp);
7049    }
7050    next(xpp);
7051    parseElementClose(res);
7052    return res;
7053  }
7054
7055  protected boolean parseDocumentReferenceDocumentReferenceContextComponentContent(int eventType, XmlPullParser xpp, DocumentReference owner, DocumentReference.DocumentReferenceContextComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7056      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
7057        res.setEncounter(parseReference(xpp));
7058      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("event")) {
7059        res.getEvent().add(parseCodeableConcept(xpp));
7060      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7061        res.setPeriod(parsePeriod(xpp));
7062      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("facilityType")) {
7063        res.setFacilityType(parseCodeableConcept(xpp));
7064      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("practiceSetting")) {
7065        res.setPracticeSetting(parseCodeableConcept(xpp));
7066      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sourcePatientInfo")) {
7067        res.setSourcePatientInfo(parseReference(xpp));
7068      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("related")) {
7069        res.getRelated().add(parseDocumentReferenceDocumentReferenceContextRelatedComponent(xpp, owner));
7070      } else if (!parseBackboneContent(eventType, xpp, res))
7071        return false;
7072    return true;
7073  }
7074
7075  protected DocumentReference.DocumentReferenceContextRelatedComponent parseDocumentReferenceDocumentReferenceContextRelatedComponent(XmlPullParser xpp, DocumentReference owner) throws XmlPullParserException, IOException, FHIRFormatError {
7076    DocumentReference.DocumentReferenceContextRelatedComponent res = new DocumentReference.DocumentReferenceContextRelatedComponent();
7077    parseBackboneAttributes(xpp, res);
7078    next(xpp);
7079    int eventType = nextNoWhitespace(xpp);
7080    while (eventType != XmlPullParser.END_TAG) {
7081  if (!parseDocumentReferenceDocumentReferenceContextRelatedComponentContent(eventType, xpp, owner, res))
7082        unknownContent(xpp);
7083      eventType = nextNoWhitespace(xpp);
7084    }
7085    next(xpp);
7086    parseElementClose(res);
7087    return res;
7088  }
7089
7090  protected boolean parseDocumentReferenceDocumentReferenceContextRelatedComponentContent(int eventType, XmlPullParser xpp, DocumentReference owner, DocumentReference.DocumentReferenceContextRelatedComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7091      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7092        res.setIdentifier(parseIdentifier(xpp));
7093      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ref")) {
7094        res.setRef(parseReference(xpp));
7095      } else if (!parseBackboneContent(eventType, xpp, res))
7096        return false;
7097    return true;
7098  }
7099
7100  protected EligibilityRequest parseEligibilityRequest(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7101    EligibilityRequest res = new EligibilityRequest();
7102    parseDomainResourceAttributes(xpp, res);
7103    next(xpp);
7104    int eventType = nextNoWhitespace(xpp);
7105    while (eventType != XmlPullParser.END_TAG) {
7106  if (!parseEligibilityRequestContent(eventType, xpp, res))
7107        unknownContent(xpp);
7108      eventType = nextNoWhitespace(xpp);
7109    }
7110    next(xpp);
7111    parseElementClose(res);
7112    return res;
7113  }
7114
7115  protected boolean parseEligibilityRequestContent(int eventType, XmlPullParser xpp, EligibilityRequest res) throws XmlPullParserException, IOException, FHIRFormatError {
7116      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7117        res.getIdentifier().add(parseIdentifier(xpp));
7118      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7119        res.setStatusElement(parseEnumeration(xpp, EligibilityRequest.EligibilityRequestStatus.NULL, new EligibilityRequest.EligibilityRequestStatusEnumFactory()));
7120      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
7121        res.setPriority(parseCodeableConcept(xpp));
7122      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
7123        res.setPatient(parseReference(xpp));
7124      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "serviced")) {
7125        res.setServiced(parseType("serviced", xpp));
7126      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
7127        res.setCreatedElement(parseDateTime(xpp));
7128      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("enterer")) {
7129        res.setEnterer(parseReference(xpp));
7130      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("provider")) {
7131        res.setProvider(parseReference(xpp));
7132      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("organization")) {
7133        res.setOrganization(parseReference(xpp));
7134      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurer")) {
7135        res.setInsurer(parseReference(xpp));
7136      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("facility")) {
7137        res.setFacility(parseReference(xpp));
7138      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
7139        res.setCoverage(parseReference(xpp));
7140      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("businessArrangement")) {
7141        res.setBusinessArrangementElement(parseString(xpp));
7142      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("benefitCategory")) {
7143        res.setBenefitCategory(parseCodeableConcept(xpp));
7144      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("benefitSubCategory")) {
7145        res.setBenefitSubCategory(parseCodeableConcept(xpp));
7146      } else if (!parseDomainResourceContent(eventType, xpp, res))
7147        return false;
7148    return true;
7149  }
7150
7151  protected EligibilityResponse parseEligibilityResponse(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7152    EligibilityResponse res = new EligibilityResponse();
7153    parseDomainResourceAttributes(xpp, res);
7154    next(xpp);
7155    int eventType = nextNoWhitespace(xpp);
7156    while (eventType != XmlPullParser.END_TAG) {
7157  if (!parseEligibilityResponseContent(eventType, xpp, res))
7158        unknownContent(xpp);
7159      eventType = nextNoWhitespace(xpp);
7160    }
7161    next(xpp);
7162    parseElementClose(res);
7163    return res;
7164  }
7165
7166  protected boolean parseEligibilityResponseContent(int eventType, XmlPullParser xpp, EligibilityResponse res) throws XmlPullParserException, IOException, FHIRFormatError {
7167      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7168        res.getIdentifier().add(parseIdentifier(xpp));
7169      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7170        res.setStatusElement(parseEnumeration(xpp, EligibilityResponse.EligibilityResponseStatus.NULL, new EligibilityResponse.EligibilityResponseStatusEnumFactory()));
7171      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
7172        res.setCreatedElement(parseDateTime(xpp));
7173      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestProvider")) {
7174        res.setRequestProvider(parseReference(xpp));
7175      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestOrganization")) {
7176        res.setRequestOrganization(parseReference(xpp));
7177      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
7178        res.setRequest(parseReference(xpp));
7179      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
7180        res.setOutcome(parseCodeableConcept(xpp));
7181      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("disposition")) {
7182        res.setDispositionElement(parseString(xpp));
7183      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurer")) {
7184        res.setInsurer(parseReference(xpp));
7185      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("inforce")) {
7186        res.setInforceElement(parseBoolean(xpp));
7187      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurance")) {
7188        res.getInsurance().add(parseEligibilityResponseInsuranceComponent(xpp, res));
7189      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("form")) {
7190        res.setForm(parseCodeableConcept(xpp));
7191      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("error")) {
7192        res.getError().add(parseEligibilityResponseErrorsComponent(xpp, res));
7193      } else if (!parseDomainResourceContent(eventType, xpp, res))
7194        return false;
7195    return true;
7196  }
7197
7198  protected EligibilityResponse.InsuranceComponent parseEligibilityResponseInsuranceComponent(XmlPullParser xpp, EligibilityResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
7199    EligibilityResponse.InsuranceComponent res = new EligibilityResponse.InsuranceComponent();
7200    parseBackboneAttributes(xpp, res);
7201    next(xpp);
7202    int eventType = nextNoWhitespace(xpp);
7203    while (eventType != XmlPullParser.END_TAG) {
7204  if (!parseEligibilityResponseInsuranceComponentContent(eventType, xpp, owner, res))
7205        unknownContent(xpp);
7206      eventType = nextNoWhitespace(xpp);
7207    }
7208    next(xpp);
7209    parseElementClose(res);
7210    return res;
7211  }
7212
7213  protected boolean parseEligibilityResponseInsuranceComponentContent(int eventType, XmlPullParser xpp, EligibilityResponse owner, EligibilityResponse.InsuranceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7214      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
7215        res.setCoverage(parseReference(xpp));
7216      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contract")) {
7217        res.setContract(parseReference(xpp));
7218      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("benefitBalance")) {
7219        res.getBenefitBalance().add(parseEligibilityResponseBenefitsComponent(xpp, owner));
7220      } else if (!parseBackboneContent(eventType, xpp, res))
7221        return false;
7222    return true;
7223  }
7224
7225  protected EligibilityResponse.BenefitsComponent parseEligibilityResponseBenefitsComponent(XmlPullParser xpp, EligibilityResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
7226    EligibilityResponse.BenefitsComponent res = new EligibilityResponse.BenefitsComponent();
7227    parseBackboneAttributes(xpp, res);
7228    next(xpp);
7229    int eventType = nextNoWhitespace(xpp);
7230    while (eventType != XmlPullParser.END_TAG) {
7231  if (!parseEligibilityResponseBenefitsComponentContent(eventType, xpp, owner, res))
7232        unknownContent(xpp);
7233      eventType = nextNoWhitespace(xpp);
7234    }
7235    next(xpp);
7236    parseElementClose(res);
7237    return res;
7238  }
7239
7240  protected boolean parseEligibilityResponseBenefitsComponentContent(int eventType, XmlPullParser xpp, EligibilityResponse owner, EligibilityResponse.BenefitsComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7241      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
7242        res.setCategory(parseCodeableConcept(xpp));
7243      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subCategory")) {
7244        res.setSubCategory(parseCodeableConcept(xpp));
7245      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("excluded")) {
7246        res.setExcludedElement(parseBoolean(xpp));
7247      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
7248        res.setNameElement(parseString(xpp));
7249      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
7250        res.setDescriptionElement(parseString(xpp));
7251      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("network")) {
7252        res.setNetwork(parseCodeableConcept(xpp));
7253      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unit")) {
7254        res.setUnit(parseCodeableConcept(xpp));
7255      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("term")) {
7256        res.setTerm(parseCodeableConcept(xpp));
7257      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("financial")) {
7258        res.getFinancial().add(parseEligibilityResponseBenefitComponent(xpp, owner));
7259      } else if (!parseBackboneContent(eventType, xpp, res))
7260        return false;
7261    return true;
7262  }
7263
7264  protected EligibilityResponse.BenefitComponent parseEligibilityResponseBenefitComponent(XmlPullParser xpp, EligibilityResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
7265    EligibilityResponse.BenefitComponent res = new EligibilityResponse.BenefitComponent();
7266    parseBackboneAttributes(xpp, res);
7267    next(xpp);
7268    int eventType = nextNoWhitespace(xpp);
7269    while (eventType != XmlPullParser.END_TAG) {
7270  if (!parseEligibilityResponseBenefitComponentContent(eventType, xpp, owner, res))
7271        unknownContent(xpp);
7272      eventType = nextNoWhitespace(xpp);
7273    }
7274    next(xpp);
7275    parseElementClose(res);
7276    return res;
7277  }
7278
7279  protected boolean parseEligibilityResponseBenefitComponentContent(int eventType, XmlPullParser xpp, EligibilityResponse owner, EligibilityResponse.BenefitComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7280      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
7281        res.setType(parseCodeableConcept(xpp));
7282      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "allowed")) {
7283        res.setAllowed(parseType("allowed", xpp));
7284      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "used")) {
7285        res.setUsed(parseType("used", xpp));
7286      } else if (!parseBackboneContent(eventType, xpp, res))
7287        return false;
7288    return true;
7289  }
7290
7291  protected EligibilityResponse.ErrorsComponent parseEligibilityResponseErrorsComponent(XmlPullParser xpp, EligibilityResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
7292    EligibilityResponse.ErrorsComponent res = new EligibilityResponse.ErrorsComponent();
7293    parseBackboneAttributes(xpp, res);
7294    next(xpp);
7295    int eventType = nextNoWhitespace(xpp);
7296    while (eventType != XmlPullParser.END_TAG) {
7297  if (!parseEligibilityResponseErrorsComponentContent(eventType, xpp, owner, res))
7298        unknownContent(xpp);
7299      eventType = nextNoWhitespace(xpp);
7300    }
7301    next(xpp);
7302    parseElementClose(res);
7303    return res;
7304  }
7305
7306  protected boolean parseEligibilityResponseErrorsComponentContent(int eventType, XmlPullParser xpp, EligibilityResponse owner, EligibilityResponse.ErrorsComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7307      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
7308        res.setCode(parseCodeableConcept(xpp));
7309      } else if (!parseBackboneContent(eventType, xpp, res))
7310        return false;
7311    return true;
7312  }
7313
7314  protected Encounter parseEncounter(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7315    Encounter res = new Encounter();
7316    parseDomainResourceAttributes(xpp, res);
7317    next(xpp);
7318    int eventType = nextNoWhitespace(xpp);
7319    while (eventType != XmlPullParser.END_TAG) {
7320  if (!parseEncounterContent(eventType, xpp, res))
7321        unknownContent(xpp);
7322      eventType = nextNoWhitespace(xpp);
7323    }
7324    next(xpp);
7325    parseElementClose(res);
7326    return res;
7327  }
7328
7329  protected boolean parseEncounterContent(int eventType, XmlPullParser xpp, Encounter res) throws XmlPullParserException, IOException, FHIRFormatError {
7330      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7331        res.getIdentifier().add(parseIdentifier(xpp));
7332      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7333        res.setStatusElement(parseEnumeration(xpp, Encounter.EncounterStatus.NULL, new Encounter.EncounterStatusEnumFactory()));
7334      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("statusHistory")) {
7335        res.getStatusHistory().add(parseEncounterStatusHistoryComponent(xpp, res));
7336      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("class")) {
7337        res.setClass_(parseCoding(xpp));
7338      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("classHistory")) {
7339        res.getClassHistory().add(parseEncounterClassHistoryComponent(xpp, res));
7340      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
7341        res.getType().add(parseCodeableConcept(xpp));
7342      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
7343        res.setPriority(parseCodeableConcept(xpp));
7344      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
7345        res.setSubject(parseReference(xpp));
7346      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("episodeOfCare")) {
7347        res.getEpisodeOfCare().add(parseReference(xpp));
7348      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("incomingReferral")) {
7349        res.getIncomingReferral().add(parseReference(xpp));
7350      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
7351        res.getParticipant().add(parseEncounterEncounterParticipantComponent(xpp, res));
7352      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("appointment")) {
7353        res.setAppointment(parseReference(xpp));
7354      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7355        res.setPeriod(parsePeriod(xpp));
7356      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("length")) {
7357        res.setLength(parseDuration(xpp));
7358      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
7359        res.getReason().add(parseCodeableConcept(xpp));
7360      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diagnosis")) {
7361        res.getDiagnosis().add(parseEncounterDiagnosisComponent(xpp, res));
7362      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("account")) {
7363        res.getAccount().add(parseReference(xpp));
7364      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("hospitalization")) {
7365        res.setHospitalization(parseEncounterEncounterHospitalizationComponent(xpp, res));
7366      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
7367        res.getLocation().add(parseEncounterEncounterLocationComponent(xpp, res));
7368      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("serviceProvider")) {
7369        res.setServiceProvider(parseReference(xpp));
7370      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
7371        res.setPartOf(parseReference(xpp));
7372      } else if (!parseDomainResourceContent(eventType, xpp, res))
7373        return false;
7374    return true;
7375  }
7376
7377  protected Encounter.StatusHistoryComponent parseEncounterStatusHistoryComponent(XmlPullParser xpp, Encounter owner) throws XmlPullParserException, IOException, FHIRFormatError {
7378    Encounter.StatusHistoryComponent res = new Encounter.StatusHistoryComponent();
7379    parseBackboneAttributes(xpp, res);
7380    next(xpp);
7381    int eventType = nextNoWhitespace(xpp);
7382    while (eventType != XmlPullParser.END_TAG) {
7383  if (!parseEncounterStatusHistoryComponentContent(eventType, xpp, owner, res))
7384        unknownContent(xpp);
7385      eventType = nextNoWhitespace(xpp);
7386    }
7387    next(xpp);
7388    parseElementClose(res);
7389    return res;
7390  }
7391
7392  protected boolean parseEncounterStatusHistoryComponentContent(int eventType, XmlPullParser xpp, Encounter owner, Encounter.StatusHistoryComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7393      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7394        res.setStatusElement(parseEnumeration(xpp, Encounter.EncounterStatus.NULL, new Encounter.EncounterStatusEnumFactory()));
7395      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7396        res.setPeriod(parsePeriod(xpp));
7397      } else if (!parseBackboneContent(eventType, xpp, res))
7398        return false;
7399    return true;
7400  }
7401
7402  protected Encounter.ClassHistoryComponent parseEncounterClassHistoryComponent(XmlPullParser xpp, Encounter owner) throws XmlPullParserException, IOException, FHIRFormatError {
7403    Encounter.ClassHistoryComponent res = new Encounter.ClassHistoryComponent();
7404    parseBackboneAttributes(xpp, res);
7405    next(xpp);
7406    int eventType = nextNoWhitespace(xpp);
7407    while (eventType != XmlPullParser.END_TAG) {
7408  if (!parseEncounterClassHistoryComponentContent(eventType, xpp, owner, res))
7409        unknownContent(xpp);
7410      eventType = nextNoWhitespace(xpp);
7411    }
7412    next(xpp);
7413    parseElementClose(res);
7414    return res;
7415  }
7416
7417  protected boolean parseEncounterClassHistoryComponentContent(int eventType, XmlPullParser xpp, Encounter owner, Encounter.ClassHistoryComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7418      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("class")) {
7419        res.setClass_(parseCoding(xpp));
7420      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7421        res.setPeriod(parsePeriod(xpp));
7422      } else if (!parseBackboneContent(eventType, xpp, res))
7423        return false;
7424    return true;
7425  }
7426
7427  protected Encounter.EncounterParticipantComponent parseEncounterEncounterParticipantComponent(XmlPullParser xpp, Encounter owner) throws XmlPullParserException, IOException, FHIRFormatError {
7428    Encounter.EncounterParticipantComponent res = new Encounter.EncounterParticipantComponent();
7429    parseBackboneAttributes(xpp, res);
7430    next(xpp);
7431    int eventType = nextNoWhitespace(xpp);
7432    while (eventType != XmlPullParser.END_TAG) {
7433  if (!parseEncounterEncounterParticipantComponentContent(eventType, xpp, owner, res))
7434        unknownContent(xpp);
7435      eventType = nextNoWhitespace(xpp);
7436    }
7437    next(xpp);
7438    parseElementClose(res);
7439    return res;
7440  }
7441
7442  protected boolean parseEncounterEncounterParticipantComponentContent(int eventType, XmlPullParser xpp, Encounter owner, Encounter.EncounterParticipantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7443      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
7444        res.getType().add(parseCodeableConcept(xpp));
7445      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7446        res.setPeriod(parsePeriod(xpp));
7447      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("individual")) {
7448        res.setIndividual(parseReference(xpp));
7449      } else if (!parseBackboneContent(eventType, xpp, res))
7450        return false;
7451    return true;
7452  }
7453
7454  protected Encounter.DiagnosisComponent parseEncounterDiagnosisComponent(XmlPullParser xpp, Encounter owner) throws XmlPullParserException, IOException, FHIRFormatError {
7455    Encounter.DiagnosisComponent res = new Encounter.DiagnosisComponent();
7456    parseBackboneAttributes(xpp, res);
7457    next(xpp);
7458    int eventType = nextNoWhitespace(xpp);
7459    while (eventType != XmlPullParser.END_TAG) {
7460  if (!parseEncounterDiagnosisComponentContent(eventType, xpp, owner, res))
7461        unknownContent(xpp);
7462      eventType = nextNoWhitespace(xpp);
7463    }
7464    next(xpp);
7465    parseElementClose(res);
7466    return res;
7467  }
7468
7469  protected boolean parseEncounterDiagnosisComponentContent(int eventType, XmlPullParser xpp, Encounter owner, Encounter.DiagnosisComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7470      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("condition")) {
7471        res.setCondition(parseReference(xpp));
7472      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
7473        res.setRole(parseCodeableConcept(xpp));
7474      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rank")) {
7475        res.setRankElement(parsePositiveInt(xpp));
7476      } else if (!parseBackboneContent(eventType, xpp, res))
7477        return false;
7478    return true;
7479  }
7480
7481  protected Encounter.EncounterHospitalizationComponent parseEncounterEncounterHospitalizationComponent(XmlPullParser xpp, Encounter owner) throws XmlPullParserException, IOException, FHIRFormatError {
7482    Encounter.EncounterHospitalizationComponent res = new Encounter.EncounterHospitalizationComponent();
7483    parseBackboneAttributes(xpp, res);
7484    next(xpp);
7485    int eventType = nextNoWhitespace(xpp);
7486    while (eventType != XmlPullParser.END_TAG) {
7487  if (!parseEncounterEncounterHospitalizationComponentContent(eventType, xpp, owner, res))
7488        unknownContent(xpp);
7489      eventType = nextNoWhitespace(xpp);
7490    }
7491    next(xpp);
7492    parseElementClose(res);
7493    return res;
7494  }
7495
7496  protected boolean parseEncounterEncounterHospitalizationComponentContent(int eventType, XmlPullParser xpp, Encounter owner, Encounter.EncounterHospitalizationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7497      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("preAdmissionIdentifier")) {
7498        res.setPreAdmissionIdentifier(parseIdentifier(xpp));
7499      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("origin")) {
7500        res.setOrigin(parseReference(xpp));
7501      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("admitSource")) {
7502        res.setAdmitSource(parseCodeableConcept(xpp));
7503      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reAdmission")) {
7504        res.setReAdmission(parseCodeableConcept(xpp));
7505      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dietPreference")) {
7506        res.getDietPreference().add(parseCodeableConcept(xpp));
7507      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specialCourtesy")) {
7508        res.getSpecialCourtesy().add(parseCodeableConcept(xpp));
7509      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specialArrangement")) {
7510        res.getSpecialArrangement().add(parseCodeableConcept(xpp));
7511      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("destination")) {
7512        res.setDestination(parseReference(xpp));
7513      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dischargeDisposition")) {
7514        res.setDischargeDisposition(parseCodeableConcept(xpp));
7515      } else if (!parseBackboneContent(eventType, xpp, res))
7516        return false;
7517    return true;
7518  }
7519
7520  protected Encounter.EncounterLocationComponent parseEncounterEncounterLocationComponent(XmlPullParser xpp, Encounter owner) throws XmlPullParserException, IOException, FHIRFormatError {
7521    Encounter.EncounterLocationComponent res = new Encounter.EncounterLocationComponent();
7522    parseBackboneAttributes(xpp, res);
7523    next(xpp);
7524    int eventType = nextNoWhitespace(xpp);
7525    while (eventType != XmlPullParser.END_TAG) {
7526  if (!parseEncounterEncounterLocationComponentContent(eventType, xpp, owner, res))
7527        unknownContent(xpp);
7528      eventType = nextNoWhitespace(xpp);
7529    }
7530    next(xpp);
7531    parseElementClose(res);
7532    return res;
7533  }
7534
7535  protected boolean parseEncounterEncounterLocationComponentContent(int eventType, XmlPullParser xpp, Encounter owner, Encounter.EncounterLocationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7536      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
7537        res.setLocation(parseReference(xpp));
7538      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7539        res.setStatusElement(parseEnumeration(xpp, Encounter.EncounterLocationStatus.NULL, new Encounter.EncounterLocationStatusEnumFactory()));
7540      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7541        res.setPeriod(parsePeriod(xpp));
7542      } else if (!parseBackboneContent(eventType, xpp, res))
7543        return false;
7544    return true;
7545  }
7546
7547  protected Endpoint parseEndpoint(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7548    Endpoint res = new Endpoint();
7549    parseDomainResourceAttributes(xpp, res);
7550    next(xpp);
7551    int eventType = nextNoWhitespace(xpp);
7552    while (eventType != XmlPullParser.END_TAG) {
7553  if (!parseEndpointContent(eventType, xpp, res))
7554        unknownContent(xpp);
7555      eventType = nextNoWhitespace(xpp);
7556    }
7557    next(xpp);
7558    parseElementClose(res);
7559    return res;
7560  }
7561
7562  protected boolean parseEndpointContent(int eventType, XmlPullParser xpp, Endpoint res) throws XmlPullParserException, IOException, FHIRFormatError {
7563      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7564        res.getIdentifier().add(parseIdentifier(xpp));
7565      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7566        res.setStatusElement(parseEnumeration(xpp, Endpoint.EndpointStatus.NULL, new Endpoint.EndpointStatusEnumFactory()));
7567      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("connectionType")) {
7568        res.setConnectionType(parseCoding(xpp));
7569      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
7570        res.setNameElement(parseString(xpp));
7571      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("managingOrganization")) {
7572        res.setManagingOrganization(parseReference(xpp));
7573      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
7574        res.getContact().add(parseContactPoint(xpp));
7575      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7576        res.setPeriod(parsePeriod(xpp));
7577      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payloadType")) {
7578        res.getPayloadType().add(parseCodeableConcept(xpp));
7579      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payloadMimeType")) {
7580        res.getPayloadMimeType().add(parseCode(xpp));
7581      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("address")) {
7582        res.setAddressElement(parseUri(xpp));
7583      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("header")) {
7584        res.getHeader().add(parseString(xpp));
7585      } else if (!parseDomainResourceContent(eventType, xpp, res))
7586        return false;
7587    return true;
7588  }
7589
7590  protected EnrollmentRequest parseEnrollmentRequest(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7591    EnrollmentRequest res = new EnrollmentRequest();
7592    parseDomainResourceAttributes(xpp, res);
7593    next(xpp);
7594    int eventType = nextNoWhitespace(xpp);
7595    while (eventType != XmlPullParser.END_TAG) {
7596  if (!parseEnrollmentRequestContent(eventType, xpp, res))
7597        unknownContent(xpp);
7598      eventType = nextNoWhitespace(xpp);
7599    }
7600    next(xpp);
7601    parseElementClose(res);
7602    return res;
7603  }
7604
7605  protected boolean parseEnrollmentRequestContent(int eventType, XmlPullParser xpp, EnrollmentRequest res) throws XmlPullParserException, IOException, FHIRFormatError {
7606      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7607        res.getIdentifier().add(parseIdentifier(xpp));
7608      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7609        res.setStatusElement(parseEnumeration(xpp, EnrollmentRequest.EnrollmentRequestStatus.NULL, new EnrollmentRequest.EnrollmentRequestStatusEnumFactory()));
7610      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
7611        res.setCreatedElement(parseDateTime(xpp));
7612      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurer")) {
7613        res.setInsurer(parseReference(xpp));
7614      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("provider")) {
7615        res.setProvider(parseReference(xpp));
7616      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("organization")) {
7617        res.setOrganization(parseReference(xpp));
7618      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
7619        res.setSubject(parseReference(xpp));
7620      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
7621        res.setCoverage(parseReference(xpp));
7622      } else if (!parseDomainResourceContent(eventType, xpp, res))
7623        return false;
7624    return true;
7625  }
7626
7627  protected EnrollmentResponse parseEnrollmentResponse(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7628    EnrollmentResponse res = new EnrollmentResponse();
7629    parseDomainResourceAttributes(xpp, res);
7630    next(xpp);
7631    int eventType = nextNoWhitespace(xpp);
7632    while (eventType != XmlPullParser.END_TAG) {
7633  if (!parseEnrollmentResponseContent(eventType, xpp, res))
7634        unknownContent(xpp);
7635      eventType = nextNoWhitespace(xpp);
7636    }
7637    next(xpp);
7638    parseElementClose(res);
7639    return res;
7640  }
7641
7642  protected boolean parseEnrollmentResponseContent(int eventType, XmlPullParser xpp, EnrollmentResponse res) throws XmlPullParserException, IOException, FHIRFormatError {
7643      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7644        res.getIdentifier().add(parseIdentifier(xpp));
7645      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7646        res.setStatusElement(parseEnumeration(xpp, EnrollmentResponse.EnrollmentResponseStatus.NULL, new EnrollmentResponse.EnrollmentResponseStatusEnumFactory()));
7647      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
7648        res.setRequest(parseReference(xpp));
7649      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
7650        res.setOutcome(parseCodeableConcept(xpp));
7651      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("disposition")) {
7652        res.setDispositionElement(parseString(xpp));
7653      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
7654        res.setCreatedElement(parseDateTime(xpp));
7655      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("organization")) {
7656        res.setOrganization(parseReference(xpp));
7657      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestProvider")) {
7658        res.setRequestProvider(parseReference(xpp));
7659      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestOrganization")) {
7660        res.setRequestOrganization(parseReference(xpp));
7661      } else if (!parseDomainResourceContent(eventType, xpp, res))
7662        return false;
7663    return true;
7664  }
7665
7666  protected EpisodeOfCare parseEpisodeOfCare(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7667    EpisodeOfCare res = new EpisodeOfCare();
7668    parseDomainResourceAttributes(xpp, res);
7669    next(xpp);
7670    int eventType = nextNoWhitespace(xpp);
7671    while (eventType != XmlPullParser.END_TAG) {
7672  if (!parseEpisodeOfCareContent(eventType, xpp, res))
7673        unknownContent(xpp);
7674      eventType = nextNoWhitespace(xpp);
7675    }
7676    next(xpp);
7677    parseElementClose(res);
7678    return res;
7679  }
7680
7681  protected boolean parseEpisodeOfCareContent(int eventType, XmlPullParser xpp, EpisodeOfCare res) throws XmlPullParserException, IOException, FHIRFormatError {
7682      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7683        res.getIdentifier().add(parseIdentifier(xpp));
7684      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7685        res.setStatusElement(parseEnumeration(xpp, EpisodeOfCare.EpisodeOfCareStatus.NULL, new EpisodeOfCare.EpisodeOfCareStatusEnumFactory()));
7686      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("statusHistory")) {
7687        res.getStatusHistory().add(parseEpisodeOfCareEpisodeOfCareStatusHistoryComponent(xpp, res));
7688      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
7689        res.getType().add(parseCodeableConcept(xpp));
7690      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diagnosis")) {
7691        res.getDiagnosis().add(parseEpisodeOfCareDiagnosisComponent(xpp, res));
7692      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
7693        res.setPatient(parseReference(xpp));
7694      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("managingOrganization")) {
7695        res.setManagingOrganization(parseReference(xpp));
7696      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7697        res.setPeriod(parsePeriod(xpp));
7698      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referralRequest")) {
7699        res.getReferralRequest().add(parseReference(xpp));
7700      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("careManager")) {
7701        res.setCareManager(parseReference(xpp));
7702      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("team")) {
7703        res.getTeam().add(parseReference(xpp));
7704      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("account")) {
7705        res.getAccount().add(parseReference(xpp));
7706      } else if (!parseDomainResourceContent(eventType, xpp, res))
7707        return false;
7708    return true;
7709  }
7710
7711  protected EpisodeOfCare.EpisodeOfCareStatusHistoryComponent parseEpisodeOfCareEpisodeOfCareStatusHistoryComponent(XmlPullParser xpp, EpisodeOfCare owner) throws XmlPullParserException, IOException, FHIRFormatError {
7712    EpisodeOfCare.EpisodeOfCareStatusHistoryComponent res = new EpisodeOfCare.EpisodeOfCareStatusHistoryComponent();
7713    parseBackboneAttributes(xpp, res);
7714    next(xpp);
7715    int eventType = nextNoWhitespace(xpp);
7716    while (eventType != XmlPullParser.END_TAG) {
7717  if (!parseEpisodeOfCareEpisodeOfCareStatusHistoryComponentContent(eventType, xpp, owner, res))
7718        unknownContent(xpp);
7719      eventType = nextNoWhitespace(xpp);
7720    }
7721    next(xpp);
7722    parseElementClose(res);
7723    return res;
7724  }
7725
7726  protected boolean parseEpisodeOfCareEpisodeOfCareStatusHistoryComponentContent(int eventType, XmlPullParser xpp, EpisodeOfCare owner, EpisodeOfCare.EpisodeOfCareStatusHistoryComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7727      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7728        res.setStatusElement(parseEnumeration(xpp, EpisodeOfCare.EpisodeOfCareStatus.NULL, new EpisodeOfCare.EpisodeOfCareStatusEnumFactory()));
7729      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7730        res.setPeriod(parsePeriod(xpp));
7731      } else if (!parseBackboneContent(eventType, xpp, res))
7732        return false;
7733    return true;
7734  }
7735
7736  protected EpisodeOfCare.DiagnosisComponent parseEpisodeOfCareDiagnosisComponent(XmlPullParser xpp, EpisodeOfCare owner) throws XmlPullParserException, IOException, FHIRFormatError {
7737    EpisodeOfCare.DiagnosisComponent res = new EpisodeOfCare.DiagnosisComponent();
7738    parseBackboneAttributes(xpp, res);
7739    next(xpp);
7740    int eventType = nextNoWhitespace(xpp);
7741    while (eventType != XmlPullParser.END_TAG) {
7742  if (!parseEpisodeOfCareDiagnosisComponentContent(eventType, xpp, owner, res))
7743        unknownContent(xpp);
7744      eventType = nextNoWhitespace(xpp);
7745    }
7746    next(xpp);
7747    parseElementClose(res);
7748    return res;
7749  }
7750
7751  protected boolean parseEpisodeOfCareDiagnosisComponentContent(int eventType, XmlPullParser xpp, EpisodeOfCare owner, EpisodeOfCare.DiagnosisComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7752      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("condition")) {
7753        res.setCondition(parseReference(xpp));
7754      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
7755        res.setRole(parseCodeableConcept(xpp));
7756      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rank")) {
7757        res.setRankElement(parsePositiveInt(xpp));
7758      } else if (!parseBackboneContent(eventType, xpp, res))
7759        return false;
7760    return true;
7761  }
7762
7763  protected ExpansionProfile parseExpansionProfile(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7764    ExpansionProfile res = new ExpansionProfile();
7765    parseDomainResourceAttributes(xpp, res);
7766    next(xpp);
7767    int eventType = nextNoWhitespace(xpp);
7768    while (eventType != XmlPullParser.END_TAG) {
7769  if (!parseExpansionProfileContent(eventType, xpp, res))
7770        unknownContent(xpp);
7771      eventType = nextNoWhitespace(xpp);
7772    }
7773    next(xpp);
7774    parseElementClose(res);
7775    return res;
7776  }
7777
7778  protected boolean parseExpansionProfileContent(int eventType, XmlPullParser xpp, ExpansionProfile res) throws XmlPullParserException, IOException, FHIRFormatError {
7779      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
7780        res.setUrlElement(parseUri(xpp));
7781      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7782        res.setIdentifier(parseIdentifier(xpp));
7783      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
7784        res.setVersionElement(parseString(xpp));
7785      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
7786        res.setNameElement(parseString(xpp));
7787      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7788        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
7789      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
7790        res.setExperimentalElement(parseBoolean(xpp));
7791      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
7792        res.setDateElement(parseDateTime(xpp));
7793      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
7794        res.setPublisherElement(parseString(xpp));
7795      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
7796        res.getContact().add(parseContactDetail(xpp));
7797      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
7798        res.setDescriptionElement(parseMarkdown(xpp));
7799      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
7800        res.getUseContext().add(parseUsageContext(xpp));
7801      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
7802        res.getJurisdiction().add(parseCodeableConcept(xpp));
7803      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fixedVersion")) {
7804        res.getFixedVersion().add(parseExpansionProfileExpansionProfileFixedVersionComponent(xpp, res));
7805      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("excludedSystem")) {
7806        res.setExcludedSystem(parseExpansionProfileExpansionProfileExcludedSystemComponent(xpp, res));
7807      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("includeDesignations")) {
7808        res.setIncludeDesignationsElement(parseBoolean(xpp));
7809      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("designation")) {
7810        res.setDesignation(parseExpansionProfileExpansionProfileDesignationComponent(xpp, res));
7811      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("includeDefinition")) {
7812        res.setIncludeDefinitionElement(parseBoolean(xpp));
7813      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("activeOnly")) {
7814        res.setActiveOnlyElement(parseBoolean(xpp));
7815      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("excludeNested")) {
7816        res.setExcludeNestedElement(parseBoolean(xpp));
7817      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("excludeNotForUI")) {
7818        res.setExcludeNotForUIElement(parseBoolean(xpp));
7819      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("excludePostCoordinated")) {
7820        res.setExcludePostCoordinatedElement(parseBoolean(xpp));
7821      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("displayLanguage")) {
7822        res.setDisplayLanguageElement(parseCode(xpp));
7823      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("limitedExpansion")) {
7824        res.setLimitedExpansionElement(parseBoolean(xpp));
7825      } else if (!parseDomainResourceContent(eventType, xpp, res))
7826        return false;
7827    return true;
7828  }
7829
7830  protected ExpansionProfile.ExpansionProfileFixedVersionComponent parseExpansionProfileExpansionProfileFixedVersionComponent(XmlPullParser xpp, ExpansionProfile owner) throws XmlPullParserException, IOException, FHIRFormatError {
7831    ExpansionProfile.ExpansionProfileFixedVersionComponent res = new ExpansionProfile.ExpansionProfileFixedVersionComponent();
7832    parseBackboneAttributes(xpp, res);
7833    next(xpp);
7834    int eventType = nextNoWhitespace(xpp);
7835    while (eventType != XmlPullParser.END_TAG) {
7836  if (!parseExpansionProfileExpansionProfileFixedVersionComponentContent(eventType, xpp, owner, res))
7837        unknownContent(xpp);
7838      eventType = nextNoWhitespace(xpp);
7839    }
7840    next(xpp);
7841    parseElementClose(res);
7842    return res;
7843  }
7844
7845  protected boolean parseExpansionProfileExpansionProfileFixedVersionComponentContent(int eventType, XmlPullParser xpp, ExpansionProfile owner, ExpansionProfile.ExpansionProfileFixedVersionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7846      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
7847        res.setSystemElement(parseUri(xpp));
7848      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
7849        res.setVersionElement(parseString(xpp));
7850      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
7851        res.setModeElement(parseEnumeration(xpp, ExpansionProfile.SystemVersionProcessingMode.NULL, new ExpansionProfile.SystemVersionProcessingModeEnumFactory()));
7852      } else if (!parseBackboneContent(eventType, xpp, res))
7853        return false;
7854    return true;
7855  }
7856
7857  protected ExpansionProfile.ExpansionProfileExcludedSystemComponent parseExpansionProfileExpansionProfileExcludedSystemComponent(XmlPullParser xpp, ExpansionProfile owner) throws XmlPullParserException, IOException, FHIRFormatError {
7858    ExpansionProfile.ExpansionProfileExcludedSystemComponent res = new ExpansionProfile.ExpansionProfileExcludedSystemComponent();
7859    parseBackboneAttributes(xpp, res);
7860    next(xpp);
7861    int eventType = nextNoWhitespace(xpp);
7862    while (eventType != XmlPullParser.END_TAG) {
7863  if (!parseExpansionProfileExpansionProfileExcludedSystemComponentContent(eventType, xpp, owner, res))
7864        unknownContent(xpp);
7865      eventType = nextNoWhitespace(xpp);
7866    }
7867    next(xpp);
7868    parseElementClose(res);
7869    return res;
7870  }
7871
7872  protected boolean parseExpansionProfileExpansionProfileExcludedSystemComponentContent(int eventType, XmlPullParser xpp, ExpansionProfile owner, ExpansionProfile.ExpansionProfileExcludedSystemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7873      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
7874        res.setSystemElement(parseUri(xpp));
7875      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
7876        res.setVersionElement(parseString(xpp));
7877      } else if (!parseBackboneContent(eventType, xpp, res))
7878        return false;
7879    return true;
7880  }
7881
7882  protected ExpansionProfile.ExpansionProfileDesignationComponent parseExpansionProfileExpansionProfileDesignationComponent(XmlPullParser xpp, ExpansionProfile owner) throws XmlPullParserException, IOException, FHIRFormatError {
7883    ExpansionProfile.ExpansionProfileDesignationComponent res = new ExpansionProfile.ExpansionProfileDesignationComponent();
7884    parseBackboneAttributes(xpp, res);
7885    next(xpp);
7886    int eventType = nextNoWhitespace(xpp);
7887    while (eventType != XmlPullParser.END_TAG) {
7888  if (!parseExpansionProfileExpansionProfileDesignationComponentContent(eventType, xpp, owner, res))
7889        unknownContent(xpp);
7890      eventType = nextNoWhitespace(xpp);
7891    }
7892    next(xpp);
7893    parseElementClose(res);
7894    return res;
7895  }
7896
7897  protected boolean parseExpansionProfileExpansionProfileDesignationComponentContent(int eventType, XmlPullParser xpp, ExpansionProfile owner, ExpansionProfile.ExpansionProfileDesignationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7898      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("include")) {
7899        res.setInclude(parseExpansionProfileDesignationIncludeComponent(xpp, owner));
7900      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("exclude")) {
7901        res.setExclude(parseExpansionProfileDesignationExcludeComponent(xpp, owner));
7902      } else if (!parseBackboneContent(eventType, xpp, res))
7903        return false;
7904    return true;
7905  }
7906
7907  protected ExpansionProfile.DesignationIncludeComponent parseExpansionProfileDesignationIncludeComponent(XmlPullParser xpp, ExpansionProfile owner) throws XmlPullParserException, IOException, FHIRFormatError {
7908    ExpansionProfile.DesignationIncludeComponent res = new ExpansionProfile.DesignationIncludeComponent();
7909    parseBackboneAttributes(xpp, res);
7910    next(xpp);
7911    int eventType = nextNoWhitespace(xpp);
7912    while (eventType != XmlPullParser.END_TAG) {
7913  if (!parseExpansionProfileDesignationIncludeComponentContent(eventType, xpp, owner, res))
7914        unknownContent(xpp);
7915      eventType = nextNoWhitespace(xpp);
7916    }
7917    next(xpp);
7918    parseElementClose(res);
7919    return res;
7920  }
7921
7922  protected boolean parseExpansionProfileDesignationIncludeComponentContent(int eventType, XmlPullParser xpp, ExpansionProfile owner, ExpansionProfile.DesignationIncludeComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7923      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("designation")) {
7924        res.getDesignation().add(parseExpansionProfileDesignationIncludeDesignationComponent(xpp, owner));
7925      } else if (!parseBackboneContent(eventType, xpp, res))
7926        return false;
7927    return true;
7928  }
7929
7930  protected ExpansionProfile.DesignationIncludeDesignationComponent parseExpansionProfileDesignationIncludeDesignationComponent(XmlPullParser xpp, ExpansionProfile owner) throws XmlPullParserException, IOException, FHIRFormatError {
7931    ExpansionProfile.DesignationIncludeDesignationComponent res = new ExpansionProfile.DesignationIncludeDesignationComponent();
7932    parseBackboneAttributes(xpp, res);
7933    next(xpp);
7934    int eventType = nextNoWhitespace(xpp);
7935    while (eventType != XmlPullParser.END_TAG) {
7936  if (!parseExpansionProfileDesignationIncludeDesignationComponentContent(eventType, xpp, owner, res))
7937        unknownContent(xpp);
7938      eventType = nextNoWhitespace(xpp);
7939    }
7940    next(xpp);
7941    parseElementClose(res);
7942    return res;
7943  }
7944
7945  protected boolean parseExpansionProfileDesignationIncludeDesignationComponentContent(int eventType, XmlPullParser xpp, ExpansionProfile owner, ExpansionProfile.DesignationIncludeDesignationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7946      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
7947        res.setLanguageElement(parseCode(xpp));
7948      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
7949        res.setUse(parseCoding(xpp));
7950      } else if (!parseBackboneContent(eventType, xpp, res))
7951        return false;
7952    return true;
7953  }
7954
7955  protected ExpansionProfile.DesignationExcludeComponent parseExpansionProfileDesignationExcludeComponent(XmlPullParser xpp, ExpansionProfile owner) throws XmlPullParserException, IOException, FHIRFormatError {
7956    ExpansionProfile.DesignationExcludeComponent res = new ExpansionProfile.DesignationExcludeComponent();
7957    parseBackboneAttributes(xpp, res);
7958    next(xpp);
7959    int eventType = nextNoWhitespace(xpp);
7960    while (eventType != XmlPullParser.END_TAG) {
7961  if (!parseExpansionProfileDesignationExcludeComponentContent(eventType, xpp, owner, res))
7962        unknownContent(xpp);
7963      eventType = nextNoWhitespace(xpp);
7964    }
7965    next(xpp);
7966    parseElementClose(res);
7967    return res;
7968  }
7969
7970  protected boolean parseExpansionProfileDesignationExcludeComponentContent(int eventType, XmlPullParser xpp, ExpansionProfile owner, ExpansionProfile.DesignationExcludeComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7971      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("designation")) {
7972        res.getDesignation().add(parseExpansionProfileDesignationExcludeDesignationComponent(xpp, owner));
7973      } else if (!parseBackboneContent(eventType, xpp, res))
7974        return false;
7975    return true;
7976  }
7977
7978  protected ExpansionProfile.DesignationExcludeDesignationComponent parseExpansionProfileDesignationExcludeDesignationComponent(XmlPullParser xpp, ExpansionProfile owner) throws XmlPullParserException, IOException, FHIRFormatError {
7979    ExpansionProfile.DesignationExcludeDesignationComponent res = new ExpansionProfile.DesignationExcludeDesignationComponent();
7980    parseBackboneAttributes(xpp, res);
7981    next(xpp);
7982    int eventType = nextNoWhitespace(xpp);
7983    while (eventType != XmlPullParser.END_TAG) {
7984  if (!parseExpansionProfileDesignationExcludeDesignationComponentContent(eventType, xpp, owner, res))
7985        unknownContent(xpp);
7986      eventType = nextNoWhitespace(xpp);
7987    }
7988    next(xpp);
7989    parseElementClose(res);
7990    return res;
7991  }
7992
7993  protected boolean parseExpansionProfileDesignationExcludeDesignationComponentContent(int eventType, XmlPullParser xpp, ExpansionProfile owner, ExpansionProfile.DesignationExcludeDesignationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7994      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
7995        res.setLanguageElement(parseCode(xpp));
7996      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
7997        res.setUse(parseCoding(xpp));
7998      } else if (!parseBackboneContent(eventType, xpp, res))
7999        return false;
8000    return true;
8001  }
8002
8003  protected ExplanationOfBenefit parseExplanationOfBenefit(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8004    ExplanationOfBenefit res = new ExplanationOfBenefit();
8005    parseDomainResourceAttributes(xpp, res);
8006    next(xpp);
8007    int eventType = nextNoWhitespace(xpp);
8008    while (eventType != XmlPullParser.END_TAG) {
8009  if (!parseExplanationOfBenefitContent(eventType, xpp, res))
8010        unknownContent(xpp);
8011      eventType = nextNoWhitespace(xpp);
8012    }
8013    next(xpp);
8014    parseElementClose(res);
8015    return res;
8016  }
8017
8018  protected boolean parseExplanationOfBenefitContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit res) throws XmlPullParserException, IOException, FHIRFormatError {
8019      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
8020        res.getIdentifier().add(parseIdentifier(xpp));
8021      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
8022        res.setStatusElement(parseEnumeration(xpp, ExplanationOfBenefit.ExplanationOfBenefitStatus.NULL, new ExplanationOfBenefit.ExplanationOfBenefitStatusEnumFactory()));
8023      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
8024        res.setType(parseCodeableConcept(xpp));
8025      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subType")) {
8026        res.getSubType().add(parseCodeableConcept(xpp));
8027      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
8028        res.setPatient(parseReference(xpp));
8029      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("billablePeriod")) {
8030        res.setBillablePeriod(parsePeriod(xpp));
8031      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
8032        res.setCreatedElement(parseDateTime(xpp));
8033      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("enterer")) {
8034        res.setEnterer(parseReference(xpp));
8035      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurer")) {
8036        res.setInsurer(parseReference(xpp));
8037      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("provider")) {
8038        res.setProvider(parseReference(xpp));
8039      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("organization")) {
8040        res.setOrganization(parseReference(xpp));
8041      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referral")) {
8042        res.setReferral(parseReference(xpp));
8043      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("facility")) {
8044        res.setFacility(parseReference(xpp));
8045      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("claim")) {
8046        res.setClaim(parseReference(xpp));
8047      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("claimResponse")) {
8048        res.setClaimResponse(parseReference(xpp));
8049      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
8050        res.setOutcome(parseCodeableConcept(xpp));
8051      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("disposition")) {
8052        res.setDispositionElement(parseString(xpp));
8053      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("related")) {
8054        res.getRelated().add(parseExplanationOfBenefitRelatedClaimComponent(xpp, res));
8055      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prescription")) {
8056        res.setPrescription(parseReference(xpp));
8057      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("originalPrescription")) {
8058        res.setOriginalPrescription(parseReference(xpp));
8059      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payee")) {
8060        res.setPayee(parseExplanationOfBenefitPayeeComponent(xpp, res));
8061      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("information")) {
8062        res.getInformation().add(parseExplanationOfBenefitSupportingInformationComponent(xpp, res));
8063      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("careTeam")) {
8064        res.getCareTeam().add(parseExplanationOfBenefitCareTeamComponent(xpp, res));
8065      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diagnosis")) {
8066        res.getDiagnosis().add(parseExplanationOfBenefitDiagnosisComponent(xpp, res));
8067      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("procedure")) {
8068        res.getProcedure().add(parseExplanationOfBenefitProcedureComponent(xpp, res));
8069      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("precedence")) {
8070        res.setPrecedenceElement(parsePositiveInt(xpp));
8071      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurance")) {
8072        res.setInsurance(parseExplanationOfBenefitInsuranceComponent(xpp, res));
8073      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("accident")) {
8074        res.setAccident(parseExplanationOfBenefitAccidentComponent(xpp, res));
8075      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("employmentImpacted")) {
8076        res.setEmploymentImpacted(parsePeriod(xpp));
8077      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("hospitalization")) {
8078        res.setHospitalization(parsePeriod(xpp));
8079      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("item")) {
8080        res.getItem().add(parseExplanationOfBenefitItemComponent(xpp, res));
8081      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("addItem")) {
8082        res.getAddItem().add(parseExplanationOfBenefitAddedItemComponent(xpp, res));
8083      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("totalCost")) {
8084        res.setTotalCost(parseMoney(xpp));
8085      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unallocDeductable")) {
8086        res.setUnallocDeductable(parseMoney(xpp));
8087      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("totalBenefit")) {
8088        res.setTotalBenefit(parseMoney(xpp));
8089      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payment")) {
8090        res.setPayment(parseExplanationOfBenefitPaymentComponent(xpp, res));
8091      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("form")) {
8092        res.setForm(parseCodeableConcept(xpp));
8093      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("processNote")) {
8094        res.getProcessNote().add(parseExplanationOfBenefitNoteComponent(xpp, res));
8095      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("benefitBalance")) {
8096        res.getBenefitBalance().add(parseExplanationOfBenefitBenefitBalanceComponent(xpp, res));
8097      } else if (!parseDomainResourceContent(eventType, xpp, res))
8098        return false;
8099    return true;
8100  }
8101
8102  protected ExplanationOfBenefit.RelatedClaimComponent parseExplanationOfBenefitRelatedClaimComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8103    ExplanationOfBenefit.RelatedClaimComponent res = new ExplanationOfBenefit.RelatedClaimComponent();
8104    parseBackboneAttributes(xpp, res);
8105    next(xpp);
8106    int eventType = nextNoWhitespace(xpp);
8107    while (eventType != XmlPullParser.END_TAG) {
8108  if (!parseExplanationOfBenefitRelatedClaimComponentContent(eventType, xpp, owner, res))
8109        unknownContent(xpp);
8110      eventType = nextNoWhitespace(xpp);
8111    }
8112    next(xpp);
8113    parseElementClose(res);
8114    return res;
8115  }
8116
8117  protected boolean parseExplanationOfBenefitRelatedClaimComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.RelatedClaimComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8118      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("claim")) {
8119        res.setClaim(parseReference(xpp));
8120      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relationship")) {
8121        res.setRelationship(parseCodeableConcept(xpp));
8122      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
8123        res.setReference(parseIdentifier(xpp));
8124      } else if (!parseBackboneContent(eventType, xpp, res))
8125        return false;
8126    return true;
8127  }
8128
8129  protected ExplanationOfBenefit.PayeeComponent parseExplanationOfBenefitPayeeComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8130    ExplanationOfBenefit.PayeeComponent res = new ExplanationOfBenefit.PayeeComponent();
8131    parseBackboneAttributes(xpp, res);
8132    next(xpp);
8133    int eventType = nextNoWhitespace(xpp);
8134    while (eventType != XmlPullParser.END_TAG) {
8135  if (!parseExplanationOfBenefitPayeeComponentContent(eventType, xpp, owner, res))
8136        unknownContent(xpp);
8137      eventType = nextNoWhitespace(xpp);
8138    }
8139    next(xpp);
8140    parseElementClose(res);
8141    return res;
8142  }
8143
8144  protected boolean parseExplanationOfBenefitPayeeComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.PayeeComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8145      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
8146        res.setType(parseCodeableConcept(xpp));
8147      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resourceType")) {
8148        res.setResourceType(parseCodeableConcept(xpp));
8149      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("party")) {
8150        res.setParty(parseReference(xpp));
8151      } else if (!parseBackboneContent(eventType, xpp, res))
8152        return false;
8153    return true;
8154  }
8155
8156  protected ExplanationOfBenefit.SupportingInformationComponent parseExplanationOfBenefitSupportingInformationComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8157    ExplanationOfBenefit.SupportingInformationComponent res = new ExplanationOfBenefit.SupportingInformationComponent();
8158    parseBackboneAttributes(xpp, res);
8159    next(xpp);
8160    int eventType = nextNoWhitespace(xpp);
8161    while (eventType != XmlPullParser.END_TAG) {
8162  if (!parseExplanationOfBenefitSupportingInformationComponentContent(eventType, xpp, owner, res))
8163        unknownContent(xpp);
8164      eventType = nextNoWhitespace(xpp);
8165    }
8166    next(xpp);
8167    parseElementClose(res);
8168    return res;
8169  }
8170
8171  protected boolean parseExplanationOfBenefitSupportingInformationComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.SupportingInformationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8172      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
8173        res.setSequenceElement(parsePositiveInt(xpp));
8174      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
8175        res.setCategory(parseCodeableConcept(xpp));
8176      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
8177        res.setCode(parseCodeableConcept(xpp));
8178      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "timing")) {
8179        res.setTiming(parseType("timing", xpp));
8180      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
8181        res.setValue(parseType("value", xpp));
8182      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
8183        res.setReason(parseCoding(xpp));
8184      } else if (!parseBackboneContent(eventType, xpp, res))
8185        return false;
8186    return true;
8187  }
8188
8189  protected ExplanationOfBenefit.CareTeamComponent parseExplanationOfBenefitCareTeamComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8190    ExplanationOfBenefit.CareTeamComponent res = new ExplanationOfBenefit.CareTeamComponent();
8191    parseBackboneAttributes(xpp, res);
8192    next(xpp);
8193    int eventType = nextNoWhitespace(xpp);
8194    while (eventType != XmlPullParser.END_TAG) {
8195  if (!parseExplanationOfBenefitCareTeamComponentContent(eventType, xpp, owner, res))
8196        unknownContent(xpp);
8197      eventType = nextNoWhitespace(xpp);
8198    }
8199    next(xpp);
8200    parseElementClose(res);
8201    return res;
8202  }
8203
8204  protected boolean parseExplanationOfBenefitCareTeamComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.CareTeamComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8205      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
8206        res.setSequenceElement(parsePositiveInt(xpp));
8207      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("provider")) {
8208        res.setProvider(parseReference(xpp));
8209      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("responsible")) {
8210        res.setResponsibleElement(parseBoolean(xpp));
8211      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
8212        res.setRole(parseCodeableConcept(xpp));
8213      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("qualification")) {
8214        res.setQualification(parseCodeableConcept(xpp));
8215      } else if (!parseBackboneContent(eventType, xpp, res))
8216        return false;
8217    return true;
8218  }
8219
8220  protected ExplanationOfBenefit.DiagnosisComponent parseExplanationOfBenefitDiagnosisComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8221    ExplanationOfBenefit.DiagnosisComponent res = new ExplanationOfBenefit.DiagnosisComponent();
8222    parseBackboneAttributes(xpp, res);
8223    next(xpp);
8224    int eventType = nextNoWhitespace(xpp);
8225    while (eventType != XmlPullParser.END_TAG) {
8226  if (!parseExplanationOfBenefitDiagnosisComponentContent(eventType, xpp, owner, res))
8227        unknownContent(xpp);
8228      eventType = nextNoWhitespace(xpp);
8229    }
8230    next(xpp);
8231    parseElementClose(res);
8232    return res;
8233  }
8234
8235  protected boolean parseExplanationOfBenefitDiagnosisComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.DiagnosisComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8236      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
8237        res.setSequenceElement(parsePositiveInt(xpp));
8238      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "diagnosis")) {
8239        res.setDiagnosis(parseType("diagnosis", xpp));
8240      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
8241        res.getType().add(parseCodeableConcept(xpp));
8242      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("packageCode")) {
8243        res.setPackageCode(parseCodeableConcept(xpp));
8244      } else if (!parseBackboneContent(eventType, xpp, res))
8245        return false;
8246    return true;
8247  }
8248
8249  protected ExplanationOfBenefit.ProcedureComponent parseExplanationOfBenefitProcedureComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8250    ExplanationOfBenefit.ProcedureComponent res = new ExplanationOfBenefit.ProcedureComponent();
8251    parseBackboneAttributes(xpp, res);
8252    next(xpp);
8253    int eventType = nextNoWhitespace(xpp);
8254    while (eventType != XmlPullParser.END_TAG) {
8255  if (!parseExplanationOfBenefitProcedureComponentContent(eventType, xpp, owner, res))
8256        unknownContent(xpp);
8257      eventType = nextNoWhitespace(xpp);
8258    }
8259    next(xpp);
8260    parseElementClose(res);
8261    return res;
8262  }
8263
8264  protected boolean parseExplanationOfBenefitProcedureComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.ProcedureComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8265      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
8266        res.setSequenceElement(parsePositiveInt(xpp));
8267      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
8268        res.setDateElement(parseDateTime(xpp));
8269      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "procedure")) {
8270        res.setProcedure(parseType("procedure", xpp));
8271      } else if (!parseBackboneContent(eventType, xpp, res))
8272        return false;
8273    return true;
8274  }
8275
8276  protected ExplanationOfBenefit.InsuranceComponent parseExplanationOfBenefitInsuranceComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8277    ExplanationOfBenefit.InsuranceComponent res = new ExplanationOfBenefit.InsuranceComponent();
8278    parseBackboneAttributes(xpp, res);
8279    next(xpp);
8280    int eventType = nextNoWhitespace(xpp);
8281    while (eventType != XmlPullParser.END_TAG) {
8282  if (!parseExplanationOfBenefitInsuranceComponentContent(eventType, xpp, owner, res))
8283        unknownContent(xpp);
8284      eventType = nextNoWhitespace(xpp);
8285    }
8286    next(xpp);
8287    parseElementClose(res);
8288    return res;
8289  }
8290
8291  protected boolean parseExplanationOfBenefitInsuranceComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.InsuranceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8292      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
8293        res.setCoverage(parseReference(xpp));
8294      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("preAuthRef")) {
8295        res.getPreAuthRef().add(parseString(xpp));
8296      } else if (!parseBackboneContent(eventType, xpp, res))
8297        return false;
8298    return true;
8299  }
8300
8301  protected ExplanationOfBenefit.AccidentComponent parseExplanationOfBenefitAccidentComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8302    ExplanationOfBenefit.AccidentComponent res = new ExplanationOfBenefit.AccidentComponent();
8303    parseBackboneAttributes(xpp, res);
8304    next(xpp);
8305    int eventType = nextNoWhitespace(xpp);
8306    while (eventType != XmlPullParser.END_TAG) {
8307  if (!parseExplanationOfBenefitAccidentComponentContent(eventType, xpp, owner, res))
8308        unknownContent(xpp);
8309      eventType = nextNoWhitespace(xpp);
8310    }
8311    next(xpp);
8312    parseElementClose(res);
8313    return res;
8314  }
8315
8316  protected boolean parseExplanationOfBenefitAccidentComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.AccidentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8317      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
8318        res.setDateElement(parseDate(xpp));
8319      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
8320        res.setType(parseCodeableConcept(xpp));
8321      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "location")) {
8322        res.setLocation(parseType("location", xpp));
8323      } else if (!parseBackboneContent(eventType, xpp, res))
8324        return false;
8325    return true;
8326  }
8327
8328  protected ExplanationOfBenefit.ItemComponent parseExplanationOfBenefitItemComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8329    ExplanationOfBenefit.ItemComponent res = new ExplanationOfBenefit.ItemComponent();
8330    parseBackboneAttributes(xpp, res);
8331    next(xpp);
8332    int eventType = nextNoWhitespace(xpp);
8333    while (eventType != XmlPullParser.END_TAG) {
8334  if (!parseExplanationOfBenefitItemComponentContent(eventType, xpp, owner, res))
8335        unknownContent(xpp);
8336      eventType = nextNoWhitespace(xpp);
8337    }
8338    next(xpp);
8339    parseElementClose(res);
8340    return res;
8341  }
8342
8343  protected boolean parseExplanationOfBenefitItemComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.ItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8344      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
8345        res.setSequenceElement(parsePositiveInt(xpp));
8346      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("careTeamLinkId")) {
8347        res.getCareTeamLinkId().add(parsePositiveInt(xpp));
8348      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diagnosisLinkId")) {
8349        res.getDiagnosisLinkId().add(parsePositiveInt(xpp));
8350      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("procedureLinkId")) {
8351        res.getProcedureLinkId().add(parsePositiveInt(xpp));
8352      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("informationLinkId")) {
8353        res.getInformationLinkId().add(parsePositiveInt(xpp));
8354      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
8355        res.setRevenue(parseCodeableConcept(xpp));
8356      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
8357        res.setCategory(parseCodeableConcept(xpp));
8358      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
8359        res.setService(parseCodeableConcept(xpp));
8360      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
8361        res.getModifier().add(parseCodeableConcept(xpp));
8362      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("programCode")) {
8363        res.getProgramCode().add(parseCodeableConcept(xpp));
8364      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "serviced")) {
8365        res.setServiced(parseType("serviced", xpp));
8366      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "location")) {
8367        res.setLocation(parseType("location", xpp));
8368      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
8369        res.setQuantity(parseSimpleQuantity(xpp));
8370      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
8371        res.setUnitPrice(parseMoney(xpp));
8372      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
8373        res.setFactorElement(parseDecimal(xpp));
8374      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
8375        res.setNet(parseMoney(xpp));
8376      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("udi")) {
8377        res.getUdi().add(parseReference(xpp));
8378      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodySite")) {
8379        res.setBodySite(parseCodeableConcept(xpp));
8380      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subSite")) {
8381        res.getSubSite().add(parseCodeableConcept(xpp));
8382      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
8383        res.getEncounter().add(parseReference(xpp));
8384      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
8385        res.getNoteNumber().add(parsePositiveInt(xpp));
8386      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
8387        res.getAdjudication().add(parseExplanationOfBenefitAdjudicationComponent(xpp, owner));
8388      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
8389        res.getDetail().add(parseExplanationOfBenefitDetailComponent(xpp, owner));
8390      } else if (!parseBackboneContent(eventType, xpp, res))
8391        return false;
8392    return true;
8393  }
8394
8395  protected ExplanationOfBenefit.AdjudicationComponent parseExplanationOfBenefitAdjudicationComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8396    ExplanationOfBenefit.AdjudicationComponent res = new ExplanationOfBenefit.AdjudicationComponent();
8397    parseBackboneAttributes(xpp, res);
8398    next(xpp);
8399    int eventType = nextNoWhitespace(xpp);
8400    while (eventType != XmlPullParser.END_TAG) {
8401  if (!parseExplanationOfBenefitAdjudicationComponentContent(eventType, xpp, owner, res))
8402        unknownContent(xpp);
8403      eventType = nextNoWhitespace(xpp);
8404    }
8405    next(xpp);
8406    parseElementClose(res);
8407    return res;
8408  }
8409
8410  protected boolean parseExplanationOfBenefitAdjudicationComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.AdjudicationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8411      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
8412        res.setCategory(parseCodeableConcept(xpp));
8413      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
8414        res.setReason(parseCodeableConcept(xpp));
8415      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("amount")) {
8416        res.setAmount(parseMoney(xpp));
8417      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
8418        res.setValueElement(parseDecimal(xpp));
8419      } else if (!parseBackboneContent(eventType, xpp, res))
8420        return false;
8421    return true;
8422  }
8423
8424  protected ExplanationOfBenefit.DetailComponent parseExplanationOfBenefitDetailComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8425    ExplanationOfBenefit.DetailComponent res = new ExplanationOfBenefit.DetailComponent();
8426    parseBackboneAttributes(xpp, res);
8427    next(xpp);
8428    int eventType = nextNoWhitespace(xpp);
8429    while (eventType != XmlPullParser.END_TAG) {
8430  if (!parseExplanationOfBenefitDetailComponentContent(eventType, xpp, owner, res))
8431        unknownContent(xpp);
8432      eventType = nextNoWhitespace(xpp);
8433    }
8434    next(xpp);
8435    parseElementClose(res);
8436    return res;
8437  }
8438
8439  protected boolean parseExplanationOfBenefitDetailComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.DetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8440      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
8441        res.setSequenceElement(parsePositiveInt(xpp));
8442      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
8443        res.setType(parseCodeableConcept(xpp));
8444      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
8445        res.setRevenue(parseCodeableConcept(xpp));
8446      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
8447        res.setCategory(parseCodeableConcept(xpp));
8448      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
8449        res.setService(parseCodeableConcept(xpp));
8450      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
8451        res.getModifier().add(parseCodeableConcept(xpp));
8452      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("programCode")) {
8453        res.getProgramCode().add(parseCodeableConcept(xpp));
8454      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
8455        res.setQuantity(parseSimpleQuantity(xpp));
8456      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
8457        res.setUnitPrice(parseMoney(xpp));
8458      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
8459        res.setFactorElement(parseDecimal(xpp));
8460      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
8461        res.setNet(parseMoney(xpp));
8462      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("udi")) {
8463        res.getUdi().add(parseReference(xpp));
8464      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
8465        res.getNoteNumber().add(parsePositiveInt(xpp));
8466      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
8467        res.getAdjudication().add(parseExplanationOfBenefitAdjudicationComponent(xpp, owner));
8468      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subDetail")) {
8469        res.getSubDetail().add(parseExplanationOfBenefitSubDetailComponent(xpp, owner));
8470      } else if (!parseBackboneContent(eventType, xpp, res))
8471        return false;
8472    return true;
8473  }
8474
8475  protected ExplanationOfBenefit.SubDetailComponent parseExplanationOfBenefitSubDetailComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8476    ExplanationOfBenefit.SubDetailComponent res = new ExplanationOfBenefit.SubDetailComponent();
8477    parseBackboneAttributes(xpp, res);
8478    next(xpp);
8479    int eventType = nextNoWhitespace(xpp);
8480    while (eventType != XmlPullParser.END_TAG) {
8481  if (!parseExplanationOfBenefitSubDetailComponentContent(eventType, xpp, owner, res))
8482        unknownContent(xpp);
8483      eventType = nextNoWhitespace(xpp);
8484    }
8485    next(xpp);
8486    parseElementClose(res);
8487    return res;
8488  }
8489
8490  protected boolean parseExplanationOfBenefitSubDetailComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.SubDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8491      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
8492        res.setSequenceElement(parsePositiveInt(xpp));
8493      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
8494        res.setType(parseCodeableConcept(xpp));
8495      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
8496        res.setRevenue(parseCodeableConcept(xpp));
8497      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
8498        res.setCategory(parseCodeableConcept(xpp));
8499      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
8500        res.setService(parseCodeableConcept(xpp));
8501      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
8502        res.getModifier().add(parseCodeableConcept(xpp));
8503      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("programCode")) {
8504        res.getProgramCode().add(parseCodeableConcept(xpp));
8505      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
8506        res.setQuantity(parseSimpleQuantity(xpp));
8507      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
8508        res.setUnitPrice(parseMoney(xpp));
8509      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
8510        res.setFactorElement(parseDecimal(xpp));
8511      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
8512        res.setNet(parseMoney(xpp));
8513      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("udi")) {
8514        res.getUdi().add(parseReference(xpp));
8515      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
8516        res.getNoteNumber().add(parsePositiveInt(xpp));
8517      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
8518        res.getAdjudication().add(parseExplanationOfBenefitAdjudicationComponent(xpp, owner));
8519      } else if (!parseBackboneContent(eventType, xpp, res))
8520        return false;
8521    return true;
8522  }
8523
8524  protected ExplanationOfBenefit.AddedItemComponent parseExplanationOfBenefitAddedItemComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8525    ExplanationOfBenefit.AddedItemComponent res = new ExplanationOfBenefit.AddedItemComponent();
8526    parseBackboneAttributes(xpp, res);
8527    next(xpp);
8528    int eventType = nextNoWhitespace(xpp);
8529    while (eventType != XmlPullParser.END_TAG) {
8530  if (!parseExplanationOfBenefitAddedItemComponentContent(eventType, xpp, owner, res))
8531        unknownContent(xpp);
8532      eventType = nextNoWhitespace(xpp);
8533    }
8534    next(xpp);
8535    parseElementClose(res);
8536    return res;
8537  }
8538
8539  protected boolean parseExplanationOfBenefitAddedItemComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.AddedItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8540      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequenceLinkId")) {
8541        res.getSequenceLinkId().add(parsePositiveInt(xpp));
8542      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
8543        res.setRevenue(parseCodeableConcept(xpp));
8544      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
8545        res.setCategory(parseCodeableConcept(xpp));
8546      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
8547        res.setService(parseCodeableConcept(xpp));
8548      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
8549        res.getModifier().add(parseCodeableConcept(xpp));
8550      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fee")) {
8551        res.setFee(parseMoney(xpp));
8552      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
8553        res.getNoteNumber().add(parsePositiveInt(xpp));
8554      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
8555        res.getAdjudication().add(parseExplanationOfBenefitAdjudicationComponent(xpp, owner));
8556      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
8557        res.getDetail().add(parseExplanationOfBenefitAddedItemsDetailComponent(xpp, owner));
8558      } else if (!parseBackboneContent(eventType, xpp, res))
8559        return false;
8560    return true;
8561  }
8562
8563  protected ExplanationOfBenefit.AddedItemsDetailComponent parseExplanationOfBenefitAddedItemsDetailComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8564    ExplanationOfBenefit.AddedItemsDetailComponent res = new ExplanationOfBenefit.AddedItemsDetailComponent();
8565    parseBackboneAttributes(xpp, res);
8566    next(xpp);
8567    int eventType = nextNoWhitespace(xpp);
8568    while (eventType != XmlPullParser.END_TAG) {
8569  if (!parseExplanationOfBenefitAddedItemsDetailComponentContent(eventType, xpp, owner, res))
8570        unknownContent(xpp);
8571      eventType = nextNoWhitespace(xpp);
8572    }
8573    next(xpp);
8574    parseElementClose(res);
8575    return res;
8576  }
8577
8578  protected boolean parseExplanationOfBenefitAddedItemsDetailComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.AddedItemsDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8579      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
8580        res.setRevenue(parseCodeableConcept(xpp));
8581      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
8582        res.setCategory(parseCodeableConcept(xpp));
8583      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
8584        res.setService(parseCodeableConcept(xpp));
8585      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
8586        res.getModifier().add(parseCodeableConcept(xpp));
8587      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fee")) {
8588        res.setFee(parseMoney(xpp));
8589      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
8590        res.getNoteNumber().add(parsePositiveInt(xpp));
8591      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
8592        res.getAdjudication().add(parseExplanationOfBenefitAdjudicationComponent(xpp, owner));
8593      } else if (!parseBackboneContent(eventType, xpp, res))
8594        return false;
8595    return true;
8596  }
8597
8598  protected ExplanationOfBenefit.PaymentComponent parseExplanationOfBenefitPaymentComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8599    ExplanationOfBenefit.PaymentComponent res = new ExplanationOfBenefit.PaymentComponent();
8600    parseBackboneAttributes(xpp, res);
8601    next(xpp);
8602    int eventType = nextNoWhitespace(xpp);
8603    while (eventType != XmlPullParser.END_TAG) {
8604  if (!parseExplanationOfBenefitPaymentComponentContent(eventType, xpp, owner, res))
8605        unknownContent(xpp);
8606      eventType = nextNoWhitespace(xpp);
8607    }
8608    next(xpp);
8609    parseElementClose(res);
8610    return res;
8611  }
8612
8613  protected boolean parseExplanationOfBenefitPaymentComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.PaymentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8614      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
8615        res.setType(parseCodeableConcept(xpp));
8616      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjustment")) {
8617        res.setAdjustment(parseMoney(xpp));
8618      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjustmentReason")) {
8619        res.setAdjustmentReason(parseCodeableConcept(xpp));
8620      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
8621        res.setDateElement(parseDate(xpp));
8622      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("amount")) {
8623        res.setAmount(parseMoney(xpp));
8624      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
8625        res.setIdentifier(parseIdentifier(xpp));
8626      } else if (!parseBackboneContent(eventType, xpp, res))
8627        return false;
8628    return true;
8629  }
8630
8631  protected ExplanationOfBenefit.NoteComponent parseExplanationOfBenefitNoteComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8632    ExplanationOfBenefit.NoteComponent res = new ExplanationOfBenefit.NoteComponent();
8633    parseBackboneAttributes(xpp, res);
8634    next(xpp);
8635    int eventType = nextNoWhitespace(xpp);
8636    while (eventType != XmlPullParser.END_TAG) {
8637  if (!parseExplanationOfBenefitNoteComponentContent(eventType, xpp, owner, res))
8638        unknownContent(xpp);
8639      eventType = nextNoWhitespace(xpp);
8640    }
8641    next(xpp);
8642    parseElementClose(res);
8643    return res;
8644  }
8645
8646  protected boolean parseExplanationOfBenefitNoteComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.NoteComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8647      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("number")) {
8648        res.setNumberElement(parsePositiveInt(xpp));
8649      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
8650        res.setType(parseCodeableConcept(xpp));
8651      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
8652        res.setTextElement(parseString(xpp));
8653      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
8654        res.setLanguage(parseCodeableConcept(xpp));
8655      } else if (!parseBackboneContent(eventType, xpp, res))
8656        return false;
8657    return true;
8658  }
8659
8660  protected ExplanationOfBenefit.BenefitBalanceComponent parseExplanationOfBenefitBenefitBalanceComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8661    ExplanationOfBenefit.BenefitBalanceComponent res = new ExplanationOfBenefit.BenefitBalanceComponent();
8662    parseBackboneAttributes(xpp, res);
8663    next(xpp);
8664    int eventType = nextNoWhitespace(xpp);
8665    while (eventType != XmlPullParser.END_TAG) {
8666  if (!parseExplanationOfBenefitBenefitBalanceComponentContent(eventType, xpp, owner, res))
8667        unknownContent(xpp);
8668      eventType = nextNoWhitespace(xpp);
8669    }
8670    next(xpp);
8671    parseElementClose(res);
8672    return res;
8673  }
8674
8675  protected boolean parseExplanationOfBenefitBenefitBalanceComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.BenefitBalanceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8676      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
8677        res.setCategory(parseCodeableConcept(xpp));
8678      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subCategory")) {
8679        res.setSubCategory(parseCodeableConcept(xpp));
8680      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("excluded")) {
8681        res.setExcludedElement(parseBoolean(xpp));
8682      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
8683        res.setNameElement(parseString(xpp));
8684      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
8685        res.setDescriptionElement(parseString(xpp));
8686      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("network")) {
8687        res.setNetwork(parseCodeableConcept(xpp));
8688      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unit")) {
8689        res.setUnit(parseCodeableConcept(xpp));
8690      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("term")) {
8691        res.setTerm(parseCodeableConcept(xpp));
8692      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("financial")) {
8693        res.getFinancial().add(parseExplanationOfBenefitBenefitComponent(xpp, owner));
8694      } else if (!parseBackboneContent(eventType, xpp, res))
8695        return false;
8696    return true;
8697  }
8698
8699  protected ExplanationOfBenefit.BenefitComponent parseExplanationOfBenefitBenefitComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8700    ExplanationOfBenefit.BenefitComponent res = new ExplanationOfBenefit.BenefitComponent();
8701    parseBackboneAttributes(xpp, res);
8702    next(xpp);
8703    int eventType = nextNoWhitespace(xpp);
8704    while (eventType != XmlPullParser.END_TAG) {
8705  if (!parseExplanationOfBenefitBenefitComponentContent(eventType, xpp, owner, res))
8706        unknownContent(xpp);
8707      eventType = nextNoWhitespace(xpp);
8708    }
8709    next(xpp);
8710    parseElementClose(res);
8711    return res;
8712  }
8713
8714  protected boolean parseExplanationOfBenefitBenefitComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.BenefitComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8715      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
8716        res.setType(parseCodeableConcept(xpp));
8717      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "allowed")) {
8718        res.setAllowed(parseType("allowed", xpp));
8719      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "used")) {
8720        res.setUsed(parseType("used", xpp));
8721      } else if (!parseBackboneContent(eventType, xpp, res))
8722        return false;
8723    return true;
8724  }
8725
8726  protected FamilyMemberHistory parseFamilyMemberHistory(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8727    FamilyMemberHistory res = new FamilyMemberHistory();
8728    parseDomainResourceAttributes(xpp, res);
8729    next(xpp);
8730    int eventType = nextNoWhitespace(xpp);
8731    while (eventType != XmlPullParser.END_TAG) {
8732  if (!parseFamilyMemberHistoryContent(eventType, xpp, res))
8733        unknownContent(xpp);
8734      eventType = nextNoWhitespace(xpp);
8735    }
8736    next(xpp);
8737    parseElementClose(res);
8738    return res;
8739  }
8740
8741  protected boolean parseFamilyMemberHistoryContent(int eventType, XmlPullParser xpp, FamilyMemberHistory res) throws XmlPullParserException, IOException, FHIRFormatError {
8742      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
8743        res.getIdentifier().add(parseIdentifier(xpp));
8744      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
8745        res.getDefinition().add(parseReference(xpp));
8746      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
8747        res.setStatusElement(parseEnumeration(xpp, FamilyMemberHistory.FamilyHistoryStatus.NULL, new FamilyMemberHistory.FamilyHistoryStatusEnumFactory()));
8748      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("notDone")) {
8749        res.setNotDoneElement(parseBoolean(xpp));
8750      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("notDoneReason")) {
8751        res.setNotDoneReason(parseCodeableConcept(xpp));
8752      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
8753        res.setPatient(parseReference(xpp));
8754      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
8755        res.setDateElement(parseDateTime(xpp));
8756      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
8757        res.setNameElement(parseString(xpp));
8758      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relationship")) {
8759        res.setRelationship(parseCodeableConcept(xpp));
8760      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("gender")) {
8761        res.setGenderElement(parseEnumeration(xpp, Enumerations.AdministrativeGender.NULL, new Enumerations.AdministrativeGenderEnumFactory()));
8762      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "born")) {
8763        res.setBorn(parseType("born", xpp));
8764      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "age")) {
8765        res.setAge(parseType("age", xpp));
8766      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("estimatedAge")) {
8767        res.setEstimatedAgeElement(parseBoolean(xpp));
8768      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "deceased")) {
8769        res.setDeceased(parseType("deceased", xpp));
8770      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonCode")) {
8771        res.getReasonCode().add(parseCodeableConcept(xpp));
8772      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonReference")) {
8773        res.getReasonReference().add(parseReference(xpp));
8774      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
8775        res.getNote().add(parseAnnotation(xpp));
8776      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("condition")) {
8777        res.getCondition().add(parseFamilyMemberHistoryFamilyMemberHistoryConditionComponent(xpp, res));
8778      } else if (!parseDomainResourceContent(eventType, xpp, res))
8779        return false;
8780    return true;
8781  }
8782
8783  protected FamilyMemberHistory.FamilyMemberHistoryConditionComponent parseFamilyMemberHistoryFamilyMemberHistoryConditionComponent(XmlPullParser xpp, FamilyMemberHistory owner) throws XmlPullParserException, IOException, FHIRFormatError {
8784    FamilyMemberHistory.FamilyMemberHistoryConditionComponent res = new FamilyMemberHistory.FamilyMemberHistoryConditionComponent();
8785    parseBackboneAttributes(xpp, res);
8786    next(xpp);
8787    int eventType = nextNoWhitespace(xpp);
8788    while (eventType != XmlPullParser.END_TAG) {
8789  if (!parseFamilyMemberHistoryFamilyMemberHistoryConditionComponentContent(eventType, xpp, owner, res))
8790        unknownContent(xpp);
8791      eventType = nextNoWhitespace(xpp);
8792    }
8793    next(xpp);
8794    parseElementClose(res);
8795    return res;
8796  }
8797
8798  protected boolean parseFamilyMemberHistoryFamilyMemberHistoryConditionComponentContent(int eventType, XmlPullParser xpp, FamilyMemberHistory owner, FamilyMemberHistory.FamilyMemberHistoryConditionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8799      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
8800        res.setCode(parseCodeableConcept(xpp));
8801      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
8802        res.setOutcome(parseCodeableConcept(xpp));
8803      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "onset")) {
8804        res.setOnset(parseType("onset", xpp));
8805      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
8806        res.getNote().add(parseAnnotation(xpp));
8807      } else if (!parseBackboneContent(eventType, xpp, res))
8808        return false;
8809    return true;
8810  }
8811
8812  protected Flag parseFlag(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8813    Flag res = new Flag();
8814    parseDomainResourceAttributes(xpp, res);
8815    next(xpp);
8816    int eventType = nextNoWhitespace(xpp);
8817    while (eventType != XmlPullParser.END_TAG) {
8818  if (!parseFlagContent(eventType, xpp, res))
8819        unknownContent(xpp);
8820      eventType = nextNoWhitespace(xpp);
8821    }
8822    next(xpp);
8823    parseElementClose(res);
8824    return res;
8825  }
8826
8827  protected boolean parseFlagContent(int eventType, XmlPullParser xpp, Flag res) throws XmlPullParserException, IOException, FHIRFormatError {
8828      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
8829        res.getIdentifier().add(parseIdentifier(xpp));
8830      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
8831        res.setStatusElement(parseEnumeration(xpp, Flag.FlagStatus.NULL, new Flag.FlagStatusEnumFactory()));
8832      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
8833        res.setCategory(parseCodeableConcept(xpp));
8834      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
8835        res.setCode(parseCodeableConcept(xpp));
8836      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
8837        res.setSubject(parseReference(xpp));
8838      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
8839        res.setPeriod(parsePeriod(xpp));
8840      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
8841        res.setEncounter(parseReference(xpp));
8842      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
8843        res.setAuthor(parseReference(xpp));
8844      } else if (!parseDomainResourceContent(eventType, xpp, res))
8845        return false;
8846    return true;
8847  }
8848
8849  protected Goal parseGoal(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8850    Goal res = new Goal();
8851    parseDomainResourceAttributes(xpp, res);
8852    next(xpp);
8853    int eventType = nextNoWhitespace(xpp);
8854    while (eventType != XmlPullParser.END_TAG) {
8855  if (!parseGoalContent(eventType, xpp, res))
8856        unknownContent(xpp);
8857      eventType = nextNoWhitespace(xpp);
8858    }
8859    next(xpp);
8860    parseElementClose(res);
8861    return res;
8862  }
8863
8864  protected boolean parseGoalContent(int eventType, XmlPullParser xpp, Goal res) throws XmlPullParserException, IOException, FHIRFormatError {
8865      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
8866        res.getIdentifier().add(parseIdentifier(xpp));
8867      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
8868        res.setStatusElement(parseEnumeration(xpp, Goal.GoalStatus.NULL, new Goal.GoalStatusEnumFactory()));
8869      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
8870        res.getCategory().add(parseCodeableConcept(xpp));
8871      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
8872        res.setPriority(parseCodeableConcept(xpp));
8873      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
8874        res.setDescription(parseCodeableConcept(xpp));
8875      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
8876        res.setSubject(parseReference(xpp));
8877      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "start")) {
8878        res.setStart(parseType("start", xpp));
8879      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("target")) {
8880        res.setTarget(parseGoalGoalTargetComponent(xpp, res));
8881      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("statusDate")) {
8882        res.setStatusDateElement(parseDate(xpp));
8883      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("statusReason")) {
8884        res.setStatusReasonElement(parseString(xpp));
8885      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expressedBy")) {
8886        res.setExpressedBy(parseReference(xpp));
8887      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("addresses")) {
8888        res.getAddresses().add(parseReference(xpp));
8889      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
8890        res.getNote().add(parseAnnotation(xpp));
8891      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcomeCode")) {
8892        res.getOutcomeCode().add(parseCodeableConcept(xpp));
8893      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcomeReference")) {
8894        res.getOutcomeReference().add(parseReference(xpp));
8895      } else if (!parseDomainResourceContent(eventType, xpp, res))
8896        return false;
8897    return true;
8898  }
8899
8900  protected Goal.GoalTargetComponent parseGoalGoalTargetComponent(XmlPullParser xpp, Goal owner) throws XmlPullParserException, IOException, FHIRFormatError {
8901    Goal.GoalTargetComponent res = new Goal.GoalTargetComponent();
8902    parseBackboneAttributes(xpp, res);
8903    next(xpp);
8904    int eventType = nextNoWhitespace(xpp);
8905    while (eventType != XmlPullParser.END_TAG) {
8906  if (!parseGoalGoalTargetComponentContent(eventType, xpp, owner, res))
8907        unknownContent(xpp);
8908      eventType = nextNoWhitespace(xpp);
8909    }
8910    next(xpp);
8911    parseElementClose(res);
8912    return res;
8913  }
8914
8915  protected boolean parseGoalGoalTargetComponentContent(int eventType, XmlPullParser xpp, Goal owner, Goal.GoalTargetComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8916      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("measure")) {
8917        res.setMeasure(parseCodeableConcept(xpp));
8918      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "detail")) {
8919        res.setDetail(parseType("detail", xpp));
8920      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "due")) {
8921        res.setDue(parseType("due", xpp));
8922      } else if (!parseBackboneContent(eventType, xpp, res))
8923        return false;
8924    return true;
8925  }
8926
8927  protected GraphDefinition parseGraphDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8928    GraphDefinition res = new GraphDefinition();
8929    parseDomainResourceAttributes(xpp, res);
8930    next(xpp);
8931    int eventType = nextNoWhitespace(xpp);
8932    while (eventType != XmlPullParser.END_TAG) {
8933  if (!parseGraphDefinitionContent(eventType, xpp, res))
8934        unknownContent(xpp);
8935      eventType = nextNoWhitespace(xpp);
8936    }
8937    next(xpp);
8938    parseElementClose(res);
8939    return res;
8940  }
8941
8942  protected boolean parseGraphDefinitionContent(int eventType, XmlPullParser xpp, GraphDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
8943      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
8944        res.setUrlElement(parseUri(xpp));
8945      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
8946        res.setVersionElement(parseString(xpp));
8947      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
8948        res.setNameElement(parseString(xpp));
8949      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
8950        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
8951      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
8952        res.setExperimentalElement(parseBoolean(xpp));
8953      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
8954        res.setDateElement(parseDateTime(xpp));
8955      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
8956        res.setPublisherElement(parseString(xpp));
8957      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
8958        res.getContact().add(parseContactDetail(xpp));
8959      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
8960        res.setDescriptionElement(parseMarkdown(xpp));
8961      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
8962        res.getUseContext().add(parseUsageContext(xpp));
8963      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
8964        res.getJurisdiction().add(parseCodeableConcept(xpp));
8965      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
8966        res.setPurposeElement(parseMarkdown(xpp));
8967      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("start")) {
8968        res.setStartElement(parseCode(xpp));
8969      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
8970        res.setProfileElement(parseUri(xpp));
8971      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("link")) {
8972        res.getLink().add(parseGraphDefinitionGraphDefinitionLinkComponent(xpp, res));
8973      } else if (!parseDomainResourceContent(eventType, xpp, res))
8974        return false;
8975    return true;
8976  }
8977
8978  protected GraphDefinition.GraphDefinitionLinkComponent parseGraphDefinitionGraphDefinitionLinkComponent(XmlPullParser xpp, GraphDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
8979    GraphDefinition.GraphDefinitionLinkComponent res = new GraphDefinition.GraphDefinitionLinkComponent();
8980    parseBackboneAttributes(xpp, res);
8981    next(xpp);
8982    int eventType = nextNoWhitespace(xpp);
8983    while (eventType != XmlPullParser.END_TAG) {
8984  if (!parseGraphDefinitionGraphDefinitionLinkComponentContent(eventType, xpp, owner, res))
8985        unknownContent(xpp);
8986      eventType = nextNoWhitespace(xpp);
8987    }
8988    next(xpp);
8989    parseElementClose(res);
8990    return res;
8991  }
8992
8993  protected boolean parseGraphDefinitionGraphDefinitionLinkComponentContent(int eventType, XmlPullParser xpp, GraphDefinition owner, GraphDefinition.GraphDefinitionLinkComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8994      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
8995        res.setPathElement(parseString(xpp));
8996      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sliceName")) {
8997        res.setSliceNameElement(parseString(xpp));
8998      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("min")) {
8999        res.setMinElement(parseInteger(xpp));
9000      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("max")) {
9001        res.setMaxElement(parseString(xpp));
9002      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
9003        res.setDescriptionElement(parseString(xpp));
9004      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("target")) {
9005        res.getTarget().add(parseGraphDefinitionGraphDefinitionLinkTargetComponent(xpp, owner));
9006      } else if (!parseBackboneContent(eventType, xpp, res))
9007        return false;
9008    return true;
9009  }
9010
9011  protected GraphDefinition.GraphDefinitionLinkTargetComponent parseGraphDefinitionGraphDefinitionLinkTargetComponent(XmlPullParser xpp, GraphDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
9012    GraphDefinition.GraphDefinitionLinkTargetComponent res = new GraphDefinition.GraphDefinitionLinkTargetComponent();
9013    parseBackboneAttributes(xpp, res);
9014    next(xpp);
9015    int eventType = nextNoWhitespace(xpp);
9016    while (eventType != XmlPullParser.END_TAG) {
9017  if (!parseGraphDefinitionGraphDefinitionLinkTargetComponentContent(eventType, xpp, owner, res))
9018        unknownContent(xpp);
9019      eventType = nextNoWhitespace(xpp);
9020    }
9021    next(xpp);
9022    parseElementClose(res);
9023    return res;
9024  }
9025
9026  protected boolean parseGraphDefinitionGraphDefinitionLinkTargetComponentContent(int eventType, XmlPullParser xpp, GraphDefinition owner, GraphDefinition.GraphDefinitionLinkTargetComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
9027      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
9028        res.setTypeElement(parseCode(xpp));
9029      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
9030        res.setProfileElement(parseUri(xpp));
9031      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("compartment")) {
9032        res.getCompartment().add(parseGraphDefinitionGraphDefinitionLinkTargetCompartmentComponent(xpp, owner));
9033      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("link")) {
9034        res.getLink().add(parseGraphDefinitionGraphDefinitionLinkComponent(xpp, owner));
9035      } else if (!parseBackboneContent(eventType, xpp, res))
9036        return false;
9037    return true;
9038  }
9039
9040  protected GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent parseGraphDefinitionGraphDefinitionLinkTargetCompartmentComponent(XmlPullParser xpp, GraphDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
9041    GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent res = new GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent();
9042    parseBackboneAttributes(xpp, res);
9043    next(xpp);
9044    int eventType = nextNoWhitespace(xpp);
9045    while (eventType != XmlPullParser.END_TAG) {
9046  if (!parseGraphDefinitionGraphDefinitionLinkTargetCompartmentComponentContent(eventType, xpp, owner, res))
9047        unknownContent(xpp);
9048      eventType = nextNoWhitespace(xpp);
9049    }
9050    next(xpp);
9051    parseElementClose(res);
9052    return res;
9053  }
9054
9055  protected boolean parseGraphDefinitionGraphDefinitionLinkTargetCompartmentComponentContent(int eventType, XmlPullParser xpp, GraphDefinition owner, GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
9056      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
9057        res.setCodeElement(parseEnumeration(xpp, GraphDefinition.CompartmentCode.NULL, new GraphDefinition.CompartmentCodeEnumFactory()));
9058      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rule")) {
9059        res.setRuleElement(parseEnumeration(xpp, GraphDefinition.GraphCompartmentRule.NULL, new GraphDefinition.GraphCompartmentRuleEnumFactory()));
9060      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expression")) {
9061        res.setExpressionElement(parseString(xpp));
9062      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
9063        res.setDescriptionElement(parseString(xpp));
9064      } else if (!parseBackboneContent(eventType, xpp, res))
9065        return false;
9066    return true;
9067  }
9068
9069  protected Group parseGroup(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
9070    Group res = new Group();
9071    parseDomainResourceAttributes(xpp, res);
9072    next(xpp);
9073    int eventType = nextNoWhitespace(xpp);
9074    while (eventType != XmlPullParser.END_TAG) {
9075  if (!parseGroupContent(eventType, xpp, res))
9076        unknownContent(xpp);
9077      eventType = nextNoWhitespace(xpp);
9078    }
9079    next(xpp);
9080    parseElementClose(res);
9081    return res;
9082  }
9083
9084  protected boolean parseGroupContent(int eventType, XmlPullParser xpp, Group res) throws XmlPullParserException, IOException, FHIRFormatError {
9085      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
9086        res.getIdentifier().add(parseIdentifier(xpp));
9087      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("active")) {
9088        res.setActiveElement(parseBoolean(xpp));
9089      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
9090        res.setTypeElement(parseEnumeration(xpp, Group.GroupType.NULL, new Group.GroupTypeEnumFactory()));
9091      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actual")) {
9092        res.setActualElement(parseBoolean(xpp));
9093      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
9094        res.setCode(parseCodeableConcept(xpp));
9095      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
9096        res.setNameElement(parseString(xpp));
9097      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
9098        res.setQuantityElement(parseUnsignedInt(xpp));
9099      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("characteristic")) {
9100        res.getCharacteristic().add(parseGroupGroupCharacteristicComponent(xpp, res));
9101      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("member")) {
9102        res.getMember().add(parseGroupGroupMemberComponent(xpp, res));
9103      } else if (!parseDomainResourceContent(eventType, xpp, res))
9104        return false;
9105    return true;
9106  }
9107
9108  protected Group.GroupCharacteristicComponent parseGroupGroupCharacteristicComponent(XmlPullParser xpp, Group owner) throws XmlPullParserException, IOException, FHIRFormatError {
9109    Group.GroupCharacteristicComponent res = new Group.GroupCharacteristicComponent();
9110    parseBackboneAttributes(xpp, res);
9111    next(xpp);
9112    int eventType = nextNoWhitespace(xpp);
9113    while (eventType != XmlPullParser.END_TAG) {
9114  if (!parseGroupGroupCharacteristicComponentContent(eventType, xpp, owner, res))
9115        unknownContent(xpp);
9116      eventType = nextNoWhitespace(xpp);
9117    }
9118    next(xpp);
9119    parseElementClose(res);
9120    return res;
9121  }
9122
9123  protected boolean parseGroupGroupCharacteristicComponentContent(int eventType, XmlPullParser xpp, Group owner, Group.GroupCharacteristicComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
9124      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
9125        res.setCode(parseCodeableConcept(xpp));
9126      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
9127        res.setValue(parseType("value", xpp));
9128      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("exclude")) {
9129        res.setExcludeElement(parseBoolean(xpp));
9130      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
9131        res.setPeriod(parsePeriod(xpp));
9132      } else if (!parseBackboneContent(eventType, xpp, res))
9133        return false;
9134    return true;
9135  }
9136
9137  protected Group.GroupMemberComponent parseGroupGroupMemberComponent(XmlPullParser xpp, Group owner) throws XmlPullParserException, IOException, FHIRFormatError {
9138    Group.GroupMemberComponent res = new Group.GroupMemberComponent();
9139    parseBackboneAttributes(xpp, res);
9140    next(xpp);
9141    int eventType = nextNoWhitespace(xpp);
9142    while (eventType != XmlPullParser.END_TAG) {
9143  if (!parseGroupGroupMemberComponentContent(eventType, xpp, owner, res))
9144        unknownContent(xpp);
9145      eventType = nextNoWhitespace(xpp);
9146    }
9147    next(xpp);
9148    parseElementClose(res);
9149    return res;
9150  }
9151
9152  protected boolean parseGroupGroupMemberComponentContent(int eventType, XmlPullParser xpp, Group owner, Group.GroupMemberComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
9153      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("entity")) {
9154        res.setEntity(parseReference(xpp));
9155      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
9156        res.setPeriod(parsePeriod(xpp));
9157      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("inactive")) {
9158        res.setInactiveElement(parseBoolean(xpp));
9159      } else if (!parseBackboneContent(eventType, xpp, res))
9160        return false;
9161    return true;
9162  }
9163
9164  protected GuidanceResponse parseGuidanceResponse(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
9165    GuidanceResponse res = new GuidanceResponse();
9166    parseDomainResourceAttributes(xpp, res);
9167    next(xpp);
9168    int eventType = nextNoWhitespace(xpp);
9169    while (eventType != XmlPullParser.END_TAG) {
9170  if (!parseGuidanceResponseContent(eventType, xpp, res))
9171        unknownContent(xpp);
9172      eventType = nextNoWhitespace(xpp);
9173    }
9174    next(xpp);
9175    parseElementClose(res);
9176    return res;
9177  }
9178
9179  protected boolean parseGuidanceResponseContent(int eventType, XmlPullParser xpp, GuidanceResponse res) throws XmlPullParserException, IOException, FHIRFormatError {
9180      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestId")) {
9181        res.setRequestIdElement(parseId(xpp));
9182      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
9183        res.setIdentifier(parseIdentifier(xpp));
9184      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("module")) {
9185        res.setModule(parseReference(xpp));
9186      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
9187        res.setStatusElement(parseEnumeration(xpp, GuidanceResponse.GuidanceResponseStatus.NULL, new GuidanceResponse.GuidanceResponseStatusEnumFactory()));
9188      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
9189        res.setSubject(parseReference(xpp));
9190      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
9191        res.setContext(parseReference(xpp));
9192      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("occurrenceDateTime")) {
9193        res.setOccurrenceDateTimeElement(parseDateTime(xpp));
9194      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performer")) {
9195        res.setPerformer(parseReference(xpp));
9196      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "reason")) {
9197        res.setReason(parseType("reason", xpp));
9198      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
9199        res.getNote().add(parseAnnotation(xpp));
9200      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("evaluationMessage")) {
9201        res.getEvaluationMessage().add(parseReference(xpp));
9202      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outputParameters")) {
9203        res.setOutputParameters(parseReference(xpp));
9204      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("result")) {
9205        res.setResult(parseReference(xpp));
9206      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dataRequirement")) {
9207        res.getDataRequirement().add(parseDataRequirement(xpp));
9208      } else if (!parseDomainResourceContent(eventType, xpp, res))
9209        return false;
9210    return true;
9211  }
9212
9213  protected HealthcareService parseHealthcareService(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
9214    HealthcareService res = new HealthcareService();
9215    parseDomainResourceAttributes(xpp, res);
9216    next(xpp);
9217    int eventType = nextNoWhitespace(xpp);
9218    while (eventType != XmlPullParser.END_TAG) {
9219  if (!parseHealthcareServiceContent(eventType, xpp, res))
9220        unknownContent(xpp);
9221      eventType = nextNoWhitespace(xpp);
9222    }
9223    next(xpp);
9224    parseElementClose(res);
9225    return res;
9226  }
9227
9228  protected boolean parseHealthcareServiceContent(int eventType, XmlPullParser xpp, HealthcareService res) throws XmlPullParserException, IOException, FHIRFormatError {
9229      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
9230        res.getIdentifier().add(parseIdentifier(xpp));
9231      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("active")) {
9232        res.setActiveElement(parseBoolean(xpp));
9233      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("providedBy")) {
9234        res.setProvidedBy(parseReference(xpp));
9235      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
9236        res.setCategory(parseCodeableConcept(xpp));
9237      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
9238        res.getType().add(parseCodeableConcept(xpp));
9239      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specialty")) {
9240        res.getSpecialty().add(parseCodeableConcept(xpp));
9241      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
9242        res.getLocation().add(parseReference(xpp));
9243      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
9244        res.setNameElement(parseString(xpp));
9245      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
9246        res.setCommentElement(parseString(xpp));
9247      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("extraDetails")) {
9248        res.setExtraDetailsElement(parseString(xpp));
9249      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("photo")) {
9250        res.setPhoto(parseAttachment(xpp));
9251      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("telecom")) {
9252        res.getTelecom().add(parseContactPoint(xpp));
9253      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverageArea")) {
9254        res.getCoverageArea().add(parseReference(xpp));
9255      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("serviceProvisionCode")) {
9256        res.getServiceProvisionCode().add(parseCodeableConcept(xpp));
9257      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("eligibility")) {
9258        res.setEligibility(parseCodeableConcept(xpp));
9259      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("eligibilityNote")) {
9260        res.setEligibilityNoteElement(parseString(xpp));
9261      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("programName")) {
9262        res.getProgramName().add(parseString(xpp));
9263      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("characteristic")) {
9264        res.getCharacteristic().add(parseCodeableConcept(xpp));
9265      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referralMethod")) {
9266        res.getReferralMethod().add(parseCodeableConcept(xpp));
9267      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("appointmentRequired")) {
9268        res.setAppointmentRequiredElement(parseBoolean(xpp));
9269      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("availableTime")) {
9270        res.getAvailableTime().add(parseHealthcareServiceHealthcareServiceAvailableTimeComponent(xpp, res));
9271      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("notAvailable")) {
9272        res.getNotAvailable().add(parseHealthcareServiceHealthcareServiceNotAvailableComponent(xpp, res));
9273      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("availabilityExceptions")) {
9274        res.setAvailabilityExceptionsElement(parseString(xpp));
9275      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("endpoint")) {
9276        res.getEndpoint().add(parseReference(xpp));
9277      } else if (!parseDomainResourceContent(eventType, xpp, res))
9278        return false;
9279    return true;
9280  }
9281
9282  protected HealthcareService.HealthcareServiceAvailableTimeComponent parseHealthcareServiceHealthcareServiceAvailableTimeComponent(XmlPullParser xpp, HealthcareService owner) throws XmlPullParserException, IOException, FHIRFormatError {
9283    HealthcareService.HealthcareServiceAvailableTimeComponent res = new HealthcareService.HealthcareServiceAvailableTimeComponent();
9284    parseBackboneAttributes(xpp, res);
9285    next(xpp);
9286    int eventType = nextNoWhitespace(xpp);
9287    while (eventType != XmlPullParser.END_TAG) {
9288  if (!parseHealthcareServiceHealthcareServiceAvailableTimeComponentContent(eventType, xpp, owner, res))
9289        unknownContent(xpp);
9290      eventType = nextNoWhitespace(xpp);
9291    }
9292    next(xpp);
9293    parseElementClose(res);
9294    return res;
9295  }
9296
9297  protected boolean parseHealthcareServiceHealthcareServiceAvailableTimeComponentContent(int eventType, XmlPullParser xpp, HealthcareService owner, HealthcareService.HealthcareServiceAvailableTimeComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
9298      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("daysOfWeek")) {
9299        res.getDaysOfWeek().add(parseEnumeration(xpp, HealthcareService.DaysOfWeek.NULL, new HealthcareService.DaysOfWeekEnumFactory()));
9300      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("allDay")) {
9301        res.setAllDayElement(parseBoolean(xpp));
9302      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("availableStartTime")) {
9303        res.setAvailableStartTimeElement(parseTime(xpp));
9304      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("availableEndTime")) {
9305        res.setAvailableEndTimeElement(parseTime(xpp));
9306      } else if (!parseBackboneContent(eventType, xpp, res))
9307        return false;
9308    return true;
9309  }
9310
9311  protected HealthcareService.HealthcareServiceNotAvailableComponent parseHealthcareServiceHealthcareServiceNotAvailableComponent(XmlPullParser xpp, HealthcareService owner) throws XmlPullParserException, IOException, FHIRFormatError {
9312    HealthcareService.HealthcareServiceNotAvailableComponent res = new HealthcareService.HealthcareServiceNotAvailableComponent();
9313    parseBackboneAttributes(xpp, res);
9314    next(xpp);
9315    int eventType = nextNoWhitespace(xpp);
9316    while (eventType != XmlPullParser.END_TAG) {
9317  if (!parseHealthcareServiceHealthcareServiceNotAvailableComponentContent(eventType, xpp, owner, res))
9318        unknownContent(xpp);
9319      eventType = nextNoWhitespace(xpp);
9320    }
9321    next(xpp);
9322    parseElementClose(res);
9323    return res;
9324  }
9325
9326  protected boolean parseHealthcareServiceHealthcareServiceNotAvailableComponentContent(int eventType, XmlPullParser xpp, HealthcareService owner, HealthcareService.HealthcareServiceNotAvailableComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
9327      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
9328        res.setDescriptionElement(parseString(xpp));
9329      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("during")) {
9330        res.setDuring(parsePeriod(xpp));
9331      } else if (!parseBackboneContent(eventType, xpp, res))
9332        return false;
9333    return true;
9334  }
9335
9336  protected ImagingManifest parseImagingManifest(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
9337    ImagingManifest res = new ImagingManifest();
9338    parseDomainResourceAttributes(xpp, res);
9339    next(xpp);
9340    int eventType = nextNoWhitespace(xpp);
9341    while (eventType != XmlPullParser.END_TAG) {
9342  if (!parseImagingManifestContent(eventType, xpp, res))
9343        unknownContent(xpp);
9344      eventType = nextNoWhitespace(xpp);
9345    }
9346    next(xpp);
9347    parseElementClose(res);
9348    return res;
9349  }
9350
9351  protected boolean parseImagingManifestContent(int eventType, XmlPullParser xpp, ImagingManifest res) throws XmlPullParserException, IOException, FHIRFormatError {
9352      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
9353        res.setIdentifier(parseIdentifier(xpp));
9354      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
9355        res.setPatient(parseReference(xpp));
9356      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authoringTime")) {
9357        res.setAuthoringTimeElement(parseDateTime(xpp));
9358      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
9359        res.setAuthor(parseReference(xpp));
9360      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
9361        res.setDescriptionElement(parseString(xpp));
9362      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("study")) {
9363        res.getStudy().add(parseImagingManifestStudyComponent(xpp, res));
9364      } else if (!parseDomainResourceContent(eventType, xpp, res))
9365        return false;
9366    return true;
9367  }
9368
9369  protected ImagingManifest.StudyComponent parseImagingManifestStudyComponent(XmlPullParser xpp, ImagingManifest owner) throws XmlPullParserException, IOException, FHIRFormatError {
9370    ImagingManifest.StudyComponent res = new ImagingManifest.StudyComponent();
9371    parseBackboneAttributes(xpp, res);
9372    next(xpp);
9373    int eventType = nextNoWhitespace(xpp);
9374    while (eventType != XmlPullParser.END_TAG) {
9375  if (!parseImagingManifestStudyComponentContent(eventType, xpp, owner, res))
9376        unknownContent(xpp);
9377      eventType = nextNoWhitespace(xpp);
9378    }
9379    next(xpp);
9380    parseElementClose(res);
9381    return res;
9382  }
9383
9384  protected boolean parseImagingManifestStudyComponentContent(int eventType, XmlPullParser xpp, ImagingManifest owner, ImagingManifest.StudyComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
9385      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("uid")) {
9386        res.setUidElement(parseOid(xpp));
9387      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("imagingStudy")) {
9388        res.setImagingStudy(parseReference(xpp));
9389      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("endpoint")) {
9390        res.getEndpoint().add(parseReference(xpp));
9391      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("series")) {
9392        res.getSeries().add(parseImagingManifestSeriesComponent(xpp, owner));
9393      } else if (!parseBackboneContent(eventType, xpp, res))
9394        return false;
9395    return true;
9396  }
9397
9398  protected ImagingManifest.SeriesComponent parseImagingManifestSeriesComponent(XmlPullParser xpp, ImagingManifest owner) throws XmlPullParserException, IOException, FHIRFormatError {
9399    ImagingManifest.SeriesComponent res = new ImagingManifest.SeriesComponent();
9400    parseBackboneAttributes(xpp, res);
9401    next(xpp);
9402    int eventType = nextNoWhitespace(xpp);
9403    while (eventType != XmlPullParser.END_TAG) {
9404  if (!parseImagingManifestSeriesComponentContent(eventType, xpp, owner, res))
9405        unknownContent(xpp);
9406      eventType = nextNoWhitespace(xpp);
9407    }
9408    next(xpp);
9409    parseElementClose(res);
9410    return res;
9411  }
9412
9413  protected boolean parseImagingManifestSeriesComponentContent(int eventType, XmlPullParser xpp, ImagingManifest owner, ImagingManifest.SeriesComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
9414      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("uid")) {
9415        res.setUidElement(parseOid(xpp));
9416      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("endpoint")) {
9417        res.getEndpoint().add(parseReference(xpp));
9418      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instance")) {
9419        res.getInstance().add(parseImagingManifestInstanceComponent(xpp, owner));
9420      } else if (!parseBackboneContent(eventType, xpp, res))
9421        return false;
9422    return true;
9423  }
9424
9425  protected ImagingManifest.InstanceComponent parseImagingManifestInstanceComponent(XmlPullParser xpp, ImagingManifest owner) throws XmlPullParserException, IOException, FHIRFormatError {
9426    ImagingManifest.InstanceComponent res = new ImagingManifest.InstanceComponent();
9427    parseBackboneAttributes(xpp, res);
9428    next(xpp);
9429    int eventType = nextNoWhitespace(xpp);
9430    while (eventType != XmlPullParser.END_TAG) {
9431  if (!parseImagingManifestInstanceComponentContent(eventType, xpp, owner, res))
9432        unknownContent(xpp);
9433      eventType = nextNoWhitespace(xpp);
9434    }
9435    next(xpp);
9436    parseElementClose(res);
9437    return res;
9438  }
9439
9440  protected boolean parseImagingManifestInstanceComponentContent(int eventType, XmlPullParser xpp, ImagingManifest owner, ImagingManifest.InstanceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
9441      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sopClass")) {
9442        res.setSopClassElement(parseOid(xpp));
9443      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("uid")) {
9444        res.setUidElement(parseOid(xpp));
9445      } else if (!parseBackboneContent(eventType, xpp, res))
9446        return false;
9447    return true;
9448  }
9449
9450  protected ImagingStudy parseImagingStudy(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
9451    ImagingStudy res = new ImagingStudy();
9452    parseDomainResourceAttributes(xpp, res);
9453    next(xpp);
9454    int eventType = nextNoWhitespace(xpp);
9455    while (eventType != XmlPullParser.END_TAG) {
9456  if (!parseImagingStudyContent(eventType, xpp, res))
9457        unknownContent(xpp);
9458      eventType = nextNoWhitespace(xpp);
9459    }
9460    next(xpp);
9461    parseElementClose(res);
9462    return res;
9463  }
9464
9465  protected boolean parseImagingStudyContent(int eventType, XmlPullParser xpp, ImagingStudy res) throws XmlPullParserException, IOException, FHIRFormatError {
9466      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("uid")) {
9467        res.setUidElement(parseOid(xpp));
9468      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("accession")) {
9469        res.setAccession(parseIdentifier(xpp));
9470      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
9471        res.getIdentifier().add(parseIdentifier(xpp));
9472      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("availability")) {
9473        res.setAvailabilityElement(parseEnumeration(xpp, ImagingStudy.InstanceAvailability.NULL, new ImagingStudy.InstanceAvailabilityEnumFactory()));
9474      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modalityList")) {
9475        res.getModalityList().add(parseCoding(xpp));
9476      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
9477        res.setPatient(parseReference(xpp));
9478      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
9479        res.setContext(parseReference(xpp));
9480      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("started")) {
9481        res.setStartedElement(parseDateTime(xpp));
9482      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
9483        res.getBasedOn().add(parseReference(xpp));
9484      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referrer")) {
9485        res.setReferrer(parseReference(xpp));
9486      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("interpreter")) {
9487        res.getInterpreter().add(parseReference(xpp));
9488      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("endpoint")) {
9489        res.getEndpoint().add(parseReference(xpp));
9490      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("numberOfSeries")) {
9491        res.setNumberOfSeriesElement(parseUnsignedInt(xpp));
9492      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("numberOfInstances")) {
9493        res.setNumberOfInstancesElement(parseUnsignedInt(xpp));
9494      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("procedureReference")) {
9495        res.getProcedureReference().add(parseReference(xpp));
9496      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("procedureCode")) {
9497        res.getProcedureCode().add(parseCodeableConcept(xpp));
9498      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
9499        res.setReason(parseCodeableConcept(xpp));
9500      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
9501        res.setDescriptionElement(parseString(xpp));
9502      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("series")) {
9503        res.getSeries().add(parseImagingStudyImagingStudySeriesComponent(xpp, res));
9504      } else if (!parseDomainResourceContent(eventType, xpp, res))
9505        return false;
9506    return true;
9507  }
9508
9509  protected ImagingStudy.ImagingStudySeriesComponent parseImagingStudyImagingStudySeriesComponent(XmlPullParser xpp, ImagingStudy owner) throws XmlPullParserException, IOException, FHIRFormatError {
9510    ImagingStudy.ImagingStudySeriesComponent res = new ImagingStudy.ImagingStudySeriesComponent();
9511    parseBackboneAttributes(xpp, res);
9512    next(xpp);
9513    int eventType = nextNoWhitespace(xpp);
9514    while (eventType != XmlPullParser.END_TAG) {
9515  if (!parseImagingStudyImagingStudySeriesComponentContent(eventType, xpp, owner, res))
9516        unknownContent(xpp);
9517      eventType = nextNoWhitespace(xpp);
9518    }
9519    next(xpp);
9520    parseElementClose(res);
9521    return res;
9522  }
9523
9524  protected boolean parseImagingStudyImagingStudySeriesComponentContent(int eventType, XmlPullParser xpp, ImagingStudy owner, ImagingStudy.ImagingStudySeriesComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
9525      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("uid")) {
9526        res.setUidElement(parseOid(xpp));
9527      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("number")) {
9528        res.setNumberElement(parseUnsignedInt(xpp));
9529      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modality")) {
9530        res.setModality(parseCoding(xpp));
9531      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
9532        res.setDescriptionElement(parseString(xpp));
9533      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("numberOfInstances")) {
9534        res.setNumberOfInstancesElement(parseUnsignedInt(xpp));
9535      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("availability")) {
9536        res.setAvailabilityElement(parseEnumeration(xpp, ImagingStudy.InstanceAvailability.NULL, new ImagingStudy.InstanceAvailabilityEnumFactory()));
9537      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("endpoint")) {
9538        res.getEndpoint().add(parseReference(xpp));
9539      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodySite")) {
9540        res.setBodySite(parseCoding(xpp));
9541      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("laterality")) {
9542        res.setLaterality(parseCoding(xpp));
9543      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("started")) {
9544        res.setStartedElement(parseDateTime(xpp));
9545      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performer")) {
9546        res.getPerformer().add(parseReference(xpp));
9547      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instance")) {
9548        res.getInstance().add(parseImagingStudyImagingStudySeriesInstanceComponent(xpp, owner));
9549      } else if (!parseBackboneContent(eventType, xpp, res))
9550        return false;
9551    return true;
9552  }
9553
9554  protected ImagingStudy.ImagingStudySeriesInstanceComponent parseImagingStudyImagingStudySeriesInstanceComponent(XmlPullParser xpp, ImagingStudy owner) throws XmlPullParserException, IOException, FHIRFormatError {
9555    ImagingStudy.ImagingStudySeriesInstanceComponent res = new ImagingStudy.ImagingStudySeriesInstanceComponent();
9556    parseBackboneAttributes(xpp, res);
9557    next(xpp);
9558    int eventType = nextNoWhitespace(xpp);
9559    while (eventType != XmlPullParser.END_TAG) {
9560  if (!parseImagingStudyImagingStudySeriesInstanceComponentContent(eventType, xpp, owner, res))
9561        unknownContent(xpp);
9562      eventType = nextNoWhitespace(xpp);
9563    }
9564    next(xpp);
9565    parseElementClose(res);
9566    return res;
9567  }
9568
9569  protected boolean parseImagingStudyImagingStudySeriesInstanceComponentContent(int eventType, XmlPullParser xpp, ImagingStudy owner, ImagingStudy.ImagingStudySeriesInstanceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
9570      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("uid")) {
9571        res.setUidElement(parseOid(xpp));
9572      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("number")) {
9573        res.setNumberElement(parseUnsignedInt(xpp));
9574      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sopClass")) {
9575        res.setSopClassElement(parseOid(xpp));
9576      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
9577        res.setTitleElement(parseString(xpp));
9578      } else if (!parseBackboneContent(eventType, xpp, res))
9579        return false;
9580    return true;
9581  }
9582
9583  protected Immunization parseImmunization(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
9584    Immunization res = new Immunization();
9585    parseDomainResourceAttributes(xpp, res);
9586    next(xpp);
9587    int eventType = nextNoWhitespace(xpp);
9588    while (eventType != XmlPullParser.END_TAG) {
9589  if (!parseImmunizationContent(eventType, xpp, res))
9590        unknownContent(xpp);
9591      eventType = nextNoWhitespace(xpp);
9592    }
9593    next(xpp);
9594    parseElementClose(res);
9595    return res;
9596  }
9597
9598  protected boolean parseImmunizationContent(int eventType, XmlPullParser xpp, Immunization res) throws XmlPullParserException, IOException, FHIRFormatError {
9599      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
9600        res.getIdentifier().add(parseIdentifier(xpp));
9601      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
9602        res.setStatusElement(parseEnumeration(xpp, Immunization.ImmunizationStatus.NULL, new Immunization.ImmunizationStatusEnumFactory()));
9603      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("notGiven")) {
9604        res.setNotGivenElement(parseBoolean(xpp));
9605      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("vaccineCode")) {
9606        res.setVaccineCode(parseCodeableConcept(xpp));
9607      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
9608        res.setPatient(parseReference(xpp));
9609      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
9610        res.setEncounter(parseReference(xpp));
9611      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
9612        res.setDateElement(parseDateTime(xpp));
9613      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("primarySource")) {
9614        res.setPrimarySourceElement(parseBoolean(xpp));
9615      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reportOrigin")) {
9616        res.setReportOrigin(parseCodeableConcept(xpp));
9617      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
9618        res.setLocation(parseReference(xpp));
9619      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("manufacturer")) {
9620        res.setManufacturer(parseReference(xpp));
9621      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lotNumber")) {
9622        res.setLotNumberElement(parseString(xpp));
9623      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expirationDate")) {
9624        res.setExpirationDateElement(parseDate(xpp));
9625      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("site")) {
9626        res.setSite(parseCodeableConcept(xpp));
9627      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("route")) {
9628        res.setRoute(parseCodeableConcept(xpp));
9629      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("doseQuantity")) {
9630        res.setDoseQuantity(parseSimpleQuantity(xpp));
9631      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("practitioner")) {
9632        res.getPractitioner().add(parseImmunizationImmunizationPractitionerComponent(xpp, res));
9633      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
9634        res.getNote().add(parseAnnotation(xpp));
9635      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("explanation")) {
9636        res.setExplanation(parseImmunizationImmunizationExplanationComponent(xpp, res));
9637      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reaction")) {
9638        res.getReaction().add(parseImmunizationImmunizationReactionComponent(xpp, res));
9639      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("vaccinationProtocol")) {
9640        res.getVaccinationProtocol().add(parseImmunizationImmunizationVaccinationProtocolComponent(xpp, res));
9641      } else if (!parseDomainResourceContent(eventType, xpp, res))
9642        return false;
9643    return true;
9644  }
9645
9646  protected Immunization.ImmunizationPractitionerComponent parseImmunizationImmunizationPractitionerComponent(XmlPullParser xpp, Immunization owner) throws XmlPullParserException, IOException, FHIRFormatError {
9647    Immunization.ImmunizationPractitionerComponent res = new Immunization.ImmunizationPractitionerComponent();
9648    parseBackboneAttributes(xpp, res);
9649    next(xpp);
9650    int eventType = nextNoWhitespace(xpp);
9651    while (eventType != XmlPullParser.END_TAG) {
9652  if (!parseImmunizationImmunizationPractitionerComponentContent(eventType, xpp, owner, res))
9653        unknownContent(xpp);
9654      eventType = nextNoWhitespace(xpp);
9655    }
9656    next(xpp);
9657    parseElementClose(res);
9658    return res;
9659  }
9660
9661  protected boolean parseImmunizationImmunizationPractitionerComponentContent(int eventType, XmlPullParser xpp, Immunization owner, Immunization.ImmunizationPractitionerComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
9662      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
9663        res.setRole(parseCodeableConcept(xpp));
9664      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
9665        res.setActor(parseReference(xpp));
9666      } else if (!parseBackboneContent(eventType, xpp, res))
9667        return false;
9668    return true;
9669  }
9670
9671  protected Immunization.ImmunizationExplanationComponent parseImmunizationImmunizationExplanationComponent(XmlPullParser xpp, Immunization owner) throws XmlPullParserException, IOException, FHIRFormatError {
9672    Immunization.ImmunizationExplanationComponent res = new Immunization.ImmunizationExplanationComponent();
9673    parseBackboneAttributes(xpp, res);
9674    next(xpp);
9675    int eventType = nextNoWhitespace(xpp);
9676    while (eventType != XmlPullParser.END_TAG) {
9677  if (!parseImmunizationImmunizationExplanationComponentContent(eventType, xpp, owner, res))
9678        unknownContent(xpp);
9679      eventType = nextNoWhitespace(xpp);
9680    }
9681    next(xpp);
9682    parseElementClose(res);
9683    return res;
9684  }
9685
9686  protected boolean parseImmunizationImmunizationExplanationComponentContent(int eventType, XmlPullParser xpp, Immunization owner, Immunization.ImmunizationExplanationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
9687      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
9688        res.getReason().add(parseCodeableConcept(xpp));
9689      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonNotGiven")) {
9690        res.getReasonNotGiven().add(parseCodeableConcept(xpp));
9691      } else if (!parseBackboneContent(eventType, xpp, res))
9692        return false;
9693    return true;
9694  }
9695
9696  protected Immunization.ImmunizationReactionComponent parseImmunizationImmunizationReactionComponent(XmlPullParser xpp, Immunization owner) throws XmlPullParserException, IOException, FHIRFormatError {
9697    Immunization.ImmunizationReactionComponent res = new Immunization.ImmunizationReactionComponent();
9698    parseBackboneAttributes(xpp, res);
9699    next(xpp);
9700    int eventType = nextNoWhitespace(xpp);
9701    while (eventType != XmlPullParser.END_TAG) {
9702  if (!parseImmunizationImmunizationReactionComponentContent(eventType, xpp, owner, res))
9703        unknownContent(xpp);
9704      eventType = nextNoWhitespace(xpp);
9705    }
9706    next(xpp);
9707    parseElementClose(res);
9708    return res;
9709  }
9710
9711  protected boolean parseImmunizationImmunizationReactionComponentContent(int eventType, XmlPullParser xpp, Immunization owner, Immunization.ImmunizationReactionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
9712      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
9713        res.setDateElement(parseDateTime(xpp));
9714      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
9715        res.setDetail(parseReference(xpp));
9716      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reported")) {
9717        res.setReportedElement(parseBoolean(xpp));
9718      } else if (!parseBackboneContent(eventType, xpp, res))
9719        return false;
9720    return true;
9721  }
9722
9723  protected Immunization.ImmunizationVaccinationProtocolComponent parseImmunizationImmunizationVaccinationProtocolComponent(XmlPullParser xpp, Immunization owner) throws XmlPullParserException, IOException, FHIRFormatError {
9724    Immunization.ImmunizationVaccinationProtocolComponent res = new Immunization.ImmunizationVaccinationProtocolComponent();
9725    parseBackboneAttributes(xpp, res);
9726    next(xpp);
9727    int eventType = nextNoWhitespace(xpp);
9728    while (eventType != XmlPullParser.END_TAG) {
9729  if (!parseImmunizationImmunizationVaccinationProtocolComponentContent(eventType, xpp, owner, res))
9730        unknownContent(xpp);
9731      eventType = nextNoWhitespace(xpp);
9732    }
9733    next(xpp);
9734    parseElementClose(res);
9735    return res;
9736  }
9737
9738  protected boolean parseImmunizationImmunizationVaccinationProtocolComponentContent(int eventType, XmlPullParser xpp, Immunization owner, Immunization.ImmunizationVaccinationProtocolComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
9739      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("doseSequence")) {
9740        res.setDoseSequenceElement(parsePositiveInt(xpp));
9741      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
9742        res.setDescriptionElement(parseString(xpp));
9743      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authority")) {
9744        res.setAuthority(parseReference(xpp));
9745      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("series")) {
9746        res.setSeriesElement(parseString(xpp));
9747      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("seriesDoses")) {
9748        res.setSeriesDosesElement(parsePositiveInt(xpp));
9749      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("targetDisease")) {
9750        res.getTargetDisease().add(parseCodeableConcept(xpp));
9751      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("doseStatus")) {
9752        res.setDoseStatus(parseCodeableConcept(xpp));
9753      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("doseStatusReason")) {
9754        res.setDoseStatusReason(parseCodeableConcept(xpp));
9755      } else if (!parseBackboneContent(eventType, xpp, res))
9756        return false;
9757    return true;
9758  }
9759
9760  protected ImmunizationRecommendation parseImmunizationRecommendation(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
9761    ImmunizationRecommendation res = new ImmunizationRecommendation();
9762    parseDomainResourceAttributes(xpp, res);
9763    next(xpp);
9764    int eventType = nextNoWhitespace(xpp);
9765    while (eventType != XmlPullParser.END_TAG) {
9766  if (!parseImmunizationRecommendationContent(eventType, xpp, res))
9767        unknownContent(xpp);
9768      eventType = nextNoWhitespace(xpp);
9769    }
9770    next(xpp);
9771    parseElementClose(res);
9772    return res;
9773  }
9774
9775  protected boolean parseImmunizationRecommendationContent(int eventType, XmlPullParser xpp, ImmunizationRecommendation res) throws XmlPullParserException, IOException, FHIRFormatError {
9776      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
9777        res.getIdentifier().add(parseIdentifier(xpp));
9778      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
9779        res.setPatient(parseReference(xpp));
9780      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recommendation")) {
9781        res.getRecommendation().add(parseImmunizationRecommendationImmunizationRecommendationRecommendationComponent(xpp, res));
9782      } else if (!parseDomainResourceContent(eventType, xpp, res))
9783        return false;
9784    return true;
9785  }
9786
9787  protected ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent parseImmunizationRecommendationImmunizationRecommendationRecommendationComponent(XmlPullParser xpp, ImmunizationRecommendation owner) throws XmlPullParserException, IOException, FHIRFormatError {
9788    ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent res = new ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent();
9789    parseBackboneAttributes(xpp, res);
9790    next(xpp);
9791    int eventType = nextNoWhitespace(xpp);
9792    while (eventType != XmlPullParser.END_TAG) {
9793  if (!parseImmunizationRecommendationImmunizationRecommendationRecommendationComponentContent(eventType, xpp, owner, res))
9794        unknownContent(xpp);
9795      eventType = nextNoWhitespace(xpp);
9796    }
9797    next(xpp);
9798    parseElementClose(res);
9799    return res;
9800  }
9801
9802  protected boolean parseImmunizationRecommendationImmunizationRecommendationRecommendationComponentContent(int eventType, XmlPullParser xpp, ImmunizationRecommendation owner, ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
9803      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
9804        res.setDateElement(parseDateTime(xpp));
9805      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("vaccineCode")) {
9806        res.setVaccineCode(parseCodeableConcept(xpp));
9807      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("targetDisease")) {
9808        res.setTargetDisease(parseCodeableConcept(xpp));
9809      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("doseNumber")) {
9810        res.setDoseNumberElement(parsePositiveInt(xpp));
9811      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("forecastStatus")) {
9812        res.setForecastStatus(parseCodeableConcept(xpp));
9813      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dateCriterion")) {
9814        res.getDateCriterion().add(parseImmunizationRecommendationImmunizationRecommendationRecommendationDateCriterionComponent(xpp, owner));
9815      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("protocol")) {
9816        res.setProtocol(parseImmunizationRecommendationImmunizationRecommendationRecommendationProtocolComponent(xpp, owner));
9817      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingImmunization")) {
9818        res.getSupportingImmunization().add(parseReference(xpp));
9819      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingPatientInformation")) {
9820        res.getSupportingPatientInformation().add(parseReference(xpp));
9821      } else if (!parseBackboneContent(eventType, xpp, res))
9822        return false;
9823    return true;
9824  }
9825
9826  protected ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent parseImmunizationRecommendationImmunizationRecommendationRecommendationDateCriterionComponent(XmlPullParser xpp, ImmunizationRecommendation owner) throws XmlPullParserException, IOException, FHIRFormatError {
9827    ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent res = new ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent();
9828    parseBackboneAttributes(xpp, res);
9829    next(xpp);
9830    int eventType = nextNoWhitespace(xpp);
9831    while (eventType != XmlPullParser.END_TAG) {
9832  if (!parseImmunizationRecommendationImmunizationRecommendationRecommendationDateCriterionComponentContent(eventType, xpp, owner, res))
9833        unknownContent(xpp);
9834      eventType = nextNoWhitespace(xpp);
9835    }
9836    next(xpp);
9837    parseElementClose(res);
9838    return res;
9839  }
9840
9841  protected boolean parseImmunizationRecommendationImmunizationRecommendationRecommendationDateCriterionComponentContent(int eventType, XmlPullParser xpp, ImmunizationRecommendation owner, ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
9842      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
9843        res.setCode(parseCodeableConcept(xpp));
9844      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
9845        res.setValueElement(parseDateTime(xpp));
9846      } else if (!parseBackboneContent(eventType, xpp, res))
9847        return false;
9848    return true;
9849  }
9850
9851  protected ImmunizationRecommendation.ImmunizationRecommendationRecommendationProtocolComponent parseImmunizationRecommendationImmunizationRecommendationRecommendationProtocolComponent(XmlPullParser xpp, ImmunizationRecommendation owner) throws XmlPullParserException, IOException, FHIRFormatError {
9852    ImmunizationRecommendation.ImmunizationRecommendationRecommendationProtocolComponent res = new ImmunizationRecommendation.ImmunizationRecommendationRecommendationProtocolComponent();
9853    parseBackboneAttributes(xpp, res);
9854    next(xpp);
9855    int eventType = nextNoWhitespace(xpp);
9856    while (eventType != XmlPullParser.END_TAG) {
9857  if (!parseImmunizationRecommendationImmunizationRecommendationRecommendationProtocolComponentContent(eventType, xpp, owner, res))
9858        unknownContent(xpp);
9859      eventType = nextNoWhitespace(xpp);
9860    }
9861    next(xpp);
9862    parseElementClose(res);
9863    return res;
9864  }
9865
9866  protected boolean parseImmunizationRecommendationImmunizationRecommendationRecommendationProtocolComponentContent(int eventType, XmlPullParser xpp, ImmunizationRecommendation owner, ImmunizationRecommendation.ImmunizationRecommendationRecommendationProtocolComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
9867      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("doseSequence")) {
9868        res.setDoseSequenceElement(parsePositiveInt(xpp));
9869      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
9870        res.setDescriptionElement(parseString(xpp));
9871      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authority")) {
9872        res.setAuthority(parseReference(xpp));
9873      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("series")) {
9874        res.setSeriesElement(parseString(xpp));
9875      } else if (!parseBackboneContent(eventType, xpp, res))
9876        return false;
9877    return true;
9878  }
9879
9880  protected ImplementationGuide parseImplementationGuide(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
9881    ImplementationGuide res = new ImplementationGuide();
9882    parseDomainResourceAttributes(xpp, res);
9883    next(xpp);
9884    int eventType = nextNoWhitespace(xpp);
9885    while (eventType != XmlPullParser.END_TAG) {
9886  if (!parseImplementationGuideContent(eventType, xpp, res))
9887        unknownContent(xpp);
9888      eventType = nextNoWhitespace(xpp);
9889    }
9890    next(xpp);
9891    parseElementClose(res);
9892    return res;
9893  }
9894
9895  protected boolean parseImplementationGuideContent(int eventType, XmlPullParser xpp, ImplementationGuide res) throws XmlPullParserException, IOException, FHIRFormatError {
9896      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
9897        res.setUrlElement(parseUri(xpp));
9898      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
9899        res.setVersionElement(parseString(xpp));
9900      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
9901        res.setNameElement(parseString(xpp));
9902      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
9903        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
9904      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
9905        res.setExperimentalElement(parseBoolean(xpp));
9906      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
9907        res.setDateElement(parseDateTime(xpp));
9908      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
9909        res.setPublisherElement(parseString(xpp));
9910      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
9911        res.getContact().add(parseContactDetail(xpp));
9912      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
9913        res.setDescriptionElement(parseMarkdown(xpp));
9914      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
9915        res.getUseContext().add(parseUsageContext(xpp));
9916      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
9917        res.getJurisdiction().add(parseCodeableConcept(xpp));
9918      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
9919        res.setCopyrightElement(parseMarkdown(xpp));
9920      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fhirVersion")) {
9921        res.setFhirVersionElement(parseId(xpp));
9922      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dependency")) {
9923        res.getDependency().add(parseImplementationGuideImplementationGuideDependencyComponent(xpp, res));
9924      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("package")) {
9925        res.getPackage().add(parseImplementationGuideImplementationGuidePackageComponent(xpp, res));
9926      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("global")) {
9927        res.getGlobal().add(parseImplementationGuideImplementationGuideGlobalComponent(xpp, res));
9928      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("binary")) {
9929        res.getBinary().add(parseUri(xpp));
9930      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("page")) {
9931        res.setPage(parseImplementationGuideImplementationGuidePageComponent(xpp, res));
9932      } else if (!parseDomainResourceContent(eventType, xpp, res))
9933        return false;
9934    return true;
9935  }
9936
9937  protected ImplementationGuide.ImplementationGuideDependencyComponent parseImplementationGuideImplementationGuideDependencyComponent(XmlPullParser xpp, ImplementationGuide owner) throws XmlPullParserException, IOException, FHIRFormatError {
9938    ImplementationGuide.ImplementationGuideDependencyComponent res = new ImplementationGuide.ImplementationGuideDependencyComponent();
9939    parseBackboneAttributes(xpp, res);
9940    next(xpp);
9941    int eventType = nextNoWhitespace(xpp);
9942    while (eventType != XmlPullParser.END_TAG) {
9943  if (!parseImplementationGuideImplementationGuideDependencyComponentContent(eventType, xpp, owner, res))
9944        unknownContent(xpp);
9945      eventType = nextNoWhitespace(xpp);
9946    }
9947    next(xpp);
9948    parseElementClose(res);
9949    return res;
9950  }
9951
9952  protected boolean parseImplementationGuideImplementationGuideDependencyComponentContent(int eventType, XmlPullParser xpp, ImplementationGuide owner, ImplementationGuide.ImplementationGuideDependencyComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
9953      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
9954        res.setTypeElement(parseEnumeration(xpp, ImplementationGuide.GuideDependencyType.NULL, new ImplementationGuide.GuideDependencyTypeEnumFactory()));
9955      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("uri")) {
9956        res.setUriElement(parseUri(xpp));
9957      } else if (!parseBackboneContent(eventType, xpp, res))
9958        return false;
9959    return true;
9960  }
9961
9962  protected ImplementationGuide.ImplementationGuidePackageComponent parseImplementationGuideImplementationGuidePackageComponent(XmlPullParser xpp, ImplementationGuide owner) throws XmlPullParserException, IOException, FHIRFormatError {
9963    ImplementationGuide.ImplementationGuidePackageComponent res = new ImplementationGuide.ImplementationGuidePackageComponent();
9964    parseBackboneAttributes(xpp, res);
9965    next(xpp);
9966    int eventType = nextNoWhitespace(xpp);
9967    while (eventType != XmlPullParser.END_TAG) {
9968  if (!parseImplementationGuideImplementationGuidePackageComponentContent(eventType, xpp, owner, res))
9969        unknownContent(xpp);
9970      eventType = nextNoWhitespace(xpp);
9971    }
9972    next(xpp);
9973    parseElementClose(res);
9974    return res;
9975  }
9976
9977  protected boolean parseImplementationGuideImplementationGuidePackageComponentContent(int eventType, XmlPullParser xpp, ImplementationGuide owner, ImplementationGuide.ImplementationGuidePackageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
9978      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
9979        res.setNameElement(parseString(xpp));
9980      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
9981        res.setDescriptionElement(parseString(xpp));
9982      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
9983        res.getResource().add(parseImplementationGuideImplementationGuidePackageResourceComponent(xpp, owner));
9984      } else if (!parseBackboneContent(eventType, xpp, res))
9985        return false;
9986    return true;
9987  }
9988
9989  protected ImplementationGuide.ImplementationGuidePackageResourceComponent parseImplementationGuideImplementationGuidePackageResourceComponent(XmlPullParser xpp, ImplementationGuide owner) throws XmlPullParserException, IOException, FHIRFormatError {
9990    ImplementationGuide.ImplementationGuidePackageResourceComponent res = new ImplementationGuide.ImplementationGuidePackageResourceComponent();
9991    parseBackboneAttributes(xpp, res);
9992    next(xpp);
9993    int eventType = nextNoWhitespace(xpp);
9994    while (eventType != XmlPullParser.END_TAG) {
9995  if (!parseImplementationGuideImplementationGuidePackageResourceComponentContent(eventType, xpp, owner, res))
9996        unknownContent(xpp);
9997      eventType = nextNoWhitespace(xpp);
9998    }
9999    next(xpp);
10000    parseElementClose(res);
10001    return res;
10002  }
10003
10004  protected boolean parseImplementationGuideImplementationGuidePackageResourceComponentContent(int eventType, XmlPullParser xpp, ImplementationGuide owner, ImplementationGuide.ImplementationGuidePackageResourceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
10005      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("example")) {
10006        res.setExampleElement(parseBoolean(xpp));
10007      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
10008        res.setNameElement(parseString(xpp));
10009      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
10010        res.setDescriptionElement(parseString(xpp));
10011      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("acronym")) {
10012        res.setAcronymElement(parseString(xpp));
10013      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "source")) {
10014        res.setSource(parseType("source", xpp));
10015      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("exampleFor")) {
10016        res.setExampleFor(parseReference(xpp));
10017      } else if (!parseBackboneContent(eventType, xpp, res))
10018        return false;
10019    return true;
10020  }
10021
10022  protected ImplementationGuide.ImplementationGuideGlobalComponent parseImplementationGuideImplementationGuideGlobalComponent(XmlPullParser xpp, ImplementationGuide owner) throws XmlPullParserException, IOException, FHIRFormatError {
10023    ImplementationGuide.ImplementationGuideGlobalComponent res = new ImplementationGuide.ImplementationGuideGlobalComponent();
10024    parseBackboneAttributes(xpp, res);
10025    next(xpp);
10026    int eventType = nextNoWhitespace(xpp);
10027    while (eventType != XmlPullParser.END_TAG) {
10028  if (!parseImplementationGuideImplementationGuideGlobalComponentContent(eventType, xpp, owner, res))
10029        unknownContent(xpp);
10030      eventType = nextNoWhitespace(xpp);
10031    }
10032    next(xpp);
10033    parseElementClose(res);
10034    return res;
10035  }
10036
10037  protected boolean parseImplementationGuideImplementationGuideGlobalComponentContent(int eventType, XmlPullParser xpp, ImplementationGuide owner, ImplementationGuide.ImplementationGuideGlobalComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
10038      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
10039        res.setTypeElement(parseCode(xpp));
10040      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
10041        res.setProfile(parseReference(xpp));
10042      } else if (!parseBackboneContent(eventType, xpp, res))
10043        return false;
10044    return true;
10045  }
10046
10047  protected ImplementationGuide.ImplementationGuidePageComponent parseImplementationGuideImplementationGuidePageComponent(XmlPullParser xpp, ImplementationGuide owner) throws XmlPullParserException, IOException, FHIRFormatError {
10048    ImplementationGuide.ImplementationGuidePageComponent res = new ImplementationGuide.ImplementationGuidePageComponent();
10049    parseBackboneAttributes(xpp, res);
10050    next(xpp);
10051    int eventType = nextNoWhitespace(xpp);
10052    while (eventType != XmlPullParser.END_TAG) {
10053  if (!parseImplementationGuideImplementationGuidePageComponentContent(eventType, xpp, owner, res))
10054        unknownContent(xpp);
10055      eventType = nextNoWhitespace(xpp);
10056    }
10057    next(xpp);
10058    parseElementClose(res);
10059    return res;
10060  }
10061
10062  protected boolean parseImplementationGuideImplementationGuidePageComponentContent(int eventType, XmlPullParser xpp, ImplementationGuide owner, ImplementationGuide.ImplementationGuidePageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
10063      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
10064        res.setSourceElement(parseUri(xpp));
10065      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
10066        res.setTitleElement(parseString(xpp));
10067      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("kind")) {
10068        res.setKindElement(parseEnumeration(xpp, ImplementationGuide.GuidePageKind.NULL, new ImplementationGuide.GuidePageKindEnumFactory()));
10069      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
10070        res.getType().add(parseCode(xpp));
10071      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("package")) {
10072        res.getPackage().add(parseString(xpp));
10073      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("format")) {
10074        res.setFormatElement(parseCode(xpp));
10075      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("page")) {
10076        res.getPage().add(parseImplementationGuideImplementationGuidePageComponent(xpp, owner));
10077      } else if (!parseBackboneContent(eventType, xpp, res))
10078        return false;
10079    return true;
10080  }
10081
10082  protected Library parseLibrary(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
10083    Library res = new Library();
10084    parseDomainResourceAttributes(xpp, res);
10085    next(xpp);
10086    int eventType = nextNoWhitespace(xpp);
10087    while (eventType != XmlPullParser.END_TAG) {
10088  if (!parseLibraryContent(eventType, xpp, res))
10089        unknownContent(xpp);
10090      eventType = nextNoWhitespace(xpp);
10091    }
10092    next(xpp);
10093    parseElementClose(res);
10094    return res;
10095  }
10096
10097  protected boolean parseLibraryContent(int eventType, XmlPullParser xpp, Library res) throws XmlPullParserException, IOException, FHIRFormatError {
10098      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
10099        res.setUrlElement(parseUri(xpp));
10100      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
10101        res.getIdentifier().add(parseIdentifier(xpp));
10102      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
10103        res.setVersionElement(parseString(xpp));
10104      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
10105        res.setNameElement(parseString(xpp));
10106      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
10107        res.setTitleElement(parseString(xpp));
10108      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
10109        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
10110      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
10111        res.setExperimentalElement(parseBoolean(xpp));
10112      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
10113        res.setType(parseCodeableConcept(xpp));
10114      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
10115        res.setDateElement(parseDateTime(xpp));
10116      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
10117        res.setPublisherElement(parseString(xpp));
10118      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
10119        res.setDescriptionElement(parseMarkdown(xpp));
10120      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
10121        res.setPurposeElement(parseMarkdown(xpp));
10122      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("usage")) {
10123        res.setUsageElement(parseString(xpp));
10124      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("approvalDate")) {
10125        res.setApprovalDateElement(parseDate(xpp));
10126      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastReviewDate")) {
10127        res.setLastReviewDateElement(parseDate(xpp));
10128      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("effectivePeriod")) {
10129        res.setEffectivePeriod(parsePeriod(xpp));
10130      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
10131        res.getUseContext().add(parseUsageContext(xpp));
10132      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
10133        res.getJurisdiction().add(parseCodeableConcept(xpp));
10134      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("topic")) {
10135        res.getTopic().add(parseCodeableConcept(xpp));
10136      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contributor")) {
10137        res.getContributor().add(parseContributor(xpp));
10138      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
10139        res.getContact().add(parseContactDetail(xpp));
10140      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
10141        res.setCopyrightElement(parseMarkdown(xpp));
10142      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatedArtifact")) {
10143        res.getRelatedArtifact().add(parseRelatedArtifact(xpp));
10144      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("parameter")) {
10145        res.getParameter().add(parseParameterDefinition(xpp));
10146      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dataRequirement")) {
10147        res.getDataRequirement().add(parseDataRequirement(xpp));
10148      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("content")) {
10149        res.getContent().add(parseAttachment(xpp));
10150      } else if (!parseDomainResourceContent(eventType, xpp, res))
10151        return false;
10152    return true;
10153  }
10154
10155  protected Linkage parseLinkage(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
10156    Linkage res = new Linkage();
10157    parseDomainResourceAttributes(xpp, res);
10158    next(xpp);
10159    int eventType = nextNoWhitespace(xpp);
10160    while (eventType != XmlPullParser.END_TAG) {
10161  if (!parseLinkageContent(eventType, xpp, res))
10162        unknownContent(xpp);
10163      eventType = nextNoWhitespace(xpp);
10164    }
10165    next(xpp);
10166    parseElementClose(res);
10167    return res;
10168  }
10169
10170  protected boolean parseLinkageContent(int eventType, XmlPullParser xpp, Linkage res) throws XmlPullParserException, IOException, FHIRFormatError {
10171      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("active")) {
10172        res.setActiveElement(parseBoolean(xpp));
10173      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
10174        res.setAuthor(parseReference(xpp));
10175      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("item")) {
10176        res.getItem().add(parseLinkageLinkageItemComponent(xpp, res));
10177      } else if (!parseDomainResourceContent(eventType, xpp, res))
10178        return false;
10179    return true;
10180  }
10181
10182  protected Linkage.LinkageItemComponent parseLinkageLinkageItemComponent(XmlPullParser xpp, Linkage owner) throws XmlPullParserException, IOException, FHIRFormatError {
10183    Linkage.LinkageItemComponent res = new Linkage.LinkageItemComponent();
10184    parseBackboneAttributes(xpp, res);
10185    next(xpp);
10186    int eventType = nextNoWhitespace(xpp);
10187    while (eventType != XmlPullParser.END_TAG) {
10188  if (!parseLinkageLinkageItemComponentContent(eventType, xpp, owner, res))
10189        unknownContent(xpp);
10190      eventType = nextNoWhitespace(xpp);
10191    }
10192    next(xpp);
10193    parseElementClose(res);
10194    return res;
10195  }
10196
10197  protected boolean parseLinkageLinkageItemComponentContent(int eventType, XmlPullParser xpp, Linkage owner, Linkage.LinkageItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
10198      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
10199        res.setTypeElement(parseEnumeration(xpp, Linkage.LinkageType.NULL, new Linkage.LinkageTypeEnumFactory()));
10200      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
10201        res.setResource(parseReference(xpp));
10202      } else if (!parseBackboneContent(eventType, xpp, res))
10203        return false;
10204    return true;
10205  }
10206
10207  protected ListResource parseListResource(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
10208    ListResource res = new ListResource();
10209    parseDomainResourceAttributes(xpp, res);
10210    next(xpp);
10211    int eventType = nextNoWhitespace(xpp);
10212    while (eventType != XmlPullParser.END_TAG) {
10213  if (!parseListResourceContent(eventType, xpp, res))
10214        unknownContent(xpp);
10215      eventType = nextNoWhitespace(xpp);
10216    }
10217    next(xpp);
10218    parseElementClose(res);
10219    return res;
10220  }
10221
10222  protected boolean parseListResourceContent(int eventType, XmlPullParser xpp, ListResource res) throws XmlPullParserException, IOException, FHIRFormatError {
10223      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
10224        res.getIdentifier().add(parseIdentifier(xpp));
10225      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
10226        res.setStatusElement(parseEnumeration(xpp, ListResource.ListStatus.NULL, new ListResource.ListStatusEnumFactory()));
10227      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
10228        res.setModeElement(parseEnumeration(xpp, ListResource.ListMode.NULL, new ListResource.ListModeEnumFactory()));
10229      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
10230        res.setTitleElement(parseString(xpp));
10231      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
10232        res.setCode(parseCodeableConcept(xpp));
10233      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
10234        res.setSubject(parseReference(xpp));
10235      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
10236        res.setEncounter(parseReference(xpp));
10237      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
10238        res.setDateElement(parseDateTime(xpp));
10239      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
10240        res.setSource(parseReference(xpp));
10241      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("orderedBy")) {
10242        res.setOrderedBy(parseCodeableConcept(xpp));
10243      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
10244        res.getNote().add(parseAnnotation(xpp));
10245      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("entry")) {
10246        res.getEntry().add(parseListResourceListEntryComponent(xpp, res));
10247      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("emptyReason")) {
10248        res.setEmptyReason(parseCodeableConcept(xpp));
10249      } else if (!parseDomainResourceContent(eventType, xpp, res))
10250        return false;
10251    return true;
10252  }
10253
10254  protected ListResource.ListEntryComponent parseListResourceListEntryComponent(XmlPullParser xpp, ListResource owner) throws XmlPullParserException, IOException, FHIRFormatError {
10255    ListResource.ListEntryComponent res = new ListResource.ListEntryComponent();
10256    parseBackboneAttributes(xpp, res);
10257    next(xpp);
10258    int eventType = nextNoWhitespace(xpp);
10259    while (eventType != XmlPullParser.END_TAG) {
10260  if (!parseListResourceListEntryComponentContent(eventType, xpp, owner, res))
10261        unknownContent(xpp);
10262      eventType = nextNoWhitespace(xpp);
10263    }
10264    next(xpp);
10265    parseElementClose(res);
10266    return res;
10267  }
10268
10269  protected boolean parseListResourceListEntryComponentContent(int eventType, XmlPullParser xpp, ListResource owner, ListResource.ListEntryComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
10270      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("flag")) {
10271        res.setFlag(parseCodeableConcept(xpp));
10272      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("deleted")) {
10273        res.setDeletedElement(parseBoolean(xpp));
10274      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
10275        res.setDateElement(parseDateTime(xpp));
10276      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("item")) {
10277        res.setItem(parseReference(xpp));
10278      } else if (!parseBackboneContent(eventType, xpp, res))
10279        return false;
10280    return true;
10281  }
10282
10283  protected Location parseLocation(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
10284    Location res = new Location();
10285    parseDomainResourceAttributes(xpp, res);
10286    next(xpp);
10287    int eventType = nextNoWhitespace(xpp);
10288    while (eventType != XmlPullParser.END_TAG) {
10289  if (!parseLocationContent(eventType, xpp, res))
10290        unknownContent(xpp);
10291      eventType = nextNoWhitespace(xpp);
10292    }
10293    next(xpp);
10294    parseElementClose(res);
10295    return res;
10296  }
10297
10298  protected boolean parseLocationContent(int eventType, XmlPullParser xpp, Location res) throws XmlPullParserException, IOException, FHIRFormatError {
10299      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
10300        res.getIdentifier().add(parseIdentifier(xpp));
10301      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
10302        res.setStatusElement(parseEnumeration(xpp, Location.LocationStatus.NULL, new Location.LocationStatusEnumFactory()));
10303      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operationalStatus")) {
10304        res.setOperationalStatus(parseCoding(xpp));
10305      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
10306        res.setNameElement(parseString(xpp));
10307      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("alias")) {
10308        res.getAlias().add(parseString(xpp));
10309      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
10310        res.setDescriptionElement(parseString(xpp));
10311      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
10312        res.setModeElement(parseEnumeration(xpp, Location.LocationMode.NULL, new Location.LocationModeEnumFactory()));
10313      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
10314        res.setType(parseCodeableConcept(xpp));
10315      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("telecom")) {
10316        res.getTelecom().add(parseContactPoint(xpp));
10317      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("address")) {
10318        res.setAddress(parseAddress(xpp));
10319      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("physicalType")) {
10320        res.setPhysicalType(parseCodeableConcept(xpp));
10321      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("position")) {
10322        res.setPosition(parseLocationLocationPositionComponent(xpp, res));
10323      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("managingOrganization")) {
10324        res.setManagingOrganization(parseReference(xpp));
10325      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
10326        res.setPartOf(parseReference(xpp));
10327      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("endpoint")) {
10328        res.getEndpoint().add(parseReference(xpp));
10329      } else if (!parseDomainResourceContent(eventType, xpp, res))
10330        return false;
10331    return true;
10332  }
10333
10334  protected Location.LocationPositionComponent parseLocationLocationPositionComponent(XmlPullParser xpp, Location owner) throws XmlPullParserException, IOException, FHIRFormatError {
10335    Location.LocationPositionComponent res = new Location.LocationPositionComponent();
10336    parseBackboneAttributes(xpp, res);
10337    next(xpp);
10338    int eventType = nextNoWhitespace(xpp);
10339    while (eventType != XmlPullParser.END_TAG) {
10340  if (!parseLocationLocationPositionComponentContent(eventType, xpp, owner, res))
10341        unknownContent(xpp);
10342      eventType = nextNoWhitespace(xpp);
10343    }
10344    next(xpp);
10345    parseElementClose(res);
10346    return res;
10347  }
10348
10349  protected boolean parseLocationLocationPositionComponentContent(int eventType, XmlPullParser xpp, Location owner, Location.LocationPositionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
10350      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("longitude")) {
10351        res.setLongitudeElement(parseDecimal(xpp));
10352      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("latitude")) {
10353        res.setLatitudeElement(parseDecimal(xpp));
10354      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("altitude")) {
10355        res.setAltitudeElement(parseDecimal(xpp));
10356      } else if (!parseBackboneContent(eventType, xpp, res))
10357        return false;
10358    return true;
10359  }
10360
10361  protected Measure parseMeasure(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
10362    Measure res = new Measure();
10363    parseDomainResourceAttributes(xpp, res);
10364    next(xpp);
10365    int eventType = nextNoWhitespace(xpp);
10366    while (eventType != XmlPullParser.END_TAG) {
10367  if (!parseMeasureContent(eventType, xpp, res))
10368        unknownContent(xpp);
10369      eventType = nextNoWhitespace(xpp);
10370    }
10371    next(xpp);
10372    parseElementClose(res);
10373    return res;
10374  }
10375
10376  protected boolean parseMeasureContent(int eventType, XmlPullParser xpp, Measure res) throws XmlPullParserException, IOException, FHIRFormatError {
10377      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
10378        res.setUrlElement(parseUri(xpp));
10379      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
10380        res.getIdentifier().add(parseIdentifier(xpp));
10381      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
10382        res.setVersionElement(parseString(xpp));
10383      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
10384        res.setNameElement(parseString(xpp));
10385      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
10386        res.setTitleElement(parseString(xpp));
10387      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
10388        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
10389      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
10390        res.setExperimentalElement(parseBoolean(xpp));
10391      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
10392        res.setDateElement(parseDateTime(xpp));
10393      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
10394        res.setPublisherElement(parseString(xpp));
10395      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
10396        res.setDescriptionElement(parseMarkdown(xpp));
10397      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
10398        res.setPurposeElement(parseMarkdown(xpp));
10399      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("usage")) {
10400        res.setUsageElement(parseString(xpp));
10401      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("approvalDate")) {
10402        res.setApprovalDateElement(parseDate(xpp));
10403      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastReviewDate")) {
10404        res.setLastReviewDateElement(parseDate(xpp));
10405      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("effectivePeriod")) {
10406        res.setEffectivePeriod(parsePeriod(xpp));
10407      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
10408        res.getUseContext().add(parseUsageContext(xpp));
10409      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
10410        res.getJurisdiction().add(parseCodeableConcept(xpp));
10411      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("topic")) {
10412        res.getTopic().add(parseCodeableConcept(xpp));
10413      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contributor")) {
10414        res.getContributor().add(parseContributor(xpp));
10415      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
10416        res.getContact().add(parseContactDetail(xpp));
10417      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
10418        res.setCopyrightElement(parseMarkdown(xpp));
10419      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatedArtifact")) {
10420        res.getRelatedArtifact().add(parseRelatedArtifact(xpp));
10421      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("library")) {
10422        res.getLibrary().add(parseReference(xpp));
10423      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("disclaimer")) {
10424        res.setDisclaimerElement(parseMarkdown(xpp));
10425      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("scoring")) {
10426        res.setScoring(parseCodeableConcept(xpp));
10427      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("compositeScoring")) {
10428        res.setCompositeScoring(parseCodeableConcept(xpp));
10429      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
10430        res.getType().add(parseCodeableConcept(xpp));
10431      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("riskAdjustment")) {
10432        res.setRiskAdjustmentElement(parseString(xpp));
10433      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rateAggregation")) {
10434        res.setRateAggregationElement(parseString(xpp));
10435      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rationale")) {
10436        res.setRationaleElement(parseMarkdown(xpp));
10437      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("clinicalRecommendationStatement")) {
10438        res.setClinicalRecommendationStatementElement(parseMarkdown(xpp));
10439      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("improvementNotation")) {
10440        res.setImprovementNotationElement(parseString(xpp));
10441      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
10442        res.getDefinition().add(parseMarkdown(xpp));
10443      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("guidance")) {
10444        res.setGuidanceElement(parseMarkdown(xpp));
10445      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("set")) {
10446        res.setSetElement(parseString(xpp));
10447      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("group")) {
10448        res.getGroup().add(parseMeasureMeasureGroupComponent(xpp, res));
10449      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supplementalData")) {
10450        res.getSupplementalData().add(parseMeasureMeasureSupplementalDataComponent(xpp, res));
10451      } else if (!parseDomainResourceContent(eventType, xpp, res))
10452        return false;
10453    return true;
10454  }
10455
10456  protected Measure.MeasureGroupComponent parseMeasureMeasureGroupComponent(XmlPullParser xpp, Measure owner) throws XmlPullParserException, IOException, FHIRFormatError {
10457    Measure.MeasureGroupComponent res = new Measure.MeasureGroupComponent();
10458    parseBackboneAttributes(xpp, res);
10459    next(xpp);
10460    int eventType = nextNoWhitespace(xpp);
10461    while (eventType != XmlPullParser.END_TAG) {
10462  if (!parseMeasureMeasureGroupComponentContent(eventType, xpp, owner, res))
10463        unknownContent(xpp);
10464      eventType = nextNoWhitespace(xpp);
10465    }
10466    next(xpp);
10467    parseElementClose(res);
10468    return res;
10469  }
10470
10471  protected boolean parseMeasureMeasureGroupComponentContent(int eventType, XmlPullParser xpp, Measure owner, Measure.MeasureGroupComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
10472      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
10473        res.setIdentifier(parseIdentifier(xpp));
10474      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
10475        res.setNameElement(parseString(xpp));
10476      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
10477        res.setDescriptionElement(parseString(xpp));
10478      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("population")) {
10479        res.getPopulation().add(parseMeasureMeasureGroupPopulationComponent(xpp, owner));
10480      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("stratifier")) {
10481        res.getStratifier().add(parseMeasureMeasureGroupStratifierComponent(xpp, owner));
10482      } else if (!parseBackboneContent(eventType, xpp, res))
10483        return false;
10484    return true;
10485  }
10486
10487  protected Measure.MeasureGroupPopulationComponent parseMeasureMeasureGroupPopulationComponent(XmlPullParser xpp, Measure owner) throws XmlPullParserException, IOException, FHIRFormatError {
10488    Measure.MeasureGroupPopulationComponent res = new Measure.MeasureGroupPopulationComponent();
10489    parseBackboneAttributes(xpp, res);
10490    next(xpp);
10491    int eventType = nextNoWhitespace(xpp);
10492    while (eventType != XmlPullParser.END_TAG) {
10493  if (!parseMeasureMeasureGroupPopulationComponentContent(eventType, xpp, owner, res))
10494        unknownContent(xpp);
10495      eventType = nextNoWhitespace(xpp);
10496    }
10497    next(xpp);
10498    parseElementClose(res);
10499    return res;
10500  }
10501
10502  protected boolean parseMeasureMeasureGroupPopulationComponentContent(int eventType, XmlPullParser xpp, Measure owner, Measure.MeasureGroupPopulationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
10503      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
10504        res.setIdentifier(parseIdentifier(xpp));
10505      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
10506        res.setCode(parseCodeableConcept(xpp));
10507      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
10508        res.setNameElement(parseString(xpp));
10509      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
10510        res.setDescriptionElement(parseString(xpp));
10511      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("criteria")) {
10512        res.setCriteriaElement(parseString(xpp));
10513      } else if (!parseBackboneContent(eventType, xpp, res))
10514        return false;
10515    return true;
10516  }
10517
10518  protected Measure.MeasureGroupStratifierComponent parseMeasureMeasureGroupStratifierComponent(XmlPullParser xpp, Measure owner) throws XmlPullParserException, IOException, FHIRFormatError {
10519    Measure.MeasureGroupStratifierComponent res = new Measure.MeasureGroupStratifierComponent();
10520    parseBackboneAttributes(xpp, res);
10521    next(xpp);
10522    int eventType = nextNoWhitespace(xpp);
10523    while (eventType != XmlPullParser.END_TAG) {
10524  if (!parseMeasureMeasureGroupStratifierComponentContent(eventType, xpp, owner, res))
10525        unknownContent(xpp);
10526      eventType = nextNoWhitespace(xpp);
10527    }
10528    next(xpp);
10529    parseElementClose(res);
10530    return res;
10531  }
10532
10533  protected boolean parseMeasureMeasureGroupStratifierComponentContent(int eventType, XmlPullParser xpp, Measure owner, Measure.MeasureGroupStratifierComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
10534      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
10535        res.setIdentifier(parseIdentifier(xpp));
10536      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("criteria")) {
10537        res.setCriteriaElement(parseString(xpp));
10538      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
10539        res.setPathElement(parseString(xpp));
10540      } else if (!parseBackboneContent(eventType, xpp, res))
10541        return false;
10542    return true;
10543  }
10544
10545  protected Measure.MeasureSupplementalDataComponent parseMeasureMeasureSupplementalDataComponent(XmlPullParser xpp, Measure owner) throws XmlPullParserException, IOException, FHIRFormatError {
10546    Measure.MeasureSupplementalDataComponent res = new Measure.MeasureSupplementalDataComponent();
10547    parseBackboneAttributes(xpp, res);
10548    next(xpp);
10549    int eventType = nextNoWhitespace(xpp);
10550    while (eventType != XmlPullParser.END_TAG) {
10551  if (!parseMeasureMeasureSupplementalDataComponentContent(eventType, xpp, owner, res))
10552        unknownContent(xpp);
10553      eventType = nextNoWhitespace(xpp);
10554    }
10555    next(xpp);
10556    parseElementClose(res);
10557    return res;
10558  }
10559
10560  protected boolean parseMeasureMeasureSupplementalDataComponentContent(int eventType, XmlPullParser xpp, Measure owner, Measure.MeasureSupplementalDataComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
10561      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
10562        res.setIdentifier(parseIdentifier(xpp));
10563      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("usage")) {
10564        res.getUsage().add(parseCodeableConcept(xpp));
10565      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("criteria")) {
10566        res.setCriteriaElement(parseString(xpp));
10567      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
10568        res.setPathElement(parseString(xpp));
10569      } else if (!parseBackboneContent(eventType, xpp, res))
10570        return false;
10571    return true;
10572  }
10573
10574  protected MeasureReport parseMeasureReport(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
10575    MeasureReport res = new MeasureReport();
10576    parseDomainResourceAttributes(xpp, res);
10577    next(xpp);
10578    int eventType = nextNoWhitespace(xpp);
10579    while (eventType != XmlPullParser.END_TAG) {
10580  if (!parseMeasureReportContent(eventType, xpp, res))
10581        unknownContent(xpp);
10582      eventType = nextNoWhitespace(xpp);
10583    }
10584    next(xpp);
10585    parseElementClose(res);
10586    return res;
10587  }
10588
10589  protected boolean parseMeasureReportContent(int eventType, XmlPullParser xpp, MeasureReport res) throws XmlPullParserException, IOException, FHIRFormatError {
10590      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
10591        res.setIdentifier(parseIdentifier(xpp));
10592      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
10593        res.setStatusElement(parseEnumeration(xpp, MeasureReport.MeasureReportStatus.NULL, new MeasureReport.MeasureReportStatusEnumFactory()));
10594      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
10595        res.setTypeElement(parseEnumeration(xpp, MeasureReport.MeasureReportType.NULL, new MeasureReport.MeasureReportTypeEnumFactory()));
10596      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("measure")) {
10597        res.setMeasure(parseReference(xpp));
10598      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
10599        res.setPatient(parseReference(xpp));
10600      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
10601        res.setDateElement(parseDateTime(xpp));
10602      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reportingOrganization")) {
10603        res.setReportingOrganization(parseReference(xpp));
10604      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
10605        res.setPeriod(parsePeriod(xpp));
10606      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("group")) {
10607        res.getGroup().add(parseMeasureReportMeasureReportGroupComponent(xpp, res));
10608      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("evaluatedResources")) {
10609        res.setEvaluatedResources(parseReference(xpp));
10610      } else if (!parseDomainResourceContent(eventType, xpp, res))
10611        return false;
10612    return true;
10613  }
10614
10615  protected MeasureReport.MeasureReportGroupComponent parseMeasureReportMeasureReportGroupComponent(XmlPullParser xpp, MeasureReport owner) throws XmlPullParserException, IOException, FHIRFormatError {
10616    MeasureReport.MeasureReportGroupComponent res = new MeasureReport.MeasureReportGroupComponent();
10617    parseBackboneAttributes(xpp, res);
10618    next(xpp);
10619    int eventType = nextNoWhitespace(xpp);
10620    while (eventType != XmlPullParser.END_TAG) {
10621  if (!parseMeasureReportMeasureReportGroupComponentContent(eventType, xpp, owner, res))
10622        unknownContent(xpp);
10623      eventType = nextNoWhitespace(xpp);
10624    }
10625    next(xpp);
10626    parseElementClose(res);
10627    return res;
10628  }
10629
10630  protected boolean parseMeasureReportMeasureReportGroupComponentContent(int eventType, XmlPullParser xpp, MeasureReport owner, MeasureReport.MeasureReportGroupComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
10631      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
10632        res.setIdentifier(parseIdentifier(xpp));
10633      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("population")) {
10634        res.getPopulation().add(parseMeasureReportMeasureReportGroupPopulationComponent(xpp, owner));
10635      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("measureScore")) {
10636        res.setMeasureScoreElement(parseDecimal(xpp));
10637      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("stratifier")) {
10638        res.getStratifier().add(parseMeasureReportMeasureReportGroupStratifierComponent(xpp, owner));
10639      } else if (!parseBackboneContent(eventType, xpp, res))
10640        return false;
10641    return true;
10642  }
10643
10644  protected MeasureReport.MeasureReportGroupPopulationComponent parseMeasureReportMeasureReportGroupPopulationComponent(XmlPullParser xpp, MeasureReport owner) throws XmlPullParserException, IOException, FHIRFormatError {
10645    MeasureReport.MeasureReportGroupPopulationComponent res = new MeasureReport.MeasureReportGroupPopulationComponent();
10646    parseBackboneAttributes(xpp, res);
10647    next(xpp);
10648    int eventType = nextNoWhitespace(xpp);
10649    while (eventType != XmlPullParser.END_TAG) {
10650  if (!parseMeasureReportMeasureReportGroupPopulationComponentContent(eventType, xpp, owner, res))
10651        unknownContent(xpp);
10652      eventType = nextNoWhitespace(xpp);
10653    }
10654    next(xpp);
10655    parseElementClose(res);
10656    return res;
10657  }
10658
10659  protected boolean parseMeasureReportMeasureReportGroupPopulationComponentContent(int eventType, XmlPullParser xpp, MeasureReport owner, MeasureReport.MeasureReportGroupPopulationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
10660      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
10661        res.setIdentifier(parseIdentifier(xpp));
10662      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
10663        res.setCode(parseCodeableConcept(xpp));
10664      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("count")) {
10665        res.setCountElement(parseInteger(xpp));
10666      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patients")) {
10667        res.setPatients(parseReference(xpp));
10668      } else if (!parseBackboneContent(eventType, xpp, res))
10669        return false;
10670    return true;
10671  }
10672
10673  protected MeasureReport.MeasureReportGroupStratifierComponent parseMeasureReportMeasureReportGroupStratifierComponent(XmlPullParser xpp, MeasureReport owner) throws XmlPullParserException, IOException, FHIRFormatError {
10674    MeasureReport.MeasureReportGroupStratifierComponent res = new MeasureReport.MeasureReportGroupStratifierComponent();
10675    parseBackboneAttributes(xpp, res);
10676    next(xpp);
10677    int eventType = nextNoWhitespace(xpp);
10678    while (eventType != XmlPullParser.END_TAG) {
10679  if (!parseMeasureReportMeasureReportGroupStratifierComponentContent(eventType, xpp, owner, res))
10680        unknownContent(xpp);
10681      eventType = nextNoWhitespace(xpp);
10682    }
10683    next(xpp);
10684    parseElementClose(res);
10685    return res;
10686  }
10687
10688  protected boolean parseMeasureReportMeasureReportGroupStratifierComponentContent(int eventType, XmlPullParser xpp, MeasureReport owner, MeasureReport.MeasureReportGroupStratifierComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
10689      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
10690        res.setIdentifier(parseIdentifier(xpp));
10691      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("stratum")) {
10692        res.getStratum().add(parseMeasureReportStratifierGroupComponent(xpp, owner));
10693      } else if (!parseBackboneContent(eventType, xpp, res))
10694        return false;
10695    return true;
10696  }
10697
10698  protected MeasureReport.StratifierGroupComponent parseMeasureReportStratifierGroupComponent(XmlPullParser xpp, MeasureReport owner) throws XmlPullParserException, IOException, FHIRFormatError {
10699    MeasureReport.StratifierGroupComponent res = new MeasureReport.StratifierGroupComponent();
10700    parseBackboneAttributes(xpp, res);
10701    next(xpp);
10702    int eventType = nextNoWhitespace(xpp);
10703    while (eventType != XmlPullParser.END_TAG) {
10704  if (!parseMeasureReportStratifierGroupComponentContent(eventType, xpp, owner, res))
10705        unknownContent(xpp);
10706      eventType = nextNoWhitespace(xpp);
10707    }
10708    next(xpp);
10709    parseElementClose(res);
10710    return res;
10711  }
10712
10713  protected boolean parseMeasureReportStratifierGroupComponentContent(int eventType, XmlPullParser xpp, MeasureReport owner, MeasureReport.StratifierGroupComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
10714      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
10715        res.setValueElement(parseString(xpp));
10716      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("population")) {
10717        res.getPopulation().add(parseMeasureReportStratifierGroupPopulationComponent(xpp, owner));
10718      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("measureScore")) {
10719        res.setMeasureScoreElement(parseDecimal(xpp));
10720      } else if (!parseBackboneContent(eventType, xpp, res))
10721        return false;
10722    return true;
10723  }
10724
10725  protected MeasureReport.StratifierGroupPopulationComponent parseMeasureReportStratifierGroupPopulationComponent(XmlPullParser xpp, MeasureReport owner) throws XmlPullParserException, IOException, FHIRFormatError {
10726    MeasureReport.StratifierGroupPopulationComponent res = new MeasureReport.StratifierGroupPopulationComponent();
10727    parseBackboneAttributes(xpp, res);
10728    next(xpp);
10729    int eventType = nextNoWhitespace(xpp);
10730    while (eventType != XmlPullParser.END_TAG) {
10731  if (!parseMeasureReportStratifierGroupPopulationComponentContent(eventType, xpp, owner, res))
10732        unknownContent(xpp);
10733      eventType = nextNoWhitespace(xpp);
10734    }
10735    next(xpp);
10736    parseElementClose(res);
10737    return res;
10738  }
10739
10740  protected boolean parseMeasureReportStratifierGroupPopulationComponentContent(int eventType, XmlPullParser xpp, MeasureReport owner, MeasureReport.StratifierGroupPopulationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
10741      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
10742        res.setIdentifier(parseIdentifier(xpp));
10743      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
10744        res.setCode(parseCodeableConcept(xpp));
10745      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("count")) {
10746        res.setCountElement(parseInteger(xpp));
10747      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patients")) {
10748        res.setPatients(parseReference(xpp));
10749      } else if (!parseBackboneContent(eventType, xpp, res))
10750        return false;
10751    return true;
10752  }
10753
10754  protected Media parseMedia(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
10755    Media res = new Media();
10756    parseDomainResourceAttributes(xpp, res);
10757    next(xpp);
10758    int eventType = nextNoWhitespace(xpp);
10759    while (eventType != XmlPullParser.END_TAG) {
10760  if (!parseMediaContent(eventType, xpp, res))
10761        unknownContent(xpp);
10762      eventType = nextNoWhitespace(xpp);
10763    }
10764    next(xpp);
10765    parseElementClose(res);
10766    return res;
10767  }
10768
10769  protected boolean parseMediaContent(int eventType, XmlPullParser xpp, Media res) throws XmlPullParserException, IOException, FHIRFormatError {
10770      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
10771        res.getIdentifier().add(parseIdentifier(xpp));
10772      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
10773        res.getBasedOn().add(parseReference(xpp));
10774      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
10775        res.setTypeElement(parseEnumeration(xpp, Media.DigitalMediaType.NULL, new Media.DigitalMediaTypeEnumFactory()));
10776      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subtype")) {
10777        res.setSubtype(parseCodeableConcept(xpp));
10778      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("view")) {
10779        res.setView(parseCodeableConcept(xpp));
10780      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
10781        res.setSubject(parseReference(xpp));
10782      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
10783        res.setContext(parseReference(xpp));
10784      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "occurrence")) {
10785        res.setOccurrence(parseType("occurrence", xpp));
10786      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operator")) {
10787        res.setOperator(parseReference(xpp));
10788      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonCode")) {
10789        res.getReasonCode().add(parseCodeableConcept(xpp));
10790      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodySite")) {
10791        res.setBodySite(parseCodeableConcept(xpp));
10792      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("device")) {
10793        res.setDevice(parseReference(xpp));
10794      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("height")) {
10795        res.setHeightElement(parsePositiveInt(xpp));
10796      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("width")) {
10797        res.setWidthElement(parsePositiveInt(xpp));
10798      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("frames")) {
10799        res.setFramesElement(parsePositiveInt(xpp));
10800      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("duration")) {
10801        res.setDurationElement(parseUnsignedInt(xpp));
10802      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("content")) {
10803        res.setContent(parseAttachment(xpp));
10804      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
10805        res.getNote().add(parseAnnotation(xpp));
10806      } else if (!parseDomainResourceContent(eventType, xpp, res))
10807        return false;
10808    return true;
10809  }
10810
10811  protected Medication parseMedication(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
10812    Medication res = new Medication();
10813    parseDomainResourceAttributes(xpp, res);
10814    next(xpp);
10815    int eventType = nextNoWhitespace(xpp);
10816    while (eventType != XmlPullParser.END_TAG) {
10817  if (!parseMedicationContent(eventType, xpp, res))
10818        unknownContent(xpp);
10819      eventType = nextNoWhitespace(xpp);
10820    }
10821    next(xpp);
10822    parseElementClose(res);
10823    return res;
10824  }
10825
10826  protected boolean parseMedicationContent(int eventType, XmlPullParser xpp, Medication res) throws XmlPullParserException, IOException, FHIRFormatError {
10827      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
10828        res.setCode(parseCodeableConcept(xpp));
10829      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
10830        res.setStatusElement(parseEnumeration(xpp, Medication.MedicationStatus.NULL, new Medication.MedicationStatusEnumFactory()));
10831      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("isBrand")) {
10832        res.setIsBrandElement(parseBoolean(xpp));
10833      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("isOverTheCounter")) {
10834        res.setIsOverTheCounterElement(parseBoolean(xpp));
10835      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("manufacturer")) {
10836        res.setManufacturer(parseReference(xpp));
10837      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("form")) {
10838        res.setForm(parseCodeableConcept(xpp));
10839      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ingredient")) {
10840        res.getIngredient().add(parseMedicationMedicationIngredientComponent(xpp, res));
10841      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("package")) {
10842        res.setPackage(parseMedicationMedicationPackageComponent(xpp, res));
10843      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("image")) {
10844        res.getImage().add(parseAttachment(xpp));
10845      } else if (!parseDomainResourceContent(eventType, xpp, res))
10846        return false;
10847    return true;
10848  }
10849
10850  protected Medication.MedicationIngredientComponent parseMedicationMedicationIngredientComponent(XmlPullParser xpp, Medication owner) throws XmlPullParserException, IOException, FHIRFormatError {
10851    Medication.MedicationIngredientComponent res = new Medication.MedicationIngredientComponent();
10852    parseBackboneAttributes(xpp, res);
10853    next(xpp);
10854    int eventType = nextNoWhitespace(xpp);
10855    while (eventType != XmlPullParser.END_TAG) {
10856  if (!parseMedicationMedicationIngredientComponentContent(eventType, xpp, owner, res))
10857        unknownContent(xpp);
10858      eventType = nextNoWhitespace(xpp);
10859    }
10860    next(xpp);
10861    parseElementClose(res);
10862    return res;
10863  }
10864
10865  protected boolean parseMedicationMedicationIngredientComponentContent(int eventType, XmlPullParser xpp, Medication owner, Medication.MedicationIngredientComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
10866      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "item")) {
10867        res.setItem(parseType("item", xpp));
10868      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("isActive")) {
10869        res.setIsActiveElement(parseBoolean(xpp));
10870      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("amount")) {
10871        res.setAmount(parseRatio(xpp));
10872      } else if (!parseBackboneContent(eventType, xpp, res))
10873        return false;
10874    return true;
10875  }
10876
10877  protected Medication.MedicationPackageComponent parseMedicationMedicationPackageComponent(XmlPullParser xpp, Medication owner) throws XmlPullParserException, IOException, FHIRFormatError {
10878    Medication.MedicationPackageComponent res = new Medication.MedicationPackageComponent();
10879    parseBackboneAttributes(xpp, res);
10880    next(xpp);
10881    int eventType = nextNoWhitespace(xpp);
10882    while (eventType != XmlPullParser.END_TAG) {
10883  if (!parseMedicationMedicationPackageComponentContent(eventType, xpp, owner, res))
10884        unknownContent(xpp);
10885      eventType = nextNoWhitespace(xpp);
10886    }
10887    next(xpp);
10888    parseElementClose(res);
10889    return res;
10890  }
10891
10892  protected boolean parseMedicationMedicationPackageComponentContent(int eventType, XmlPullParser xpp, Medication owner, Medication.MedicationPackageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
10893      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("container")) {
10894        res.setContainer(parseCodeableConcept(xpp));
10895      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("content")) {
10896        res.getContent().add(parseMedicationMedicationPackageContentComponent(xpp, owner));
10897      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("batch")) {
10898        res.getBatch().add(parseMedicationMedicationPackageBatchComponent(xpp, owner));
10899      } else if (!parseBackboneContent(eventType, xpp, res))
10900        return false;
10901    return true;
10902  }
10903
10904  protected Medication.MedicationPackageContentComponent parseMedicationMedicationPackageContentComponent(XmlPullParser xpp, Medication owner) throws XmlPullParserException, IOException, FHIRFormatError {
10905    Medication.MedicationPackageContentComponent res = new Medication.MedicationPackageContentComponent();
10906    parseBackboneAttributes(xpp, res);
10907    next(xpp);
10908    int eventType = nextNoWhitespace(xpp);
10909    while (eventType != XmlPullParser.END_TAG) {
10910  if (!parseMedicationMedicationPackageContentComponentContent(eventType, xpp, owner, res))
10911        unknownContent(xpp);
10912      eventType = nextNoWhitespace(xpp);
10913    }
10914    next(xpp);
10915    parseElementClose(res);
10916    return res;
10917  }
10918
10919  protected boolean parseMedicationMedicationPackageContentComponentContent(int eventType, XmlPullParser xpp, Medication owner, Medication.MedicationPackageContentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
10920      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "item")) {
10921        res.setItem(parseType("item", xpp));
10922      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("amount")) {
10923        res.setAmount(parseSimpleQuantity(xpp));
10924      } else if (!parseBackboneContent(eventType, xpp, res))
10925        return false;
10926    return true;
10927  }
10928
10929  protected Medication.MedicationPackageBatchComponent parseMedicationMedicationPackageBatchComponent(XmlPullParser xpp, Medication owner) throws XmlPullParserException, IOException, FHIRFormatError {
10930    Medication.MedicationPackageBatchComponent res = new Medication.MedicationPackageBatchComponent();
10931    parseBackboneAttributes(xpp, res);
10932    next(xpp);
10933    int eventType = nextNoWhitespace(xpp);
10934    while (eventType != XmlPullParser.END_TAG) {
10935  if (!parseMedicationMedicationPackageBatchComponentContent(eventType, xpp, owner, res))
10936        unknownContent(xpp);
10937      eventType = nextNoWhitespace(xpp);
10938    }
10939    next(xpp);
10940    parseElementClose(res);
10941    return res;
10942  }
10943
10944  protected boolean parseMedicationMedicationPackageBatchComponentContent(int eventType, XmlPullParser xpp, Medication owner, Medication.MedicationPackageBatchComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
10945      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lotNumber")) {
10946        res.setLotNumberElement(parseString(xpp));
10947      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expirationDate")) {
10948        res.setExpirationDateElement(parseDateTime(xpp));
10949      } else if (!parseBackboneContent(eventType, xpp, res))
10950        return false;
10951    return true;
10952  }
10953
10954  protected MedicationAdministration parseMedicationAdministration(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
10955    MedicationAdministration res = new MedicationAdministration();
10956    parseDomainResourceAttributes(xpp, res);
10957    next(xpp);
10958    int eventType = nextNoWhitespace(xpp);
10959    while (eventType != XmlPullParser.END_TAG) {
10960  if (!parseMedicationAdministrationContent(eventType, xpp, res))
10961        unknownContent(xpp);
10962      eventType = nextNoWhitespace(xpp);
10963    }
10964    next(xpp);
10965    parseElementClose(res);
10966    return res;
10967  }
10968
10969  protected boolean parseMedicationAdministrationContent(int eventType, XmlPullParser xpp, MedicationAdministration res) throws XmlPullParserException, IOException, FHIRFormatError {
10970      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
10971        res.getIdentifier().add(parseIdentifier(xpp));
10972      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
10973        res.getDefinition().add(parseReference(xpp));
10974      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
10975        res.getPartOf().add(parseReference(xpp));
10976      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
10977        res.setStatusElement(parseEnumeration(xpp, MedicationAdministration.MedicationAdministrationStatus.NULL, new MedicationAdministration.MedicationAdministrationStatusEnumFactory()));
10978      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
10979        res.setCategory(parseCodeableConcept(xpp));
10980      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "medication")) {
10981        res.setMedication(parseType("medication", xpp));
10982      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
10983        res.setSubject(parseReference(xpp));
10984      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
10985        res.setContext(parseReference(xpp));
10986      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInformation")) {
10987        res.getSupportingInformation().add(parseReference(xpp));
10988      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "effective")) {
10989        res.setEffective(parseType("effective", xpp));
10990      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performer")) {
10991        res.getPerformer().add(parseMedicationAdministrationMedicationAdministrationPerformerComponent(xpp, res));
10992      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("notGiven")) {
10993        res.setNotGivenElement(parseBoolean(xpp));
10994      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonNotGiven")) {
10995        res.getReasonNotGiven().add(parseCodeableConcept(xpp));
10996      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonCode")) {
10997        res.getReasonCode().add(parseCodeableConcept(xpp));
10998      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonReference")) {
10999        res.getReasonReference().add(parseReference(xpp));
11000      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prescription")) {
11001        res.setPrescription(parseReference(xpp));
11002      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("device")) {
11003        res.getDevice().add(parseReference(xpp));
11004      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
11005        res.getNote().add(parseAnnotation(xpp));
11006      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dosage")) {
11007        res.setDosage(parseMedicationAdministrationMedicationAdministrationDosageComponent(xpp, res));
11008      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("eventHistory")) {
11009        res.getEventHistory().add(parseReference(xpp));
11010      } else if (!parseDomainResourceContent(eventType, xpp, res))
11011        return false;
11012    return true;
11013  }
11014
11015  protected MedicationAdministration.MedicationAdministrationPerformerComponent parseMedicationAdministrationMedicationAdministrationPerformerComponent(XmlPullParser xpp, MedicationAdministration owner) throws XmlPullParserException, IOException, FHIRFormatError {
11016    MedicationAdministration.MedicationAdministrationPerformerComponent res = new MedicationAdministration.MedicationAdministrationPerformerComponent();
11017    parseBackboneAttributes(xpp, res);
11018    next(xpp);
11019    int eventType = nextNoWhitespace(xpp);
11020    while (eventType != XmlPullParser.END_TAG) {
11021  if (!parseMedicationAdministrationMedicationAdministrationPerformerComponentContent(eventType, xpp, owner, res))
11022        unknownContent(xpp);
11023      eventType = nextNoWhitespace(xpp);
11024    }
11025    next(xpp);
11026    parseElementClose(res);
11027    return res;
11028  }
11029
11030  protected boolean parseMedicationAdministrationMedicationAdministrationPerformerComponentContent(int eventType, XmlPullParser xpp, MedicationAdministration owner, MedicationAdministration.MedicationAdministrationPerformerComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
11031      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
11032        res.setActor(parseReference(xpp));
11033      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onBehalfOf")) {
11034        res.setOnBehalfOf(parseReference(xpp));
11035      } else if (!parseBackboneContent(eventType, xpp, res))
11036        return false;
11037    return true;
11038  }
11039
11040  protected MedicationAdministration.MedicationAdministrationDosageComponent parseMedicationAdministrationMedicationAdministrationDosageComponent(XmlPullParser xpp, MedicationAdministration owner) throws XmlPullParserException, IOException, FHIRFormatError {
11041    MedicationAdministration.MedicationAdministrationDosageComponent res = new MedicationAdministration.MedicationAdministrationDosageComponent();
11042    parseBackboneAttributes(xpp, res);
11043    next(xpp);
11044    int eventType = nextNoWhitespace(xpp);
11045    while (eventType != XmlPullParser.END_TAG) {
11046  if (!parseMedicationAdministrationMedicationAdministrationDosageComponentContent(eventType, xpp, owner, res))
11047        unknownContent(xpp);
11048      eventType = nextNoWhitespace(xpp);
11049    }
11050    next(xpp);
11051    parseElementClose(res);
11052    return res;
11053  }
11054
11055  protected boolean parseMedicationAdministrationMedicationAdministrationDosageComponentContent(int eventType, XmlPullParser xpp, MedicationAdministration owner, MedicationAdministration.MedicationAdministrationDosageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
11056      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
11057        res.setTextElement(parseString(xpp));
11058      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("site")) {
11059        res.setSite(parseCodeableConcept(xpp));
11060      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("route")) {
11061        res.setRoute(parseCodeableConcept(xpp));
11062      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("method")) {
11063        res.setMethod(parseCodeableConcept(xpp));
11064      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dose")) {
11065        res.setDose(parseSimpleQuantity(xpp));
11066      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "rate")) {
11067        res.setRate(parseType("rate", xpp));
11068      } else if (!parseBackboneContent(eventType, xpp, res))
11069        return false;
11070    return true;
11071  }
11072
11073  protected MedicationDispense parseMedicationDispense(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
11074    MedicationDispense res = new MedicationDispense();
11075    parseDomainResourceAttributes(xpp, res);
11076    next(xpp);
11077    int eventType = nextNoWhitespace(xpp);
11078    while (eventType != XmlPullParser.END_TAG) {
11079  if (!parseMedicationDispenseContent(eventType, xpp, res))
11080        unknownContent(xpp);
11081      eventType = nextNoWhitespace(xpp);
11082    }
11083    next(xpp);
11084    parseElementClose(res);
11085    return res;
11086  }
11087
11088  protected boolean parseMedicationDispenseContent(int eventType, XmlPullParser xpp, MedicationDispense res) throws XmlPullParserException, IOException, FHIRFormatError {
11089      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
11090        res.getIdentifier().add(parseIdentifier(xpp));
11091      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
11092        res.getPartOf().add(parseReference(xpp));
11093      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
11094        res.setStatusElement(parseEnumeration(xpp, MedicationDispense.MedicationDispenseStatus.NULL, new MedicationDispense.MedicationDispenseStatusEnumFactory()));
11095      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
11096        res.setCategory(parseCodeableConcept(xpp));
11097      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "medication")) {
11098        res.setMedication(parseType("medication", xpp));
11099      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
11100        res.setSubject(parseReference(xpp));
11101      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
11102        res.setContext(parseReference(xpp));
11103      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInformation")) {
11104        res.getSupportingInformation().add(parseReference(xpp));
11105      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performer")) {
11106        res.getPerformer().add(parseMedicationDispenseMedicationDispensePerformerComponent(xpp, res));
11107      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authorizingPrescription")) {
11108        res.getAuthorizingPrescription().add(parseReference(xpp));
11109      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
11110        res.setType(parseCodeableConcept(xpp));
11111      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
11112        res.setQuantity(parseSimpleQuantity(xpp));
11113      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("daysSupply")) {
11114        res.setDaysSupply(parseSimpleQuantity(xpp));
11115      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("whenPrepared")) {
11116        res.setWhenPreparedElement(parseDateTime(xpp));
11117      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("whenHandedOver")) {
11118        res.setWhenHandedOverElement(parseDateTime(xpp));
11119      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("destination")) {
11120        res.setDestination(parseReference(xpp));
11121      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("receiver")) {
11122        res.getReceiver().add(parseReference(xpp));
11123      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
11124        res.getNote().add(parseAnnotation(xpp));
11125      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dosageInstruction")) {
11126        res.getDosageInstruction().add(parseDosage(xpp));
11127      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("substitution")) {
11128        res.setSubstitution(parseMedicationDispenseMedicationDispenseSubstitutionComponent(xpp, res));
11129      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detectedIssue")) {
11130        res.getDetectedIssue().add(parseReference(xpp));
11131      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("notDone")) {
11132        res.setNotDoneElement(parseBoolean(xpp));
11133      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "notDoneReason")) {
11134        res.setNotDoneReason(parseType("notDoneReason", xpp));
11135      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("eventHistory")) {
11136        res.getEventHistory().add(parseReference(xpp));
11137      } else if (!parseDomainResourceContent(eventType, xpp, res))
11138        return false;
11139    return true;
11140  }
11141
11142  protected MedicationDispense.MedicationDispensePerformerComponent parseMedicationDispenseMedicationDispensePerformerComponent(XmlPullParser xpp, MedicationDispense owner) throws XmlPullParserException, IOException, FHIRFormatError {
11143    MedicationDispense.MedicationDispensePerformerComponent res = new MedicationDispense.MedicationDispensePerformerComponent();
11144    parseBackboneAttributes(xpp, res);
11145    next(xpp);
11146    int eventType = nextNoWhitespace(xpp);
11147    while (eventType != XmlPullParser.END_TAG) {
11148  if (!parseMedicationDispenseMedicationDispensePerformerComponentContent(eventType, xpp, owner, res))
11149        unknownContent(xpp);
11150      eventType = nextNoWhitespace(xpp);
11151    }
11152    next(xpp);
11153    parseElementClose(res);
11154    return res;
11155  }
11156
11157  protected boolean parseMedicationDispenseMedicationDispensePerformerComponentContent(int eventType, XmlPullParser xpp, MedicationDispense owner, MedicationDispense.MedicationDispensePerformerComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
11158      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
11159        res.setActor(parseReference(xpp));
11160      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onBehalfOf")) {
11161        res.setOnBehalfOf(parseReference(xpp));
11162      } else if (!parseBackboneContent(eventType, xpp, res))
11163        return false;
11164    return true;
11165  }
11166
11167  protected MedicationDispense.MedicationDispenseSubstitutionComponent parseMedicationDispenseMedicationDispenseSubstitutionComponent(XmlPullParser xpp, MedicationDispense owner) throws XmlPullParserException, IOException, FHIRFormatError {
11168    MedicationDispense.MedicationDispenseSubstitutionComponent res = new MedicationDispense.MedicationDispenseSubstitutionComponent();
11169    parseBackboneAttributes(xpp, res);
11170    next(xpp);
11171    int eventType = nextNoWhitespace(xpp);
11172    while (eventType != XmlPullParser.END_TAG) {
11173  if (!parseMedicationDispenseMedicationDispenseSubstitutionComponentContent(eventType, xpp, owner, res))
11174        unknownContent(xpp);
11175      eventType = nextNoWhitespace(xpp);
11176    }
11177    next(xpp);
11178    parseElementClose(res);
11179    return res;
11180  }
11181
11182  protected boolean parseMedicationDispenseMedicationDispenseSubstitutionComponentContent(int eventType, XmlPullParser xpp, MedicationDispense owner, MedicationDispense.MedicationDispenseSubstitutionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
11183      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("wasSubstituted")) {
11184        res.setWasSubstitutedElement(parseBoolean(xpp));
11185      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
11186        res.setType(parseCodeableConcept(xpp));
11187      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
11188        res.getReason().add(parseCodeableConcept(xpp));
11189      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("responsibleParty")) {
11190        res.getResponsibleParty().add(parseReference(xpp));
11191      } else if (!parseBackboneContent(eventType, xpp, res))
11192        return false;
11193    return true;
11194  }
11195
11196  protected MedicationRequest parseMedicationRequest(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
11197    MedicationRequest res = new MedicationRequest();
11198    parseDomainResourceAttributes(xpp, res);
11199    next(xpp);
11200    int eventType = nextNoWhitespace(xpp);
11201    while (eventType != XmlPullParser.END_TAG) {
11202  if (!parseMedicationRequestContent(eventType, xpp, res))
11203        unknownContent(xpp);
11204      eventType = nextNoWhitespace(xpp);
11205    }
11206    next(xpp);
11207    parseElementClose(res);
11208    return res;
11209  }
11210
11211  protected boolean parseMedicationRequestContent(int eventType, XmlPullParser xpp, MedicationRequest res) throws XmlPullParserException, IOException, FHIRFormatError {
11212      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
11213        res.getIdentifier().add(parseIdentifier(xpp));
11214      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
11215        res.getDefinition().add(parseReference(xpp));
11216      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
11217        res.getBasedOn().add(parseReference(xpp));
11218      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("groupIdentifier")) {
11219        res.setGroupIdentifier(parseIdentifier(xpp));
11220      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
11221        res.setStatusElement(parseEnumeration(xpp, MedicationRequest.MedicationRequestStatus.NULL, new MedicationRequest.MedicationRequestStatusEnumFactory()));
11222      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("intent")) {
11223        res.setIntentElement(parseEnumeration(xpp, MedicationRequest.MedicationRequestIntent.NULL, new MedicationRequest.MedicationRequestIntentEnumFactory()));
11224      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
11225        res.setCategory(parseCodeableConcept(xpp));
11226      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
11227        res.setPriorityElement(parseEnumeration(xpp, MedicationRequest.MedicationRequestPriority.NULL, new MedicationRequest.MedicationRequestPriorityEnumFactory()));
11228      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "medication")) {
11229        res.setMedication(parseType("medication", xpp));
11230      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
11231        res.setSubject(parseReference(xpp));
11232      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
11233        res.setContext(parseReference(xpp));
11234      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInformation")) {
11235        res.getSupportingInformation().add(parseReference(xpp));
11236      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authoredOn")) {
11237        res.setAuthoredOnElement(parseDateTime(xpp));
11238      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requester")) {
11239        res.setRequester(parseMedicationRequestMedicationRequestRequesterComponent(xpp, res));
11240      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recorder")) {
11241        res.setRecorder(parseReference(xpp));
11242      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonCode")) {
11243        res.getReasonCode().add(parseCodeableConcept(xpp));
11244      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonReference")) {
11245        res.getReasonReference().add(parseReference(xpp));
11246      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
11247        res.getNote().add(parseAnnotation(xpp));
11248      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dosageInstruction")) {
11249        res.getDosageInstruction().add(parseDosage(xpp));
11250      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dispenseRequest")) {
11251        res.setDispenseRequest(parseMedicationRequestMedicationRequestDispenseRequestComponent(xpp, res));
11252      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("substitution")) {
11253        res.setSubstitution(parseMedicationRequestMedicationRequestSubstitutionComponent(xpp, res));
11254      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priorPrescription")) {
11255        res.setPriorPrescription(parseReference(xpp));
11256      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detectedIssue")) {
11257        res.getDetectedIssue().add(parseReference(xpp));
11258      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("eventHistory")) {
11259        res.getEventHistory().add(parseReference(xpp));
11260      } else if (!parseDomainResourceContent(eventType, xpp, res))
11261        return false;
11262    return true;
11263  }
11264
11265  protected MedicationRequest.MedicationRequestRequesterComponent parseMedicationRequestMedicationRequestRequesterComponent(XmlPullParser xpp, MedicationRequest owner) throws XmlPullParserException, IOException, FHIRFormatError {
11266    MedicationRequest.MedicationRequestRequesterComponent res = new MedicationRequest.MedicationRequestRequesterComponent();
11267    parseBackboneAttributes(xpp, res);
11268    next(xpp);
11269    int eventType = nextNoWhitespace(xpp);
11270    while (eventType != XmlPullParser.END_TAG) {
11271  if (!parseMedicationRequestMedicationRequestRequesterComponentContent(eventType, xpp, owner, res))
11272        unknownContent(xpp);
11273      eventType = nextNoWhitespace(xpp);
11274    }
11275    next(xpp);
11276    parseElementClose(res);
11277    return res;
11278  }
11279
11280  protected boolean parseMedicationRequestMedicationRequestRequesterComponentContent(int eventType, XmlPullParser xpp, MedicationRequest owner, MedicationRequest.MedicationRequestRequesterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
11281      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("agent")) {
11282        res.setAgent(parseReference(xpp));
11283      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onBehalfOf")) {
11284        res.setOnBehalfOf(parseReference(xpp));
11285      } else if (!parseBackboneContent(eventType, xpp, res))
11286        return false;
11287    return true;
11288  }
11289
11290  protected MedicationRequest.MedicationRequestDispenseRequestComponent parseMedicationRequestMedicationRequestDispenseRequestComponent(XmlPullParser xpp, MedicationRequest owner) throws XmlPullParserException, IOException, FHIRFormatError {
11291    MedicationRequest.MedicationRequestDispenseRequestComponent res = new MedicationRequest.MedicationRequestDispenseRequestComponent();
11292    parseBackboneAttributes(xpp, res);
11293    next(xpp);
11294    int eventType = nextNoWhitespace(xpp);
11295    while (eventType != XmlPullParser.END_TAG) {
11296  if (!parseMedicationRequestMedicationRequestDispenseRequestComponentContent(eventType, xpp, owner, res))
11297        unknownContent(xpp);
11298      eventType = nextNoWhitespace(xpp);
11299    }
11300    next(xpp);
11301    parseElementClose(res);
11302    return res;
11303  }
11304
11305  protected boolean parseMedicationRequestMedicationRequestDispenseRequestComponentContent(int eventType, XmlPullParser xpp, MedicationRequest owner, MedicationRequest.MedicationRequestDispenseRequestComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
11306      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("validityPeriod")) {
11307        res.setValidityPeriod(parsePeriod(xpp));
11308      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("numberOfRepeatsAllowed")) {
11309        res.setNumberOfRepeatsAllowedElement(parsePositiveInt(xpp));
11310      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
11311        res.setQuantity(parseSimpleQuantity(xpp));
11312      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expectedSupplyDuration")) {
11313        res.setExpectedSupplyDuration(parseDuration(xpp));
11314      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performer")) {
11315        res.setPerformer(parseReference(xpp));
11316      } else if (!parseBackboneContent(eventType, xpp, res))
11317        return false;
11318    return true;
11319  }
11320
11321  protected MedicationRequest.MedicationRequestSubstitutionComponent parseMedicationRequestMedicationRequestSubstitutionComponent(XmlPullParser xpp, MedicationRequest owner) throws XmlPullParserException, IOException, FHIRFormatError {
11322    MedicationRequest.MedicationRequestSubstitutionComponent res = new MedicationRequest.MedicationRequestSubstitutionComponent();
11323    parseBackboneAttributes(xpp, res);
11324    next(xpp);
11325    int eventType = nextNoWhitespace(xpp);
11326    while (eventType != XmlPullParser.END_TAG) {
11327  if (!parseMedicationRequestMedicationRequestSubstitutionComponentContent(eventType, xpp, owner, res))
11328        unknownContent(xpp);
11329      eventType = nextNoWhitespace(xpp);
11330    }
11331    next(xpp);
11332    parseElementClose(res);
11333    return res;
11334  }
11335
11336  protected boolean parseMedicationRequestMedicationRequestSubstitutionComponentContent(int eventType, XmlPullParser xpp, MedicationRequest owner, MedicationRequest.MedicationRequestSubstitutionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
11337      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("allowed")) {
11338        res.setAllowedElement(parseBoolean(xpp));
11339      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
11340        res.setReason(parseCodeableConcept(xpp));
11341      } else if (!parseBackboneContent(eventType, xpp, res))
11342        return false;
11343    return true;
11344  }
11345
11346  protected MedicationStatement parseMedicationStatement(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
11347    MedicationStatement res = new MedicationStatement();
11348    parseDomainResourceAttributes(xpp, res);
11349    next(xpp);
11350    int eventType = nextNoWhitespace(xpp);
11351    while (eventType != XmlPullParser.END_TAG) {
11352  if (!parseMedicationStatementContent(eventType, xpp, res))
11353        unknownContent(xpp);
11354      eventType = nextNoWhitespace(xpp);
11355    }
11356    next(xpp);
11357    parseElementClose(res);
11358    return res;
11359  }
11360
11361  protected boolean parseMedicationStatementContent(int eventType, XmlPullParser xpp, MedicationStatement res) throws XmlPullParserException, IOException, FHIRFormatError {
11362      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
11363        res.getIdentifier().add(parseIdentifier(xpp));
11364      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
11365        res.getBasedOn().add(parseReference(xpp));
11366      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
11367        res.getPartOf().add(parseReference(xpp));
11368      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
11369        res.setContext(parseReference(xpp));
11370      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
11371        res.setStatusElement(parseEnumeration(xpp, MedicationStatement.MedicationStatementStatus.NULL, new MedicationStatement.MedicationStatementStatusEnumFactory()));
11372      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
11373        res.setCategory(parseCodeableConcept(xpp));
11374      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "medication")) {
11375        res.setMedication(parseType("medication", xpp));
11376      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "effective")) {
11377        res.setEffective(parseType("effective", xpp));
11378      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dateAsserted")) {
11379        res.setDateAssertedElement(parseDateTime(xpp));
11380      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("informationSource")) {
11381        res.setInformationSource(parseReference(xpp));
11382      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
11383        res.setSubject(parseReference(xpp));
11384      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("derivedFrom")) {
11385        res.getDerivedFrom().add(parseReference(xpp));
11386      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("taken")) {
11387        res.setTakenElement(parseEnumeration(xpp, MedicationStatement.MedicationStatementTaken.NULL, new MedicationStatement.MedicationStatementTakenEnumFactory()));
11388      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonNotTaken")) {
11389        res.getReasonNotTaken().add(parseCodeableConcept(xpp));
11390      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonCode")) {
11391        res.getReasonCode().add(parseCodeableConcept(xpp));
11392      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonReference")) {
11393        res.getReasonReference().add(parseReference(xpp));
11394      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
11395        res.getNote().add(parseAnnotation(xpp));
11396      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dosage")) {
11397        res.getDosage().add(parseDosage(xpp));
11398      } else if (!parseDomainResourceContent(eventType, xpp, res))
11399        return false;
11400    return true;
11401  }
11402
11403  protected MessageDefinition parseMessageDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
11404    MessageDefinition res = new MessageDefinition();
11405    parseDomainResourceAttributes(xpp, res);
11406    next(xpp);
11407    int eventType = nextNoWhitespace(xpp);
11408    while (eventType != XmlPullParser.END_TAG) {
11409  if (!parseMessageDefinitionContent(eventType, xpp, res))
11410        unknownContent(xpp);
11411      eventType = nextNoWhitespace(xpp);
11412    }
11413    next(xpp);
11414    parseElementClose(res);
11415    return res;
11416  }
11417
11418  protected boolean parseMessageDefinitionContent(int eventType, XmlPullParser xpp, MessageDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
11419      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
11420        res.setUrlElement(parseUri(xpp));
11421      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
11422        res.setIdentifier(parseIdentifier(xpp));
11423      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
11424        res.setVersionElement(parseString(xpp));
11425      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
11426        res.setNameElement(parseString(xpp));
11427      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
11428        res.setTitleElement(parseString(xpp));
11429      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
11430        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
11431      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
11432        res.setExperimentalElement(parseBoolean(xpp));
11433      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
11434        res.setDateElement(parseDateTime(xpp));
11435      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
11436        res.setPublisherElement(parseString(xpp));
11437      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
11438        res.getContact().add(parseContactDetail(xpp));
11439      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
11440        res.setDescriptionElement(parseMarkdown(xpp));
11441      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
11442        res.getUseContext().add(parseUsageContext(xpp));
11443      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
11444        res.getJurisdiction().add(parseCodeableConcept(xpp));
11445      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
11446        res.setPurposeElement(parseMarkdown(xpp));
11447      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
11448        res.setCopyrightElement(parseMarkdown(xpp));
11449      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("base")) {
11450        res.setBase(parseReference(xpp));
11451      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("parent")) {
11452        res.getParent().add(parseReference(xpp));
11453      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("replaces")) {
11454        res.getReplaces().add(parseReference(xpp));
11455      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("event")) {
11456        res.setEvent(parseCoding(xpp));
11457      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
11458        res.setCategoryElement(parseEnumeration(xpp, MessageDefinition.MessageSignificanceCategory.NULL, new MessageDefinition.MessageSignificanceCategoryEnumFactory()));
11459      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("focus")) {
11460        res.getFocus().add(parseMessageDefinitionMessageDefinitionFocusComponent(xpp, res));
11461      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("responseRequired")) {
11462        res.setResponseRequiredElement(parseBoolean(xpp));
11463      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("allowedResponse")) {
11464        res.getAllowedResponse().add(parseMessageDefinitionMessageDefinitionAllowedResponseComponent(xpp, res));
11465      } else if (!parseDomainResourceContent(eventType, xpp, res))
11466        return false;
11467    return true;
11468  }
11469
11470  protected MessageDefinition.MessageDefinitionFocusComponent parseMessageDefinitionMessageDefinitionFocusComponent(XmlPullParser xpp, MessageDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
11471    MessageDefinition.MessageDefinitionFocusComponent res = new MessageDefinition.MessageDefinitionFocusComponent();
11472    parseBackboneAttributes(xpp, res);
11473    next(xpp);
11474    int eventType = nextNoWhitespace(xpp);
11475    while (eventType != XmlPullParser.END_TAG) {
11476  if (!parseMessageDefinitionMessageDefinitionFocusComponentContent(eventType, xpp, owner, res))
11477        unknownContent(xpp);
11478      eventType = nextNoWhitespace(xpp);
11479    }
11480    next(xpp);
11481    parseElementClose(res);
11482    return res;
11483  }
11484
11485  protected boolean parseMessageDefinitionMessageDefinitionFocusComponentContent(int eventType, XmlPullParser xpp, MessageDefinition owner, MessageDefinition.MessageDefinitionFocusComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
11486      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
11487        res.setCodeElement(parseCode(xpp));
11488      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
11489        res.setProfile(parseReference(xpp));
11490      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("min")) {
11491        res.setMinElement(parseUnsignedInt(xpp));
11492      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("max")) {
11493        res.setMaxElement(parseString(xpp));
11494      } else if (!parseBackboneContent(eventType, xpp, res))
11495        return false;
11496    return true;
11497  }
11498
11499  protected MessageDefinition.MessageDefinitionAllowedResponseComponent parseMessageDefinitionMessageDefinitionAllowedResponseComponent(XmlPullParser xpp, MessageDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
11500    MessageDefinition.MessageDefinitionAllowedResponseComponent res = new MessageDefinition.MessageDefinitionAllowedResponseComponent();
11501    parseBackboneAttributes(xpp, res);
11502    next(xpp);
11503    int eventType = nextNoWhitespace(xpp);
11504    while (eventType != XmlPullParser.END_TAG) {
11505  if (!parseMessageDefinitionMessageDefinitionAllowedResponseComponentContent(eventType, xpp, owner, res))
11506        unknownContent(xpp);
11507      eventType = nextNoWhitespace(xpp);
11508    }
11509    next(xpp);
11510    parseElementClose(res);
11511    return res;
11512  }
11513
11514  protected boolean parseMessageDefinitionMessageDefinitionAllowedResponseComponentContent(int eventType, XmlPullParser xpp, MessageDefinition owner, MessageDefinition.MessageDefinitionAllowedResponseComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
11515      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("message")) {
11516        res.setMessage(parseReference(xpp));
11517      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("situation")) {
11518        res.setSituationElement(parseMarkdown(xpp));
11519      } else if (!parseBackboneContent(eventType, xpp, res))
11520        return false;
11521    return true;
11522  }
11523
11524  protected MessageHeader parseMessageHeader(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
11525    MessageHeader res = new MessageHeader();
11526    parseDomainResourceAttributes(xpp, res);
11527    next(xpp);
11528    int eventType = nextNoWhitespace(xpp);
11529    while (eventType != XmlPullParser.END_TAG) {
11530  if (!parseMessageHeaderContent(eventType, xpp, res))
11531        unknownContent(xpp);
11532      eventType = nextNoWhitespace(xpp);
11533    }
11534    next(xpp);
11535    parseElementClose(res);
11536    return res;
11537  }
11538
11539  protected boolean parseMessageHeaderContent(int eventType, XmlPullParser xpp, MessageHeader res) throws XmlPullParserException, IOException, FHIRFormatError {
11540      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("event")) {
11541        res.setEvent(parseCoding(xpp));
11542      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("destination")) {
11543        res.getDestination().add(parseMessageHeaderMessageDestinationComponent(xpp, res));
11544      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("receiver")) {
11545        res.setReceiver(parseReference(xpp));
11546      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sender")) {
11547        res.setSender(parseReference(xpp));
11548      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("timestamp")) {
11549        res.setTimestampElement(parseInstant(xpp));
11550      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("enterer")) {
11551        res.setEnterer(parseReference(xpp));
11552      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
11553        res.setAuthor(parseReference(xpp));
11554      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
11555        res.setSource(parseMessageHeaderMessageSourceComponent(xpp, res));
11556      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("responsible")) {
11557        res.setResponsible(parseReference(xpp));
11558      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
11559        res.setReason(parseCodeableConcept(xpp));
11560      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("response")) {
11561        res.setResponse(parseMessageHeaderMessageHeaderResponseComponent(xpp, res));
11562      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("focus")) {
11563        res.getFocus().add(parseReference(xpp));
11564      } else if (!parseDomainResourceContent(eventType, xpp, res))
11565        return false;
11566    return true;
11567  }
11568
11569  protected MessageHeader.MessageDestinationComponent parseMessageHeaderMessageDestinationComponent(XmlPullParser xpp, MessageHeader owner) throws XmlPullParserException, IOException, FHIRFormatError {
11570    MessageHeader.MessageDestinationComponent res = new MessageHeader.MessageDestinationComponent();
11571    parseBackboneAttributes(xpp, res);
11572    next(xpp);
11573    int eventType = nextNoWhitespace(xpp);
11574    while (eventType != XmlPullParser.END_TAG) {
11575  if (!parseMessageHeaderMessageDestinationComponentContent(eventType, xpp, owner, res))
11576        unknownContent(xpp);
11577      eventType = nextNoWhitespace(xpp);
11578    }
11579    next(xpp);
11580    parseElementClose(res);
11581    return res;
11582  }
11583
11584  protected boolean parseMessageHeaderMessageDestinationComponentContent(int eventType, XmlPullParser xpp, MessageHeader owner, MessageHeader.MessageDestinationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
11585      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
11586        res.setNameElement(parseString(xpp));
11587      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("target")) {
11588        res.setTarget(parseReference(xpp));
11589      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("endpoint")) {
11590        res.setEndpointElement(parseUri(xpp));
11591      } else if (!parseBackboneContent(eventType, xpp, res))
11592        return false;
11593    return true;
11594  }
11595
11596  protected MessageHeader.MessageSourceComponent parseMessageHeaderMessageSourceComponent(XmlPullParser xpp, MessageHeader owner) throws XmlPullParserException, IOException, FHIRFormatError {
11597    MessageHeader.MessageSourceComponent res = new MessageHeader.MessageSourceComponent();
11598    parseBackboneAttributes(xpp, res);
11599    next(xpp);
11600    int eventType = nextNoWhitespace(xpp);
11601    while (eventType != XmlPullParser.END_TAG) {
11602  if (!parseMessageHeaderMessageSourceComponentContent(eventType, xpp, owner, res))
11603        unknownContent(xpp);
11604      eventType = nextNoWhitespace(xpp);
11605    }
11606    next(xpp);
11607    parseElementClose(res);
11608    return res;
11609  }
11610
11611  protected boolean parseMessageHeaderMessageSourceComponentContent(int eventType, XmlPullParser xpp, MessageHeader owner, MessageHeader.MessageSourceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
11612      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
11613        res.setNameElement(parseString(xpp));
11614      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("software")) {
11615        res.setSoftwareElement(parseString(xpp));
11616      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
11617        res.setVersionElement(parseString(xpp));
11618      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
11619        res.setContact(parseContactPoint(xpp));
11620      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("endpoint")) {
11621        res.setEndpointElement(parseUri(xpp));
11622      } else if (!parseBackboneContent(eventType, xpp, res))
11623        return false;
11624    return true;
11625  }
11626
11627  protected MessageHeader.MessageHeaderResponseComponent parseMessageHeaderMessageHeaderResponseComponent(XmlPullParser xpp, MessageHeader owner) throws XmlPullParserException, IOException, FHIRFormatError {
11628    MessageHeader.MessageHeaderResponseComponent res = new MessageHeader.MessageHeaderResponseComponent();
11629    parseBackboneAttributes(xpp, res);
11630    next(xpp);
11631    int eventType = nextNoWhitespace(xpp);
11632    while (eventType != XmlPullParser.END_TAG) {
11633  if (!parseMessageHeaderMessageHeaderResponseComponentContent(eventType, xpp, owner, res))
11634        unknownContent(xpp);
11635      eventType = nextNoWhitespace(xpp);
11636    }
11637    next(xpp);
11638    parseElementClose(res);
11639    return res;
11640  }
11641
11642  protected boolean parseMessageHeaderMessageHeaderResponseComponentContent(int eventType, XmlPullParser xpp, MessageHeader owner, MessageHeader.MessageHeaderResponseComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
11643      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
11644        res.setIdentifierElement(parseId(xpp));
11645      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
11646        res.setCodeElement(parseEnumeration(xpp, MessageHeader.ResponseType.NULL, new MessageHeader.ResponseTypeEnumFactory()));
11647      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("details")) {
11648        res.setDetails(parseReference(xpp));
11649      } else if (!parseBackboneContent(eventType, xpp, res))
11650        return false;
11651    return true;
11652  }
11653
11654  protected NamingSystem parseNamingSystem(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
11655    NamingSystem res = new NamingSystem();
11656    parseDomainResourceAttributes(xpp, res);
11657    next(xpp);
11658    int eventType = nextNoWhitespace(xpp);
11659    while (eventType != XmlPullParser.END_TAG) {
11660  if (!parseNamingSystemContent(eventType, xpp, res))
11661        unknownContent(xpp);
11662      eventType = nextNoWhitespace(xpp);
11663    }
11664    next(xpp);
11665    parseElementClose(res);
11666    return res;
11667  }
11668
11669  protected boolean parseNamingSystemContent(int eventType, XmlPullParser xpp, NamingSystem res) throws XmlPullParserException, IOException, FHIRFormatError {
11670      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
11671        res.setNameElement(parseString(xpp));
11672      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
11673        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
11674      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("kind")) {
11675        res.setKindElement(parseEnumeration(xpp, NamingSystem.NamingSystemType.NULL, new NamingSystem.NamingSystemTypeEnumFactory()));
11676      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
11677        res.setDateElement(parseDateTime(xpp));
11678      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
11679        res.setPublisherElement(parseString(xpp));
11680      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
11681        res.getContact().add(parseContactDetail(xpp));
11682      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("responsible")) {
11683        res.setResponsibleElement(parseString(xpp));
11684      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
11685        res.setType(parseCodeableConcept(xpp));
11686      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
11687        res.setDescriptionElement(parseMarkdown(xpp));
11688      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
11689        res.getUseContext().add(parseUsageContext(xpp));
11690      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
11691        res.getJurisdiction().add(parseCodeableConcept(xpp));
11692      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("usage")) {
11693        res.setUsageElement(parseString(xpp));
11694      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("uniqueId")) {
11695        res.getUniqueId().add(parseNamingSystemNamingSystemUniqueIdComponent(xpp, res));
11696      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("replacedBy")) {
11697        res.setReplacedBy(parseReference(xpp));
11698      } else if (!parseDomainResourceContent(eventType, xpp, res))
11699        return false;
11700    return true;
11701  }
11702
11703  protected NamingSystem.NamingSystemUniqueIdComponent parseNamingSystemNamingSystemUniqueIdComponent(XmlPullParser xpp, NamingSystem owner) throws XmlPullParserException, IOException, FHIRFormatError {
11704    NamingSystem.NamingSystemUniqueIdComponent res = new NamingSystem.NamingSystemUniqueIdComponent();
11705    parseBackboneAttributes(xpp, res);
11706    next(xpp);
11707    int eventType = nextNoWhitespace(xpp);
11708    while (eventType != XmlPullParser.END_TAG) {
11709  if (!parseNamingSystemNamingSystemUniqueIdComponentContent(eventType, xpp, owner, res))
11710        unknownContent(xpp);
11711      eventType = nextNoWhitespace(xpp);
11712    }
11713    next(xpp);
11714    parseElementClose(res);
11715    return res;
11716  }
11717
11718  protected boolean parseNamingSystemNamingSystemUniqueIdComponentContent(int eventType, XmlPullParser xpp, NamingSystem owner, NamingSystem.NamingSystemUniqueIdComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
11719      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
11720        res.setTypeElement(parseEnumeration(xpp, NamingSystem.NamingSystemIdentifierType.NULL, new NamingSystem.NamingSystemIdentifierTypeEnumFactory()));
11721      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
11722        res.setValueElement(parseString(xpp));
11723      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("preferred")) {
11724        res.setPreferredElement(parseBoolean(xpp));
11725      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
11726        res.setCommentElement(parseString(xpp));
11727      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
11728        res.setPeriod(parsePeriod(xpp));
11729      } else if (!parseBackboneContent(eventType, xpp, res))
11730        return false;
11731    return true;
11732  }
11733
11734  protected NutritionOrder parseNutritionOrder(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
11735    NutritionOrder res = new NutritionOrder();
11736    parseDomainResourceAttributes(xpp, res);
11737    next(xpp);
11738    int eventType = nextNoWhitespace(xpp);
11739    while (eventType != XmlPullParser.END_TAG) {
11740  if (!parseNutritionOrderContent(eventType, xpp, res))
11741        unknownContent(xpp);
11742      eventType = nextNoWhitespace(xpp);
11743    }
11744    next(xpp);
11745    parseElementClose(res);
11746    return res;
11747  }
11748
11749  protected boolean parseNutritionOrderContent(int eventType, XmlPullParser xpp, NutritionOrder res) throws XmlPullParserException, IOException, FHIRFormatError {
11750      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
11751        res.getIdentifier().add(parseIdentifier(xpp));
11752      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
11753        res.setStatusElement(parseEnumeration(xpp, NutritionOrder.NutritionOrderStatus.NULL, new NutritionOrder.NutritionOrderStatusEnumFactory()));
11754      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
11755        res.setPatient(parseReference(xpp));
11756      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
11757        res.setEncounter(parseReference(xpp));
11758      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dateTime")) {
11759        res.setDateTimeElement(parseDateTime(xpp));
11760      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("orderer")) {
11761        res.setOrderer(parseReference(xpp));
11762      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("allergyIntolerance")) {
11763        res.getAllergyIntolerance().add(parseReference(xpp));
11764      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("foodPreferenceModifier")) {
11765        res.getFoodPreferenceModifier().add(parseCodeableConcept(xpp));
11766      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("excludeFoodModifier")) {
11767        res.getExcludeFoodModifier().add(parseCodeableConcept(xpp));
11768      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("oralDiet")) {
11769        res.setOralDiet(parseNutritionOrderNutritionOrderOralDietComponent(xpp, res));
11770      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supplement")) {
11771        res.getSupplement().add(parseNutritionOrderNutritionOrderSupplementComponent(xpp, res));
11772      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("enteralFormula")) {
11773        res.setEnteralFormula(parseNutritionOrderNutritionOrderEnteralFormulaComponent(xpp, res));
11774      } else if (!parseDomainResourceContent(eventType, xpp, res))
11775        return false;
11776    return true;
11777  }
11778
11779  protected NutritionOrder.NutritionOrderOralDietComponent parseNutritionOrderNutritionOrderOralDietComponent(XmlPullParser xpp, NutritionOrder owner) throws XmlPullParserException, IOException, FHIRFormatError {
11780    NutritionOrder.NutritionOrderOralDietComponent res = new NutritionOrder.NutritionOrderOralDietComponent();
11781    parseBackboneAttributes(xpp, res);
11782    next(xpp);
11783    int eventType = nextNoWhitespace(xpp);
11784    while (eventType != XmlPullParser.END_TAG) {
11785  if (!parseNutritionOrderNutritionOrderOralDietComponentContent(eventType, xpp, owner, res))
11786        unknownContent(xpp);
11787      eventType = nextNoWhitespace(xpp);
11788    }
11789    next(xpp);
11790    parseElementClose(res);
11791    return res;
11792  }
11793
11794  protected boolean parseNutritionOrderNutritionOrderOralDietComponentContent(int eventType, XmlPullParser xpp, NutritionOrder owner, NutritionOrder.NutritionOrderOralDietComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
11795      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
11796        res.getType().add(parseCodeableConcept(xpp));
11797      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("schedule")) {
11798        res.getSchedule().add(parseTiming(xpp));
11799      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("nutrient")) {
11800        res.getNutrient().add(parseNutritionOrderNutritionOrderOralDietNutrientComponent(xpp, owner));
11801      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("texture")) {
11802        res.getTexture().add(parseNutritionOrderNutritionOrderOralDietTextureComponent(xpp, owner));
11803      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fluidConsistencyType")) {
11804        res.getFluidConsistencyType().add(parseCodeableConcept(xpp));
11805      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instruction")) {
11806        res.setInstructionElement(parseString(xpp));
11807      } else if (!parseBackboneContent(eventType, xpp, res))
11808        return false;
11809    return true;
11810  }
11811
11812  protected NutritionOrder.NutritionOrderOralDietNutrientComponent parseNutritionOrderNutritionOrderOralDietNutrientComponent(XmlPullParser xpp, NutritionOrder owner) throws XmlPullParserException, IOException, FHIRFormatError {
11813    NutritionOrder.NutritionOrderOralDietNutrientComponent res = new NutritionOrder.NutritionOrderOralDietNutrientComponent();
11814    parseBackboneAttributes(xpp, res);
11815    next(xpp);
11816    int eventType = nextNoWhitespace(xpp);
11817    while (eventType != XmlPullParser.END_TAG) {
11818  if (!parseNutritionOrderNutritionOrderOralDietNutrientComponentContent(eventType, xpp, owner, res))
11819        unknownContent(xpp);
11820      eventType = nextNoWhitespace(xpp);
11821    }
11822    next(xpp);
11823    parseElementClose(res);
11824    return res;
11825  }
11826
11827  protected boolean parseNutritionOrderNutritionOrderOralDietNutrientComponentContent(int eventType, XmlPullParser xpp, NutritionOrder owner, NutritionOrder.NutritionOrderOralDietNutrientComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
11828      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
11829        res.setModifier(parseCodeableConcept(xpp));
11830      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("amount")) {
11831        res.setAmount(parseSimpleQuantity(xpp));
11832      } else if (!parseBackboneContent(eventType, xpp, res))
11833        return false;
11834    return true;
11835  }
11836
11837  protected NutritionOrder.NutritionOrderOralDietTextureComponent parseNutritionOrderNutritionOrderOralDietTextureComponent(XmlPullParser xpp, NutritionOrder owner) throws XmlPullParserException, IOException, FHIRFormatError {
11838    NutritionOrder.NutritionOrderOralDietTextureComponent res = new NutritionOrder.NutritionOrderOralDietTextureComponent();
11839    parseBackboneAttributes(xpp, res);
11840    next(xpp);
11841    int eventType = nextNoWhitespace(xpp);
11842    while (eventType != XmlPullParser.END_TAG) {
11843  if (!parseNutritionOrderNutritionOrderOralDietTextureComponentContent(eventType, xpp, owner, res))
11844        unknownContent(xpp);
11845      eventType = nextNoWhitespace(xpp);
11846    }
11847    next(xpp);
11848    parseElementClose(res);
11849    return res;
11850  }
11851
11852  protected boolean parseNutritionOrderNutritionOrderOralDietTextureComponentContent(int eventType, XmlPullParser xpp, NutritionOrder owner, NutritionOrder.NutritionOrderOralDietTextureComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
11853      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
11854        res.setModifier(parseCodeableConcept(xpp));
11855      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("foodType")) {
11856        res.setFoodType(parseCodeableConcept(xpp));
11857      } else if (!parseBackboneContent(eventType, xpp, res))
11858        return false;
11859    return true;
11860  }
11861
11862  protected NutritionOrder.NutritionOrderSupplementComponent parseNutritionOrderNutritionOrderSupplementComponent(XmlPullParser xpp, NutritionOrder owner) throws XmlPullParserException, IOException, FHIRFormatError {
11863    NutritionOrder.NutritionOrderSupplementComponent res = new NutritionOrder.NutritionOrderSupplementComponent();
11864    parseBackboneAttributes(xpp, res);
11865    next(xpp);
11866    int eventType = nextNoWhitespace(xpp);
11867    while (eventType != XmlPullParser.END_TAG) {
11868  if (!parseNutritionOrderNutritionOrderSupplementComponentContent(eventType, xpp, owner, res))
11869        unknownContent(xpp);
11870      eventType = nextNoWhitespace(xpp);
11871    }
11872    next(xpp);
11873    parseElementClose(res);
11874    return res;
11875  }
11876
11877  protected boolean parseNutritionOrderNutritionOrderSupplementComponentContent(int eventType, XmlPullParser xpp, NutritionOrder owner, NutritionOrder.NutritionOrderSupplementComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
11878      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
11879        res.setType(parseCodeableConcept(xpp));
11880      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productName")) {
11881        res.setProductNameElement(parseString(xpp));
11882      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("schedule")) {
11883        res.getSchedule().add(parseTiming(xpp));
11884      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
11885        res.setQuantity(parseSimpleQuantity(xpp));
11886      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instruction")) {
11887        res.setInstructionElement(parseString(xpp));
11888      } else if (!parseBackboneContent(eventType, xpp, res))
11889        return false;
11890    return true;
11891  }
11892
11893  protected NutritionOrder.NutritionOrderEnteralFormulaComponent parseNutritionOrderNutritionOrderEnteralFormulaComponent(XmlPullParser xpp, NutritionOrder owner) throws XmlPullParserException, IOException, FHIRFormatError {
11894    NutritionOrder.NutritionOrderEnteralFormulaComponent res = new NutritionOrder.NutritionOrderEnteralFormulaComponent();
11895    parseBackboneAttributes(xpp, res);
11896    next(xpp);
11897    int eventType = nextNoWhitespace(xpp);
11898    while (eventType != XmlPullParser.END_TAG) {
11899  if (!parseNutritionOrderNutritionOrderEnteralFormulaComponentContent(eventType, xpp, owner, res))
11900        unknownContent(xpp);
11901      eventType = nextNoWhitespace(xpp);
11902    }
11903    next(xpp);
11904    parseElementClose(res);
11905    return res;
11906  }
11907
11908  protected boolean parseNutritionOrderNutritionOrderEnteralFormulaComponentContent(int eventType, XmlPullParser xpp, NutritionOrder owner, NutritionOrder.NutritionOrderEnteralFormulaComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
11909      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("baseFormulaType")) {
11910        res.setBaseFormulaType(parseCodeableConcept(xpp));
11911      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("baseFormulaProductName")) {
11912        res.setBaseFormulaProductNameElement(parseString(xpp));
11913      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("additiveType")) {
11914        res.setAdditiveType(parseCodeableConcept(xpp));
11915      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("additiveProductName")) {
11916        res.setAdditiveProductNameElement(parseString(xpp));
11917      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("caloricDensity")) {
11918        res.setCaloricDensity(parseSimpleQuantity(xpp));
11919      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("routeofAdministration")) {
11920        res.setRouteofAdministration(parseCodeableConcept(xpp));
11921      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("administration")) {
11922        res.getAdministration().add(parseNutritionOrderNutritionOrderEnteralFormulaAdministrationComponent(xpp, owner));
11923      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxVolumeToDeliver")) {
11924        res.setMaxVolumeToDeliver(parseSimpleQuantity(xpp));
11925      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("administrationInstruction")) {
11926        res.setAdministrationInstructionElement(parseString(xpp));
11927      } else if (!parseBackboneContent(eventType, xpp, res))
11928        return false;
11929    return true;
11930  }
11931
11932  protected NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent parseNutritionOrderNutritionOrderEnteralFormulaAdministrationComponent(XmlPullParser xpp, NutritionOrder owner) throws XmlPullParserException, IOException, FHIRFormatError {
11933    NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent res = new NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent();
11934    parseBackboneAttributes(xpp, res);
11935    next(xpp);
11936    int eventType = nextNoWhitespace(xpp);
11937    while (eventType != XmlPullParser.END_TAG) {
11938  if (!parseNutritionOrderNutritionOrderEnteralFormulaAdministrationComponentContent(eventType, xpp, owner, res))
11939        unknownContent(xpp);
11940      eventType = nextNoWhitespace(xpp);
11941    }
11942    next(xpp);
11943    parseElementClose(res);
11944    return res;
11945  }
11946
11947  protected boolean parseNutritionOrderNutritionOrderEnteralFormulaAdministrationComponentContent(int eventType, XmlPullParser xpp, NutritionOrder owner, NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
11948      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("schedule")) {
11949        res.setSchedule(parseTiming(xpp));
11950      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
11951        res.setQuantity(parseSimpleQuantity(xpp));
11952      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "rate")) {
11953        res.setRate(parseType("rate", xpp));
11954      } else if (!parseBackboneContent(eventType, xpp, res))
11955        return false;
11956    return true;
11957  }
11958
11959  protected Observation parseObservation(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
11960    Observation res = new Observation();
11961    parseDomainResourceAttributes(xpp, res);
11962    next(xpp);
11963    int eventType = nextNoWhitespace(xpp);
11964    while (eventType != XmlPullParser.END_TAG) {
11965  if (!parseObservationContent(eventType, xpp, res))
11966        unknownContent(xpp);
11967      eventType = nextNoWhitespace(xpp);
11968    }
11969    next(xpp);
11970    parseElementClose(res);
11971    return res;
11972  }
11973
11974  protected boolean parseObservationContent(int eventType, XmlPullParser xpp, Observation res) throws XmlPullParserException, IOException, FHIRFormatError {
11975      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
11976        res.getIdentifier().add(parseIdentifier(xpp));
11977      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
11978        res.getBasedOn().add(parseReference(xpp));
11979      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
11980        res.setStatusElement(parseEnumeration(xpp, Observation.ObservationStatus.NULL, new Observation.ObservationStatusEnumFactory()));
11981      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
11982        res.getCategory().add(parseCodeableConcept(xpp));
11983      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
11984        res.setCode(parseCodeableConcept(xpp));
11985      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
11986        res.setSubject(parseReference(xpp));
11987      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
11988        res.setContext(parseReference(xpp));
11989      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "effective")) {
11990        res.setEffective(parseType("effective", xpp));
11991      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("issued")) {
11992        res.setIssuedElement(parseInstant(xpp));
11993      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performer")) {
11994        res.getPerformer().add(parseReference(xpp));
11995      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
11996        res.setValue(parseType("value", xpp));
11997      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dataAbsentReason")) {
11998        res.setDataAbsentReason(parseCodeableConcept(xpp));
11999      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("interpretation")) {
12000        res.setInterpretation(parseCodeableConcept(xpp));
12001      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
12002        res.setCommentElement(parseString(xpp));
12003      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodySite")) {
12004        res.setBodySite(parseCodeableConcept(xpp));
12005      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("method")) {
12006        res.setMethod(parseCodeableConcept(xpp));
12007      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specimen")) {
12008        res.setSpecimen(parseReference(xpp));
12009      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("device")) {
12010        res.setDevice(parseReference(xpp));
12011      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referenceRange")) {
12012        res.getReferenceRange().add(parseObservationObservationReferenceRangeComponent(xpp, res));
12013      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("related")) {
12014        res.getRelated().add(parseObservationObservationRelatedComponent(xpp, res));
12015      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("component")) {
12016        res.getComponent().add(parseObservationObservationComponentComponent(xpp, res));
12017      } else if (!parseDomainResourceContent(eventType, xpp, res))
12018        return false;
12019    return true;
12020  }
12021
12022  protected Observation.ObservationReferenceRangeComponent parseObservationObservationReferenceRangeComponent(XmlPullParser xpp, Observation owner) throws XmlPullParserException, IOException, FHIRFormatError {
12023    Observation.ObservationReferenceRangeComponent res = new Observation.ObservationReferenceRangeComponent();
12024    parseBackboneAttributes(xpp, res);
12025    next(xpp);
12026    int eventType = nextNoWhitespace(xpp);
12027    while (eventType != XmlPullParser.END_TAG) {
12028  if (!parseObservationObservationReferenceRangeComponentContent(eventType, xpp, owner, res))
12029        unknownContent(xpp);
12030      eventType = nextNoWhitespace(xpp);
12031    }
12032    next(xpp);
12033    parseElementClose(res);
12034    return res;
12035  }
12036
12037  protected boolean parseObservationObservationReferenceRangeComponentContent(int eventType, XmlPullParser xpp, Observation owner, Observation.ObservationReferenceRangeComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
12038      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("low")) {
12039        res.setLow(parseSimpleQuantity(xpp));
12040      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("high")) {
12041        res.setHigh(parseSimpleQuantity(xpp));
12042      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
12043        res.setType(parseCodeableConcept(xpp));
12044      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("appliesTo")) {
12045        res.getAppliesTo().add(parseCodeableConcept(xpp));
12046      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("age")) {
12047        res.setAge(parseRange(xpp));
12048      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
12049        res.setTextElement(parseString(xpp));
12050      } else if (!parseBackboneContent(eventType, xpp, res))
12051        return false;
12052    return true;
12053  }
12054
12055  protected Observation.ObservationRelatedComponent parseObservationObservationRelatedComponent(XmlPullParser xpp, Observation owner) throws XmlPullParserException, IOException, FHIRFormatError {
12056    Observation.ObservationRelatedComponent res = new Observation.ObservationRelatedComponent();
12057    parseBackboneAttributes(xpp, res);
12058    next(xpp);
12059    int eventType = nextNoWhitespace(xpp);
12060    while (eventType != XmlPullParser.END_TAG) {
12061  if (!parseObservationObservationRelatedComponentContent(eventType, xpp, owner, res))
12062        unknownContent(xpp);
12063      eventType = nextNoWhitespace(xpp);
12064    }
12065    next(xpp);
12066    parseElementClose(res);
12067    return res;
12068  }
12069
12070  protected boolean parseObservationObservationRelatedComponentContent(int eventType, XmlPullParser xpp, Observation owner, Observation.ObservationRelatedComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
12071      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
12072        res.setTypeElement(parseEnumeration(xpp, Observation.ObservationRelationshipType.NULL, new Observation.ObservationRelationshipTypeEnumFactory()));
12073      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("target")) {
12074        res.setTarget(parseReference(xpp));
12075      } else if (!parseBackboneContent(eventType, xpp, res))
12076        return false;
12077    return true;
12078  }
12079
12080  protected Observation.ObservationComponentComponent parseObservationObservationComponentComponent(XmlPullParser xpp, Observation owner) throws XmlPullParserException, IOException, FHIRFormatError {
12081    Observation.ObservationComponentComponent res = new Observation.ObservationComponentComponent();
12082    parseBackboneAttributes(xpp, res);
12083    next(xpp);
12084    int eventType = nextNoWhitespace(xpp);
12085    while (eventType != XmlPullParser.END_TAG) {
12086  if (!parseObservationObservationComponentComponentContent(eventType, xpp, owner, res))
12087        unknownContent(xpp);
12088      eventType = nextNoWhitespace(xpp);
12089    }
12090    next(xpp);
12091    parseElementClose(res);
12092    return res;
12093  }
12094
12095  protected boolean parseObservationObservationComponentComponentContent(int eventType, XmlPullParser xpp, Observation owner, Observation.ObservationComponentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
12096      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
12097        res.setCode(parseCodeableConcept(xpp));
12098      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
12099        res.setValue(parseType("value", xpp));
12100      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dataAbsentReason")) {
12101        res.setDataAbsentReason(parseCodeableConcept(xpp));
12102      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("interpretation")) {
12103        res.setInterpretation(parseCodeableConcept(xpp));
12104      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referenceRange")) {
12105        res.getReferenceRange().add(parseObservationObservationReferenceRangeComponent(xpp, owner));
12106      } else if (!parseBackboneContent(eventType, xpp, res))
12107        return false;
12108    return true;
12109  }
12110
12111  protected OperationDefinition parseOperationDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
12112    OperationDefinition res = new OperationDefinition();
12113    parseDomainResourceAttributes(xpp, res);
12114    next(xpp);
12115    int eventType = nextNoWhitespace(xpp);
12116    while (eventType != XmlPullParser.END_TAG) {
12117  if (!parseOperationDefinitionContent(eventType, xpp, res))
12118        unknownContent(xpp);
12119      eventType = nextNoWhitespace(xpp);
12120    }
12121    next(xpp);
12122    parseElementClose(res);
12123    return res;
12124  }
12125
12126  protected boolean parseOperationDefinitionContent(int eventType, XmlPullParser xpp, OperationDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
12127      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
12128        res.setUrlElement(parseUri(xpp));
12129      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
12130        res.setVersionElement(parseString(xpp));
12131      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
12132        res.setNameElement(parseString(xpp));
12133      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
12134        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
12135      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("kind")) {
12136        res.setKindElement(parseEnumeration(xpp, OperationDefinition.OperationKind.NULL, new OperationDefinition.OperationKindEnumFactory()));
12137      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
12138        res.setExperimentalElement(parseBoolean(xpp));
12139      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
12140        res.setDateElement(parseDateTime(xpp));
12141      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
12142        res.setPublisherElement(parseString(xpp));
12143      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
12144        res.getContact().add(parseContactDetail(xpp));
12145      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
12146        res.setDescriptionElement(parseMarkdown(xpp));
12147      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
12148        res.getUseContext().add(parseUsageContext(xpp));
12149      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
12150        res.getJurisdiction().add(parseCodeableConcept(xpp));
12151      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
12152        res.setPurposeElement(parseMarkdown(xpp));
12153      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("idempotent")) {
12154        res.setIdempotentElement(parseBoolean(xpp));
12155      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
12156        res.setCodeElement(parseCode(xpp));
12157      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
12158        res.setCommentElement(parseString(xpp));
12159      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("base")) {
12160        res.setBase(parseReference(xpp));
12161      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
12162        res.getResource().add(parseCode(xpp));
12163      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
12164        res.setSystemElement(parseBoolean(xpp));
12165      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
12166        res.setTypeElement(parseBoolean(xpp));
12167      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instance")) {
12168        res.setInstanceElement(parseBoolean(xpp));
12169      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("parameter")) {
12170        res.getParameter().add(parseOperationDefinitionOperationDefinitionParameterComponent(xpp, res));
12171      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("overload")) {
12172        res.getOverload().add(parseOperationDefinitionOperationDefinitionOverloadComponent(xpp, res));
12173      } else if (!parseDomainResourceContent(eventType, xpp, res))
12174        return false;
12175    return true;
12176  }
12177
12178  protected OperationDefinition.OperationDefinitionParameterComponent parseOperationDefinitionOperationDefinitionParameterComponent(XmlPullParser xpp, OperationDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
12179    OperationDefinition.OperationDefinitionParameterComponent res = new OperationDefinition.OperationDefinitionParameterComponent();
12180    parseBackboneAttributes(xpp, res);
12181    next(xpp);
12182    int eventType = nextNoWhitespace(xpp);
12183    while (eventType != XmlPullParser.END_TAG) {
12184  if (!parseOperationDefinitionOperationDefinitionParameterComponentContent(eventType, xpp, owner, res))
12185        unknownContent(xpp);
12186      eventType = nextNoWhitespace(xpp);
12187    }
12188    next(xpp);
12189    parseElementClose(res);
12190    return res;
12191  }
12192
12193  protected boolean parseOperationDefinitionOperationDefinitionParameterComponentContent(int eventType, XmlPullParser xpp, OperationDefinition owner, OperationDefinition.OperationDefinitionParameterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
12194      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
12195        res.setNameElement(parseCode(xpp));
12196      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
12197        res.setUseElement(parseEnumeration(xpp, OperationDefinition.OperationParameterUse.NULL, new OperationDefinition.OperationParameterUseEnumFactory()));
12198      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("min")) {
12199        res.setMinElement(parseInteger(xpp));
12200      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("max")) {
12201        res.setMaxElement(parseString(xpp));
12202      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
12203        res.setDocumentationElement(parseString(xpp));
12204      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
12205        res.setTypeElement(parseCode(xpp));
12206      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchType")) {
12207        res.setSearchTypeElement(parseEnumeration(xpp, Enumerations.SearchParamType.NULL, new Enumerations.SearchParamTypeEnumFactory()));
12208      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
12209        res.setProfile(parseReference(xpp));
12210      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("binding")) {
12211        res.setBinding(parseOperationDefinitionOperationDefinitionParameterBindingComponent(xpp, owner));
12212      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("part")) {
12213        res.getPart().add(parseOperationDefinitionOperationDefinitionParameterComponent(xpp, owner));
12214      } else if (!parseBackboneContent(eventType, xpp, res))
12215        return false;
12216    return true;
12217  }
12218
12219  protected OperationDefinition.OperationDefinitionParameterBindingComponent parseOperationDefinitionOperationDefinitionParameterBindingComponent(XmlPullParser xpp, OperationDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
12220    OperationDefinition.OperationDefinitionParameterBindingComponent res = new OperationDefinition.OperationDefinitionParameterBindingComponent();
12221    parseBackboneAttributes(xpp, res);
12222    next(xpp);
12223    int eventType = nextNoWhitespace(xpp);
12224    while (eventType != XmlPullParser.END_TAG) {
12225  if (!parseOperationDefinitionOperationDefinitionParameterBindingComponentContent(eventType, xpp, owner, res))
12226        unknownContent(xpp);
12227      eventType = nextNoWhitespace(xpp);
12228    }
12229    next(xpp);
12230    parseElementClose(res);
12231    return res;
12232  }
12233
12234  protected boolean parseOperationDefinitionOperationDefinitionParameterBindingComponentContent(int eventType, XmlPullParser xpp, OperationDefinition owner, OperationDefinition.OperationDefinitionParameterBindingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
12235      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("strength")) {
12236        res.setStrengthElement(parseEnumeration(xpp, Enumerations.BindingStrength.NULL, new Enumerations.BindingStrengthEnumFactory()));
12237      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "valueSet")) {
12238        res.setValueSet(parseType("valueSet", xpp));
12239      } else if (!parseBackboneContent(eventType, xpp, res))
12240        return false;
12241    return true;
12242  }
12243
12244  protected OperationDefinition.OperationDefinitionOverloadComponent parseOperationDefinitionOperationDefinitionOverloadComponent(XmlPullParser xpp, OperationDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
12245    OperationDefinition.OperationDefinitionOverloadComponent res = new OperationDefinition.OperationDefinitionOverloadComponent();
12246    parseBackboneAttributes(xpp, res);
12247    next(xpp);
12248    int eventType = nextNoWhitespace(xpp);
12249    while (eventType != XmlPullParser.END_TAG) {
12250  if (!parseOperationDefinitionOperationDefinitionOverloadComponentContent(eventType, xpp, owner, res))
12251        unknownContent(xpp);
12252      eventType = nextNoWhitespace(xpp);
12253    }
12254    next(xpp);
12255    parseElementClose(res);
12256    return res;
12257  }
12258
12259  protected boolean parseOperationDefinitionOperationDefinitionOverloadComponentContent(int eventType, XmlPullParser xpp, OperationDefinition owner, OperationDefinition.OperationDefinitionOverloadComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
12260      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("parameterName")) {
12261        res.getParameterName().add(parseString(xpp));
12262      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
12263        res.setCommentElement(parseString(xpp));
12264      } else if (!parseBackboneContent(eventType, xpp, res))
12265        return false;
12266    return true;
12267  }
12268
12269  protected OperationOutcome parseOperationOutcome(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
12270    OperationOutcome res = new OperationOutcome();
12271    parseDomainResourceAttributes(xpp, res);
12272    next(xpp);
12273    int eventType = nextNoWhitespace(xpp);
12274    while (eventType != XmlPullParser.END_TAG) {
12275  if (!parseOperationOutcomeContent(eventType, xpp, res))
12276        unknownContent(xpp);
12277      eventType = nextNoWhitespace(xpp);
12278    }
12279    next(xpp);
12280    parseElementClose(res);
12281    return res;
12282  }
12283
12284  protected boolean parseOperationOutcomeContent(int eventType, XmlPullParser xpp, OperationOutcome res) throws XmlPullParserException, IOException, FHIRFormatError {
12285      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("issue")) {
12286        res.getIssue().add(parseOperationOutcomeOperationOutcomeIssueComponent(xpp, res));
12287      } else if (!parseDomainResourceContent(eventType, xpp, res))
12288        return false;
12289    return true;
12290  }
12291
12292  protected OperationOutcome.OperationOutcomeIssueComponent parseOperationOutcomeOperationOutcomeIssueComponent(XmlPullParser xpp, OperationOutcome owner) throws XmlPullParserException, IOException, FHIRFormatError {
12293    OperationOutcome.OperationOutcomeIssueComponent res = new OperationOutcome.OperationOutcomeIssueComponent();
12294    parseBackboneAttributes(xpp, res);
12295    next(xpp);
12296    int eventType = nextNoWhitespace(xpp);
12297    while (eventType != XmlPullParser.END_TAG) {
12298  if (!parseOperationOutcomeOperationOutcomeIssueComponentContent(eventType, xpp, owner, res))
12299        unknownContent(xpp);
12300      eventType = nextNoWhitespace(xpp);
12301    }
12302    next(xpp);
12303    parseElementClose(res);
12304    return res;
12305  }
12306
12307  protected boolean parseOperationOutcomeOperationOutcomeIssueComponentContent(int eventType, XmlPullParser xpp, OperationOutcome owner, OperationOutcome.OperationOutcomeIssueComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
12308      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("severity")) {
12309        res.setSeverityElement(parseEnumeration(xpp, OperationOutcome.IssueSeverity.NULL, new OperationOutcome.IssueSeverityEnumFactory()));
12310      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
12311        res.setCodeElement(parseEnumeration(xpp, OperationOutcome.IssueType.NULL, new OperationOutcome.IssueTypeEnumFactory()));
12312      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("details")) {
12313        res.setDetails(parseCodeableConcept(xpp));
12314      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diagnostics")) {
12315        res.setDiagnosticsElement(parseString(xpp));
12316      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
12317        res.getLocation().add(parseString(xpp));
12318      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expression")) {
12319        res.getExpression().add(parseString(xpp));
12320      } else if (!parseBackboneContent(eventType, xpp, res))
12321        return false;
12322    return true;
12323  }
12324
12325  protected Organization parseOrganization(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
12326    Organization res = new Organization();
12327    parseDomainResourceAttributes(xpp, res);
12328    next(xpp);
12329    int eventType = nextNoWhitespace(xpp);
12330    while (eventType != XmlPullParser.END_TAG) {
12331  if (!parseOrganizationContent(eventType, xpp, res))
12332        unknownContent(xpp);
12333      eventType = nextNoWhitespace(xpp);
12334    }
12335    next(xpp);
12336    parseElementClose(res);
12337    return res;
12338  }
12339
12340  protected boolean parseOrganizationContent(int eventType, XmlPullParser xpp, Organization res) throws XmlPullParserException, IOException, FHIRFormatError {
12341      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
12342        res.getIdentifier().add(parseIdentifier(xpp));
12343      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("active")) {
12344        res.setActiveElement(parseBoolean(xpp));
12345      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
12346        res.getType().add(parseCodeableConcept(xpp));
12347      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
12348        res.setNameElement(parseString(xpp));
12349      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("alias")) {
12350        res.getAlias().add(parseString(xpp));
12351      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("telecom")) {
12352        res.getTelecom().add(parseContactPoint(xpp));
12353      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("address")) {
12354        res.getAddress().add(parseAddress(xpp));
12355      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
12356        res.setPartOf(parseReference(xpp));
12357      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
12358        res.getContact().add(parseOrganizationOrganizationContactComponent(xpp, res));
12359      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("endpoint")) {
12360        res.getEndpoint().add(parseReference(xpp));
12361      } else if (!parseDomainResourceContent(eventType, xpp, res))
12362        return false;
12363    return true;
12364  }
12365
12366  protected Organization.OrganizationContactComponent parseOrganizationOrganizationContactComponent(XmlPullParser xpp, Organization owner) throws XmlPullParserException, IOException, FHIRFormatError {
12367    Organization.OrganizationContactComponent res = new Organization.OrganizationContactComponent();
12368    parseBackboneAttributes(xpp, res);
12369    next(xpp);
12370    int eventType = nextNoWhitespace(xpp);
12371    while (eventType != XmlPullParser.END_TAG) {
12372  if (!parseOrganizationOrganizationContactComponentContent(eventType, xpp, owner, res))
12373        unknownContent(xpp);
12374      eventType = nextNoWhitespace(xpp);
12375    }
12376    next(xpp);
12377    parseElementClose(res);
12378    return res;
12379  }
12380
12381  protected boolean parseOrganizationOrganizationContactComponentContent(int eventType, XmlPullParser xpp, Organization owner, Organization.OrganizationContactComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
12382      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
12383        res.setPurpose(parseCodeableConcept(xpp));
12384      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
12385        res.setName(parseHumanName(xpp));
12386      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("telecom")) {
12387        res.getTelecom().add(parseContactPoint(xpp));
12388      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("address")) {
12389        res.setAddress(parseAddress(xpp));
12390      } else if (!parseBackboneContent(eventType, xpp, res))
12391        return false;
12392    return true;
12393  }
12394
12395  protected Patient parsePatient(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
12396    Patient res = new Patient();
12397    parseDomainResourceAttributes(xpp, res);
12398    next(xpp);
12399    int eventType = nextNoWhitespace(xpp);
12400    while (eventType != XmlPullParser.END_TAG) {
12401  if (!parsePatientContent(eventType, xpp, res))
12402        unknownContent(xpp);
12403      eventType = nextNoWhitespace(xpp);
12404    }
12405    next(xpp);
12406    parseElementClose(res);
12407    return res;
12408  }
12409
12410  protected boolean parsePatientContent(int eventType, XmlPullParser xpp, Patient res) throws XmlPullParserException, IOException, FHIRFormatError {
12411      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
12412        res.getIdentifier().add(parseIdentifier(xpp));
12413      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("active")) {
12414        res.setActiveElement(parseBoolean(xpp));
12415      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
12416        res.getName().add(parseHumanName(xpp));
12417      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("telecom")) {
12418        res.getTelecom().add(parseContactPoint(xpp));
12419      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("gender")) {
12420        res.setGenderElement(parseEnumeration(xpp, Enumerations.AdministrativeGender.NULL, new Enumerations.AdministrativeGenderEnumFactory()));
12421      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("birthDate")) {
12422        res.setBirthDateElement(parseDate(xpp));
12423      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "deceased")) {
12424        res.setDeceased(parseType("deceased", xpp));
12425      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("address")) {
12426        res.getAddress().add(parseAddress(xpp));
12427      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maritalStatus")) {
12428        res.setMaritalStatus(parseCodeableConcept(xpp));
12429      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "multipleBirth")) {
12430        res.setMultipleBirth(parseType("multipleBirth", xpp));
12431      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("photo")) {
12432        res.getPhoto().add(parseAttachment(xpp));
12433      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
12434        res.getContact().add(parsePatientContactComponent(xpp, res));
12435      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("animal")) {
12436        res.setAnimal(parsePatientAnimalComponent(xpp, res));
12437      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("communication")) {
12438        res.getCommunication().add(parsePatientPatientCommunicationComponent(xpp, res));
12439      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("generalPractitioner")) {
12440        res.getGeneralPractitioner().add(parseReference(xpp));
12441      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("managingOrganization")) {
12442        res.setManagingOrganization(parseReference(xpp));
12443      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("link")) {
12444        res.getLink().add(parsePatientPatientLinkComponent(xpp, res));
12445      } else if (!parseDomainResourceContent(eventType, xpp, res))
12446        return false;
12447    return true;
12448  }
12449
12450  protected Patient.ContactComponent parsePatientContactComponent(XmlPullParser xpp, Patient owner) throws XmlPullParserException, IOException, FHIRFormatError {
12451    Patient.ContactComponent res = new Patient.ContactComponent();
12452    parseBackboneAttributes(xpp, res);
12453    next(xpp);
12454    int eventType = nextNoWhitespace(xpp);
12455    while (eventType != XmlPullParser.END_TAG) {
12456  if (!parsePatientContactComponentContent(eventType, xpp, owner, res))
12457        unknownContent(xpp);
12458      eventType = nextNoWhitespace(xpp);
12459    }
12460    next(xpp);
12461    parseElementClose(res);
12462    return res;
12463  }
12464
12465  protected boolean parsePatientContactComponentContent(int eventType, XmlPullParser xpp, Patient owner, Patient.ContactComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
12466      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relationship")) {
12467        res.getRelationship().add(parseCodeableConcept(xpp));
12468      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
12469        res.setName(parseHumanName(xpp));
12470      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("telecom")) {
12471        res.getTelecom().add(parseContactPoint(xpp));
12472      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("address")) {
12473        res.setAddress(parseAddress(xpp));
12474      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("gender")) {
12475        res.setGenderElement(parseEnumeration(xpp, Enumerations.AdministrativeGender.NULL, new Enumerations.AdministrativeGenderEnumFactory()));
12476      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("organization")) {
12477        res.setOrganization(parseReference(xpp));
12478      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
12479        res.setPeriod(parsePeriod(xpp));
12480      } else if (!parseBackboneContent(eventType, xpp, res))
12481        return false;
12482    return true;
12483  }
12484
12485  protected Patient.AnimalComponent parsePatientAnimalComponent(XmlPullParser xpp, Patient owner) throws XmlPullParserException, IOException, FHIRFormatError {
12486    Patient.AnimalComponent res = new Patient.AnimalComponent();
12487    parseBackboneAttributes(xpp, res);
12488    next(xpp);
12489    int eventType = nextNoWhitespace(xpp);
12490    while (eventType != XmlPullParser.END_TAG) {
12491  if (!parsePatientAnimalComponentContent(eventType, xpp, owner, res))
12492        unknownContent(xpp);
12493      eventType = nextNoWhitespace(xpp);
12494    }
12495    next(xpp);
12496    parseElementClose(res);
12497    return res;
12498  }
12499
12500  protected boolean parsePatientAnimalComponentContent(int eventType, XmlPullParser xpp, Patient owner, Patient.AnimalComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
12501      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("species")) {
12502        res.setSpecies(parseCodeableConcept(xpp));
12503      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("breed")) {
12504        res.setBreed(parseCodeableConcept(xpp));
12505      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("genderStatus")) {
12506        res.setGenderStatus(parseCodeableConcept(xpp));
12507      } else if (!parseBackboneContent(eventType, xpp, res))
12508        return false;
12509    return true;
12510  }
12511
12512  protected Patient.PatientCommunicationComponent parsePatientPatientCommunicationComponent(XmlPullParser xpp, Patient owner) throws XmlPullParserException, IOException, FHIRFormatError {
12513    Patient.PatientCommunicationComponent res = new Patient.PatientCommunicationComponent();
12514    parseBackboneAttributes(xpp, res);
12515    next(xpp);
12516    int eventType = nextNoWhitespace(xpp);
12517    while (eventType != XmlPullParser.END_TAG) {
12518  if (!parsePatientPatientCommunicationComponentContent(eventType, xpp, owner, res))
12519        unknownContent(xpp);
12520      eventType = nextNoWhitespace(xpp);
12521    }
12522    next(xpp);
12523    parseElementClose(res);
12524    return res;
12525  }
12526
12527  protected boolean parsePatientPatientCommunicationComponentContent(int eventType, XmlPullParser xpp, Patient owner, Patient.PatientCommunicationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
12528      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
12529        res.setLanguage(parseCodeableConcept(xpp));
12530      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("preferred")) {
12531        res.setPreferredElement(parseBoolean(xpp));
12532      } else if (!parseBackboneContent(eventType, xpp, res))
12533        return false;
12534    return true;
12535  }
12536
12537  protected Patient.PatientLinkComponent parsePatientPatientLinkComponent(XmlPullParser xpp, Patient owner) throws XmlPullParserException, IOException, FHIRFormatError {
12538    Patient.PatientLinkComponent res = new Patient.PatientLinkComponent();
12539    parseBackboneAttributes(xpp, res);
12540    next(xpp);
12541    int eventType = nextNoWhitespace(xpp);
12542    while (eventType != XmlPullParser.END_TAG) {
12543  if (!parsePatientPatientLinkComponentContent(eventType, xpp, owner, res))
12544        unknownContent(xpp);
12545      eventType = nextNoWhitespace(xpp);
12546    }
12547    next(xpp);
12548    parseElementClose(res);
12549    return res;
12550  }
12551
12552  protected boolean parsePatientPatientLinkComponentContent(int eventType, XmlPullParser xpp, Patient owner, Patient.PatientLinkComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
12553      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("other")) {
12554        res.setOther(parseReference(xpp));
12555      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
12556        res.setTypeElement(parseEnumeration(xpp, Patient.LinkType.NULL, new Patient.LinkTypeEnumFactory()));
12557      } else if (!parseBackboneContent(eventType, xpp, res))
12558        return false;
12559    return true;
12560  }
12561
12562  protected PaymentNotice parsePaymentNotice(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
12563    PaymentNotice res = new PaymentNotice();
12564    parseDomainResourceAttributes(xpp, res);
12565    next(xpp);
12566    int eventType = nextNoWhitespace(xpp);
12567    while (eventType != XmlPullParser.END_TAG) {
12568  if (!parsePaymentNoticeContent(eventType, xpp, res))
12569        unknownContent(xpp);
12570      eventType = nextNoWhitespace(xpp);
12571    }
12572    next(xpp);
12573    parseElementClose(res);
12574    return res;
12575  }
12576
12577  protected boolean parsePaymentNoticeContent(int eventType, XmlPullParser xpp, PaymentNotice res) throws XmlPullParserException, IOException, FHIRFormatError {
12578      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
12579        res.getIdentifier().add(parseIdentifier(xpp));
12580      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
12581        res.setStatusElement(parseEnumeration(xpp, PaymentNotice.PaymentNoticeStatus.NULL, new PaymentNotice.PaymentNoticeStatusEnumFactory()));
12582      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
12583        res.setRequest(parseReference(xpp));
12584      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("response")) {
12585        res.setResponse(parseReference(xpp));
12586      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("statusDate")) {
12587        res.setStatusDateElement(parseDate(xpp));
12588      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
12589        res.setCreatedElement(parseDateTime(xpp));
12590      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("target")) {
12591        res.setTarget(parseReference(xpp));
12592      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("provider")) {
12593        res.setProvider(parseReference(xpp));
12594      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("organization")) {
12595        res.setOrganization(parseReference(xpp));
12596      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("paymentStatus")) {
12597        res.setPaymentStatus(parseCodeableConcept(xpp));
12598      } else if (!parseDomainResourceContent(eventType, xpp, res))
12599        return false;
12600    return true;
12601  }
12602
12603  protected PaymentReconciliation parsePaymentReconciliation(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
12604    PaymentReconciliation res = new PaymentReconciliation();
12605    parseDomainResourceAttributes(xpp, res);
12606    next(xpp);
12607    int eventType = nextNoWhitespace(xpp);
12608    while (eventType != XmlPullParser.END_TAG) {
12609  if (!parsePaymentReconciliationContent(eventType, xpp, res))
12610        unknownContent(xpp);
12611      eventType = nextNoWhitespace(xpp);
12612    }
12613    next(xpp);
12614    parseElementClose(res);
12615    return res;
12616  }
12617
12618  protected boolean parsePaymentReconciliationContent(int eventType, XmlPullParser xpp, PaymentReconciliation res) throws XmlPullParserException, IOException, FHIRFormatError {
12619      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
12620        res.getIdentifier().add(parseIdentifier(xpp));
12621      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
12622        res.setStatusElement(parseEnumeration(xpp, PaymentReconciliation.PaymentReconciliationStatus.NULL, new PaymentReconciliation.PaymentReconciliationStatusEnumFactory()));
12623      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
12624        res.setPeriod(parsePeriod(xpp));
12625      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
12626        res.setCreatedElement(parseDateTime(xpp));
12627      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("organization")) {
12628        res.setOrganization(parseReference(xpp));
12629      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
12630        res.setRequest(parseReference(xpp));
12631      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
12632        res.setOutcome(parseCodeableConcept(xpp));
12633      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("disposition")) {
12634        res.setDispositionElement(parseString(xpp));
12635      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestProvider")) {
12636        res.setRequestProvider(parseReference(xpp));
12637      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestOrganization")) {
12638        res.setRequestOrganization(parseReference(xpp));
12639      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
12640        res.getDetail().add(parsePaymentReconciliationDetailsComponent(xpp, res));
12641      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("form")) {
12642        res.setForm(parseCodeableConcept(xpp));
12643      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("total")) {
12644        res.setTotal(parseMoney(xpp));
12645      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("processNote")) {
12646        res.getProcessNote().add(parsePaymentReconciliationNotesComponent(xpp, res));
12647      } else if (!parseDomainResourceContent(eventType, xpp, res))
12648        return false;
12649    return true;
12650  }
12651
12652  protected PaymentReconciliation.DetailsComponent parsePaymentReconciliationDetailsComponent(XmlPullParser xpp, PaymentReconciliation owner) throws XmlPullParserException, IOException, FHIRFormatError {
12653    PaymentReconciliation.DetailsComponent res = new PaymentReconciliation.DetailsComponent();
12654    parseBackboneAttributes(xpp, res);
12655    next(xpp);
12656    int eventType = nextNoWhitespace(xpp);
12657    while (eventType != XmlPullParser.END_TAG) {
12658  if (!parsePaymentReconciliationDetailsComponentContent(eventType, xpp, owner, res))
12659        unknownContent(xpp);
12660      eventType = nextNoWhitespace(xpp);
12661    }
12662    next(xpp);
12663    parseElementClose(res);
12664    return res;
12665  }
12666
12667  protected boolean parsePaymentReconciliationDetailsComponentContent(int eventType, XmlPullParser xpp, PaymentReconciliation owner, PaymentReconciliation.DetailsComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
12668      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
12669        res.setType(parseCodeableConcept(xpp));
12670      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
12671        res.setRequest(parseReference(xpp));
12672      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("response")) {
12673        res.setResponse(parseReference(xpp));
12674      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("submitter")) {
12675        res.setSubmitter(parseReference(xpp));
12676      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payee")) {
12677        res.setPayee(parseReference(xpp));
12678      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
12679        res.setDateElement(parseDate(xpp));
12680      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("amount")) {
12681        res.setAmount(parseMoney(xpp));
12682      } else if (!parseBackboneContent(eventType, xpp, res))
12683        return false;
12684    return true;
12685  }
12686
12687  protected PaymentReconciliation.NotesComponent parsePaymentReconciliationNotesComponent(XmlPullParser xpp, PaymentReconciliation owner) throws XmlPullParserException, IOException, FHIRFormatError {
12688    PaymentReconciliation.NotesComponent res = new PaymentReconciliation.NotesComponent();
12689    parseBackboneAttributes(xpp, res);
12690    next(xpp);
12691    int eventType = nextNoWhitespace(xpp);
12692    while (eventType != XmlPullParser.END_TAG) {
12693  if (!parsePaymentReconciliationNotesComponentContent(eventType, xpp, owner, res))
12694        unknownContent(xpp);
12695      eventType = nextNoWhitespace(xpp);
12696    }
12697    next(xpp);
12698    parseElementClose(res);
12699    return res;
12700  }
12701
12702  protected boolean parsePaymentReconciliationNotesComponentContent(int eventType, XmlPullParser xpp, PaymentReconciliation owner, PaymentReconciliation.NotesComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
12703      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
12704        res.setType(parseCodeableConcept(xpp));
12705      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
12706        res.setTextElement(parseString(xpp));
12707      } else if (!parseBackboneContent(eventType, xpp, res))
12708        return false;
12709    return true;
12710  }
12711
12712  protected Person parsePerson(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
12713    Person res = new Person();
12714    parseDomainResourceAttributes(xpp, res);
12715    next(xpp);
12716    int eventType = nextNoWhitespace(xpp);
12717    while (eventType != XmlPullParser.END_TAG) {
12718  if (!parsePersonContent(eventType, xpp, res))
12719        unknownContent(xpp);
12720      eventType = nextNoWhitespace(xpp);
12721    }
12722    next(xpp);
12723    parseElementClose(res);
12724    return res;
12725  }
12726
12727  protected boolean parsePersonContent(int eventType, XmlPullParser xpp, Person res) throws XmlPullParserException, IOException, FHIRFormatError {
12728      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
12729        res.getIdentifier().add(parseIdentifier(xpp));
12730      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
12731        res.getName().add(parseHumanName(xpp));
12732      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("telecom")) {
12733        res.getTelecom().add(parseContactPoint(xpp));
12734      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("gender")) {
12735        res.setGenderElement(parseEnumeration(xpp, Enumerations.AdministrativeGender.NULL, new Enumerations.AdministrativeGenderEnumFactory()));
12736      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("birthDate")) {
12737        res.setBirthDateElement(parseDate(xpp));
12738      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("address")) {
12739        res.getAddress().add(parseAddress(xpp));
12740      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("photo")) {
12741        res.setPhoto(parseAttachment(xpp));
12742      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("managingOrganization")) {
12743        res.setManagingOrganization(parseReference(xpp));
12744      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("active")) {
12745        res.setActiveElement(parseBoolean(xpp));
12746      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("link")) {
12747        res.getLink().add(parsePersonPersonLinkComponent(xpp, res));
12748      } else if (!parseDomainResourceContent(eventType, xpp, res))
12749        return false;
12750    return true;
12751  }
12752
12753  protected Person.PersonLinkComponent parsePersonPersonLinkComponent(XmlPullParser xpp, Person owner) throws XmlPullParserException, IOException, FHIRFormatError {
12754    Person.PersonLinkComponent res = new Person.PersonLinkComponent();
12755    parseBackboneAttributes(xpp, res);
12756    next(xpp);
12757    int eventType = nextNoWhitespace(xpp);
12758    while (eventType != XmlPullParser.END_TAG) {
12759  if (!parsePersonPersonLinkComponentContent(eventType, xpp, owner, res))
12760        unknownContent(xpp);
12761      eventType = nextNoWhitespace(xpp);
12762    }
12763    next(xpp);
12764    parseElementClose(res);
12765    return res;
12766  }
12767
12768  protected boolean parsePersonPersonLinkComponentContent(int eventType, XmlPullParser xpp, Person owner, Person.PersonLinkComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
12769      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("target")) {
12770        res.setTarget(parseReference(xpp));
12771      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("assurance")) {
12772        res.setAssuranceElement(parseEnumeration(xpp, Person.IdentityAssuranceLevel.NULL, new Person.IdentityAssuranceLevelEnumFactory()));
12773      } else if (!parseBackboneContent(eventType, xpp, res))
12774        return false;
12775    return true;
12776  }
12777
12778  protected PlanDefinition parsePlanDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
12779    PlanDefinition res = new PlanDefinition();
12780    parseDomainResourceAttributes(xpp, res);
12781    next(xpp);
12782    int eventType = nextNoWhitespace(xpp);
12783    while (eventType != XmlPullParser.END_TAG) {
12784  if (!parsePlanDefinitionContent(eventType, xpp, res))
12785        unknownContent(xpp);
12786      eventType = nextNoWhitespace(xpp);
12787    }
12788    next(xpp);
12789    parseElementClose(res);
12790    return res;
12791  }
12792
12793  protected boolean parsePlanDefinitionContent(int eventType, XmlPullParser xpp, PlanDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
12794      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
12795        res.setUrlElement(parseUri(xpp));
12796      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
12797        res.getIdentifier().add(parseIdentifier(xpp));
12798      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
12799        res.setVersionElement(parseString(xpp));
12800      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
12801        res.setNameElement(parseString(xpp));
12802      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
12803        res.setTitleElement(parseString(xpp));
12804      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
12805        res.setType(parseCodeableConcept(xpp));
12806      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
12807        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
12808      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
12809        res.setExperimentalElement(parseBoolean(xpp));
12810      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
12811        res.setDateElement(parseDateTime(xpp));
12812      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
12813        res.setPublisherElement(parseString(xpp));
12814      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
12815        res.setDescriptionElement(parseMarkdown(xpp));
12816      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
12817        res.setPurposeElement(parseMarkdown(xpp));
12818      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("usage")) {
12819        res.setUsageElement(parseString(xpp));
12820      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("approvalDate")) {
12821        res.setApprovalDateElement(parseDate(xpp));
12822      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastReviewDate")) {
12823        res.setLastReviewDateElement(parseDate(xpp));
12824      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("effectivePeriod")) {
12825        res.setEffectivePeriod(parsePeriod(xpp));
12826      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
12827        res.getUseContext().add(parseUsageContext(xpp));
12828      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
12829        res.getJurisdiction().add(parseCodeableConcept(xpp));
12830      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("topic")) {
12831        res.getTopic().add(parseCodeableConcept(xpp));
12832      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contributor")) {
12833        res.getContributor().add(parseContributor(xpp));
12834      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
12835        res.getContact().add(parseContactDetail(xpp));
12836      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
12837        res.setCopyrightElement(parseMarkdown(xpp));
12838      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatedArtifact")) {
12839        res.getRelatedArtifact().add(parseRelatedArtifact(xpp));
12840      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("library")) {
12841        res.getLibrary().add(parseReference(xpp));
12842      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("goal")) {
12843        res.getGoal().add(parsePlanDefinitionPlanDefinitionGoalComponent(xpp, res));
12844      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
12845        res.getAction().add(parsePlanDefinitionPlanDefinitionActionComponent(xpp, res));
12846      } else if (!parseDomainResourceContent(eventType, xpp, res))
12847        return false;
12848    return true;
12849  }
12850
12851  protected PlanDefinition.PlanDefinitionGoalComponent parsePlanDefinitionPlanDefinitionGoalComponent(XmlPullParser xpp, PlanDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
12852    PlanDefinition.PlanDefinitionGoalComponent res = new PlanDefinition.PlanDefinitionGoalComponent();
12853    parseBackboneAttributes(xpp, res);
12854    next(xpp);
12855    int eventType = nextNoWhitespace(xpp);
12856    while (eventType != XmlPullParser.END_TAG) {
12857  if (!parsePlanDefinitionPlanDefinitionGoalComponentContent(eventType, xpp, owner, res))
12858        unknownContent(xpp);
12859      eventType = nextNoWhitespace(xpp);
12860    }
12861    next(xpp);
12862    parseElementClose(res);
12863    return res;
12864  }
12865
12866  protected boolean parsePlanDefinitionPlanDefinitionGoalComponentContent(int eventType, XmlPullParser xpp, PlanDefinition owner, PlanDefinition.PlanDefinitionGoalComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
12867      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
12868        res.setCategory(parseCodeableConcept(xpp));
12869      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
12870        res.setDescription(parseCodeableConcept(xpp));
12871      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
12872        res.setPriority(parseCodeableConcept(xpp));
12873      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("start")) {
12874        res.setStart(parseCodeableConcept(xpp));
12875      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("addresses")) {
12876        res.getAddresses().add(parseCodeableConcept(xpp));
12877      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
12878        res.getDocumentation().add(parseRelatedArtifact(xpp));
12879      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("target")) {
12880        res.getTarget().add(parsePlanDefinitionPlanDefinitionGoalTargetComponent(xpp, owner));
12881      } else if (!parseBackboneContent(eventType, xpp, res))
12882        return false;
12883    return true;
12884  }
12885
12886  protected PlanDefinition.PlanDefinitionGoalTargetComponent parsePlanDefinitionPlanDefinitionGoalTargetComponent(XmlPullParser xpp, PlanDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
12887    PlanDefinition.PlanDefinitionGoalTargetComponent res = new PlanDefinition.PlanDefinitionGoalTargetComponent();
12888    parseBackboneAttributes(xpp, res);
12889    next(xpp);
12890    int eventType = nextNoWhitespace(xpp);
12891    while (eventType != XmlPullParser.END_TAG) {
12892  if (!parsePlanDefinitionPlanDefinitionGoalTargetComponentContent(eventType, xpp, owner, res))
12893        unknownContent(xpp);
12894      eventType = nextNoWhitespace(xpp);
12895    }
12896    next(xpp);
12897    parseElementClose(res);
12898    return res;
12899  }
12900
12901  protected boolean parsePlanDefinitionPlanDefinitionGoalTargetComponentContent(int eventType, XmlPullParser xpp, PlanDefinition owner, PlanDefinition.PlanDefinitionGoalTargetComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
12902      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("measure")) {
12903        res.setMeasure(parseCodeableConcept(xpp));
12904      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "detail")) {
12905        res.setDetail(parseType("detail", xpp));
12906      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("due")) {
12907        res.setDue(parseDuration(xpp));
12908      } else if (!parseBackboneContent(eventType, xpp, res))
12909        return false;
12910    return true;
12911  }
12912
12913  protected PlanDefinition.PlanDefinitionActionComponent parsePlanDefinitionPlanDefinitionActionComponent(XmlPullParser xpp, PlanDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
12914    PlanDefinition.PlanDefinitionActionComponent res = new PlanDefinition.PlanDefinitionActionComponent();
12915    parseBackboneAttributes(xpp, res);
12916    next(xpp);
12917    int eventType = nextNoWhitespace(xpp);
12918    while (eventType != XmlPullParser.END_TAG) {
12919  if (!parsePlanDefinitionPlanDefinitionActionComponentContent(eventType, xpp, owner, res))
12920        unknownContent(xpp);
12921      eventType = nextNoWhitespace(xpp);
12922    }
12923    next(xpp);
12924    parseElementClose(res);
12925    return res;
12926  }
12927
12928  protected boolean parsePlanDefinitionPlanDefinitionActionComponentContent(int eventType, XmlPullParser xpp, PlanDefinition owner, PlanDefinition.PlanDefinitionActionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
12929      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("label")) {
12930        res.setLabelElement(parseString(xpp));
12931      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
12932        res.setTitleElement(parseString(xpp));
12933      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
12934        res.setDescriptionElement(parseString(xpp));
12935      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("textEquivalent")) {
12936        res.setTextEquivalentElement(parseString(xpp));
12937      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
12938        res.getCode().add(parseCodeableConcept(xpp));
12939      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
12940        res.getReason().add(parseCodeableConcept(xpp));
12941      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
12942        res.getDocumentation().add(parseRelatedArtifact(xpp));
12943      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("goalId")) {
12944        res.getGoalId().add(parseId(xpp));
12945      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("triggerDefinition")) {
12946        res.getTriggerDefinition().add(parseTriggerDefinition(xpp));
12947      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("condition")) {
12948        res.getCondition().add(parsePlanDefinitionPlanDefinitionActionConditionComponent(xpp, owner));
12949      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("input")) {
12950        res.getInput().add(parseDataRequirement(xpp));
12951      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("output")) {
12952        res.getOutput().add(parseDataRequirement(xpp));
12953      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatedAction")) {
12954        res.getRelatedAction().add(parsePlanDefinitionPlanDefinitionActionRelatedActionComponent(xpp, owner));
12955      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "timing")) {
12956        res.setTiming(parseType("timing", xpp));
12957      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
12958        res.getParticipant().add(parsePlanDefinitionPlanDefinitionActionParticipantComponent(xpp, owner));
12959      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
12960        res.setType(parseCoding(xpp));
12961      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("groupingBehavior")) {
12962        res.setGroupingBehaviorElement(parseEnumeration(xpp, PlanDefinition.ActionGroupingBehavior.NULL, new PlanDefinition.ActionGroupingBehaviorEnumFactory()));
12963      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("selectionBehavior")) {
12964        res.setSelectionBehaviorElement(parseEnumeration(xpp, PlanDefinition.ActionSelectionBehavior.NULL, new PlanDefinition.ActionSelectionBehaviorEnumFactory()));
12965      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requiredBehavior")) {
12966        res.setRequiredBehaviorElement(parseEnumeration(xpp, PlanDefinition.ActionRequiredBehavior.NULL, new PlanDefinition.ActionRequiredBehaviorEnumFactory()));
12967      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("precheckBehavior")) {
12968        res.setPrecheckBehaviorElement(parseEnumeration(xpp, PlanDefinition.ActionPrecheckBehavior.NULL, new PlanDefinition.ActionPrecheckBehaviorEnumFactory()));
12969      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("cardinalityBehavior")) {
12970        res.setCardinalityBehaviorElement(parseEnumeration(xpp, PlanDefinition.ActionCardinalityBehavior.NULL, new PlanDefinition.ActionCardinalityBehaviorEnumFactory()));
12971      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
12972        res.setDefinition(parseReference(xpp));
12973      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("transform")) {
12974        res.setTransform(parseReference(xpp));
12975      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dynamicValue")) {
12976        res.getDynamicValue().add(parsePlanDefinitionPlanDefinitionActionDynamicValueComponent(xpp, owner));
12977      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
12978        res.getAction().add(parsePlanDefinitionPlanDefinitionActionComponent(xpp, owner));
12979      } else if (!parseBackboneContent(eventType, xpp, res))
12980        return false;
12981    return true;
12982  }
12983
12984  protected PlanDefinition.PlanDefinitionActionConditionComponent parsePlanDefinitionPlanDefinitionActionConditionComponent(XmlPullParser xpp, PlanDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
12985    PlanDefinition.PlanDefinitionActionConditionComponent res = new PlanDefinition.PlanDefinitionActionConditionComponent();
12986    parseBackboneAttributes(xpp, res);
12987    next(xpp);
12988    int eventType = nextNoWhitespace(xpp);
12989    while (eventType != XmlPullParser.END_TAG) {
12990  if (!parsePlanDefinitionPlanDefinitionActionConditionComponentContent(eventType, xpp, owner, res))
12991        unknownContent(xpp);
12992      eventType = nextNoWhitespace(xpp);
12993    }
12994    next(xpp);
12995    parseElementClose(res);
12996    return res;
12997  }
12998
12999  protected boolean parsePlanDefinitionPlanDefinitionActionConditionComponentContent(int eventType, XmlPullParser xpp, PlanDefinition owner, PlanDefinition.PlanDefinitionActionConditionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
13000      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("kind")) {
13001        res.setKindElement(parseEnumeration(xpp, PlanDefinition.ActionConditionKind.NULL, new PlanDefinition.ActionConditionKindEnumFactory()));
13002      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
13003        res.setDescriptionElement(parseString(xpp));
13004      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
13005        res.setLanguageElement(parseString(xpp));
13006      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expression")) {
13007        res.setExpressionElement(parseString(xpp));
13008      } else if (!parseBackboneContent(eventType, xpp, res))
13009        return false;
13010    return true;
13011  }
13012
13013  protected PlanDefinition.PlanDefinitionActionRelatedActionComponent parsePlanDefinitionPlanDefinitionActionRelatedActionComponent(XmlPullParser xpp, PlanDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
13014    PlanDefinition.PlanDefinitionActionRelatedActionComponent res = new PlanDefinition.PlanDefinitionActionRelatedActionComponent();
13015    parseBackboneAttributes(xpp, res);
13016    next(xpp);
13017    int eventType = nextNoWhitespace(xpp);
13018    while (eventType != XmlPullParser.END_TAG) {
13019  if (!parsePlanDefinitionPlanDefinitionActionRelatedActionComponentContent(eventType, xpp, owner, res))
13020        unknownContent(xpp);
13021      eventType = nextNoWhitespace(xpp);
13022    }
13023    next(xpp);
13024    parseElementClose(res);
13025    return res;
13026  }
13027
13028  protected boolean parsePlanDefinitionPlanDefinitionActionRelatedActionComponentContent(int eventType, XmlPullParser xpp, PlanDefinition owner, PlanDefinition.PlanDefinitionActionRelatedActionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
13029      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actionId")) {
13030        res.setActionIdElement(parseId(xpp));
13031      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relationship")) {
13032        res.setRelationshipElement(parseEnumeration(xpp, PlanDefinition.ActionRelationshipType.NULL, new PlanDefinition.ActionRelationshipTypeEnumFactory()));
13033      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "offset")) {
13034        res.setOffset(parseType("offset", xpp));
13035      } else if (!parseBackboneContent(eventType, xpp, res))
13036        return false;
13037    return true;
13038  }
13039
13040  protected PlanDefinition.PlanDefinitionActionParticipantComponent parsePlanDefinitionPlanDefinitionActionParticipantComponent(XmlPullParser xpp, PlanDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
13041    PlanDefinition.PlanDefinitionActionParticipantComponent res = new PlanDefinition.PlanDefinitionActionParticipantComponent();
13042    parseBackboneAttributes(xpp, res);
13043    next(xpp);
13044    int eventType = nextNoWhitespace(xpp);
13045    while (eventType != XmlPullParser.END_TAG) {
13046  if (!parsePlanDefinitionPlanDefinitionActionParticipantComponentContent(eventType, xpp, owner, res))
13047        unknownContent(xpp);
13048      eventType = nextNoWhitespace(xpp);
13049    }
13050    next(xpp);
13051    parseElementClose(res);
13052    return res;
13053  }
13054
13055  protected boolean parsePlanDefinitionPlanDefinitionActionParticipantComponentContent(int eventType, XmlPullParser xpp, PlanDefinition owner, PlanDefinition.PlanDefinitionActionParticipantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
13056      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
13057        res.setTypeElement(parseEnumeration(xpp, PlanDefinition.ActionParticipantType.NULL, new PlanDefinition.ActionParticipantTypeEnumFactory()));
13058      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
13059        res.setRole(parseCodeableConcept(xpp));
13060      } else if (!parseBackboneContent(eventType, xpp, res))
13061        return false;
13062    return true;
13063  }
13064
13065  protected PlanDefinition.PlanDefinitionActionDynamicValueComponent parsePlanDefinitionPlanDefinitionActionDynamicValueComponent(XmlPullParser xpp, PlanDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
13066    PlanDefinition.PlanDefinitionActionDynamicValueComponent res = new PlanDefinition.PlanDefinitionActionDynamicValueComponent();
13067    parseBackboneAttributes(xpp, res);
13068    next(xpp);
13069    int eventType = nextNoWhitespace(xpp);
13070    while (eventType != XmlPullParser.END_TAG) {
13071  if (!parsePlanDefinitionPlanDefinitionActionDynamicValueComponentContent(eventType, xpp, owner, res))
13072        unknownContent(xpp);
13073      eventType = nextNoWhitespace(xpp);
13074    }
13075    next(xpp);
13076    parseElementClose(res);
13077    return res;
13078  }
13079
13080  protected boolean parsePlanDefinitionPlanDefinitionActionDynamicValueComponentContent(int eventType, XmlPullParser xpp, PlanDefinition owner, PlanDefinition.PlanDefinitionActionDynamicValueComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
13081      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
13082        res.setDescriptionElement(parseString(xpp));
13083      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
13084        res.setPathElement(parseString(xpp));
13085      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
13086        res.setLanguageElement(parseString(xpp));
13087      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expression")) {
13088        res.setExpressionElement(parseString(xpp));
13089      } else if (!parseBackboneContent(eventType, xpp, res))
13090        return false;
13091    return true;
13092  }
13093
13094  protected Practitioner parsePractitioner(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
13095    Practitioner res = new Practitioner();
13096    parseDomainResourceAttributes(xpp, res);
13097    next(xpp);
13098    int eventType = nextNoWhitespace(xpp);
13099    while (eventType != XmlPullParser.END_TAG) {
13100  if (!parsePractitionerContent(eventType, xpp, res))
13101        unknownContent(xpp);
13102      eventType = nextNoWhitespace(xpp);
13103    }
13104    next(xpp);
13105    parseElementClose(res);
13106    return res;
13107  }
13108
13109  protected boolean parsePractitionerContent(int eventType, XmlPullParser xpp, Practitioner res) throws XmlPullParserException, IOException, FHIRFormatError {
13110      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
13111        res.getIdentifier().add(parseIdentifier(xpp));
13112      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("active")) {
13113        res.setActiveElement(parseBoolean(xpp));
13114      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
13115        res.getName().add(parseHumanName(xpp));
13116      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("telecom")) {
13117        res.getTelecom().add(parseContactPoint(xpp));
13118      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("address")) {
13119        res.getAddress().add(parseAddress(xpp));
13120      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("gender")) {
13121        res.setGenderElement(parseEnumeration(xpp, Enumerations.AdministrativeGender.NULL, new Enumerations.AdministrativeGenderEnumFactory()));
13122      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("birthDate")) {
13123        res.setBirthDateElement(parseDate(xpp));
13124      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("photo")) {
13125        res.getPhoto().add(parseAttachment(xpp));
13126      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("qualification")) {
13127        res.getQualification().add(parsePractitionerPractitionerQualificationComponent(xpp, res));
13128      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("communication")) {
13129        res.getCommunication().add(parseCodeableConcept(xpp));
13130      } else if (!parseDomainResourceContent(eventType, xpp, res))
13131        return false;
13132    return true;
13133  }
13134
13135  protected Practitioner.PractitionerQualificationComponent parsePractitionerPractitionerQualificationComponent(XmlPullParser xpp, Practitioner owner) throws XmlPullParserException, IOException, FHIRFormatError {
13136    Practitioner.PractitionerQualificationComponent res = new Practitioner.PractitionerQualificationComponent();
13137    parseBackboneAttributes(xpp, res);
13138    next(xpp);
13139    int eventType = nextNoWhitespace(xpp);
13140    while (eventType != XmlPullParser.END_TAG) {
13141  if (!parsePractitionerPractitionerQualificationComponentContent(eventType, xpp, owner, res))
13142        unknownContent(xpp);
13143      eventType = nextNoWhitespace(xpp);
13144    }
13145    next(xpp);
13146    parseElementClose(res);
13147    return res;
13148  }
13149
13150  protected boolean parsePractitionerPractitionerQualificationComponentContent(int eventType, XmlPullParser xpp, Practitioner owner, Practitioner.PractitionerQualificationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
13151      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
13152        res.getIdentifier().add(parseIdentifier(xpp));
13153      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
13154        res.setCode(parseCodeableConcept(xpp));
13155      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
13156        res.setPeriod(parsePeriod(xpp));
13157      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("issuer")) {
13158        res.setIssuer(parseReference(xpp));
13159      } else if (!parseBackboneContent(eventType, xpp, res))
13160        return false;
13161    return true;
13162  }
13163
13164  protected PractitionerRole parsePractitionerRole(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
13165    PractitionerRole res = new PractitionerRole();
13166    parseDomainResourceAttributes(xpp, res);
13167    next(xpp);
13168    int eventType = nextNoWhitespace(xpp);
13169    while (eventType != XmlPullParser.END_TAG) {
13170  if (!parsePractitionerRoleContent(eventType, xpp, res))
13171        unknownContent(xpp);
13172      eventType = nextNoWhitespace(xpp);
13173    }
13174    next(xpp);
13175    parseElementClose(res);
13176    return res;
13177  }
13178
13179  protected boolean parsePractitionerRoleContent(int eventType, XmlPullParser xpp, PractitionerRole res) throws XmlPullParserException, IOException, FHIRFormatError {
13180      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
13181        res.getIdentifier().add(parseIdentifier(xpp));
13182      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("active")) {
13183        res.setActiveElement(parseBoolean(xpp));
13184      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
13185        res.setPeriod(parsePeriod(xpp));
13186      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("practitioner")) {
13187        res.setPractitioner(parseReference(xpp));
13188      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("organization")) {
13189        res.setOrganization(parseReference(xpp));
13190      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
13191        res.getCode().add(parseCodeableConcept(xpp));
13192      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specialty")) {
13193        res.getSpecialty().add(parseCodeableConcept(xpp));
13194      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
13195        res.getLocation().add(parseReference(xpp));
13196      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("healthcareService")) {
13197        res.getHealthcareService().add(parseReference(xpp));
13198      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("telecom")) {
13199        res.getTelecom().add(parseContactPoint(xpp));
13200      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("availableTime")) {
13201        res.getAvailableTime().add(parsePractitionerRolePractitionerRoleAvailableTimeComponent(xpp, res));
13202      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("notAvailable")) {
13203        res.getNotAvailable().add(parsePractitionerRolePractitionerRoleNotAvailableComponent(xpp, res));
13204      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("availabilityExceptions")) {
13205        res.setAvailabilityExceptionsElement(parseString(xpp));
13206      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("endpoint")) {
13207        res.getEndpoint().add(parseReference(xpp));
13208      } else if (!parseDomainResourceContent(eventType, xpp, res))
13209        return false;
13210    return true;
13211  }
13212
13213  protected PractitionerRole.PractitionerRoleAvailableTimeComponent parsePractitionerRolePractitionerRoleAvailableTimeComponent(XmlPullParser xpp, PractitionerRole owner) throws XmlPullParserException, IOException, FHIRFormatError {
13214    PractitionerRole.PractitionerRoleAvailableTimeComponent res = new PractitionerRole.PractitionerRoleAvailableTimeComponent();
13215    parseBackboneAttributes(xpp, res);
13216    next(xpp);
13217    int eventType = nextNoWhitespace(xpp);
13218    while (eventType != XmlPullParser.END_TAG) {
13219  if (!parsePractitionerRolePractitionerRoleAvailableTimeComponentContent(eventType, xpp, owner, res))
13220        unknownContent(xpp);
13221      eventType = nextNoWhitespace(xpp);
13222    }
13223    next(xpp);
13224    parseElementClose(res);
13225    return res;
13226  }
13227
13228  protected boolean parsePractitionerRolePractitionerRoleAvailableTimeComponentContent(int eventType, XmlPullParser xpp, PractitionerRole owner, PractitionerRole.PractitionerRoleAvailableTimeComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
13229      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("daysOfWeek")) {
13230        res.getDaysOfWeek().add(parseEnumeration(xpp, PractitionerRole.DaysOfWeek.NULL, new PractitionerRole.DaysOfWeekEnumFactory()));
13231      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("allDay")) {
13232        res.setAllDayElement(parseBoolean(xpp));
13233      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("availableStartTime")) {
13234        res.setAvailableStartTimeElement(parseTime(xpp));
13235      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("availableEndTime")) {
13236        res.setAvailableEndTimeElement(parseTime(xpp));
13237      } else if (!parseBackboneContent(eventType, xpp, res))
13238        return false;
13239    return true;
13240  }
13241
13242  protected PractitionerRole.PractitionerRoleNotAvailableComponent parsePractitionerRolePractitionerRoleNotAvailableComponent(XmlPullParser xpp, PractitionerRole owner) throws XmlPullParserException, IOException, FHIRFormatError {
13243    PractitionerRole.PractitionerRoleNotAvailableComponent res = new PractitionerRole.PractitionerRoleNotAvailableComponent();
13244    parseBackboneAttributes(xpp, res);
13245    next(xpp);
13246    int eventType = nextNoWhitespace(xpp);
13247    while (eventType != XmlPullParser.END_TAG) {
13248  if (!parsePractitionerRolePractitionerRoleNotAvailableComponentContent(eventType, xpp, owner, res))
13249        unknownContent(xpp);
13250      eventType = nextNoWhitespace(xpp);
13251    }
13252    next(xpp);
13253    parseElementClose(res);
13254    return res;
13255  }
13256
13257  protected boolean parsePractitionerRolePractitionerRoleNotAvailableComponentContent(int eventType, XmlPullParser xpp, PractitionerRole owner, PractitionerRole.PractitionerRoleNotAvailableComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
13258      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
13259        res.setDescriptionElement(parseString(xpp));
13260      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("during")) {
13261        res.setDuring(parsePeriod(xpp));
13262      } else if (!parseBackboneContent(eventType, xpp, res))
13263        return false;
13264    return true;
13265  }
13266
13267  protected Procedure parseProcedure(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
13268    Procedure res = new Procedure();
13269    parseDomainResourceAttributes(xpp, res);
13270    next(xpp);
13271    int eventType = nextNoWhitespace(xpp);
13272    while (eventType != XmlPullParser.END_TAG) {
13273  if (!parseProcedureContent(eventType, xpp, res))
13274        unknownContent(xpp);
13275      eventType = nextNoWhitespace(xpp);
13276    }
13277    next(xpp);
13278    parseElementClose(res);
13279    return res;
13280  }
13281
13282  protected boolean parseProcedureContent(int eventType, XmlPullParser xpp, Procedure res) throws XmlPullParserException, IOException, FHIRFormatError {
13283      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
13284        res.getIdentifier().add(parseIdentifier(xpp));
13285      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
13286        res.getDefinition().add(parseReference(xpp));
13287      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
13288        res.getBasedOn().add(parseReference(xpp));
13289      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
13290        res.getPartOf().add(parseReference(xpp));
13291      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
13292        res.setStatusElement(parseEnumeration(xpp, Procedure.ProcedureStatus.NULL, new Procedure.ProcedureStatusEnumFactory()));
13293      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("notDone")) {
13294        res.setNotDoneElement(parseBoolean(xpp));
13295      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("notDoneReason")) {
13296        res.setNotDoneReason(parseCodeableConcept(xpp));
13297      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
13298        res.setCategory(parseCodeableConcept(xpp));
13299      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
13300        res.setCode(parseCodeableConcept(xpp));
13301      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
13302        res.setSubject(parseReference(xpp));
13303      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
13304        res.setContext(parseReference(xpp));
13305      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "performed")) {
13306        res.setPerformed(parseType("performed", xpp));
13307      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performer")) {
13308        res.getPerformer().add(parseProcedureProcedurePerformerComponent(xpp, res));
13309      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
13310        res.setLocation(parseReference(xpp));
13311      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonCode")) {
13312        res.getReasonCode().add(parseCodeableConcept(xpp));
13313      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonReference")) {
13314        res.getReasonReference().add(parseReference(xpp));
13315      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodySite")) {
13316        res.getBodySite().add(parseCodeableConcept(xpp));
13317      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
13318        res.setOutcome(parseCodeableConcept(xpp));
13319      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("report")) {
13320        res.getReport().add(parseReference(xpp));
13321      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("complication")) {
13322        res.getComplication().add(parseCodeableConcept(xpp));
13323      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("complicationDetail")) {
13324        res.getComplicationDetail().add(parseReference(xpp));
13325      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("followUp")) {
13326        res.getFollowUp().add(parseCodeableConcept(xpp));
13327      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
13328        res.getNote().add(parseAnnotation(xpp));
13329      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("focalDevice")) {
13330        res.getFocalDevice().add(parseProcedureProcedureFocalDeviceComponent(xpp, res));
13331      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("usedReference")) {
13332        res.getUsedReference().add(parseReference(xpp));
13333      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("usedCode")) {
13334        res.getUsedCode().add(parseCodeableConcept(xpp));
13335      } else if (!parseDomainResourceContent(eventType, xpp, res))
13336        return false;
13337    return true;
13338  }
13339
13340  protected Procedure.ProcedurePerformerComponent parseProcedureProcedurePerformerComponent(XmlPullParser xpp, Procedure owner) throws XmlPullParserException, IOException, FHIRFormatError {
13341    Procedure.ProcedurePerformerComponent res = new Procedure.ProcedurePerformerComponent();
13342    parseBackboneAttributes(xpp, res);
13343    next(xpp);
13344    int eventType = nextNoWhitespace(xpp);
13345    while (eventType != XmlPullParser.END_TAG) {
13346  if (!parseProcedureProcedurePerformerComponentContent(eventType, xpp, owner, res))
13347        unknownContent(xpp);
13348      eventType = nextNoWhitespace(xpp);
13349    }
13350    next(xpp);
13351    parseElementClose(res);
13352    return res;
13353  }
13354
13355  protected boolean parseProcedureProcedurePerformerComponentContent(int eventType, XmlPullParser xpp, Procedure owner, Procedure.ProcedurePerformerComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
13356      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
13357        res.setRole(parseCodeableConcept(xpp));
13358      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
13359        res.setActor(parseReference(xpp));
13360      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onBehalfOf")) {
13361        res.setOnBehalfOf(parseReference(xpp));
13362      } else if (!parseBackboneContent(eventType, xpp, res))
13363        return false;
13364    return true;
13365  }
13366
13367  protected Procedure.ProcedureFocalDeviceComponent parseProcedureProcedureFocalDeviceComponent(XmlPullParser xpp, Procedure owner) throws XmlPullParserException, IOException, FHIRFormatError {
13368    Procedure.ProcedureFocalDeviceComponent res = new Procedure.ProcedureFocalDeviceComponent();
13369    parseBackboneAttributes(xpp, res);
13370    next(xpp);
13371    int eventType = nextNoWhitespace(xpp);
13372    while (eventType != XmlPullParser.END_TAG) {
13373  if (!parseProcedureProcedureFocalDeviceComponentContent(eventType, xpp, owner, res))
13374        unknownContent(xpp);
13375      eventType = nextNoWhitespace(xpp);
13376    }
13377    next(xpp);
13378    parseElementClose(res);
13379    return res;
13380  }
13381
13382  protected boolean parseProcedureProcedureFocalDeviceComponentContent(int eventType, XmlPullParser xpp, Procedure owner, Procedure.ProcedureFocalDeviceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
13383      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
13384        res.setAction(parseCodeableConcept(xpp));
13385      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("manipulated")) {
13386        res.setManipulated(parseReference(xpp));
13387      } else if (!parseBackboneContent(eventType, xpp, res))
13388        return false;
13389    return true;
13390  }
13391
13392  protected ProcedureRequest parseProcedureRequest(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
13393    ProcedureRequest res = new ProcedureRequest();
13394    parseDomainResourceAttributes(xpp, res);
13395    next(xpp);
13396    int eventType = nextNoWhitespace(xpp);
13397    while (eventType != XmlPullParser.END_TAG) {
13398  if (!parseProcedureRequestContent(eventType, xpp, res))
13399        unknownContent(xpp);
13400      eventType = nextNoWhitespace(xpp);
13401    }
13402    next(xpp);
13403    parseElementClose(res);
13404    return res;
13405  }
13406
13407  protected boolean parseProcedureRequestContent(int eventType, XmlPullParser xpp, ProcedureRequest res) throws XmlPullParserException, IOException, FHIRFormatError {
13408      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
13409        res.getIdentifier().add(parseIdentifier(xpp));
13410      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
13411        res.getDefinition().add(parseReference(xpp));
13412      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
13413        res.getBasedOn().add(parseReference(xpp));
13414      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("replaces")) {
13415        res.getReplaces().add(parseReference(xpp));
13416      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requisition")) {
13417        res.setRequisition(parseIdentifier(xpp));
13418      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
13419        res.setStatusElement(parseEnumeration(xpp, ProcedureRequest.ProcedureRequestStatus.NULL, new ProcedureRequest.ProcedureRequestStatusEnumFactory()));
13420      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("intent")) {
13421        res.setIntentElement(parseEnumeration(xpp, ProcedureRequest.ProcedureRequestIntent.NULL, new ProcedureRequest.ProcedureRequestIntentEnumFactory()));
13422      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
13423        res.setPriorityElement(parseEnumeration(xpp, ProcedureRequest.ProcedureRequestPriority.NULL, new ProcedureRequest.ProcedureRequestPriorityEnumFactory()));
13424      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("doNotPerform")) {
13425        res.setDoNotPerformElement(parseBoolean(xpp));
13426      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
13427        res.getCategory().add(parseCodeableConcept(xpp));
13428      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
13429        res.setCode(parseCodeableConcept(xpp));
13430      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
13431        res.setSubject(parseReference(xpp));
13432      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
13433        res.setContext(parseReference(xpp));
13434      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "occurrence")) {
13435        res.setOccurrence(parseType("occurrence", xpp));
13436      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "asNeeded")) {
13437        res.setAsNeeded(parseType("asNeeded", xpp));
13438      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authoredOn")) {
13439        res.setAuthoredOnElement(parseDateTime(xpp));
13440      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requester")) {
13441        res.setRequester(parseProcedureRequestProcedureRequestRequesterComponent(xpp, res));
13442      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performerType")) {
13443        res.setPerformerType(parseCodeableConcept(xpp));
13444      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performer")) {
13445        res.setPerformer(parseReference(xpp));
13446      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonCode")) {
13447        res.getReasonCode().add(parseCodeableConcept(xpp));
13448      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonReference")) {
13449        res.getReasonReference().add(parseReference(xpp));
13450      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInfo")) {
13451        res.getSupportingInfo().add(parseReference(xpp));
13452      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specimen")) {
13453        res.getSpecimen().add(parseReference(xpp));
13454      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodySite")) {
13455        res.getBodySite().add(parseCodeableConcept(xpp));
13456      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
13457        res.getNote().add(parseAnnotation(xpp));
13458      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relevantHistory")) {
13459        res.getRelevantHistory().add(parseReference(xpp));
13460      } else if (!parseDomainResourceContent(eventType, xpp, res))
13461        return false;
13462    return true;
13463  }
13464
13465  protected ProcedureRequest.ProcedureRequestRequesterComponent parseProcedureRequestProcedureRequestRequesterComponent(XmlPullParser xpp, ProcedureRequest owner) throws XmlPullParserException, IOException, FHIRFormatError {
13466    ProcedureRequest.ProcedureRequestRequesterComponent res = new ProcedureRequest.ProcedureRequestRequesterComponent();
13467    parseBackboneAttributes(xpp, res);
13468    next(xpp);
13469    int eventType = nextNoWhitespace(xpp);
13470    while (eventType != XmlPullParser.END_TAG) {
13471  if (!parseProcedureRequestProcedureRequestRequesterComponentContent(eventType, xpp, owner, res))
13472        unknownContent(xpp);
13473      eventType = nextNoWhitespace(xpp);
13474    }
13475    next(xpp);
13476    parseElementClose(res);
13477    return res;
13478  }
13479
13480  protected boolean parseProcedureRequestProcedureRequestRequesterComponentContent(int eventType, XmlPullParser xpp, ProcedureRequest owner, ProcedureRequest.ProcedureRequestRequesterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
13481      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("agent")) {
13482        res.setAgent(parseReference(xpp));
13483      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onBehalfOf")) {
13484        res.setOnBehalfOf(parseReference(xpp));
13485      } else if (!parseBackboneContent(eventType, xpp, res))
13486        return false;
13487    return true;
13488  }
13489
13490  protected ProcessRequest parseProcessRequest(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
13491    ProcessRequest res = new ProcessRequest();
13492    parseDomainResourceAttributes(xpp, res);
13493    next(xpp);
13494    int eventType = nextNoWhitespace(xpp);
13495    while (eventType != XmlPullParser.END_TAG) {
13496  if (!parseProcessRequestContent(eventType, xpp, res))
13497        unknownContent(xpp);
13498      eventType = nextNoWhitespace(xpp);
13499    }
13500    next(xpp);
13501    parseElementClose(res);
13502    return res;
13503  }
13504
13505  protected boolean parseProcessRequestContent(int eventType, XmlPullParser xpp, ProcessRequest res) throws XmlPullParserException, IOException, FHIRFormatError {
13506      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
13507        res.getIdentifier().add(parseIdentifier(xpp));
13508      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
13509        res.setStatusElement(parseEnumeration(xpp, ProcessRequest.ProcessRequestStatus.NULL, new ProcessRequest.ProcessRequestStatusEnumFactory()));
13510      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
13511        res.setActionElement(parseEnumeration(xpp, ProcessRequest.ActionList.NULL, new ProcessRequest.ActionListEnumFactory()));
13512      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("target")) {
13513        res.setTarget(parseReference(xpp));
13514      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
13515        res.setCreatedElement(parseDateTime(xpp));
13516      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("provider")) {
13517        res.setProvider(parseReference(xpp));
13518      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("organization")) {
13519        res.setOrganization(parseReference(xpp));
13520      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
13521        res.setRequest(parseReference(xpp));
13522      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("response")) {
13523        res.setResponse(parseReference(xpp));
13524      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("nullify")) {
13525        res.setNullifyElement(parseBoolean(xpp));
13526      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
13527        res.setReferenceElement(parseString(xpp));
13528      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("item")) {
13529        res.getItem().add(parseProcessRequestItemsComponent(xpp, res));
13530      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("include")) {
13531        res.getInclude().add(parseString(xpp));
13532      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("exclude")) {
13533        res.getExclude().add(parseString(xpp));
13534      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
13535        res.setPeriod(parsePeriod(xpp));
13536      } else if (!parseDomainResourceContent(eventType, xpp, res))
13537        return false;
13538    return true;
13539  }
13540
13541  protected ProcessRequest.ItemsComponent parseProcessRequestItemsComponent(XmlPullParser xpp, ProcessRequest owner) throws XmlPullParserException, IOException, FHIRFormatError {
13542    ProcessRequest.ItemsComponent res = new ProcessRequest.ItemsComponent();
13543    parseBackboneAttributes(xpp, res);
13544    next(xpp);
13545    int eventType = nextNoWhitespace(xpp);
13546    while (eventType != XmlPullParser.END_TAG) {
13547  if (!parseProcessRequestItemsComponentContent(eventType, xpp, owner, res))
13548        unknownContent(xpp);
13549      eventType = nextNoWhitespace(xpp);
13550    }
13551    next(xpp);
13552    parseElementClose(res);
13553    return res;
13554  }
13555
13556  protected boolean parseProcessRequestItemsComponentContent(int eventType, XmlPullParser xpp, ProcessRequest owner, ProcessRequest.ItemsComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
13557      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequenceLinkId")) {
13558        res.setSequenceLinkIdElement(parseInteger(xpp));
13559      } else if (!parseBackboneContent(eventType, xpp, res))
13560        return false;
13561    return true;
13562  }
13563
13564  protected ProcessResponse parseProcessResponse(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
13565    ProcessResponse res = new ProcessResponse();
13566    parseDomainResourceAttributes(xpp, res);
13567    next(xpp);
13568    int eventType = nextNoWhitespace(xpp);
13569    while (eventType != XmlPullParser.END_TAG) {
13570  if (!parseProcessResponseContent(eventType, xpp, res))
13571        unknownContent(xpp);
13572      eventType = nextNoWhitespace(xpp);
13573    }
13574    next(xpp);
13575    parseElementClose(res);
13576    return res;
13577  }
13578
13579  protected boolean parseProcessResponseContent(int eventType, XmlPullParser xpp, ProcessResponse res) throws XmlPullParserException, IOException, FHIRFormatError {
13580      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
13581        res.getIdentifier().add(parseIdentifier(xpp));
13582      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
13583        res.setStatusElement(parseEnumeration(xpp, ProcessResponse.ProcessResponseStatus.NULL, new ProcessResponse.ProcessResponseStatusEnumFactory()));
13584      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
13585        res.setCreatedElement(parseDateTime(xpp));
13586      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("organization")) {
13587        res.setOrganization(parseReference(xpp));
13588      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
13589        res.setRequest(parseReference(xpp));
13590      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
13591        res.setOutcome(parseCodeableConcept(xpp));
13592      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("disposition")) {
13593        res.setDispositionElement(parseString(xpp));
13594      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestProvider")) {
13595        res.setRequestProvider(parseReference(xpp));
13596      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestOrganization")) {
13597        res.setRequestOrganization(parseReference(xpp));
13598      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("form")) {
13599        res.setForm(parseCodeableConcept(xpp));
13600      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("processNote")) {
13601        res.getProcessNote().add(parseProcessResponseProcessResponseProcessNoteComponent(xpp, res));
13602      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("error")) {
13603        res.getError().add(parseCodeableConcept(xpp));
13604      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("communicationRequest")) {
13605        res.getCommunicationRequest().add(parseReference(xpp));
13606      } else if (!parseDomainResourceContent(eventType, xpp, res))
13607        return false;
13608    return true;
13609  }
13610
13611  protected ProcessResponse.ProcessResponseProcessNoteComponent parseProcessResponseProcessResponseProcessNoteComponent(XmlPullParser xpp, ProcessResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
13612    ProcessResponse.ProcessResponseProcessNoteComponent res = new ProcessResponse.ProcessResponseProcessNoteComponent();
13613    parseBackboneAttributes(xpp, res);
13614    next(xpp);
13615    int eventType = nextNoWhitespace(xpp);
13616    while (eventType != XmlPullParser.END_TAG) {
13617  if (!parseProcessResponseProcessResponseProcessNoteComponentContent(eventType, xpp, owner, res))
13618        unknownContent(xpp);
13619      eventType = nextNoWhitespace(xpp);
13620    }
13621    next(xpp);
13622    parseElementClose(res);
13623    return res;
13624  }
13625
13626  protected boolean parseProcessResponseProcessResponseProcessNoteComponentContent(int eventType, XmlPullParser xpp, ProcessResponse owner, ProcessResponse.ProcessResponseProcessNoteComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
13627      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
13628        res.setType(parseCodeableConcept(xpp));
13629      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
13630        res.setTextElement(parseString(xpp));
13631      } else if (!parseBackboneContent(eventType, xpp, res))
13632        return false;
13633    return true;
13634  }
13635
13636  protected Provenance parseProvenance(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
13637    Provenance res = new Provenance();
13638    parseDomainResourceAttributes(xpp, res);
13639    next(xpp);
13640    int eventType = nextNoWhitespace(xpp);
13641    while (eventType != XmlPullParser.END_TAG) {
13642  if (!parseProvenanceContent(eventType, xpp, res))
13643        unknownContent(xpp);
13644      eventType = nextNoWhitespace(xpp);
13645    }
13646    next(xpp);
13647    parseElementClose(res);
13648    return res;
13649  }
13650
13651  protected boolean parseProvenanceContent(int eventType, XmlPullParser xpp, Provenance res) throws XmlPullParserException, IOException, FHIRFormatError {
13652      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("target")) {
13653        res.getTarget().add(parseReference(xpp));
13654      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
13655        res.setPeriod(parsePeriod(xpp));
13656      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recorded")) {
13657        res.setRecordedElement(parseInstant(xpp));
13658      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("policy")) {
13659        res.getPolicy().add(parseUri(xpp));
13660      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
13661        res.setLocation(parseReference(xpp));
13662      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
13663        res.getReason().add(parseCoding(xpp));
13664      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("activity")) {
13665        res.setActivity(parseCoding(xpp));
13666      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("agent")) {
13667        res.getAgent().add(parseProvenanceProvenanceAgentComponent(xpp, res));
13668      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("entity")) {
13669        res.getEntity().add(parseProvenanceProvenanceEntityComponent(xpp, res));
13670      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("signature")) {
13671        res.getSignature().add(parseSignature(xpp));
13672      } else if (!parseDomainResourceContent(eventType, xpp, res))
13673        return false;
13674    return true;
13675  }
13676
13677  protected Provenance.ProvenanceAgentComponent parseProvenanceProvenanceAgentComponent(XmlPullParser xpp, Provenance owner) throws XmlPullParserException, IOException, FHIRFormatError {
13678    Provenance.ProvenanceAgentComponent res = new Provenance.ProvenanceAgentComponent();
13679    parseBackboneAttributes(xpp, res);
13680    next(xpp);
13681    int eventType = nextNoWhitespace(xpp);
13682    while (eventType != XmlPullParser.END_TAG) {
13683  if (!parseProvenanceProvenanceAgentComponentContent(eventType, xpp, owner, res))
13684        unknownContent(xpp);
13685      eventType = nextNoWhitespace(xpp);
13686    }
13687    next(xpp);
13688    parseElementClose(res);
13689    return res;
13690  }
13691
13692  protected boolean parseProvenanceProvenanceAgentComponentContent(int eventType, XmlPullParser xpp, Provenance owner, Provenance.ProvenanceAgentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
13693      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
13694        res.getRole().add(parseCodeableConcept(xpp));
13695      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "who")) {
13696        res.setWho(parseType("who", xpp));
13697      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "onBehalfOf")) {
13698        res.setOnBehalfOf(parseType("onBehalfOf", xpp));
13699      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatedAgentType")) {
13700        res.setRelatedAgentType(parseCodeableConcept(xpp));
13701      } else if (!parseBackboneContent(eventType, xpp, res))
13702        return false;
13703    return true;
13704  }
13705
13706  protected Provenance.ProvenanceEntityComponent parseProvenanceProvenanceEntityComponent(XmlPullParser xpp, Provenance owner) throws XmlPullParserException, IOException, FHIRFormatError {
13707    Provenance.ProvenanceEntityComponent res = new Provenance.ProvenanceEntityComponent();
13708    parseBackboneAttributes(xpp, res);
13709    next(xpp);
13710    int eventType = nextNoWhitespace(xpp);
13711    while (eventType != XmlPullParser.END_TAG) {
13712  if (!parseProvenanceProvenanceEntityComponentContent(eventType, xpp, owner, res))
13713        unknownContent(xpp);
13714      eventType = nextNoWhitespace(xpp);
13715    }
13716    next(xpp);
13717    parseElementClose(res);
13718    return res;
13719  }
13720
13721  protected boolean parseProvenanceProvenanceEntityComponentContent(int eventType, XmlPullParser xpp, Provenance owner, Provenance.ProvenanceEntityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
13722      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
13723        res.setRoleElement(parseEnumeration(xpp, Provenance.ProvenanceEntityRole.NULL, new Provenance.ProvenanceEntityRoleEnumFactory()));
13724      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "what")) {
13725        res.setWhat(parseType("what", xpp));
13726      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("agent")) {
13727        res.getAgent().add(parseProvenanceProvenanceAgentComponent(xpp, owner));
13728      } else if (!parseBackboneContent(eventType, xpp, res))
13729        return false;
13730    return true;
13731  }
13732
13733  protected Questionnaire parseQuestionnaire(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
13734    Questionnaire res = new Questionnaire();
13735    parseDomainResourceAttributes(xpp, res);
13736    next(xpp);
13737    int eventType = nextNoWhitespace(xpp);
13738    while (eventType != XmlPullParser.END_TAG) {
13739  if (!parseQuestionnaireContent(eventType, xpp, res))
13740        unknownContent(xpp);
13741      eventType = nextNoWhitespace(xpp);
13742    }
13743    next(xpp);
13744    parseElementClose(res);
13745    return res;
13746  }
13747
13748  protected boolean parseQuestionnaireContent(int eventType, XmlPullParser xpp, Questionnaire res) throws XmlPullParserException, IOException, FHIRFormatError {
13749      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
13750        res.setUrlElement(parseUri(xpp));
13751      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
13752        res.getIdentifier().add(parseIdentifier(xpp));
13753      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
13754        res.setVersionElement(parseString(xpp));
13755      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
13756        res.setNameElement(parseString(xpp));
13757      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
13758        res.setTitleElement(parseString(xpp));
13759      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
13760        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
13761      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
13762        res.setExperimentalElement(parseBoolean(xpp));
13763      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
13764        res.setDateElement(parseDateTime(xpp));
13765      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
13766        res.setPublisherElement(parseString(xpp));
13767      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
13768        res.setDescriptionElement(parseMarkdown(xpp));
13769      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
13770        res.setPurposeElement(parseMarkdown(xpp));
13771      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("approvalDate")) {
13772        res.setApprovalDateElement(parseDate(xpp));
13773      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastReviewDate")) {
13774        res.setLastReviewDateElement(parseDate(xpp));
13775      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("effectivePeriod")) {
13776        res.setEffectivePeriod(parsePeriod(xpp));
13777      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
13778        res.getUseContext().add(parseUsageContext(xpp));
13779      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
13780        res.getJurisdiction().add(parseCodeableConcept(xpp));
13781      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
13782        res.getContact().add(parseContactDetail(xpp));
13783      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
13784        res.setCopyrightElement(parseMarkdown(xpp));
13785      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
13786        res.getCode().add(parseCoding(xpp));
13787      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subjectType")) {
13788        res.getSubjectType().add(parseCode(xpp));
13789      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("item")) {
13790        res.getItem().add(parseQuestionnaireQuestionnaireItemComponent(xpp, res));
13791      } else if (!parseDomainResourceContent(eventType, xpp, res))
13792        return false;
13793    return true;
13794  }
13795
13796  protected Questionnaire.QuestionnaireItemComponent parseQuestionnaireQuestionnaireItemComponent(XmlPullParser xpp, Questionnaire owner) throws XmlPullParserException, IOException, FHIRFormatError {
13797    Questionnaire.QuestionnaireItemComponent res = new Questionnaire.QuestionnaireItemComponent();
13798    parseBackboneAttributes(xpp, res);
13799    next(xpp);
13800    int eventType = nextNoWhitespace(xpp);
13801    while (eventType != XmlPullParser.END_TAG) {
13802  if (!parseQuestionnaireQuestionnaireItemComponentContent(eventType, xpp, owner, res))
13803        unknownContent(xpp);
13804      eventType = nextNoWhitespace(xpp);
13805    }
13806    next(xpp);
13807    parseElementClose(res);
13808    return res;
13809  }
13810
13811  protected boolean parseQuestionnaireQuestionnaireItemComponentContent(int eventType, XmlPullParser xpp, Questionnaire owner, Questionnaire.QuestionnaireItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
13812      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("linkId")) {
13813        res.setLinkIdElement(parseString(xpp));
13814      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
13815        res.setDefinitionElement(parseUri(xpp));
13816      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
13817        res.getCode().add(parseCoding(xpp));
13818      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prefix")) {
13819        res.setPrefixElement(parseString(xpp));
13820      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
13821        res.setTextElement(parseString(xpp));
13822      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
13823        res.setTypeElement(parseEnumeration(xpp, Questionnaire.QuestionnaireItemType.NULL, new Questionnaire.QuestionnaireItemTypeEnumFactory()));
13824      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("enableWhen")) {
13825        res.getEnableWhen().add(parseQuestionnaireQuestionnaireItemEnableWhenComponent(xpp, owner));
13826      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("required")) {
13827        res.setRequiredElement(parseBoolean(xpp));
13828      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("repeats")) {
13829        res.setRepeatsElement(parseBoolean(xpp));
13830      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("readOnly")) {
13831        res.setReadOnlyElement(parseBoolean(xpp));
13832      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxLength")) {
13833        res.setMaxLengthElement(parseInteger(xpp));
13834      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("options")) {
13835        res.setOptions(parseReference(xpp));
13836      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("option")) {
13837        res.getOption().add(parseQuestionnaireQuestionnaireItemOptionComponent(xpp, owner));
13838      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "initial")) {
13839        res.setInitial(parseType("initial", xpp));
13840      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("item")) {
13841        res.getItem().add(parseQuestionnaireQuestionnaireItemComponent(xpp, owner));
13842      } else if (!parseBackboneContent(eventType, xpp, res))
13843        return false;
13844    return true;
13845  }
13846
13847  protected Questionnaire.QuestionnaireItemEnableWhenComponent parseQuestionnaireQuestionnaireItemEnableWhenComponent(XmlPullParser xpp, Questionnaire owner) throws XmlPullParserException, IOException, FHIRFormatError {
13848    Questionnaire.QuestionnaireItemEnableWhenComponent res = new Questionnaire.QuestionnaireItemEnableWhenComponent();
13849    parseBackboneAttributes(xpp, res);
13850    next(xpp);
13851    int eventType = nextNoWhitespace(xpp);
13852    while (eventType != XmlPullParser.END_TAG) {
13853  if (!parseQuestionnaireQuestionnaireItemEnableWhenComponentContent(eventType, xpp, owner, res))
13854        unknownContent(xpp);
13855      eventType = nextNoWhitespace(xpp);
13856    }
13857    next(xpp);
13858    parseElementClose(res);
13859    return res;
13860  }
13861
13862  protected boolean parseQuestionnaireQuestionnaireItemEnableWhenComponentContent(int eventType, XmlPullParser xpp, Questionnaire owner, Questionnaire.QuestionnaireItemEnableWhenComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
13863      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("question")) {
13864        res.setQuestionElement(parseString(xpp));
13865      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("hasAnswer")) {
13866        res.setHasAnswerElement(parseBoolean(xpp));
13867      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "answer")) {
13868        res.setAnswer(parseType("answer", xpp));
13869      } else if (!parseBackboneContent(eventType, xpp, res))
13870        return false;
13871    return true;
13872  }
13873
13874  protected Questionnaire.QuestionnaireItemOptionComponent parseQuestionnaireQuestionnaireItemOptionComponent(XmlPullParser xpp, Questionnaire owner) throws XmlPullParserException, IOException, FHIRFormatError {
13875    Questionnaire.QuestionnaireItemOptionComponent res = new Questionnaire.QuestionnaireItemOptionComponent();
13876    parseBackboneAttributes(xpp, res);
13877    next(xpp);
13878    int eventType = nextNoWhitespace(xpp);
13879    while (eventType != XmlPullParser.END_TAG) {
13880  if (!parseQuestionnaireQuestionnaireItemOptionComponentContent(eventType, xpp, owner, res))
13881        unknownContent(xpp);
13882      eventType = nextNoWhitespace(xpp);
13883    }
13884    next(xpp);
13885    parseElementClose(res);
13886    return res;
13887  }
13888
13889  protected boolean parseQuestionnaireQuestionnaireItemOptionComponentContent(int eventType, XmlPullParser xpp, Questionnaire owner, Questionnaire.QuestionnaireItemOptionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
13890      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
13891        res.setValue(parseType("value", xpp));
13892      } else if (!parseBackboneContent(eventType, xpp, res))
13893        return false;
13894    return true;
13895  }
13896
13897  protected QuestionnaireResponse parseQuestionnaireResponse(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
13898    QuestionnaireResponse res = new QuestionnaireResponse();
13899    parseDomainResourceAttributes(xpp, res);
13900    next(xpp);
13901    int eventType = nextNoWhitespace(xpp);
13902    while (eventType != XmlPullParser.END_TAG) {
13903  if (!parseQuestionnaireResponseContent(eventType, xpp, res))
13904        unknownContent(xpp);
13905      eventType = nextNoWhitespace(xpp);
13906    }
13907    next(xpp);
13908    parseElementClose(res);
13909    return res;
13910  }
13911
13912  protected boolean parseQuestionnaireResponseContent(int eventType, XmlPullParser xpp, QuestionnaireResponse res) throws XmlPullParserException, IOException, FHIRFormatError {
13913      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
13914        res.setIdentifier(parseIdentifier(xpp));
13915      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
13916        res.getBasedOn().add(parseReference(xpp));
13917      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("parent")) {
13918        res.getParent().add(parseReference(xpp));
13919      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("questionnaire")) {
13920        res.setQuestionnaire(parseReference(xpp));
13921      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
13922        res.setStatusElement(parseEnumeration(xpp, QuestionnaireResponse.QuestionnaireResponseStatus.NULL, new QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory()));
13923      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
13924        res.setSubject(parseReference(xpp));
13925      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
13926        res.setContext(parseReference(xpp));
13927      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authored")) {
13928        res.setAuthoredElement(parseDateTime(xpp));
13929      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
13930        res.setAuthor(parseReference(xpp));
13931      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
13932        res.setSource(parseReference(xpp));
13933      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("item")) {
13934        res.getItem().add(parseQuestionnaireResponseQuestionnaireResponseItemComponent(xpp, res));
13935      } else if (!parseDomainResourceContent(eventType, xpp, res))
13936        return false;
13937    return true;
13938  }
13939
13940  protected QuestionnaireResponse.QuestionnaireResponseItemComponent parseQuestionnaireResponseQuestionnaireResponseItemComponent(XmlPullParser xpp, QuestionnaireResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
13941    QuestionnaireResponse.QuestionnaireResponseItemComponent res = new QuestionnaireResponse.QuestionnaireResponseItemComponent();
13942    parseBackboneAttributes(xpp, res);
13943    next(xpp);
13944    int eventType = nextNoWhitespace(xpp);
13945    while (eventType != XmlPullParser.END_TAG) {
13946  if (!parseQuestionnaireResponseQuestionnaireResponseItemComponentContent(eventType, xpp, owner, res))
13947        unknownContent(xpp);
13948      eventType = nextNoWhitespace(xpp);
13949    }
13950    next(xpp);
13951    parseElementClose(res);
13952    return res;
13953  }
13954
13955  protected boolean parseQuestionnaireResponseQuestionnaireResponseItemComponentContent(int eventType, XmlPullParser xpp, QuestionnaireResponse owner, QuestionnaireResponse.QuestionnaireResponseItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
13956      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("linkId")) {
13957        res.setLinkIdElement(parseString(xpp));
13958      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
13959        res.setDefinitionElement(parseUri(xpp));
13960      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
13961        res.setTextElement(parseString(xpp));
13962      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
13963        res.setSubject(parseReference(xpp));
13964      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("answer")) {
13965        res.getAnswer().add(parseQuestionnaireResponseQuestionnaireResponseItemAnswerComponent(xpp, owner));
13966      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("item")) {
13967        res.getItem().add(parseQuestionnaireResponseQuestionnaireResponseItemComponent(xpp, owner));
13968      } else if (!parseBackboneContent(eventType, xpp, res))
13969        return false;
13970    return true;
13971  }
13972
13973  protected QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent parseQuestionnaireResponseQuestionnaireResponseItemAnswerComponent(XmlPullParser xpp, QuestionnaireResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
13974    QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent res = new QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent();
13975    parseBackboneAttributes(xpp, res);
13976    next(xpp);
13977    int eventType = nextNoWhitespace(xpp);
13978    while (eventType != XmlPullParser.END_TAG) {
13979  if (!parseQuestionnaireResponseQuestionnaireResponseItemAnswerComponentContent(eventType, xpp, owner, res))
13980        unknownContent(xpp);
13981      eventType = nextNoWhitespace(xpp);
13982    }
13983    next(xpp);
13984    parseElementClose(res);
13985    return res;
13986  }
13987
13988  protected boolean parseQuestionnaireResponseQuestionnaireResponseItemAnswerComponentContent(int eventType, XmlPullParser xpp, QuestionnaireResponse owner, QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
13989      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
13990        res.setValue(parseType("value", xpp));
13991      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("item")) {
13992        res.getItem().add(parseQuestionnaireResponseQuestionnaireResponseItemComponent(xpp, owner));
13993      } else if (!parseBackboneContent(eventType, xpp, res))
13994        return false;
13995    return true;
13996  }
13997
13998  protected ReferralRequest parseReferralRequest(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
13999    ReferralRequest res = new ReferralRequest();
14000    parseDomainResourceAttributes(xpp, res);
14001    next(xpp);
14002    int eventType = nextNoWhitespace(xpp);
14003    while (eventType != XmlPullParser.END_TAG) {
14004  if (!parseReferralRequestContent(eventType, xpp, res))
14005        unknownContent(xpp);
14006      eventType = nextNoWhitespace(xpp);
14007    }
14008    next(xpp);
14009    parseElementClose(res);
14010    return res;
14011  }
14012
14013  protected boolean parseReferralRequestContent(int eventType, XmlPullParser xpp, ReferralRequest res) throws XmlPullParserException, IOException, FHIRFormatError {
14014      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
14015        res.getIdentifier().add(parseIdentifier(xpp));
14016      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
14017        res.getDefinition().add(parseReference(xpp));
14018      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
14019        res.getBasedOn().add(parseReference(xpp));
14020      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("replaces")) {
14021        res.getReplaces().add(parseReference(xpp));
14022      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("groupIdentifier")) {
14023        res.setGroupIdentifier(parseIdentifier(xpp));
14024      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
14025        res.setStatusElement(parseEnumeration(xpp, ReferralRequest.ReferralRequestStatus.NULL, new ReferralRequest.ReferralRequestStatusEnumFactory()));
14026      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("intent")) {
14027        res.setIntentElement(parseEnumeration(xpp, ReferralRequest.ReferralCategory.NULL, new ReferralRequest.ReferralCategoryEnumFactory()));
14028      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
14029        res.setType(parseCodeableConcept(xpp));
14030      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
14031        res.setPriorityElement(parseEnumeration(xpp, ReferralRequest.ReferralPriority.NULL, new ReferralRequest.ReferralPriorityEnumFactory()));
14032      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("serviceRequested")) {
14033        res.getServiceRequested().add(parseCodeableConcept(xpp));
14034      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
14035        res.setSubject(parseReference(xpp));
14036      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
14037        res.setContext(parseReference(xpp));
14038      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "occurrence")) {
14039        res.setOccurrence(parseType("occurrence", xpp));
14040      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authoredOn")) {
14041        res.setAuthoredOnElement(parseDateTime(xpp));
14042      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requester")) {
14043        res.setRequester(parseReferralRequestReferralRequestRequesterComponent(xpp, res));
14044      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specialty")) {
14045        res.setSpecialty(parseCodeableConcept(xpp));
14046      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recipient")) {
14047        res.getRecipient().add(parseReference(xpp));
14048      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonCode")) {
14049        res.getReasonCode().add(parseCodeableConcept(xpp));
14050      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonReference")) {
14051        res.getReasonReference().add(parseReference(xpp));
14052      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
14053        res.setDescriptionElement(parseString(xpp));
14054      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInfo")) {
14055        res.getSupportingInfo().add(parseReference(xpp));
14056      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
14057        res.getNote().add(parseAnnotation(xpp));
14058      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relevantHistory")) {
14059        res.getRelevantHistory().add(parseReference(xpp));
14060      } else if (!parseDomainResourceContent(eventType, xpp, res))
14061        return false;
14062    return true;
14063  }
14064
14065  protected ReferralRequest.ReferralRequestRequesterComponent parseReferralRequestReferralRequestRequesterComponent(XmlPullParser xpp, ReferralRequest owner) throws XmlPullParserException, IOException, FHIRFormatError {
14066    ReferralRequest.ReferralRequestRequesterComponent res = new ReferralRequest.ReferralRequestRequesterComponent();
14067    parseBackboneAttributes(xpp, res);
14068    next(xpp);
14069    int eventType = nextNoWhitespace(xpp);
14070    while (eventType != XmlPullParser.END_TAG) {
14071  if (!parseReferralRequestReferralRequestRequesterComponentContent(eventType, xpp, owner, res))
14072        unknownContent(xpp);
14073      eventType = nextNoWhitespace(xpp);
14074    }
14075    next(xpp);
14076    parseElementClose(res);
14077    return res;
14078  }
14079
14080  protected boolean parseReferralRequestReferralRequestRequesterComponentContent(int eventType, XmlPullParser xpp, ReferralRequest owner, ReferralRequest.ReferralRequestRequesterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
14081      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("agent")) {
14082        res.setAgent(parseReference(xpp));
14083      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onBehalfOf")) {
14084        res.setOnBehalfOf(parseReference(xpp));
14085      } else if (!parseBackboneContent(eventType, xpp, res))
14086        return false;
14087    return true;
14088  }
14089
14090  protected RelatedPerson parseRelatedPerson(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
14091    RelatedPerson res = new RelatedPerson();
14092    parseDomainResourceAttributes(xpp, res);
14093    next(xpp);
14094    int eventType = nextNoWhitespace(xpp);
14095    while (eventType != XmlPullParser.END_TAG) {
14096  if (!parseRelatedPersonContent(eventType, xpp, res))
14097        unknownContent(xpp);
14098      eventType = nextNoWhitespace(xpp);
14099    }
14100    next(xpp);
14101    parseElementClose(res);
14102    return res;
14103  }
14104
14105  protected boolean parseRelatedPersonContent(int eventType, XmlPullParser xpp, RelatedPerson res) throws XmlPullParserException, IOException, FHIRFormatError {
14106      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
14107        res.getIdentifier().add(parseIdentifier(xpp));
14108      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("active")) {
14109        res.setActiveElement(parseBoolean(xpp));
14110      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
14111        res.setPatient(parseReference(xpp));
14112      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relationship")) {
14113        res.setRelationship(parseCodeableConcept(xpp));
14114      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
14115        res.getName().add(parseHumanName(xpp));
14116      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("telecom")) {
14117        res.getTelecom().add(parseContactPoint(xpp));
14118      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("gender")) {
14119        res.setGenderElement(parseEnumeration(xpp, Enumerations.AdministrativeGender.NULL, new Enumerations.AdministrativeGenderEnumFactory()));
14120      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("birthDate")) {
14121        res.setBirthDateElement(parseDate(xpp));
14122      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("address")) {
14123        res.getAddress().add(parseAddress(xpp));
14124      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("photo")) {
14125        res.getPhoto().add(parseAttachment(xpp));
14126      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
14127        res.setPeriod(parsePeriod(xpp));
14128      } else if (!parseDomainResourceContent(eventType, xpp, res))
14129        return false;
14130    return true;
14131  }
14132
14133  protected RequestGroup parseRequestGroup(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
14134    RequestGroup res = new RequestGroup();
14135    parseDomainResourceAttributes(xpp, res);
14136    next(xpp);
14137    int eventType = nextNoWhitespace(xpp);
14138    while (eventType != XmlPullParser.END_TAG) {
14139  if (!parseRequestGroupContent(eventType, xpp, res))
14140        unknownContent(xpp);
14141      eventType = nextNoWhitespace(xpp);
14142    }
14143    next(xpp);
14144    parseElementClose(res);
14145    return res;
14146  }
14147
14148  protected boolean parseRequestGroupContent(int eventType, XmlPullParser xpp, RequestGroup res) throws XmlPullParserException, IOException, FHIRFormatError {
14149      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
14150        res.getIdentifier().add(parseIdentifier(xpp));
14151      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
14152        res.getDefinition().add(parseReference(xpp));
14153      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
14154        res.getBasedOn().add(parseReference(xpp));
14155      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("replaces")) {
14156        res.getReplaces().add(parseReference(xpp));
14157      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("groupIdentifier")) {
14158        res.setGroupIdentifier(parseIdentifier(xpp));
14159      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
14160        res.setStatusElement(parseEnumeration(xpp, RequestGroup.RequestStatus.NULL, new RequestGroup.RequestStatusEnumFactory()));
14161      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("intent")) {
14162        res.setIntentElement(parseEnumeration(xpp, RequestGroup.RequestIntent.NULL, new RequestGroup.RequestIntentEnumFactory()));
14163      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
14164        res.setPriorityElement(parseEnumeration(xpp, RequestGroup.RequestPriority.NULL, new RequestGroup.RequestPriorityEnumFactory()));
14165      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
14166        res.setSubject(parseReference(xpp));
14167      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
14168        res.setContext(parseReference(xpp));
14169      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authoredOn")) {
14170        res.setAuthoredOnElement(parseDateTime(xpp));
14171      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
14172        res.setAuthor(parseReference(xpp));
14173      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "reason")) {
14174        res.setReason(parseType("reason", xpp));
14175      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
14176        res.getNote().add(parseAnnotation(xpp));
14177      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
14178        res.getAction().add(parseRequestGroupRequestGroupActionComponent(xpp, res));
14179      } else if (!parseDomainResourceContent(eventType, xpp, res))
14180        return false;
14181    return true;
14182  }
14183
14184  protected RequestGroup.RequestGroupActionComponent parseRequestGroupRequestGroupActionComponent(XmlPullParser xpp, RequestGroup owner) throws XmlPullParserException, IOException, FHIRFormatError {
14185    RequestGroup.RequestGroupActionComponent res = new RequestGroup.RequestGroupActionComponent();
14186    parseBackboneAttributes(xpp, res);
14187    next(xpp);
14188    int eventType = nextNoWhitespace(xpp);
14189    while (eventType != XmlPullParser.END_TAG) {
14190  if (!parseRequestGroupRequestGroupActionComponentContent(eventType, xpp, owner, res))
14191        unknownContent(xpp);
14192      eventType = nextNoWhitespace(xpp);
14193    }
14194    next(xpp);
14195    parseElementClose(res);
14196    return res;
14197  }
14198
14199  protected boolean parseRequestGroupRequestGroupActionComponentContent(int eventType, XmlPullParser xpp, RequestGroup owner, RequestGroup.RequestGroupActionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
14200      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("label")) {
14201        res.setLabelElement(parseString(xpp));
14202      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
14203        res.setTitleElement(parseString(xpp));
14204      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
14205        res.setDescriptionElement(parseString(xpp));
14206      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("textEquivalent")) {
14207        res.setTextEquivalentElement(parseString(xpp));
14208      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
14209        res.getCode().add(parseCodeableConcept(xpp));
14210      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
14211        res.getDocumentation().add(parseRelatedArtifact(xpp));
14212      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("condition")) {
14213        res.getCondition().add(parseRequestGroupRequestGroupActionConditionComponent(xpp, owner));
14214      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatedAction")) {
14215        res.getRelatedAction().add(parseRequestGroupRequestGroupActionRelatedActionComponent(xpp, owner));
14216      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "timing")) {
14217        res.setTiming(parseType("timing", xpp));
14218      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
14219        res.getParticipant().add(parseReference(xpp));
14220      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
14221        res.setType(parseCoding(xpp));
14222      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("groupingBehavior")) {
14223        res.setGroupingBehaviorElement(parseEnumeration(xpp, RequestGroup.ActionGroupingBehavior.NULL, new RequestGroup.ActionGroupingBehaviorEnumFactory()));
14224      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("selectionBehavior")) {
14225        res.setSelectionBehaviorElement(parseEnumeration(xpp, RequestGroup.ActionSelectionBehavior.NULL, new RequestGroup.ActionSelectionBehaviorEnumFactory()));
14226      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requiredBehavior")) {
14227        res.setRequiredBehaviorElement(parseEnumeration(xpp, RequestGroup.ActionRequiredBehavior.NULL, new RequestGroup.ActionRequiredBehaviorEnumFactory()));
14228      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("precheckBehavior")) {
14229        res.setPrecheckBehaviorElement(parseEnumeration(xpp, RequestGroup.ActionPrecheckBehavior.NULL, new RequestGroup.ActionPrecheckBehaviorEnumFactory()));
14230      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("cardinalityBehavior")) {
14231        res.setCardinalityBehaviorElement(parseEnumeration(xpp, RequestGroup.ActionCardinalityBehavior.NULL, new RequestGroup.ActionCardinalityBehaviorEnumFactory()));
14232      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
14233        res.setResource(parseReference(xpp));
14234      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
14235        res.getAction().add(parseRequestGroupRequestGroupActionComponent(xpp, owner));
14236      } else if (!parseBackboneContent(eventType, xpp, res))
14237        return false;
14238    return true;
14239  }
14240
14241  protected RequestGroup.RequestGroupActionConditionComponent parseRequestGroupRequestGroupActionConditionComponent(XmlPullParser xpp, RequestGroup owner) throws XmlPullParserException, IOException, FHIRFormatError {
14242    RequestGroup.RequestGroupActionConditionComponent res = new RequestGroup.RequestGroupActionConditionComponent();
14243    parseBackboneAttributes(xpp, res);
14244    next(xpp);
14245    int eventType = nextNoWhitespace(xpp);
14246    while (eventType != XmlPullParser.END_TAG) {
14247  if (!parseRequestGroupRequestGroupActionConditionComponentContent(eventType, xpp, owner, res))
14248        unknownContent(xpp);
14249      eventType = nextNoWhitespace(xpp);
14250    }
14251    next(xpp);
14252    parseElementClose(res);
14253    return res;
14254  }
14255
14256  protected boolean parseRequestGroupRequestGroupActionConditionComponentContent(int eventType, XmlPullParser xpp, RequestGroup owner, RequestGroup.RequestGroupActionConditionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
14257      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("kind")) {
14258        res.setKindElement(parseEnumeration(xpp, RequestGroup.ActionConditionKind.NULL, new RequestGroup.ActionConditionKindEnumFactory()));
14259      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
14260        res.setDescriptionElement(parseString(xpp));
14261      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
14262        res.setLanguageElement(parseString(xpp));
14263      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expression")) {
14264        res.setExpressionElement(parseString(xpp));
14265      } else if (!parseBackboneContent(eventType, xpp, res))
14266        return false;
14267    return true;
14268  }
14269
14270  protected RequestGroup.RequestGroupActionRelatedActionComponent parseRequestGroupRequestGroupActionRelatedActionComponent(XmlPullParser xpp, RequestGroup owner) throws XmlPullParserException, IOException, FHIRFormatError {
14271    RequestGroup.RequestGroupActionRelatedActionComponent res = new RequestGroup.RequestGroupActionRelatedActionComponent();
14272    parseBackboneAttributes(xpp, res);
14273    next(xpp);
14274    int eventType = nextNoWhitespace(xpp);
14275    while (eventType != XmlPullParser.END_TAG) {
14276  if (!parseRequestGroupRequestGroupActionRelatedActionComponentContent(eventType, xpp, owner, res))
14277        unknownContent(xpp);
14278      eventType = nextNoWhitespace(xpp);
14279    }
14280    next(xpp);
14281    parseElementClose(res);
14282    return res;
14283  }
14284
14285  protected boolean parseRequestGroupRequestGroupActionRelatedActionComponentContent(int eventType, XmlPullParser xpp, RequestGroup owner, RequestGroup.RequestGroupActionRelatedActionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
14286      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actionId")) {
14287        res.setActionIdElement(parseId(xpp));
14288      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relationship")) {
14289        res.setRelationshipElement(parseEnumeration(xpp, RequestGroup.ActionRelationshipType.NULL, new RequestGroup.ActionRelationshipTypeEnumFactory()));
14290      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "offset")) {
14291        res.setOffset(parseType("offset", xpp));
14292      } else if (!parseBackboneContent(eventType, xpp, res))
14293        return false;
14294    return true;
14295  }
14296
14297  protected ResearchStudy parseResearchStudy(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
14298    ResearchStudy res = new ResearchStudy();
14299    parseDomainResourceAttributes(xpp, res);
14300    next(xpp);
14301    int eventType = nextNoWhitespace(xpp);
14302    while (eventType != XmlPullParser.END_TAG) {
14303  if (!parseResearchStudyContent(eventType, xpp, res))
14304        unknownContent(xpp);
14305      eventType = nextNoWhitespace(xpp);
14306    }
14307    next(xpp);
14308    parseElementClose(res);
14309    return res;
14310  }
14311
14312  protected boolean parseResearchStudyContent(int eventType, XmlPullParser xpp, ResearchStudy res) throws XmlPullParserException, IOException, FHIRFormatError {
14313      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
14314        res.getIdentifier().add(parseIdentifier(xpp));
14315      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
14316        res.setTitleElement(parseString(xpp));
14317      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("protocol")) {
14318        res.getProtocol().add(parseReference(xpp));
14319      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
14320        res.getPartOf().add(parseReference(xpp));
14321      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
14322        res.setStatusElement(parseEnumeration(xpp, ResearchStudy.ResearchStudyStatus.NULL, new ResearchStudy.ResearchStudyStatusEnumFactory()));
14323      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
14324        res.getCategory().add(parseCodeableConcept(xpp));
14325      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("focus")) {
14326        res.getFocus().add(parseCodeableConcept(xpp));
14327      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
14328        res.getContact().add(parseContactDetail(xpp));
14329      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatedArtifact")) {
14330        res.getRelatedArtifact().add(parseRelatedArtifact(xpp));
14331      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("keyword")) {
14332        res.getKeyword().add(parseCodeableConcept(xpp));
14333      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
14334        res.getJurisdiction().add(parseCodeableConcept(xpp));
14335      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
14336        res.setDescriptionElement(parseMarkdown(xpp));
14337      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("enrollment")) {
14338        res.getEnrollment().add(parseReference(xpp));
14339      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
14340        res.setPeriod(parsePeriod(xpp));
14341      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sponsor")) {
14342        res.setSponsor(parseReference(xpp));
14343      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("principalInvestigator")) {
14344        res.setPrincipalInvestigator(parseReference(xpp));
14345      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("site")) {
14346        res.getSite().add(parseReference(xpp));
14347      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonStopped")) {
14348        res.setReasonStopped(parseCodeableConcept(xpp));
14349      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
14350        res.getNote().add(parseAnnotation(xpp));
14351      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("arm")) {
14352        res.getArm().add(parseResearchStudyResearchStudyArmComponent(xpp, res));
14353      } else if (!parseDomainResourceContent(eventType, xpp, res))
14354        return false;
14355    return true;
14356  }
14357
14358  protected ResearchStudy.ResearchStudyArmComponent parseResearchStudyResearchStudyArmComponent(XmlPullParser xpp, ResearchStudy owner) throws XmlPullParserException, IOException, FHIRFormatError {
14359    ResearchStudy.ResearchStudyArmComponent res = new ResearchStudy.ResearchStudyArmComponent();
14360    parseBackboneAttributes(xpp, res);
14361    next(xpp);
14362    int eventType = nextNoWhitespace(xpp);
14363    while (eventType != XmlPullParser.END_TAG) {
14364  if (!parseResearchStudyResearchStudyArmComponentContent(eventType, xpp, owner, res))
14365        unknownContent(xpp);
14366      eventType = nextNoWhitespace(xpp);
14367    }
14368    next(xpp);
14369    parseElementClose(res);
14370    return res;
14371  }
14372
14373  protected boolean parseResearchStudyResearchStudyArmComponentContent(int eventType, XmlPullParser xpp, ResearchStudy owner, ResearchStudy.ResearchStudyArmComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
14374      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
14375        res.setNameElement(parseString(xpp));
14376      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
14377        res.setCode(parseCodeableConcept(xpp));
14378      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
14379        res.setDescriptionElement(parseString(xpp));
14380      } else if (!parseBackboneContent(eventType, xpp, res))
14381        return false;
14382    return true;
14383  }
14384
14385  protected ResearchSubject parseResearchSubject(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
14386    ResearchSubject res = new ResearchSubject();
14387    parseDomainResourceAttributes(xpp, res);
14388    next(xpp);
14389    int eventType = nextNoWhitespace(xpp);
14390    while (eventType != XmlPullParser.END_TAG) {
14391  if (!parseResearchSubjectContent(eventType, xpp, res))
14392        unknownContent(xpp);
14393      eventType = nextNoWhitespace(xpp);
14394    }
14395    next(xpp);
14396    parseElementClose(res);
14397    return res;
14398  }
14399
14400  protected boolean parseResearchSubjectContent(int eventType, XmlPullParser xpp, ResearchSubject res) throws XmlPullParserException, IOException, FHIRFormatError {
14401      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
14402        res.setIdentifier(parseIdentifier(xpp));
14403      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
14404        res.setStatusElement(parseEnumeration(xpp, ResearchSubject.ResearchSubjectStatus.NULL, new ResearchSubject.ResearchSubjectStatusEnumFactory()));
14405      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
14406        res.setPeriod(parsePeriod(xpp));
14407      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("study")) {
14408        res.setStudy(parseReference(xpp));
14409      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("individual")) {
14410        res.setIndividual(parseReference(xpp));
14411      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("assignedArm")) {
14412        res.setAssignedArmElement(parseString(xpp));
14413      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actualArm")) {
14414        res.setActualArmElement(parseString(xpp));
14415      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("consent")) {
14416        res.setConsent(parseReference(xpp));
14417      } else if (!parseDomainResourceContent(eventType, xpp, res))
14418        return false;
14419    return true;
14420  }
14421
14422  protected RiskAssessment parseRiskAssessment(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
14423    RiskAssessment res = new RiskAssessment();
14424    parseDomainResourceAttributes(xpp, res);
14425    next(xpp);
14426    int eventType = nextNoWhitespace(xpp);
14427    while (eventType != XmlPullParser.END_TAG) {
14428  if (!parseRiskAssessmentContent(eventType, xpp, res))
14429        unknownContent(xpp);
14430      eventType = nextNoWhitespace(xpp);
14431    }
14432    next(xpp);
14433    parseElementClose(res);
14434    return res;
14435  }
14436
14437  protected boolean parseRiskAssessmentContent(int eventType, XmlPullParser xpp, RiskAssessment res) throws XmlPullParserException, IOException, FHIRFormatError {
14438      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
14439        res.setIdentifier(parseIdentifier(xpp));
14440      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
14441        res.setBasedOn(parseReference(xpp));
14442      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("parent")) {
14443        res.setParent(parseReference(xpp));
14444      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
14445        res.setStatusElement(parseEnumeration(xpp, RiskAssessment.RiskAssessmentStatus.NULL, new RiskAssessment.RiskAssessmentStatusEnumFactory()));
14446      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("method")) {
14447        res.setMethod(parseCodeableConcept(xpp));
14448      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
14449        res.setCode(parseCodeableConcept(xpp));
14450      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
14451        res.setSubject(parseReference(xpp));
14452      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
14453        res.setContext(parseReference(xpp));
14454      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "occurrence")) {
14455        res.setOccurrence(parseType("occurrence", xpp));
14456      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("condition")) {
14457        res.setCondition(parseReference(xpp));
14458      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performer")) {
14459        res.setPerformer(parseReference(xpp));
14460      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "reason")) {
14461        res.setReason(parseType("reason", xpp));
14462      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basis")) {
14463        res.getBasis().add(parseReference(xpp));
14464      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prediction")) {
14465        res.getPrediction().add(parseRiskAssessmentRiskAssessmentPredictionComponent(xpp, res));
14466      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mitigation")) {
14467        res.setMitigationElement(parseString(xpp));
14468      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
14469        res.setCommentElement(parseString(xpp));
14470      } else if (!parseDomainResourceContent(eventType, xpp, res))
14471        return false;
14472    return true;
14473  }
14474
14475  protected RiskAssessment.RiskAssessmentPredictionComponent parseRiskAssessmentRiskAssessmentPredictionComponent(XmlPullParser xpp, RiskAssessment owner) throws XmlPullParserException, IOException, FHIRFormatError {
14476    RiskAssessment.RiskAssessmentPredictionComponent res = new RiskAssessment.RiskAssessmentPredictionComponent();
14477    parseBackboneAttributes(xpp, res);
14478    next(xpp);
14479    int eventType = nextNoWhitespace(xpp);
14480    while (eventType != XmlPullParser.END_TAG) {
14481  if (!parseRiskAssessmentRiskAssessmentPredictionComponentContent(eventType, xpp, owner, res))
14482        unknownContent(xpp);
14483      eventType = nextNoWhitespace(xpp);
14484    }
14485    next(xpp);
14486    parseElementClose(res);
14487    return res;
14488  }
14489
14490  protected boolean parseRiskAssessmentRiskAssessmentPredictionComponentContent(int eventType, XmlPullParser xpp, RiskAssessment owner, RiskAssessment.RiskAssessmentPredictionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
14491      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
14492        res.setOutcome(parseCodeableConcept(xpp));
14493      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "probability")) {
14494        res.setProbability(parseType("probability", xpp));
14495      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("qualitativeRisk")) {
14496        res.setQualitativeRisk(parseCodeableConcept(xpp));
14497      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relativeRisk")) {
14498        res.setRelativeRiskElement(parseDecimal(xpp));
14499      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "when")) {
14500        res.setWhen(parseType("when", xpp));
14501      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rationale")) {
14502        res.setRationaleElement(parseString(xpp));
14503      } else if (!parseBackboneContent(eventType, xpp, res))
14504        return false;
14505    return true;
14506  }
14507
14508  protected Schedule parseSchedule(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
14509    Schedule res = new Schedule();
14510    parseDomainResourceAttributes(xpp, res);
14511    next(xpp);
14512    int eventType = nextNoWhitespace(xpp);
14513    while (eventType != XmlPullParser.END_TAG) {
14514  if (!parseScheduleContent(eventType, xpp, res))
14515        unknownContent(xpp);
14516      eventType = nextNoWhitespace(xpp);
14517    }
14518    next(xpp);
14519    parseElementClose(res);
14520    return res;
14521  }
14522
14523  protected boolean parseScheduleContent(int eventType, XmlPullParser xpp, Schedule res) throws XmlPullParserException, IOException, FHIRFormatError {
14524      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
14525        res.getIdentifier().add(parseIdentifier(xpp));
14526      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("active")) {
14527        res.setActiveElement(parseBoolean(xpp));
14528      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("serviceCategory")) {
14529        res.setServiceCategory(parseCodeableConcept(xpp));
14530      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("serviceType")) {
14531        res.getServiceType().add(parseCodeableConcept(xpp));
14532      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specialty")) {
14533        res.getSpecialty().add(parseCodeableConcept(xpp));
14534      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
14535        res.getActor().add(parseReference(xpp));
14536      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("planningHorizon")) {
14537        res.setPlanningHorizon(parsePeriod(xpp));
14538      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
14539        res.setCommentElement(parseString(xpp));
14540      } else if (!parseDomainResourceContent(eventType, xpp, res))
14541        return false;
14542    return true;
14543  }
14544
14545  protected SearchParameter parseSearchParameter(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
14546    SearchParameter res = new SearchParameter();
14547    parseDomainResourceAttributes(xpp, res);
14548    next(xpp);
14549    int eventType = nextNoWhitespace(xpp);
14550    while (eventType != XmlPullParser.END_TAG) {
14551  if (!parseSearchParameterContent(eventType, xpp, res))
14552        unknownContent(xpp);
14553      eventType = nextNoWhitespace(xpp);
14554    }
14555    next(xpp);
14556    parseElementClose(res);
14557    return res;
14558  }
14559
14560  protected boolean parseSearchParameterContent(int eventType, XmlPullParser xpp, SearchParameter res) throws XmlPullParserException, IOException, FHIRFormatError {
14561      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
14562        res.setUrlElement(parseUri(xpp));
14563      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
14564        res.setVersionElement(parseString(xpp));
14565      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
14566        res.setNameElement(parseString(xpp));
14567      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
14568        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
14569      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
14570        res.setExperimentalElement(parseBoolean(xpp));
14571      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
14572        res.setDateElement(parseDateTime(xpp));
14573      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
14574        res.setPublisherElement(parseString(xpp));
14575      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
14576        res.getContact().add(parseContactDetail(xpp));
14577      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
14578        res.getUseContext().add(parseUsageContext(xpp));
14579      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
14580        res.getJurisdiction().add(parseCodeableConcept(xpp));
14581      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
14582        res.setPurposeElement(parseMarkdown(xpp));
14583      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
14584        res.setCodeElement(parseCode(xpp));
14585      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("base")) {
14586        res.getBase().add(parseCode(xpp));
14587      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
14588        res.setTypeElement(parseEnumeration(xpp, Enumerations.SearchParamType.NULL, new Enumerations.SearchParamTypeEnumFactory()));
14589      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("derivedFrom")) {
14590        res.setDerivedFromElement(parseUri(xpp));
14591      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
14592        res.setDescriptionElement(parseMarkdown(xpp));
14593      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expression")) {
14594        res.setExpressionElement(parseString(xpp));
14595      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("xpath")) {
14596        res.setXpathElement(parseString(xpp));
14597      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("xpathUsage")) {
14598        res.setXpathUsageElement(parseEnumeration(xpp, SearchParameter.XPathUsageType.NULL, new SearchParameter.XPathUsageTypeEnumFactory()));
14599      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("target")) {
14600        res.getTarget().add(parseCode(xpp));
14601      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comparator")) {
14602        res.getComparator().add(parseEnumeration(xpp, SearchParameter.SearchComparator.NULL, new SearchParameter.SearchComparatorEnumFactory()));
14603      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
14604        res.getModifier().add(parseEnumeration(xpp, SearchParameter.SearchModifierCode.NULL, new SearchParameter.SearchModifierCodeEnumFactory()));
14605      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("chain")) {
14606        res.getChain().add(parseString(xpp));
14607      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("component")) {
14608        res.getComponent().add(parseSearchParameterSearchParameterComponentComponent(xpp, res));
14609      } else if (!parseDomainResourceContent(eventType, xpp, res))
14610        return false;
14611    return true;
14612  }
14613
14614  protected SearchParameter.SearchParameterComponentComponent parseSearchParameterSearchParameterComponentComponent(XmlPullParser xpp, SearchParameter owner) throws XmlPullParserException, IOException, FHIRFormatError {
14615    SearchParameter.SearchParameterComponentComponent res = new SearchParameter.SearchParameterComponentComponent();
14616    parseBackboneAttributes(xpp, res);
14617    next(xpp);
14618    int eventType = nextNoWhitespace(xpp);
14619    while (eventType != XmlPullParser.END_TAG) {
14620  if (!parseSearchParameterSearchParameterComponentComponentContent(eventType, xpp, owner, res))
14621        unknownContent(xpp);
14622      eventType = nextNoWhitespace(xpp);
14623    }
14624    next(xpp);
14625    parseElementClose(res);
14626    return res;
14627  }
14628
14629  protected boolean parseSearchParameterSearchParameterComponentComponentContent(int eventType, XmlPullParser xpp, SearchParameter owner, SearchParameter.SearchParameterComponentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
14630      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
14631        res.setDefinition(parseReference(xpp));
14632      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expression")) {
14633        res.setExpressionElement(parseString(xpp));
14634      } else if (!parseBackboneContent(eventType, xpp, res))
14635        return false;
14636    return true;
14637  }
14638
14639  protected Sequence parseSequence(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
14640    Sequence res = new Sequence();
14641    parseDomainResourceAttributes(xpp, res);
14642    next(xpp);
14643    int eventType = nextNoWhitespace(xpp);
14644    while (eventType != XmlPullParser.END_TAG) {
14645  if (!parseSequenceContent(eventType, xpp, res))
14646        unknownContent(xpp);
14647      eventType = nextNoWhitespace(xpp);
14648    }
14649    next(xpp);
14650    parseElementClose(res);
14651    return res;
14652  }
14653
14654  protected boolean parseSequenceContent(int eventType, XmlPullParser xpp, Sequence res) throws XmlPullParserException, IOException, FHIRFormatError {
14655      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
14656        res.getIdentifier().add(parseIdentifier(xpp));
14657      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
14658        res.setTypeElement(parseEnumeration(xpp, Sequence.SequenceType.NULL, new Sequence.SequenceTypeEnumFactory()));
14659      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coordinateSystem")) {
14660        res.setCoordinateSystemElement(parseInteger(xpp));
14661      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
14662        res.setPatient(parseReference(xpp));
14663      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specimen")) {
14664        res.setSpecimen(parseReference(xpp));
14665      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("device")) {
14666        res.setDevice(parseReference(xpp));
14667      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performer")) {
14668        res.setPerformer(parseReference(xpp));
14669      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
14670        res.setQuantity(parseQuantity(xpp));
14671      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referenceSeq")) {
14672        res.setReferenceSeq(parseSequenceSequenceReferenceSeqComponent(xpp, res));
14673      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("variant")) {
14674        res.getVariant().add(parseSequenceSequenceVariantComponent(xpp, res));
14675      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("observedSeq")) {
14676        res.setObservedSeqElement(parseString(xpp));
14677      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quality")) {
14678        res.getQuality().add(parseSequenceSequenceQualityComponent(xpp, res));
14679      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("readCoverage")) {
14680        res.setReadCoverageElement(parseInteger(xpp));
14681      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("repository")) {
14682        res.getRepository().add(parseSequenceSequenceRepositoryComponent(xpp, res));
14683      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("pointer")) {
14684        res.getPointer().add(parseReference(xpp));
14685      } else if (!parseDomainResourceContent(eventType, xpp, res))
14686        return false;
14687    return true;
14688  }
14689
14690  protected Sequence.SequenceReferenceSeqComponent parseSequenceSequenceReferenceSeqComponent(XmlPullParser xpp, Sequence owner) throws XmlPullParserException, IOException, FHIRFormatError {
14691    Sequence.SequenceReferenceSeqComponent res = new Sequence.SequenceReferenceSeqComponent();
14692    parseBackboneAttributes(xpp, res);
14693    next(xpp);
14694    int eventType = nextNoWhitespace(xpp);
14695    while (eventType != XmlPullParser.END_TAG) {
14696  if (!parseSequenceSequenceReferenceSeqComponentContent(eventType, xpp, owner, res))
14697        unknownContent(xpp);
14698      eventType = nextNoWhitespace(xpp);
14699    }
14700    next(xpp);
14701    parseElementClose(res);
14702    return res;
14703  }
14704
14705  protected boolean parseSequenceSequenceReferenceSeqComponentContent(int eventType, XmlPullParser xpp, Sequence owner, Sequence.SequenceReferenceSeqComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
14706      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("chromosome")) {
14707        res.setChromosome(parseCodeableConcept(xpp));
14708      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("genomeBuild")) {
14709        res.setGenomeBuildElement(parseString(xpp));
14710      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referenceSeqId")) {
14711        res.setReferenceSeqId(parseCodeableConcept(xpp));
14712      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referenceSeqPointer")) {
14713        res.setReferenceSeqPointer(parseReference(xpp));
14714      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referenceSeqString")) {
14715        res.setReferenceSeqStringElement(parseString(xpp));
14716      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("strand")) {
14717        res.setStrandElement(parseInteger(xpp));
14718      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("windowStart")) {
14719        res.setWindowStartElement(parseInteger(xpp));
14720      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("windowEnd")) {
14721        res.setWindowEndElement(parseInteger(xpp));
14722      } else if (!parseBackboneContent(eventType, xpp, res))
14723        return false;
14724    return true;
14725  }
14726
14727  protected Sequence.SequenceVariantComponent parseSequenceSequenceVariantComponent(XmlPullParser xpp, Sequence owner) throws XmlPullParserException, IOException, FHIRFormatError {
14728    Sequence.SequenceVariantComponent res = new Sequence.SequenceVariantComponent();
14729    parseBackboneAttributes(xpp, res);
14730    next(xpp);
14731    int eventType = nextNoWhitespace(xpp);
14732    while (eventType != XmlPullParser.END_TAG) {
14733  if (!parseSequenceSequenceVariantComponentContent(eventType, xpp, owner, res))
14734        unknownContent(xpp);
14735      eventType = nextNoWhitespace(xpp);
14736    }
14737    next(xpp);
14738    parseElementClose(res);
14739    return res;
14740  }
14741
14742  protected boolean parseSequenceSequenceVariantComponentContent(int eventType, XmlPullParser xpp, Sequence owner, Sequence.SequenceVariantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
14743      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("start")) {
14744        res.setStartElement(parseInteger(xpp));
14745      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("end")) {
14746        res.setEndElement(parseInteger(xpp));
14747      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("observedAllele")) {
14748        res.setObservedAlleleElement(parseString(xpp));
14749      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referenceAllele")) {
14750        res.setReferenceAlleleElement(parseString(xpp));
14751      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("cigar")) {
14752        res.setCigarElement(parseString(xpp));
14753      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("variantPointer")) {
14754        res.setVariantPointer(parseReference(xpp));
14755      } else if (!parseBackboneContent(eventType, xpp, res))
14756        return false;
14757    return true;
14758  }
14759
14760  protected Sequence.SequenceQualityComponent parseSequenceSequenceQualityComponent(XmlPullParser xpp, Sequence owner) throws XmlPullParserException, IOException, FHIRFormatError {
14761    Sequence.SequenceQualityComponent res = new Sequence.SequenceQualityComponent();
14762    parseBackboneAttributes(xpp, res);
14763    next(xpp);
14764    int eventType = nextNoWhitespace(xpp);
14765    while (eventType != XmlPullParser.END_TAG) {
14766  if (!parseSequenceSequenceQualityComponentContent(eventType, xpp, owner, res))
14767        unknownContent(xpp);
14768      eventType = nextNoWhitespace(xpp);
14769    }
14770    next(xpp);
14771    parseElementClose(res);
14772    return res;
14773  }
14774
14775  protected boolean parseSequenceSequenceQualityComponentContent(int eventType, XmlPullParser xpp, Sequence owner, Sequence.SequenceQualityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
14776      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
14777        res.setTypeElement(parseEnumeration(xpp, Sequence.QualityType.NULL, new Sequence.QualityTypeEnumFactory()));
14778      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("standardSequence")) {
14779        res.setStandardSequence(parseCodeableConcept(xpp));
14780      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("start")) {
14781        res.setStartElement(parseInteger(xpp));
14782      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("end")) {
14783        res.setEndElement(parseInteger(xpp));
14784      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("score")) {
14785        res.setScore(parseQuantity(xpp));
14786      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("method")) {
14787        res.setMethod(parseCodeableConcept(xpp));
14788      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("truthTP")) {
14789        res.setTruthTPElement(parseDecimal(xpp));
14790      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("queryTP")) {
14791        res.setQueryTPElement(parseDecimal(xpp));
14792      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("truthFN")) {
14793        res.setTruthFNElement(parseDecimal(xpp));
14794      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("queryFP")) {
14795        res.setQueryFPElement(parseDecimal(xpp));
14796      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("gtFP")) {
14797        res.setGtFPElement(parseDecimal(xpp));
14798      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("precision")) {
14799        res.setPrecisionElement(parseDecimal(xpp));
14800      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recall")) {
14801        res.setRecallElement(parseDecimal(xpp));
14802      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fScore")) {
14803        res.setFScoreElement(parseDecimal(xpp));
14804      } else if (!parseBackboneContent(eventType, xpp, res))
14805        return false;
14806    return true;
14807  }
14808
14809  protected Sequence.SequenceRepositoryComponent parseSequenceSequenceRepositoryComponent(XmlPullParser xpp, Sequence owner) throws XmlPullParserException, IOException, FHIRFormatError {
14810    Sequence.SequenceRepositoryComponent res = new Sequence.SequenceRepositoryComponent();
14811    parseBackboneAttributes(xpp, res);
14812    next(xpp);
14813    int eventType = nextNoWhitespace(xpp);
14814    while (eventType != XmlPullParser.END_TAG) {
14815  if (!parseSequenceSequenceRepositoryComponentContent(eventType, xpp, owner, res))
14816        unknownContent(xpp);
14817      eventType = nextNoWhitespace(xpp);
14818    }
14819    next(xpp);
14820    parseElementClose(res);
14821    return res;
14822  }
14823
14824  protected boolean parseSequenceSequenceRepositoryComponentContent(int eventType, XmlPullParser xpp, Sequence owner, Sequence.SequenceRepositoryComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
14825      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
14826        res.setTypeElement(parseEnumeration(xpp, Sequence.RepositoryType.NULL, new Sequence.RepositoryTypeEnumFactory()));
14827      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
14828        res.setUrlElement(parseUri(xpp));
14829      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
14830        res.setNameElement(parseString(xpp));
14831      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("datasetId")) {
14832        res.setDatasetIdElement(parseString(xpp));
14833      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("variantsetId")) {
14834        res.setVariantsetIdElement(parseString(xpp));
14835      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("readsetId")) {
14836        res.setReadsetIdElement(parseString(xpp));
14837      } else if (!parseBackboneContent(eventType, xpp, res))
14838        return false;
14839    return true;
14840  }
14841
14842  protected ServiceDefinition parseServiceDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
14843    ServiceDefinition res = new ServiceDefinition();
14844    parseDomainResourceAttributes(xpp, res);
14845    next(xpp);
14846    int eventType = nextNoWhitespace(xpp);
14847    while (eventType != XmlPullParser.END_TAG) {
14848  if (!parseServiceDefinitionContent(eventType, xpp, res))
14849        unknownContent(xpp);
14850      eventType = nextNoWhitespace(xpp);
14851    }
14852    next(xpp);
14853    parseElementClose(res);
14854    return res;
14855  }
14856
14857  protected boolean parseServiceDefinitionContent(int eventType, XmlPullParser xpp, ServiceDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
14858      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
14859        res.setUrlElement(parseUri(xpp));
14860      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
14861        res.getIdentifier().add(parseIdentifier(xpp));
14862      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
14863        res.setVersionElement(parseString(xpp));
14864      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
14865        res.setNameElement(parseString(xpp));
14866      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
14867        res.setTitleElement(parseString(xpp));
14868      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
14869        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
14870      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
14871        res.setExperimentalElement(parseBoolean(xpp));
14872      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
14873        res.setDateElement(parseDateTime(xpp));
14874      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
14875        res.setPublisherElement(parseString(xpp));
14876      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
14877        res.setDescriptionElement(parseMarkdown(xpp));
14878      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
14879        res.setPurposeElement(parseMarkdown(xpp));
14880      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("usage")) {
14881        res.setUsageElement(parseString(xpp));
14882      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("approvalDate")) {
14883        res.setApprovalDateElement(parseDate(xpp));
14884      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastReviewDate")) {
14885        res.setLastReviewDateElement(parseDate(xpp));
14886      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("effectivePeriod")) {
14887        res.setEffectivePeriod(parsePeriod(xpp));
14888      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
14889        res.getUseContext().add(parseUsageContext(xpp));
14890      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
14891        res.getJurisdiction().add(parseCodeableConcept(xpp));
14892      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("topic")) {
14893        res.getTopic().add(parseCodeableConcept(xpp));
14894      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contributor")) {
14895        res.getContributor().add(parseContributor(xpp));
14896      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
14897        res.getContact().add(parseContactDetail(xpp));
14898      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
14899        res.setCopyrightElement(parseMarkdown(xpp));
14900      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatedArtifact")) {
14901        res.getRelatedArtifact().add(parseRelatedArtifact(xpp));
14902      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("trigger")) {
14903        res.getTrigger().add(parseTriggerDefinition(xpp));
14904      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dataRequirement")) {
14905        res.getDataRequirement().add(parseDataRequirement(xpp));
14906      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operationDefinition")) {
14907        res.setOperationDefinition(parseReference(xpp));
14908      } else if (!parseDomainResourceContent(eventType, xpp, res))
14909        return false;
14910    return true;
14911  }
14912
14913  protected Slot parseSlot(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
14914    Slot res = new Slot();
14915    parseDomainResourceAttributes(xpp, res);
14916    next(xpp);
14917    int eventType = nextNoWhitespace(xpp);
14918    while (eventType != XmlPullParser.END_TAG) {
14919  if (!parseSlotContent(eventType, xpp, res))
14920        unknownContent(xpp);
14921      eventType = nextNoWhitespace(xpp);
14922    }
14923    next(xpp);
14924    parseElementClose(res);
14925    return res;
14926  }
14927
14928  protected boolean parseSlotContent(int eventType, XmlPullParser xpp, Slot res) throws XmlPullParserException, IOException, FHIRFormatError {
14929      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
14930        res.getIdentifier().add(parseIdentifier(xpp));
14931      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("serviceCategory")) {
14932        res.setServiceCategory(parseCodeableConcept(xpp));
14933      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("serviceType")) {
14934        res.getServiceType().add(parseCodeableConcept(xpp));
14935      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specialty")) {
14936        res.getSpecialty().add(parseCodeableConcept(xpp));
14937      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("appointmentType")) {
14938        res.setAppointmentType(parseCodeableConcept(xpp));
14939      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("schedule")) {
14940        res.setSchedule(parseReference(xpp));
14941      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
14942        res.setStatusElement(parseEnumeration(xpp, Slot.SlotStatus.NULL, new Slot.SlotStatusEnumFactory()));
14943      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("start")) {
14944        res.setStartElement(parseInstant(xpp));
14945      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("end")) {
14946        res.setEndElement(parseInstant(xpp));
14947      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("overbooked")) {
14948        res.setOverbookedElement(parseBoolean(xpp));
14949      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
14950        res.setCommentElement(parseString(xpp));
14951      } else if (!parseDomainResourceContent(eventType, xpp, res))
14952        return false;
14953    return true;
14954  }
14955
14956  protected Specimen parseSpecimen(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
14957    Specimen res = new Specimen();
14958    parseDomainResourceAttributes(xpp, res);
14959    next(xpp);
14960    int eventType = nextNoWhitespace(xpp);
14961    while (eventType != XmlPullParser.END_TAG) {
14962  if (!parseSpecimenContent(eventType, xpp, res))
14963        unknownContent(xpp);
14964      eventType = nextNoWhitespace(xpp);
14965    }
14966    next(xpp);
14967    parseElementClose(res);
14968    return res;
14969  }
14970
14971  protected boolean parseSpecimenContent(int eventType, XmlPullParser xpp, Specimen res) throws XmlPullParserException, IOException, FHIRFormatError {
14972      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
14973        res.getIdentifier().add(parseIdentifier(xpp));
14974      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("accessionIdentifier")) {
14975        res.setAccessionIdentifier(parseIdentifier(xpp));
14976      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
14977        res.setStatusElement(parseEnumeration(xpp, Specimen.SpecimenStatus.NULL, new Specimen.SpecimenStatusEnumFactory()));
14978      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
14979        res.setType(parseCodeableConcept(xpp));
14980      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
14981        res.setSubject(parseReference(xpp));
14982      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("receivedTime")) {
14983        res.setReceivedTimeElement(parseDateTime(xpp));
14984      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("parent")) {
14985        res.getParent().add(parseReference(xpp));
14986      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
14987        res.getRequest().add(parseReference(xpp));
14988      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("collection")) {
14989        res.setCollection(parseSpecimenSpecimenCollectionComponent(xpp, res));
14990      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("processing")) {
14991        res.getProcessing().add(parseSpecimenSpecimenProcessingComponent(xpp, res));
14992      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("container")) {
14993        res.getContainer().add(parseSpecimenSpecimenContainerComponent(xpp, res));
14994      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
14995        res.getNote().add(parseAnnotation(xpp));
14996      } else if (!parseDomainResourceContent(eventType, xpp, res))
14997        return false;
14998    return true;
14999  }
15000
15001  protected Specimen.SpecimenCollectionComponent parseSpecimenSpecimenCollectionComponent(XmlPullParser xpp, Specimen owner) throws XmlPullParserException, IOException, FHIRFormatError {
15002    Specimen.SpecimenCollectionComponent res = new Specimen.SpecimenCollectionComponent();
15003    parseBackboneAttributes(xpp, res);
15004    next(xpp);
15005    int eventType = nextNoWhitespace(xpp);
15006    while (eventType != XmlPullParser.END_TAG) {
15007  if (!parseSpecimenSpecimenCollectionComponentContent(eventType, xpp, owner, res))
15008        unknownContent(xpp);
15009      eventType = nextNoWhitespace(xpp);
15010    }
15011    next(xpp);
15012    parseElementClose(res);
15013    return res;
15014  }
15015
15016  protected boolean parseSpecimenSpecimenCollectionComponentContent(int eventType, XmlPullParser xpp, Specimen owner, Specimen.SpecimenCollectionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
15017      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("collector")) {
15018        res.setCollector(parseReference(xpp));
15019      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "collected")) {
15020        res.setCollected(parseType("collected", xpp));
15021      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
15022        res.setQuantity(parseSimpleQuantity(xpp));
15023      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("method")) {
15024        res.setMethod(parseCodeableConcept(xpp));
15025      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodySite")) {
15026        res.setBodySite(parseCodeableConcept(xpp));
15027      } else if (!parseBackboneContent(eventType, xpp, res))
15028        return false;
15029    return true;
15030  }
15031
15032  protected Specimen.SpecimenProcessingComponent parseSpecimenSpecimenProcessingComponent(XmlPullParser xpp, Specimen owner) throws XmlPullParserException, IOException, FHIRFormatError {
15033    Specimen.SpecimenProcessingComponent res = new Specimen.SpecimenProcessingComponent();
15034    parseBackboneAttributes(xpp, res);
15035    next(xpp);
15036    int eventType = nextNoWhitespace(xpp);
15037    while (eventType != XmlPullParser.END_TAG) {
15038  if (!parseSpecimenSpecimenProcessingComponentContent(eventType, xpp, owner, res))
15039        unknownContent(xpp);
15040      eventType = nextNoWhitespace(xpp);
15041    }
15042    next(xpp);
15043    parseElementClose(res);
15044    return res;
15045  }
15046
15047  protected boolean parseSpecimenSpecimenProcessingComponentContent(int eventType, XmlPullParser xpp, Specimen owner, Specimen.SpecimenProcessingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
15048      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
15049        res.setDescriptionElement(parseString(xpp));
15050      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("procedure")) {
15051        res.setProcedure(parseCodeableConcept(xpp));
15052      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("additive")) {
15053        res.getAdditive().add(parseReference(xpp));
15054      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "time")) {
15055        res.setTime(parseType("time", xpp));
15056      } else if (!parseBackboneContent(eventType, xpp, res))
15057        return false;
15058    return true;
15059  }
15060
15061  protected Specimen.SpecimenContainerComponent parseSpecimenSpecimenContainerComponent(XmlPullParser xpp, Specimen owner) throws XmlPullParserException, IOException, FHIRFormatError {
15062    Specimen.SpecimenContainerComponent res = new Specimen.SpecimenContainerComponent();
15063    parseBackboneAttributes(xpp, res);
15064    next(xpp);
15065    int eventType = nextNoWhitespace(xpp);
15066    while (eventType != XmlPullParser.END_TAG) {
15067  if (!parseSpecimenSpecimenContainerComponentContent(eventType, xpp, owner, res))
15068        unknownContent(xpp);
15069      eventType = nextNoWhitespace(xpp);
15070    }
15071    next(xpp);
15072    parseElementClose(res);
15073    return res;
15074  }
15075
15076  protected boolean parseSpecimenSpecimenContainerComponentContent(int eventType, XmlPullParser xpp, Specimen owner, Specimen.SpecimenContainerComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
15077      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
15078        res.getIdentifier().add(parseIdentifier(xpp));
15079      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
15080        res.setDescriptionElement(parseString(xpp));
15081      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
15082        res.setType(parseCodeableConcept(xpp));
15083      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("capacity")) {
15084        res.setCapacity(parseSimpleQuantity(xpp));
15085      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specimenQuantity")) {
15086        res.setSpecimenQuantity(parseSimpleQuantity(xpp));
15087      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "additive")) {
15088        res.setAdditive(parseType("additive", xpp));
15089      } else if (!parseBackboneContent(eventType, xpp, res))
15090        return false;
15091    return true;
15092  }
15093
15094  protected StructureDefinition parseStructureDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
15095    StructureDefinition res = new StructureDefinition();
15096    parseDomainResourceAttributes(xpp, res);
15097    next(xpp);
15098    int eventType = nextNoWhitespace(xpp);
15099    while (eventType != XmlPullParser.END_TAG) {
15100  if (!parseStructureDefinitionContent(eventType, xpp, res))
15101        unknownContent(xpp);
15102      eventType = nextNoWhitespace(xpp);
15103    }
15104    next(xpp);
15105    parseElementClose(res);
15106    return res;
15107  }
15108
15109  protected boolean parseStructureDefinitionContent(int eventType, XmlPullParser xpp, StructureDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
15110      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
15111        res.setUrlElement(parseUri(xpp));
15112      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
15113        res.getIdentifier().add(parseIdentifier(xpp));
15114      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
15115        res.setVersionElement(parseString(xpp));
15116      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
15117        res.setNameElement(parseString(xpp));
15118      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
15119        res.setTitleElement(parseString(xpp));
15120      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
15121        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
15122      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
15123        res.setExperimentalElement(parseBoolean(xpp));
15124      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
15125        res.setDateElement(parseDateTime(xpp));
15126      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
15127        res.setPublisherElement(parseString(xpp));
15128      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
15129        res.getContact().add(parseContactDetail(xpp));
15130      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
15131        res.setDescriptionElement(parseMarkdown(xpp));
15132      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
15133        res.getUseContext().add(parseUsageContext(xpp));
15134      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
15135        res.getJurisdiction().add(parseCodeableConcept(xpp));
15136      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
15137        res.setPurposeElement(parseMarkdown(xpp));
15138      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
15139        res.setCopyrightElement(parseMarkdown(xpp));
15140      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("keyword")) {
15141        res.getKeyword().add(parseCoding(xpp));
15142      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fhirVersion")) {
15143        res.setFhirVersionElement(parseId(xpp));
15144      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mapping")) {
15145        res.getMapping().add(parseStructureDefinitionStructureDefinitionMappingComponent(xpp, res));
15146      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("kind")) {
15147        res.setKindElement(parseEnumeration(xpp, StructureDefinition.StructureDefinitionKind.NULL, new StructureDefinition.StructureDefinitionKindEnumFactory()));
15148      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("abstract")) {
15149        res.setAbstractElement(parseBoolean(xpp));
15150      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contextType")) {
15151        res.setContextTypeElement(parseEnumeration(xpp, StructureDefinition.ExtensionContext.NULL, new StructureDefinition.ExtensionContextEnumFactory()));
15152      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
15153        res.getContext().add(parseString(xpp));
15154      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contextInvariant")) {
15155        res.getContextInvariant().add(parseString(xpp));
15156      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
15157        res.setTypeElement(parseCode(xpp));
15158      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("baseDefinition")) {
15159        res.setBaseDefinitionElement(parseUri(xpp));
15160      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("derivation")) {
15161        res.setDerivationElement(parseEnumeration(xpp, StructureDefinition.TypeDerivationRule.NULL, new StructureDefinition.TypeDerivationRuleEnumFactory()));
15162      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("snapshot")) {
15163        res.setSnapshot(parseStructureDefinitionStructureDefinitionSnapshotComponent(xpp, res));
15164      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("differential")) {
15165        res.setDifferential(parseStructureDefinitionStructureDefinitionDifferentialComponent(xpp, res));
15166      } else if (!parseDomainResourceContent(eventType, xpp, res))
15167        return false;
15168    return true;
15169  }
15170
15171  protected StructureDefinition.StructureDefinitionMappingComponent parseStructureDefinitionStructureDefinitionMappingComponent(XmlPullParser xpp, StructureDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
15172    StructureDefinition.StructureDefinitionMappingComponent res = new StructureDefinition.StructureDefinitionMappingComponent();
15173    parseBackboneAttributes(xpp, res);
15174    next(xpp);
15175    int eventType = nextNoWhitespace(xpp);
15176    while (eventType != XmlPullParser.END_TAG) {
15177  if (!parseStructureDefinitionStructureDefinitionMappingComponentContent(eventType, xpp, owner, res))
15178        unknownContent(xpp);
15179      eventType = nextNoWhitespace(xpp);
15180    }
15181    next(xpp);
15182    parseElementClose(res);
15183    return res;
15184  }
15185
15186  protected boolean parseStructureDefinitionStructureDefinitionMappingComponentContent(int eventType, XmlPullParser xpp, StructureDefinition owner, StructureDefinition.StructureDefinitionMappingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
15187      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identity")) {
15188        res.setIdentityElement(parseId(xpp));
15189      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("uri")) {
15190        res.setUriElement(parseUri(xpp));
15191      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
15192        res.setNameElement(parseString(xpp));
15193      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
15194        res.setCommentElement(parseString(xpp));
15195      } else if (!parseBackboneContent(eventType, xpp, res))
15196        return false;
15197    return true;
15198  }
15199
15200  protected StructureDefinition.StructureDefinitionSnapshotComponent parseStructureDefinitionStructureDefinitionSnapshotComponent(XmlPullParser xpp, StructureDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
15201    StructureDefinition.StructureDefinitionSnapshotComponent res = new StructureDefinition.StructureDefinitionSnapshotComponent();
15202    parseBackboneAttributes(xpp, res);
15203    next(xpp);
15204    int eventType = nextNoWhitespace(xpp);
15205    while (eventType != XmlPullParser.END_TAG) {
15206  if (!parseStructureDefinitionStructureDefinitionSnapshotComponentContent(eventType, xpp, owner, res))
15207        unknownContent(xpp);
15208      eventType = nextNoWhitespace(xpp);
15209    }
15210    next(xpp);
15211    parseElementClose(res);
15212    return res;
15213  }
15214
15215  protected boolean parseStructureDefinitionStructureDefinitionSnapshotComponentContent(int eventType, XmlPullParser xpp, StructureDefinition owner, StructureDefinition.StructureDefinitionSnapshotComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
15216      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("element")) {
15217        res.getElement().add(parseElementDefinition(xpp));
15218      } else if (!parseBackboneContent(eventType, xpp, res))
15219        return false;
15220    return true;
15221  }
15222
15223  protected StructureDefinition.StructureDefinitionDifferentialComponent parseStructureDefinitionStructureDefinitionDifferentialComponent(XmlPullParser xpp, StructureDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
15224    StructureDefinition.StructureDefinitionDifferentialComponent res = new StructureDefinition.StructureDefinitionDifferentialComponent();
15225    parseBackboneAttributes(xpp, res);
15226    next(xpp);
15227    int eventType = nextNoWhitespace(xpp);
15228    while (eventType != XmlPullParser.END_TAG) {
15229  if (!parseStructureDefinitionStructureDefinitionDifferentialComponentContent(eventType, xpp, owner, res))
15230        unknownContent(xpp);
15231      eventType = nextNoWhitespace(xpp);
15232    }
15233    next(xpp);
15234    parseElementClose(res);
15235    return res;
15236  }
15237
15238  protected boolean parseStructureDefinitionStructureDefinitionDifferentialComponentContent(int eventType, XmlPullParser xpp, StructureDefinition owner, StructureDefinition.StructureDefinitionDifferentialComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
15239      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("element")) {
15240        res.getElement().add(parseElementDefinition(xpp));
15241      } else if (!parseBackboneContent(eventType, xpp, res))
15242        return false;
15243    return true;
15244  }
15245
15246  protected StructureMap parseStructureMap(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
15247    StructureMap res = new StructureMap();
15248    parseDomainResourceAttributes(xpp, res);
15249    next(xpp);
15250    int eventType = nextNoWhitespace(xpp);
15251    while (eventType != XmlPullParser.END_TAG) {
15252  if (!parseStructureMapContent(eventType, xpp, res))
15253        unknownContent(xpp);
15254      eventType = nextNoWhitespace(xpp);
15255    }
15256    next(xpp);
15257    parseElementClose(res);
15258    return res;
15259  }
15260
15261  protected boolean parseStructureMapContent(int eventType, XmlPullParser xpp, StructureMap res) throws XmlPullParserException, IOException, FHIRFormatError {
15262      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
15263        res.setUrlElement(parseUri(xpp));
15264      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
15265        res.getIdentifier().add(parseIdentifier(xpp));
15266      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
15267        res.setVersionElement(parseString(xpp));
15268      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
15269        res.setNameElement(parseString(xpp));
15270      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
15271        res.setTitleElement(parseString(xpp));
15272      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
15273        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
15274      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
15275        res.setExperimentalElement(parseBoolean(xpp));
15276      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
15277        res.setDateElement(parseDateTime(xpp));
15278      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
15279        res.setPublisherElement(parseString(xpp));
15280      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
15281        res.getContact().add(parseContactDetail(xpp));
15282      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
15283        res.setDescriptionElement(parseMarkdown(xpp));
15284      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
15285        res.getUseContext().add(parseUsageContext(xpp));
15286      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
15287        res.getJurisdiction().add(parseCodeableConcept(xpp));
15288      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
15289        res.setPurposeElement(parseMarkdown(xpp));
15290      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
15291        res.setCopyrightElement(parseMarkdown(xpp));
15292      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("structure")) {
15293        res.getStructure().add(parseStructureMapStructureMapStructureComponent(xpp, res));
15294      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("import")) {
15295        res.getImport().add(parseUri(xpp));
15296      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("group")) {
15297        res.getGroup().add(parseStructureMapStructureMapGroupComponent(xpp, res));
15298      } else if (!parseDomainResourceContent(eventType, xpp, res))
15299        return false;
15300    return true;
15301  }
15302
15303  protected StructureMap.StructureMapStructureComponent parseStructureMapStructureMapStructureComponent(XmlPullParser xpp, StructureMap owner) throws XmlPullParserException, IOException, FHIRFormatError {
15304    StructureMap.StructureMapStructureComponent res = new StructureMap.StructureMapStructureComponent();
15305    parseBackboneAttributes(xpp, res);
15306    next(xpp);
15307    int eventType = nextNoWhitespace(xpp);
15308    while (eventType != XmlPullParser.END_TAG) {
15309  if (!parseStructureMapStructureMapStructureComponentContent(eventType, xpp, owner, res))
15310        unknownContent(xpp);
15311      eventType = nextNoWhitespace(xpp);
15312    }
15313    next(xpp);
15314    parseElementClose(res);
15315    return res;
15316  }
15317
15318  protected boolean parseStructureMapStructureMapStructureComponentContent(int eventType, XmlPullParser xpp, StructureMap owner, StructureMap.StructureMapStructureComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
15319      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
15320        res.setUrlElement(parseUri(xpp));
15321      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
15322        res.setModeElement(parseEnumeration(xpp, StructureMap.StructureMapModelMode.NULL, new StructureMap.StructureMapModelModeEnumFactory()));
15323      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("alias")) {
15324        res.setAliasElement(parseString(xpp));
15325      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
15326        res.setDocumentationElement(parseString(xpp));
15327      } else if (!parseBackboneContent(eventType, xpp, res))
15328        return false;
15329    return true;
15330  }
15331
15332  protected StructureMap.StructureMapGroupComponent parseStructureMapStructureMapGroupComponent(XmlPullParser xpp, StructureMap owner) throws XmlPullParserException, IOException, FHIRFormatError {
15333    StructureMap.StructureMapGroupComponent res = new StructureMap.StructureMapGroupComponent();
15334    parseBackboneAttributes(xpp, res);
15335    next(xpp);
15336    int eventType = nextNoWhitespace(xpp);
15337    while (eventType != XmlPullParser.END_TAG) {
15338  if (!parseStructureMapStructureMapGroupComponentContent(eventType, xpp, owner, res))
15339        unknownContent(xpp);
15340      eventType = nextNoWhitespace(xpp);
15341    }
15342    next(xpp);
15343    parseElementClose(res);
15344    return res;
15345  }
15346
15347  protected boolean parseStructureMapStructureMapGroupComponentContent(int eventType, XmlPullParser xpp, StructureMap owner, StructureMap.StructureMapGroupComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
15348      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
15349        res.setNameElement(parseId(xpp));
15350      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("extends")) {
15351        res.setExtendsElement(parseId(xpp));
15352      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("typeMode")) {
15353        res.setTypeModeElement(parseEnumeration(xpp, StructureMap.StructureMapGroupTypeMode.NULL, new StructureMap.StructureMapGroupTypeModeEnumFactory()));
15354      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
15355        res.setDocumentationElement(parseString(xpp));
15356      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("input")) {
15357        res.getInput().add(parseStructureMapStructureMapGroupInputComponent(xpp, owner));
15358      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rule")) {
15359        res.getRule().add(parseStructureMapStructureMapGroupRuleComponent(xpp, owner));
15360      } else if (!parseBackboneContent(eventType, xpp, res))
15361        return false;
15362    return true;
15363  }
15364
15365  protected StructureMap.StructureMapGroupInputComponent parseStructureMapStructureMapGroupInputComponent(XmlPullParser xpp, StructureMap owner) throws XmlPullParserException, IOException, FHIRFormatError {
15366    StructureMap.StructureMapGroupInputComponent res = new StructureMap.StructureMapGroupInputComponent();
15367    parseBackboneAttributes(xpp, res);
15368    next(xpp);
15369    int eventType = nextNoWhitespace(xpp);
15370    while (eventType != XmlPullParser.END_TAG) {
15371  if (!parseStructureMapStructureMapGroupInputComponentContent(eventType, xpp, owner, res))
15372        unknownContent(xpp);
15373      eventType = nextNoWhitespace(xpp);
15374    }
15375    next(xpp);
15376    parseElementClose(res);
15377    return res;
15378  }
15379
15380  protected boolean parseStructureMapStructureMapGroupInputComponentContent(int eventType, XmlPullParser xpp, StructureMap owner, StructureMap.StructureMapGroupInputComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
15381      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
15382        res.setNameElement(parseId(xpp));
15383      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
15384        res.setTypeElement(parseString(xpp));
15385      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
15386        res.setModeElement(parseEnumeration(xpp, StructureMap.StructureMapInputMode.NULL, new StructureMap.StructureMapInputModeEnumFactory()));
15387      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
15388        res.setDocumentationElement(parseString(xpp));
15389      } else if (!parseBackboneContent(eventType, xpp, res))
15390        return false;
15391    return true;
15392  }
15393
15394  protected StructureMap.StructureMapGroupRuleComponent parseStructureMapStructureMapGroupRuleComponent(XmlPullParser xpp, StructureMap owner) throws XmlPullParserException, IOException, FHIRFormatError {
15395    StructureMap.StructureMapGroupRuleComponent res = new StructureMap.StructureMapGroupRuleComponent();
15396    parseBackboneAttributes(xpp, res);
15397    next(xpp);
15398    int eventType = nextNoWhitespace(xpp);
15399    while (eventType != XmlPullParser.END_TAG) {
15400  if (!parseStructureMapStructureMapGroupRuleComponentContent(eventType, xpp, owner, res))
15401        unknownContent(xpp);
15402      eventType = nextNoWhitespace(xpp);
15403    }
15404    next(xpp);
15405    parseElementClose(res);
15406    return res;
15407  }
15408
15409  protected boolean parseStructureMapStructureMapGroupRuleComponentContent(int eventType, XmlPullParser xpp, StructureMap owner, StructureMap.StructureMapGroupRuleComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
15410      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
15411        res.setNameElement(parseId(xpp));
15412      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
15413        res.getSource().add(parseStructureMapStructureMapGroupRuleSourceComponent(xpp, owner));
15414      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("target")) {
15415        res.getTarget().add(parseStructureMapStructureMapGroupRuleTargetComponent(xpp, owner));
15416      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rule")) {
15417        res.getRule().add(parseStructureMapStructureMapGroupRuleComponent(xpp, owner));
15418      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dependent")) {
15419        res.getDependent().add(parseStructureMapStructureMapGroupRuleDependentComponent(xpp, owner));
15420      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
15421        res.setDocumentationElement(parseString(xpp));
15422      } else if (!parseBackboneContent(eventType, xpp, res))
15423        return false;
15424    return true;
15425  }
15426
15427  protected StructureMap.StructureMapGroupRuleSourceComponent parseStructureMapStructureMapGroupRuleSourceComponent(XmlPullParser xpp, StructureMap owner) throws XmlPullParserException, IOException, FHIRFormatError {
15428    StructureMap.StructureMapGroupRuleSourceComponent res = new StructureMap.StructureMapGroupRuleSourceComponent();
15429    parseBackboneAttributes(xpp, res);
15430    next(xpp);
15431    int eventType = nextNoWhitespace(xpp);
15432    while (eventType != XmlPullParser.END_TAG) {
15433  if (!parseStructureMapStructureMapGroupRuleSourceComponentContent(eventType, xpp, owner, res))
15434        unknownContent(xpp);
15435      eventType = nextNoWhitespace(xpp);
15436    }
15437    next(xpp);
15438    parseElementClose(res);
15439    return res;
15440  }
15441
15442  protected boolean parseStructureMapStructureMapGroupRuleSourceComponentContent(int eventType, XmlPullParser xpp, StructureMap owner, StructureMap.StructureMapGroupRuleSourceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
15443      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
15444        res.setContextElement(parseId(xpp));
15445      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("min")) {
15446        res.setMinElement(parseInteger(xpp));
15447      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("max")) {
15448        res.setMaxElement(parseString(xpp));
15449      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
15450        res.setTypeElement(parseString(xpp));
15451      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "defaultValue")) {
15452        res.setDefaultValue(parseType("defaultValue", xpp));
15453      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("element")) {
15454        res.setElementElement(parseString(xpp));
15455      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("listMode")) {
15456        res.setListModeElement(parseEnumeration(xpp, StructureMap.StructureMapSourceListMode.NULL, new StructureMap.StructureMapSourceListModeEnumFactory()));
15457      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("variable")) {
15458        res.setVariableElement(parseId(xpp));
15459      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("condition")) {
15460        res.setConditionElement(parseString(xpp));
15461      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("check")) {
15462        res.setCheckElement(parseString(xpp));
15463      } else if (!parseBackboneContent(eventType, xpp, res))
15464        return false;
15465    return true;
15466  }
15467
15468  protected StructureMap.StructureMapGroupRuleTargetComponent parseStructureMapStructureMapGroupRuleTargetComponent(XmlPullParser xpp, StructureMap owner) throws XmlPullParserException, IOException, FHIRFormatError {
15469    StructureMap.StructureMapGroupRuleTargetComponent res = new StructureMap.StructureMapGroupRuleTargetComponent();
15470    parseBackboneAttributes(xpp, res);
15471    next(xpp);
15472    int eventType = nextNoWhitespace(xpp);
15473    while (eventType != XmlPullParser.END_TAG) {
15474  if (!parseStructureMapStructureMapGroupRuleTargetComponentContent(eventType, xpp, owner, res))
15475        unknownContent(xpp);
15476      eventType = nextNoWhitespace(xpp);
15477    }
15478    next(xpp);
15479    parseElementClose(res);
15480    return res;
15481  }
15482
15483  protected boolean parseStructureMapStructureMapGroupRuleTargetComponentContent(int eventType, XmlPullParser xpp, StructureMap owner, StructureMap.StructureMapGroupRuleTargetComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
15484      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
15485        res.setContextElement(parseId(xpp));
15486      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contextType")) {
15487        res.setContextTypeElement(parseEnumeration(xpp, StructureMap.StructureMapContextType.NULL, new StructureMap.StructureMapContextTypeEnumFactory()));
15488      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("element")) {
15489        res.setElementElement(parseString(xpp));
15490      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("variable")) {
15491        res.setVariableElement(parseId(xpp));
15492      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("listMode")) {
15493        res.getListMode().add(parseEnumeration(xpp, StructureMap.StructureMapTargetListMode.NULL, new StructureMap.StructureMapTargetListModeEnumFactory()));
15494      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("listRuleId")) {
15495        res.setListRuleIdElement(parseId(xpp));
15496      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("transform")) {
15497        res.setTransformElement(parseEnumeration(xpp, StructureMap.StructureMapTransform.NULL, new StructureMap.StructureMapTransformEnumFactory()));
15498      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("parameter")) {
15499        res.getParameter().add(parseStructureMapStructureMapGroupRuleTargetParameterComponent(xpp, owner));
15500      } else if (!parseBackboneContent(eventType, xpp, res))
15501        return false;
15502    return true;
15503  }
15504
15505  protected StructureMap.StructureMapGroupRuleTargetParameterComponent parseStructureMapStructureMapGroupRuleTargetParameterComponent(XmlPullParser xpp, StructureMap owner) throws XmlPullParserException, IOException, FHIRFormatError {
15506    StructureMap.StructureMapGroupRuleTargetParameterComponent res = new StructureMap.StructureMapGroupRuleTargetParameterComponent();
15507    parseBackboneAttributes(xpp, res);
15508    next(xpp);
15509    int eventType = nextNoWhitespace(xpp);
15510    while (eventType != XmlPullParser.END_TAG) {
15511  if (!parseStructureMapStructureMapGroupRuleTargetParameterComponentContent(eventType, xpp, owner, res))
15512        unknownContent(xpp);
15513      eventType = nextNoWhitespace(xpp);
15514    }
15515    next(xpp);
15516    parseElementClose(res);
15517    return res;
15518  }
15519
15520  protected boolean parseStructureMapStructureMapGroupRuleTargetParameterComponentContent(int eventType, XmlPullParser xpp, StructureMap owner, StructureMap.StructureMapGroupRuleTargetParameterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
15521      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
15522        res.setValue(parseType("value", xpp));
15523      } else if (!parseBackboneContent(eventType, xpp, res))
15524        return false;
15525    return true;
15526  }
15527
15528  protected StructureMap.StructureMapGroupRuleDependentComponent parseStructureMapStructureMapGroupRuleDependentComponent(XmlPullParser xpp, StructureMap owner) throws XmlPullParserException, IOException, FHIRFormatError {
15529    StructureMap.StructureMapGroupRuleDependentComponent res = new StructureMap.StructureMapGroupRuleDependentComponent();
15530    parseBackboneAttributes(xpp, res);
15531    next(xpp);
15532    int eventType = nextNoWhitespace(xpp);
15533    while (eventType != XmlPullParser.END_TAG) {
15534  if (!parseStructureMapStructureMapGroupRuleDependentComponentContent(eventType, xpp, owner, res))
15535        unknownContent(xpp);
15536      eventType = nextNoWhitespace(xpp);
15537    }
15538    next(xpp);
15539    parseElementClose(res);
15540    return res;
15541  }
15542
15543  protected boolean parseStructureMapStructureMapGroupRuleDependentComponentContent(int eventType, XmlPullParser xpp, StructureMap owner, StructureMap.StructureMapGroupRuleDependentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
15544      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
15545        res.setNameElement(parseId(xpp));
15546      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("variable")) {
15547        res.getVariable().add(parseString(xpp));
15548      } else if (!parseBackboneContent(eventType, xpp, res))
15549        return false;
15550    return true;
15551  }
15552
15553  protected Subscription parseSubscription(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
15554    Subscription res = new Subscription();
15555    parseDomainResourceAttributes(xpp, res);
15556    next(xpp);
15557    int eventType = nextNoWhitespace(xpp);
15558    while (eventType != XmlPullParser.END_TAG) {
15559  if (!parseSubscriptionContent(eventType, xpp, res))
15560        unknownContent(xpp);
15561      eventType = nextNoWhitespace(xpp);
15562    }
15563    next(xpp);
15564    parseElementClose(res);
15565    return res;
15566  }
15567
15568  protected boolean parseSubscriptionContent(int eventType, XmlPullParser xpp, Subscription res) throws XmlPullParserException, IOException, FHIRFormatError {
15569      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
15570        res.setStatusElement(parseEnumeration(xpp, Subscription.SubscriptionStatus.NULL, new Subscription.SubscriptionStatusEnumFactory()));
15571      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
15572        res.getContact().add(parseContactPoint(xpp));
15573      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("end")) {
15574        res.setEndElement(parseInstant(xpp));
15575      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
15576        res.setReasonElement(parseString(xpp));
15577      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("criteria")) {
15578        res.setCriteriaElement(parseString(xpp));
15579      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("error")) {
15580        res.setErrorElement(parseString(xpp));
15581      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("channel")) {
15582        res.setChannel(parseSubscriptionSubscriptionChannelComponent(xpp, res));
15583      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("tag")) {
15584        res.getTag().add(parseCoding(xpp));
15585      } else if (!parseDomainResourceContent(eventType, xpp, res))
15586        return false;
15587    return true;
15588  }
15589
15590  protected Subscription.SubscriptionChannelComponent parseSubscriptionSubscriptionChannelComponent(XmlPullParser xpp, Subscription owner) throws XmlPullParserException, IOException, FHIRFormatError {
15591    Subscription.SubscriptionChannelComponent res = new Subscription.SubscriptionChannelComponent();
15592    parseBackboneAttributes(xpp, res);
15593    next(xpp);
15594    int eventType = nextNoWhitespace(xpp);
15595    while (eventType != XmlPullParser.END_TAG) {
15596  if (!parseSubscriptionSubscriptionChannelComponentContent(eventType, xpp, owner, res))
15597        unknownContent(xpp);
15598      eventType = nextNoWhitespace(xpp);
15599    }
15600    next(xpp);
15601    parseElementClose(res);
15602    return res;
15603  }
15604
15605  protected boolean parseSubscriptionSubscriptionChannelComponentContent(int eventType, XmlPullParser xpp, Subscription owner, Subscription.SubscriptionChannelComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
15606      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
15607        res.setTypeElement(parseEnumeration(xpp, Subscription.SubscriptionChannelType.NULL, new Subscription.SubscriptionChannelTypeEnumFactory()));
15608      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("endpoint")) {
15609        res.setEndpointElement(parseUri(xpp));
15610      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payload")) {
15611        res.setPayloadElement(parseString(xpp));
15612      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("header")) {
15613        res.getHeader().add(parseString(xpp));
15614      } else if (!parseBackboneContent(eventType, xpp, res))
15615        return false;
15616    return true;
15617  }
15618
15619  protected Substance parseSubstance(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
15620    Substance res = new Substance();
15621    parseDomainResourceAttributes(xpp, res);
15622    next(xpp);
15623    int eventType = nextNoWhitespace(xpp);
15624    while (eventType != XmlPullParser.END_TAG) {
15625  if (!parseSubstanceContent(eventType, xpp, res))
15626        unknownContent(xpp);
15627      eventType = nextNoWhitespace(xpp);
15628    }
15629    next(xpp);
15630    parseElementClose(res);
15631    return res;
15632  }
15633
15634  protected boolean parseSubstanceContent(int eventType, XmlPullParser xpp, Substance res) throws XmlPullParserException, IOException, FHIRFormatError {
15635      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
15636        res.getIdentifier().add(parseIdentifier(xpp));
15637      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
15638        res.setStatusElement(parseEnumeration(xpp, Substance.FHIRSubstanceStatus.NULL, new Substance.FHIRSubstanceStatusEnumFactory()));
15639      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
15640        res.getCategory().add(parseCodeableConcept(xpp));
15641      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
15642        res.setCode(parseCodeableConcept(xpp));
15643      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
15644        res.setDescriptionElement(parseString(xpp));
15645      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instance")) {
15646        res.getInstance().add(parseSubstanceSubstanceInstanceComponent(xpp, res));
15647      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ingredient")) {
15648        res.getIngredient().add(parseSubstanceSubstanceIngredientComponent(xpp, res));
15649      } else if (!parseDomainResourceContent(eventType, xpp, res))
15650        return false;
15651    return true;
15652  }
15653
15654  protected Substance.SubstanceInstanceComponent parseSubstanceSubstanceInstanceComponent(XmlPullParser xpp, Substance owner) throws XmlPullParserException, IOException, FHIRFormatError {
15655    Substance.SubstanceInstanceComponent res = new Substance.SubstanceInstanceComponent();
15656    parseBackboneAttributes(xpp, res);
15657    next(xpp);
15658    int eventType = nextNoWhitespace(xpp);
15659    while (eventType != XmlPullParser.END_TAG) {
15660  if (!parseSubstanceSubstanceInstanceComponentContent(eventType, xpp, owner, res))
15661        unknownContent(xpp);
15662      eventType = nextNoWhitespace(xpp);
15663    }
15664    next(xpp);
15665    parseElementClose(res);
15666    return res;
15667  }
15668
15669  protected boolean parseSubstanceSubstanceInstanceComponentContent(int eventType, XmlPullParser xpp, Substance owner, Substance.SubstanceInstanceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
15670      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
15671        res.setIdentifier(parseIdentifier(xpp));
15672      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expiry")) {
15673        res.setExpiryElement(parseDateTime(xpp));
15674      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
15675        res.setQuantity(parseSimpleQuantity(xpp));
15676      } else if (!parseBackboneContent(eventType, xpp, res))
15677        return false;
15678    return true;
15679  }
15680
15681  protected Substance.SubstanceIngredientComponent parseSubstanceSubstanceIngredientComponent(XmlPullParser xpp, Substance owner) throws XmlPullParserException, IOException, FHIRFormatError {
15682    Substance.SubstanceIngredientComponent res = new Substance.SubstanceIngredientComponent();
15683    parseBackboneAttributes(xpp, res);
15684    next(xpp);
15685    int eventType = nextNoWhitespace(xpp);
15686    while (eventType != XmlPullParser.END_TAG) {
15687  if (!parseSubstanceSubstanceIngredientComponentContent(eventType, xpp, owner, res))
15688        unknownContent(xpp);
15689      eventType = nextNoWhitespace(xpp);
15690    }
15691    next(xpp);
15692    parseElementClose(res);
15693    return res;
15694  }
15695
15696  protected boolean parseSubstanceSubstanceIngredientComponentContent(int eventType, XmlPullParser xpp, Substance owner, Substance.SubstanceIngredientComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
15697      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
15698        res.setQuantity(parseRatio(xpp));
15699      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "substance")) {
15700        res.setSubstance(parseType("substance", xpp));
15701      } else if (!parseBackboneContent(eventType, xpp, res))
15702        return false;
15703    return true;
15704  }
15705
15706  protected SupplyDelivery parseSupplyDelivery(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
15707    SupplyDelivery res = new SupplyDelivery();
15708    parseDomainResourceAttributes(xpp, res);
15709    next(xpp);
15710    int eventType = nextNoWhitespace(xpp);
15711    while (eventType != XmlPullParser.END_TAG) {
15712  if (!parseSupplyDeliveryContent(eventType, xpp, res))
15713        unknownContent(xpp);
15714      eventType = nextNoWhitespace(xpp);
15715    }
15716    next(xpp);
15717    parseElementClose(res);
15718    return res;
15719  }
15720
15721  protected boolean parseSupplyDeliveryContent(int eventType, XmlPullParser xpp, SupplyDelivery res) throws XmlPullParserException, IOException, FHIRFormatError {
15722      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
15723        res.setIdentifier(parseIdentifier(xpp));
15724      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
15725        res.getBasedOn().add(parseReference(xpp));
15726      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
15727        res.getPartOf().add(parseReference(xpp));
15728      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
15729        res.setStatusElement(parseEnumeration(xpp, SupplyDelivery.SupplyDeliveryStatus.NULL, new SupplyDelivery.SupplyDeliveryStatusEnumFactory()));
15730      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
15731        res.setPatient(parseReference(xpp));
15732      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
15733        res.setType(parseCodeableConcept(xpp));
15734      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("suppliedItem")) {
15735        res.setSuppliedItem(parseSupplyDeliverySupplyDeliverySuppliedItemComponent(xpp, res));
15736      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "occurrence")) {
15737        res.setOccurrence(parseType("occurrence", xpp));
15738      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supplier")) {
15739        res.setSupplier(parseReference(xpp));
15740      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("destination")) {
15741        res.setDestination(parseReference(xpp));
15742      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("receiver")) {
15743        res.getReceiver().add(parseReference(xpp));
15744      } else if (!parseDomainResourceContent(eventType, xpp, res))
15745        return false;
15746    return true;
15747  }
15748
15749  protected SupplyDelivery.SupplyDeliverySuppliedItemComponent parseSupplyDeliverySupplyDeliverySuppliedItemComponent(XmlPullParser xpp, SupplyDelivery owner) throws XmlPullParserException, IOException, FHIRFormatError {
15750    SupplyDelivery.SupplyDeliverySuppliedItemComponent res = new SupplyDelivery.SupplyDeliverySuppliedItemComponent();
15751    parseBackboneAttributes(xpp, res);
15752    next(xpp);
15753    int eventType = nextNoWhitespace(xpp);
15754    while (eventType != XmlPullParser.END_TAG) {
15755  if (!parseSupplyDeliverySupplyDeliverySuppliedItemComponentContent(eventType, xpp, owner, res))
15756        unknownContent(xpp);
15757      eventType = nextNoWhitespace(xpp);
15758    }
15759    next(xpp);
15760    parseElementClose(res);
15761    return res;
15762  }
15763
15764  protected boolean parseSupplyDeliverySupplyDeliverySuppliedItemComponentContent(int eventType, XmlPullParser xpp, SupplyDelivery owner, SupplyDelivery.SupplyDeliverySuppliedItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
15765      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
15766        res.setQuantity(parseSimpleQuantity(xpp));
15767      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "item")) {
15768        res.setItem(parseType("item", xpp));
15769      } else if (!parseBackboneContent(eventType, xpp, res))
15770        return false;
15771    return true;
15772  }
15773
15774  protected SupplyRequest parseSupplyRequest(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
15775    SupplyRequest res = new SupplyRequest();
15776    parseDomainResourceAttributes(xpp, res);
15777    next(xpp);
15778    int eventType = nextNoWhitespace(xpp);
15779    while (eventType != XmlPullParser.END_TAG) {
15780  if (!parseSupplyRequestContent(eventType, xpp, res))
15781        unknownContent(xpp);
15782      eventType = nextNoWhitespace(xpp);
15783    }
15784    next(xpp);
15785    parseElementClose(res);
15786    return res;
15787  }
15788
15789  protected boolean parseSupplyRequestContent(int eventType, XmlPullParser xpp, SupplyRequest res) throws XmlPullParserException, IOException, FHIRFormatError {
15790      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
15791        res.setIdentifier(parseIdentifier(xpp));
15792      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
15793        res.setStatusElement(parseEnumeration(xpp, SupplyRequest.SupplyRequestStatus.NULL, new SupplyRequest.SupplyRequestStatusEnumFactory()));
15794      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
15795        res.setCategory(parseCodeableConcept(xpp));
15796      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
15797        res.setPriorityElement(parseEnumeration(xpp, SupplyRequest.RequestPriority.NULL, new SupplyRequest.RequestPriorityEnumFactory()));
15798      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("orderedItem")) {
15799        res.setOrderedItem(parseSupplyRequestSupplyRequestOrderedItemComponent(xpp, res));
15800      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "occurrence")) {
15801        res.setOccurrence(parseType("occurrence", xpp));
15802      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authoredOn")) {
15803        res.setAuthoredOnElement(parseDateTime(xpp));
15804      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requester")) {
15805        res.setRequester(parseSupplyRequestSupplyRequestRequesterComponent(xpp, res));
15806      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supplier")) {
15807        res.getSupplier().add(parseReference(xpp));
15808      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "reason")) {
15809        res.setReason(parseType("reason", xpp));
15810      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("deliverFrom")) {
15811        res.setDeliverFrom(parseReference(xpp));
15812      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("deliverTo")) {
15813        res.setDeliverTo(parseReference(xpp));
15814      } else if (!parseDomainResourceContent(eventType, xpp, res))
15815        return false;
15816    return true;
15817  }
15818
15819  protected SupplyRequest.SupplyRequestOrderedItemComponent parseSupplyRequestSupplyRequestOrderedItemComponent(XmlPullParser xpp, SupplyRequest owner) throws XmlPullParserException, IOException, FHIRFormatError {
15820    SupplyRequest.SupplyRequestOrderedItemComponent res = new SupplyRequest.SupplyRequestOrderedItemComponent();
15821    parseBackboneAttributes(xpp, res);
15822    next(xpp);
15823    int eventType = nextNoWhitespace(xpp);
15824    while (eventType != XmlPullParser.END_TAG) {
15825  if (!parseSupplyRequestSupplyRequestOrderedItemComponentContent(eventType, xpp, owner, res))
15826        unknownContent(xpp);
15827      eventType = nextNoWhitespace(xpp);
15828    }
15829    next(xpp);
15830    parseElementClose(res);
15831    return res;
15832  }
15833
15834  protected boolean parseSupplyRequestSupplyRequestOrderedItemComponentContent(int eventType, XmlPullParser xpp, SupplyRequest owner, SupplyRequest.SupplyRequestOrderedItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
15835      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
15836        res.setQuantity(parseQuantity(xpp));
15837      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "item")) {
15838        res.setItem(parseType("item", xpp));
15839      } else if (!parseBackboneContent(eventType, xpp, res))
15840        return false;
15841    return true;
15842  }
15843
15844  protected SupplyRequest.SupplyRequestRequesterComponent parseSupplyRequestSupplyRequestRequesterComponent(XmlPullParser xpp, SupplyRequest owner) throws XmlPullParserException, IOException, FHIRFormatError {
15845    SupplyRequest.SupplyRequestRequesterComponent res = new SupplyRequest.SupplyRequestRequesterComponent();
15846    parseBackboneAttributes(xpp, res);
15847    next(xpp);
15848    int eventType = nextNoWhitespace(xpp);
15849    while (eventType != XmlPullParser.END_TAG) {
15850  if (!parseSupplyRequestSupplyRequestRequesterComponentContent(eventType, xpp, owner, res))
15851        unknownContent(xpp);
15852      eventType = nextNoWhitespace(xpp);
15853    }
15854    next(xpp);
15855    parseElementClose(res);
15856    return res;
15857  }
15858
15859  protected boolean parseSupplyRequestSupplyRequestRequesterComponentContent(int eventType, XmlPullParser xpp, SupplyRequest owner, SupplyRequest.SupplyRequestRequesterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
15860      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("agent")) {
15861        res.setAgent(parseReference(xpp));
15862      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onBehalfOf")) {
15863        res.setOnBehalfOf(parseReference(xpp));
15864      } else if (!parseBackboneContent(eventType, xpp, res))
15865        return false;
15866    return true;
15867  }
15868
15869  protected Task parseTask(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
15870    Task res = new Task();
15871    parseDomainResourceAttributes(xpp, res);
15872    next(xpp);
15873    int eventType = nextNoWhitespace(xpp);
15874    while (eventType != XmlPullParser.END_TAG) {
15875  if (!parseTaskContent(eventType, xpp, res))
15876        unknownContent(xpp);
15877      eventType = nextNoWhitespace(xpp);
15878    }
15879    next(xpp);
15880    parseElementClose(res);
15881    return res;
15882  }
15883
15884  protected boolean parseTaskContent(int eventType, XmlPullParser xpp, Task res) throws XmlPullParserException, IOException, FHIRFormatError {
15885      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
15886        res.getIdentifier().add(parseIdentifier(xpp));
15887      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "definition")) {
15888        res.setDefinition(parseType("definition", xpp));
15889      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
15890        res.getBasedOn().add(parseReference(xpp));
15891      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("groupIdentifier")) {
15892        res.setGroupIdentifier(parseIdentifier(xpp));
15893      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
15894        res.getPartOf().add(parseReference(xpp));
15895      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
15896        res.setStatusElement(parseEnumeration(xpp, Task.TaskStatus.NULL, new Task.TaskStatusEnumFactory()));
15897      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("statusReason")) {
15898        res.setStatusReason(parseCodeableConcept(xpp));
15899      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("businessStatus")) {
15900        res.setBusinessStatus(parseCodeableConcept(xpp));
15901      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("intent")) {
15902        res.setIntentElement(parseEnumeration(xpp, Task.TaskIntent.NULL, new Task.TaskIntentEnumFactory()));
15903      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
15904        res.setPriorityElement(parseEnumeration(xpp, Task.TaskPriority.NULL, new Task.TaskPriorityEnumFactory()));
15905      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
15906        res.setCode(parseCodeableConcept(xpp));
15907      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
15908        res.setDescriptionElement(parseString(xpp));
15909      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("focus")) {
15910        res.setFocus(parseReference(xpp));
15911      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("for")) {
15912        res.setFor(parseReference(xpp));
15913      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
15914        res.setContext(parseReference(xpp));
15915      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("executionPeriod")) {
15916        res.setExecutionPeriod(parsePeriod(xpp));
15917      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authoredOn")) {
15918        res.setAuthoredOnElement(parseDateTime(xpp));
15919      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastModified")) {
15920        res.setLastModifiedElement(parseDateTime(xpp));
15921      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requester")) {
15922        res.setRequester(parseTaskTaskRequesterComponent(xpp, res));
15923      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performerType")) {
15924        res.getPerformerType().add(parseCodeableConcept(xpp));
15925      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("owner")) {
15926        res.setOwner(parseReference(xpp));
15927      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
15928        res.setReason(parseCodeableConcept(xpp));
15929      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
15930        res.getNote().add(parseAnnotation(xpp));
15931      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relevantHistory")) {
15932        res.getRelevantHistory().add(parseReference(xpp));
15933      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("restriction")) {
15934        res.setRestriction(parseTaskTaskRestrictionComponent(xpp, res));
15935      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("input")) {
15936        res.getInput().add(parseTaskParameterComponent(xpp, res));
15937      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("output")) {
15938        res.getOutput().add(parseTaskTaskOutputComponent(xpp, res));
15939      } else if (!parseDomainResourceContent(eventType, xpp, res))
15940        return false;
15941    return true;
15942  }
15943
15944  protected Task.TaskRequesterComponent parseTaskTaskRequesterComponent(XmlPullParser xpp, Task owner) throws XmlPullParserException, IOException, FHIRFormatError {
15945    Task.TaskRequesterComponent res = new Task.TaskRequesterComponent();
15946    parseBackboneAttributes(xpp, res);
15947    next(xpp);
15948    int eventType = nextNoWhitespace(xpp);
15949    while (eventType != XmlPullParser.END_TAG) {
15950  if (!parseTaskTaskRequesterComponentContent(eventType, xpp, owner, res))
15951        unknownContent(xpp);
15952      eventType = nextNoWhitespace(xpp);
15953    }
15954    next(xpp);
15955    parseElementClose(res);
15956    return res;
15957  }
15958
15959  protected boolean parseTaskTaskRequesterComponentContent(int eventType, XmlPullParser xpp, Task owner, Task.TaskRequesterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
15960      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("agent")) {
15961        res.setAgent(parseReference(xpp));
15962      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onBehalfOf")) {
15963        res.setOnBehalfOf(parseReference(xpp));
15964      } else if (!parseBackboneContent(eventType, xpp, res))
15965        return false;
15966    return true;
15967  }
15968
15969  protected Task.TaskRestrictionComponent parseTaskTaskRestrictionComponent(XmlPullParser xpp, Task owner) throws XmlPullParserException, IOException, FHIRFormatError {
15970    Task.TaskRestrictionComponent res = new Task.TaskRestrictionComponent();
15971    parseBackboneAttributes(xpp, res);
15972    next(xpp);
15973    int eventType = nextNoWhitespace(xpp);
15974    while (eventType != XmlPullParser.END_TAG) {
15975  if (!parseTaskTaskRestrictionComponentContent(eventType, xpp, owner, res))
15976        unknownContent(xpp);
15977      eventType = nextNoWhitespace(xpp);
15978    }
15979    next(xpp);
15980    parseElementClose(res);
15981    return res;
15982  }
15983
15984  protected boolean parseTaskTaskRestrictionComponentContent(int eventType, XmlPullParser xpp, Task owner, Task.TaskRestrictionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
15985      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("repetitions")) {
15986        res.setRepetitionsElement(parsePositiveInt(xpp));
15987      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
15988        res.setPeriod(parsePeriod(xpp));
15989      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recipient")) {
15990        res.getRecipient().add(parseReference(xpp));
15991      } else if (!parseBackboneContent(eventType, xpp, res))
15992        return false;
15993    return true;
15994  }
15995
15996  protected Task.ParameterComponent parseTaskParameterComponent(XmlPullParser xpp, Task owner) throws XmlPullParserException, IOException, FHIRFormatError {
15997    Task.ParameterComponent res = new Task.ParameterComponent();
15998    parseBackboneAttributes(xpp, res);
15999    next(xpp);
16000    int eventType = nextNoWhitespace(xpp);
16001    while (eventType != XmlPullParser.END_TAG) {
16002  if (!parseTaskParameterComponentContent(eventType, xpp, owner, res))
16003        unknownContent(xpp);
16004      eventType = nextNoWhitespace(xpp);
16005    }
16006    next(xpp);
16007    parseElementClose(res);
16008    return res;
16009  }
16010
16011  protected boolean parseTaskParameterComponentContent(int eventType, XmlPullParser xpp, Task owner, Task.ParameterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16012      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
16013        res.setType(parseCodeableConcept(xpp));
16014      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
16015        res.setValue(parseType("value", xpp));
16016      } else if (!parseBackboneContent(eventType, xpp, res))
16017        return false;
16018    return true;
16019  }
16020
16021  protected Task.TaskOutputComponent parseTaskTaskOutputComponent(XmlPullParser xpp, Task owner) throws XmlPullParserException, IOException, FHIRFormatError {
16022    Task.TaskOutputComponent res = new Task.TaskOutputComponent();
16023    parseBackboneAttributes(xpp, res);
16024    next(xpp);
16025    int eventType = nextNoWhitespace(xpp);
16026    while (eventType != XmlPullParser.END_TAG) {
16027  if (!parseTaskTaskOutputComponentContent(eventType, xpp, owner, res))
16028        unknownContent(xpp);
16029      eventType = nextNoWhitespace(xpp);
16030    }
16031    next(xpp);
16032    parseElementClose(res);
16033    return res;
16034  }
16035
16036  protected boolean parseTaskTaskOutputComponentContent(int eventType, XmlPullParser xpp, Task owner, Task.TaskOutputComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16037      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
16038        res.setType(parseCodeableConcept(xpp));
16039      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
16040        res.setValue(parseType("value", xpp));
16041      } else if (!parseBackboneContent(eventType, xpp, res))
16042        return false;
16043    return true;
16044  }
16045
16046  protected TestReport parseTestReport(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
16047    TestReport res = new TestReport();
16048    parseDomainResourceAttributes(xpp, res);
16049    next(xpp);
16050    int eventType = nextNoWhitespace(xpp);
16051    while (eventType != XmlPullParser.END_TAG) {
16052  if (!parseTestReportContent(eventType, xpp, res))
16053        unknownContent(xpp);
16054      eventType = nextNoWhitespace(xpp);
16055    }
16056    next(xpp);
16057    parseElementClose(res);
16058    return res;
16059  }
16060
16061  protected boolean parseTestReportContent(int eventType, XmlPullParser xpp, TestReport res) throws XmlPullParserException, IOException, FHIRFormatError {
16062      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
16063        res.setIdentifier(parseIdentifier(xpp));
16064      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
16065        res.setNameElement(parseString(xpp));
16066      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
16067        res.setStatusElement(parseEnumeration(xpp, TestReport.TestReportStatus.NULL, new TestReport.TestReportStatusEnumFactory()));
16068      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("testScript")) {
16069        res.setTestScript(parseReference(xpp));
16070      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("result")) {
16071        res.setResultElement(parseEnumeration(xpp, TestReport.TestReportResult.NULL, new TestReport.TestReportResultEnumFactory()));
16072      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("score")) {
16073        res.setScoreElement(parseDecimal(xpp));
16074      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("tester")) {
16075        res.setTesterElement(parseString(xpp));
16076      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("issued")) {
16077        res.setIssuedElement(parseDateTime(xpp));
16078      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
16079        res.getParticipant().add(parseTestReportTestReportParticipantComponent(xpp, res));
16080      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("setup")) {
16081        res.setSetup(parseTestReportTestReportSetupComponent(xpp, res));
16082      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("test")) {
16083        res.getTest().add(parseTestReportTestReportTestComponent(xpp, res));
16084      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("teardown")) {
16085        res.setTeardown(parseTestReportTestReportTeardownComponent(xpp, res));
16086      } else if (!parseDomainResourceContent(eventType, xpp, res))
16087        return false;
16088    return true;
16089  }
16090
16091  protected TestReport.TestReportParticipantComponent parseTestReportTestReportParticipantComponent(XmlPullParser xpp, TestReport owner) throws XmlPullParserException, IOException, FHIRFormatError {
16092    TestReport.TestReportParticipantComponent res = new TestReport.TestReportParticipantComponent();
16093    parseBackboneAttributes(xpp, res);
16094    next(xpp);
16095    int eventType = nextNoWhitespace(xpp);
16096    while (eventType != XmlPullParser.END_TAG) {
16097  if (!parseTestReportTestReportParticipantComponentContent(eventType, xpp, owner, res))
16098        unknownContent(xpp);
16099      eventType = nextNoWhitespace(xpp);
16100    }
16101    next(xpp);
16102    parseElementClose(res);
16103    return res;
16104  }
16105
16106  protected boolean parseTestReportTestReportParticipantComponentContent(int eventType, XmlPullParser xpp, TestReport owner, TestReport.TestReportParticipantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16107      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
16108        res.setTypeElement(parseEnumeration(xpp, TestReport.TestReportParticipantType.NULL, new TestReport.TestReportParticipantTypeEnumFactory()));
16109      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("uri")) {
16110        res.setUriElement(parseUri(xpp));
16111      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
16112        res.setDisplayElement(parseString(xpp));
16113      } else if (!parseBackboneContent(eventType, xpp, res))
16114        return false;
16115    return true;
16116  }
16117
16118  protected TestReport.TestReportSetupComponent parseTestReportTestReportSetupComponent(XmlPullParser xpp, TestReport owner) throws XmlPullParserException, IOException, FHIRFormatError {
16119    TestReport.TestReportSetupComponent res = new TestReport.TestReportSetupComponent();
16120    parseBackboneAttributes(xpp, res);
16121    next(xpp);
16122    int eventType = nextNoWhitespace(xpp);
16123    while (eventType != XmlPullParser.END_TAG) {
16124  if (!parseTestReportTestReportSetupComponentContent(eventType, xpp, owner, res))
16125        unknownContent(xpp);
16126      eventType = nextNoWhitespace(xpp);
16127    }
16128    next(xpp);
16129    parseElementClose(res);
16130    return res;
16131  }
16132
16133  protected boolean parseTestReportTestReportSetupComponentContent(int eventType, XmlPullParser xpp, TestReport owner, TestReport.TestReportSetupComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16134      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
16135        res.getAction().add(parseTestReportSetupActionComponent(xpp, owner));
16136      } else if (!parseBackboneContent(eventType, xpp, res))
16137        return false;
16138    return true;
16139  }
16140
16141  protected TestReport.SetupActionComponent parseTestReportSetupActionComponent(XmlPullParser xpp, TestReport owner) throws XmlPullParserException, IOException, FHIRFormatError {
16142    TestReport.SetupActionComponent res = new TestReport.SetupActionComponent();
16143    parseBackboneAttributes(xpp, res);
16144    next(xpp);
16145    int eventType = nextNoWhitespace(xpp);
16146    while (eventType != XmlPullParser.END_TAG) {
16147  if (!parseTestReportSetupActionComponentContent(eventType, xpp, owner, res))
16148        unknownContent(xpp);
16149      eventType = nextNoWhitespace(xpp);
16150    }
16151    next(xpp);
16152    parseElementClose(res);
16153    return res;
16154  }
16155
16156  protected boolean parseTestReportSetupActionComponentContent(int eventType, XmlPullParser xpp, TestReport owner, TestReport.SetupActionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16157      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operation")) {
16158        res.setOperation(parseTestReportSetupActionOperationComponent(xpp, owner));
16159      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("assert")) {
16160        res.setAssert(parseTestReportSetupActionAssertComponent(xpp, owner));
16161      } else if (!parseBackboneContent(eventType, xpp, res))
16162        return false;
16163    return true;
16164  }
16165
16166  protected TestReport.SetupActionOperationComponent parseTestReportSetupActionOperationComponent(XmlPullParser xpp, TestReport owner) throws XmlPullParserException, IOException, FHIRFormatError {
16167    TestReport.SetupActionOperationComponent res = new TestReport.SetupActionOperationComponent();
16168    parseBackboneAttributes(xpp, res);
16169    next(xpp);
16170    int eventType = nextNoWhitespace(xpp);
16171    while (eventType != XmlPullParser.END_TAG) {
16172  if (!parseTestReportSetupActionOperationComponentContent(eventType, xpp, owner, res))
16173        unknownContent(xpp);
16174      eventType = nextNoWhitespace(xpp);
16175    }
16176    next(xpp);
16177    parseElementClose(res);
16178    return res;
16179  }
16180
16181  protected boolean parseTestReportSetupActionOperationComponentContent(int eventType, XmlPullParser xpp, TestReport owner, TestReport.SetupActionOperationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16182      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("result")) {
16183        res.setResultElement(parseEnumeration(xpp, TestReport.TestReportActionResult.NULL, new TestReport.TestReportActionResultEnumFactory()));
16184      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("message")) {
16185        res.setMessageElement(parseMarkdown(xpp));
16186      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
16187        res.setDetailElement(parseUri(xpp));
16188      } else if (!parseBackboneContent(eventType, xpp, res))
16189        return false;
16190    return true;
16191  }
16192
16193  protected TestReport.SetupActionAssertComponent parseTestReportSetupActionAssertComponent(XmlPullParser xpp, TestReport owner) throws XmlPullParserException, IOException, FHIRFormatError {
16194    TestReport.SetupActionAssertComponent res = new TestReport.SetupActionAssertComponent();
16195    parseBackboneAttributes(xpp, res);
16196    next(xpp);
16197    int eventType = nextNoWhitespace(xpp);
16198    while (eventType != XmlPullParser.END_TAG) {
16199  if (!parseTestReportSetupActionAssertComponentContent(eventType, xpp, owner, res))
16200        unknownContent(xpp);
16201      eventType = nextNoWhitespace(xpp);
16202    }
16203    next(xpp);
16204    parseElementClose(res);
16205    return res;
16206  }
16207
16208  protected boolean parseTestReportSetupActionAssertComponentContent(int eventType, XmlPullParser xpp, TestReport owner, TestReport.SetupActionAssertComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16209      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("result")) {
16210        res.setResultElement(parseEnumeration(xpp, TestReport.TestReportActionResult.NULL, new TestReport.TestReportActionResultEnumFactory()));
16211      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("message")) {
16212        res.setMessageElement(parseMarkdown(xpp));
16213      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
16214        res.setDetailElement(parseString(xpp));
16215      } else if (!parseBackboneContent(eventType, xpp, res))
16216        return false;
16217    return true;
16218  }
16219
16220  protected TestReport.TestReportTestComponent parseTestReportTestReportTestComponent(XmlPullParser xpp, TestReport owner) throws XmlPullParserException, IOException, FHIRFormatError {
16221    TestReport.TestReportTestComponent res = new TestReport.TestReportTestComponent();
16222    parseBackboneAttributes(xpp, res);
16223    next(xpp);
16224    int eventType = nextNoWhitespace(xpp);
16225    while (eventType != XmlPullParser.END_TAG) {
16226  if (!parseTestReportTestReportTestComponentContent(eventType, xpp, owner, res))
16227        unknownContent(xpp);
16228      eventType = nextNoWhitespace(xpp);
16229    }
16230    next(xpp);
16231    parseElementClose(res);
16232    return res;
16233  }
16234
16235  protected boolean parseTestReportTestReportTestComponentContent(int eventType, XmlPullParser xpp, TestReport owner, TestReport.TestReportTestComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16236      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
16237        res.setNameElement(parseString(xpp));
16238      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
16239        res.setDescriptionElement(parseString(xpp));
16240      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
16241        res.getAction().add(parseTestReportTestActionComponent(xpp, owner));
16242      } else if (!parseBackboneContent(eventType, xpp, res))
16243        return false;
16244    return true;
16245  }
16246
16247  protected TestReport.TestActionComponent parseTestReportTestActionComponent(XmlPullParser xpp, TestReport owner) throws XmlPullParserException, IOException, FHIRFormatError {
16248    TestReport.TestActionComponent res = new TestReport.TestActionComponent();
16249    parseBackboneAttributes(xpp, res);
16250    next(xpp);
16251    int eventType = nextNoWhitespace(xpp);
16252    while (eventType != XmlPullParser.END_TAG) {
16253  if (!parseTestReportTestActionComponentContent(eventType, xpp, owner, res))
16254        unknownContent(xpp);
16255      eventType = nextNoWhitespace(xpp);
16256    }
16257    next(xpp);
16258    parseElementClose(res);
16259    return res;
16260  }
16261
16262  protected boolean parseTestReportTestActionComponentContent(int eventType, XmlPullParser xpp, TestReport owner, TestReport.TestActionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16263      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operation")) {
16264        res.setOperation(parseTestReportSetupActionOperationComponent(xpp, owner));
16265      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("assert")) {
16266        res.setAssert(parseTestReportSetupActionAssertComponent(xpp, owner));
16267      } else if (!parseBackboneContent(eventType, xpp, res))
16268        return false;
16269    return true;
16270  }
16271
16272  protected TestReport.TestReportTeardownComponent parseTestReportTestReportTeardownComponent(XmlPullParser xpp, TestReport owner) throws XmlPullParserException, IOException, FHIRFormatError {
16273    TestReport.TestReportTeardownComponent res = new TestReport.TestReportTeardownComponent();
16274    parseBackboneAttributes(xpp, res);
16275    next(xpp);
16276    int eventType = nextNoWhitespace(xpp);
16277    while (eventType != XmlPullParser.END_TAG) {
16278  if (!parseTestReportTestReportTeardownComponentContent(eventType, xpp, owner, res))
16279        unknownContent(xpp);
16280      eventType = nextNoWhitespace(xpp);
16281    }
16282    next(xpp);
16283    parseElementClose(res);
16284    return res;
16285  }
16286
16287  protected boolean parseTestReportTestReportTeardownComponentContent(int eventType, XmlPullParser xpp, TestReport owner, TestReport.TestReportTeardownComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16288      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
16289        res.getAction().add(parseTestReportTeardownActionComponent(xpp, owner));
16290      } else if (!parseBackboneContent(eventType, xpp, res))
16291        return false;
16292    return true;
16293  }
16294
16295  protected TestReport.TeardownActionComponent parseTestReportTeardownActionComponent(XmlPullParser xpp, TestReport owner) throws XmlPullParserException, IOException, FHIRFormatError {
16296    TestReport.TeardownActionComponent res = new TestReport.TeardownActionComponent();
16297    parseBackboneAttributes(xpp, res);
16298    next(xpp);
16299    int eventType = nextNoWhitespace(xpp);
16300    while (eventType != XmlPullParser.END_TAG) {
16301  if (!parseTestReportTeardownActionComponentContent(eventType, xpp, owner, res))
16302        unknownContent(xpp);
16303      eventType = nextNoWhitespace(xpp);
16304    }
16305    next(xpp);
16306    parseElementClose(res);
16307    return res;
16308  }
16309
16310  protected boolean parseTestReportTeardownActionComponentContent(int eventType, XmlPullParser xpp, TestReport owner, TestReport.TeardownActionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16311      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operation")) {
16312        res.setOperation(parseTestReportSetupActionOperationComponent(xpp, owner));
16313      } else if (!parseBackboneContent(eventType, xpp, res))
16314        return false;
16315    return true;
16316  }
16317
16318  protected TestScript parseTestScript(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
16319    TestScript res = new TestScript();
16320    parseDomainResourceAttributes(xpp, res);
16321    next(xpp);
16322    int eventType = nextNoWhitespace(xpp);
16323    while (eventType != XmlPullParser.END_TAG) {
16324  if (!parseTestScriptContent(eventType, xpp, res))
16325        unknownContent(xpp);
16326      eventType = nextNoWhitespace(xpp);
16327    }
16328    next(xpp);
16329    parseElementClose(res);
16330    return res;
16331  }
16332
16333  protected boolean parseTestScriptContent(int eventType, XmlPullParser xpp, TestScript res) throws XmlPullParserException, IOException, FHIRFormatError {
16334      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
16335        res.setUrlElement(parseUri(xpp));
16336      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
16337        res.setIdentifier(parseIdentifier(xpp));
16338      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
16339        res.setVersionElement(parseString(xpp));
16340      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
16341        res.setNameElement(parseString(xpp));
16342      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
16343        res.setTitleElement(parseString(xpp));
16344      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
16345        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
16346      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
16347        res.setExperimentalElement(parseBoolean(xpp));
16348      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
16349        res.setDateElement(parseDateTime(xpp));
16350      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
16351        res.setPublisherElement(parseString(xpp));
16352      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
16353        res.getContact().add(parseContactDetail(xpp));
16354      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
16355        res.setDescriptionElement(parseMarkdown(xpp));
16356      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
16357        res.getUseContext().add(parseUsageContext(xpp));
16358      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
16359        res.getJurisdiction().add(parseCodeableConcept(xpp));
16360      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
16361        res.setPurposeElement(parseMarkdown(xpp));
16362      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
16363        res.setCopyrightElement(parseMarkdown(xpp));
16364      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("origin")) {
16365        res.getOrigin().add(parseTestScriptTestScriptOriginComponent(xpp, res));
16366      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("destination")) {
16367        res.getDestination().add(parseTestScriptTestScriptDestinationComponent(xpp, res));
16368      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("metadata")) {
16369        res.setMetadata(parseTestScriptTestScriptMetadataComponent(xpp, res));
16370      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fixture")) {
16371        res.getFixture().add(parseTestScriptTestScriptFixtureComponent(xpp, res));
16372      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
16373        res.getProfile().add(parseReference(xpp));
16374      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("variable")) {
16375        res.getVariable().add(parseTestScriptTestScriptVariableComponent(xpp, res));
16376      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rule")) {
16377        res.getRule().add(parseTestScriptTestScriptRuleComponent(xpp, res));
16378      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ruleset")) {
16379        res.getRuleset().add(parseTestScriptTestScriptRulesetComponent(xpp, res));
16380      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("setup")) {
16381        res.setSetup(parseTestScriptTestScriptSetupComponent(xpp, res));
16382      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("test")) {
16383        res.getTest().add(parseTestScriptTestScriptTestComponent(xpp, res));
16384      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("teardown")) {
16385        res.setTeardown(parseTestScriptTestScriptTeardownComponent(xpp, res));
16386      } else if (!parseDomainResourceContent(eventType, xpp, res))
16387        return false;
16388    return true;
16389  }
16390
16391  protected TestScript.TestScriptOriginComponent parseTestScriptTestScriptOriginComponent(XmlPullParser xpp, TestScript owner) throws XmlPullParserException, IOException, FHIRFormatError {
16392    TestScript.TestScriptOriginComponent res = new TestScript.TestScriptOriginComponent();
16393    parseBackboneAttributes(xpp, res);
16394    next(xpp);
16395    int eventType = nextNoWhitespace(xpp);
16396    while (eventType != XmlPullParser.END_TAG) {
16397  if (!parseTestScriptTestScriptOriginComponentContent(eventType, xpp, owner, res))
16398        unknownContent(xpp);
16399      eventType = nextNoWhitespace(xpp);
16400    }
16401    next(xpp);
16402    parseElementClose(res);
16403    return res;
16404  }
16405
16406  protected boolean parseTestScriptTestScriptOriginComponentContent(int eventType, XmlPullParser xpp, TestScript owner, TestScript.TestScriptOriginComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16407      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("index")) {
16408        res.setIndexElement(parseInteger(xpp));
16409      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
16410        res.setProfile(parseCoding(xpp));
16411      } else if (!parseBackboneContent(eventType, xpp, res))
16412        return false;
16413    return true;
16414  }
16415
16416  protected TestScript.TestScriptDestinationComponent parseTestScriptTestScriptDestinationComponent(XmlPullParser xpp, TestScript owner) throws XmlPullParserException, IOException, FHIRFormatError {
16417    TestScript.TestScriptDestinationComponent res = new TestScript.TestScriptDestinationComponent();
16418    parseBackboneAttributes(xpp, res);
16419    next(xpp);
16420    int eventType = nextNoWhitespace(xpp);
16421    while (eventType != XmlPullParser.END_TAG) {
16422  if (!parseTestScriptTestScriptDestinationComponentContent(eventType, xpp, owner, res))
16423        unknownContent(xpp);
16424      eventType = nextNoWhitespace(xpp);
16425    }
16426    next(xpp);
16427    parseElementClose(res);
16428    return res;
16429  }
16430
16431  protected boolean parseTestScriptTestScriptDestinationComponentContent(int eventType, XmlPullParser xpp, TestScript owner, TestScript.TestScriptDestinationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16432      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("index")) {
16433        res.setIndexElement(parseInteger(xpp));
16434      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
16435        res.setProfile(parseCoding(xpp));
16436      } else if (!parseBackboneContent(eventType, xpp, res))
16437        return false;
16438    return true;
16439  }
16440
16441  protected TestScript.TestScriptMetadataComponent parseTestScriptTestScriptMetadataComponent(XmlPullParser xpp, TestScript owner) throws XmlPullParserException, IOException, FHIRFormatError {
16442    TestScript.TestScriptMetadataComponent res = new TestScript.TestScriptMetadataComponent();
16443    parseBackboneAttributes(xpp, res);
16444    next(xpp);
16445    int eventType = nextNoWhitespace(xpp);
16446    while (eventType != XmlPullParser.END_TAG) {
16447  if (!parseTestScriptTestScriptMetadataComponentContent(eventType, xpp, owner, res))
16448        unknownContent(xpp);
16449      eventType = nextNoWhitespace(xpp);
16450    }
16451    next(xpp);
16452    parseElementClose(res);
16453    return res;
16454  }
16455
16456  protected boolean parseTestScriptTestScriptMetadataComponentContent(int eventType, XmlPullParser xpp, TestScript owner, TestScript.TestScriptMetadataComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16457      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("link")) {
16458        res.getLink().add(parseTestScriptTestScriptMetadataLinkComponent(xpp, owner));
16459      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("capability")) {
16460        res.getCapability().add(parseTestScriptTestScriptMetadataCapabilityComponent(xpp, owner));
16461      } else if (!parseBackboneContent(eventType, xpp, res))
16462        return false;
16463    return true;
16464  }
16465
16466  protected TestScript.TestScriptMetadataLinkComponent parseTestScriptTestScriptMetadataLinkComponent(XmlPullParser xpp, TestScript owner) throws XmlPullParserException, IOException, FHIRFormatError {
16467    TestScript.TestScriptMetadataLinkComponent res = new TestScript.TestScriptMetadataLinkComponent();
16468    parseBackboneAttributes(xpp, res);
16469    next(xpp);
16470    int eventType = nextNoWhitespace(xpp);
16471    while (eventType != XmlPullParser.END_TAG) {
16472  if (!parseTestScriptTestScriptMetadataLinkComponentContent(eventType, xpp, owner, res))
16473        unknownContent(xpp);
16474      eventType = nextNoWhitespace(xpp);
16475    }
16476    next(xpp);
16477    parseElementClose(res);
16478    return res;
16479  }
16480
16481  protected boolean parseTestScriptTestScriptMetadataLinkComponentContent(int eventType, XmlPullParser xpp, TestScript owner, TestScript.TestScriptMetadataLinkComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16482      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
16483        res.setUrlElement(parseUri(xpp));
16484      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
16485        res.setDescriptionElement(parseString(xpp));
16486      } else if (!parseBackboneContent(eventType, xpp, res))
16487        return false;
16488    return true;
16489  }
16490
16491  protected TestScript.TestScriptMetadataCapabilityComponent parseTestScriptTestScriptMetadataCapabilityComponent(XmlPullParser xpp, TestScript owner) throws XmlPullParserException, IOException, FHIRFormatError {
16492    TestScript.TestScriptMetadataCapabilityComponent res = new TestScript.TestScriptMetadataCapabilityComponent();
16493    parseBackboneAttributes(xpp, res);
16494    next(xpp);
16495    int eventType = nextNoWhitespace(xpp);
16496    while (eventType != XmlPullParser.END_TAG) {
16497  if (!parseTestScriptTestScriptMetadataCapabilityComponentContent(eventType, xpp, owner, res))
16498        unknownContent(xpp);
16499      eventType = nextNoWhitespace(xpp);
16500    }
16501    next(xpp);
16502    parseElementClose(res);
16503    return res;
16504  }
16505
16506  protected boolean parseTestScriptTestScriptMetadataCapabilityComponentContent(int eventType, XmlPullParser xpp, TestScript owner, TestScript.TestScriptMetadataCapabilityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16507      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("required")) {
16508        res.setRequiredElement(parseBoolean(xpp));
16509      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("validated")) {
16510        res.setValidatedElement(parseBoolean(xpp));
16511      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
16512        res.setDescriptionElement(parseString(xpp));
16513      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("origin")) {
16514        res.getOrigin().add(parseInteger(xpp));
16515      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("destination")) {
16516        res.setDestinationElement(parseInteger(xpp));
16517      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("link")) {
16518        res.getLink().add(parseUri(xpp));
16519      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("capabilities")) {
16520        res.setCapabilities(parseReference(xpp));
16521      } else if (!parseBackboneContent(eventType, xpp, res))
16522        return false;
16523    return true;
16524  }
16525
16526  protected TestScript.TestScriptFixtureComponent parseTestScriptTestScriptFixtureComponent(XmlPullParser xpp, TestScript owner) throws XmlPullParserException, IOException, FHIRFormatError {
16527    TestScript.TestScriptFixtureComponent res = new TestScript.TestScriptFixtureComponent();
16528    parseBackboneAttributes(xpp, res);
16529    next(xpp);
16530    int eventType = nextNoWhitespace(xpp);
16531    while (eventType != XmlPullParser.END_TAG) {
16532  if (!parseTestScriptTestScriptFixtureComponentContent(eventType, xpp, owner, res))
16533        unknownContent(xpp);
16534      eventType = nextNoWhitespace(xpp);
16535    }
16536    next(xpp);
16537    parseElementClose(res);
16538    return res;
16539  }
16540
16541  protected boolean parseTestScriptTestScriptFixtureComponentContent(int eventType, XmlPullParser xpp, TestScript owner, TestScript.TestScriptFixtureComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16542      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("autocreate")) {
16543        res.setAutocreateElement(parseBoolean(xpp));
16544      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("autodelete")) {
16545        res.setAutodeleteElement(parseBoolean(xpp));
16546      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
16547        res.setResource(parseReference(xpp));
16548      } else if (!parseBackboneContent(eventType, xpp, res))
16549        return false;
16550    return true;
16551  }
16552
16553  protected TestScript.TestScriptVariableComponent parseTestScriptTestScriptVariableComponent(XmlPullParser xpp, TestScript owner) throws XmlPullParserException, IOException, FHIRFormatError {
16554    TestScript.TestScriptVariableComponent res = new TestScript.TestScriptVariableComponent();
16555    parseBackboneAttributes(xpp, res);
16556    next(xpp);
16557    int eventType = nextNoWhitespace(xpp);
16558    while (eventType != XmlPullParser.END_TAG) {
16559  if (!parseTestScriptTestScriptVariableComponentContent(eventType, xpp, owner, res))
16560        unknownContent(xpp);
16561      eventType = nextNoWhitespace(xpp);
16562    }
16563    next(xpp);
16564    parseElementClose(res);
16565    return res;
16566  }
16567
16568  protected boolean parseTestScriptTestScriptVariableComponentContent(int eventType, XmlPullParser xpp, TestScript owner, TestScript.TestScriptVariableComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16569      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
16570        res.setNameElement(parseString(xpp));
16571      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("defaultValue")) {
16572        res.setDefaultValueElement(parseString(xpp));
16573      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
16574        res.setDescriptionElement(parseString(xpp));
16575      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expression")) {
16576        res.setExpressionElement(parseString(xpp));
16577      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("headerField")) {
16578        res.setHeaderFieldElement(parseString(xpp));
16579      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("hint")) {
16580        res.setHintElement(parseString(xpp));
16581      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
16582        res.setPathElement(parseString(xpp));
16583      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sourceId")) {
16584        res.setSourceIdElement(parseId(xpp));
16585      } else if (!parseBackboneContent(eventType, xpp, res))
16586        return false;
16587    return true;
16588  }
16589
16590  protected TestScript.TestScriptRuleComponent parseTestScriptTestScriptRuleComponent(XmlPullParser xpp, TestScript owner) throws XmlPullParserException, IOException, FHIRFormatError {
16591    TestScript.TestScriptRuleComponent res = new TestScript.TestScriptRuleComponent();
16592    parseBackboneAttributes(xpp, res);
16593    next(xpp);
16594    int eventType = nextNoWhitespace(xpp);
16595    while (eventType != XmlPullParser.END_TAG) {
16596  if (!parseTestScriptTestScriptRuleComponentContent(eventType, xpp, owner, res))
16597        unknownContent(xpp);
16598      eventType = nextNoWhitespace(xpp);
16599    }
16600    next(xpp);
16601    parseElementClose(res);
16602    return res;
16603  }
16604
16605  protected boolean parseTestScriptTestScriptRuleComponentContent(int eventType, XmlPullParser xpp, TestScript owner, TestScript.TestScriptRuleComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16606      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
16607        res.setResource(parseReference(xpp));
16608      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("param")) {
16609        res.getParam().add(parseTestScriptRuleParamComponent(xpp, owner));
16610      } else if (!parseBackboneContent(eventType, xpp, res))
16611        return false;
16612    return true;
16613  }
16614
16615  protected TestScript.RuleParamComponent parseTestScriptRuleParamComponent(XmlPullParser xpp, TestScript owner) throws XmlPullParserException, IOException, FHIRFormatError {
16616    TestScript.RuleParamComponent res = new TestScript.RuleParamComponent();
16617    parseBackboneAttributes(xpp, res);
16618    next(xpp);
16619    int eventType = nextNoWhitespace(xpp);
16620    while (eventType != XmlPullParser.END_TAG) {
16621  if (!parseTestScriptRuleParamComponentContent(eventType, xpp, owner, res))
16622        unknownContent(xpp);
16623      eventType = nextNoWhitespace(xpp);
16624    }
16625    next(xpp);
16626    parseElementClose(res);
16627    return res;
16628  }
16629
16630  protected boolean parseTestScriptRuleParamComponentContent(int eventType, XmlPullParser xpp, TestScript owner, TestScript.RuleParamComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16631      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
16632        res.setNameElement(parseString(xpp));
16633      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
16634        res.setValueElement(parseString(xpp));
16635      } else if (!parseBackboneContent(eventType, xpp, res))
16636        return false;
16637    return true;
16638  }
16639
16640  protected TestScript.TestScriptRulesetComponent parseTestScriptTestScriptRulesetComponent(XmlPullParser xpp, TestScript owner) throws XmlPullParserException, IOException, FHIRFormatError {
16641    TestScript.TestScriptRulesetComponent res = new TestScript.TestScriptRulesetComponent();
16642    parseBackboneAttributes(xpp, res);
16643    next(xpp);
16644    int eventType = nextNoWhitespace(xpp);
16645    while (eventType != XmlPullParser.END_TAG) {
16646  if (!parseTestScriptTestScriptRulesetComponentContent(eventType, xpp, owner, res))
16647        unknownContent(xpp);
16648      eventType = nextNoWhitespace(xpp);
16649    }
16650    next(xpp);
16651    parseElementClose(res);
16652    return res;
16653  }
16654
16655  protected boolean parseTestScriptTestScriptRulesetComponentContent(int eventType, XmlPullParser xpp, TestScript owner, TestScript.TestScriptRulesetComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16656      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
16657        res.setResource(parseReference(xpp));
16658      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rule")) {
16659        res.getRule().add(parseTestScriptRulesetRuleComponent(xpp, owner));
16660      } else if (!parseBackboneContent(eventType, xpp, res))
16661        return false;
16662    return true;
16663  }
16664
16665  protected TestScript.RulesetRuleComponent parseTestScriptRulesetRuleComponent(XmlPullParser xpp, TestScript owner) throws XmlPullParserException, IOException, FHIRFormatError {
16666    TestScript.RulesetRuleComponent res = new TestScript.RulesetRuleComponent();
16667    parseBackboneAttributes(xpp, res);
16668    next(xpp);
16669    int eventType = nextNoWhitespace(xpp);
16670    while (eventType != XmlPullParser.END_TAG) {
16671  if (!parseTestScriptRulesetRuleComponentContent(eventType, xpp, owner, res))
16672        unknownContent(xpp);
16673      eventType = nextNoWhitespace(xpp);
16674    }
16675    next(xpp);
16676    parseElementClose(res);
16677    return res;
16678  }
16679
16680  protected boolean parseTestScriptRulesetRuleComponentContent(int eventType, XmlPullParser xpp, TestScript owner, TestScript.RulesetRuleComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16681      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ruleId")) {
16682        res.setRuleIdElement(parseId(xpp));
16683      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("param")) {
16684        res.getParam().add(parseTestScriptRulesetRuleParamComponent(xpp, owner));
16685      } else if (!parseBackboneContent(eventType, xpp, res))
16686        return false;
16687    return true;
16688  }
16689
16690  protected TestScript.RulesetRuleParamComponent parseTestScriptRulesetRuleParamComponent(XmlPullParser xpp, TestScript owner) throws XmlPullParserException, IOException, FHIRFormatError {
16691    TestScript.RulesetRuleParamComponent res = new TestScript.RulesetRuleParamComponent();
16692    parseBackboneAttributes(xpp, res);
16693    next(xpp);
16694    int eventType = nextNoWhitespace(xpp);
16695    while (eventType != XmlPullParser.END_TAG) {
16696  if (!parseTestScriptRulesetRuleParamComponentContent(eventType, xpp, owner, res))
16697        unknownContent(xpp);
16698      eventType = nextNoWhitespace(xpp);
16699    }
16700    next(xpp);
16701    parseElementClose(res);
16702    return res;
16703  }
16704
16705  protected boolean parseTestScriptRulesetRuleParamComponentContent(int eventType, XmlPullParser xpp, TestScript owner, TestScript.RulesetRuleParamComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16706      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
16707        res.setNameElement(parseString(xpp));
16708      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
16709        res.setValueElement(parseString(xpp));
16710      } else if (!parseBackboneContent(eventType, xpp, res))
16711        return false;
16712    return true;
16713  }
16714
16715  protected TestScript.TestScriptSetupComponent parseTestScriptTestScriptSetupComponent(XmlPullParser xpp, TestScript owner) throws XmlPullParserException, IOException, FHIRFormatError {
16716    TestScript.TestScriptSetupComponent res = new TestScript.TestScriptSetupComponent();
16717    parseBackboneAttributes(xpp, res);
16718    next(xpp);
16719    int eventType = nextNoWhitespace(xpp);
16720    while (eventType != XmlPullParser.END_TAG) {
16721  if (!parseTestScriptTestScriptSetupComponentContent(eventType, xpp, owner, res))
16722        unknownContent(xpp);
16723      eventType = nextNoWhitespace(xpp);
16724    }
16725    next(xpp);
16726    parseElementClose(res);
16727    return res;
16728  }
16729
16730  protected boolean parseTestScriptTestScriptSetupComponentContent(int eventType, XmlPullParser xpp, TestScript owner, TestScript.TestScriptSetupComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16731      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
16732        res.getAction().add(parseTestScriptSetupActionComponent(xpp, owner));
16733      } else if (!parseBackboneContent(eventType, xpp, res))
16734        return false;
16735    return true;
16736  }
16737
16738  protected TestScript.SetupActionComponent parseTestScriptSetupActionComponent(XmlPullParser xpp, TestScript owner) throws XmlPullParserException, IOException, FHIRFormatError {
16739    TestScript.SetupActionComponent res = new TestScript.SetupActionComponent();
16740    parseBackboneAttributes(xpp, res);
16741    next(xpp);
16742    int eventType = nextNoWhitespace(xpp);
16743    while (eventType != XmlPullParser.END_TAG) {
16744  if (!parseTestScriptSetupActionComponentContent(eventType, xpp, owner, res))
16745        unknownContent(xpp);
16746      eventType = nextNoWhitespace(xpp);
16747    }
16748    next(xpp);
16749    parseElementClose(res);
16750    return res;
16751  }
16752
16753  protected boolean parseTestScriptSetupActionComponentContent(int eventType, XmlPullParser xpp, TestScript owner, TestScript.SetupActionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16754      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operation")) {
16755        res.setOperation(parseTestScriptSetupActionOperationComponent(xpp, owner));
16756      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("assert")) {
16757        res.setAssert(parseTestScriptSetupActionAssertComponent(xpp, owner));
16758      } else if (!parseBackboneContent(eventType, xpp, res))
16759        return false;
16760    return true;
16761  }
16762
16763  protected TestScript.SetupActionOperationComponent parseTestScriptSetupActionOperationComponent(XmlPullParser xpp, TestScript owner) throws XmlPullParserException, IOException, FHIRFormatError {
16764    TestScript.SetupActionOperationComponent res = new TestScript.SetupActionOperationComponent();
16765    parseBackboneAttributes(xpp, res);
16766    next(xpp);
16767    int eventType = nextNoWhitespace(xpp);
16768    while (eventType != XmlPullParser.END_TAG) {
16769  if (!parseTestScriptSetupActionOperationComponentContent(eventType, xpp, owner, res))
16770        unknownContent(xpp);
16771      eventType = nextNoWhitespace(xpp);
16772    }
16773    next(xpp);
16774    parseElementClose(res);
16775    return res;
16776  }
16777
16778  protected boolean parseTestScriptSetupActionOperationComponentContent(int eventType, XmlPullParser xpp, TestScript owner, TestScript.SetupActionOperationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16779      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
16780        res.setType(parseCoding(xpp));
16781      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
16782        res.setResourceElement(parseCode(xpp));
16783      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("label")) {
16784        res.setLabelElement(parseString(xpp));
16785      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
16786        res.setDescriptionElement(parseString(xpp));
16787      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("accept")) {
16788        res.setAcceptElement(parseEnumeration(xpp, TestScript.ContentType.NULL, new TestScript.ContentTypeEnumFactory()));
16789      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contentType")) {
16790        res.setContentTypeElement(parseEnumeration(xpp, TestScript.ContentType.NULL, new TestScript.ContentTypeEnumFactory()));
16791      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("destination")) {
16792        res.setDestinationElement(parseInteger(xpp));
16793      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encodeRequestUrl")) {
16794        res.setEncodeRequestUrlElement(parseBoolean(xpp));
16795      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("origin")) {
16796        res.setOriginElement(parseInteger(xpp));
16797      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("params")) {
16798        res.setParamsElement(parseString(xpp));
16799      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestHeader")) {
16800        res.getRequestHeader().add(parseTestScriptSetupActionOperationRequestHeaderComponent(xpp, owner));
16801      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestId")) {
16802        res.setRequestIdElement(parseId(xpp));
16803      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("responseId")) {
16804        res.setResponseIdElement(parseId(xpp));
16805      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sourceId")) {
16806        res.setSourceIdElement(parseId(xpp));
16807      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("targetId")) {
16808        res.setTargetIdElement(parseId(xpp));
16809      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
16810        res.setUrlElement(parseString(xpp));
16811      } else if (!parseBackboneContent(eventType, xpp, res))
16812        return false;
16813    return true;
16814  }
16815
16816  protected TestScript.SetupActionOperationRequestHeaderComponent parseTestScriptSetupActionOperationRequestHeaderComponent(XmlPullParser xpp, TestScript owner) throws XmlPullParserException, IOException, FHIRFormatError {
16817    TestScript.SetupActionOperationRequestHeaderComponent res = new TestScript.SetupActionOperationRequestHeaderComponent();
16818    parseBackboneAttributes(xpp, res);
16819    next(xpp);
16820    int eventType = nextNoWhitespace(xpp);
16821    while (eventType != XmlPullParser.END_TAG) {
16822  if (!parseTestScriptSetupActionOperationRequestHeaderComponentContent(eventType, xpp, owner, res))
16823        unknownContent(xpp);
16824      eventType = nextNoWhitespace(xpp);
16825    }
16826    next(xpp);
16827    parseElementClose(res);
16828    return res;
16829  }
16830
16831  protected boolean parseTestScriptSetupActionOperationRequestHeaderComponentContent(int eventType, XmlPullParser xpp, TestScript owner, TestScript.SetupActionOperationRequestHeaderComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16832      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("field")) {
16833        res.setFieldElement(parseString(xpp));
16834      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
16835        res.setValueElement(parseString(xpp));
16836      } else if (!parseBackboneContent(eventType, xpp, res))
16837        return false;
16838    return true;
16839  }
16840
16841  protected TestScript.SetupActionAssertComponent parseTestScriptSetupActionAssertComponent(XmlPullParser xpp, TestScript owner) throws XmlPullParserException, IOException, FHIRFormatError {
16842    TestScript.SetupActionAssertComponent res = new TestScript.SetupActionAssertComponent();
16843    parseBackboneAttributes(xpp, res);
16844    next(xpp);
16845    int eventType = nextNoWhitespace(xpp);
16846    while (eventType != XmlPullParser.END_TAG) {
16847  if (!parseTestScriptSetupActionAssertComponentContent(eventType, xpp, owner, res))
16848        unknownContent(xpp);
16849      eventType = nextNoWhitespace(xpp);
16850    }
16851    next(xpp);
16852    parseElementClose(res);
16853    return res;
16854  }
16855
16856  protected boolean parseTestScriptSetupActionAssertComponentContent(int eventType, XmlPullParser xpp, TestScript owner, TestScript.SetupActionAssertComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16857      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("label")) {
16858        res.setLabelElement(parseString(xpp));
16859      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
16860        res.setDescriptionElement(parseString(xpp));
16861      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("direction")) {
16862        res.setDirectionElement(parseEnumeration(xpp, TestScript.AssertionDirectionType.NULL, new TestScript.AssertionDirectionTypeEnumFactory()));
16863      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("compareToSourceId")) {
16864        res.setCompareToSourceIdElement(parseString(xpp));
16865      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("compareToSourceExpression")) {
16866        res.setCompareToSourceExpressionElement(parseString(xpp));
16867      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("compareToSourcePath")) {
16868        res.setCompareToSourcePathElement(parseString(xpp));
16869      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contentType")) {
16870        res.setContentTypeElement(parseEnumeration(xpp, TestScript.ContentType.NULL, new TestScript.ContentTypeEnumFactory()));
16871      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expression")) {
16872        res.setExpressionElement(parseString(xpp));
16873      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("headerField")) {
16874        res.setHeaderFieldElement(parseString(xpp));
16875      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("minimumId")) {
16876        res.setMinimumIdElement(parseString(xpp));
16877      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("navigationLinks")) {
16878        res.setNavigationLinksElement(parseBoolean(xpp));
16879      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operator")) {
16880        res.setOperatorElement(parseEnumeration(xpp, TestScript.AssertionOperatorType.NULL, new TestScript.AssertionOperatorTypeEnumFactory()));
16881      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
16882        res.setPathElement(parseString(xpp));
16883      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestMethod")) {
16884        res.setRequestMethodElement(parseEnumeration(xpp, TestScript.TestScriptRequestMethodCode.NULL, new TestScript.TestScriptRequestMethodCodeEnumFactory()));
16885      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestURL")) {
16886        res.setRequestURLElement(parseString(xpp));
16887      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
16888        res.setResourceElement(parseCode(xpp));
16889      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("response")) {
16890        res.setResponseElement(parseEnumeration(xpp, TestScript.AssertionResponseTypes.NULL, new TestScript.AssertionResponseTypesEnumFactory()));
16891      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("responseCode")) {
16892        res.setResponseCodeElement(parseString(xpp));
16893      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rule")) {
16894        res.setRule(parseTestScriptActionAssertRuleComponent(xpp, owner));
16895      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ruleset")) {
16896        res.setRuleset(parseTestScriptActionAssertRulesetComponent(xpp, owner));
16897      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sourceId")) {
16898        res.setSourceIdElement(parseId(xpp));
16899      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("validateProfileId")) {
16900        res.setValidateProfileIdElement(parseId(xpp));
16901      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
16902        res.setValueElement(parseString(xpp));
16903      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("warningOnly")) {
16904        res.setWarningOnlyElement(parseBoolean(xpp));
16905      } else if (!parseBackboneContent(eventType, xpp, res))
16906        return false;
16907    return true;
16908  }
16909
16910  protected TestScript.ActionAssertRuleComponent parseTestScriptActionAssertRuleComponent(XmlPullParser xpp, TestScript owner) throws XmlPullParserException, IOException, FHIRFormatError {
16911    TestScript.ActionAssertRuleComponent res = new TestScript.ActionAssertRuleComponent();
16912    parseBackboneAttributes(xpp, res);
16913    next(xpp);
16914    int eventType = nextNoWhitespace(xpp);
16915    while (eventType != XmlPullParser.END_TAG) {
16916  if (!parseTestScriptActionAssertRuleComponentContent(eventType, xpp, owner, res))
16917        unknownContent(xpp);
16918      eventType = nextNoWhitespace(xpp);
16919    }
16920    next(xpp);
16921    parseElementClose(res);
16922    return res;
16923  }
16924
16925  protected boolean parseTestScriptActionAssertRuleComponentContent(int eventType, XmlPullParser xpp, TestScript owner, TestScript.ActionAssertRuleComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16926      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ruleId")) {
16927        res.setRuleIdElement(parseId(xpp));
16928      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("param")) {
16929        res.getParam().add(parseTestScriptActionAssertRuleParamComponent(xpp, owner));
16930      } else if (!parseBackboneContent(eventType, xpp, res))
16931        return false;
16932    return true;
16933  }
16934
16935  protected TestScript.ActionAssertRuleParamComponent parseTestScriptActionAssertRuleParamComponent(XmlPullParser xpp, TestScript owner) throws XmlPullParserException, IOException, FHIRFormatError {
16936    TestScript.ActionAssertRuleParamComponent res = new TestScript.ActionAssertRuleParamComponent();
16937    parseBackboneAttributes(xpp, res);
16938    next(xpp);
16939    int eventType = nextNoWhitespace(xpp);
16940    while (eventType != XmlPullParser.END_TAG) {
16941  if (!parseTestScriptActionAssertRuleParamComponentContent(eventType, xpp, owner, res))
16942        unknownContent(xpp);
16943      eventType = nextNoWhitespace(xpp);
16944    }
16945    next(xpp);
16946    parseElementClose(res);
16947    return res;
16948  }
16949
16950  protected boolean parseTestScriptActionAssertRuleParamComponentContent(int eventType, XmlPullParser xpp, TestScript owner, TestScript.ActionAssertRuleParamComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16951      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
16952        res.setNameElement(parseString(xpp));
16953      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
16954        res.setValueElement(parseString(xpp));
16955      } else if (!parseBackboneContent(eventType, xpp, res))
16956        return false;
16957    return true;
16958  }
16959
16960  protected TestScript.ActionAssertRulesetComponent parseTestScriptActionAssertRulesetComponent(XmlPullParser xpp, TestScript owner) throws XmlPullParserException, IOException, FHIRFormatError {
16961    TestScript.ActionAssertRulesetComponent res = new TestScript.ActionAssertRulesetComponent();
16962    parseBackboneAttributes(xpp, res);
16963    next(xpp);
16964    int eventType = nextNoWhitespace(xpp);
16965    while (eventType != XmlPullParser.END_TAG) {
16966  if (!parseTestScriptActionAssertRulesetComponentContent(eventType, xpp, owner, res))
16967        unknownContent(xpp);
16968      eventType = nextNoWhitespace(xpp);
16969    }
16970    next(xpp);
16971    parseElementClose(res);
16972    return res;
16973  }
16974
16975  protected boolean parseTestScriptActionAssertRulesetComponentContent(int eventType, XmlPullParser xpp, TestScript owner, TestScript.ActionAssertRulesetComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
16976      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rulesetId")) {
16977        res.setRulesetIdElement(parseId(xpp));
16978      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rule")) {
16979        res.getRule().add(parseTestScriptActionAssertRulesetRuleComponent(xpp, owner));
16980      } else if (!parseBackboneContent(eventType, xpp, res))
16981        return false;
16982    return true;
16983  }
16984
16985  protected TestScript.ActionAssertRulesetRuleComponent parseTestScriptActionAssertRulesetRuleComponent(XmlPullParser xpp, TestScript owner) throws XmlPullParserException, IOException, FHIRFormatError {
16986    TestScript.ActionAssertRulesetRuleComponent res = new TestScript.ActionAssertRulesetRuleComponent();
16987    parseBackboneAttributes(xpp, res);
16988    next(xpp);
16989    int eventType = nextNoWhitespace(xpp);
16990    while (eventType != XmlPullParser.END_TAG) {
16991  if (!parseTestScriptActionAssertRulesetRuleComponentContent(eventType, xpp, owner, res))
16992        unknownContent(xpp);
16993      eventType = nextNoWhitespace(xpp);
16994    }
16995    next(xpp);
16996    parseElementClose(res);
16997    return res;
16998  }
16999
17000  protected boolean parseTestScriptActionAssertRulesetRuleComponentContent(int eventType, XmlPullParser xpp, TestScript owner, TestScript.ActionAssertRulesetRuleComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
17001      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ruleId")) {
17002        res.setRuleIdElement(parseId(xpp));
17003      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("param")) {
17004        res.getParam().add(parseTestScriptActionAssertRulesetRuleParamComponent(xpp, owner));
17005      } else if (!parseBackboneContent(eventType, xpp, res))
17006        return false;
17007    return true;
17008  }
17009
17010  protected TestScript.ActionAssertRulesetRuleParamComponent parseTestScriptActionAssertRulesetRuleParamComponent(XmlPullParser xpp, TestScript owner) throws XmlPullParserException, IOException, FHIRFormatError {
17011    TestScript.ActionAssertRulesetRuleParamComponent res = new TestScript.ActionAssertRulesetRuleParamComponent();
17012    parseBackboneAttributes(xpp, res);
17013    next(xpp);
17014    int eventType = nextNoWhitespace(xpp);
17015    while (eventType != XmlPullParser.END_TAG) {
17016  if (!parseTestScriptActionAssertRulesetRuleParamComponentContent(eventType, xpp, owner, res))
17017        unknownContent(xpp);
17018      eventType = nextNoWhitespace(xpp);
17019    }
17020    next(xpp);
17021    parseElementClose(res);
17022    return res;
17023  }
17024
17025  protected boolean parseTestScriptActionAssertRulesetRuleParamComponentContent(int eventType, XmlPullParser xpp, TestScript owner, TestScript.ActionAssertRulesetRuleParamComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
17026      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
17027        res.setNameElement(parseString(xpp));
17028      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
17029        res.setValueElement(parseString(xpp));
17030      } else if (!parseBackboneContent(eventType, xpp, res))
17031        return false;
17032    return true;
17033  }
17034
17035  protected TestScript.TestScriptTestComponent parseTestScriptTestScriptTestComponent(XmlPullParser xpp, TestScript owner) throws XmlPullParserException, IOException, FHIRFormatError {
17036    TestScript.TestScriptTestComponent res = new TestScript.TestScriptTestComponent();
17037    parseBackboneAttributes(xpp, res);
17038    next(xpp);
17039    int eventType = nextNoWhitespace(xpp);
17040    while (eventType != XmlPullParser.END_TAG) {
17041  if (!parseTestScriptTestScriptTestComponentContent(eventType, xpp, owner, res))
17042        unknownContent(xpp);
17043      eventType = nextNoWhitespace(xpp);
17044    }
17045    next(xpp);
17046    parseElementClose(res);
17047    return res;
17048  }
17049
17050  protected boolean parseTestScriptTestScriptTestComponentContent(int eventType, XmlPullParser xpp, TestScript owner, TestScript.TestScriptTestComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
17051      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
17052        res.setNameElement(parseString(xpp));
17053      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
17054        res.setDescriptionElement(parseString(xpp));
17055      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
17056        res.getAction().add(parseTestScriptTestActionComponent(xpp, owner));
17057      } else if (!parseBackboneContent(eventType, xpp, res))
17058        return false;
17059    return true;
17060  }
17061
17062  protected TestScript.TestActionComponent parseTestScriptTestActionComponent(XmlPullParser xpp, TestScript owner) throws XmlPullParserException, IOException, FHIRFormatError {
17063    TestScript.TestActionComponent res = new TestScript.TestActionComponent();
17064    parseBackboneAttributes(xpp, res);
17065    next(xpp);
17066    int eventType = nextNoWhitespace(xpp);
17067    while (eventType != XmlPullParser.END_TAG) {
17068  if (!parseTestScriptTestActionComponentContent(eventType, xpp, owner, res))
17069        unknownContent(xpp);
17070      eventType = nextNoWhitespace(xpp);
17071    }
17072    next(xpp);
17073    parseElementClose(res);
17074    return res;
17075  }
17076
17077  protected boolean parseTestScriptTestActionComponentContent(int eventType, XmlPullParser xpp, TestScript owner, TestScript.TestActionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
17078      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operation")) {
17079        res.setOperation(parseTestScriptSetupActionOperationComponent(xpp, owner));
17080      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("assert")) {
17081        res.setAssert(parseTestScriptSetupActionAssertComponent(xpp, owner));
17082      } else if (!parseBackboneContent(eventType, xpp, res))
17083        return false;
17084    return true;
17085  }
17086
17087  protected TestScript.TestScriptTeardownComponent parseTestScriptTestScriptTeardownComponent(XmlPullParser xpp, TestScript owner) throws XmlPullParserException, IOException, FHIRFormatError {
17088    TestScript.TestScriptTeardownComponent res = new TestScript.TestScriptTeardownComponent();
17089    parseBackboneAttributes(xpp, res);
17090    next(xpp);
17091    int eventType = nextNoWhitespace(xpp);
17092    while (eventType != XmlPullParser.END_TAG) {
17093  if (!parseTestScriptTestScriptTeardownComponentContent(eventType, xpp, owner, res))
17094        unknownContent(xpp);
17095      eventType = nextNoWhitespace(xpp);
17096    }
17097    next(xpp);
17098    parseElementClose(res);
17099    return res;
17100  }
17101
17102  protected boolean parseTestScriptTestScriptTeardownComponentContent(int eventType, XmlPullParser xpp, TestScript owner, TestScript.TestScriptTeardownComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
17103      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
17104        res.getAction().add(parseTestScriptTeardownActionComponent(xpp, owner));
17105      } else if (!parseBackboneContent(eventType, xpp, res))
17106        return false;
17107    return true;
17108  }
17109
17110  protected TestScript.TeardownActionComponent parseTestScriptTeardownActionComponent(XmlPullParser xpp, TestScript owner) throws XmlPullParserException, IOException, FHIRFormatError {
17111    TestScript.TeardownActionComponent res = new TestScript.TeardownActionComponent();
17112    parseBackboneAttributes(xpp, res);
17113    next(xpp);
17114    int eventType = nextNoWhitespace(xpp);
17115    while (eventType != XmlPullParser.END_TAG) {
17116  if (!parseTestScriptTeardownActionComponentContent(eventType, xpp, owner, res))
17117        unknownContent(xpp);
17118      eventType = nextNoWhitespace(xpp);
17119    }
17120    next(xpp);
17121    parseElementClose(res);
17122    return res;
17123  }
17124
17125  protected boolean parseTestScriptTeardownActionComponentContent(int eventType, XmlPullParser xpp, TestScript owner, TestScript.TeardownActionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
17126      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operation")) {
17127        res.setOperation(parseTestScriptSetupActionOperationComponent(xpp, owner));
17128      } else if (!parseBackboneContent(eventType, xpp, res))
17129        return false;
17130    return true;
17131  }
17132
17133  protected ValueSet parseValueSet(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
17134    ValueSet res = new ValueSet();
17135    parseDomainResourceAttributes(xpp, res);
17136    next(xpp);
17137    int eventType = nextNoWhitespace(xpp);
17138    while (eventType != XmlPullParser.END_TAG) {
17139  if (!parseValueSetContent(eventType, xpp, res))
17140        unknownContent(xpp);
17141      eventType = nextNoWhitespace(xpp);
17142    }
17143    next(xpp);
17144    parseElementClose(res);
17145    return res;
17146  }
17147
17148  protected boolean parseValueSetContent(int eventType, XmlPullParser xpp, ValueSet res) throws XmlPullParserException, IOException, FHIRFormatError {
17149      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
17150        res.setUrlElement(parseUri(xpp));
17151      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
17152        res.getIdentifier().add(parseIdentifier(xpp));
17153      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
17154        res.setVersionElement(parseString(xpp));
17155      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
17156        res.setNameElement(parseString(xpp));
17157      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
17158        res.setTitleElement(parseString(xpp));
17159      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
17160        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
17161      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
17162        res.setExperimentalElement(parseBoolean(xpp));
17163      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
17164        res.setDateElement(parseDateTime(xpp));
17165      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
17166        res.setPublisherElement(parseString(xpp));
17167      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
17168        res.getContact().add(parseContactDetail(xpp));
17169      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
17170        res.setDescriptionElement(parseMarkdown(xpp));
17171      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
17172        res.getUseContext().add(parseUsageContext(xpp));
17173      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
17174        res.getJurisdiction().add(parseCodeableConcept(xpp));
17175      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("immutable")) {
17176        res.setImmutableElement(parseBoolean(xpp));
17177      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
17178        res.setPurposeElement(parseMarkdown(xpp));
17179      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
17180        res.setCopyrightElement(parseMarkdown(xpp));
17181      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("extensible")) {
17182        res.setExtensibleElement(parseBoolean(xpp));
17183      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("compose")) {
17184        res.setCompose(parseValueSetValueSetComposeComponent(xpp, res));
17185      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expansion")) {
17186        res.setExpansion(parseValueSetValueSetExpansionComponent(xpp, res));
17187      } else if (!parseDomainResourceContent(eventType, xpp, res))
17188        return false;
17189    return true;
17190  }
17191
17192  protected ValueSet.ValueSetComposeComponent parseValueSetValueSetComposeComponent(XmlPullParser xpp, ValueSet owner) throws XmlPullParserException, IOException, FHIRFormatError {
17193    ValueSet.ValueSetComposeComponent res = new ValueSet.ValueSetComposeComponent();
17194    parseBackboneAttributes(xpp, res);
17195    next(xpp);
17196    int eventType = nextNoWhitespace(xpp);
17197    while (eventType != XmlPullParser.END_TAG) {
17198  if (!parseValueSetValueSetComposeComponentContent(eventType, xpp, owner, res))
17199        unknownContent(xpp);
17200      eventType = nextNoWhitespace(xpp);
17201    }
17202    next(xpp);
17203    parseElementClose(res);
17204    return res;
17205  }
17206
17207  protected boolean parseValueSetValueSetComposeComponentContent(int eventType, XmlPullParser xpp, ValueSet owner, ValueSet.ValueSetComposeComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
17208      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lockedDate")) {
17209        res.setLockedDateElement(parseDate(xpp));
17210      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("inactive")) {
17211        res.setInactiveElement(parseBoolean(xpp));
17212      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("include")) {
17213        res.getInclude().add(parseValueSetConceptSetComponent(xpp, owner));
17214      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("exclude")) {
17215        res.getExclude().add(parseValueSetConceptSetComponent(xpp, owner));
17216      } else if (!parseBackboneContent(eventType, xpp, res))
17217        return false;
17218    return true;
17219  }
17220
17221  protected ValueSet.ConceptSetComponent parseValueSetConceptSetComponent(XmlPullParser xpp, ValueSet owner) throws XmlPullParserException, IOException, FHIRFormatError {
17222    ValueSet.ConceptSetComponent res = new ValueSet.ConceptSetComponent();
17223    parseBackboneAttributes(xpp, res);
17224    next(xpp);
17225    int eventType = nextNoWhitespace(xpp);
17226    while (eventType != XmlPullParser.END_TAG) {
17227  if (!parseValueSetConceptSetComponentContent(eventType, xpp, owner, res))
17228        unknownContent(xpp);
17229      eventType = nextNoWhitespace(xpp);
17230    }
17231    next(xpp);
17232    parseElementClose(res);
17233    return res;
17234  }
17235
17236  protected boolean parseValueSetConceptSetComponentContent(int eventType, XmlPullParser xpp, ValueSet owner, ValueSet.ConceptSetComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
17237      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
17238        res.setSystemElement(parseUri(xpp));
17239      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
17240        res.setVersionElement(parseString(xpp));
17241      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("concept")) {
17242        res.getConcept().add(parseValueSetConceptReferenceComponent(xpp, owner));
17243      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("filter")) {
17244        res.getFilter().add(parseValueSetConceptSetFilterComponent(xpp, owner));
17245      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueSet")) {
17246        res.getValueSet().add(parseUri(xpp));
17247      } else if (!parseBackboneContent(eventType, xpp, res))
17248        return false;
17249    return true;
17250  }
17251
17252  protected ValueSet.ConceptReferenceComponent parseValueSetConceptReferenceComponent(XmlPullParser xpp, ValueSet owner) throws XmlPullParserException, IOException, FHIRFormatError {
17253    ValueSet.ConceptReferenceComponent res = new ValueSet.ConceptReferenceComponent();
17254    parseBackboneAttributes(xpp, res);
17255    next(xpp);
17256    int eventType = nextNoWhitespace(xpp);
17257    while (eventType != XmlPullParser.END_TAG) {
17258  if (!parseValueSetConceptReferenceComponentContent(eventType, xpp, owner, res))
17259        unknownContent(xpp);
17260      eventType = nextNoWhitespace(xpp);
17261    }
17262    next(xpp);
17263    parseElementClose(res);
17264    return res;
17265  }
17266
17267  protected boolean parseValueSetConceptReferenceComponentContent(int eventType, XmlPullParser xpp, ValueSet owner, ValueSet.ConceptReferenceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
17268      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
17269        res.setCodeElement(parseCode(xpp));
17270      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
17271        res.setDisplayElement(parseString(xpp));
17272      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("designation")) {
17273        res.getDesignation().add(parseValueSetConceptReferenceDesignationComponent(xpp, owner));
17274      } else if (!parseBackboneContent(eventType, xpp, res))
17275        return false;
17276    return true;
17277  }
17278
17279  protected ValueSet.ConceptReferenceDesignationComponent parseValueSetConceptReferenceDesignationComponent(XmlPullParser xpp, ValueSet owner) throws XmlPullParserException, IOException, FHIRFormatError {
17280    ValueSet.ConceptReferenceDesignationComponent res = new ValueSet.ConceptReferenceDesignationComponent();
17281    parseBackboneAttributes(xpp, res);
17282    next(xpp);
17283    int eventType = nextNoWhitespace(xpp);
17284    while (eventType != XmlPullParser.END_TAG) {
17285  if (!parseValueSetConceptReferenceDesignationComponentContent(eventType, xpp, owner, res))
17286        unknownContent(xpp);
17287      eventType = nextNoWhitespace(xpp);
17288    }
17289    next(xpp);
17290    parseElementClose(res);
17291    return res;
17292  }
17293
17294  protected boolean parseValueSetConceptReferenceDesignationComponentContent(int eventType, XmlPullParser xpp, ValueSet owner, ValueSet.ConceptReferenceDesignationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
17295      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
17296        res.setLanguageElement(parseCode(xpp));
17297      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
17298        res.setUse(parseCoding(xpp));
17299      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
17300        res.setValueElement(parseString(xpp));
17301      } else if (!parseBackboneContent(eventType, xpp, res))
17302        return false;
17303    return true;
17304  }
17305
17306  protected ValueSet.ConceptSetFilterComponent parseValueSetConceptSetFilterComponent(XmlPullParser xpp, ValueSet owner) throws XmlPullParserException, IOException, FHIRFormatError {
17307    ValueSet.ConceptSetFilterComponent res = new ValueSet.ConceptSetFilterComponent();
17308    parseBackboneAttributes(xpp, res);
17309    next(xpp);
17310    int eventType = nextNoWhitespace(xpp);
17311    while (eventType != XmlPullParser.END_TAG) {
17312  if (!parseValueSetConceptSetFilterComponentContent(eventType, xpp, owner, res))
17313        unknownContent(xpp);
17314      eventType = nextNoWhitespace(xpp);
17315    }
17316    next(xpp);
17317    parseElementClose(res);
17318    return res;
17319  }
17320
17321  protected boolean parseValueSetConceptSetFilterComponentContent(int eventType, XmlPullParser xpp, ValueSet owner, ValueSet.ConceptSetFilterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
17322      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("property")) {
17323        res.setPropertyElement(parseCode(xpp));
17324      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("op")) {
17325        res.setOpElement(parseEnumeration(xpp, ValueSet.FilterOperator.NULL, new ValueSet.FilterOperatorEnumFactory()));
17326      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
17327        res.setValueElement(parseCode(xpp));
17328      } else if (!parseBackboneContent(eventType, xpp, res))
17329        return false;
17330    return true;
17331  }
17332
17333  protected ValueSet.ValueSetExpansionComponent parseValueSetValueSetExpansionComponent(XmlPullParser xpp, ValueSet owner) throws XmlPullParserException, IOException, FHIRFormatError {
17334    ValueSet.ValueSetExpansionComponent res = new ValueSet.ValueSetExpansionComponent();
17335    parseBackboneAttributes(xpp, res);
17336    next(xpp);
17337    int eventType = nextNoWhitespace(xpp);
17338    while (eventType != XmlPullParser.END_TAG) {
17339  if (!parseValueSetValueSetExpansionComponentContent(eventType, xpp, owner, res))
17340        unknownContent(xpp);
17341      eventType = nextNoWhitespace(xpp);
17342    }
17343    next(xpp);
17344    parseElementClose(res);
17345    return res;
17346  }
17347
17348  protected boolean parseValueSetValueSetExpansionComponentContent(int eventType, XmlPullParser xpp, ValueSet owner, ValueSet.ValueSetExpansionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
17349      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
17350        res.setIdentifierElement(parseUri(xpp));
17351      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("timestamp")) {
17352        res.setTimestampElement(parseDateTime(xpp));
17353      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("total")) {
17354        res.setTotalElement(parseInteger(xpp));
17355      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("offset")) {
17356        res.setOffsetElement(parseInteger(xpp));
17357      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("parameter")) {
17358        res.getParameter().add(parseValueSetValueSetExpansionParameterComponent(xpp, owner));
17359      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contains")) {
17360        res.getContains().add(parseValueSetValueSetExpansionContainsComponent(xpp, owner));
17361      } else if (!parseBackboneContent(eventType, xpp, res))
17362        return false;
17363    return true;
17364  }
17365
17366  protected ValueSet.ValueSetExpansionParameterComponent parseValueSetValueSetExpansionParameterComponent(XmlPullParser xpp, ValueSet owner) throws XmlPullParserException, IOException, FHIRFormatError {
17367    ValueSet.ValueSetExpansionParameterComponent res = new ValueSet.ValueSetExpansionParameterComponent();
17368    parseBackboneAttributes(xpp, res);
17369    next(xpp);
17370    int eventType = nextNoWhitespace(xpp);
17371    while (eventType != XmlPullParser.END_TAG) {
17372  if (!parseValueSetValueSetExpansionParameterComponentContent(eventType, xpp, owner, res))
17373        unknownContent(xpp);
17374      eventType = nextNoWhitespace(xpp);
17375    }
17376    next(xpp);
17377    parseElementClose(res);
17378    return res;
17379  }
17380
17381  protected boolean parseValueSetValueSetExpansionParameterComponentContent(int eventType, XmlPullParser xpp, ValueSet owner, ValueSet.ValueSetExpansionParameterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
17382      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
17383        res.setNameElement(parseString(xpp));
17384      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
17385        res.setValue(parseType("value", xpp));
17386      } else if (!parseBackboneContent(eventType, xpp, res))
17387        return false;
17388    return true;
17389  }
17390
17391  protected ValueSet.ValueSetExpansionContainsComponent parseValueSetValueSetExpansionContainsComponent(XmlPullParser xpp, ValueSet owner) throws XmlPullParserException, IOException, FHIRFormatError {
17392    ValueSet.ValueSetExpansionContainsComponent res = new ValueSet.ValueSetExpansionContainsComponent();
17393    parseBackboneAttributes(xpp, res);
17394    next(xpp);
17395    int eventType = nextNoWhitespace(xpp);
17396    while (eventType != XmlPullParser.END_TAG) {
17397  if (!parseValueSetValueSetExpansionContainsComponentContent(eventType, xpp, owner, res))
17398        unknownContent(xpp);
17399      eventType = nextNoWhitespace(xpp);
17400    }
17401    next(xpp);
17402    parseElementClose(res);
17403    return res;
17404  }
17405
17406  protected boolean parseValueSetValueSetExpansionContainsComponentContent(int eventType, XmlPullParser xpp, ValueSet owner, ValueSet.ValueSetExpansionContainsComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
17407      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
17408        res.setSystemElement(parseUri(xpp));
17409      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("abstract")) {
17410        res.setAbstractElement(parseBoolean(xpp));
17411      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("inactive")) {
17412        res.setInactiveElement(parseBoolean(xpp));
17413      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
17414        res.setVersionElement(parseString(xpp));
17415      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
17416        res.setCodeElement(parseCode(xpp));
17417      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
17418        res.setDisplayElement(parseString(xpp));
17419      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("designation")) {
17420        res.getDesignation().add(parseValueSetConceptReferenceDesignationComponent(xpp, owner));
17421      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contains")) {
17422        res.getContains().add(parseValueSetValueSetExpansionContainsComponent(xpp, owner));
17423      } else if (!parseBackboneContent(eventType, xpp, res))
17424        return false;
17425    return true;
17426  }
17427
17428  protected VisionPrescription parseVisionPrescription(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
17429    VisionPrescription res = new VisionPrescription();
17430    parseDomainResourceAttributes(xpp, res);
17431    next(xpp);
17432    int eventType = nextNoWhitespace(xpp);
17433    while (eventType != XmlPullParser.END_TAG) {
17434  if (!parseVisionPrescriptionContent(eventType, xpp, res))
17435        unknownContent(xpp);
17436      eventType = nextNoWhitespace(xpp);
17437    }
17438    next(xpp);
17439    parseElementClose(res);
17440    return res;
17441  }
17442
17443  protected boolean parseVisionPrescriptionContent(int eventType, XmlPullParser xpp, VisionPrescription res) throws XmlPullParserException, IOException, FHIRFormatError {
17444      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
17445        res.getIdentifier().add(parseIdentifier(xpp));
17446      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
17447        res.setStatusElement(parseEnumeration(xpp, VisionPrescription.VisionStatus.NULL, new VisionPrescription.VisionStatusEnumFactory()));
17448      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
17449        res.setPatient(parseReference(xpp));
17450      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
17451        res.setEncounter(parseReference(xpp));
17452      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dateWritten")) {
17453        res.setDateWrittenElement(parseDateTime(xpp));
17454      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prescriber")) {
17455        res.setPrescriber(parseReference(xpp));
17456      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "reason")) {
17457        res.setReason(parseType("reason", xpp));
17458      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dispense")) {
17459        res.getDispense().add(parseVisionPrescriptionVisionPrescriptionDispenseComponent(xpp, res));
17460      } else if (!parseDomainResourceContent(eventType, xpp, res))
17461        return false;
17462    return true;
17463  }
17464
17465  protected VisionPrescription.VisionPrescriptionDispenseComponent parseVisionPrescriptionVisionPrescriptionDispenseComponent(XmlPullParser xpp, VisionPrescription owner) throws XmlPullParserException, IOException, FHIRFormatError {
17466    VisionPrescription.VisionPrescriptionDispenseComponent res = new VisionPrescription.VisionPrescriptionDispenseComponent();
17467    parseBackboneAttributes(xpp, res);
17468    next(xpp);
17469    int eventType = nextNoWhitespace(xpp);
17470    while (eventType != XmlPullParser.END_TAG) {
17471  if (!parseVisionPrescriptionVisionPrescriptionDispenseComponentContent(eventType, xpp, owner, res))
17472        unknownContent(xpp);
17473      eventType = nextNoWhitespace(xpp);
17474    }
17475    next(xpp);
17476    parseElementClose(res);
17477    return res;
17478  }
17479
17480  protected boolean parseVisionPrescriptionVisionPrescriptionDispenseComponentContent(int eventType, XmlPullParser xpp, VisionPrescription owner, VisionPrescription.VisionPrescriptionDispenseComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
17481      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("product")) {
17482        res.setProduct(parseCodeableConcept(xpp));
17483      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("eye")) {
17484        res.setEyeElement(parseEnumeration(xpp, VisionPrescription.VisionEyes.NULL, new VisionPrescription.VisionEyesEnumFactory()));
17485      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sphere")) {
17486        res.setSphereElement(parseDecimal(xpp));
17487      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("cylinder")) {
17488        res.setCylinderElement(parseDecimal(xpp));
17489      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("axis")) {
17490        res.setAxisElement(parseInteger(xpp));
17491      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prism")) {
17492        res.setPrismElement(parseDecimal(xpp));
17493      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("base")) {
17494        res.setBaseElement(parseEnumeration(xpp, VisionPrescription.VisionBase.NULL, new VisionPrescription.VisionBaseEnumFactory()));
17495      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("add")) {
17496        res.setAddElement(parseDecimal(xpp));
17497      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("power")) {
17498        res.setPowerElement(parseDecimal(xpp));
17499      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("backCurve")) {
17500        res.setBackCurveElement(parseDecimal(xpp));
17501      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diameter")) {
17502        res.setDiameterElement(parseDecimal(xpp));
17503      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("duration")) {
17504        res.setDuration(parseSimpleQuantity(xpp));
17505      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("color")) {
17506        res.setColorElement(parseString(xpp));
17507      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("brand")) {
17508        res.setBrandElement(parseString(xpp));
17509      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
17510        res.getNote().add(parseAnnotation(xpp));
17511      } else if (!parseBackboneContent(eventType, xpp, res))
17512        return false;
17513    return true;
17514  }
17515
17516  @Override
17517  protected Resource parseResource(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
17518    if (xpp.getName().equals("Parameters"))
17519      return parseParameters(xpp);
17520    else if (xpp.getName().equals("Account"))
17521      return parseAccount(xpp);
17522    else if (xpp.getName().equals("ActivityDefinition"))
17523      return parseActivityDefinition(xpp);
17524    else if (xpp.getName().equals("AdverseEvent"))
17525      return parseAdverseEvent(xpp);
17526    else if (xpp.getName().equals("AllergyIntolerance"))
17527      return parseAllergyIntolerance(xpp);
17528    else if (xpp.getName().equals("Appointment"))
17529      return parseAppointment(xpp);
17530    else if (xpp.getName().equals("AppointmentResponse"))
17531      return parseAppointmentResponse(xpp);
17532    else if (xpp.getName().equals("AuditEvent"))
17533      return parseAuditEvent(xpp);
17534    else if (xpp.getName().equals("Basic"))
17535      return parseBasic(xpp);
17536    else if (xpp.getName().equals("Binary"))
17537      return parseBinary(xpp);
17538    else if (xpp.getName().equals("BodySite"))
17539      return parseBodySite(xpp);
17540    else if (xpp.getName().equals("Bundle"))
17541      return parseBundle(xpp);
17542    else if (xpp.getName().equals("CapabilityStatement"))
17543      return parseCapabilityStatement(xpp);
17544    else if (xpp.getName().equals("CarePlan"))
17545      return parseCarePlan(xpp);
17546    else if (xpp.getName().equals("CareTeam"))
17547      return parseCareTeam(xpp);
17548    else if (xpp.getName().equals("ChargeItem"))
17549      return parseChargeItem(xpp);
17550    else if (xpp.getName().equals("Claim"))
17551      return parseClaim(xpp);
17552    else if (xpp.getName().equals("ClaimResponse"))
17553      return parseClaimResponse(xpp);
17554    else if (xpp.getName().equals("ClinicalImpression"))
17555      return parseClinicalImpression(xpp);
17556    else if (xpp.getName().equals("CodeSystem"))
17557      return parseCodeSystem(xpp);
17558    else if (xpp.getName().equals("Communication"))
17559      return parseCommunication(xpp);
17560    else if (xpp.getName().equals("CommunicationRequest"))
17561      return parseCommunicationRequest(xpp);
17562    else if (xpp.getName().equals("CompartmentDefinition"))
17563      return parseCompartmentDefinition(xpp);
17564    else if (xpp.getName().equals("Composition"))
17565      return parseComposition(xpp);
17566    else if (xpp.getName().equals("ConceptMap"))
17567      return parseConceptMap(xpp);
17568    else if (xpp.getName().equals("Condition"))
17569      return parseCondition(xpp);
17570    else if (xpp.getName().equals("Consent"))
17571      return parseConsent(xpp);
17572    else if (xpp.getName().equals("Contract"))
17573      return parseContract(xpp);
17574    else if (xpp.getName().equals("Coverage"))
17575      return parseCoverage(xpp);
17576    else if (xpp.getName().equals("DataElement"))
17577      return parseDataElement(xpp);
17578    else if (xpp.getName().equals("DetectedIssue"))
17579      return parseDetectedIssue(xpp);
17580    else if (xpp.getName().equals("Device"))
17581      return parseDevice(xpp);
17582    else if (xpp.getName().equals("DeviceComponent"))
17583      return parseDeviceComponent(xpp);
17584    else if (xpp.getName().equals("DeviceMetric"))
17585      return parseDeviceMetric(xpp);
17586    else if (xpp.getName().equals("DeviceRequest"))
17587      return parseDeviceRequest(xpp);
17588    else if (xpp.getName().equals("DeviceUseStatement"))
17589      return parseDeviceUseStatement(xpp);
17590    else if (xpp.getName().equals("DiagnosticReport"))
17591      return parseDiagnosticReport(xpp);
17592    else if (xpp.getName().equals("DocumentManifest"))
17593      return parseDocumentManifest(xpp);
17594    else if (xpp.getName().equals("DocumentReference"))
17595      return parseDocumentReference(xpp);
17596    else if (xpp.getName().equals("EligibilityRequest"))
17597      return parseEligibilityRequest(xpp);
17598    else if (xpp.getName().equals("EligibilityResponse"))
17599      return parseEligibilityResponse(xpp);
17600    else if (xpp.getName().equals("Encounter"))
17601      return parseEncounter(xpp);
17602    else if (xpp.getName().equals("Endpoint"))
17603      return parseEndpoint(xpp);
17604    else if (xpp.getName().equals("EnrollmentRequest"))
17605      return parseEnrollmentRequest(xpp);
17606    else if (xpp.getName().equals("EnrollmentResponse"))
17607      return parseEnrollmentResponse(xpp);
17608    else if (xpp.getName().equals("EpisodeOfCare"))
17609      return parseEpisodeOfCare(xpp);
17610    else if (xpp.getName().equals("ExpansionProfile"))
17611      return parseExpansionProfile(xpp);
17612    else if (xpp.getName().equals("ExplanationOfBenefit"))
17613      return parseExplanationOfBenefit(xpp);
17614    else if (xpp.getName().equals("FamilyMemberHistory"))
17615      return parseFamilyMemberHistory(xpp);
17616    else if (xpp.getName().equals("Flag"))
17617      return parseFlag(xpp);
17618    else if (xpp.getName().equals("Goal"))
17619      return parseGoal(xpp);
17620    else if (xpp.getName().equals("GraphDefinition"))
17621      return parseGraphDefinition(xpp);
17622    else if (xpp.getName().equals("Group"))
17623      return parseGroup(xpp);
17624    else if (xpp.getName().equals("GuidanceResponse"))
17625      return parseGuidanceResponse(xpp);
17626    else if (xpp.getName().equals("HealthcareService"))
17627      return parseHealthcareService(xpp);
17628    else if (xpp.getName().equals("ImagingManifest"))
17629      return parseImagingManifest(xpp);
17630    else if (xpp.getName().equals("ImagingStudy"))
17631      return parseImagingStudy(xpp);
17632    else if (xpp.getName().equals("Immunization"))
17633      return parseImmunization(xpp);
17634    else if (xpp.getName().equals("ImmunizationRecommendation"))
17635      return parseImmunizationRecommendation(xpp);
17636    else if (xpp.getName().equals("ImplementationGuide"))
17637      return parseImplementationGuide(xpp);
17638    else if (xpp.getName().equals("Library"))
17639      return parseLibrary(xpp);
17640    else if (xpp.getName().equals("Linkage"))
17641      return parseLinkage(xpp);
17642    else if (xpp.getName().equals("List"))
17643      return parseListResource(xpp);
17644    else if (xpp.getName().equals("Location"))
17645      return parseLocation(xpp);
17646    else if (xpp.getName().equals("Measure"))
17647      return parseMeasure(xpp);
17648    else if (xpp.getName().equals("MeasureReport"))
17649      return parseMeasureReport(xpp);
17650    else if (xpp.getName().equals("Media"))
17651      return parseMedia(xpp);
17652    else if (xpp.getName().equals("Medication"))
17653      return parseMedication(xpp);
17654    else if (xpp.getName().equals("MedicationAdministration"))
17655      return parseMedicationAdministration(xpp);
17656    else if (xpp.getName().equals("MedicationDispense"))
17657      return parseMedicationDispense(xpp);
17658    else if (xpp.getName().equals("MedicationRequest"))
17659      return parseMedicationRequest(xpp);
17660    else if (xpp.getName().equals("MedicationStatement"))
17661      return parseMedicationStatement(xpp);
17662    else if (xpp.getName().equals("MessageDefinition"))
17663      return parseMessageDefinition(xpp);
17664    else if (xpp.getName().equals("MessageHeader"))
17665      return parseMessageHeader(xpp);
17666    else if (xpp.getName().equals("NamingSystem"))
17667      return parseNamingSystem(xpp);
17668    else if (xpp.getName().equals("NutritionOrder"))
17669      return parseNutritionOrder(xpp);
17670    else if (xpp.getName().equals("Observation"))
17671      return parseObservation(xpp);
17672    else if (xpp.getName().equals("OperationDefinition"))
17673      return parseOperationDefinition(xpp);
17674    else if (xpp.getName().equals("OperationOutcome"))
17675      return parseOperationOutcome(xpp);
17676    else if (xpp.getName().equals("Organization"))
17677      return parseOrganization(xpp);
17678    else if (xpp.getName().equals("Patient"))
17679      return parsePatient(xpp);
17680    else if (xpp.getName().equals("PaymentNotice"))
17681      return parsePaymentNotice(xpp);
17682    else if (xpp.getName().equals("PaymentReconciliation"))
17683      return parsePaymentReconciliation(xpp);
17684    else if (xpp.getName().equals("Person"))
17685      return parsePerson(xpp);
17686    else if (xpp.getName().equals("PlanDefinition"))
17687      return parsePlanDefinition(xpp);
17688    else if (xpp.getName().equals("Practitioner"))
17689      return parsePractitioner(xpp);
17690    else if (xpp.getName().equals("PractitionerRole"))
17691      return parsePractitionerRole(xpp);
17692    else if (xpp.getName().equals("Procedure"))
17693      return parseProcedure(xpp);
17694    else if (xpp.getName().equals("ProcedureRequest"))
17695      return parseProcedureRequest(xpp);
17696    else if (xpp.getName().equals("ProcessRequest"))
17697      return parseProcessRequest(xpp);
17698    else if (xpp.getName().equals("ProcessResponse"))
17699      return parseProcessResponse(xpp);
17700    else if (xpp.getName().equals("Provenance"))
17701      return parseProvenance(xpp);
17702    else if (xpp.getName().equals("Questionnaire"))
17703      return parseQuestionnaire(xpp);
17704    else if (xpp.getName().equals("QuestionnaireResponse"))
17705      return parseQuestionnaireResponse(xpp);
17706    else if (xpp.getName().equals("ReferralRequest"))
17707      return parseReferralRequest(xpp);
17708    else if (xpp.getName().equals("RelatedPerson"))
17709      return parseRelatedPerson(xpp);
17710    else if (xpp.getName().equals("RequestGroup"))
17711      return parseRequestGroup(xpp);
17712    else if (xpp.getName().equals("ResearchStudy"))
17713      return parseResearchStudy(xpp);
17714    else if (xpp.getName().equals("ResearchSubject"))
17715      return parseResearchSubject(xpp);
17716    else if (xpp.getName().equals("RiskAssessment"))
17717      return parseRiskAssessment(xpp);
17718    else if (xpp.getName().equals("Schedule"))
17719      return parseSchedule(xpp);
17720    else if (xpp.getName().equals("SearchParameter"))
17721      return parseSearchParameter(xpp);
17722    else if (xpp.getName().equals("Sequence"))
17723      return parseSequence(xpp);
17724    else if (xpp.getName().equals("ServiceDefinition"))
17725      return parseServiceDefinition(xpp);
17726    else if (xpp.getName().equals("Slot"))
17727      return parseSlot(xpp);
17728    else if (xpp.getName().equals("Specimen"))
17729      return parseSpecimen(xpp);
17730    else if (xpp.getName().equals("StructureDefinition"))
17731      return parseStructureDefinition(xpp);
17732    else if (xpp.getName().equals("StructureMap"))
17733      return parseStructureMap(xpp);
17734    else if (xpp.getName().equals("Subscription"))
17735      return parseSubscription(xpp);
17736    else if (xpp.getName().equals("Substance"))
17737      return parseSubstance(xpp);
17738    else if (xpp.getName().equals("SupplyDelivery"))
17739      return parseSupplyDelivery(xpp);
17740    else if (xpp.getName().equals("SupplyRequest"))
17741      return parseSupplyRequest(xpp);
17742    else if (xpp.getName().equals("Task"))
17743      return parseTask(xpp);
17744    else if (xpp.getName().equals("TestReport"))
17745      return parseTestReport(xpp);
17746    else if (xpp.getName().equals("TestScript"))
17747      return parseTestScript(xpp);
17748    else if (xpp.getName().equals("ValueSet"))
17749      return parseValueSet(xpp);
17750    else if (xpp.getName().equals("VisionPrescription"))
17751      return parseVisionPrescription(xpp);
17752    else if (xpp.getName().equals("Binary"))
17753      return parseBinary(xpp);
17754    throw new FHIRFormatError("Unknown resource type "+xpp.getName()+"");
17755  }
17756
17757  protected Type parseType(String prefix, XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
17758    if (xpp.getName().equals(prefix+"date"))
17759      return parseDate(xpp);
17760    else if (xpp.getName().equals(prefix+"dateTime"))
17761      return parseDateTime(xpp);
17762    else if (xpp.getName().equals(prefix+"code"))
17763      return parseCode(xpp);
17764    else if (xpp.getName().equals(prefix+"string"))
17765      return parseString(xpp);
17766    else if (xpp.getName().equals(prefix+"integer"))
17767      return parseInteger(xpp);
17768    else if (xpp.getName().equals(prefix+"oid"))
17769      return parseOid(xpp);
17770    else if (xpp.getName().equals(prefix+"uri"))
17771      return parseUri(xpp);
17772    else if (xpp.getName().equals(prefix+"uuid"))
17773      return parseUuid(xpp);
17774    else if (xpp.getName().equals(prefix+"instant"))
17775      return parseInstant(xpp);
17776    else if (xpp.getName().equals(prefix+"boolean"))
17777      return parseBoolean(xpp);
17778    else if (xpp.getName().equals(prefix+"base64Binary"))
17779      return parseBase64Binary(xpp);
17780    else if (xpp.getName().equals(prefix+"unsignedInt"))
17781      return parseUnsignedInt(xpp);
17782    else if (xpp.getName().equals(prefix+"markdown"))
17783      return parseMarkdown(xpp);
17784    else if (xpp.getName().equals(prefix+"time"))
17785      return parseTime(xpp);
17786    else if (xpp.getName().equals(prefix+"id"))
17787      return parseId(xpp);
17788    else if (xpp.getName().equals(prefix+"positiveInt"))
17789      return parsePositiveInt(xpp);
17790    else if (xpp.getName().equals(prefix+"decimal"))
17791      return parseDecimal(xpp);
17792    else if (xpp.getName().equals(prefix+"Extension"))
17793      return parseExtension(xpp);
17794    else if (xpp.getName().equals(prefix+"Narrative"))
17795      return parseNarrative(xpp);
17796    else if (xpp.getName().equals(prefix+"Reference"))
17797      return parseReference(xpp);
17798    else if (xpp.getName().equals(prefix+"Quantity"))
17799      return parseQuantity(xpp);
17800    else if (xpp.getName().equals(prefix+"Period"))
17801      return parsePeriod(xpp);
17802    else if (xpp.getName().equals(prefix+"Attachment"))
17803      return parseAttachment(xpp);
17804    else if (xpp.getName().equals(prefix+"Duration"))
17805      return parseDuration(xpp);
17806    else if (xpp.getName().equals(prefix+"Count"))
17807      return parseCount(xpp);
17808    else if (xpp.getName().equals(prefix+"Range"))
17809      return parseRange(xpp);
17810    else if (xpp.getName().equals(prefix+"Annotation"))
17811      return parseAnnotation(xpp);
17812    else if (xpp.getName().equals(prefix+"Money"))
17813      return parseMoney(xpp);
17814    else if (xpp.getName().equals(prefix+"Identifier"))
17815      return parseIdentifier(xpp);
17816    else if (xpp.getName().equals(prefix+"Coding"))
17817      return parseCoding(xpp);
17818    else if (xpp.getName().equals(prefix+"Signature"))
17819      return parseSignature(xpp);
17820    else if (xpp.getName().equals(prefix+"SampledData"))
17821      return parseSampledData(xpp);
17822    else if (xpp.getName().equals(prefix+"Ratio"))
17823      return parseRatio(xpp);
17824    else if (xpp.getName().equals(prefix+"Distance"))
17825      return parseDistance(xpp);
17826    else if (xpp.getName().equals(prefix+"Age"))
17827      return parseAge(xpp);
17828    else if (xpp.getName().equals(prefix+"CodeableConcept"))
17829      return parseCodeableConcept(xpp);
17830    else if (xpp.getName().equals(prefix+"SimpleQuantity"))
17831      return parseSimpleQuantity(xpp);
17832    else if (xpp.getName().equals(prefix+"Meta"))
17833      return parseMeta(xpp);
17834    else if (xpp.getName().equals(prefix+"Address"))
17835      return parseAddress(xpp);
17836    else if (xpp.getName().equals(prefix+"TriggerDefinition"))
17837      return parseTriggerDefinition(xpp);
17838    else if (xpp.getName().equals(prefix+"Contributor"))
17839      return parseContributor(xpp);
17840    else if (xpp.getName().equals(prefix+"DataRequirement"))
17841      return parseDataRequirement(xpp);
17842    else if (xpp.getName().equals(prefix+"Dosage"))
17843      return parseDosage(xpp);
17844    else if (xpp.getName().equals(prefix+"RelatedArtifact"))
17845      return parseRelatedArtifact(xpp);
17846    else if (xpp.getName().equals(prefix+"ContactDetail"))
17847      return parseContactDetail(xpp);
17848    else if (xpp.getName().equals(prefix+"HumanName"))
17849      return parseHumanName(xpp);
17850    else if (xpp.getName().equals(prefix+"ContactPoint"))
17851      return parseContactPoint(xpp);
17852    else if (xpp.getName().equals(prefix+"UsageContext"))
17853      return parseUsageContext(xpp);
17854    else if (xpp.getName().equals(prefix+"Timing"))
17855      return parseTiming(xpp);
17856    else if (xpp.getName().equals(prefix+"ElementDefinition"))
17857      return parseElementDefinition(xpp);
17858    else if (xpp.getName().equals(prefix+"ParameterDefinition"))
17859      return parseParameterDefinition(xpp);
17860    else if (xpp.getName().equals(prefix+"Date"))
17861      return parseDate(xpp);
17862    else if (xpp.getName().equals(prefix+"DateTime"))
17863      return parseDateTime(xpp);
17864    else if (xpp.getName().equals(prefix+"Code"))
17865      return parseCode(xpp);
17866    else if (xpp.getName().equals(prefix+"String"))
17867      return parseString(xpp);
17868    else if (xpp.getName().equals(prefix+"Integer"))
17869      return parseInteger(xpp);
17870    else if (xpp.getName().equals(prefix+"Oid"))
17871      return parseOid(xpp);
17872    else if (xpp.getName().equals(prefix+"Uri"))
17873      return parseUri(xpp);
17874    else if (xpp.getName().equals(prefix+"Uuid"))
17875      return parseUuid(xpp);
17876    else if (xpp.getName().equals(prefix+"Instant"))
17877      return parseInstant(xpp);
17878    else if (xpp.getName().equals(prefix+"Boolean"))
17879      return parseBoolean(xpp);
17880    else if (xpp.getName().equals(prefix+"Base64Binary"))
17881      return parseBase64Binary(xpp);
17882    else if (xpp.getName().equals(prefix+"UnsignedInt"))
17883      return parseUnsignedInt(xpp);
17884    else if (xpp.getName().equals(prefix+"Markdown"))
17885      return parseMarkdown(xpp);
17886    else if (xpp.getName().equals(prefix+"Time"))
17887      return parseTime(xpp);
17888    else if (xpp.getName().equals(prefix+"Id"))
17889      return parseId(xpp);
17890    else if (xpp.getName().equals(prefix+"PositiveInt"))
17891      return parsePositiveInt(xpp);
17892    else if (xpp.getName().equals(prefix+"Decimal"))
17893      return parseDecimal(xpp);
17894    throw new FHIRFormatError("Unknown type "+xpp.getName());
17895  }
17896
17897  protected Type parseType(XmlPullParser xpp, String type) throws XmlPullParserException, IOException, FHIRFormatError {
17898    if (type.equals("date"))
17899      return parseDate(xpp);
17900    else if (type.equals("dateTime"))
17901      return parseDateTime(xpp);
17902    else if (type.equals("code"))
17903      return parseCode(xpp);
17904    else if (type.equals("string"))
17905      return parseString(xpp);
17906    else if (type.equals("integer"))
17907      return parseInteger(xpp);
17908    else if (type.equals("oid"))
17909      return parseOid(xpp);
17910    else if (type.equals("uri"))
17911      return parseUri(xpp);
17912    else if (type.equals("uuid"))
17913      return parseUuid(xpp);
17914    else if (type.equals("instant"))
17915      return parseInstant(xpp);
17916    else if (type.equals("boolean"))
17917      return parseBoolean(xpp);
17918    else if (type.equals("base64Binary"))
17919      return parseBase64Binary(xpp);
17920    else if (type.equals("unsignedInt"))
17921      return parseUnsignedInt(xpp);
17922    else if (type.equals("markdown"))
17923      return parseMarkdown(xpp);
17924    else if (type.equals("time"))
17925      return parseTime(xpp);
17926    else if (type.equals("id"))
17927      return parseId(xpp);
17928    else if (type.equals("positiveInt"))
17929      return parsePositiveInt(xpp);
17930    else if (type.equals("decimal"))
17931      return parseDecimal(xpp);
17932    else if (type.equals("Extension"))
17933      return parseExtension(xpp);
17934    else if (type.equals("Narrative"))
17935      return parseNarrative(xpp);
17936    else if (type.equals("Reference"))
17937      return parseReference(xpp);
17938    else if (type.equals("Quantity"))
17939      return parseQuantity(xpp);
17940    else if (type.equals("Period"))
17941      return parsePeriod(xpp);
17942    else if (type.equals("Attachment"))
17943      return parseAttachment(xpp);
17944    else if (type.equals("Duration"))
17945      return parseDuration(xpp);
17946    else if (type.equals("Count"))
17947      return parseCount(xpp);
17948    else if (type.equals("Range"))
17949      return parseRange(xpp);
17950    else if (type.equals("Annotation"))
17951      return parseAnnotation(xpp);
17952    else if (type.equals("Money"))
17953      return parseMoney(xpp);
17954    else if (type.equals("Identifier"))
17955      return parseIdentifier(xpp);
17956    else if (type.equals("Coding"))
17957      return parseCoding(xpp);
17958    else if (type.equals("Signature"))
17959      return parseSignature(xpp);
17960    else if (type.equals("SampledData"))
17961      return parseSampledData(xpp);
17962    else if (type.equals("Ratio"))
17963      return parseRatio(xpp);
17964    else if (type.equals("Distance"))
17965      return parseDistance(xpp);
17966    else if (type.equals("Age"))
17967      return parseAge(xpp);
17968    else if (type.equals("CodeableConcept"))
17969      return parseCodeableConcept(xpp);
17970    else if (type.equals("SimpleQuantity"))
17971      return parseSimpleQuantity(xpp);
17972    else if (type.equals("Meta"))
17973      return parseMeta(xpp);
17974    else if (type.equals("Address"))
17975      return parseAddress(xpp);
17976    else if (type.equals("TriggerDefinition"))
17977      return parseTriggerDefinition(xpp);
17978    else if (type.equals("Contributor"))
17979      return parseContributor(xpp);
17980    else if (type.equals("DataRequirement"))
17981      return parseDataRequirement(xpp);
17982    else if (type.equals("Dosage"))
17983      return parseDosage(xpp);
17984    else if (type.equals("RelatedArtifact"))
17985      return parseRelatedArtifact(xpp);
17986    else if (type.equals("ContactDetail"))
17987      return parseContactDetail(xpp);
17988    else if (type.equals("HumanName"))
17989      return parseHumanName(xpp);
17990    else if (type.equals("ContactPoint"))
17991      return parseContactPoint(xpp);
17992    else if (type.equals("UsageContext"))
17993      return parseUsageContext(xpp);
17994    else if (type.equals("Timing"))
17995      return parseTiming(xpp);
17996    else if (type.equals("ElementDefinition"))
17997      return parseElementDefinition(xpp);
17998    else if (type.equals("ParameterDefinition"))
17999      return parseParameterDefinition(xpp);
18000    throw new FHIRFormatError("Unknown type "+type);
18001  }
18002
18003  public Base parseFragment(XmlPullParser xpp, String type) throws XmlPullParserException, IOException, FHIRFormatError {
18004    if (type.equals("Extension"))
18005      return parseExtension(xpp);
18006    else if (type.equals("Narrative"))
18007      return parseNarrative(xpp);
18008    else if (type.equals("Reference"))
18009      return parseReference(xpp);
18010    else if (type.equals("Quantity"))
18011      return parseQuantity(xpp);
18012    else if (type.equals("Period"))
18013      return parsePeriod(xpp);
18014    else if (type.equals("Attachment"))
18015      return parseAttachment(xpp);
18016    else if (type.equals("Duration"))
18017      return parseDuration(xpp);
18018    else if (type.equals("Count"))
18019      return parseCount(xpp);
18020    else if (type.equals("Range"))
18021      return parseRange(xpp);
18022    else if (type.equals("Annotation"))
18023      return parseAnnotation(xpp);
18024    else if (type.equals("Money"))
18025      return parseMoney(xpp);
18026    else if (type.equals("Identifier"))
18027      return parseIdentifier(xpp);
18028    else if (type.equals("Coding"))
18029      return parseCoding(xpp);
18030    else if (type.equals("Signature"))
18031      return parseSignature(xpp);
18032    else if (type.equals("SampledData"))
18033      return parseSampledData(xpp);
18034    else if (type.equals("Ratio"))
18035      return parseRatio(xpp);
18036    else if (type.equals("Distance"))
18037      return parseDistance(xpp);
18038    else if (type.equals("Age"))
18039      return parseAge(xpp);
18040    else if (type.equals("CodeableConcept"))
18041      return parseCodeableConcept(xpp);
18042    else if (type.equals("SimpleQuantity"))
18043      return parseSimpleQuantity(xpp);
18044    else if (type.equals("Meta"))
18045      return parseMeta(xpp);
18046    else if (type.equals("Address"))
18047      return parseAddress(xpp);
18048    else if (type.equals("TriggerDefinition"))
18049      return parseTriggerDefinition(xpp);
18050    else if (type.equals("Contributor"))
18051      return parseContributor(xpp);
18052    else if (type.equals("DataRequirement"))
18053      return parseDataRequirement(xpp);
18054    else if (type.equals("Dosage"))
18055      return parseDosage(xpp);
18056    else if (type.equals("RelatedArtifact"))
18057      return parseRelatedArtifact(xpp);
18058    else if (type.equals("ContactDetail"))
18059      return parseContactDetail(xpp);
18060    else if (type.equals("HumanName"))
18061      return parseHumanName(xpp);
18062    else if (type.equals("ContactPoint"))
18063      return parseContactPoint(xpp);
18064    else if (type.equals("UsageContext"))
18065      return parseUsageContext(xpp);
18066    else if (type.equals("Timing"))
18067      return parseTiming(xpp);
18068    else if (type.equals("ElementDefinition"))
18069      return parseElementDefinition(xpp);
18070    else if (type.equals("ParameterDefinition"))
18071      return parseParameterDefinition(xpp);
18072    else if (type.equals("Parameters"))
18073      return parseParameters(xpp);
18074    else if (type.equals("Account"))
18075      return parseAccount(xpp);
18076    else if (type.equals("ActivityDefinition"))
18077      return parseActivityDefinition(xpp);
18078    else if (type.equals("AdverseEvent"))
18079      return parseAdverseEvent(xpp);
18080    else if (type.equals("AllergyIntolerance"))
18081      return parseAllergyIntolerance(xpp);
18082    else if (type.equals("Appointment"))
18083      return parseAppointment(xpp);
18084    else if (type.equals("AppointmentResponse"))
18085      return parseAppointmentResponse(xpp);
18086    else if (type.equals("AuditEvent"))
18087      return parseAuditEvent(xpp);
18088    else if (type.equals("Basic"))
18089      return parseBasic(xpp);
18090    else if (type.equals("Binary"))
18091      return parseBinary(xpp);
18092    else if (type.equals("BodySite"))
18093      return parseBodySite(xpp);
18094    else if (type.equals("Bundle"))
18095      return parseBundle(xpp);
18096    else if (type.equals("CapabilityStatement"))
18097      return parseCapabilityStatement(xpp);
18098    else if (type.equals("CarePlan"))
18099      return parseCarePlan(xpp);
18100    else if (type.equals("CareTeam"))
18101      return parseCareTeam(xpp);
18102    else if (type.equals("ChargeItem"))
18103      return parseChargeItem(xpp);
18104    else if (type.equals("Claim"))
18105      return parseClaim(xpp);
18106    else if (type.equals("ClaimResponse"))
18107      return parseClaimResponse(xpp);
18108    else if (type.equals("ClinicalImpression"))
18109      return parseClinicalImpression(xpp);
18110    else if (type.equals("CodeSystem"))
18111      return parseCodeSystem(xpp);
18112    else if (type.equals("Communication"))
18113      return parseCommunication(xpp);
18114    else if (type.equals("CommunicationRequest"))
18115      return parseCommunicationRequest(xpp);
18116    else if (type.equals("CompartmentDefinition"))
18117      return parseCompartmentDefinition(xpp);
18118    else if (type.equals("Composition"))
18119      return parseComposition(xpp);
18120    else if (type.equals("ConceptMap"))
18121      return parseConceptMap(xpp);
18122    else if (type.equals("Condition"))
18123      return parseCondition(xpp);
18124    else if (type.equals("Consent"))
18125      return parseConsent(xpp);
18126    else if (type.equals("Contract"))
18127      return parseContract(xpp);
18128    else if (type.equals("Coverage"))
18129      return parseCoverage(xpp);
18130    else if (type.equals("DataElement"))
18131      return parseDataElement(xpp);
18132    else if (type.equals("DetectedIssue"))
18133      return parseDetectedIssue(xpp);
18134    else if (type.equals("Device"))
18135      return parseDevice(xpp);
18136    else if (type.equals("DeviceComponent"))
18137      return parseDeviceComponent(xpp);
18138    else if (type.equals("DeviceMetric"))
18139      return parseDeviceMetric(xpp);
18140    else if (type.equals("DeviceRequest"))
18141      return parseDeviceRequest(xpp);
18142    else if (type.equals("DeviceUseStatement"))
18143      return parseDeviceUseStatement(xpp);
18144    else if (type.equals("DiagnosticReport"))
18145      return parseDiagnosticReport(xpp);
18146    else if (type.equals("DocumentManifest"))
18147      return parseDocumentManifest(xpp);
18148    else if (type.equals("DocumentReference"))
18149      return parseDocumentReference(xpp);
18150    else if (type.equals("EligibilityRequest"))
18151      return parseEligibilityRequest(xpp);
18152    else if (type.equals("EligibilityResponse"))
18153      return parseEligibilityResponse(xpp);
18154    else if (type.equals("Encounter"))
18155      return parseEncounter(xpp);
18156    else if (type.equals("Endpoint"))
18157      return parseEndpoint(xpp);
18158    else if (type.equals("EnrollmentRequest"))
18159      return parseEnrollmentRequest(xpp);
18160    else if (type.equals("EnrollmentResponse"))
18161      return parseEnrollmentResponse(xpp);
18162    else if (type.equals("EpisodeOfCare"))
18163      return parseEpisodeOfCare(xpp);
18164    else if (type.equals("ExpansionProfile"))
18165      return parseExpansionProfile(xpp);
18166    else if (type.equals("ExplanationOfBenefit"))
18167      return parseExplanationOfBenefit(xpp);
18168    else if (type.equals("FamilyMemberHistory"))
18169      return parseFamilyMemberHistory(xpp);
18170    else if (type.equals("Flag"))
18171      return parseFlag(xpp);
18172    else if (type.equals("Goal"))
18173      return parseGoal(xpp);
18174    else if (type.equals("GraphDefinition"))
18175      return parseGraphDefinition(xpp);
18176    else if (type.equals("Group"))
18177      return parseGroup(xpp);
18178    else if (type.equals("GuidanceResponse"))
18179      return parseGuidanceResponse(xpp);
18180    else if (type.equals("HealthcareService"))
18181      return parseHealthcareService(xpp);
18182    else if (type.equals("ImagingManifest"))
18183      return parseImagingManifest(xpp);
18184    else if (type.equals("ImagingStudy"))
18185      return parseImagingStudy(xpp);
18186    else if (type.equals("Immunization"))
18187      return parseImmunization(xpp);
18188    else if (type.equals("ImmunizationRecommendation"))
18189      return parseImmunizationRecommendation(xpp);
18190    else if (type.equals("ImplementationGuide"))
18191      return parseImplementationGuide(xpp);
18192    else if (type.equals("Library"))
18193      return parseLibrary(xpp);
18194    else if (type.equals("Linkage"))
18195      return parseLinkage(xpp);
18196    else if (type.equals("List"))
18197      return parseListResource(xpp);
18198    else if (type.equals("Location"))
18199      return parseLocation(xpp);
18200    else if (type.equals("Measure"))
18201      return parseMeasure(xpp);
18202    else if (type.equals("MeasureReport"))
18203      return parseMeasureReport(xpp);
18204    else if (type.equals("Media"))
18205      return parseMedia(xpp);
18206    else if (type.equals("Medication"))
18207      return parseMedication(xpp);
18208    else if (type.equals("MedicationAdministration"))
18209      return parseMedicationAdministration(xpp);
18210    else if (type.equals("MedicationDispense"))
18211      return parseMedicationDispense(xpp);
18212    else if (type.equals("MedicationRequest"))
18213      return parseMedicationRequest(xpp);
18214    else if (type.equals("MedicationStatement"))
18215      return parseMedicationStatement(xpp);
18216    else if (type.equals("MessageDefinition"))
18217      return parseMessageDefinition(xpp);
18218    else if (type.equals("MessageHeader"))
18219      return parseMessageHeader(xpp);
18220    else if (type.equals("NamingSystem"))
18221      return parseNamingSystem(xpp);
18222    else if (type.equals("NutritionOrder"))
18223      return parseNutritionOrder(xpp);
18224    else if (type.equals("Observation"))
18225      return parseObservation(xpp);
18226    else if (type.equals("OperationDefinition"))
18227      return parseOperationDefinition(xpp);
18228    else if (type.equals("OperationOutcome"))
18229      return parseOperationOutcome(xpp);
18230    else if (type.equals("Organization"))
18231      return parseOrganization(xpp);
18232    else if (type.equals("Patient"))
18233      return parsePatient(xpp);
18234    else if (type.equals("PaymentNotice"))
18235      return parsePaymentNotice(xpp);
18236    else if (type.equals("PaymentReconciliation"))
18237      return parsePaymentReconciliation(xpp);
18238    else if (type.equals("Person"))
18239      return parsePerson(xpp);
18240    else if (type.equals("PlanDefinition"))
18241      return parsePlanDefinition(xpp);
18242    else if (type.equals("Practitioner"))
18243      return parsePractitioner(xpp);
18244    else if (type.equals("PractitionerRole"))
18245      return parsePractitionerRole(xpp);
18246    else if (type.equals("Procedure"))
18247      return parseProcedure(xpp);
18248    else if (type.equals("ProcedureRequest"))
18249      return parseProcedureRequest(xpp);
18250    else if (type.equals("ProcessRequest"))
18251      return parseProcessRequest(xpp);
18252    else if (type.equals("ProcessResponse"))
18253      return parseProcessResponse(xpp);
18254    else if (type.equals("Provenance"))
18255      return parseProvenance(xpp);
18256    else if (type.equals("Questionnaire"))
18257      return parseQuestionnaire(xpp);
18258    else if (type.equals("QuestionnaireResponse"))
18259      return parseQuestionnaireResponse(xpp);
18260    else if (type.equals("ReferralRequest"))
18261      return parseReferralRequest(xpp);
18262    else if (type.equals("RelatedPerson"))
18263      return parseRelatedPerson(xpp);
18264    else if (type.equals("RequestGroup"))
18265      return parseRequestGroup(xpp);
18266    else if (type.equals("ResearchStudy"))
18267      return parseResearchStudy(xpp);
18268    else if (type.equals("ResearchSubject"))
18269      return parseResearchSubject(xpp);
18270    else if (type.equals("RiskAssessment"))
18271      return parseRiskAssessment(xpp);
18272    else if (type.equals("Schedule"))
18273      return parseSchedule(xpp);
18274    else if (type.equals("SearchParameter"))
18275      return parseSearchParameter(xpp);
18276    else if (type.equals("Sequence"))
18277      return parseSequence(xpp);
18278    else if (type.equals("ServiceDefinition"))
18279      return parseServiceDefinition(xpp);
18280    else if (type.equals("Slot"))
18281      return parseSlot(xpp);
18282    else if (type.equals("Specimen"))
18283      return parseSpecimen(xpp);
18284    else if (type.equals("StructureDefinition"))
18285      return parseStructureDefinition(xpp);
18286    else if (type.equals("StructureMap"))
18287      return parseStructureMap(xpp);
18288    else if (type.equals("Subscription"))
18289      return parseSubscription(xpp);
18290    else if (type.equals("Substance"))
18291      return parseSubstance(xpp);
18292    else if (type.equals("SupplyDelivery"))
18293      return parseSupplyDelivery(xpp);
18294    else if (type.equals("SupplyRequest"))
18295      return parseSupplyRequest(xpp);
18296    else if (type.equals("Task"))
18297      return parseTask(xpp);
18298    else if (type.equals("TestReport"))
18299      return parseTestReport(xpp);
18300    else if (type.equals("TestScript"))
18301      return parseTestScript(xpp);
18302    else if (type.equals("ValueSet"))
18303      return parseValueSet(xpp);
18304    else if (type.equals("VisionPrescription"))
18305      return parseVisionPrescription(xpp);
18306    else if (type.equals("date"))
18307      return parseDate(xpp);
18308    else if (type.equals("dateTime"))
18309      return parseDateTime(xpp);
18310    else if (type.equals("code"))
18311      return parseCode(xpp);
18312    else if (type.equals("string"))
18313      return parseString(xpp);
18314    else if (type.equals("integer"))
18315      return parseInteger(xpp);
18316    else if (type.equals("oid"))
18317      return parseOid(xpp);
18318    else if (type.equals("uri"))
18319      return parseUri(xpp);
18320    else if (type.equals("uuid"))
18321      return parseUuid(xpp);
18322    else if (type.equals("instant"))
18323      return parseInstant(xpp);
18324    else if (type.equals("boolean"))
18325      return parseBoolean(xpp);
18326    else if (type.equals("base64Binary"))
18327      return parseBase64Binary(xpp);
18328    else if (type.equals("unsignedInt"))
18329      return parseUnsignedInt(xpp);
18330    else if (type.equals("markdown"))
18331      return parseMarkdown(xpp);
18332    else if (type.equals("time"))
18333      return parseTime(xpp);
18334    else if (type.equals("id"))
18335      return parseId(xpp);
18336    else if (type.equals("positiveInt"))
18337      return parsePositiveInt(xpp);
18338    else if (type.equals("decimal"))
18339      return parseDecimal(xpp);
18340    throw new FHIRFormatError("Unknown type "+type);
18341  }
18342
18343  private boolean nameIsTypeName(XmlPullParser xpp, String prefix) {
18344        if (xpp.getName().equals(prefix+"Reference"))
18345      return true;
18346    if (xpp.getName().equals(prefix+"Quantity"))
18347      return true;
18348    if (xpp.getName().equals(prefix+"Period"))
18349      return true;
18350    if (xpp.getName().equals(prefix+"Attachment"))
18351      return true;
18352    if (xpp.getName().equals(prefix+"Duration"))
18353      return true;
18354    if (xpp.getName().equals(prefix+"Count"))
18355      return true;
18356    if (xpp.getName().equals(prefix+"Range"))
18357      return true;
18358    if (xpp.getName().equals(prefix+"Annotation"))
18359      return true;
18360    if (xpp.getName().equals(prefix+"Money"))
18361      return true;
18362    if (xpp.getName().equals(prefix+"Identifier"))
18363      return true;
18364    if (xpp.getName().equals(prefix+"Coding"))
18365      return true;
18366    if (xpp.getName().equals(prefix+"Signature"))
18367      return true;
18368    if (xpp.getName().equals(prefix+"SampledData"))
18369      return true;
18370    if (xpp.getName().equals(prefix+"Ratio"))
18371      return true;
18372    if (xpp.getName().equals(prefix+"Distance"))
18373      return true;
18374    if (xpp.getName().equals(prefix+"Age"))
18375      return true;
18376    if (xpp.getName().equals(prefix+"CodeableConcept"))
18377      return true;
18378    if (xpp.getName().equals(prefix+"SimpleQuantity"))
18379      return true;
18380    if (xpp.getName().equals(prefix+"Meta"))
18381      return true;
18382    if (xpp.getName().equals(prefix+"Address"))
18383      return true;
18384    if (xpp.getName().equals(prefix+"TriggerDefinition"))
18385      return true;
18386    if (xpp.getName().equals(prefix+"Contributor"))
18387      return true;
18388    if (xpp.getName().equals(prefix+"DataRequirement"))
18389      return true;
18390    if (xpp.getName().equals(prefix+"Dosage"))
18391      return true;
18392    if (xpp.getName().equals(prefix+"RelatedArtifact"))
18393      return true;
18394    if (xpp.getName().equals(prefix+"ContactDetail"))
18395      return true;
18396    if (xpp.getName().equals(prefix+"HumanName"))
18397      return true;
18398    if (xpp.getName().equals(prefix+"ContactPoint"))
18399      return true;
18400    if (xpp.getName().equals(prefix+"UsageContext"))
18401      return true;
18402    if (xpp.getName().equals(prefix+"Timing"))
18403      return true;
18404    if (xpp.getName().equals(prefix+"ElementDefinition"))
18405      return true;
18406    if (xpp.getName().equals(prefix+"ParameterDefinition"))
18407      return true;
18408    if (xpp.getName().equals(prefix+"Parameters"))
18409      return true;
18410    if (xpp.getName().equals(prefix+"Account"))
18411      return true;
18412    if (xpp.getName().equals(prefix+"ActivityDefinition"))
18413      return true;
18414    if (xpp.getName().equals(prefix+"AdverseEvent"))
18415      return true;
18416    if (xpp.getName().equals(prefix+"AllergyIntolerance"))
18417      return true;
18418    if (xpp.getName().equals(prefix+"Appointment"))
18419      return true;
18420    if (xpp.getName().equals(prefix+"AppointmentResponse"))
18421      return true;
18422    if (xpp.getName().equals(prefix+"AuditEvent"))
18423      return true;
18424    if (xpp.getName().equals(prefix+"Basic"))
18425      return true;
18426    if (xpp.getName().equals(prefix+"Binary"))
18427      return true;
18428    if (xpp.getName().equals(prefix+"BodySite"))
18429      return true;
18430    if (xpp.getName().equals(prefix+"Bundle"))
18431      return true;
18432    if (xpp.getName().equals(prefix+"CapabilityStatement"))
18433      return true;
18434    if (xpp.getName().equals(prefix+"CarePlan"))
18435      return true;
18436    if (xpp.getName().equals(prefix+"CareTeam"))
18437      return true;
18438    if (xpp.getName().equals(prefix+"ChargeItem"))
18439      return true;
18440    if (xpp.getName().equals(prefix+"Claim"))
18441      return true;
18442    if (xpp.getName().equals(prefix+"ClaimResponse"))
18443      return true;
18444    if (xpp.getName().equals(prefix+"ClinicalImpression"))
18445      return true;
18446    if (xpp.getName().equals(prefix+"CodeSystem"))
18447      return true;
18448    if (xpp.getName().equals(prefix+"Communication"))
18449      return true;
18450    if (xpp.getName().equals(prefix+"CommunicationRequest"))
18451      return true;
18452    if (xpp.getName().equals(prefix+"CompartmentDefinition"))
18453      return true;
18454    if (xpp.getName().equals(prefix+"Composition"))
18455      return true;
18456    if (xpp.getName().equals(prefix+"ConceptMap"))
18457      return true;
18458    if (xpp.getName().equals(prefix+"Condition"))
18459      return true;
18460    if (xpp.getName().equals(prefix+"Consent"))
18461      return true;
18462    if (xpp.getName().equals(prefix+"Contract"))
18463      return true;
18464    if (xpp.getName().equals(prefix+"Coverage"))
18465      return true;
18466    if (xpp.getName().equals(prefix+"DataElement"))
18467      return true;
18468    if (xpp.getName().equals(prefix+"DetectedIssue"))
18469      return true;
18470    if (xpp.getName().equals(prefix+"Device"))
18471      return true;
18472    if (xpp.getName().equals(prefix+"DeviceComponent"))
18473      return true;
18474    if (xpp.getName().equals(prefix+"DeviceMetric"))
18475      return true;
18476    if (xpp.getName().equals(prefix+"DeviceRequest"))
18477      return true;
18478    if (xpp.getName().equals(prefix+"DeviceUseStatement"))
18479      return true;
18480    if (xpp.getName().equals(prefix+"DiagnosticReport"))
18481      return true;
18482    if (xpp.getName().equals(prefix+"DocumentManifest"))
18483      return true;
18484    if (xpp.getName().equals(prefix+"DocumentReference"))
18485      return true;
18486    if (xpp.getName().equals(prefix+"EligibilityRequest"))
18487      return true;
18488    if (xpp.getName().equals(prefix+"EligibilityResponse"))
18489      return true;
18490    if (xpp.getName().equals(prefix+"Encounter"))
18491      return true;
18492    if (xpp.getName().equals(prefix+"Endpoint"))
18493      return true;
18494    if (xpp.getName().equals(prefix+"EnrollmentRequest"))
18495      return true;
18496    if (xpp.getName().equals(prefix+"EnrollmentResponse"))
18497      return true;
18498    if (xpp.getName().equals(prefix+"EpisodeOfCare"))
18499      return true;
18500    if (xpp.getName().equals(prefix+"ExpansionProfile"))
18501      return true;
18502    if (xpp.getName().equals(prefix+"ExplanationOfBenefit"))
18503      return true;
18504    if (xpp.getName().equals(prefix+"FamilyMemberHistory"))
18505      return true;
18506    if (xpp.getName().equals(prefix+"Flag"))
18507      return true;
18508    if (xpp.getName().equals(prefix+"Goal"))
18509      return true;
18510    if (xpp.getName().equals(prefix+"GraphDefinition"))
18511      return true;
18512    if (xpp.getName().equals(prefix+"Group"))
18513      return true;
18514    if (xpp.getName().equals(prefix+"GuidanceResponse"))
18515      return true;
18516    if (xpp.getName().equals(prefix+"HealthcareService"))
18517      return true;
18518    if (xpp.getName().equals(prefix+"ImagingManifest"))
18519      return true;
18520    if (xpp.getName().equals(prefix+"ImagingStudy"))
18521      return true;
18522    if (xpp.getName().equals(prefix+"Immunization"))
18523      return true;
18524    if (xpp.getName().equals(prefix+"ImmunizationRecommendation"))
18525      return true;
18526    if (xpp.getName().equals(prefix+"ImplementationGuide"))
18527      return true;
18528    if (xpp.getName().equals(prefix+"Library"))
18529      return true;
18530    if (xpp.getName().equals(prefix+"Linkage"))
18531      return true;
18532    if (xpp.getName().equals(prefix+"List"))
18533      return true;
18534    if (xpp.getName().equals(prefix+"Location"))
18535      return true;
18536    if (xpp.getName().equals(prefix+"Measure"))
18537      return true;
18538    if (xpp.getName().equals(prefix+"MeasureReport"))
18539      return true;
18540    if (xpp.getName().equals(prefix+"Media"))
18541      return true;
18542    if (xpp.getName().equals(prefix+"Medication"))
18543      return true;
18544    if (xpp.getName().equals(prefix+"MedicationAdministration"))
18545      return true;
18546    if (xpp.getName().equals(prefix+"MedicationDispense"))
18547      return true;
18548    if (xpp.getName().equals(prefix+"MedicationRequest"))
18549      return true;
18550    if (xpp.getName().equals(prefix+"MedicationStatement"))
18551      return true;
18552    if (xpp.getName().equals(prefix+"MessageDefinition"))
18553      return true;
18554    if (xpp.getName().equals(prefix+"MessageHeader"))
18555      return true;
18556    if (xpp.getName().equals(prefix+"NamingSystem"))
18557      return true;
18558    if (xpp.getName().equals(prefix+"NutritionOrder"))
18559      return true;
18560    if (xpp.getName().equals(prefix+"Observation"))
18561      return true;
18562    if (xpp.getName().equals(prefix+"OperationDefinition"))
18563      return true;
18564    if (xpp.getName().equals(prefix+"OperationOutcome"))
18565      return true;
18566    if (xpp.getName().equals(prefix+"Organization"))
18567      return true;
18568    if (xpp.getName().equals(prefix+"Patient"))
18569      return true;
18570    if (xpp.getName().equals(prefix+"PaymentNotice"))
18571      return true;
18572    if (xpp.getName().equals(prefix+"PaymentReconciliation"))
18573      return true;
18574    if (xpp.getName().equals(prefix+"Person"))
18575      return true;
18576    if (xpp.getName().equals(prefix+"PlanDefinition"))
18577      return true;
18578    if (xpp.getName().equals(prefix+"Practitioner"))
18579      return true;
18580    if (xpp.getName().equals(prefix+"PractitionerRole"))
18581      return true;
18582    if (xpp.getName().equals(prefix+"Procedure"))
18583      return true;
18584    if (xpp.getName().equals(prefix+"ProcedureRequest"))
18585      return true;
18586    if (xpp.getName().equals(prefix+"ProcessRequest"))
18587      return true;
18588    if (xpp.getName().equals(prefix+"ProcessResponse"))
18589      return true;
18590    if (xpp.getName().equals(prefix+"Provenance"))
18591      return true;
18592    if (xpp.getName().equals(prefix+"Questionnaire"))
18593      return true;
18594    if (xpp.getName().equals(prefix+"QuestionnaireResponse"))
18595      return true;
18596    if (xpp.getName().equals(prefix+"ReferralRequest"))
18597      return true;
18598    if (xpp.getName().equals(prefix+"RelatedPerson"))
18599      return true;
18600    if (xpp.getName().equals(prefix+"RequestGroup"))
18601      return true;
18602    if (xpp.getName().equals(prefix+"ResearchStudy"))
18603      return true;
18604    if (xpp.getName().equals(prefix+"ResearchSubject"))
18605      return true;
18606    if (xpp.getName().equals(prefix+"RiskAssessment"))
18607      return true;
18608    if (xpp.getName().equals(prefix+"Schedule"))
18609      return true;
18610    if (xpp.getName().equals(prefix+"SearchParameter"))
18611      return true;
18612    if (xpp.getName().equals(prefix+"Sequence"))
18613      return true;
18614    if (xpp.getName().equals(prefix+"ServiceDefinition"))
18615      return true;
18616    if (xpp.getName().equals(prefix+"Slot"))
18617      return true;
18618    if (xpp.getName().equals(prefix+"Specimen"))
18619      return true;
18620    if (xpp.getName().equals(prefix+"StructureDefinition"))
18621      return true;
18622    if (xpp.getName().equals(prefix+"StructureMap"))
18623      return true;
18624    if (xpp.getName().equals(prefix+"Subscription"))
18625      return true;
18626    if (xpp.getName().equals(prefix+"Substance"))
18627      return true;
18628    if (xpp.getName().equals(prefix+"SupplyDelivery"))
18629      return true;
18630    if (xpp.getName().equals(prefix+"SupplyRequest"))
18631      return true;
18632    if (xpp.getName().equals(prefix+"Task"))
18633      return true;
18634    if (xpp.getName().equals(prefix+"TestReport"))
18635      return true;
18636    if (xpp.getName().equals(prefix+"TestScript"))
18637      return true;
18638    if (xpp.getName().equals(prefix+"ValueSet"))
18639      return true;
18640    if (xpp.getName().equals(prefix+"VisionPrescription"))
18641      return true;
18642    if (xpp.getName().equals(prefix+"Date"))
18643      return true;
18644    if (xpp.getName().equals(prefix+"DateTime"))
18645      return true;
18646    if (xpp.getName().equals(prefix+"Code"))
18647      return true;
18648    if (xpp.getName().equals(prefix+"String"))
18649      return true;
18650    if (xpp.getName().equals(prefix+"Integer"))
18651      return true;
18652    if (xpp.getName().equals(prefix+"Oid"))
18653      return true;
18654    if (xpp.getName().equals(prefix+"Uri"))
18655      return true;
18656    if (xpp.getName().equals(prefix+"Uuid"))
18657      return true;
18658    if (xpp.getName().equals(prefix+"Instant"))
18659      return true;
18660    if (xpp.getName().equals(prefix+"Boolean"))
18661      return true;
18662    if (xpp.getName().equals(prefix+"Base64Binary"))
18663      return true;
18664    if (xpp.getName().equals(prefix+"UnsignedInt"))
18665      return true;
18666    if (xpp.getName().equals(prefix+"Markdown"))
18667      return true;
18668    if (xpp.getName().equals(prefix+"Time"))
18669      return true;
18670    if (xpp.getName().equals(prefix+"Id"))
18671      return true;
18672    if (xpp.getName().equals(prefix+"PositiveInt"))
18673      return true;
18674    if (xpp.getName().equals(prefix+"Decimal"))
18675      return true;
18676    return false;
18677  }
18678  protected void composeElementElements(Element element) throws IOException {
18679    for (Extension e : element.getExtension()) {
18680      composeExtension("extension", e);
18681    }
18682  }
18683
18684  protected void composeBackboneElements(BackboneElement element) throws IOException {
18685    composeElementElements(element);
18686    for (Extension e : element.getModifierExtension()) {
18687      composeExtension("modifierExtension", e);
18688    }
18689  }
18690
18691  protected <E extends Enum<E>> void composeEnumeration(String name, Enumeration<E> value, EnumFactory e) throws IOException {
18692    if (value != null && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || value.getValue() != null)) {
18693      composeElementAttributes(value);
18694      if (value.getValue() != null) 
18695        xml.attribute("value", e.toCode(value.getValue()));
18696        
18697      xml.enter(FHIR_NS, name);
18698      composeElementElements(value);
18699      composeElementClose(value);
18700      xml.exit(FHIR_NS, name);
18701    }    
18702  }    
18703
18704  protected void composeDate(String name, DateType value) throws IOException  {
18705    if (value != null && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || value.getValue() != null)) {// date
18706      composeElementAttributes(value);
18707      if (value.asStringValue() != null) 
18708        xml.attribute("value", value.asStringValue());
18709        
18710      xml.enter(FHIR_NS, name);
18711      composeElementElements(value);
18712      composeElementClose(value);
18713      xml.exit(FHIR_NS, name);
18714    }    
18715  }    
18716
18717  protected void composeDateTime(String name, DateTimeType value) throws IOException  {
18718    if (value != null && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || value.getValue() != null)) {// dateTime
18719      composeElementAttributes(value);
18720      if (value.asStringValue() != null) 
18721        xml.attribute("value", value.asStringValue());
18722        
18723      xml.enter(FHIR_NS, name);
18724      composeElementElements(value);
18725      composeElementClose(value);
18726      xml.exit(FHIR_NS, name);
18727    }    
18728  }    
18729
18730  protected void composeCode(String name, CodeType value) throws IOException  {
18731    if (value != null && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || !Utilities.noString(value.getValue()))) {// code
18732      composeElementAttributes(value);
18733      if (value.asStringValue() != null) 
18734        xml.attribute("value", value.asStringValue());
18735        
18736      xml.enter(FHIR_NS, name);
18737      composeElementElements(value);
18738      composeElementClose(value);
18739      xml.exit(FHIR_NS, name);
18740    }    
18741  }    
18742
18743  protected void composeString(String name, StringType value) throws IOException  {
18744    if (value != null && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || !Utilities.noString(value.getValue()))) {// string
18745      composeElementAttributes(value);
18746      if (value.asStringValue() != null) 
18747        xml.attribute("value", value.asStringValue());
18748        
18749      xml.enter(FHIR_NS, name);
18750      composeElementElements(value);
18751      composeElementClose(value);
18752      xml.exit(FHIR_NS, name);
18753    }    
18754  }    
18755
18756  protected void composeInteger(String name, IntegerType value) throws IOException  {
18757    if (value != null) { // integer
18758      composeElementAttributes(value);
18759      if (value.asStringValue() != null) 
18760        xml.attribute("value", value.asStringValue());
18761        
18762      xml.enter(FHIR_NS, name);
18763      composeElementElements(value);
18764      composeElementClose(value);
18765      xml.exit(FHIR_NS, name);
18766    }    
18767  }    
18768
18769  protected void composeOid(String name, OidType value) throws IOException  {
18770    if (value != null && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || !Utilities.noString(value.getValue()))) {// oid
18771      composeElementAttributes(value);
18772      if (value.asStringValue() != null) 
18773        xml.attribute("value", value.asStringValue());
18774        
18775      xml.enter(FHIR_NS, name);
18776      composeElementElements(value);
18777      composeElementClose(value);
18778      xml.exit(FHIR_NS, name);
18779    }    
18780  }    
18781
18782  protected void composeUri(String name, UriType value) throws IOException  {
18783    if (value != null && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || value.getValue() != null)) {// uri
18784      composeElementAttributes(value);
18785      if (value.asStringValue() != null) 
18786        xml.attribute("value", value.asStringValue());
18787        
18788      xml.enter(FHIR_NS, name);
18789      composeElementElements(value);
18790      composeElementClose(value);
18791      xml.exit(FHIR_NS, name);
18792    }    
18793  }    
18794
18795  protected void composeUuid(String name, UuidType value) throws IOException  {
18796    if (value != null && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || !Utilities.noString(value.getValue()))) {// uuid
18797      composeElementAttributes(value);
18798      if (value.asStringValue() != null) 
18799        xml.attribute("value", value.asStringValue());
18800        
18801      xml.enter(FHIR_NS, name);
18802      composeElementElements(value);
18803      composeElementClose(value);
18804      xml.exit(FHIR_NS, name);
18805    }    
18806  }    
18807
18808  protected void composeInstant(String name, InstantType value) throws IOException  {
18809    if (value != null && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || value.getValue() != null)) {// instant
18810      composeElementAttributes(value);
18811      if (value.asStringValue() != null) 
18812        xml.attribute("value", value.asStringValue());
18813        
18814      xml.enter(FHIR_NS, name);
18815      composeElementElements(value);
18816      composeElementClose(value);
18817      xml.exit(FHIR_NS, name);
18818    }    
18819  }    
18820
18821  protected void composeBoolean(String name, BooleanType value) throws IOException  {
18822    if (value != null) { // boolean
18823      composeElementAttributes(value);
18824      if (value.asStringValue() != null) 
18825        xml.attribute("value", value.asStringValue());
18826        
18827      xml.enter(FHIR_NS, name);
18828      composeElementElements(value);
18829      composeElementClose(value);
18830      xml.exit(FHIR_NS, name);
18831    }    
18832  }    
18833
18834  protected void composeBase64Binary(String name, Base64BinaryType value) throws IOException  {
18835    if (value != null && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || value.getValue() != null)) {// base64Binary
18836      composeElementAttributes(value);
18837      if (value.asStringValue() != null) 
18838        xml.attribute("value", value.asStringValue());
18839        
18840      xml.enter(FHIR_NS, name);
18841      composeElementElements(value);
18842      composeElementClose(value);
18843      xml.exit(FHIR_NS, name);
18844    }    
18845  }    
18846
18847  protected void composeUnsignedInt(String name, UnsignedIntType value) throws IOException  {
18848    if (value != null) { // unsignedInt
18849      composeElementAttributes(value);
18850      if (value.asStringValue() != null) 
18851        xml.attribute("value", value.asStringValue());
18852        
18853      xml.enter(FHIR_NS, name);
18854      composeElementElements(value);
18855      composeElementClose(value);
18856      xml.exit(FHIR_NS, name);
18857    }    
18858  }    
18859
18860  protected void composeMarkdown(String name, MarkdownType value) throws IOException  {
18861    if (value != null && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || !Utilities.noString(value.getValue()))) {// markdown
18862      composeElementAttributes(value);
18863      if (value.asStringValue() != null) 
18864        xml.attribute("value", value.asStringValue());
18865        
18866      xml.enter(FHIR_NS, name);
18867      composeElementElements(value);
18868      composeElementClose(value);
18869      xml.exit(FHIR_NS, name);
18870    }    
18871  }    
18872
18873  protected void composeTime(String name, TimeType value) throws IOException  {
18874    if (value != null && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || !Utilities.noString(value.getValue()))) {// time
18875      composeElementAttributes(value);
18876      if (value.asStringValue() != null) 
18877        xml.attribute("value", value.asStringValue());
18878        
18879      xml.enter(FHIR_NS, name);
18880      composeElementElements(value);
18881      composeElementClose(value);
18882      xml.exit(FHIR_NS, name);
18883    }    
18884  }    
18885
18886  protected void composeId(String name, IdType value) throws IOException  {
18887    if (value != null && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || !Utilities.noString(value.getValue()))) {// id
18888      composeElementAttributes(value);
18889      if (value.asStringValue() != null) 
18890        xml.attribute("value", value.asStringValue());
18891        
18892      xml.enter(FHIR_NS, name);
18893      composeElementElements(value);
18894      composeElementClose(value);
18895      xml.exit(FHIR_NS, name);
18896    }    
18897  }    
18898
18899  protected void composePositiveInt(String name, PositiveIntType value) throws IOException  {
18900    if (value != null) { // positiveInt
18901      composeElementAttributes(value);
18902      if (value.asStringValue() != null) 
18903        xml.attribute("value", value.asStringValue());
18904        
18905      xml.enter(FHIR_NS, name);
18906      composeElementElements(value);
18907      composeElementClose(value);
18908      xml.exit(FHIR_NS, name);
18909    }    
18910  }    
18911
18912  protected void composeDecimal(String name, DecimalType value) throws IOException  {
18913    if (value != null && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || value.getValue() != null)) {// decimal
18914      composeElementAttributes(value);
18915      if (value.asStringValue() != null) 
18916        xml.attribute("value", value.asStringValue());
18917        
18918      xml.enter(FHIR_NS, name);
18919      composeElementElements(value);
18920      composeElementClose(value);
18921      xml.exit(FHIR_NS, name);
18922    }    
18923  }    
18924
18925  protected void composeExtension(String name, Extension element) throws IOException {
18926    if (element != null) {
18927      composeElementAttributes(element);
18928      if (element.hasUrlElement())
18929        xml.attribute("url", element.getUrlElement().getValue());
18930      xml.enter(FHIR_NS, name);
18931      composeExtensionElements(element);
18932      composeElementClose(element);
18933      xml.exit(FHIR_NS, name);
18934    }
18935  }
18936
18937  protected void composeExtensionElements(Extension element) throws IOException {
18938      composeElementElements(element);
18939      if (element.hasValue()) {
18940        composeType("value", element.getValue());
18941      }  }
18942
18943  protected void composeNarrative(String name, Narrative element) throws IOException {
18944    if (element != null) {
18945      composeElementAttributes(element);
18946      xml.enter(FHIR_NS, name);
18947      composeNarrativeElements(element);
18948      composeElementClose(element);
18949      xml.exit(FHIR_NS, name);
18950    }
18951  }
18952
18953  protected void composeNarrativeElements(Narrative element) throws IOException {
18954      composeElementElements(element);
18955      if (element.hasStatusElement())
18956        composeEnumeration("status", element.getStatusElement(), new Narrative.NarrativeStatusEnumFactory());
18957      if (element.hasDiv()) {
18958        composeXhtml("div", element.getDiv());
18959      }
18960  }
18961
18962  protected void composeDuration(String name, Duration element) throws IOException {
18963    if (element != null) {
18964      composeTypeAttributes(element);
18965      xml.enter(FHIR_NS, name);
18966      composeDurationElements(element);
18967      composeElementClose(element);
18968      xml.exit(FHIR_NS, name);
18969    }
18970  }
18971
18972  protected void composeDurationElements(Duration element) throws IOException {
18973      composeQuantityElements(element);
18974  }
18975
18976  protected void composeCount(String name, Count element) throws IOException {
18977    if (element != null) {
18978      composeTypeAttributes(element);
18979      xml.enter(FHIR_NS, name);
18980      composeCountElements(element);
18981      composeElementClose(element);
18982      xml.exit(FHIR_NS, name);
18983    }
18984  }
18985
18986  protected void composeCountElements(Count element) throws IOException {
18987      composeQuantityElements(element);
18988  }
18989
18990  protected void composeMoney(String name, Money element) throws IOException {
18991    if (element != null) {
18992      composeTypeAttributes(element);
18993      xml.enter(FHIR_NS, name);
18994      composeMoneyElements(element);
18995      composeElementClose(element);
18996      xml.exit(FHIR_NS, name);
18997    }
18998  }
18999
19000  protected void composeMoneyElements(Money element) throws IOException {
19001      composeQuantityElements(element);
19002  }
19003
19004  protected void composeDistance(String name, Distance element) throws IOException {
19005    if (element != null) {
19006      composeTypeAttributes(element);
19007      xml.enter(FHIR_NS, name);
19008      composeDistanceElements(element);
19009      composeElementClose(element);
19010      xml.exit(FHIR_NS, name);
19011    }
19012  }
19013
19014  protected void composeDistanceElements(Distance element) throws IOException {
19015      composeQuantityElements(element);
19016  }
19017
19018  protected void composeAge(String name, Age element) throws IOException {
19019    if (element != null) {
19020      composeTypeAttributes(element);
19021      xml.enter(FHIR_NS, name);
19022      composeAgeElements(element);
19023      composeElementClose(element);
19024      xml.exit(FHIR_NS, name);
19025    }
19026  }
19027
19028  protected void composeAgeElements(Age element) throws IOException {
19029      composeQuantityElements(element);
19030  }
19031
19032  protected void composeReference(String name, Reference element) throws IOException {
19033    if (element != null) {
19034      composeTypeAttributes(element);
19035      xml.enter(FHIR_NS, name);
19036      composeReferenceElements(element);
19037      composeElementClose(element);
19038      xml.exit(FHIR_NS, name);
19039    }
19040  }
19041
19042  protected void composeReferenceElements(Reference element) throws IOException {
19043      composeElementElements(element);
19044      if (element.hasReferenceElement()) {
19045        composeString("reference", element.getReferenceElement());
19046      }
19047      if (element.hasIdentifier()) {
19048        composeIdentifier("identifier", element.getIdentifier());
19049      }
19050      if (element.hasDisplayElement()) {
19051        composeString("display", element.getDisplayElement());
19052      }
19053  }
19054
19055  protected void composeQuantity(String name, Quantity element) throws IOException {
19056    if (element != null) {
19057      composeTypeAttributes(element);
19058      xml.enter(FHIR_NS, name);
19059      composeQuantityElements(element);
19060      composeElementClose(element);
19061      xml.exit(FHIR_NS, name);
19062    }
19063  }
19064
19065  protected void composeQuantityElements(Quantity element) throws IOException {
19066      composeElementElements(element);
19067      if (element.hasValueElement()) {
19068        composeDecimal("value", element.getValueElement());
19069      }
19070      if (element.hasComparatorElement())
19071        composeEnumeration("comparator", element.getComparatorElement(), new Quantity.QuantityComparatorEnumFactory());
19072      if (element.hasUnitElement()) {
19073        composeString("unit", element.getUnitElement());
19074      }
19075      if (element.hasSystemElement()) {
19076        composeUri("system", element.getSystemElement());
19077      }
19078      if (element.hasCodeElement()) {
19079        composeCode("code", element.getCodeElement());
19080      }
19081  }
19082
19083  protected void composePeriod(String name, Period element) throws IOException {
19084    if (element != null) {
19085      composeTypeAttributes(element);
19086      xml.enter(FHIR_NS, name);
19087      composePeriodElements(element);
19088      composeElementClose(element);
19089      xml.exit(FHIR_NS, name);
19090    }
19091  }
19092
19093  protected void composePeriodElements(Period element) throws IOException {
19094      composeElementElements(element);
19095      if (element.hasStartElement()) {
19096        composeDateTime("start", element.getStartElement());
19097      }
19098      if (element.hasEndElement()) {
19099        composeDateTime("end", element.getEndElement());
19100      }
19101  }
19102
19103  protected void composeAttachment(String name, Attachment element) throws IOException {
19104    if (element != null) {
19105      composeTypeAttributes(element);
19106      xml.enter(FHIR_NS, name);
19107      composeAttachmentElements(element);
19108      composeElementClose(element);
19109      xml.exit(FHIR_NS, name);
19110    }
19111  }
19112
19113  protected void composeAttachmentElements(Attachment element) throws IOException {
19114      composeElementElements(element);
19115      if (element.hasContentTypeElement()) {
19116        composeCode("contentType", element.getContentTypeElement());
19117      }
19118      if (element.hasLanguageElement()) {
19119        composeCode("language", element.getLanguageElement());
19120      }
19121      if (element.hasDataElement()) {
19122        composeBase64Binary("data", element.getDataElement());
19123      }
19124      if (element.hasUrlElement()) {
19125        composeUri("url", element.getUrlElement());
19126      }
19127      if (element.hasSizeElement()) {
19128        composeUnsignedInt("size", element.getSizeElement());
19129      }
19130      if (element.hasHashElement()) {
19131        composeBase64Binary("hash", element.getHashElement());
19132      }
19133      if (element.hasTitleElement()) {
19134        composeString("title", element.getTitleElement());
19135      }
19136      if (element.hasCreationElement()) {
19137        composeDateTime("creation", element.getCreationElement());
19138      }
19139  }
19140
19141  protected void composeRange(String name, Range element) throws IOException {
19142    if (element != null) {
19143      composeTypeAttributes(element);
19144      xml.enter(FHIR_NS, name);
19145      composeRangeElements(element);
19146      composeElementClose(element);
19147      xml.exit(FHIR_NS, name);
19148    }
19149  }
19150
19151  protected void composeRangeElements(Range element) throws IOException {
19152      composeElementElements(element);
19153      if (element.hasLow()) {
19154        composeSimpleQuantity("low", element.getLow());
19155      }
19156      if (element.hasHigh()) {
19157        composeSimpleQuantity("high", element.getHigh());
19158      }
19159  }
19160
19161  protected void composeAnnotation(String name, Annotation element) throws IOException {
19162    if (element != null) {
19163      composeTypeAttributes(element);
19164      xml.enter(FHIR_NS, name);
19165      composeAnnotationElements(element);
19166      composeElementClose(element);
19167      xml.exit(FHIR_NS, name);
19168    }
19169  }
19170
19171  protected void composeAnnotationElements(Annotation element) throws IOException {
19172      composeElementElements(element);
19173      if (element.hasAuthor()) {
19174        composeType("author", element.getAuthor());
19175      }      if (element.hasTimeElement()) {
19176        composeDateTime("time", element.getTimeElement());
19177      }
19178      if (element.hasTextElement()) {
19179        composeString("text", element.getTextElement());
19180      }
19181  }
19182
19183  protected void composeIdentifier(String name, Identifier element) throws IOException {
19184    if (element != null) {
19185      composeTypeAttributes(element);
19186      xml.enter(FHIR_NS, name);
19187      composeIdentifierElements(element);
19188      composeElementClose(element);
19189      xml.exit(FHIR_NS, name);
19190    }
19191  }
19192
19193  protected void composeIdentifierElements(Identifier element) throws IOException {
19194      composeElementElements(element);
19195      if (element.hasUseElement())
19196        composeEnumeration("use", element.getUseElement(), new Identifier.IdentifierUseEnumFactory());
19197      if (element.hasType()) {
19198        composeCodeableConcept("type", element.getType());
19199      }
19200      if (element.hasSystemElement()) {
19201        composeUri("system", element.getSystemElement());
19202      }
19203      if (element.hasValueElement()) {
19204        composeString("value", element.getValueElement());
19205      }
19206      if (element.hasPeriod()) {
19207        composePeriod("period", element.getPeriod());
19208      }
19209      if (element.hasAssigner()) {
19210        composeReference("assigner", element.getAssigner());
19211      }
19212  }
19213
19214  protected void composeCoding(String name, Coding element) throws IOException {
19215    if (element != null) {
19216      composeTypeAttributes(element);
19217      xml.enter(FHIR_NS, name);
19218      composeCodingElements(element);
19219      composeElementClose(element);
19220      xml.exit(FHIR_NS, name);
19221    }
19222  }
19223
19224  protected void composeCodingElements(Coding element) throws IOException {
19225      composeElementElements(element);
19226      if (element.hasSystemElement()) {
19227        composeUri("system", element.getSystemElement());
19228      }
19229      if (element.hasVersionElement()) {
19230        composeString("version", element.getVersionElement());
19231      }
19232      if (element.hasCodeElement()) {
19233        composeCode("code", element.getCodeElement());
19234      }
19235      if (element.hasDisplayElement()) {
19236        composeString("display", element.getDisplayElement());
19237      }
19238      if (element.hasUserSelectedElement()) {
19239        composeBoolean("userSelected", element.getUserSelectedElement());
19240      }
19241  }
19242
19243  protected void composeSignature(String name, Signature element) throws IOException {
19244    if (element != null) {
19245      composeTypeAttributes(element);
19246      xml.enter(FHIR_NS, name);
19247      composeSignatureElements(element);
19248      composeElementClose(element);
19249      xml.exit(FHIR_NS, name);
19250    }
19251  }
19252
19253  protected void composeSignatureElements(Signature element) throws IOException {
19254      composeElementElements(element);
19255      if (element.hasType()) { 
19256        for (Coding e : element.getType()) 
19257          composeCoding("type", e);
19258      }
19259      if (element.hasWhenElement()) {
19260        composeInstant("when", element.getWhenElement());
19261      }
19262      if (element.hasWho()) {
19263        composeType("who", element.getWho());
19264      }      if (element.hasOnBehalfOf()) {
19265        composeType("onBehalfOf", element.getOnBehalfOf());
19266      }      if (element.hasContentTypeElement()) {
19267        composeCode("contentType", element.getContentTypeElement());
19268      }
19269      if (element.hasBlobElement()) {
19270        composeBase64Binary("blob", element.getBlobElement());
19271      }
19272  }
19273
19274  protected void composeSampledData(String name, SampledData element) throws IOException {
19275    if (element != null) {
19276      composeTypeAttributes(element);
19277      xml.enter(FHIR_NS, name);
19278      composeSampledDataElements(element);
19279      composeElementClose(element);
19280      xml.exit(FHIR_NS, name);
19281    }
19282  }
19283
19284  protected void composeSampledDataElements(SampledData element) throws IOException {
19285      composeElementElements(element);
19286      if (element.hasOrigin()) {
19287        composeSimpleQuantity("origin", element.getOrigin());
19288      }
19289      if (element.hasPeriodElement()) {
19290        composeDecimal("period", element.getPeriodElement());
19291      }
19292      if (element.hasFactorElement()) {
19293        composeDecimal("factor", element.getFactorElement());
19294      }
19295      if (element.hasLowerLimitElement()) {
19296        composeDecimal("lowerLimit", element.getLowerLimitElement());
19297      }
19298      if (element.hasUpperLimitElement()) {
19299        composeDecimal("upperLimit", element.getUpperLimitElement());
19300      }
19301      if (element.hasDimensionsElement()) {
19302        composePositiveInt("dimensions", element.getDimensionsElement());
19303      }
19304      if (element.hasDataElement()) {
19305        composeString("data", element.getDataElement());
19306      }
19307  }
19308
19309  protected void composeRatio(String name, Ratio element) throws IOException {
19310    if (element != null) {
19311      composeTypeAttributes(element);
19312      xml.enter(FHIR_NS, name);
19313      composeRatioElements(element);
19314      composeElementClose(element);
19315      xml.exit(FHIR_NS, name);
19316    }
19317  }
19318
19319  protected void composeRatioElements(Ratio element) throws IOException {
19320      composeElementElements(element);
19321      if (element.hasNumerator()) {
19322        composeQuantity("numerator", element.getNumerator());
19323      }
19324      if (element.hasDenominator()) {
19325        composeQuantity("denominator", element.getDenominator());
19326      }
19327  }
19328
19329  protected void composeCodeableConcept(String name, CodeableConcept element) throws IOException {
19330    if (element != null) {
19331      composeTypeAttributes(element);
19332      xml.enter(FHIR_NS, name);
19333      composeCodeableConceptElements(element);
19334      composeElementClose(element);
19335      xml.exit(FHIR_NS, name);
19336    }
19337  }
19338
19339  protected void composeCodeableConceptElements(CodeableConcept element) throws IOException {
19340      composeElementElements(element);
19341      if (element.hasCoding()) { 
19342        for (Coding e : element.getCoding()) 
19343          composeCoding("coding", e);
19344      }
19345      if (element.hasTextElement()) {
19346        composeString("text", element.getTextElement());
19347      }
19348  }
19349
19350  protected void composeSimpleQuantity(String name, SimpleQuantity element) throws IOException {
19351    if (element != null) {
19352      composeTypeAttributes(element);
19353      xml.enter(FHIR_NS, name);
19354      composeSimpleQuantityElements(element);
19355      composeElementClose(element);
19356      xml.exit(FHIR_NS, name);
19357    }
19358  }
19359
19360  protected void composeSimpleQuantityElements(SimpleQuantity element) throws IOException {
19361      composeElementElements(element);
19362      if (element.hasValueElement()) {
19363        composeDecimal("value", element.getValueElement());
19364      }
19365      if (element.hasComparatorElement())
19366        composeEnumeration("comparator", element.getComparatorElement(), new SimpleQuantity.QuantityComparatorEnumFactory());
19367      if (element.hasUnitElement()) {
19368        composeString("unit", element.getUnitElement());
19369      }
19370      if (element.hasSystemElement()) {
19371        composeUri("system", element.getSystemElement());
19372      }
19373      if (element.hasCodeElement()) {
19374        composeCode("code", element.getCodeElement());
19375      }
19376  }
19377
19378  protected void composeMeta(String name, Meta element) throws IOException {
19379    if (element != null) {
19380      composeElementAttributes(element);
19381      xml.enter(FHIR_NS, name);
19382      composeMetaElements(element);
19383      composeElementClose(element);
19384      xml.exit(FHIR_NS, name);
19385    }
19386  }
19387
19388  protected void composeMetaElements(Meta element) throws IOException {
19389      composeElementElements(element);
19390      if (element.hasVersionIdElement()) {
19391        composeId("versionId", element.getVersionIdElement());
19392      }
19393      if (element.hasLastUpdatedElement()) {
19394        composeInstant("lastUpdated", element.getLastUpdatedElement());
19395      }
19396      if (element.hasProfile()) { 
19397        for (UriType e : element.getProfile()) 
19398          composeUri("profile", e);
19399      }
19400      if (element.hasSecurity()) { 
19401        for (Coding e : element.getSecurity()) 
19402          composeCoding("security", e);
19403      }
19404      if (element.hasTag()) { 
19405        for (Coding e : element.getTag()) 
19406          composeCoding("tag", e);
19407      }
19408  }
19409
19410  protected void composeAddress(String name, Address element) throws IOException {
19411    if (element != null) {
19412      composeElementAttributes(element);
19413      xml.enter(FHIR_NS, name);
19414      composeAddressElements(element);
19415      composeElementClose(element);
19416      xml.exit(FHIR_NS, name);
19417    }
19418  }
19419
19420  protected void composeAddressElements(Address element) throws IOException {
19421      composeElementElements(element);
19422      if (element.hasUseElement())
19423        composeEnumeration("use", element.getUseElement(), new Address.AddressUseEnumFactory());
19424      if (element.hasTypeElement())
19425        composeEnumeration("type", element.getTypeElement(), new Address.AddressTypeEnumFactory());
19426      if (element.hasTextElement()) {
19427        composeString("text", element.getTextElement());
19428      }
19429      if (element.hasLine()) { 
19430        for (StringType e : element.getLine()) 
19431          composeString("line", e);
19432      }
19433      if (element.hasCityElement()) {
19434        composeString("city", element.getCityElement());
19435      }
19436      if (element.hasDistrictElement()) {
19437        composeString("district", element.getDistrictElement());
19438      }
19439      if (element.hasStateElement()) {
19440        composeString("state", element.getStateElement());
19441      }
19442      if (element.hasPostalCodeElement()) {
19443        composeString("postalCode", element.getPostalCodeElement());
19444      }
19445      if (element.hasCountryElement()) {
19446        composeString("country", element.getCountryElement());
19447      }
19448      if (element.hasPeriod()) {
19449        composePeriod("period", element.getPeriod());
19450      }
19451  }
19452
19453  protected void composeTriggerDefinition(String name, TriggerDefinition element) throws IOException {
19454    if (element != null) {
19455      composeElementAttributes(element);
19456      xml.enter(FHIR_NS, name);
19457      composeTriggerDefinitionElements(element);
19458      composeElementClose(element);
19459      xml.exit(FHIR_NS, name);
19460    }
19461  }
19462
19463  protected void composeTriggerDefinitionElements(TriggerDefinition element) throws IOException {
19464      composeElementElements(element);
19465      if (element.hasTypeElement())
19466        composeEnumeration("type", element.getTypeElement(), new TriggerDefinition.TriggerTypeEnumFactory());
19467      if (element.hasEventNameElement()) {
19468        composeString("eventName", element.getEventNameElement());
19469      }
19470      if (element.hasEventTiming()) {
19471        composeType("eventTiming", element.getEventTiming());
19472      }      if (element.hasEventData()) {
19473        composeDataRequirement("eventData", element.getEventData());
19474      }
19475  }
19476
19477  protected void composeContributor(String name, Contributor element) throws IOException {
19478    if (element != null) {
19479      composeElementAttributes(element);
19480      xml.enter(FHIR_NS, name);
19481      composeContributorElements(element);
19482      composeElementClose(element);
19483      xml.exit(FHIR_NS, name);
19484    }
19485  }
19486
19487  protected void composeContributorElements(Contributor element) throws IOException {
19488      composeElementElements(element);
19489      if (element.hasTypeElement())
19490        composeEnumeration("type", element.getTypeElement(), new Contributor.ContributorTypeEnumFactory());
19491      if (element.hasNameElement()) {
19492        composeString("name", element.getNameElement());
19493      }
19494      if (element.hasContact()) { 
19495        for (ContactDetail e : element.getContact()) 
19496          composeContactDetail("contact", e);
19497      }
19498  }
19499
19500  protected void composeDataRequirement(String name, DataRequirement element) throws IOException {
19501    if (element != null) {
19502      composeElementAttributes(element);
19503      xml.enter(FHIR_NS, name);
19504      composeDataRequirementElements(element);
19505      composeElementClose(element);
19506      xml.exit(FHIR_NS, name);
19507    }
19508  }
19509
19510  protected void composeDataRequirementElements(DataRequirement element) throws IOException {
19511      composeElementElements(element);
19512      if (element.hasTypeElement()) {
19513        composeCode("type", element.getTypeElement());
19514      }
19515      if (element.hasProfile()) { 
19516        for (UriType e : element.getProfile()) 
19517          composeUri("profile", e);
19518      }
19519      if (element.hasMustSupport()) { 
19520        for (StringType e : element.getMustSupport()) 
19521          composeString("mustSupport", e);
19522      }
19523      if (element.hasCodeFilter()) { 
19524        for (DataRequirement.DataRequirementCodeFilterComponent e : element.getCodeFilter()) 
19525          composeDataRequirementDataRequirementCodeFilterComponent("codeFilter", e);
19526      }
19527      if (element.hasDateFilter()) { 
19528        for (DataRequirement.DataRequirementDateFilterComponent e : element.getDateFilter()) 
19529          composeDataRequirementDataRequirementDateFilterComponent("dateFilter", e);
19530      }
19531  }
19532
19533  protected void composeDataRequirementDataRequirementCodeFilterComponent(String name, DataRequirement.DataRequirementCodeFilterComponent element) throws IOException {
19534    if (element != null) {
19535      composeElementAttributes(element);
19536      xml.enter(FHIR_NS, name);
19537      composeDataRequirementDataRequirementCodeFilterComponentElements(element);
19538      composeElementClose(element);
19539      xml.exit(FHIR_NS, name);
19540    }
19541  }
19542
19543  protected void composeDataRequirementDataRequirementCodeFilterComponentElements(DataRequirement.DataRequirementCodeFilterComponent element) throws IOException {
19544      composeElementElements(element);
19545      if (element.hasPathElement()) {
19546        composeString("path", element.getPathElement());
19547      }
19548      if (element.hasValueSet()) {
19549        composeType("valueSet", element.getValueSet());
19550      }      if (element.hasValueCode()) { 
19551        for (CodeType e : element.getValueCode()) 
19552          composeCode("valueCode", e);
19553      }
19554      if (element.hasValueCoding()) { 
19555        for (Coding e : element.getValueCoding()) 
19556          composeCoding("valueCoding", e);
19557      }
19558      if (element.hasValueCodeableConcept()) { 
19559        for (CodeableConcept e : element.getValueCodeableConcept()) 
19560          composeCodeableConcept("valueCodeableConcept", e);
19561      }
19562  }
19563
19564  protected void composeDataRequirementDataRequirementDateFilterComponent(String name, DataRequirement.DataRequirementDateFilterComponent element) throws IOException {
19565    if (element != null) {
19566      composeElementAttributes(element);
19567      xml.enter(FHIR_NS, name);
19568      composeDataRequirementDataRequirementDateFilterComponentElements(element);
19569      composeElementClose(element);
19570      xml.exit(FHIR_NS, name);
19571    }
19572  }
19573
19574  protected void composeDataRequirementDataRequirementDateFilterComponentElements(DataRequirement.DataRequirementDateFilterComponent element) throws IOException {
19575      composeElementElements(element);
19576      if (element.hasPathElement()) {
19577        composeString("path", element.getPathElement());
19578      }
19579      if (element.hasValue()) {
19580        composeType("value", element.getValue());
19581      }  }
19582
19583  protected void composeDosage(String name, Dosage element) throws IOException {
19584    if (element != null) {
19585      composeElementAttributes(element);
19586      xml.enter(FHIR_NS, name);
19587      composeDosageElements(element);
19588      composeElementClose(element);
19589      xml.exit(FHIR_NS, name);
19590    }
19591  }
19592
19593  protected void composeDosageElements(Dosage element) throws IOException {
19594      composeElementElements(element);
19595      if (element.hasSequenceElement()) {
19596        composeInteger("sequence", element.getSequenceElement());
19597      }
19598      if (element.hasTextElement()) {
19599        composeString("text", element.getTextElement());
19600      }
19601      if (element.hasAdditionalInstruction()) { 
19602        for (CodeableConcept e : element.getAdditionalInstruction()) 
19603          composeCodeableConcept("additionalInstruction", e);
19604      }
19605      if (element.hasPatientInstructionElement()) {
19606        composeString("patientInstruction", element.getPatientInstructionElement());
19607      }
19608      if (element.hasTiming()) {
19609        composeTiming("timing", element.getTiming());
19610      }
19611      if (element.hasAsNeeded()) {
19612        composeType("asNeeded", element.getAsNeeded());
19613      }      if (element.hasSite()) {
19614        composeCodeableConcept("site", element.getSite());
19615      }
19616      if (element.hasRoute()) {
19617        composeCodeableConcept("route", element.getRoute());
19618      }
19619      if (element.hasMethod()) {
19620        composeCodeableConcept("method", element.getMethod());
19621      }
19622      if (element.hasDose()) {
19623        composeType("dose", element.getDose());
19624      }      if (element.hasMaxDosePerPeriod()) {
19625        composeRatio("maxDosePerPeriod", element.getMaxDosePerPeriod());
19626      }
19627      if (element.hasMaxDosePerAdministration()) {
19628        composeSimpleQuantity("maxDosePerAdministration", element.getMaxDosePerAdministration());
19629      }
19630      if (element.hasMaxDosePerLifetime()) {
19631        composeSimpleQuantity("maxDosePerLifetime", element.getMaxDosePerLifetime());
19632      }
19633      if (element.hasRate()) {
19634        composeType("rate", element.getRate());
19635      }  }
19636
19637  protected void composeRelatedArtifact(String name, RelatedArtifact element) throws IOException {
19638    if (element != null) {
19639      composeElementAttributes(element);
19640      xml.enter(FHIR_NS, name);
19641      composeRelatedArtifactElements(element);
19642      composeElementClose(element);
19643      xml.exit(FHIR_NS, name);
19644    }
19645  }
19646
19647  protected void composeRelatedArtifactElements(RelatedArtifact element) throws IOException {
19648      composeElementElements(element);
19649      if (element.hasTypeElement())
19650        composeEnumeration("type", element.getTypeElement(), new RelatedArtifact.RelatedArtifactTypeEnumFactory());
19651      if (element.hasDisplayElement()) {
19652        composeString("display", element.getDisplayElement());
19653      }
19654      if (element.hasCitationElement()) {
19655        composeString("citation", element.getCitationElement());
19656      }
19657      if (element.hasUrlElement()) {
19658        composeUri("url", element.getUrlElement());
19659      }
19660      if (element.hasDocument()) {
19661        composeAttachment("document", element.getDocument());
19662      }
19663      if (element.hasResource()) {
19664        composeReference("resource", element.getResource());
19665      }
19666  }
19667
19668  protected void composeContactDetail(String name, ContactDetail element) throws IOException {
19669    if (element != null) {
19670      composeElementAttributes(element);
19671      xml.enter(FHIR_NS, name);
19672      composeContactDetailElements(element);
19673      composeElementClose(element);
19674      xml.exit(FHIR_NS, name);
19675    }
19676  }
19677
19678  protected void composeContactDetailElements(ContactDetail element) throws IOException {
19679      composeElementElements(element);
19680      if (element.hasNameElement()) {
19681        composeString("name", element.getNameElement());
19682      }
19683      if (element.hasTelecom()) { 
19684        for (ContactPoint e : element.getTelecom()) 
19685          composeContactPoint("telecom", e);
19686      }
19687  }
19688
19689  protected void composeHumanName(String name, HumanName element) throws IOException {
19690    if (element != null) {
19691      composeElementAttributes(element);
19692      xml.enter(FHIR_NS, name);
19693      composeHumanNameElements(element);
19694      composeElementClose(element);
19695      xml.exit(FHIR_NS, name);
19696    }
19697  }
19698
19699  protected void composeHumanNameElements(HumanName element) throws IOException {
19700      composeElementElements(element);
19701      if (element.hasUseElement())
19702        composeEnumeration("use", element.getUseElement(), new HumanName.NameUseEnumFactory());
19703      if (element.hasTextElement()) {
19704        composeString("text", element.getTextElement());
19705      }
19706      if (element.hasFamilyElement()) {
19707        composeString("family", element.getFamilyElement());
19708      }
19709      if (element.hasGiven()) { 
19710        for (StringType e : element.getGiven()) 
19711          composeString("given", e);
19712      }
19713      if (element.hasPrefix()) { 
19714        for (StringType e : element.getPrefix()) 
19715          composeString("prefix", e);
19716      }
19717      if (element.hasSuffix()) { 
19718        for (StringType e : element.getSuffix()) 
19719          composeString("suffix", e);
19720      }
19721      if (element.hasPeriod()) {
19722        composePeriod("period", element.getPeriod());
19723      }
19724  }
19725
19726  protected void composeContactPoint(String name, ContactPoint element) throws IOException {
19727    if (element != null) {
19728      composeElementAttributes(element);
19729      xml.enter(FHIR_NS, name);
19730      composeContactPointElements(element);
19731      composeElementClose(element);
19732      xml.exit(FHIR_NS, name);
19733    }
19734  }
19735
19736  protected void composeContactPointElements(ContactPoint element) throws IOException {
19737      composeElementElements(element);
19738      if (element.hasSystemElement())
19739        composeEnumeration("system", element.getSystemElement(), new ContactPoint.ContactPointSystemEnumFactory());
19740      if (element.hasValueElement()) {
19741        composeString("value", element.getValueElement());
19742      }
19743      if (element.hasUseElement())
19744        composeEnumeration("use", element.getUseElement(), new ContactPoint.ContactPointUseEnumFactory());
19745      if (element.hasRankElement()) {
19746        composePositiveInt("rank", element.getRankElement());
19747      }
19748      if (element.hasPeriod()) {
19749        composePeriod("period", element.getPeriod());
19750      }
19751  }
19752
19753  protected void composeUsageContext(String name, UsageContext element) throws IOException {
19754    if (element != null) {
19755      composeElementAttributes(element);
19756      xml.enter(FHIR_NS, name);
19757      composeUsageContextElements(element);
19758      composeElementClose(element);
19759      xml.exit(FHIR_NS, name);
19760    }
19761  }
19762
19763  protected void composeUsageContextElements(UsageContext element) throws IOException {
19764      composeElementElements(element);
19765      if (element.hasCode()) {
19766        composeCoding("code", element.getCode());
19767      }
19768      if (element.hasValue()) {
19769        composeType("value", element.getValue());
19770      }  }
19771
19772  protected void composeTiming(String name, Timing element) throws IOException {
19773    if (element != null) {
19774      composeElementAttributes(element);
19775      xml.enter(FHIR_NS, name);
19776      composeTimingElements(element);
19777      composeElementClose(element);
19778      xml.exit(FHIR_NS, name);
19779    }
19780  }
19781
19782  protected void composeTimingElements(Timing element) throws IOException {
19783      composeElementElements(element);
19784      if (element.hasEvent()) { 
19785        for (DateTimeType e : element.getEvent()) 
19786          composeDateTime("event", e);
19787      }
19788      if (element.hasRepeat()) {
19789        composeTimingTimingRepeatComponent("repeat", element.getRepeat());
19790      }
19791      if (element.hasCode()) {
19792        composeCodeableConcept("code", element.getCode());
19793      }
19794  }
19795
19796  protected void composeTimingTimingRepeatComponent(String name, Timing.TimingRepeatComponent element) throws IOException {
19797    if (element != null) {
19798      composeElementAttributes(element);
19799      xml.enter(FHIR_NS, name);
19800      composeTimingTimingRepeatComponentElements(element);
19801      composeElementClose(element);
19802      xml.exit(FHIR_NS, name);
19803    }
19804  }
19805
19806  protected void composeTimingTimingRepeatComponentElements(Timing.TimingRepeatComponent element) throws IOException {
19807      composeElementElements(element);
19808      if (element.hasBounds()) {
19809        composeType("bounds", element.getBounds());
19810      }      if (element.hasCountElement()) {
19811        composeInteger("count", element.getCountElement());
19812      }
19813      if (element.hasCountMaxElement()) {
19814        composeInteger("countMax", element.getCountMaxElement());
19815      }
19816      if (element.hasDurationElement()) {
19817        composeDecimal("duration", element.getDurationElement());
19818      }
19819      if (element.hasDurationMaxElement()) {
19820        composeDecimal("durationMax", element.getDurationMaxElement());
19821      }
19822      if (element.hasDurationUnitElement())
19823        composeEnumeration("durationUnit", element.getDurationUnitElement(), new Timing.UnitsOfTimeEnumFactory());
19824      if (element.hasFrequencyElement()) {
19825        composeInteger("frequency", element.getFrequencyElement());
19826      }
19827      if (element.hasFrequencyMaxElement()) {
19828        composeInteger("frequencyMax", element.getFrequencyMaxElement());
19829      }
19830      if (element.hasPeriodElement()) {
19831        composeDecimal("period", element.getPeriodElement());
19832      }
19833      if (element.hasPeriodMaxElement()) {
19834        composeDecimal("periodMax", element.getPeriodMaxElement());
19835      }
19836      if (element.hasPeriodUnitElement())
19837        composeEnumeration("periodUnit", element.getPeriodUnitElement(), new Timing.UnitsOfTimeEnumFactory());
19838        if (element.hasDayOfWeek()) 
19839          for (Enumeration<Timing.DayOfWeek> e : element.getDayOfWeek()) 
19840            composeEnumeration("dayOfWeek", e, new Timing.DayOfWeekEnumFactory());
19841      if (element.hasTimeOfDay()) { 
19842        for (TimeType e : element.getTimeOfDay()) 
19843          composeTime("timeOfDay", e);
19844      }
19845        if (element.hasWhen()) 
19846          for (Enumeration<Timing.EventTiming> e : element.getWhen()) 
19847            composeEnumeration("when", e, new Timing.EventTimingEnumFactory());
19848      if (element.hasOffsetElement()) {
19849        composeUnsignedInt("offset", element.getOffsetElement());
19850      }
19851  }
19852
19853  protected void composeElementDefinition(String name, ElementDefinition element) throws IOException {
19854    if (element != null) {
19855      composeElementAttributes(element);
19856      xml.enter(FHIR_NS, name);
19857      composeElementDefinitionElements(element);
19858      composeElementClose(element);
19859      xml.exit(FHIR_NS, name);
19860    }
19861  }
19862
19863  protected void composeElementDefinitionElements(ElementDefinition element) throws IOException {
19864      composeElementElements(element);
19865      if (element.hasPathElement()) {
19866        composeString("path", element.getPathElement());
19867      }
19868        if (element.hasRepresentation()) 
19869          for (Enumeration<ElementDefinition.PropertyRepresentation> e : element.getRepresentation()) 
19870            composeEnumeration("representation", e, new ElementDefinition.PropertyRepresentationEnumFactory());
19871      if (element.hasSliceNameElement()) {
19872        composeString("sliceName", element.getSliceNameElement());
19873      }
19874      if (element.hasLabelElement()) {
19875        composeString("label", element.getLabelElement());
19876      }
19877      if (element.hasCode()) { 
19878        for (Coding e : element.getCode()) 
19879          composeCoding("code", e);
19880      }
19881      if (element.hasSlicing()) {
19882        composeElementDefinitionElementDefinitionSlicingComponent("slicing", element.getSlicing());
19883      }
19884      if (element.hasShortElement()) {
19885        composeString("short", element.getShortElement());
19886      }
19887      if (element.hasDefinitionElement()) {
19888        composeMarkdown("definition", element.getDefinitionElement());
19889      }
19890      if (element.hasCommentElement()) {
19891        composeMarkdown("comment", element.getCommentElement());
19892      }
19893      if (element.hasRequirementsElement()) {
19894        composeMarkdown("requirements", element.getRequirementsElement());
19895      }
19896      if (element.hasAlias()) { 
19897        for (StringType e : element.getAlias()) 
19898          composeString("alias", e);
19899      }
19900      if (element.hasMinElement()) {
19901        composeUnsignedInt("min", element.getMinElement());
19902      }
19903      if (element.hasMaxElement()) {
19904        composeString("max", element.getMaxElement());
19905      }
19906      if (element.hasBase()) {
19907        composeElementDefinitionElementDefinitionBaseComponent("base", element.getBase());
19908      }
19909      if (element.hasContentReferenceElement()) {
19910        composeUri("contentReference", element.getContentReferenceElement());
19911      }
19912      if (element.hasType()) { 
19913        for (ElementDefinition.TypeRefComponent e : element.getType()) 
19914          composeElementDefinitionTypeRefComponent("type", e);
19915      }
19916      if (element.hasDefaultValue()) {
19917        composeType("defaultValue", element.getDefaultValue());
19918      }      if (element.hasMeaningWhenMissingElement()) {
19919        composeMarkdown("meaningWhenMissing", element.getMeaningWhenMissingElement());
19920      }
19921      if (element.hasOrderMeaningElement()) {
19922        composeString("orderMeaning", element.getOrderMeaningElement());
19923      }
19924      if (element.hasFixed()) {
19925        composeType("fixed", element.getFixed());
19926      }      if (element.hasPattern()) {
19927        composeType("pattern", element.getPattern());
19928      }      if (element.hasExample()) { 
19929        for (ElementDefinition.ElementDefinitionExampleComponent e : element.getExample()) 
19930          composeElementDefinitionElementDefinitionExampleComponent("example", e);
19931      }
19932      if (element.hasMinValue()) {
19933        composeType("minValue", element.getMinValue());
19934      }      if (element.hasMaxValue()) {
19935        composeType("maxValue", element.getMaxValue());
19936      }      if (element.hasMaxLengthElement()) {
19937        composeInteger("maxLength", element.getMaxLengthElement());
19938      }
19939      if (element.hasCondition()) { 
19940        for (IdType e : element.getCondition()) 
19941          composeId("condition", e);
19942      }
19943      if (element.hasConstraint()) { 
19944        for (ElementDefinition.ElementDefinitionConstraintComponent e : element.getConstraint()) 
19945          composeElementDefinitionElementDefinitionConstraintComponent("constraint", e);
19946      }
19947      if (element.hasMustSupportElement()) {
19948        composeBoolean("mustSupport", element.getMustSupportElement());
19949      }
19950      if (element.hasIsModifierElement()) {
19951        composeBoolean("isModifier", element.getIsModifierElement());
19952      }
19953      if (element.hasIsSummaryElement()) {
19954        composeBoolean("isSummary", element.getIsSummaryElement());
19955      }
19956      if (element.hasBinding()) {
19957        composeElementDefinitionElementDefinitionBindingComponent("binding", element.getBinding());
19958      }
19959      if (element.hasMapping()) { 
19960        for (ElementDefinition.ElementDefinitionMappingComponent e : element.getMapping()) 
19961          composeElementDefinitionElementDefinitionMappingComponent("mapping", e);
19962      }
19963  }
19964
19965  protected void composeElementDefinitionElementDefinitionSlicingComponent(String name, ElementDefinition.ElementDefinitionSlicingComponent element) throws IOException {
19966    if (element != null) {
19967      composeElementAttributes(element);
19968      xml.enter(FHIR_NS, name);
19969      composeElementDefinitionElementDefinitionSlicingComponentElements(element);
19970      composeElementClose(element);
19971      xml.exit(FHIR_NS, name);
19972    }
19973  }
19974
19975  protected void composeElementDefinitionElementDefinitionSlicingComponentElements(ElementDefinition.ElementDefinitionSlicingComponent element) throws IOException {
19976      composeElementElements(element);
19977      if (element.hasDiscriminator()) { 
19978        for (ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent e : element.getDiscriminator()) 
19979          composeElementDefinitionElementDefinitionSlicingDiscriminatorComponent("discriminator", e);
19980      }
19981      if (element.hasDescriptionElement()) {
19982        composeString("description", element.getDescriptionElement());
19983      }
19984      if (element.hasOrderedElement()) {
19985        composeBoolean("ordered", element.getOrderedElement());
19986      }
19987      if (element.hasRulesElement())
19988        composeEnumeration("rules", element.getRulesElement(), new ElementDefinition.SlicingRulesEnumFactory());
19989  }
19990
19991  protected void composeElementDefinitionElementDefinitionSlicingDiscriminatorComponent(String name, ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent element) throws IOException {
19992    if (element != null) {
19993      composeElementAttributes(element);
19994      xml.enter(FHIR_NS, name);
19995      composeElementDefinitionElementDefinitionSlicingDiscriminatorComponentElements(element);
19996      composeElementClose(element);
19997      xml.exit(FHIR_NS, name);
19998    }
19999  }
20000
20001  protected void composeElementDefinitionElementDefinitionSlicingDiscriminatorComponentElements(ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent element) throws IOException {
20002      composeElementElements(element);
20003      if (element.hasTypeElement())
20004        composeEnumeration("type", element.getTypeElement(), new ElementDefinition.DiscriminatorTypeEnumFactory());
20005      if (element.hasPathElement()) {
20006        composeString("path", element.getPathElement());
20007      }
20008  }
20009
20010  protected void composeElementDefinitionElementDefinitionBaseComponent(String name, ElementDefinition.ElementDefinitionBaseComponent element) throws IOException {
20011    if (element != null) {
20012      composeElementAttributes(element);
20013      xml.enter(FHIR_NS, name);
20014      composeElementDefinitionElementDefinitionBaseComponentElements(element);
20015      composeElementClose(element);
20016      xml.exit(FHIR_NS, name);
20017    }
20018  }
20019
20020  protected void composeElementDefinitionElementDefinitionBaseComponentElements(ElementDefinition.ElementDefinitionBaseComponent element) throws IOException {
20021      composeElementElements(element);
20022      if (element.hasPathElement()) {
20023        composeString("path", element.getPathElement());
20024      }
20025      if (element.hasMinElement()) {
20026        composeUnsignedInt("min", element.getMinElement());
20027      }
20028      if (element.hasMaxElement()) {
20029        composeString("max", element.getMaxElement());
20030      }
20031  }
20032
20033  protected void composeElementDefinitionTypeRefComponent(String name, ElementDefinition.TypeRefComponent element) throws IOException {
20034    if (element != null) {
20035      composeElementAttributes(element);
20036      xml.enter(FHIR_NS, name);
20037      composeElementDefinitionTypeRefComponentElements(element);
20038      composeElementClose(element);
20039      xml.exit(FHIR_NS, name);
20040    }
20041  }
20042
20043  protected void composeElementDefinitionTypeRefComponentElements(ElementDefinition.TypeRefComponent element) throws IOException {
20044      composeElementElements(element);
20045      if (element.hasCodeElement()) {
20046        composeUri("code", element.getCodeElement());
20047      }
20048      if (element.hasProfileElement()) {
20049        composeUri("profile", element.getProfileElement());
20050      }
20051      if (element.hasTargetProfileElement()) {
20052        composeUri("targetProfile", element.getTargetProfileElement());
20053      }
20054        if (element.hasAggregation()) 
20055          for (Enumeration<ElementDefinition.AggregationMode> e : element.getAggregation()) 
20056            composeEnumeration("aggregation", e, new ElementDefinition.AggregationModeEnumFactory());
20057      if (element.hasVersioningElement())
20058        composeEnumeration("versioning", element.getVersioningElement(), new ElementDefinition.ReferenceVersionRulesEnumFactory());
20059  }
20060
20061  protected void composeElementDefinitionElementDefinitionExampleComponent(String name, ElementDefinition.ElementDefinitionExampleComponent element) throws IOException {
20062    if (element != null) {
20063      composeElementAttributes(element);
20064      xml.enter(FHIR_NS, name);
20065      composeElementDefinitionElementDefinitionExampleComponentElements(element);
20066      composeElementClose(element);
20067      xml.exit(FHIR_NS, name);
20068    }
20069  }
20070
20071  protected void composeElementDefinitionElementDefinitionExampleComponentElements(ElementDefinition.ElementDefinitionExampleComponent element) throws IOException {
20072      composeElementElements(element);
20073      if (element.hasLabelElement()) {
20074        composeString("label", element.getLabelElement());
20075      }
20076      if (element.hasValue()) {
20077        composeType("value", element.getValue());
20078      }  }
20079
20080  protected void composeElementDefinitionElementDefinitionConstraintComponent(String name, ElementDefinition.ElementDefinitionConstraintComponent element) throws IOException {
20081    if (element != null) {
20082      composeElementAttributes(element);
20083      xml.enter(FHIR_NS, name);
20084      composeElementDefinitionElementDefinitionConstraintComponentElements(element);
20085      composeElementClose(element);
20086      xml.exit(FHIR_NS, name);
20087    }
20088  }
20089
20090  protected void composeElementDefinitionElementDefinitionConstraintComponentElements(ElementDefinition.ElementDefinitionConstraintComponent element) throws IOException {
20091      composeElementElements(element);
20092      if (element.hasKeyElement()) {
20093        composeId("key", element.getKeyElement());
20094      }
20095      if (element.hasRequirementsElement()) {
20096        composeString("requirements", element.getRequirementsElement());
20097      }
20098      if (element.hasSeverityElement())
20099        composeEnumeration("severity", element.getSeverityElement(), new ElementDefinition.ConstraintSeverityEnumFactory());
20100      if (element.hasHumanElement()) {
20101        composeString("human", element.getHumanElement());
20102      }
20103      if (element.hasExpressionElement()) {
20104        composeString("expression", element.getExpressionElement());
20105      }
20106      if (element.hasXpathElement()) {
20107        composeString("xpath", element.getXpathElement());
20108      }
20109      if (element.hasSourceElement()) {
20110        composeUri("source", element.getSourceElement());
20111      }
20112  }
20113
20114  protected void composeElementDefinitionElementDefinitionBindingComponent(String name, ElementDefinition.ElementDefinitionBindingComponent element) throws IOException {
20115    if (element != null) {
20116      composeElementAttributes(element);
20117      xml.enter(FHIR_NS, name);
20118      composeElementDefinitionElementDefinitionBindingComponentElements(element);
20119      composeElementClose(element);
20120      xml.exit(FHIR_NS, name);
20121    }
20122  }
20123
20124  protected void composeElementDefinitionElementDefinitionBindingComponentElements(ElementDefinition.ElementDefinitionBindingComponent element) throws IOException {
20125      composeElementElements(element);
20126      if (element.hasStrengthElement())
20127        composeEnumeration("strength", element.getStrengthElement(), new Enumerations.BindingStrengthEnumFactory());
20128      if (element.hasDescriptionElement()) {
20129        composeString("description", element.getDescriptionElement());
20130      }
20131      if (element.hasValueSet()) {
20132        composeType("valueSet", element.getValueSet());
20133      }  }
20134
20135  protected void composeElementDefinitionElementDefinitionMappingComponent(String name, ElementDefinition.ElementDefinitionMappingComponent element) throws IOException {
20136    if (element != null) {
20137      composeElementAttributes(element);
20138      xml.enter(FHIR_NS, name);
20139      composeElementDefinitionElementDefinitionMappingComponentElements(element);
20140      composeElementClose(element);
20141      xml.exit(FHIR_NS, name);
20142    }
20143  }
20144
20145  protected void composeElementDefinitionElementDefinitionMappingComponentElements(ElementDefinition.ElementDefinitionMappingComponent element) throws IOException {
20146      composeElementElements(element);
20147      if (element.hasIdentityElement()) {
20148        composeId("identity", element.getIdentityElement());
20149      }
20150      if (element.hasLanguageElement()) {
20151        composeCode("language", element.getLanguageElement());
20152      }
20153      if (element.hasMapElement()) {
20154        composeString("map", element.getMapElement());
20155      }
20156      if (element.hasCommentElement()) {
20157        composeString("comment", element.getCommentElement());
20158      }
20159  }
20160
20161  protected void composeParameterDefinition(String name, ParameterDefinition element) throws IOException {
20162    if (element != null) {
20163      composeElementAttributes(element);
20164      xml.enter(FHIR_NS, name);
20165      composeParameterDefinitionElements(element);
20166      composeElementClose(element);
20167      xml.exit(FHIR_NS, name);
20168    }
20169  }
20170
20171  protected void composeParameterDefinitionElements(ParameterDefinition element) throws IOException {
20172      composeElementElements(element);
20173      if (element.hasNameElement()) {
20174        composeCode("name", element.getNameElement());
20175      }
20176      if (element.hasUseElement())
20177        composeEnumeration("use", element.getUseElement(), new ParameterDefinition.ParameterUseEnumFactory());
20178      if (element.hasMinElement()) {
20179        composeInteger("min", element.getMinElement());
20180      }
20181      if (element.hasMaxElement()) {
20182        composeString("max", element.getMaxElement());
20183      }
20184      if (element.hasDocumentationElement()) {
20185        composeString("documentation", element.getDocumentationElement());
20186      }
20187      if (element.hasTypeElement()) {
20188        composeCode("type", element.getTypeElement());
20189      }
20190      if (element.hasProfile()) {
20191        composeReference("profile", element.getProfile());
20192      }
20193  }
20194
20195  protected void composeDomainResourceAttributes(DomainResource element) throws IOException {
20196    composeResourceAttributes(element);
20197  }
20198
20199  protected void composeDomainResourceElements(DomainResource element) throws IOException {
20200    composeResourceElements(element);
20201      if (element.hasText()) {
20202        composeNarrative("text", element.getText());
20203      }
20204      if (element.hasContained()) { 
20205        for (Resource e : element.getContained()) 
20206        {
20207          xml.enter(FHIR_NS, "contained");
20208          composeResource(e);
20209          xml.exit(FHIR_NS, "contained");
20210        }
20211      }
20212      if (element.hasExtension()) 
20213        for (Extension e : element.getExtension()) 
20214          composeExtension("extension", e);
20215      if (element.hasModifierExtension()) { 
20216        for (Extension e : element.getModifierExtension()) 
20217          composeExtension("modifierExtension", e);
20218      }
20219  }
20220
20221  protected void composeParameters(String name, Parameters element) throws IOException {
20222    if (element != null) {
20223      composeResourceAttributes(element);
20224      xml.enter(FHIR_NS, name);
20225      composeParametersElements(element);
20226      composeElementClose(element);
20227      xml.exit(FHIR_NS, name);
20228    }
20229  }
20230
20231  protected void composeParametersElements(Parameters element) throws IOException {
20232      composeResourceElements(element);
20233      if (element.hasParameter()) { 
20234        for (Parameters.ParametersParameterComponent e : element.getParameter()) 
20235          composeParametersParametersParameterComponent("parameter", e);
20236      }
20237  }
20238
20239  protected void composeParametersParametersParameterComponent(String name, Parameters.ParametersParameterComponent element) throws IOException {
20240    if (element != null) {
20241      composeElementAttributes(element);
20242      xml.enter(FHIR_NS, name);
20243      composeParametersParametersParameterComponentElements(element);
20244      composeElementClose(element);
20245      xml.exit(FHIR_NS, name);
20246    }
20247  }
20248
20249  protected void composeParametersParametersParameterComponentElements(Parameters.ParametersParameterComponent element) throws IOException {
20250      composeBackboneElements(element);
20251      if (element.hasNameElement()) {
20252        composeString("name", element.getNameElement());
20253      }
20254      if (element.hasValue()) {
20255        composeType("value", element.getValue());
20256      }      if (element.hasResource()) {
20257        xml.enter(FHIR_NS, "resource");
20258        composeResource(element.getResource());
20259        xml.exit(FHIR_NS, "resource");
20260      }
20261      if (element.hasPart()) { 
20262        for (Parameters.ParametersParameterComponent e : element.getPart()) 
20263          composeParametersParametersParameterComponent("part", e);
20264      }
20265  }
20266
20267  protected void composeResourceAttributes(Resource element) throws IOException {
20268    if (style != OutputStyle.CANONICAL)
20269      for (String comment : element.getFormatCommentsPre())
20270        xml.comment(comment, getOutputStyle() == OutputStyle.PRETTY);
20271  }
20272
20273  protected void composeResourceElements(Resource element) throws IOException {
20274      if (element.hasIdElement()) {
20275        composeId("id", element.getIdElement());
20276      }
20277      if (element.hasMeta()) {
20278        composeMeta("meta", element.getMeta());
20279      }
20280      if (element.hasImplicitRulesElement()) {
20281        composeUri("implicitRules", element.getImplicitRulesElement());
20282      }
20283      if (element.hasLanguageElement()) {
20284        composeCode("language", element.getLanguageElement());
20285      }
20286  }
20287
20288  protected void composeAccount(String name, Account element) throws IOException {
20289    if (element != null) {
20290      composeDomainResourceAttributes(element);
20291      xml.enter(FHIR_NS, name);
20292      composeAccountElements(element);
20293      composeElementClose(element);
20294      xml.exit(FHIR_NS, name);
20295    }
20296  }
20297
20298  protected void composeAccountElements(Account element) throws IOException {
20299      composeDomainResourceElements(element);
20300      if (element.hasIdentifier()) { 
20301        for (Identifier e : element.getIdentifier()) 
20302          composeIdentifier("identifier", e);
20303      }
20304      if (element.hasStatusElement())
20305        composeEnumeration("status", element.getStatusElement(), new Account.AccountStatusEnumFactory());
20306      if (element.hasType()) {
20307        composeCodeableConcept("type", element.getType());
20308      }
20309      if (element.hasNameElement()) {
20310        composeString("name", element.getNameElement());
20311      }
20312      if (element.hasSubject()) {
20313        composeReference("subject", element.getSubject());
20314      }
20315      if (element.hasPeriod()) {
20316        composePeriod("period", element.getPeriod());
20317      }
20318      if (element.hasActive()) {
20319        composePeriod("active", element.getActive());
20320      }
20321      if (element.hasBalance()) {
20322        composeMoney("balance", element.getBalance());
20323      }
20324      if (element.hasCoverage()) { 
20325        for (Account.CoverageComponent e : element.getCoverage()) 
20326          composeAccountCoverageComponent("coverage", e);
20327      }
20328      if (element.hasOwner()) {
20329        composeReference("owner", element.getOwner());
20330      }
20331      if (element.hasDescriptionElement()) {
20332        composeString("description", element.getDescriptionElement());
20333      }
20334      if (element.hasGuarantor()) { 
20335        for (Account.GuarantorComponent e : element.getGuarantor()) 
20336          composeAccountGuarantorComponent("guarantor", e);
20337      }
20338  }
20339
20340  protected void composeAccountCoverageComponent(String name, Account.CoverageComponent element) throws IOException {
20341    if (element != null) {
20342      composeElementAttributes(element);
20343      xml.enter(FHIR_NS, name);
20344      composeAccountCoverageComponentElements(element);
20345      composeElementClose(element);
20346      xml.exit(FHIR_NS, name);
20347    }
20348  }
20349
20350  protected void composeAccountCoverageComponentElements(Account.CoverageComponent element) throws IOException {
20351      composeBackboneElements(element);
20352      if (element.hasCoverage()) {
20353        composeReference("coverage", element.getCoverage());
20354      }
20355      if (element.hasPriorityElement()) {
20356        composePositiveInt("priority", element.getPriorityElement());
20357      }
20358  }
20359
20360  protected void composeAccountGuarantorComponent(String name, Account.GuarantorComponent element) throws IOException {
20361    if (element != null) {
20362      composeElementAttributes(element);
20363      xml.enter(FHIR_NS, name);
20364      composeAccountGuarantorComponentElements(element);
20365      composeElementClose(element);
20366      xml.exit(FHIR_NS, name);
20367    }
20368  }
20369
20370  protected void composeAccountGuarantorComponentElements(Account.GuarantorComponent element) throws IOException {
20371      composeBackboneElements(element);
20372      if (element.hasParty()) {
20373        composeReference("party", element.getParty());
20374      }
20375      if (element.hasOnHoldElement()) {
20376        composeBoolean("onHold", element.getOnHoldElement());
20377      }
20378      if (element.hasPeriod()) {
20379        composePeriod("period", element.getPeriod());
20380      }
20381  }
20382
20383  protected void composeActivityDefinition(String name, ActivityDefinition element) throws IOException {
20384    if (element != null) {
20385      composeDomainResourceAttributes(element);
20386      xml.enter(FHIR_NS, name);
20387      composeActivityDefinitionElements(element);
20388      composeElementClose(element);
20389      xml.exit(FHIR_NS, name);
20390    }
20391  }
20392
20393  protected void composeActivityDefinitionElements(ActivityDefinition element) throws IOException {
20394      composeDomainResourceElements(element);
20395      if (element.hasUrlElement()) {
20396        composeUri("url", element.getUrlElement());
20397      }
20398      if (element.hasIdentifier()) { 
20399        for (Identifier e : element.getIdentifier()) 
20400          composeIdentifier("identifier", e);
20401      }
20402      if (element.hasVersionElement()) {
20403        composeString("version", element.getVersionElement());
20404      }
20405      if (element.hasNameElement()) {
20406        composeString("name", element.getNameElement());
20407      }
20408      if (element.hasTitleElement()) {
20409        composeString("title", element.getTitleElement());
20410      }
20411      if (element.hasStatusElement())
20412        composeEnumeration("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory());
20413      if (element.hasExperimentalElement()) {
20414        composeBoolean("experimental", element.getExperimentalElement());
20415      }
20416      if (element.hasDateElement()) {
20417        composeDateTime("date", element.getDateElement());
20418      }
20419      if (element.hasPublisherElement()) {
20420        composeString("publisher", element.getPublisherElement());
20421      }
20422      if (element.hasDescriptionElement()) {
20423        composeMarkdown("description", element.getDescriptionElement());
20424      }
20425      if (element.hasPurposeElement()) {
20426        composeMarkdown("purpose", element.getPurposeElement());
20427      }
20428      if (element.hasUsageElement()) {
20429        composeString("usage", element.getUsageElement());
20430      }
20431      if (element.hasApprovalDateElement()) {
20432        composeDate("approvalDate", element.getApprovalDateElement());
20433      }
20434      if (element.hasLastReviewDateElement()) {
20435        composeDate("lastReviewDate", element.getLastReviewDateElement());
20436      }
20437      if (element.hasEffectivePeriod()) {
20438        composePeriod("effectivePeriod", element.getEffectivePeriod());
20439      }
20440      if (element.hasUseContext()) { 
20441        for (UsageContext e : element.getUseContext()) 
20442          composeUsageContext("useContext", e);
20443      }
20444      if (element.hasJurisdiction()) { 
20445        for (CodeableConcept e : element.getJurisdiction()) 
20446          composeCodeableConcept("jurisdiction", e);
20447      }
20448      if (element.hasTopic()) { 
20449        for (CodeableConcept e : element.getTopic()) 
20450          composeCodeableConcept("topic", e);
20451      }
20452      if (element.hasContributor()) { 
20453        for (Contributor e : element.getContributor()) 
20454          composeContributor("contributor", e);
20455      }
20456      if (element.hasContact()) { 
20457        for (ContactDetail e : element.getContact()) 
20458          composeContactDetail("contact", e);
20459      }
20460      if (element.hasCopyrightElement()) {
20461        composeMarkdown("copyright", element.getCopyrightElement());
20462      }
20463      if (element.hasRelatedArtifact()) { 
20464        for (RelatedArtifact e : element.getRelatedArtifact()) 
20465          composeRelatedArtifact("relatedArtifact", e);
20466      }
20467      if (element.hasLibrary()) { 
20468        for (Reference e : element.getLibrary()) 
20469          composeReference("library", e);
20470      }
20471      if (element.hasKindElement())
20472        composeEnumeration("kind", element.getKindElement(), new ActivityDefinition.ActivityDefinitionKindEnumFactory());
20473      if (element.hasCode()) {
20474        composeCodeableConcept("code", element.getCode());
20475      }
20476      if (element.hasTiming()) {
20477        composeType("timing", element.getTiming());
20478      }      if (element.hasLocation()) {
20479        composeReference("location", element.getLocation());
20480      }
20481      if (element.hasParticipant()) { 
20482        for (ActivityDefinition.ActivityDefinitionParticipantComponent e : element.getParticipant()) 
20483          composeActivityDefinitionActivityDefinitionParticipantComponent("participant", e);
20484      }
20485      if (element.hasProduct()) {
20486        composeType("product", element.getProduct());
20487      }      if (element.hasQuantity()) {
20488        composeSimpleQuantity("quantity", element.getQuantity());
20489      }
20490      if (element.hasDosage()) { 
20491        for (Dosage e : element.getDosage()) 
20492          composeDosage("dosage", e);
20493      }
20494      if (element.hasBodySite()) { 
20495        for (CodeableConcept e : element.getBodySite()) 
20496          composeCodeableConcept("bodySite", e);
20497      }
20498      if (element.hasTransform()) {
20499        composeReference("transform", element.getTransform());
20500      }
20501      if (element.hasDynamicValue()) { 
20502        for (ActivityDefinition.ActivityDefinitionDynamicValueComponent e : element.getDynamicValue()) 
20503          composeActivityDefinitionActivityDefinitionDynamicValueComponent("dynamicValue", e);
20504      }
20505  }
20506
20507  protected void composeActivityDefinitionActivityDefinitionParticipantComponent(String name, ActivityDefinition.ActivityDefinitionParticipantComponent element) throws IOException {
20508    if (element != null) {
20509      composeElementAttributes(element);
20510      xml.enter(FHIR_NS, name);
20511      composeActivityDefinitionActivityDefinitionParticipantComponentElements(element);
20512      composeElementClose(element);
20513      xml.exit(FHIR_NS, name);
20514    }
20515  }
20516
20517  protected void composeActivityDefinitionActivityDefinitionParticipantComponentElements(ActivityDefinition.ActivityDefinitionParticipantComponent element) throws IOException {
20518      composeBackboneElements(element);
20519      if (element.hasTypeElement())
20520        composeEnumeration("type", element.getTypeElement(), new ActivityDefinition.ActivityParticipantTypeEnumFactory());
20521      if (element.hasRole()) {
20522        composeCodeableConcept("role", element.getRole());
20523      }
20524  }
20525
20526  protected void composeActivityDefinitionActivityDefinitionDynamicValueComponent(String name, ActivityDefinition.ActivityDefinitionDynamicValueComponent element) throws IOException {
20527    if (element != null) {
20528      composeElementAttributes(element);
20529      xml.enter(FHIR_NS, name);
20530      composeActivityDefinitionActivityDefinitionDynamicValueComponentElements(element);
20531      composeElementClose(element);
20532      xml.exit(FHIR_NS, name);
20533    }
20534  }
20535
20536  protected void composeActivityDefinitionActivityDefinitionDynamicValueComponentElements(ActivityDefinition.ActivityDefinitionDynamicValueComponent element) throws IOException {
20537      composeBackboneElements(element);
20538      if (element.hasDescriptionElement()) {
20539        composeString("description", element.getDescriptionElement());
20540      }
20541      if (element.hasPathElement()) {
20542        composeString("path", element.getPathElement());
20543      }
20544      if (element.hasLanguageElement()) {
20545        composeString("language", element.getLanguageElement());
20546      }
20547      if (element.hasExpressionElement()) {
20548        composeString("expression", element.getExpressionElement());
20549      }
20550  }
20551
20552  protected void composeAdverseEvent(String name, AdverseEvent element) throws IOException {
20553    if (element != null) {
20554      composeDomainResourceAttributes(element);
20555      xml.enter(FHIR_NS, name);
20556      composeAdverseEventElements(element);
20557      composeElementClose(element);
20558      xml.exit(FHIR_NS, name);
20559    }
20560  }
20561
20562  protected void composeAdverseEventElements(AdverseEvent element) throws IOException {
20563      composeDomainResourceElements(element);
20564      if (element.hasIdentifier()) {
20565        composeIdentifier("identifier", element.getIdentifier());
20566      }
20567      if (element.hasCategoryElement())
20568        composeEnumeration("category", element.getCategoryElement(), new AdverseEvent.AdverseEventCategoryEnumFactory());
20569      if (element.hasType()) {
20570        composeCodeableConcept("type", element.getType());
20571      }
20572      if (element.hasSubject()) {
20573        composeReference("subject", element.getSubject());
20574      }
20575      if (element.hasDateElement()) {
20576        composeDateTime("date", element.getDateElement());
20577      }
20578      if (element.hasReaction()) { 
20579        for (Reference e : element.getReaction()) 
20580          composeReference("reaction", e);
20581      }
20582      if (element.hasLocation()) {
20583        composeReference("location", element.getLocation());
20584      }
20585      if (element.hasSeriousness()) {
20586        composeCodeableConcept("seriousness", element.getSeriousness());
20587      }
20588      if (element.hasOutcome()) {
20589        composeCodeableConcept("outcome", element.getOutcome());
20590      }
20591      if (element.hasRecorder()) {
20592        composeReference("recorder", element.getRecorder());
20593      }
20594      if (element.hasEventParticipant()) {
20595        composeReference("eventParticipant", element.getEventParticipant());
20596      }
20597      if (element.hasDescriptionElement()) {
20598        composeString("description", element.getDescriptionElement());
20599      }
20600      if (element.hasSuspectEntity()) { 
20601        for (AdverseEvent.AdverseEventSuspectEntityComponent e : element.getSuspectEntity()) 
20602          composeAdverseEventAdverseEventSuspectEntityComponent("suspectEntity", e);
20603      }
20604      if (element.hasSubjectMedicalHistory()) { 
20605        for (Reference e : element.getSubjectMedicalHistory()) 
20606          composeReference("subjectMedicalHistory", e);
20607      }
20608      if (element.hasReferenceDocument()) { 
20609        for (Reference e : element.getReferenceDocument()) 
20610          composeReference("referenceDocument", e);
20611      }
20612      if (element.hasStudy()) { 
20613        for (Reference e : element.getStudy()) 
20614          composeReference("study", e);
20615      }
20616  }
20617
20618  protected void composeAdverseEventAdverseEventSuspectEntityComponent(String name, AdverseEvent.AdverseEventSuspectEntityComponent element) throws IOException {
20619    if (element != null) {
20620      composeElementAttributes(element);
20621      xml.enter(FHIR_NS, name);
20622      composeAdverseEventAdverseEventSuspectEntityComponentElements(element);
20623      composeElementClose(element);
20624      xml.exit(FHIR_NS, name);
20625    }
20626  }
20627
20628  protected void composeAdverseEventAdverseEventSuspectEntityComponentElements(AdverseEvent.AdverseEventSuspectEntityComponent element) throws IOException {
20629      composeBackboneElements(element);
20630      if (element.hasInstance()) {
20631        composeReference("instance", element.getInstance());
20632      }
20633      if (element.hasCausalityElement())
20634        composeEnumeration("causality", element.getCausalityElement(), new AdverseEvent.AdverseEventCausalityEnumFactory());
20635      if (element.hasCausalityAssessment()) {
20636        composeCodeableConcept("causalityAssessment", element.getCausalityAssessment());
20637      }
20638      if (element.hasCausalityProductRelatednessElement()) {
20639        composeString("causalityProductRelatedness", element.getCausalityProductRelatednessElement());
20640      }
20641      if (element.hasCausalityMethod()) {
20642        composeCodeableConcept("causalityMethod", element.getCausalityMethod());
20643      }
20644      if (element.hasCausalityAuthor()) {
20645        composeReference("causalityAuthor", element.getCausalityAuthor());
20646      }
20647      if (element.hasCausalityResult()) {
20648        composeCodeableConcept("causalityResult", element.getCausalityResult());
20649      }
20650  }
20651
20652  protected void composeAllergyIntolerance(String name, AllergyIntolerance element) throws IOException {
20653    if (element != null) {
20654      composeDomainResourceAttributes(element);
20655      xml.enter(FHIR_NS, name);
20656      composeAllergyIntoleranceElements(element);
20657      composeElementClose(element);
20658      xml.exit(FHIR_NS, name);
20659    }
20660  }
20661
20662  protected void composeAllergyIntoleranceElements(AllergyIntolerance element) throws IOException {
20663      composeDomainResourceElements(element);
20664      if (element.hasIdentifier()) { 
20665        for (Identifier e : element.getIdentifier()) 
20666          composeIdentifier("identifier", e);
20667      }
20668      if (element.hasClinicalStatusElement())
20669        composeEnumeration("clinicalStatus", element.getClinicalStatusElement(), new AllergyIntolerance.AllergyIntoleranceClinicalStatusEnumFactory());
20670      if (element.hasVerificationStatusElement())
20671        composeEnumeration("verificationStatus", element.getVerificationStatusElement(), new AllergyIntolerance.AllergyIntoleranceVerificationStatusEnumFactory());
20672      if (element.hasTypeElement())
20673        composeEnumeration("type", element.getTypeElement(), new AllergyIntolerance.AllergyIntoleranceTypeEnumFactory());
20674        if (element.hasCategory()) 
20675          for (Enumeration<AllergyIntolerance.AllergyIntoleranceCategory> e : element.getCategory()) 
20676            composeEnumeration("category", e, new AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory());
20677      if (element.hasCriticalityElement())
20678        composeEnumeration("criticality", element.getCriticalityElement(), new AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory());
20679      if (element.hasCode()) {
20680        composeCodeableConcept("code", element.getCode());
20681      }
20682      if (element.hasPatient()) {
20683        composeReference("patient", element.getPatient());
20684      }
20685      if (element.hasOnset()) {
20686        composeType("onset", element.getOnset());
20687      }      if (element.hasAssertedDateElement()) {
20688        composeDateTime("assertedDate", element.getAssertedDateElement());
20689      }
20690      if (element.hasRecorder()) {
20691        composeReference("recorder", element.getRecorder());
20692      }
20693      if (element.hasAsserter()) {
20694        composeReference("asserter", element.getAsserter());
20695      }
20696      if (element.hasLastOccurrenceElement()) {
20697        composeDateTime("lastOccurrence", element.getLastOccurrenceElement());
20698      }
20699      if (element.hasNote()) { 
20700        for (Annotation e : element.getNote()) 
20701          composeAnnotation("note", e);
20702      }
20703      if (element.hasReaction()) { 
20704        for (AllergyIntolerance.AllergyIntoleranceReactionComponent e : element.getReaction()) 
20705          composeAllergyIntoleranceAllergyIntoleranceReactionComponent("reaction", e);
20706      }
20707  }
20708
20709  protected void composeAllergyIntoleranceAllergyIntoleranceReactionComponent(String name, AllergyIntolerance.AllergyIntoleranceReactionComponent element) throws IOException {
20710    if (element != null) {
20711      composeElementAttributes(element);
20712      xml.enter(FHIR_NS, name);
20713      composeAllergyIntoleranceAllergyIntoleranceReactionComponentElements(element);
20714      composeElementClose(element);
20715      xml.exit(FHIR_NS, name);
20716    }
20717  }
20718
20719  protected void composeAllergyIntoleranceAllergyIntoleranceReactionComponentElements(AllergyIntolerance.AllergyIntoleranceReactionComponent element) throws IOException {
20720      composeBackboneElements(element);
20721      if (element.hasSubstance()) {
20722        composeCodeableConcept("substance", element.getSubstance());
20723      }
20724      if (element.hasManifestation()) { 
20725        for (CodeableConcept e : element.getManifestation()) 
20726          composeCodeableConcept("manifestation", e);
20727      }
20728      if (element.hasDescriptionElement()) {
20729        composeString("description", element.getDescriptionElement());
20730      }
20731      if (element.hasOnsetElement()) {
20732        composeDateTime("onset", element.getOnsetElement());
20733      }
20734      if (element.hasSeverityElement())
20735        composeEnumeration("severity", element.getSeverityElement(), new AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory());
20736      if (element.hasExposureRoute()) {
20737        composeCodeableConcept("exposureRoute", element.getExposureRoute());
20738      }
20739      if (element.hasNote()) { 
20740        for (Annotation e : element.getNote()) 
20741          composeAnnotation("note", e);
20742      }
20743  }
20744
20745  protected void composeAppointment(String name, Appointment element) throws IOException {
20746    if (element != null) {
20747      composeDomainResourceAttributes(element);
20748      xml.enter(FHIR_NS, name);
20749      composeAppointmentElements(element);
20750      composeElementClose(element);
20751      xml.exit(FHIR_NS, name);
20752    }
20753  }
20754
20755  protected void composeAppointmentElements(Appointment element) throws IOException {
20756      composeDomainResourceElements(element);
20757      if (element.hasIdentifier()) { 
20758        for (Identifier e : element.getIdentifier()) 
20759          composeIdentifier("identifier", e);
20760      }
20761      if (element.hasStatusElement())
20762        composeEnumeration("status", element.getStatusElement(), new Appointment.AppointmentStatusEnumFactory());
20763      if (element.hasServiceCategory()) {
20764        composeCodeableConcept("serviceCategory", element.getServiceCategory());
20765      }
20766      if (element.hasServiceType()) { 
20767        for (CodeableConcept e : element.getServiceType()) 
20768          composeCodeableConcept("serviceType", e);
20769      }
20770      if (element.hasSpecialty()) { 
20771        for (CodeableConcept e : element.getSpecialty()) 
20772          composeCodeableConcept("specialty", e);
20773      }
20774      if (element.hasAppointmentType()) {
20775        composeCodeableConcept("appointmentType", element.getAppointmentType());
20776      }
20777      if (element.hasReason()) { 
20778        for (CodeableConcept e : element.getReason()) 
20779          composeCodeableConcept("reason", e);
20780      }
20781      if (element.hasIndication()) { 
20782        for (Reference e : element.getIndication()) 
20783          composeReference("indication", e);
20784      }
20785      if (element.hasPriorityElement()) {
20786        composeUnsignedInt("priority", element.getPriorityElement());
20787      }
20788      if (element.hasDescriptionElement()) {
20789        composeString("description", element.getDescriptionElement());
20790      }
20791      if (element.hasSupportingInformation()) { 
20792        for (Reference e : element.getSupportingInformation()) 
20793          composeReference("supportingInformation", e);
20794      }
20795      if (element.hasStartElement()) {
20796        composeInstant("start", element.getStartElement());
20797      }
20798      if (element.hasEndElement()) {
20799        composeInstant("end", element.getEndElement());
20800      }
20801      if (element.hasMinutesDurationElement()) {
20802        composePositiveInt("minutesDuration", element.getMinutesDurationElement());
20803      }
20804      if (element.hasSlot()) { 
20805        for (Reference e : element.getSlot()) 
20806          composeReference("slot", e);
20807      }
20808      if (element.hasCreatedElement()) {
20809        composeDateTime("created", element.getCreatedElement());
20810      }
20811      if (element.hasCommentElement()) {
20812        composeString("comment", element.getCommentElement());
20813      }
20814      if (element.hasIncomingReferral()) { 
20815        for (Reference e : element.getIncomingReferral()) 
20816          composeReference("incomingReferral", e);
20817      }
20818      if (element.hasParticipant()) { 
20819        for (Appointment.AppointmentParticipantComponent e : element.getParticipant()) 
20820          composeAppointmentAppointmentParticipantComponent("participant", e);
20821      }
20822      if (element.hasRequestedPeriod()) { 
20823        for (Period e : element.getRequestedPeriod()) 
20824          composePeriod("requestedPeriod", e);
20825      }
20826  }
20827
20828  protected void composeAppointmentAppointmentParticipantComponent(String name, Appointment.AppointmentParticipantComponent element) throws IOException {
20829    if (element != null) {
20830      composeElementAttributes(element);
20831      xml.enter(FHIR_NS, name);
20832      composeAppointmentAppointmentParticipantComponentElements(element);
20833      composeElementClose(element);
20834      xml.exit(FHIR_NS, name);
20835    }
20836  }
20837
20838  protected void composeAppointmentAppointmentParticipantComponentElements(Appointment.AppointmentParticipantComponent element) throws IOException {
20839      composeBackboneElements(element);
20840      if (element.hasType()) { 
20841        for (CodeableConcept e : element.getType()) 
20842          composeCodeableConcept("type", e);
20843      }
20844      if (element.hasActor()) {
20845        composeReference("actor", element.getActor());
20846      }
20847      if (element.hasRequiredElement())
20848        composeEnumeration("required", element.getRequiredElement(), new Appointment.ParticipantRequiredEnumFactory());
20849      if (element.hasStatusElement())
20850        composeEnumeration("status", element.getStatusElement(), new Appointment.ParticipationStatusEnumFactory());
20851  }
20852
20853  protected void composeAppointmentResponse(String name, AppointmentResponse element) throws IOException {
20854    if (element != null) {
20855      composeDomainResourceAttributes(element);
20856      xml.enter(FHIR_NS, name);
20857      composeAppointmentResponseElements(element);
20858      composeElementClose(element);
20859      xml.exit(FHIR_NS, name);
20860    }
20861  }
20862
20863  protected void composeAppointmentResponseElements(AppointmentResponse element) throws IOException {
20864      composeDomainResourceElements(element);
20865      if (element.hasIdentifier()) { 
20866        for (Identifier e : element.getIdentifier()) 
20867          composeIdentifier("identifier", e);
20868      }
20869      if (element.hasAppointment()) {
20870        composeReference("appointment", element.getAppointment());
20871      }
20872      if (element.hasStartElement()) {
20873        composeInstant("start", element.getStartElement());
20874      }
20875      if (element.hasEndElement()) {
20876        composeInstant("end", element.getEndElement());
20877      }
20878      if (element.hasParticipantType()) { 
20879        for (CodeableConcept e : element.getParticipantType()) 
20880          composeCodeableConcept("participantType", e);
20881      }
20882      if (element.hasActor()) {
20883        composeReference("actor", element.getActor());
20884      }
20885      if (element.hasParticipantStatusElement())
20886        composeEnumeration("participantStatus", element.getParticipantStatusElement(), new AppointmentResponse.ParticipantStatusEnumFactory());
20887      if (element.hasCommentElement()) {
20888        composeString("comment", element.getCommentElement());
20889      }
20890  }
20891
20892  protected void composeAuditEvent(String name, AuditEvent element) throws IOException {
20893    if (element != null) {
20894      composeDomainResourceAttributes(element);
20895      xml.enter(FHIR_NS, name);
20896      composeAuditEventElements(element);
20897      composeElementClose(element);
20898      xml.exit(FHIR_NS, name);
20899    }
20900  }
20901
20902  protected void composeAuditEventElements(AuditEvent element) throws IOException {
20903      composeDomainResourceElements(element);
20904      if (element.hasType()) {
20905        composeCoding("type", element.getType());
20906      }
20907      if (element.hasSubtype()) { 
20908        for (Coding e : element.getSubtype()) 
20909          composeCoding("subtype", e);
20910      }
20911      if (element.hasActionElement())
20912        composeEnumeration("action", element.getActionElement(), new AuditEvent.AuditEventActionEnumFactory());
20913      if (element.hasRecordedElement()) {
20914        composeInstant("recorded", element.getRecordedElement());
20915      }
20916      if (element.hasOutcomeElement())
20917        composeEnumeration("outcome", element.getOutcomeElement(), new AuditEvent.AuditEventOutcomeEnumFactory());
20918      if (element.hasOutcomeDescElement()) {
20919        composeString("outcomeDesc", element.getOutcomeDescElement());
20920      }
20921      if (element.hasPurposeOfEvent()) { 
20922        for (CodeableConcept e : element.getPurposeOfEvent()) 
20923          composeCodeableConcept("purposeOfEvent", e);
20924      }
20925      if (element.hasAgent()) { 
20926        for (AuditEvent.AuditEventAgentComponent e : element.getAgent()) 
20927          composeAuditEventAuditEventAgentComponent("agent", e);
20928      }
20929      if (element.hasSource()) {
20930        composeAuditEventAuditEventSourceComponent("source", element.getSource());
20931      }
20932      if (element.hasEntity()) { 
20933        for (AuditEvent.AuditEventEntityComponent e : element.getEntity()) 
20934          composeAuditEventAuditEventEntityComponent("entity", e);
20935      }
20936  }
20937
20938  protected void composeAuditEventAuditEventAgentComponent(String name, AuditEvent.AuditEventAgentComponent element) throws IOException {
20939    if (element != null) {
20940      composeElementAttributes(element);
20941      xml.enter(FHIR_NS, name);
20942      composeAuditEventAuditEventAgentComponentElements(element);
20943      composeElementClose(element);
20944      xml.exit(FHIR_NS, name);
20945    }
20946  }
20947
20948  protected void composeAuditEventAuditEventAgentComponentElements(AuditEvent.AuditEventAgentComponent element) throws IOException {
20949      composeBackboneElements(element);
20950      if (element.hasRole()) { 
20951        for (CodeableConcept e : element.getRole()) 
20952          composeCodeableConcept("role", e);
20953      }
20954      if (element.hasReference()) {
20955        composeReference("reference", element.getReference());
20956      }
20957      if (element.hasUserId()) {
20958        composeIdentifier("userId", element.getUserId());
20959      }
20960      if (element.hasAltIdElement()) {
20961        composeString("altId", element.getAltIdElement());
20962      }
20963      if (element.hasNameElement()) {
20964        composeString("name", element.getNameElement());
20965      }
20966      if (element.hasRequestorElement()) {
20967        composeBoolean("requestor", element.getRequestorElement());
20968      }
20969      if (element.hasLocation()) {
20970        composeReference("location", element.getLocation());
20971      }
20972      if (element.hasPolicy()) { 
20973        for (UriType e : element.getPolicy()) 
20974          composeUri("policy", e);
20975      }
20976      if (element.hasMedia()) {
20977        composeCoding("media", element.getMedia());
20978      }
20979      if (element.hasNetwork()) {
20980        composeAuditEventAuditEventAgentNetworkComponent("network", element.getNetwork());
20981      }
20982      if (element.hasPurposeOfUse()) { 
20983        for (CodeableConcept e : element.getPurposeOfUse()) 
20984          composeCodeableConcept("purposeOfUse", e);
20985      }
20986  }
20987
20988  protected void composeAuditEventAuditEventAgentNetworkComponent(String name, AuditEvent.AuditEventAgentNetworkComponent element) throws IOException {
20989    if (element != null) {
20990      composeElementAttributes(element);
20991      xml.enter(FHIR_NS, name);
20992      composeAuditEventAuditEventAgentNetworkComponentElements(element);
20993      composeElementClose(element);
20994      xml.exit(FHIR_NS, name);
20995    }
20996  }
20997
20998  protected void composeAuditEventAuditEventAgentNetworkComponentElements(AuditEvent.AuditEventAgentNetworkComponent element) throws IOException {
20999      composeBackboneElements(element);
21000      if (element.hasAddressElement()) {
21001        composeString("address", element.getAddressElement());
21002      }
21003      if (element.hasTypeElement())
21004        composeEnumeration("type", element.getTypeElement(), new AuditEvent.AuditEventAgentNetworkTypeEnumFactory());
21005  }
21006
21007  protected void composeAuditEventAuditEventSourceComponent(String name, AuditEvent.AuditEventSourceComponent element) throws IOException {
21008    if (element != null) {
21009      composeElementAttributes(element);
21010      xml.enter(FHIR_NS, name);
21011      composeAuditEventAuditEventSourceComponentElements(element);
21012      composeElementClose(element);
21013      xml.exit(FHIR_NS, name);
21014    }
21015  }
21016
21017  protected void composeAuditEventAuditEventSourceComponentElements(AuditEvent.AuditEventSourceComponent element) throws IOException {
21018      composeBackboneElements(element);
21019      if (element.hasSiteElement()) {
21020        composeString("site", element.getSiteElement());
21021      }
21022      if (element.hasIdentifier()) {
21023        composeIdentifier("identifier", element.getIdentifier());
21024      }
21025      if (element.hasType()) { 
21026        for (Coding e : element.getType()) 
21027          composeCoding("type", e);
21028      }
21029  }
21030
21031  protected void composeAuditEventAuditEventEntityComponent(String name, AuditEvent.AuditEventEntityComponent element) throws IOException {
21032    if (element != null) {
21033      composeElementAttributes(element);
21034      xml.enter(FHIR_NS, name);
21035      composeAuditEventAuditEventEntityComponentElements(element);
21036      composeElementClose(element);
21037      xml.exit(FHIR_NS, name);
21038    }
21039  }
21040
21041  protected void composeAuditEventAuditEventEntityComponentElements(AuditEvent.AuditEventEntityComponent element) throws IOException {
21042      composeBackboneElements(element);
21043      if (element.hasIdentifier()) {
21044        composeIdentifier("identifier", element.getIdentifier());
21045      }
21046      if (element.hasReference()) {
21047        composeReference("reference", element.getReference());
21048      }
21049      if (element.hasType()) {
21050        composeCoding("type", element.getType());
21051      }
21052      if (element.hasRole()) {
21053        composeCoding("role", element.getRole());
21054      }
21055      if (element.hasLifecycle()) {
21056        composeCoding("lifecycle", element.getLifecycle());
21057      }
21058      if (element.hasSecurityLabel()) { 
21059        for (Coding e : element.getSecurityLabel()) 
21060          composeCoding("securityLabel", e);
21061      }
21062      if (element.hasNameElement()) {
21063        composeString("name", element.getNameElement());
21064      }
21065      if (element.hasDescriptionElement()) {
21066        composeString("description", element.getDescriptionElement());
21067      }
21068      if (element.hasQueryElement()) {
21069        composeBase64Binary("query", element.getQueryElement());
21070      }
21071      if (element.hasDetail()) { 
21072        for (AuditEvent.AuditEventEntityDetailComponent e : element.getDetail()) 
21073          composeAuditEventAuditEventEntityDetailComponent("detail", e);
21074      }
21075  }
21076
21077  protected void composeAuditEventAuditEventEntityDetailComponent(String name, AuditEvent.AuditEventEntityDetailComponent element) throws IOException {
21078    if (element != null) {
21079      composeElementAttributes(element);
21080      xml.enter(FHIR_NS, name);
21081      composeAuditEventAuditEventEntityDetailComponentElements(element);
21082      composeElementClose(element);
21083      xml.exit(FHIR_NS, name);
21084    }
21085  }
21086
21087  protected void composeAuditEventAuditEventEntityDetailComponentElements(AuditEvent.AuditEventEntityDetailComponent element) throws IOException {
21088      composeBackboneElements(element);
21089      if (element.hasTypeElement()) {
21090        composeString("type", element.getTypeElement());
21091      }
21092      if (element.hasValueElement()) {
21093        composeBase64Binary("value", element.getValueElement());
21094      }
21095  }
21096
21097  protected void composeBasic(String name, Basic element) throws IOException {
21098    if (element != null) {
21099      composeDomainResourceAttributes(element);
21100      xml.enter(FHIR_NS, name);
21101      composeBasicElements(element);
21102      composeElementClose(element);
21103      xml.exit(FHIR_NS, name);
21104    }
21105  }
21106
21107  protected void composeBasicElements(Basic element) throws IOException {
21108      composeDomainResourceElements(element);
21109      if (element.hasIdentifier()) { 
21110        for (Identifier e : element.getIdentifier()) 
21111          composeIdentifier("identifier", e);
21112      }
21113      if (element.hasCode()) {
21114        composeCodeableConcept("code", element.getCode());
21115      }
21116      if (element.hasSubject()) {
21117        composeReference("subject", element.getSubject());
21118      }
21119      if (element.hasCreatedElement()) {
21120        composeDate("created", element.getCreatedElement());
21121      }
21122      if (element.hasAuthor()) {
21123        composeReference("author", element.getAuthor());
21124      }
21125  }
21126
21127  protected void composeBinary(String name, Binary element) throws IOException {
21128    if (element != null) {
21129      composeResourceAttributes(element);
21130      xml.enter(FHIR_NS, name);
21131      composeBinaryElements(element);
21132      composeElementClose(element);
21133      xml.exit(FHIR_NS, name);
21134    }
21135  }
21136
21137  protected void composeBinaryElements(Binary element) throws IOException {
21138      composeResourceElements(element);
21139      if (element.hasContentTypeElement()) {
21140        composeCode("contentType", element.getContentTypeElement());
21141      }
21142      if (element.hasSecurityContext()) {
21143        composeReference("securityContext", element.getSecurityContext());
21144      }
21145      if (element.hasContentElement()) {
21146        composeBase64Binary("content", element.getContentElement());
21147      }
21148  }
21149
21150  protected void composeBodySite(String name, BodySite element) throws IOException {
21151    if (element != null) {
21152      composeDomainResourceAttributes(element);
21153      xml.enter(FHIR_NS, name);
21154      composeBodySiteElements(element);
21155      composeElementClose(element);
21156      xml.exit(FHIR_NS, name);
21157    }
21158  }
21159
21160  protected void composeBodySiteElements(BodySite element) throws IOException {
21161      composeDomainResourceElements(element);
21162      if (element.hasIdentifier()) { 
21163        for (Identifier e : element.getIdentifier()) 
21164          composeIdentifier("identifier", e);
21165      }
21166      if (element.hasActiveElement()) {
21167        composeBoolean("active", element.getActiveElement());
21168      }
21169      if (element.hasCode()) {
21170        composeCodeableConcept("code", element.getCode());
21171      }
21172      if (element.hasQualifier()) { 
21173        for (CodeableConcept e : element.getQualifier()) 
21174          composeCodeableConcept("qualifier", e);
21175      }
21176      if (element.hasDescriptionElement()) {
21177        composeString("description", element.getDescriptionElement());
21178      }
21179      if (element.hasImage()) { 
21180        for (Attachment e : element.getImage()) 
21181          composeAttachment("image", e);
21182      }
21183      if (element.hasPatient()) {
21184        composeReference("patient", element.getPatient());
21185      }
21186  }
21187
21188  protected void composeBundle(String name, Bundle element) throws IOException {
21189    if (element != null) {
21190      composeResourceAttributes(element);
21191      xml.enter(FHIR_NS, name);
21192      composeBundleElements(element);
21193      composeElementClose(element);
21194      xml.exit(FHIR_NS, name);
21195    }
21196  }
21197
21198  protected void composeBundleElements(Bundle element) throws IOException {
21199      composeResourceElements(element);
21200      if (element.hasIdentifier()) {
21201        composeIdentifier("identifier", element.getIdentifier());
21202      }
21203      if (element.hasTypeElement())
21204        composeEnumeration("type", element.getTypeElement(), new Bundle.BundleTypeEnumFactory());
21205      if (element.hasTotalElement()) {
21206        composeUnsignedInt("total", element.getTotalElement());
21207      }
21208      if (element.hasLink()) { 
21209        for (Bundle.BundleLinkComponent e : element.getLink()) 
21210          composeBundleBundleLinkComponent("link", e);
21211      }
21212      if (element.hasEntry()) { 
21213        for (Bundle.BundleEntryComponent e : element.getEntry()) 
21214          composeBundleBundleEntryComponent("entry", e);
21215      }
21216      if (element.hasSignature()) {
21217        composeSignature("signature", element.getSignature());
21218      }
21219  }
21220
21221  protected void composeBundleBundleLinkComponent(String name, Bundle.BundleLinkComponent element) throws IOException {
21222    if (element != null) {
21223      composeElementAttributes(element);
21224      xml.enter(FHIR_NS, name);
21225      composeBundleBundleLinkComponentElements(element);
21226      composeElementClose(element);
21227      xml.exit(FHIR_NS, name);
21228    }
21229  }
21230
21231  protected void composeBundleBundleLinkComponentElements(Bundle.BundleLinkComponent element) throws IOException {
21232      composeBackboneElements(element);
21233      if (element.hasRelationElement()) {
21234        composeString("relation", element.getRelationElement());
21235      }
21236      if (element.hasUrlElement()) {
21237        composeUri("url", element.getUrlElement());
21238      }
21239  }
21240
21241  protected void composeBundleBundleEntryComponent(String name, Bundle.BundleEntryComponent element) throws IOException {
21242    if (element != null) {
21243      composeElementAttributes(element);
21244      xml.enter(FHIR_NS, name);
21245      composeBundleBundleEntryComponentElements(element);
21246      composeElementClose(element);
21247      xml.exit(FHIR_NS, name);
21248    }
21249  }
21250
21251  protected void composeBundleBundleEntryComponentElements(Bundle.BundleEntryComponent element) throws IOException {
21252      composeBackboneElements(element);
21253      if (element.hasLink()) { 
21254        for (Bundle.BundleLinkComponent e : element.getLink()) 
21255          composeBundleBundleLinkComponent("link", e);
21256      }
21257      if (element.hasFullUrlElement()) {
21258        composeUri("fullUrl", element.getFullUrlElement());
21259      }
21260      if (element.hasResource()) {
21261        xml.enter(FHIR_NS, "resource");
21262        composeResource(element.getResource());
21263        xml.exit(FHIR_NS, "resource");
21264      }
21265      if (element.hasSearch()) {
21266        composeBundleBundleEntrySearchComponent("search", element.getSearch());
21267      }
21268      if (element.hasRequest()) {
21269        composeBundleBundleEntryRequestComponent("request", element.getRequest());
21270      }
21271      if (element.hasResponse()) {
21272        composeBundleBundleEntryResponseComponent("response", element.getResponse());
21273      }
21274  }
21275
21276  protected void composeBundleBundleEntrySearchComponent(String name, Bundle.BundleEntrySearchComponent element) throws IOException {
21277    if (element != null) {
21278      composeElementAttributes(element);
21279      xml.enter(FHIR_NS, name);
21280      composeBundleBundleEntrySearchComponentElements(element);
21281      composeElementClose(element);
21282      xml.exit(FHIR_NS, name);
21283    }
21284  }
21285
21286  protected void composeBundleBundleEntrySearchComponentElements(Bundle.BundleEntrySearchComponent element) throws IOException {
21287      composeBackboneElements(element);
21288      if (element.hasModeElement())
21289        composeEnumeration("mode", element.getModeElement(), new Bundle.SearchEntryModeEnumFactory());
21290      if (element.hasScoreElement()) {
21291        composeDecimal("score", element.getScoreElement());
21292      }
21293  }
21294
21295  protected void composeBundleBundleEntryRequestComponent(String name, Bundle.BundleEntryRequestComponent element) throws IOException {
21296    if (element != null) {
21297      composeElementAttributes(element);
21298      xml.enter(FHIR_NS, name);
21299      composeBundleBundleEntryRequestComponentElements(element);
21300      composeElementClose(element);
21301      xml.exit(FHIR_NS, name);
21302    }
21303  }
21304
21305  protected void composeBundleBundleEntryRequestComponentElements(Bundle.BundleEntryRequestComponent element) throws IOException {
21306      composeBackboneElements(element);
21307      if (element.hasMethodElement())
21308        composeEnumeration("method", element.getMethodElement(), new Bundle.HTTPVerbEnumFactory());
21309      if (element.hasUrlElement()) {
21310        composeUri("url", element.getUrlElement());
21311      }
21312      if (element.hasIfNoneMatchElement()) {
21313        composeString("ifNoneMatch", element.getIfNoneMatchElement());
21314      }
21315      if (element.hasIfModifiedSinceElement()) {
21316        composeInstant("ifModifiedSince", element.getIfModifiedSinceElement());
21317      }
21318      if (element.hasIfMatchElement()) {
21319        composeString("ifMatch", element.getIfMatchElement());
21320      }
21321      if (element.hasIfNoneExistElement()) {
21322        composeString("ifNoneExist", element.getIfNoneExistElement());
21323      }
21324  }
21325
21326  protected void composeBundleBundleEntryResponseComponent(String name, Bundle.BundleEntryResponseComponent element) throws IOException {
21327    if (element != null) {
21328      composeElementAttributes(element);
21329      xml.enter(FHIR_NS, name);
21330      composeBundleBundleEntryResponseComponentElements(element);
21331      composeElementClose(element);
21332      xml.exit(FHIR_NS, name);
21333    }
21334  }
21335
21336  protected void composeBundleBundleEntryResponseComponentElements(Bundle.BundleEntryResponseComponent element) throws IOException {
21337      composeBackboneElements(element);
21338      if (element.hasStatusElement()) {
21339        composeString("status", element.getStatusElement());
21340      }
21341      if (element.hasLocationElement()) {
21342        composeUri("location", element.getLocationElement());
21343      }
21344      if (element.hasEtagElement()) {
21345        composeString("etag", element.getEtagElement());
21346      }
21347      if (element.hasLastModifiedElement()) {
21348        composeInstant("lastModified", element.getLastModifiedElement());
21349      }
21350      if (element.hasOutcome()) {
21351        xml.enter(FHIR_NS, "outcome");
21352        composeResource(element.getOutcome());
21353        xml.exit(FHIR_NS, "outcome");
21354      }
21355  }
21356
21357  protected void composeCapabilityStatement(String name, CapabilityStatement element) throws IOException {
21358    if (element != null) {
21359      composeDomainResourceAttributes(element);
21360      xml.enter(FHIR_NS, name);
21361      composeCapabilityStatementElements(element);
21362      composeElementClose(element);
21363      xml.exit(FHIR_NS, name);
21364    }
21365  }
21366
21367  protected void composeCapabilityStatementElements(CapabilityStatement element) throws IOException {
21368      composeDomainResourceElements(element);
21369      if (element.hasUrlElement()) {
21370        composeUri("url", element.getUrlElement());
21371      }
21372      if (element.hasVersionElement()) {
21373        composeString("version", element.getVersionElement());
21374      }
21375      if (element.hasNameElement()) {
21376        composeString("name", element.getNameElement());
21377      }
21378      if (element.hasTitleElement()) {
21379        composeString("title", element.getTitleElement());
21380      }
21381      if (element.hasStatusElement())
21382        composeEnumeration("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory());
21383      if (element.hasExperimentalElement()) {
21384        composeBoolean("experimental", element.getExperimentalElement());
21385      }
21386      if (element.hasDateElement()) {
21387        composeDateTime("date", element.getDateElement());
21388      }
21389      if (element.hasPublisherElement()) {
21390        composeString("publisher", element.getPublisherElement());
21391      }
21392      if (element.hasContact()) { 
21393        for (ContactDetail e : element.getContact()) 
21394          composeContactDetail("contact", e);
21395      }
21396      if (element.hasDescriptionElement()) {
21397        composeMarkdown("description", element.getDescriptionElement());
21398      }
21399      if (element.hasUseContext()) { 
21400        for (UsageContext e : element.getUseContext()) 
21401          composeUsageContext("useContext", e);
21402      }
21403      if (element.hasJurisdiction()) { 
21404        for (CodeableConcept e : element.getJurisdiction()) 
21405          composeCodeableConcept("jurisdiction", e);
21406      }
21407      if (element.hasPurposeElement()) {
21408        composeMarkdown("purpose", element.getPurposeElement());
21409      }
21410      if (element.hasCopyrightElement()) {
21411        composeMarkdown("copyright", element.getCopyrightElement());
21412      }
21413      if (element.hasKindElement())
21414        composeEnumeration("kind", element.getKindElement(), new CapabilityStatement.CapabilityStatementKindEnumFactory());
21415      if (element.hasInstantiates()) { 
21416        for (UriType e : element.getInstantiates()) 
21417          composeUri("instantiates", e);
21418      }
21419      if (element.hasSoftware()) {
21420        composeCapabilityStatementCapabilityStatementSoftwareComponent("software", element.getSoftware());
21421      }
21422      if (element.hasImplementation()) {
21423        composeCapabilityStatementCapabilityStatementImplementationComponent("implementation", element.getImplementation());
21424      }
21425      if (element.hasFhirVersionElement()) {
21426        composeId("fhirVersion", element.getFhirVersionElement());
21427      }
21428      if (element.hasAcceptUnknownElement())
21429        composeEnumeration("acceptUnknown", element.getAcceptUnknownElement(), new CapabilityStatement.UnknownContentCodeEnumFactory());
21430      if (element.hasFormat()) { 
21431        for (CodeType e : element.getFormat()) 
21432          composeCode("format", e);
21433      }
21434      if (element.hasPatchFormat()) { 
21435        for (CodeType e : element.getPatchFormat()) 
21436          composeCode("patchFormat", e);
21437      }
21438      if (element.hasImplementationGuide()) { 
21439        for (UriType e : element.getImplementationGuide()) 
21440          composeUri("implementationGuide", e);
21441      }
21442      if (element.hasProfile()) { 
21443        for (Reference e : element.getProfile()) 
21444          composeReference("profile", e);
21445      }
21446      if (element.hasRest()) { 
21447        for (CapabilityStatement.CapabilityStatementRestComponent e : element.getRest()) 
21448          composeCapabilityStatementCapabilityStatementRestComponent("rest", e);
21449      }
21450      if (element.hasMessaging()) { 
21451        for (CapabilityStatement.CapabilityStatementMessagingComponent e : element.getMessaging()) 
21452          composeCapabilityStatementCapabilityStatementMessagingComponent("messaging", e);
21453      }
21454      if (element.hasDocument()) { 
21455        for (CapabilityStatement.CapabilityStatementDocumentComponent e : element.getDocument()) 
21456          composeCapabilityStatementCapabilityStatementDocumentComponent("document", e);
21457      }
21458  }
21459
21460  protected void composeCapabilityStatementCapabilityStatementSoftwareComponent(String name, CapabilityStatement.CapabilityStatementSoftwareComponent element) throws IOException {
21461    if (element != null) {
21462      composeElementAttributes(element);
21463      xml.enter(FHIR_NS, name);
21464      composeCapabilityStatementCapabilityStatementSoftwareComponentElements(element);
21465      composeElementClose(element);
21466      xml.exit(FHIR_NS, name);
21467    }
21468  }
21469
21470  protected void composeCapabilityStatementCapabilityStatementSoftwareComponentElements(CapabilityStatement.CapabilityStatementSoftwareComponent element) throws IOException {
21471      composeBackboneElements(element);
21472      if (element.hasNameElement()) {
21473        composeString("name", element.getNameElement());
21474      }
21475      if (element.hasVersionElement()) {
21476        composeString("version", element.getVersionElement());
21477      }
21478      if (element.hasReleaseDateElement()) {
21479        composeDateTime("releaseDate", element.getReleaseDateElement());
21480      }
21481  }
21482
21483  protected void composeCapabilityStatementCapabilityStatementImplementationComponent(String name, CapabilityStatement.CapabilityStatementImplementationComponent element) throws IOException {
21484    if (element != null) {
21485      composeElementAttributes(element);
21486      xml.enter(FHIR_NS, name);
21487      composeCapabilityStatementCapabilityStatementImplementationComponentElements(element);
21488      composeElementClose(element);
21489      xml.exit(FHIR_NS, name);
21490    }
21491  }
21492
21493  protected void composeCapabilityStatementCapabilityStatementImplementationComponentElements(CapabilityStatement.CapabilityStatementImplementationComponent element) throws IOException {
21494      composeBackboneElements(element);
21495      if (element.hasDescriptionElement()) {
21496        composeString("description", element.getDescriptionElement());
21497      }
21498      if (element.hasUrlElement()) {
21499        composeUri("url", element.getUrlElement());
21500      }
21501  }
21502
21503  protected void composeCapabilityStatementCapabilityStatementRestComponent(String name, CapabilityStatement.CapabilityStatementRestComponent element) throws IOException {
21504    if (element != null) {
21505      composeElementAttributes(element);
21506      xml.enter(FHIR_NS, name);
21507      composeCapabilityStatementCapabilityStatementRestComponentElements(element);
21508      composeElementClose(element);
21509      xml.exit(FHIR_NS, name);
21510    }
21511  }
21512
21513  protected void composeCapabilityStatementCapabilityStatementRestComponentElements(CapabilityStatement.CapabilityStatementRestComponent element) throws IOException {
21514      composeBackboneElements(element);
21515      if (element.hasModeElement())
21516        composeEnumeration("mode", element.getModeElement(), new CapabilityStatement.RestfulCapabilityModeEnumFactory());
21517      if (element.hasDocumentationElement()) {
21518        composeString("documentation", element.getDocumentationElement());
21519      }
21520      if (element.hasSecurity()) {
21521        composeCapabilityStatementCapabilityStatementRestSecurityComponent("security", element.getSecurity());
21522      }
21523      if (element.hasResource()) { 
21524        for (CapabilityStatement.CapabilityStatementRestResourceComponent e : element.getResource()) 
21525          composeCapabilityStatementCapabilityStatementRestResourceComponent("resource", e);
21526      }
21527      if (element.hasInteraction()) { 
21528        for (CapabilityStatement.SystemInteractionComponent e : element.getInteraction()) 
21529          composeCapabilityStatementSystemInteractionComponent("interaction", e);
21530      }
21531      if (element.hasSearchParam()) { 
21532        for (CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent e : element.getSearchParam()) 
21533          composeCapabilityStatementCapabilityStatementRestResourceSearchParamComponent("searchParam", e);
21534      }
21535      if (element.hasOperation()) { 
21536        for (CapabilityStatement.CapabilityStatementRestOperationComponent e : element.getOperation()) 
21537          composeCapabilityStatementCapabilityStatementRestOperationComponent("operation", e);
21538      }
21539      if (element.hasCompartment()) { 
21540        for (UriType e : element.getCompartment()) 
21541          composeUri("compartment", e);
21542      }
21543  }
21544
21545  protected void composeCapabilityStatementCapabilityStatementRestSecurityComponent(String name, CapabilityStatement.CapabilityStatementRestSecurityComponent element) throws IOException {
21546    if (element != null) {
21547      composeElementAttributes(element);
21548      xml.enter(FHIR_NS, name);
21549      composeCapabilityStatementCapabilityStatementRestSecurityComponentElements(element);
21550      composeElementClose(element);
21551      xml.exit(FHIR_NS, name);
21552    }
21553  }
21554
21555  protected void composeCapabilityStatementCapabilityStatementRestSecurityComponentElements(CapabilityStatement.CapabilityStatementRestSecurityComponent element) throws IOException {
21556      composeBackboneElements(element);
21557      if (element.hasCorsElement()) {
21558        composeBoolean("cors", element.getCorsElement());
21559      }
21560      if (element.hasService()) { 
21561        for (CodeableConcept e : element.getService()) 
21562          composeCodeableConcept("service", e);
21563      }
21564      if (element.hasDescriptionElement()) {
21565        composeString("description", element.getDescriptionElement());
21566      }
21567      if (element.hasCertificate()) { 
21568        for (CapabilityStatement.CapabilityStatementRestSecurityCertificateComponent e : element.getCertificate()) 
21569          composeCapabilityStatementCapabilityStatementRestSecurityCertificateComponent("certificate", e);
21570      }
21571  }
21572
21573  protected void composeCapabilityStatementCapabilityStatementRestSecurityCertificateComponent(String name, CapabilityStatement.CapabilityStatementRestSecurityCertificateComponent element) throws IOException {
21574    if (element != null) {
21575      composeElementAttributes(element);
21576      xml.enter(FHIR_NS, name);
21577      composeCapabilityStatementCapabilityStatementRestSecurityCertificateComponentElements(element);
21578      composeElementClose(element);
21579      xml.exit(FHIR_NS, name);
21580    }
21581  }
21582
21583  protected void composeCapabilityStatementCapabilityStatementRestSecurityCertificateComponentElements(CapabilityStatement.CapabilityStatementRestSecurityCertificateComponent element) throws IOException {
21584      composeBackboneElements(element);
21585      if (element.hasTypeElement()) {
21586        composeCode("type", element.getTypeElement());
21587      }
21588      if (element.hasBlobElement()) {
21589        composeBase64Binary("blob", element.getBlobElement());
21590      }
21591  }
21592
21593  protected void composeCapabilityStatementCapabilityStatementRestResourceComponent(String name, CapabilityStatement.CapabilityStatementRestResourceComponent element) throws IOException {
21594    if (element != null) {
21595      composeElementAttributes(element);
21596      xml.enter(FHIR_NS, name);
21597      composeCapabilityStatementCapabilityStatementRestResourceComponentElements(element);
21598      composeElementClose(element);
21599      xml.exit(FHIR_NS, name);
21600    }
21601  }
21602
21603  protected void composeCapabilityStatementCapabilityStatementRestResourceComponentElements(CapabilityStatement.CapabilityStatementRestResourceComponent element) throws IOException {
21604      composeBackboneElements(element);
21605      if (element.hasTypeElement()) {
21606        composeCode("type", element.getTypeElement());
21607      }
21608      if (element.hasProfile()) {
21609        composeReference("profile", element.getProfile());
21610      }
21611      if (element.hasDocumentationElement()) {
21612        composeMarkdown("documentation", element.getDocumentationElement());
21613      }
21614      if (element.hasInteraction()) { 
21615        for (CapabilityStatement.ResourceInteractionComponent e : element.getInteraction()) 
21616          composeCapabilityStatementResourceInteractionComponent("interaction", e);
21617      }
21618      if (element.hasVersioningElement())
21619        composeEnumeration("versioning", element.getVersioningElement(), new CapabilityStatement.ResourceVersionPolicyEnumFactory());
21620      if (element.hasReadHistoryElement()) {
21621        composeBoolean("readHistory", element.getReadHistoryElement());
21622      }
21623      if (element.hasUpdateCreateElement()) {
21624        composeBoolean("updateCreate", element.getUpdateCreateElement());
21625      }
21626      if (element.hasConditionalCreateElement()) {
21627        composeBoolean("conditionalCreate", element.getConditionalCreateElement());
21628      }
21629      if (element.hasConditionalReadElement())
21630        composeEnumeration("conditionalRead", element.getConditionalReadElement(), new CapabilityStatement.ConditionalReadStatusEnumFactory());
21631      if (element.hasConditionalUpdateElement()) {
21632        composeBoolean("conditionalUpdate", element.getConditionalUpdateElement());
21633      }
21634      if (element.hasConditionalDeleteElement())
21635        composeEnumeration("conditionalDelete", element.getConditionalDeleteElement(), new CapabilityStatement.ConditionalDeleteStatusEnumFactory());
21636        if (element.hasReferencePolicy()) 
21637          for (Enumeration<CapabilityStatement.ReferenceHandlingPolicy> e : element.getReferencePolicy()) 
21638            composeEnumeration("referencePolicy", e, new CapabilityStatement.ReferenceHandlingPolicyEnumFactory());
21639      if (element.hasSearchInclude()) { 
21640        for (StringType e : element.getSearchInclude()) 
21641          composeString("searchInclude", e);
21642      }
21643      if (element.hasSearchRevInclude()) { 
21644        for (StringType e : element.getSearchRevInclude()) 
21645          composeString("searchRevInclude", e);
21646      }
21647      if (element.hasSearchParam()) { 
21648        for (CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent e : element.getSearchParam()) 
21649          composeCapabilityStatementCapabilityStatementRestResourceSearchParamComponent("searchParam", e);
21650      }
21651  }
21652
21653  protected void composeCapabilityStatementResourceInteractionComponent(String name, CapabilityStatement.ResourceInteractionComponent element) throws IOException {
21654    if (element != null) {
21655      composeElementAttributes(element);
21656      xml.enter(FHIR_NS, name);
21657      composeCapabilityStatementResourceInteractionComponentElements(element);
21658      composeElementClose(element);
21659      xml.exit(FHIR_NS, name);
21660    }
21661  }
21662
21663  protected void composeCapabilityStatementResourceInteractionComponentElements(CapabilityStatement.ResourceInteractionComponent element) throws IOException {
21664      composeBackboneElements(element);
21665      if (element.hasCodeElement())
21666        composeEnumeration("code", element.getCodeElement(), new CapabilityStatement.TypeRestfulInteractionEnumFactory());
21667      if (element.hasDocumentationElement()) {
21668        composeString("documentation", element.getDocumentationElement());
21669      }
21670  }
21671
21672  protected void composeCapabilityStatementCapabilityStatementRestResourceSearchParamComponent(String name, CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent element) throws IOException {
21673    if (element != null) {
21674      composeElementAttributes(element);
21675      xml.enter(FHIR_NS, name);
21676      composeCapabilityStatementCapabilityStatementRestResourceSearchParamComponentElements(element);
21677      composeElementClose(element);
21678      xml.exit(FHIR_NS, name);
21679    }
21680  }
21681
21682  protected void composeCapabilityStatementCapabilityStatementRestResourceSearchParamComponentElements(CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent element) throws IOException {
21683      composeBackboneElements(element);
21684      if (element.hasNameElement()) {
21685        composeString("name", element.getNameElement());
21686      }
21687      if (element.hasDefinitionElement()) {
21688        composeUri("definition", element.getDefinitionElement());
21689      }
21690      if (element.hasTypeElement())
21691        composeEnumeration("type", element.getTypeElement(), new Enumerations.SearchParamTypeEnumFactory());
21692      if (element.hasDocumentationElement()) {
21693        composeString("documentation", element.getDocumentationElement());
21694      }
21695  }
21696
21697  protected void composeCapabilityStatementSystemInteractionComponent(String name, CapabilityStatement.SystemInteractionComponent element) throws IOException {
21698    if (element != null) {
21699      composeElementAttributes(element);
21700      xml.enter(FHIR_NS, name);
21701      composeCapabilityStatementSystemInteractionComponentElements(element);
21702      composeElementClose(element);
21703      xml.exit(FHIR_NS, name);
21704    }
21705  }
21706
21707  protected void composeCapabilityStatementSystemInteractionComponentElements(CapabilityStatement.SystemInteractionComponent element) throws IOException {
21708      composeBackboneElements(element);
21709      if (element.hasCodeElement())
21710        composeEnumeration("code", element.getCodeElement(), new CapabilityStatement.SystemRestfulInteractionEnumFactory());
21711      if (element.hasDocumentationElement()) {
21712        composeString("documentation", element.getDocumentationElement());
21713      }
21714  }
21715
21716  protected void composeCapabilityStatementCapabilityStatementRestOperationComponent(String name, CapabilityStatement.CapabilityStatementRestOperationComponent element) throws IOException {
21717    if (element != null) {
21718      composeElementAttributes(element);
21719      xml.enter(FHIR_NS, name);
21720      composeCapabilityStatementCapabilityStatementRestOperationComponentElements(element);
21721      composeElementClose(element);
21722      xml.exit(FHIR_NS, name);
21723    }
21724  }
21725
21726  protected void composeCapabilityStatementCapabilityStatementRestOperationComponentElements(CapabilityStatement.CapabilityStatementRestOperationComponent element) throws IOException {
21727      composeBackboneElements(element);
21728      if (element.hasNameElement()) {
21729        composeString("name", element.getNameElement());
21730      }
21731      if (element.hasDefinition()) {
21732        composeReference("definition", element.getDefinition());
21733      }
21734  }
21735
21736  protected void composeCapabilityStatementCapabilityStatementMessagingComponent(String name, CapabilityStatement.CapabilityStatementMessagingComponent element) throws IOException {
21737    if (element != null) {
21738      composeElementAttributes(element);
21739      xml.enter(FHIR_NS, name);
21740      composeCapabilityStatementCapabilityStatementMessagingComponentElements(element);
21741      composeElementClose(element);
21742      xml.exit(FHIR_NS, name);
21743    }
21744  }
21745
21746  protected void composeCapabilityStatementCapabilityStatementMessagingComponentElements(CapabilityStatement.CapabilityStatementMessagingComponent element) throws IOException {
21747      composeBackboneElements(element);
21748      if (element.hasEndpoint()) { 
21749        for (CapabilityStatement.CapabilityStatementMessagingEndpointComponent e : element.getEndpoint()) 
21750          composeCapabilityStatementCapabilityStatementMessagingEndpointComponent("endpoint", e);
21751      }
21752      if (element.hasReliableCacheElement()) {
21753        composeUnsignedInt("reliableCache", element.getReliableCacheElement());
21754      }
21755      if (element.hasDocumentationElement()) {
21756        composeString("documentation", element.getDocumentationElement());
21757      }
21758      if (element.hasSupportedMessage()) { 
21759        for (CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent e : element.getSupportedMessage()) 
21760          composeCapabilityStatementCapabilityStatementMessagingSupportedMessageComponent("supportedMessage", e);
21761      }
21762      if (element.hasEvent()) { 
21763        for (CapabilityStatement.CapabilityStatementMessagingEventComponent e : element.getEvent()) 
21764          composeCapabilityStatementCapabilityStatementMessagingEventComponent("event", e);
21765      }
21766  }
21767
21768  protected void composeCapabilityStatementCapabilityStatementMessagingEndpointComponent(String name, CapabilityStatement.CapabilityStatementMessagingEndpointComponent element) throws IOException {
21769    if (element != null) {
21770      composeElementAttributes(element);
21771      xml.enter(FHIR_NS, name);
21772      composeCapabilityStatementCapabilityStatementMessagingEndpointComponentElements(element);
21773      composeElementClose(element);
21774      xml.exit(FHIR_NS, name);
21775    }
21776  }
21777
21778  protected void composeCapabilityStatementCapabilityStatementMessagingEndpointComponentElements(CapabilityStatement.CapabilityStatementMessagingEndpointComponent element) throws IOException {
21779      composeBackboneElements(element);
21780      if (element.hasProtocol()) {
21781        composeCoding("protocol", element.getProtocol());
21782      }
21783      if (element.hasAddressElement()) {
21784        composeUri("address", element.getAddressElement());
21785      }
21786  }
21787
21788  protected void composeCapabilityStatementCapabilityStatementMessagingSupportedMessageComponent(String name, CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent element) throws IOException {
21789    if (element != null) {
21790      composeElementAttributes(element);
21791      xml.enter(FHIR_NS, name);
21792      composeCapabilityStatementCapabilityStatementMessagingSupportedMessageComponentElements(element);
21793      composeElementClose(element);
21794      xml.exit(FHIR_NS, name);
21795    }
21796  }
21797
21798  protected void composeCapabilityStatementCapabilityStatementMessagingSupportedMessageComponentElements(CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent element) throws IOException {
21799      composeBackboneElements(element);
21800      if (element.hasModeElement())
21801        composeEnumeration("mode", element.getModeElement(), new CapabilityStatement.EventCapabilityModeEnumFactory());
21802      if (element.hasDefinition()) {
21803        composeReference("definition", element.getDefinition());
21804      }
21805  }
21806
21807  protected void composeCapabilityStatementCapabilityStatementMessagingEventComponent(String name, CapabilityStatement.CapabilityStatementMessagingEventComponent element) throws IOException {
21808    if (element != null) {
21809      composeElementAttributes(element);
21810      xml.enter(FHIR_NS, name);
21811      composeCapabilityStatementCapabilityStatementMessagingEventComponentElements(element);
21812      composeElementClose(element);
21813      xml.exit(FHIR_NS, name);
21814    }
21815  }
21816
21817  protected void composeCapabilityStatementCapabilityStatementMessagingEventComponentElements(CapabilityStatement.CapabilityStatementMessagingEventComponent element) throws IOException {
21818      composeBackboneElements(element);
21819      if (element.hasCode()) {
21820        composeCoding("code", element.getCode());
21821      }
21822      if (element.hasCategoryElement())
21823        composeEnumeration("category", element.getCategoryElement(), new CapabilityStatement.MessageSignificanceCategoryEnumFactory());
21824      if (element.hasModeElement())
21825        composeEnumeration("mode", element.getModeElement(), new CapabilityStatement.EventCapabilityModeEnumFactory());
21826      if (element.hasFocusElement()) {
21827        composeCode("focus", element.getFocusElement());
21828      }
21829      if (element.hasRequest()) {
21830        composeReference("request", element.getRequest());
21831      }
21832      if (element.hasResponse()) {
21833        composeReference("response", element.getResponse());
21834      }
21835      if (element.hasDocumentationElement()) {
21836        composeString("documentation", element.getDocumentationElement());
21837      }
21838  }
21839
21840  protected void composeCapabilityStatementCapabilityStatementDocumentComponent(String name, CapabilityStatement.CapabilityStatementDocumentComponent element) throws IOException {
21841    if (element != null) {
21842      composeElementAttributes(element);
21843      xml.enter(FHIR_NS, name);
21844      composeCapabilityStatementCapabilityStatementDocumentComponentElements(element);
21845      composeElementClose(element);
21846      xml.exit(FHIR_NS, name);
21847    }
21848  }
21849
21850  protected void composeCapabilityStatementCapabilityStatementDocumentComponentElements(CapabilityStatement.CapabilityStatementDocumentComponent element) throws IOException {
21851      composeBackboneElements(element);
21852      if (element.hasModeElement())
21853        composeEnumeration("mode", element.getModeElement(), new CapabilityStatement.DocumentModeEnumFactory());
21854      if (element.hasDocumentationElement()) {
21855        composeString("documentation", element.getDocumentationElement());
21856      }
21857      if (element.hasProfile()) {
21858        composeReference("profile", element.getProfile());
21859      }
21860  }
21861
21862  protected void composeCarePlan(String name, CarePlan element) throws IOException {
21863    if (element != null) {
21864      composeDomainResourceAttributes(element);
21865      xml.enter(FHIR_NS, name);
21866      composeCarePlanElements(element);
21867      composeElementClose(element);
21868      xml.exit(FHIR_NS, name);
21869    }
21870  }
21871
21872  protected void composeCarePlanElements(CarePlan element) throws IOException {
21873      composeDomainResourceElements(element);
21874      if (element.hasIdentifier()) { 
21875        for (Identifier e : element.getIdentifier()) 
21876          composeIdentifier("identifier", e);
21877      }
21878      if (element.hasDefinition()) { 
21879        for (Reference e : element.getDefinition()) 
21880          composeReference("definition", e);
21881      }
21882      if (element.hasBasedOn()) { 
21883        for (Reference e : element.getBasedOn()) 
21884          composeReference("basedOn", e);
21885      }
21886      if (element.hasReplaces()) { 
21887        for (Reference e : element.getReplaces()) 
21888          composeReference("replaces", e);
21889      }
21890      if (element.hasPartOf()) { 
21891        for (Reference e : element.getPartOf()) 
21892          composeReference("partOf", e);
21893      }
21894      if (element.hasStatusElement())
21895        composeEnumeration("status", element.getStatusElement(), new CarePlan.CarePlanStatusEnumFactory());
21896      if (element.hasIntentElement())
21897        composeEnumeration("intent", element.getIntentElement(), new CarePlan.CarePlanIntentEnumFactory());
21898      if (element.hasCategory()) { 
21899        for (CodeableConcept e : element.getCategory()) 
21900          composeCodeableConcept("category", e);
21901      }
21902      if (element.hasTitleElement()) {
21903        composeString("title", element.getTitleElement());
21904      }
21905      if (element.hasDescriptionElement()) {
21906        composeString("description", element.getDescriptionElement());
21907      }
21908      if (element.hasSubject()) {
21909        composeReference("subject", element.getSubject());
21910      }
21911      if (element.hasContext()) {
21912        composeReference("context", element.getContext());
21913      }
21914      if (element.hasPeriod()) {
21915        composePeriod("period", element.getPeriod());
21916      }
21917      if (element.hasAuthor()) { 
21918        for (Reference e : element.getAuthor()) 
21919          composeReference("author", e);
21920      }
21921      if (element.hasCareTeam()) { 
21922        for (Reference e : element.getCareTeam()) 
21923          composeReference("careTeam", e);
21924      }
21925      if (element.hasAddresses()) { 
21926        for (Reference e : element.getAddresses()) 
21927          composeReference("addresses", e);
21928      }
21929      if (element.hasSupportingInfo()) { 
21930        for (Reference e : element.getSupportingInfo()) 
21931          composeReference("supportingInfo", e);
21932      }
21933      if (element.hasGoal()) { 
21934        for (Reference e : element.getGoal()) 
21935          composeReference("goal", e);
21936      }
21937      if (element.hasActivity()) { 
21938        for (CarePlan.CarePlanActivityComponent e : element.getActivity()) 
21939          composeCarePlanCarePlanActivityComponent("activity", e);
21940      }
21941      if (element.hasNote()) { 
21942        for (Annotation e : element.getNote()) 
21943          composeAnnotation("note", e);
21944      }
21945  }
21946
21947  protected void composeCarePlanCarePlanActivityComponent(String name, CarePlan.CarePlanActivityComponent element) throws IOException {
21948    if (element != null) {
21949      composeElementAttributes(element);
21950      xml.enter(FHIR_NS, name);
21951      composeCarePlanCarePlanActivityComponentElements(element);
21952      composeElementClose(element);
21953      xml.exit(FHIR_NS, name);
21954    }
21955  }
21956
21957  protected void composeCarePlanCarePlanActivityComponentElements(CarePlan.CarePlanActivityComponent element) throws IOException {
21958      composeBackboneElements(element);
21959      if (element.hasOutcomeCodeableConcept()) { 
21960        for (CodeableConcept e : element.getOutcomeCodeableConcept()) 
21961          composeCodeableConcept("outcomeCodeableConcept", e);
21962      }
21963      if (element.hasOutcomeReference()) { 
21964        for (Reference e : element.getOutcomeReference()) 
21965          composeReference("outcomeReference", e);
21966      }
21967      if (element.hasProgress()) { 
21968        for (Annotation e : element.getProgress()) 
21969          composeAnnotation("progress", e);
21970      }
21971      if (element.hasReference()) {
21972        composeReference("reference", element.getReference());
21973      }
21974      if (element.hasDetail()) {
21975        composeCarePlanCarePlanActivityDetailComponent("detail", element.getDetail());
21976      }
21977  }
21978
21979  protected void composeCarePlanCarePlanActivityDetailComponent(String name, CarePlan.CarePlanActivityDetailComponent element) throws IOException {
21980    if (element != null) {
21981      composeElementAttributes(element);
21982      xml.enter(FHIR_NS, name);
21983      composeCarePlanCarePlanActivityDetailComponentElements(element);
21984      composeElementClose(element);
21985      xml.exit(FHIR_NS, name);
21986    }
21987  }
21988
21989  protected void composeCarePlanCarePlanActivityDetailComponentElements(CarePlan.CarePlanActivityDetailComponent element) throws IOException {
21990      composeBackboneElements(element);
21991      if (element.hasCategory()) {
21992        composeCodeableConcept("category", element.getCategory());
21993      }
21994      if (element.hasDefinition()) {
21995        composeReference("definition", element.getDefinition());
21996      }
21997      if (element.hasCode()) {
21998        composeCodeableConcept("code", element.getCode());
21999      }
22000      if (element.hasReasonCode()) { 
22001        for (CodeableConcept e : element.getReasonCode()) 
22002          composeCodeableConcept("reasonCode", e);
22003      }
22004      if (element.hasReasonReference()) { 
22005        for (Reference e : element.getReasonReference()) 
22006          composeReference("reasonReference", e);
22007      }
22008      if (element.hasGoal()) { 
22009        for (Reference e : element.getGoal()) 
22010          composeReference("goal", e);
22011      }
22012      if (element.hasStatusElement())
22013        composeEnumeration("status", element.getStatusElement(), new CarePlan.CarePlanActivityStatusEnumFactory());
22014      if (element.hasStatusReasonElement()) {
22015        composeString("statusReason", element.getStatusReasonElement());
22016      }
22017      if (element.hasProhibitedElement()) {
22018        composeBoolean("prohibited", element.getProhibitedElement());
22019      }
22020      if (element.hasScheduled()) {
22021        composeType("scheduled", element.getScheduled());
22022      }      if (element.hasLocation()) {
22023        composeReference("location", element.getLocation());
22024      }
22025      if (element.hasPerformer()) { 
22026        for (Reference e : element.getPerformer()) 
22027          composeReference("performer", e);
22028      }
22029      if (element.hasProduct()) {
22030        composeType("product", element.getProduct());
22031      }      if (element.hasDailyAmount()) {
22032        composeSimpleQuantity("dailyAmount", element.getDailyAmount());
22033      }
22034      if (element.hasQuantity()) {
22035        composeSimpleQuantity("quantity", element.getQuantity());
22036      }
22037      if (element.hasDescriptionElement()) {
22038        composeString("description", element.getDescriptionElement());
22039      }
22040  }
22041
22042  protected void composeCareTeam(String name, CareTeam element) throws IOException {
22043    if (element != null) {
22044      composeDomainResourceAttributes(element);
22045      xml.enter(FHIR_NS, name);
22046      composeCareTeamElements(element);
22047      composeElementClose(element);
22048      xml.exit(FHIR_NS, name);
22049    }
22050  }
22051
22052  protected void composeCareTeamElements(CareTeam element) throws IOException {
22053      composeDomainResourceElements(element);
22054      if (element.hasIdentifier()) { 
22055        for (Identifier e : element.getIdentifier()) 
22056          composeIdentifier("identifier", e);
22057      }
22058      if (element.hasStatusElement())
22059        composeEnumeration("status", element.getStatusElement(), new CareTeam.CareTeamStatusEnumFactory());
22060      if (element.hasCategory()) { 
22061        for (CodeableConcept e : element.getCategory()) 
22062          composeCodeableConcept("category", e);
22063      }
22064      if (element.hasNameElement()) {
22065        composeString("name", element.getNameElement());
22066      }
22067      if (element.hasSubject()) {
22068        composeReference("subject", element.getSubject());
22069      }
22070      if (element.hasContext()) {
22071        composeReference("context", element.getContext());
22072      }
22073      if (element.hasPeriod()) {
22074        composePeriod("period", element.getPeriod());
22075      }
22076      if (element.hasParticipant()) { 
22077        for (CareTeam.CareTeamParticipantComponent e : element.getParticipant()) 
22078          composeCareTeamCareTeamParticipantComponent("participant", e);
22079      }
22080      if (element.hasReasonCode()) { 
22081        for (CodeableConcept e : element.getReasonCode()) 
22082          composeCodeableConcept("reasonCode", e);
22083      }
22084      if (element.hasReasonReference()) { 
22085        for (Reference e : element.getReasonReference()) 
22086          composeReference("reasonReference", e);
22087      }
22088      if (element.hasManagingOrganization()) { 
22089        for (Reference e : element.getManagingOrganization()) 
22090          composeReference("managingOrganization", e);
22091      }
22092      if (element.hasNote()) { 
22093        for (Annotation e : element.getNote()) 
22094          composeAnnotation("note", e);
22095      }
22096  }
22097
22098  protected void composeCareTeamCareTeamParticipantComponent(String name, CareTeam.CareTeamParticipantComponent element) throws IOException {
22099    if (element != null) {
22100      composeElementAttributes(element);
22101      xml.enter(FHIR_NS, name);
22102      composeCareTeamCareTeamParticipantComponentElements(element);
22103      composeElementClose(element);
22104      xml.exit(FHIR_NS, name);
22105    }
22106  }
22107
22108  protected void composeCareTeamCareTeamParticipantComponentElements(CareTeam.CareTeamParticipantComponent element) throws IOException {
22109      composeBackboneElements(element);
22110      if (element.hasRole()) {
22111        composeCodeableConcept("role", element.getRole());
22112      }
22113      if (element.hasMember()) {
22114        composeReference("member", element.getMember());
22115      }
22116      if (element.hasOnBehalfOf()) {
22117        composeReference("onBehalfOf", element.getOnBehalfOf());
22118      }
22119      if (element.hasPeriod()) {
22120        composePeriod("period", element.getPeriod());
22121      }
22122  }
22123
22124  protected void composeChargeItem(String name, ChargeItem element) throws IOException {
22125    if (element != null) {
22126      composeDomainResourceAttributes(element);
22127      xml.enter(FHIR_NS, name);
22128      composeChargeItemElements(element);
22129      composeElementClose(element);
22130      xml.exit(FHIR_NS, name);
22131    }
22132  }
22133
22134  protected void composeChargeItemElements(ChargeItem element) throws IOException {
22135      composeDomainResourceElements(element);
22136      if (element.hasIdentifier()) {
22137        composeIdentifier("identifier", element.getIdentifier());
22138      }
22139      if (element.hasDefinition()) { 
22140        for (UriType e : element.getDefinition()) 
22141          composeUri("definition", e);
22142      }
22143      if (element.hasStatusElement())
22144        composeEnumeration("status", element.getStatusElement(), new ChargeItem.ChargeItemStatusEnumFactory());
22145      if (element.hasPartOf()) { 
22146        for (Reference e : element.getPartOf()) 
22147          composeReference("partOf", e);
22148      }
22149      if (element.hasCode()) {
22150        composeCodeableConcept("code", element.getCode());
22151      }
22152      if (element.hasSubject()) {
22153        composeReference("subject", element.getSubject());
22154      }
22155      if (element.hasContext()) {
22156        composeReference("context", element.getContext());
22157      }
22158      if (element.hasOccurrence()) {
22159        composeType("occurrence", element.getOccurrence());
22160      }      if (element.hasParticipant()) { 
22161        for (ChargeItem.ChargeItemParticipantComponent e : element.getParticipant()) 
22162          composeChargeItemChargeItemParticipantComponent("participant", e);
22163      }
22164      if (element.hasPerformingOrganization()) {
22165        composeReference("performingOrganization", element.getPerformingOrganization());
22166      }
22167      if (element.hasRequestingOrganization()) {
22168        composeReference("requestingOrganization", element.getRequestingOrganization());
22169      }
22170      if (element.hasQuantity()) {
22171        composeQuantity("quantity", element.getQuantity());
22172      }
22173      if (element.hasBodysite()) { 
22174        for (CodeableConcept e : element.getBodysite()) 
22175          composeCodeableConcept("bodysite", e);
22176      }
22177      if (element.hasFactorOverrideElement()) {
22178        composeDecimal("factorOverride", element.getFactorOverrideElement());
22179      }
22180      if (element.hasPriceOverride()) {
22181        composeMoney("priceOverride", element.getPriceOverride());
22182      }
22183      if (element.hasOverrideReasonElement()) {
22184        composeString("overrideReason", element.getOverrideReasonElement());
22185      }
22186      if (element.hasEnterer()) {
22187        composeReference("enterer", element.getEnterer());
22188      }
22189      if (element.hasEnteredDateElement()) {
22190        composeDateTime("enteredDate", element.getEnteredDateElement());
22191      }
22192      if (element.hasReason()) { 
22193        for (CodeableConcept e : element.getReason()) 
22194          composeCodeableConcept("reason", e);
22195      }
22196      if (element.hasService()) { 
22197        for (Reference e : element.getService()) 
22198          composeReference("service", e);
22199      }
22200      if (element.hasAccount()) { 
22201        for (Reference e : element.getAccount()) 
22202          composeReference("account", e);
22203      }
22204      if (element.hasNote()) { 
22205        for (Annotation e : element.getNote()) 
22206          composeAnnotation("note", e);
22207      }
22208      if (element.hasSupportingInformation()) { 
22209        for (Reference e : element.getSupportingInformation()) 
22210          composeReference("supportingInformation", e);
22211      }
22212  }
22213
22214  protected void composeChargeItemChargeItemParticipantComponent(String name, ChargeItem.ChargeItemParticipantComponent element) throws IOException {
22215    if (element != null) {
22216      composeElementAttributes(element);
22217      xml.enter(FHIR_NS, name);
22218      composeChargeItemChargeItemParticipantComponentElements(element);
22219      composeElementClose(element);
22220      xml.exit(FHIR_NS, name);
22221    }
22222  }
22223
22224  protected void composeChargeItemChargeItemParticipantComponentElements(ChargeItem.ChargeItemParticipantComponent element) throws IOException {
22225      composeBackboneElements(element);
22226      if (element.hasRole()) {
22227        composeCodeableConcept("role", element.getRole());
22228      }
22229      if (element.hasActor()) {
22230        composeReference("actor", element.getActor());
22231      }
22232  }
22233
22234  protected void composeClaim(String name, Claim element) throws IOException {
22235    if (element != null) {
22236      composeDomainResourceAttributes(element);
22237      xml.enter(FHIR_NS, name);
22238      composeClaimElements(element);
22239      composeElementClose(element);
22240      xml.exit(FHIR_NS, name);
22241    }
22242  }
22243
22244  protected void composeClaimElements(Claim element) throws IOException {
22245      composeDomainResourceElements(element);
22246      if (element.hasIdentifier()) { 
22247        for (Identifier e : element.getIdentifier()) 
22248          composeIdentifier("identifier", e);
22249      }
22250      if (element.hasStatusElement())
22251        composeEnumeration("status", element.getStatusElement(), new Claim.ClaimStatusEnumFactory());
22252      if (element.hasType()) {
22253        composeCodeableConcept("type", element.getType());
22254      }
22255      if (element.hasSubType()) { 
22256        for (CodeableConcept e : element.getSubType()) 
22257          composeCodeableConcept("subType", e);
22258      }
22259      if (element.hasUseElement())
22260        composeEnumeration("use", element.getUseElement(), new Claim.UseEnumFactory());
22261      if (element.hasPatient()) {
22262        composeReference("patient", element.getPatient());
22263      }
22264      if (element.hasBillablePeriod()) {
22265        composePeriod("billablePeriod", element.getBillablePeriod());
22266      }
22267      if (element.hasCreatedElement()) {
22268        composeDateTime("created", element.getCreatedElement());
22269      }
22270      if (element.hasEnterer()) {
22271        composeReference("enterer", element.getEnterer());
22272      }
22273      if (element.hasInsurer()) {
22274        composeReference("insurer", element.getInsurer());
22275      }
22276      if (element.hasProvider()) {
22277        composeReference("provider", element.getProvider());
22278      }
22279      if (element.hasOrganization()) {
22280        composeReference("organization", element.getOrganization());
22281      }
22282      if (element.hasPriority()) {
22283        composeCodeableConcept("priority", element.getPriority());
22284      }
22285      if (element.hasFundsReserve()) {
22286        composeCodeableConcept("fundsReserve", element.getFundsReserve());
22287      }
22288      if (element.hasRelated()) { 
22289        for (Claim.RelatedClaimComponent e : element.getRelated()) 
22290          composeClaimRelatedClaimComponent("related", e);
22291      }
22292      if (element.hasPrescription()) {
22293        composeReference("prescription", element.getPrescription());
22294      }
22295      if (element.hasOriginalPrescription()) {
22296        composeReference("originalPrescription", element.getOriginalPrescription());
22297      }
22298      if (element.hasPayee()) {
22299        composeClaimPayeeComponent("payee", element.getPayee());
22300      }
22301      if (element.hasReferral()) {
22302        composeReference("referral", element.getReferral());
22303      }
22304      if (element.hasFacility()) {
22305        composeReference("facility", element.getFacility());
22306      }
22307      if (element.hasCareTeam()) { 
22308        for (Claim.CareTeamComponent e : element.getCareTeam()) 
22309          composeClaimCareTeamComponent("careTeam", e);
22310      }
22311      if (element.hasInformation()) { 
22312        for (Claim.SpecialConditionComponent e : element.getInformation()) 
22313          composeClaimSpecialConditionComponent("information", e);
22314      }
22315      if (element.hasDiagnosis()) { 
22316        for (Claim.DiagnosisComponent e : element.getDiagnosis()) 
22317          composeClaimDiagnosisComponent("diagnosis", e);
22318      }
22319      if (element.hasProcedure()) { 
22320        for (Claim.ProcedureComponent e : element.getProcedure()) 
22321          composeClaimProcedureComponent("procedure", e);
22322      }
22323      if (element.hasInsurance()) { 
22324        for (Claim.InsuranceComponent e : element.getInsurance()) 
22325          composeClaimInsuranceComponent("insurance", e);
22326      }
22327      if (element.hasAccident()) {
22328        composeClaimAccidentComponent("accident", element.getAccident());
22329      }
22330      if (element.hasEmploymentImpacted()) {
22331        composePeriod("employmentImpacted", element.getEmploymentImpacted());
22332      }
22333      if (element.hasHospitalization()) {
22334        composePeriod("hospitalization", element.getHospitalization());
22335      }
22336      if (element.hasItem()) { 
22337        for (Claim.ItemComponent e : element.getItem()) 
22338          composeClaimItemComponent("item", e);
22339      }
22340      if (element.hasTotal()) {
22341        composeMoney("total", element.getTotal());
22342      }
22343  }
22344
22345  protected void composeClaimRelatedClaimComponent(String name, Claim.RelatedClaimComponent element) throws IOException {
22346    if (element != null) {
22347      composeElementAttributes(element);
22348      xml.enter(FHIR_NS, name);
22349      composeClaimRelatedClaimComponentElements(element);
22350      composeElementClose(element);
22351      xml.exit(FHIR_NS, name);
22352    }
22353  }
22354
22355  protected void composeClaimRelatedClaimComponentElements(Claim.RelatedClaimComponent element) throws IOException {
22356      composeBackboneElements(element);
22357      if (element.hasClaim()) {
22358        composeReference("claim", element.getClaim());
22359      }
22360      if (element.hasRelationship()) {
22361        composeCodeableConcept("relationship", element.getRelationship());
22362      }
22363      if (element.hasReference()) {
22364        composeIdentifier("reference", element.getReference());
22365      }
22366  }
22367
22368  protected void composeClaimPayeeComponent(String name, Claim.PayeeComponent element) throws IOException {
22369    if (element != null) {
22370      composeElementAttributes(element);
22371      xml.enter(FHIR_NS, name);
22372      composeClaimPayeeComponentElements(element);
22373      composeElementClose(element);
22374      xml.exit(FHIR_NS, name);
22375    }
22376  }
22377
22378  protected void composeClaimPayeeComponentElements(Claim.PayeeComponent element) throws IOException {
22379      composeBackboneElements(element);
22380      if (element.hasType()) {
22381        composeCodeableConcept("type", element.getType());
22382      }
22383      if (element.hasResourceType()) {
22384        composeCoding("resourceType", element.getResourceType());
22385      }
22386      if (element.hasParty()) {
22387        composeReference("party", element.getParty());
22388      }
22389  }
22390
22391  protected void composeClaimCareTeamComponent(String name, Claim.CareTeamComponent element) throws IOException {
22392    if (element != null) {
22393      composeElementAttributes(element);
22394      xml.enter(FHIR_NS, name);
22395      composeClaimCareTeamComponentElements(element);
22396      composeElementClose(element);
22397      xml.exit(FHIR_NS, name);
22398    }
22399  }
22400
22401  protected void composeClaimCareTeamComponentElements(Claim.CareTeamComponent element) throws IOException {
22402      composeBackboneElements(element);
22403      if (element.hasSequenceElement()) {
22404        composePositiveInt("sequence", element.getSequenceElement());
22405      }
22406      if (element.hasProvider()) {
22407        composeReference("provider", element.getProvider());
22408      }
22409      if (element.hasResponsibleElement()) {
22410        composeBoolean("responsible", element.getResponsibleElement());
22411      }
22412      if (element.hasRole()) {
22413        composeCodeableConcept("role", element.getRole());
22414      }
22415      if (element.hasQualification()) {
22416        composeCodeableConcept("qualification", element.getQualification());
22417      }
22418  }
22419
22420  protected void composeClaimSpecialConditionComponent(String name, Claim.SpecialConditionComponent element) throws IOException {
22421    if (element != null) {
22422      composeElementAttributes(element);
22423      xml.enter(FHIR_NS, name);
22424      composeClaimSpecialConditionComponentElements(element);
22425      composeElementClose(element);
22426      xml.exit(FHIR_NS, name);
22427    }
22428  }
22429
22430  protected void composeClaimSpecialConditionComponentElements(Claim.SpecialConditionComponent element) throws IOException {
22431      composeBackboneElements(element);
22432      if (element.hasSequenceElement()) {
22433        composePositiveInt("sequence", element.getSequenceElement());
22434      }
22435      if (element.hasCategory()) {
22436        composeCodeableConcept("category", element.getCategory());
22437      }
22438      if (element.hasCode()) {
22439        composeCodeableConcept("code", element.getCode());
22440      }
22441      if (element.hasTiming()) {
22442        composeType("timing", element.getTiming());
22443      }      if (element.hasValue()) {
22444        composeType("value", element.getValue());
22445      }      if (element.hasReason()) {
22446        composeCodeableConcept("reason", element.getReason());
22447      }
22448  }
22449
22450  protected void composeClaimDiagnosisComponent(String name, Claim.DiagnosisComponent element) throws IOException {
22451    if (element != null) {
22452      composeElementAttributes(element);
22453      xml.enter(FHIR_NS, name);
22454      composeClaimDiagnosisComponentElements(element);
22455      composeElementClose(element);
22456      xml.exit(FHIR_NS, name);
22457    }
22458  }
22459
22460  protected void composeClaimDiagnosisComponentElements(Claim.DiagnosisComponent element) throws IOException {
22461      composeBackboneElements(element);
22462      if (element.hasSequenceElement()) {
22463        composePositiveInt("sequence", element.getSequenceElement());
22464      }
22465      if (element.hasDiagnosis()) {
22466        composeType("diagnosis", element.getDiagnosis());
22467      }      if (element.hasType()) { 
22468        for (CodeableConcept e : element.getType()) 
22469          composeCodeableConcept("type", e);
22470      }
22471      if (element.hasPackageCode()) {
22472        composeCodeableConcept("packageCode", element.getPackageCode());
22473      }
22474  }
22475
22476  protected void composeClaimProcedureComponent(String name, Claim.ProcedureComponent element) throws IOException {
22477    if (element != null) {
22478      composeElementAttributes(element);
22479      xml.enter(FHIR_NS, name);
22480      composeClaimProcedureComponentElements(element);
22481      composeElementClose(element);
22482      xml.exit(FHIR_NS, name);
22483    }
22484  }
22485
22486  protected void composeClaimProcedureComponentElements(Claim.ProcedureComponent element) throws IOException {
22487      composeBackboneElements(element);
22488      if (element.hasSequenceElement()) {
22489        composePositiveInt("sequence", element.getSequenceElement());
22490      }
22491      if (element.hasDateElement()) {
22492        composeDateTime("date", element.getDateElement());
22493      }
22494      if (element.hasProcedure()) {
22495        composeType("procedure", element.getProcedure());
22496      }  }
22497
22498  protected void composeClaimInsuranceComponent(String name, Claim.InsuranceComponent element) throws IOException {
22499    if (element != null) {
22500      composeElementAttributes(element);
22501      xml.enter(FHIR_NS, name);
22502      composeClaimInsuranceComponentElements(element);
22503      composeElementClose(element);
22504      xml.exit(FHIR_NS, name);
22505    }
22506  }
22507
22508  protected void composeClaimInsuranceComponentElements(Claim.InsuranceComponent element) throws IOException {
22509      composeBackboneElements(element);
22510      if (element.hasSequenceElement()) {
22511        composePositiveInt("sequence", element.getSequenceElement());
22512      }
22513      if (element.hasFocalElement()) {
22514        composeBoolean("focal", element.getFocalElement());
22515      }
22516      if (element.hasCoverage()) {
22517        composeReference("coverage", element.getCoverage());
22518      }
22519      if (element.hasBusinessArrangementElement()) {
22520        composeString("businessArrangement", element.getBusinessArrangementElement());
22521      }
22522      if (element.hasPreAuthRef()) { 
22523        for (StringType e : element.getPreAuthRef()) 
22524          composeString("preAuthRef", e);
22525      }
22526      if (element.hasClaimResponse()) {
22527        composeReference("claimResponse", element.getClaimResponse());
22528      }
22529  }
22530
22531  protected void composeClaimAccidentComponent(String name, Claim.AccidentComponent element) throws IOException {
22532    if (element != null) {
22533      composeElementAttributes(element);
22534      xml.enter(FHIR_NS, name);
22535      composeClaimAccidentComponentElements(element);
22536      composeElementClose(element);
22537      xml.exit(FHIR_NS, name);
22538    }
22539  }
22540
22541  protected void composeClaimAccidentComponentElements(Claim.AccidentComponent element) throws IOException {
22542      composeBackboneElements(element);
22543      if (element.hasDateElement()) {
22544        composeDate("date", element.getDateElement());
22545      }
22546      if (element.hasType()) {
22547        composeCodeableConcept("type", element.getType());
22548      }
22549      if (element.hasLocation()) {
22550        composeType("location", element.getLocation());
22551      }  }
22552
22553  protected void composeClaimItemComponent(String name, Claim.ItemComponent element) throws IOException {
22554    if (element != null) {
22555      composeElementAttributes(element);
22556      xml.enter(FHIR_NS, name);
22557      composeClaimItemComponentElements(element);
22558      composeElementClose(element);
22559      xml.exit(FHIR_NS, name);
22560    }
22561  }
22562
22563  protected void composeClaimItemComponentElements(Claim.ItemComponent element) throws IOException {
22564      composeBackboneElements(element);
22565      if (element.hasSequenceElement()) {
22566        composePositiveInt("sequence", element.getSequenceElement());
22567      }
22568      if (element.hasCareTeamLinkId()) { 
22569        for (PositiveIntType e : element.getCareTeamLinkId()) 
22570          composePositiveInt("careTeamLinkId", e);
22571      }
22572      if (element.hasDiagnosisLinkId()) { 
22573        for (PositiveIntType e : element.getDiagnosisLinkId()) 
22574          composePositiveInt("diagnosisLinkId", e);
22575      }
22576      if (element.hasProcedureLinkId()) { 
22577        for (PositiveIntType e : element.getProcedureLinkId()) 
22578          composePositiveInt("procedureLinkId", e);
22579      }
22580      if (element.hasInformationLinkId()) { 
22581        for (PositiveIntType e : element.getInformationLinkId()) 
22582          composePositiveInt("informationLinkId", e);
22583      }
22584      if (element.hasRevenue()) {
22585        composeCodeableConcept("revenue", element.getRevenue());
22586      }
22587      if (element.hasCategory()) {
22588        composeCodeableConcept("category", element.getCategory());
22589      }
22590      if (element.hasService()) {
22591        composeCodeableConcept("service", element.getService());
22592      }
22593      if (element.hasModifier()) { 
22594        for (CodeableConcept e : element.getModifier()) 
22595          composeCodeableConcept("modifier", e);
22596      }
22597      if (element.hasProgramCode()) { 
22598        for (CodeableConcept e : element.getProgramCode()) 
22599          composeCodeableConcept("programCode", e);
22600      }
22601      if (element.hasServiced()) {
22602        composeType("serviced", element.getServiced());
22603      }      if (element.hasLocation()) {
22604        composeType("location", element.getLocation());
22605      }      if (element.hasQuantity()) {
22606        composeSimpleQuantity("quantity", element.getQuantity());
22607      }
22608      if (element.hasUnitPrice()) {
22609        composeMoney("unitPrice", element.getUnitPrice());
22610      }
22611      if (element.hasFactorElement()) {
22612        composeDecimal("factor", element.getFactorElement());
22613      }
22614      if (element.hasNet()) {
22615        composeMoney("net", element.getNet());
22616      }
22617      if (element.hasUdi()) { 
22618        for (Reference e : element.getUdi()) 
22619          composeReference("udi", e);
22620      }
22621      if (element.hasBodySite()) {
22622        composeCodeableConcept("bodySite", element.getBodySite());
22623      }
22624      if (element.hasSubSite()) { 
22625        for (CodeableConcept e : element.getSubSite()) 
22626          composeCodeableConcept("subSite", e);
22627      }
22628      if (element.hasEncounter()) { 
22629        for (Reference e : element.getEncounter()) 
22630          composeReference("encounter", e);
22631      }
22632      if (element.hasDetail()) { 
22633        for (Claim.DetailComponent e : element.getDetail()) 
22634          composeClaimDetailComponent("detail", e);
22635      }
22636  }
22637
22638  protected void composeClaimDetailComponent(String name, Claim.DetailComponent element) throws IOException {
22639    if (element != null) {
22640      composeElementAttributes(element);
22641      xml.enter(FHIR_NS, name);
22642      composeClaimDetailComponentElements(element);
22643      composeElementClose(element);
22644      xml.exit(FHIR_NS, name);
22645    }
22646  }
22647
22648  protected void composeClaimDetailComponentElements(Claim.DetailComponent element) throws IOException {
22649      composeBackboneElements(element);
22650      if (element.hasSequenceElement()) {
22651        composePositiveInt("sequence", element.getSequenceElement());
22652      }
22653      if (element.hasRevenue()) {
22654        composeCodeableConcept("revenue", element.getRevenue());
22655      }
22656      if (element.hasCategory()) {
22657        composeCodeableConcept("category", element.getCategory());
22658      }
22659      if (element.hasService()) {
22660        composeCodeableConcept("service", element.getService());
22661      }
22662      if (element.hasModifier()) { 
22663        for (CodeableConcept e : element.getModifier()) 
22664          composeCodeableConcept("modifier", e);
22665      }
22666      if (element.hasProgramCode()) { 
22667        for (CodeableConcept e : element.getProgramCode()) 
22668          composeCodeableConcept("programCode", e);
22669      }
22670      if (element.hasQuantity()) {
22671        composeSimpleQuantity("quantity", element.getQuantity());
22672      }
22673      if (element.hasUnitPrice()) {
22674        composeMoney("unitPrice", element.getUnitPrice());
22675      }
22676      if (element.hasFactorElement()) {
22677        composeDecimal("factor", element.getFactorElement());
22678      }
22679      if (element.hasNet()) {
22680        composeMoney("net", element.getNet());
22681      }
22682      if (element.hasUdi()) { 
22683        for (Reference e : element.getUdi()) 
22684          composeReference("udi", e);
22685      }
22686      if (element.hasSubDetail()) { 
22687        for (Claim.SubDetailComponent e : element.getSubDetail()) 
22688          composeClaimSubDetailComponent("subDetail", e);
22689      }
22690  }
22691
22692  protected void composeClaimSubDetailComponent(String name, Claim.SubDetailComponent element) throws IOException {
22693    if (element != null) {
22694      composeElementAttributes(element);
22695      xml.enter(FHIR_NS, name);
22696      composeClaimSubDetailComponentElements(element);
22697      composeElementClose(element);
22698      xml.exit(FHIR_NS, name);
22699    }
22700  }
22701
22702  protected void composeClaimSubDetailComponentElements(Claim.SubDetailComponent element) throws IOException {
22703      composeBackboneElements(element);
22704      if (element.hasSequenceElement()) {
22705        composePositiveInt("sequence", element.getSequenceElement());
22706      }
22707      if (element.hasRevenue()) {
22708        composeCodeableConcept("revenue", element.getRevenue());
22709      }
22710      if (element.hasCategory()) {
22711        composeCodeableConcept("category", element.getCategory());
22712      }
22713      if (element.hasService()) {
22714        composeCodeableConcept("service", element.getService());
22715      }
22716      if (element.hasModifier()) { 
22717        for (CodeableConcept e : element.getModifier()) 
22718          composeCodeableConcept("modifier", e);
22719      }
22720      if (element.hasProgramCode()) { 
22721        for (CodeableConcept e : element.getProgramCode()) 
22722          composeCodeableConcept("programCode", e);
22723      }
22724      if (element.hasQuantity()) {
22725        composeSimpleQuantity("quantity", element.getQuantity());
22726      }
22727      if (element.hasUnitPrice()) {
22728        composeMoney("unitPrice", element.getUnitPrice());
22729      }
22730      if (element.hasFactorElement()) {
22731        composeDecimal("factor", element.getFactorElement());
22732      }
22733      if (element.hasNet()) {
22734        composeMoney("net", element.getNet());
22735      }
22736      if (element.hasUdi()) { 
22737        for (Reference e : element.getUdi()) 
22738          composeReference("udi", e);
22739      }
22740  }
22741
22742  protected void composeClaimResponse(String name, ClaimResponse element) throws IOException {
22743    if (element != null) {
22744      composeDomainResourceAttributes(element);
22745      xml.enter(FHIR_NS, name);
22746      composeClaimResponseElements(element);
22747      composeElementClose(element);
22748      xml.exit(FHIR_NS, name);
22749    }
22750  }
22751
22752  protected void composeClaimResponseElements(ClaimResponse element) throws IOException {
22753      composeDomainResourceElements(element);
22754      if (element.hasIdentifier()) { 
22755        for (Identifier e : element.getIdentifier()) 
22756          composeIdentifier("identifier", e);
22757      }
22758      if (element.hasStatusElement())
22759        composeEnumeration("status", element.getStatusElement(), new ClaimResponse.ClaimResponseStatusEnumFactory());
22760      if (element.hasPatient()) {
22761        composeReference("patient", element.getPatient());
22762      }
22763      if (element.hasCreatedElement()) {
22764        composeDateTime("created", element.getCreatedElement());
22765      }
22766      if (element.hasInsurer()) {
22767        composeReference("insurer", element.getInsurer());
22768      }
22769      if (element.hasRequestProvider()) {
22770        composeReference("requestProvider", element.getRequestProvider());
22771      }
22772      if (element.hasRequestOrganization()) {
22773        composeReference("requestOrganization", element.getRequestOrganization());
22774      }
22775      if (element.hasRequest()) {
22776        composeReference("request", element.getRequest());
22777      }
22778      if (element.hasOutcome()) {
22779        composeCodeableConcept("outcome", element.getOutcome());
22780      }
22781      if (element.hasDispositionElement()) {
22782        composeString("disposition", element.getDispositionElement());
22783      }
22784      if (element.hasPayeeType()) {
22785        composeCodeableConcept("payeeType", element.getPayeeType());
22786      }
22787      if (element.hasItem()) { 
22788        for (ClaimResponse.ItemComponent e : element.getItem()) 
22789          composeClaimResponseItemComponent("item", e);
22790      }
22791      if (element.hasAddItem()) { 
22792        for (ClaimResponse.AddedItemComponent e : element.getAddItem()) 
22793          composeClaimResponseAddedItemComponent("addItem", e);
22794      }
22795      if (element.hasError()) { 
22796        for (ClaimResponse.ErrorComponent e : element.getError()) 
22797          composeClaimResponseErrorComponent("error", e);
22798      }
22799      if (element.hasTotalCost()) {
22800        composeMoney("totalCost", element.getTotalCost());
22801      }
22802      if (element.hasUnallocDeductable()) {
22803        composeMoney("unallocDeductable", element.getUnallocDeductable());
22804      }
22805      if (element.hasTotalBenefit()) {
22806        composeMoney("totalBenefit", element.getTotalBenefit());
22807      }
22808      if (element.hasPayment()) {
22809        composeClaimResponsePaymentComponent("payment", element.getPayment());
22810      }
22811      if (element.hasReserved()) {
22812        composeCoding("reserved", element.getReserved());
22813      }
22814      if (element.hasForm()) {
22815        composeCodeableConcept("form", element.getForm());
22816      }
22817      if (element.hasProcessNote()) { 
22818        for (ClaimResponse.NoteComponent e : element.getProcessNote()) 
22819          composeClaimResponseNoteComponent("processNote", e);
22820      }
22821      if (element.hasCommunicationRequest()) { 
22822        for (Reference e : element.getCommunicationRequest()) 
22823          composeReference("communicationRequest", e);
22824      }
22825      if (element.hasInsurance()) { 
22826        for (ClaimResponse.InsuranceComponent e : element.getInsurance()) 
22827          composeClaimResponseInsuranceComponent("insurance", e);
22828      }
22829  }
22830
22831  protected void composeClaimResponseItemComponent(String name, ClaimResponse.ItemComponent element) throws IOException {
22832    if (element != null) {
22833      composeElementAttributes(element);
22834      xml.enter(FHIR_NS, name);
22835      composeClaimResponseItemComponentElements(element);
22836      composeElementClose(element);
22837      xml.exit(FHIR_NS, name);
22838    }
22839  }
22840
22841  protected void composeClaimResponseItemComponentElements(ClaimResponse.ItemComponent element) throws IOException {
22842      composeBackboneElements(element);
22843      if (element.hasSequenceLinkIdElement()) {
22844        composePositiveInt("sequenceLinkId", element.getSequenceLinkIdElement());
22845      }
22846      if (element.hasNoteNumber()) { 
22847        for (PositiveIntType e : element.getNoteNumber()) 
22848          composePositiveInt("noteNumber", e);
22849      }
22850      if (element.hasAdjudication()) { 
22851        for (ClaimResponse.AdjudicationComponent e : element.getAdjudication()) 
22852          composeClaimResponseAdjudicationComponent("adjudication", e);
22853      }
22854      if (element.hasDetail()) { 
22855        for (ClaimResponse.ItemDetailComponent e : element.getDetail()) 
22856          composeClaimResponseItemDetailComponent("detail", e);
22857      }
22858  }
22859
22860  protected void composeClaimResponseAdjudicationComponent(String name, ClaimResponse.AdjudicationComponent element) throws IOException {
22861    if (element != null) {
22862      composeElementAttributes(element);
22863      xml.enter(FHIR_NS, name);
22864      composeClaimResponseAdjudicationComponentElements(element);
22865      composeElementClose(element);
22866      xml.exit(FHIR_NS, name);
22867    }
22868  }
22869
22870  protected void composeClaimResponseAdjudicationComponentElements(ClaimResponse.AdjudicationComponent element) throws IOException {
22871      composeBackboneElements(element);
22872      if (element.hasCategory()) {
22873        composeCodeableConcept("category", element.getCategory());
22874      }
22875      if (element.hasReason()) {
22876        composeCodeableConcept("reason", element.getReason());
22877      }
22878      if (element.hasAmount()) {
22879        composeMoney("amount", element.getAmount());
22880      }
22881      if (element.hasValueElement()) {
22882        composeDecimal("value", element.getValueElement());
22883      }
22884  }
22885
22886  protected void composeClaimResponseItemDetailComponent(String name, ClaimResponse.ItemDetailComponent element) throws IOException {
22887    if (element != null) {
22888      composeElementAttributes(element);
22889      xml.enter(FHIR_NS, name);
22890      composeClaimResponseItemDetailComponentElements(element);
22891      composeElementClose(element);
22892      xml.exit(FHIR_NS, name);
22893    }
22894  }
22895
22896  protected void composeClaimResponseItemDetailComponentElements(ClaimResponse.ItemDetailComponent element) throws IOException {
22897      composeBackboneElements(element);
22898      if (element.hasSequenceLinkIdElement()) {
22899        composePositiveInt("sequenceLinkId", element.getSequenceLinkIdElement());
22900      }
22901      if (element.hasNoteNumber()) { 
22902        for (PositiveIntType e : element.getNoteNumber()) 
22903          composePositiveInt("noteNumber", e);
22904      }
22905      if (element.hasAdjudication()) { 
22906        for (ClaimResponse.AdjudicationComponent e : element.getAdjudication()) 
22907          composeClaimResponseAdjudicationComponent("adjudication", e);
22908      }
22909      if (element.hasSubDetail()) { 
22910        for (ClaimResponse.SubDetailComponent e : element.getSubDetail()) 
22911          composeClaimResponseSubDetailComponent("subDetail", e);
22912      }
22913  }
22914
22915  protected void composeClaimResponseSubDetailComponent(String name, ClaimResponse.SubDetailComponent element) throws IOException {
22916    if (element != null) {
22917      composeElementAttributes(element);
22918      xml.enter(FHIR_NS, name);
22919      composeClaimResponseSubDetailComponentElements(element);
22920      composeElementClose(element);
22921      xml.exit(FHIR_NS, name);
22922    }
22923  }
22924
22925  protected void composeClaimResponseSubDetailComponentElements(ClaimResponse.SubDetailComponent element) throws IOException {
22926      composeBackboneElements(element);
22927      if (element.hasSequenceLinkIdElement()) {
22928        composePositiveInt("sequenceLinkId", element.getSequenceLinkIdElement());
22929      }
22930      if (element.hasNoteNumber()) { 
22931        for (PositiveIntType e : element.getNoteNumber()) 
22932          composePositiveInt("noteNumber", e);
22933      }
22934      if (element.hasAdjudication()) { 
22935        for (ClaimResponse.AdjudicationComponent e : element.getAdjudication()) 
22936          composeClaimResponseAdjudicationComponent("adjudication", e);
22937      }
22938  }
22939
22940  protected void composeClaimResponseAddedItemComponent(String name, ClaimResponse.AddedItemComponent element) throws IOException {
22941    if (element != null) {
22942      composeElementAttributes(element);
22943      xml.enter(FHIR_NS, name);
22944      composeClaimResponseAddedItemComponentElements(element);
22945      composeElementClose(element);
22946      xml.exit(FHIR_NS, name);
22947    }
22948  }
22949
22950  protected void composeClaimResponseAddedItemComponentElements(ClaimResponse.AddedItemComponent element) throws IOException {
22951      composeBackboneElements(element);
22952      if (element.hasSequenceLinkId()) { 
22953        for (PositiveIntType e : element.getSequenceLinkId()) 
22954          composePositiveInt("sequenceLinkId", e);
22955      }
22956      if (element.hasRevenue()) {
22957        composeCodeableConcept("revenue", element.getRevenue());
22958      }
22959      if (element.hasCategory()) {
22960        composeCodeableConcept("category", element.getCategory());
22961      }
22962      if (element.hasService()) {
22963        composeCodeableConcept("service", element.getService());
22964      }
22965      if (element.hasModifier()) { 
22966        for (CodeableConcept e : element.getModifier()) 
22967          composeCodeableConcept("modifier", e);
22968      }
22969      if (element.hasFee()) {
22970        composeMoney("fee", element.getFee());
22971      }
22972      if (element.hasNoteNumber()) { 
22973        for (PositiveIntType e : element.getNoteNumber()) 
22974          composePositiveInt("noteNumber", e);
22975      }
22976      if (element.hasAdjudication()) { 
22977        for (ClaimResponse.AdjudicationComponent e : element.getAdjudication()) 
22978          composeClaimResponseAdjudicationComponent("adjudication", e);
22979      }
22980      if (element.hasDetail()) { 
22981        for (ClaimResponse.AddedItemsDetailComponent e : element.getDetail()) 
22982          composeClaimResponseAddedItemsDetailComponent("detail", e);
22983      }
22984  }
22985
22986  protected void composeClaimResponseAddedItemsDetailComponent(String name, ClaimResponse.AddedItemsDetailComponent element) throws IOException {
22987    if (element != null) {
22988      composeElementAttributes(element);
22989      xml.enter(FHIR_NS, name);
22990      composeClaimResponseAddedItemsDetailComponentElements(element);
22991      composeElementClose(element);
22992      xml.exit(FHIR_NS, name);
22993    }
22994  }
22995
22996  protected void composeClaimResponseAddedItemsDetailComponentElements(ClaimResponse.AddedItemsDetailComponent element) throws IOException {
22997      composeBackboneElements(element);
22998      if (element.hasRevenue()) {
22999        composeCodeableConcept("revenue", element.getRevenue());
23000      }
23001      if (element.hasCategory()) {
23002        composeCodeableConcept("category", element.getCategory());
23003      }
23004      if (element.hasService()) {
23005        composeCodeableConcept("service", element.getService());
23006      }
23007      if (element.hasModifier()) { 
23008        for (CodeableConcept e : element.getModifier()) 
23009          composeCodeableConcept("modifier", e);
23010      }
23011      if (element.hasFee()) {
23012        composeMoney("fee", element.getFee());
23013      }
23014      if (element.hasNoteNumber()) { 
23015        for (PositiveIntType e : element.getNoteNumber()) 
23016          composePositiveInt("noteNumber", e);
23017      }
23018      if (element.hasAdjudication()) { 
23019        for (ClaimResponse.AdjudicationComponent e : element.getAdjudication()) 
23020          composeClaimResponseAdjudicationComponent("adjudication", e);
23021      }
23022  }
23023
23024  protected void composeClaimResponseErrorComponent(String name, ClaimResponse.ErrorComponent element) throws IOException {
23025    if (element != null) {
23026      composeElementAttributes(element);
23027      xml.enter(FHIR_NS, name);
23028      composeClaimResponseErrorComponentElements(element);
23029      composeElementClose(element);
23030      xml.exit(FHIR_NS, name);
23031    }
23032  }
23033
23034  protected void composeClaimResponseErrorComponentElements(ClaimResponse.ErrorComponent element) throws IOException {
23035      composeBackboneElements(element);
23036      if (element.hasSequenceLinkIdElement()) {
23037        composePositiveInt("sequenceLinkId", element.getSequenceLinkIdElement());
23038      }
23039      if (element.hasDetailSequenceLinkIdElement()) {
23040        composePositiveInt("detailSequenceLinkId", element.getDetailSequenceLinkIdElement());
23041      }
23042      if (element.hasSubdetailSequenceLinkIdElement()) {
23043        composePositiveInt("subdetailSequenceLinkId", element.getSubdetailSequenceLinkIdElement());
23044      }
23045      if (element.hasCode()) {
23046        composeCodeableConcept("code", element.getCode());
23047      }
23048  }
23049
23050  protected void composeClaimResponsePaymentComponent(String name, ClaimResponse.PaymentComponent element) throws IOException {
23051    if (element != null) {
23052      composeElementAttributes(element);
23053      xml.enter(FHIR_NS, name);
23054      composeClaimResponsePaymentComponentElements(element);
23055      composeElementClose(element);
23056      xml.exit(FHIR_NS, name);
23057    }
23058  }
23059
23060  protected void composeClaimResponsePaymentComponentElements(ClaimResponse.PaymentComponent element) throws IOException {
23061      composeBackboneElements(element);
23062      if (element.hasType()) {
23063        composeCodeableConcept("type", element.getType());
23064      }
23065      if (element.hasAdjustment()) {
23066        composeMoney("adjustment", element.getAdjustment());
23067      }
23068      if (element.hasAdjustmentReason()) {
23069        composeCodeableConcept("adjustmentReason", element.getAdjustmentReason());
23070      }
23071      if (element.hasDateElement()) {
23072        composeDate("date", element.getDateElement());
23073      }
23074      if (element.hasAmount()) {
23075        composeMoney("amount", element.getAmount());
23076      }
23077      if (element.hasIdentifier()) {
23078        composeIdentifier("identifier", element.getIdentifier());
23079      }
23080  }
23081
23082  protected void composeClaimResponseNoteComponent(String name, ClaimResponse.NoteComponent element) throws IOException {
23083    if (element != null) {
23084      composeElementAttributes(element);
23085      xml.enter(FHIR_NS, name);
23086      composeClaimResponseNoteComponentElements(element);
23087      composeElementClose(element);
23088      xml.exit(FHIR_NS, name);
23089    }
23090  }
23091
23092  protected void composeClaimResponseNoteComponentElements(ClaimResponse.NoteComponent element) throws IOException {
23093      composeBackboneElements(element);
23094      if (element.hasNumberElement()) {
23095        composePositiveInt("number", element.getNumberElement());
23096      }
23097      if (element.hasType()) {
23098        composeCodeableConcept("type", element.getType());
23099      }
23100      if (element.hasTextElement()) {
23101        composeString("text", element.getTextElement());
23102      }
23103      if (element.hasLanguage()) {
23104        composeCodeableConcept("language", element.getLanguage());
23105      }
23106  }
23107
23108  protected void composeClaimResponseInsuranceComponent(String name, ClaimResponse.InsuranceComponent element) throws IOException {
23109    if (element != null) {
23110      composeElementAttributes(element);
23111      xml.enter(FHIR_NS, name);
23112      composeClaimResponseInsuranceComponentElements(element);
23113      composeElementClose(element);
23114      xml.exit(FHIR_NS, name);
23115    }
23116  }
23117
23118  protected void composeClaimResponseInsuranceComponentElements(ClaimResponse.InsuranceComponent element) throws IOException {
23119      composeBackboneElements(element);
23120      if (element.hasSequenceElement()) {
23121        composePositiveInt("sequence", element.getSequenceElement());
23122      }
23123      if (element.hasFocalElement()) {
23124        composeBoolean("focal", element.getFocalElement());
23125      }
23126      if (element.hasCoverage()) {
23127        composeReference("coverage", element.getCoverage());
23128      }
23129      if (element.hasBusinessArrangementElement()) {
23130        composeString("businessArrangement", element.getBusinessArrangementElement());
23131      }
23132      if (element.hasPreAuthRef()) { 
23133        for (StringType e : element.getPreAuthRef()) 
23134          composeString("preAuthRef", e);
23135      }
23136      if (element.hasClaimResponse()) {
23137        composeReference("claimResponse", element.getClaimResponse());
23138      }
23139  }
23140
23141  protected void composeClinicalImpression(String name, ClinicalImpression element) throws IOException {
23142    if (element != null) {
23143      composeDomainResourceAttributes(element);
23144      xml.enter(FHIR_NS, name);
23145      composeClinicalImpressionElements(element);
23146      composeElementClose(element);
23147      xml.exit(FHIR_NS, name);
23148    }
23149  }
23150
23151  protected void composeClinicalImpressionElements(ClinicalImpression element) throws IOException {
23152      composeDomainResourceElements(element);
23153      if (element.hasIdentifier()) { 
23154        for (Identifier e : element.getIdentifier()) 
23155          composeIdentifier("identifier", e);
23156      }
23157      if (element.hasStatusElement())
23158        composeEnumeration("status", element.getStatusElement(), new ClinicalImpression.ClinicalImpressionStatusEnumFactory());
23159      if (element.hasCode()) {
23160        composeCodeableConcept("code", element.getCode());
23161      }
23162      if (element.hasDescriptionElement()) {
23163        composeString("description", element.getDescriptionElement());
23164      }
23165      if (element.hasSubject()) {
23166        composeReference("subject", element.getSubject());
23167      }
23168      if (element.hasContext()) {
23169        composeReference("context", element.getContext());
23170      }
23171      if (element.hasEffective()) {
23172        composeType("effective", element.getEffective());
23173      }      if (element.hasDateElement()) {
23174        composeDateTime("date", element.getDateElement());
23175      }
23176      if (element.hasAssessor()) {
23177        composeReference("assessor", element.getAssessor());
23178      }
23179      if (element.hasPrevious()) {
23180        composeReference("previous", element.getPrevious());
23181      }
23182      if (element.hasProblem()) { 
23183        for (Reference e : element.getProblem()) 
23184          composeReference("problem", e);
23185      }
23186      if (element.hasInvestigation()) { 
23187        for (ClinicalImpression.ClinicalImpressionInvestigationComponent e : element.getInvestigation()) 
23188          composeClinicalImpressionClinicalImpressionInvestigationComponent("investigation", e);
23189      }
23190      if (element.hasProtocol()) { 
23191        for (UriType e : element.getProtocol()) 
23192          composeUri("protocol", e);
23193      }
23194      if (element.hasSummaryElement()) {
23195        composeString("summary", element.getSummaryElement());
23196      }
23197      if (element.hasFinding()) { 
23198        for (ClinicalImpression.ClinicalImpressionFindingComponent e : element.getFinding()) 
23199          composeClinicalImpressionClinicalImpressionFindingComponent("finding", e);
23200      }
23201      if (element.hasPrognosisCodeableConcept()) { 
23202        for (CodeableConcept e : element.getPrognosisCodeableConcept()) 
23203          composeCodeableConcept("prognosisCodeableConcept", e);
23204      }
23205      if (element.hasPrognosisReference()) { 
23206        for (Reference e : element.getPrognosisReference()) 
23207          composeReference("prognosisReference", e);
23208      }
23209      if (element.hasAction()) { 
23210        for (Reference e : element.getAction()) 
23211          composeReference("action", e);
23212      }
23213      if (element.hasNote()) { 
23214        for (Annotation e : element.getNote()) 
23215          composeAnnotation("note", e);
23216      }
23217  }
23218
23219  protected void composeClinicalImpressionClinicalImpressionInvestigationComponent(String name, ClinicalImpression.ClinicalImpressionInvestigationComponent element) throws IOException {
23220    if (element != null) {
23221      composeElementAttributes(element);
23222      xml.enter(FHIR_NS, name);
23223      composeClinicalImpressionClinicalImpressionInvestigationComponentElements(element);
23224      composeElementClose(element);
23225      xml.exit(FHIR_NS, name);
23226    }
23227  }
23228
23229  protected void composeClinicalImpressionClinicalImpressionInvestigationComponentElements(ClinicalImpression.ClinicalImpressionInvestigationComponent element) throws IOException {
23230      composeBackboneElements(element);
23231      if (element.hasCode()) {
23232        composeCodeableConcept("code", element.getCode());
23233      }
23234      if (element.hasItem()) { 
23235        for (Reference e : element.getItem()) 
23236          composeReference("item", e);
23237      }
23238  }
23239
23240  protected void composeClinicalImpressionClinicalImpressionFindingComponent(String name, ClinicalImpression.ClinicalImpressionFindingComponent element) throws IOException {
23241    if (element != null) {
23242      composeElementAttributes(element);
23243      xml.enter(FHIR_NS, name);
23244      composeClinicalImpressionClinicalImpressionFindingComponentElements(element);
23245      composeElementClose(element);
23246      xml.exit(FHIR_NS, name);
23247    }
23248  }
23249
23250  protected void composeClinicalImpressionClinicalImpressionFindingComponentElements(ClinicalImpression.ClinicalImpressionFindingComponent element) throws IOException {
23251      composeBackboneElements(element);
23252      if (element.hasItem()) {
23253        composeType("item", element.getItem());
23254      }      if (element.hasBasisElement()) {
23255        composeString("basis", element.getBasisElement());
23256      }
23257  }
23258
23259  protected void composeCodeSystem(String name, CodeSystem element) throws IOException {
23260    if (element != null) {
23261      composeDomainResourceAttributes(element);
23262      xml.enter(FHIR_NS, name);
23263      composeCodeSystemElements(element);
23264      composeElementClose(element);
23265      xml.exit(FHIR_NS, name);
23266    }
23267  }
23268
23269  protected void composeCodeSystemElements(CodeSystem element) throws IOException {
23270      composeDomainResourceElements(element);
23271      if (element.hasUrlElement()) {
23272        composeUri("url", element.getUrlElement());
23273      }
23274      if (element.hasIdentifier()) {
23275        composeIdentifier("identifier", element.getIdentifier());
23276      }
23277      if (element.hasVersionElement()) {
23278        composeString("version", element.getVersionElement());
23279      }
23280      if (element.hasNameElement()) {
23281        composeString("name", element.getNameElement());
23282      }
23283      if (element.hasTitleElement()) {
23284        composeString("title", element.getTitleElement());
23285      }
23286      if (element.hasStatusElement())
23287        composeEnumeration("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory());
23288      if (element.hasExperimentalElement()) {
23289        composeBoolean("experimental", element.getExperimentalElement());
23290      }
23291      if (element.hasDateElement()) {
23292        composeDateTime("date", element.getDateElement());
23293      }
23294      if (element.hasPublisherElement()) {
23295        composeString("publisher", element.getPublisherElement());
23296      }
23297      if (element.hasContact()) { 
23298        for (ContactDetail e : element.getContact()) 
23299          composeContactDetail("contact", e);
23300      }
23301      if (element.hasDescriptionElement()) {
23302        composeMarkdown("description", element.getDescriptionElement());
23303      }
23304      if (element.hasUseContext()) { 
23305        for (UsageContext e : element.getUseContext()) 
23306          composeUsageContext("useContext", e);
23307      }
23308      if (element.hasJurisdiction()) { 
23309        for (CodeableConcept e : element.getJurisdiction()) 
23310          composeCodeableConcept("jurisdiction", e);
23311      }
23312      if (element.hasPurposeElement()) {
23313        composeMarkdown("purpose", element.getPurposeElement());
23314      }
23315      if (element.hasCopyrightElement()) {
23316        composeMarkdown("copyright", element.getCopyrightElement());
23317      }
23318      if (element.hasCaseSensitiveElement()) {
23319        composeBoolean("caseSensitive", element.getCaseSensitiveElement());
23320      }
23321      if (element.hasValueSetElement()) {
23322        composeUri("valueSet", element.getValueSetElement());
23323      }
23324      if (element.hasHierarchyMeaningElement())
23325        composeEnumeration("hierarchyMeaning", element.getHierarchyMeaningElement(), new CodeSystem.CodeSystemHierarchyMeaningEnumFactory());
23326      if (element.hasCompositionalElement()) {
23327        composeBoolean("compositional", element.getCompositionalElement());
23328      }
23329      if (element.hasVersionNeededElement()) {
23330        composeBoolean("versionNeeded", element.getVersionNeededElement());
23331      }
23332      if (element.hasContentElement())
23333        composeEnumeration("content", element.getContentElement(), new CodeSystem.CodeSystemContentModeEnumFactory());
23334      if (element.hasCountElement()) {
23335        composeUnsignedInt("count", element.getCountElement());
23336      }
23337      if (element.hasFilter()) { 
23338        for (CodeSystem.CodeSystemFilterComponent e : element.getFilter()) 
23339          composeCodeSystemCodeSystemFilterComponent("filter", e);
23340      }
23341      if (element.hasProperty()) { 
23342        for (CodeSystem.PropertyComponent e : element.getProperty()) 
23343          composeCodeSystemPropertyComponent("property", e);
23344      }
23345      if (element.hasConcept()) { 
23346        for (CodeSystem.ConceptDefinitionComponent e : element.getConcept()) 
23347          composeCodeSystemConceptDefinitionComponent("concept", e);
23348      }
23349  }
23350
23351  protected void composeCodeSystemCodeSystemFilterComponent(String name, CodeSystem.CodeSystemFilterComponent element) throws IOException {
23352    if (element != null) {
23353      composeElementAttributes(element);
23354      xml.enter(FHIR_NS, name);
23355      composeCodeSystemCodeSystemFilterComponentElements(element);
23356      composeElementClose(element);
23357      xml.exit(FHIR_NS, name);
23358    }
23359  }
23360
23361  protected void composeCodeSystemCodeSystemFilterComponentElements(CodeSystem.CodeSystemFilterComponent element) throws IOException {
23362      composeBackboneElements(element);
23363      if (element.hasCodeElement()) {
23364        composeCode("code", element.getCodeElement());
23365      }
23366      if (element.hasDescriptionElement()) {
23367        composeString("description", element.getDescriptionElement());
23368      }
23369        if (element.hasOperator()) 
23370          for (Enumeration<CodeSystem.FilterOperator> e : element.getOperator()) 
23371            composeEnumeration("operator", e, new CodeSystem.FilterOperatorEnumFactory());
23372      if (element.hasValueElement()) {
23373        composeString("value", element.getValueElement());
23374      }
23375  }
23376
23377  protected void composeCodeSystemPropertyComponent(String name, CodeSystem.PropertyComponent element) throws IOException {
23378    if (element != null) {
23379      composeElementAttributes(element);
23380      xml.enter(FHIR_NS, name);
23381      composeCodeSystemPropertyComponentElements(element);
23382      composeElementClose(element);
23383      xml.exit(FHIR_NS, name);
23384    }
23385  }
23386
23387  protected void composeCodeSystemPropertyComponentElements(CodeSystem.PropertyComponent element) throws IOException {
23388      composeBackboneElements(element);
23389      if (element.hasCodeElement()) {
23390        composeCode("code", element.getCodeElement());
23391      }
23392      if (element.hasUriElement()) {
23393        composeUri("uri", element.getUriElement());
23394      }
23395      if (element.hasDescriptionElement()) {
23396        composeString("description", element.getDescriptionElement());
23397      }
23398      if (element.hasTypeElement())
23399        composeEnumeration("type", element.getTypeElement(), new CodeSystem.PropertyTypeEnumFactory());
23400  }
23401
23402  protected void composeCodeSystemConceptDefinitionComponent(String name, CodeSystem.ConceptDefinitionComponent element) throws IOException {
23403    if (element != null) {
23404      composeElementAttributes(element);
23405      xml.enter(FHIR_NS, name);
23406      composeCodeSystemConceptDefinitionComponentElements(element);
23407      composeElementClose(element);
23408      xml.exit(FHIR_NS, name);
23409    }
23410  }
23411
23412  protected void composeCodeSystemConceptDefinitionComponentElements(CodeSystem.ConceptDefinitionComponent element) throws IOException {
23413      composeBackboneElements(element);
23414      if (element.hasCodeElement()) {
23415        composeCode("code", element.getCodeElement());
23416      }
23417      if (element.hasDisplayElement()) {
23418        composeString("display", element.getDisplayElement());
23419      }
23420      if (element.hasDefinitionElement()) {
23421        composeString("definition", element.getDefinitionElement());
23422      }
23423      if (element.hasDesignation()) { 
23424        for (CodeSystem.ConceptDefinitionDesignationComponent e : element.getDesignation()) 
23425          composeCodeSystemConceptDefinitionDesignationComponent("designation", e);
23426      }
23427      if (element.hasProperty()) { 
23428        for (CodeSystem.ConceptPropertyComponent e : element.getProperty()) 
23429          composeCodeSystemConceptPropertyComponent("property", e);
23430      }
23431      if (element.hasConcept()) { 
23432        for (CodeSystem.ConceptDefinitionComponent e : element.getConcept()) 
23433          composeCodeSystemConceptDefinitionComponent("concept", e);
23434      }
23435  }
23436
23437  protected void composeCodeSystemConceptDefinitionDesignationComponent(String name, CodeSystem.ConceptDefinitionDesignationComponent element) throws IOException {
23438    if (element != null) {
23439      composeElementAttributes(element);
23440      xml.enter(FHIR_NS, name);
23441      composeCodeSystemConceptDefinitionDesignationComponentElements(element);
23442      composeElementClose(element);
23443      xml.exit(FHIR_NS, name);
23444    }
23445  }
23446
23447  protected void composeCodeSystemConceptDefinitionDesignationComponentElements(CodeSystem.ConceptDefinitionDesignationComponent element) throws IOException {
23448      composeBackboneElements(element);
23449      if (element.hasLanguageElement()) {
23450        composeCode("language", element.getLanguageElement());
23451      }
23452      if (element.hasUse()) {
23453        composeCoding("use", element.getUse());
23454      }
23455      if (element.hasValueElement()) {
23456        composeString("value", element.getValueElement());
23457      }
23458  }
23459
23460  protected void composeCodeSystemConceptPropertyComponent(String name, CodeSystem.ConceptPropertyComponent element) throws IOException {
23461    if (element != null) {
23462      composeElementAttributes(element);
23463      xml.enter(FHIR_NS, name);
23464      composeCodeSystemConceptPropertyComponentElements(element);
23465      composeElementClose(element);
23466      xml.exit(FHIR_NS, name);
23467    }
23468  }
23469
23470  protected void composeCodeSystemConceptPropertyComponentElements(CodeSystem.ConceptPropertyComponent element) throws IOException {
23471      composeBackboneElements(element);
23472      if (element.hasCodeElement()) {
23473        composeCode("code", element.getCodeElement());
23474      }
23475      if (element.hasValue()) {
23476        composeType("value", element.getValue());
23477      }  }
23478
23479  protected void composeCommunication(String name, Communication element) throws IOException {
23480    if (element != null) {
23481      composeDomainResourceAttributes(element);
23482      xml.enter(FHIR_NS, name);
23483      composeCommunicationElements(element);
23484      composeElementClose(element);
23485      xml.exit(FHIR_NS, name);
23486    }
23487  }
23488
23489  protected void composeCommunicationElements(Communication element) throws IOException {
23490      composeDomainResourceElements(element);
23491      if (element.hasIdentifier()) { 
23492        for (Identifier e : element.getIdentifier()) 
23493          composeIdentifier("identifier", e);
23494      }
23495      if (element.hasDefinition()) { 
23496        for (Reference e : element.getDefinition()) 
23497          composeReference("definition", e);
23498      }
23499      if (element.hasBasedOn()) { 
23500        for (Reference e : element.getBasedOn()) 
23501          composeReference("basedOn", e);
23502      }
23503      if (element.hasPartOf()) { 
23504        for (Reference e : element.getPartOf()) 
23505          composeReference("partOf", e);
23506      }
23507      if (element.hasStatusElement())
23508        composeEnumeration("status", element.getStatusElement(), new Communication.CommunicationStatusEnumFactory());
23509      if (element.hasNotDoneElement()) {
23510        composeBoolean("notDone", element.getNotDoneElement());
23511      }
23512      if (element.hasNotDoneReason()) {
23513        composeCodeableConcept("notDoneReason", element.getNotDoneReason());
23514      }
23515      if (element.hasCategory()) { 
23516        for (CodeableConcept e : element.getCategory()) 
23517          composeCodeableConcept("category", e);
23518      }
23519      if (element.hasMedium()) { 
23520        for (CodeableConcept e : element.getMedium()) 
23521          composeCodeableConcept("medium", e);
23522      }
23523      if (element.hasSubject()) {
23524        composeReference("subject", element.getSubject());
23525      }
23526      if (element.hasRecipient()) { 
23527        for (Reference e : element.getRecipient()) 
23528          composeReference("recipient", e);
23529      }
23530      if (element.hasTopic()) { 
23531        for (Reference e : element.getTopic()) 
23532          composeReference("topic", e);
23533      }
23534      if (element.hasContext()) {
23535        composeReference("context", element.getContext());
23536      }
23537      if (element.hasSentElement()) {
23538        composeDateTime("sent", element.getSentElement());
23539      }
23540      if (element.hasReceivedElement()) {
23541        composeDateTime("received", element.getReceivedElement());
23542      }
23543      if (element.hasSender()) {
23544        composeReference("sender", element.getSender());
23545      }
23546      if (element.hasReasonCode()) { 
23547        for (CodeableConcept e : element.getReasonCode()) 
23548          composeCodeableConcept("reasonCode", e);
23549      }
23550      if (element.hasReasonReference()) { 
23551        for (Reference e : element.getReasonReference()) 
23552          composeReference("reasonReference", e);
23553      }
23554      if (element.hasPayload()) { 
23555        for (Communication.CommunicationPayloadComponent e : element.getPayload()) 
23556          composeCommunicationCommunicationPayloadComponent("payload", e);
23557      }
23558      if (element.hasNote()) { 
23559        for (Annotation e : element.getNote()) 
23560          composeAnnotation("note", e);
23561      }
23562  }
23563
23564  protected void composeCommunicationCommunicationPayloadComponent(String name, Communication.CommunicationPayloadComponent element) throws IOException {
23565    if (element != null) {
23566      composeElementAttributes(element);
23567      xml.enter(FHIR_NS, name);
23568      composeCommunicationCommunicationPayloadComponentElements(element);
23569      composeElementClose(element);
23570      xml.exit(FHIR_NS, name);
23571    }
23572  }
23573
23574  protected void composeCommunicationCommunicationPayloadComponentElements(Communication.CommunicationPayloadComponent element) throws IOException {
23575      composeBackboneElements(element);
23576      if (element.hasContent()) {
23577        composeType("content", element.getContent());
23578      }  }
23579
23580  protected void composeCommunicationRequest(String name, CommunicationRequest element) throws IOException {
23581    if (element != null) {
23582      composeDomainResourceAttributes(element);
23583      xml.enter(FHIR_NS, name);
23584      composeCommunicationRequestElements(element);
23585      composeElementClose(element);
23586      xml.exit(FHIR_NS, name);
23587    }
23588  }
23589
23590  protected void composeCommunicationRequestElements(CommunicationRequest element) throws IOException {
23591      composeDomainResourceElements(element);
23592      if (element.hasIdentifier()) { 
23593        for (Identifier e : element.getIdentifier()) 
23594          composeIdentifier("identifier", e);
23595      }
23596      if (element.hasBasedOn()) { 
23597        for (Reference e : element.getBasedOn()) 
23598          composeReference("basedOn", e);
23599      }
23600      if (element.hasReplaces()) { 
23601        for (Reference e : element.getReplaces()) 
23602          composeReference("replaces", e);
23603      }
23604      if (element.hasGroupIdentifier()) {
23605        composeIdentifier("groupIdentifier", element.getGroupIdentifier());
23606      }
23607      if (element.hasStatusElement())
23608        composeEnumeration("status", element.getStatusElement(), new CommunicationRequest.CommunicationRequestStatusEnumFactory());
23609      if (element.hasCategory()) { 
23610        for (CodeableConcept e : element.getCategory()) 
23611          composeCodeableConcept("category", e);
23612      }
23613      if (element.hasPriorityElement())
23614        composeEnumeration("priority", element.getPriorityElement(), new CommunicationRequest.CommunicationPriorityEnumFactory());
23615      if (element.hasMedium()) { 
23616        for (CodeableConcept e : element.getMedium()) 
23617          composeCodeableConcept("medium", e);
23618      }
23619      if (element.hasSubject()) {
23620        composeReference("subject", element.getSubject());
23621      }
23622      if (element.hasRecipient()) { 
23623        for (Reference e : element.getRecipient()) 
23624          composeReference("recipient", e);
23625      }
23626      if (element.hasTopic()) { 
23627        for (Reference e : element.getTopic()) 
23628          composeReference("topic", e);
23629      }
23630      if (element.hasContext()) {
23631        composeReference("context", element.getContext());
23632      }
23633      if (element.hasPayload()) { 
23634        for (CommunicationRequest.CommunicationRequestPayloadComponent e : element.getPayload()) 
23635          composeCommunicationRequestCommunicationRequestPayloadComponent("payload", e);
23636      }
23637      if (element.hasOccurrence()) {
23638        composeType("occurrence", element.getOccurrence());
23639      }      if (element.hasAuthoredOnElement()) {
23640        composeDateTime("authoredOn", element.getAuthoredOnElement());
23641      }
23642      if (element.hasSender()) {
23643        composeReference("sender", element.getSender());
23644      }
23645      if (element.hasRequester()) {
23646        composeCommunicationRequestCommunicationRequestRequesterComponent("requester", element.getRequester());
23647      }
23648      if (element.hasReasonCode()) { 
23649        for (CodeableConcept e : element.getReasonCode()) 
23650          composeCodeableConcept("reasonCode", e);
23651      }
23652      if (element.hasReasonReference()) { 
23653        for (Reference e : element.getReasonReference()) 
23654          composeReference("reasonReference", e);
23655      }
23656      if (element.hasNote()) { 
23657        for (Annotation e : element.getNote()) 
23658          composeAnnotation("note", e);
23659      }
23660  }
23661
23662  protected void composeCommunicationRequestCommunicationRequestPayloadComponent(String name, CommunicationRequest.CommunicationRequestPayloadComponent element) throws IOException {
23663    if (element != null) {
23664      composeElementAttributes(element);
23665      xml.enter(FHIR_NS, name);
23666      composeCommunicationRequestCommunicationRequestPayloadComponentElements(element);
23667      composeElementClose(element);
23668      xml.exit(FHIR_NS, name);
23669    }
23670  }
23671
23672  protected void composeCommunicationRequestCommunicationRequestPayloadComponentElements(CommunicationRequest.CommunicationRequestPayloadComponent element) throws IOException {
23673      composeBackboneElements(element);
23674      if (element.hasContent()) {
23675        composeType("content", element.getContent());
23676      }  }
23677
23678  protected void composeCommunicationRequestCommunicationRequestRequesterComponent(String name, CommunicationRequest.CommunicationRequestRequesterComponent element) throws IOException {
23679    if (element != null) {
23680      composeElementAttributes(element);
23681      xml.enter(FHIR_NS, name);
23682      composeCommunicationRequestCommunicationRequestRequesterComponentElements(element);
23683      composeElementClose(element);
23684      xml.exit(FHIR_NS, name);
23685    }
23686  }
23687
23688  protected void composeCommunicationRequestCommunicationRequestRequesterComponentElements(CommunicationRequest.CommunicationRequestRequesterComponent element) throws IOException {
23689      composeBackboneElements(element);
23690      if (element.hasAgent()) {
23691        composeReference("agent", element.getAgent());
23692      }
23693      if (element.hasOnBehalfOf()) {
23694        composeReference("onBehalfOf", element.getOnBehalfOf());
23695      }
23696  }
23697
23698  protected void composeCompartmentDefinition(String name, CompartmentDefinition element) throws IOException {
23699    if (element != null) {
23700      composeDomainResourceAttributes(element);
23701      xml.enter(FHIR_NS, name);
23702      composeCompartmentDefinitionElements(element);
23703      composeElementClose(element);
23704      xml.exit(FHIR_NS, name);
23705    }
23706  }
23707
23708  protected void composeCompartmentDefinitionElements(CompartmentDefinition element) throws IOException {
23709      composeDomainResourceElements(element);
23710      if (element.hasUrlElement()) {
23711        composeUri("url", element.getUrlElement());
23712      }
23713      if (element.hasNameElement()) {
23714        composeString("name", element.getNameElement());
23715      }
23716      if (element.hasTitleElement()) {
23717        composeString("title", element.getTitleElement());
23718      }
23719      if (element.hasStatusElement())
23720        composeEnumeration("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory());
23721      if (element.hasExperimentalElement()) {
23722        composeBoolean("experimental", element.getExperimentalElement());
23723      }
23724      if (element.hasDateElement()) {
23725        composeDateTime("date", element.getDateElement());
23726      }
23727      if (element.hasPublisherElement()) {
23728        composeString("publisher", element.getPublisherElement());
23729      }
23730      if (element.hasContact()) { 
23731        for (ContactDetail e : element.getContact()) 
23732          composeContactDetail("contact", e);
23733      }
23734      if (element.hasDescriptionElement()) {
23735        composeMarkdown("description", element.getDescriptionElement());
23736      }
23737      if (element.hasPurposeElement()) {
23738        composeMarkdown("purpose", element.getPurposeElement());
23739      }
23740      if (element.hasUseContext()) { 
23741        for (UsageContext e : element.getUseContext()) 
23742          composeUsageContext("useContext", e);
23743      }
23744      if (element.hasJurisdiction()) { 
23745        for (CodeableConcept e : element.getJurisdiction()) 
23746          composeCodeableConcept("jurisdiction", e);
23747      }
23748      if (element.hasCodeElement())
23749        composeEnumeration("code", element.getCodeElement(), new CompartmentDefinition.CompartmentTypeEnumFactory());
23750      if (element.hasSearchElement()) {
23751        composeBoolean("search", element.getSearchElement());
23752      }
23753      if (element.hasResource()) { 
23754        for (CompartmentDefinition.CompartmentDefinitionResourceComponent e : element.getResource()) 
23755          composeCompartmentDefinitionCompartmentDefinitionResourceComponent("resource", e);
23756      }
23757  }
23758
23759  protected void composeCompartmentDefinitionCompartmentDefinitionResourceComponent(String name, CompartmentDefinition.CompartmentDefinitionResourceComponent element) throws IOException {
23760    if (element != null) {
23761      composeElementAttributes(element);
23762      xml.enter(FHIR_NS, name);
23763      composeCompartmentDefinitionCompartmentDefinitionResourceComponentElements(element);
23764      composeElementClose(element);
23765      xml.exit(FHIR_NS, name);
23766    }
23767  }
23768
23769  protected void composeCompartmentDefinitionCompartmentDefinitionResourceComponentElements(CompartmentDefinition.CompartmentDefinitionResourceComponent element) throws IOException {
23770      composeBackboneElements(element);
23771      if (element.hasCodeElement()) {
23772        composeCode("code", element.getCodeElement());
23773      }
23774      if (element.hasParam()) { 
23775        for (StringType e : element.getParam()) 
23776          composeString("param", e);
23777      }
23778      if (element.hasDocumentationElement()) {
23779        composeString("documentation", element.getDocumentationElement());
23780      }
23781  }
23782
23783  protected void composeComposition(String name, Composition element) throws IOException {
23784    if (element != null) {
23785      composeDomainResourceAttributes(element);
23786      xml.enter(FHIR_NS, name);
23787      composeCompositionElements(element);
23788      composeElementClose(element);
23789      xml.exit(FHIR_NS, name);
23790    }
23791  }
23792
23793  protected void composeCompositionElements(Composition element) throws IOException {
23794      composeDomainResourceElements(element);
23795      if (element.hasIdentifier()) {
23796        composeIdentifier("identifier", element.getIdentifier());
23797      }
23798      if (element.hasStatusElement())
23799        composeEnumeration("status", element.getStatusElement(), new Composition.CompositionStatusEnumFactory());
23800      if (element.hasType()) {
23801        composeCodeableConcept("type", element.getType());
23802      }
23803      if (element.hasClass_()) {
23804        composeCodeableConcept("class", element.getClass_());
23805      }
23806      if (element.hasSubject()) {
23807        composeReference("subject", element.getSubject());
23808      }
23809      if (element.hasEncounter()) {
23810        composeReference("encounter", element.getEncounter());
23811      }
23812      if (element.hasDateElement()) {
23813        composeDateTime("date", element.getDateElement());
23814      }
23815      if (element.hasAuthor()) { 
23816        for (Reference e : element.getAuthor()) 
23817          composeReference("author", e);
23818      }
23819      if (element.hasTitleElement()) {
23820        composeString("title", element.getTitleElement());
23821      }
23822      if (element.hasConfidentialityElement())
23823        composeEnumeration("confidentiality", element.getConfidentialityElement(), new Composition.DocumentConfidentialityEnumFactory());
23824      if (element.hasAttester()) { 
23825        for (Composition.CompositionAttesterComponent e : element.getAttester()) 
23826          composeCompositionCompositionAttesterComponent("attester", e);
23827      }
23828      if (element.hasCustodian()) {
23829        composeReference("custodian", element.getCustodian());
23830      }
23831      if (element.hasRelatesTo()) { 
23832        for (Composition.CompositionRelatesToComponent e : element.getRelatesTo()) 
23833          composeCompositionCompositionRelatesToComponent("relatesTo", e);
23834      }
23835      if (element.hasEvent()) { 
23836        for (Composition.CompositionEventComponent e : element.getEvent()) 
23837          composeCompositionCompositionEventComponent("event", e);
23838      }
23839      if (element.hasSection()) { 
23840        for (Composition.SectionComponent e : element.getSection()) 
23841          composeCompositionSectionComponent("section", e);
23842      }
23843  }
23844
23845  protected void composeCompositionCompositionAttesterComponent(String name, Composition.CompositionAttesterComponent element) throws IOException {
23846    if (element != null) {
23847      composeElementAttributes(element);
23848      xml.enter(FHIR_NS, name);
23849      composeCompositionCompositionAttesterComponentElements(element);
23850      composeElementClose(element);
23851      xml.exit(FHIR_NS, name);
23852    }
23853  }
23854
23855  protected void composeCompositionCompositionAttesterComponentElements(Composition.CompositionAttesterComponent element) throws IOException {
23856      composeBackboneElements(element);
23857        if (element.hasMode()) 
23858          for (Enumeration<Composition.CompositionAttestationMode> e : element.getMode()) 
23859            composeEnumeration("mode", e, new Composition.CompositionAttestationModeEnumFactory());
23860      if (element.hasTimeElement()) {
23861        composeDateTime("time", element.getTimeElement());
23862      }
23863      if (element.hasParty()) {
23864        composeReference("party", element.getParty());
23865      }
23866  }
23867
23868  protected void composeCompositionCompositionRelatesToComponent(String name, Composition.CompositionRelatesToComponent element) throws IOException {
23869    if (element != null) {
23870      composeElementAttributes(element);
23871      xml.enter(FHIR_NS, name);
23872      composeCompositionCompositionRelatesToComponentElements(element);
23873      composeElementClose(element);
23874      xml.exit(FHIR_NS, name);
23875    }
23876  }
23877
23878  protected void composeCompositionCompositionRelatesToComponentElements(Composition.CompositionRelatesToComponent element) throws IOException {
23879      composeBackboneElements(element);
23880      if (element.hasCodeElement())
23881        composeEnumeration("code", element.getCodeElement(), new Composition.DocumentRelationshipTypeEnumFactory());
23882      if (element.hasTarget()) {
23883        composeType("target", element.getTarget());
23884      }  }
23885
23886  protected void composeCompositionCompositionEventComponent(String name, Composition.CompositionEventComponent element) throws IOException {
23887    if (element != null) {
23888      composeElementAttributes(element);
23889      xml.enter(FHIR_NS, name);
23890      composeCompositionCompositionEventComponentElements(element);
23891      composeElementClose(element);
23892      xml.exit(FHIR_NS, name);
23893    }
23894  }
23895
23896  protected void composeCompositionCompositionEventComponentElements(Composition.CompositionEventComponent element) throws IOException {
23897      composeBackboneElements(element);
23898      if (element.hasCode()) { 
23899        for (CodeableConcept e : element.getCode()) 
23900          composeCodeableConcept("code", e);
23901      }
23902      if (element.hasPeriod()) {
23903        composePeriod("period", element.getPeriod());
23904      }
23905      if (element.hasDetail()) { 
23906        for (Reference e : element.getDetail()) 
23907          composeReference("detail", e);
23908      }
23909  }
23910
23911  protected void composeCompositionSectionComponent(String name, Composition.SectionComponent element) throws IOException {
23912    if (element != null) {
23913      composeElementAttributes(element);
23914      xml.enter(FHIR_NS, name);
23915      composeCompositionSectionComponentElements(element);
23916      composeElementClose(element);
23917      xml.exit(FHIR_NS, name);
23918    }
23919  }
23920
23921  protected void composeCompositionSectionComponentElements(Composition.SectionComponent element) throws IOException {
23922      composeBackboneElements(element);
23923      if (element.hasTitleElement()) {
23924        composeString("title", element.getTitleElement());
23925      }
23926      if (element.hasCode()) {
23927        composeCodeableConcept("code", element.getCode());
23928      }
23929      if (element.hasText()) {
23930        composeNarrative("text", element.getText());
23931      }
23932      if (element.hasModeElement())
23933        composeEnumeration("mode", element.getModeElement(), new Composition.SectionModeEnumFactory());
23934      if (element.hasOrderedBy()) {
23935        composeCodeableConcept("orderedBy", element.getOrderedBy());
23936      }
23937      if (element.hasEntry()) { 
23938        for (Reference e : element.getEntry()) 
23939          composeReference("entry", e);
23940      }
23941      if (element.hasEmptyReason()) {
23942        composeCodeableConcept("emptyReason", element.getEmptyReason());
23943      }
23944      if (element.hasSection()) { 
23945        for (Composition.SectionComponent e : element.getSection()) 
23946          composeCompositionSectionComponent("section", e);
23947      }
23948  }
23949
23950  protected void composeConceptMap(String name, ConceptMap element) throws IOException {
23951    if (element != null) {
23952      composeDomainResourceAttributes(element);
23953      xml.enter(FHIR_NS, name);
23954      composeConceptMapElements(element);
23955      composeElementClose(element);
23956      xml.exit(FHIR_NS, name);
23957    }
23958  }
23959
23960  protected void composeConceptMapElements(ConceptMap element) throws IOException {
23961      composeDomainResourceElements(element);
23962      if (element.hasUrlElement()) {
23963        composeUri("url", element.getUrlElement());
23964      }
23965      if (element.hasIdentifier()) {
23966        composeIdentifier("identifier", element.getIdentifier());
23967      }
23968      if (element.hasVersionElement()) {
23969        composeString("version", element.getVersionElement());
23970      }
23971      if (element.hasNameElement()) {
23972        composeString("name", element.getNameElement());
23973      }
23974      if (element.hasTitleElement()) {
23975        composeString("title", element.getTitleElement());
23976      }
23977      if (element.hasStatusElement())
23978        composeEnumeration("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory());
23979      if (element.hasExperimentalElement()) {
23980        composeBoolean("experimental", element.getExperimentalElement());
23981      }
23982      if (element.hasDateElement()) {
23983        composeDateTime("date", element.getDateElement());
23984      }
23985      if (element.hasPublisherElement()) {
23986        composeString("publisher", element.getPublisherElement());
23987      }
23988      if (element.hasContact()) { 
23989        for (ContactDetail e : element.getContact()) 
23990          composeContactDetail("contact", e);
23991      }
23992      if (element.hasDescriptionElement()) {
23993        composeMarkdown("description", element.getDescriptionElement());
23994      }
23995      if (element.hasUseContext()) { 
23996        for (UsageContext e : element.getUseContext()) 
23997          composeUsageContext("useContext", e);
23998      }
23999      if (element.hasJurisdiction()) { 
24000        for (CodeableConcept e : element.getJurisdiction()) 
24001          composeCodeableConcept("jurisdiction", e);
24002      }
24003      if (element.hasPurposeElement()) {
24004        composeMarkdown("purpose", element.getPurposeElement());
24005      }
24006      if (element.hasCopyrightElement()) {
24007        composeMarkdown("copyright", element.getCopyrightElement());
24008      }
24009      if (element.hasSource()) {
24010        composeType("source", element.getSource());
24011      }      if (element.hasTarget()) {
24012        composeType("target", element.getTarget());
24013      }      if (element.hasGroup()) { 
24014        for (ConceptMap.ConceptMapGroupComponent e : element.getGroup()) 
24015          composeConceptMapConceptMapGroupComponent("group", e);
24016      }
24017  }
24018
24019  protected void composeConceptMapConceptMapGroupComponent(String name, ConceptMap.ConceptMapGroupComponent element) throws IOException {
24020    if (element != null) {
24021      composeElementAttributes(element);
24022      xml.enter(FHIR_NS, name);
24023      composeConceptMapConceptMapGroupComponentElements(element);
24024      composeElementClose(element);
24025      xml.exit(FHIR_NS, name);
24026    }
24027  }
24028
24029  protected void composeConceptMapConceptMapGroupComponentElements(ConceptMap.ConceptMapGroupComponent element) throws IOException {
24030      composeBackboneElements(element);
24031      if (element.hasSourceElement()) {
24032        composeUri("source", element.getSourceElement());
24033      }
24034      if (element.hasSourceVersionElement()) {
24035        composeString("sourceVersion", element.getSourceVersionElement());
24036      }
24037      if (element.hasTargetElement()) {
24038        composeUri("target", element.getTargetElement());
24039      }
24040      if (element.hasTargetVersionElement()) {
24041        composeString("targetVersion", element.getTargetVersionElement());
24042      }
24043      if (element.hasElement()) { 
24044        for (ConceptMap.SourceElementComponent e : element.getElement()) 
24045          composeConceptMapSourceElementComponent("element", e);
24046      }
24047      if (element.hasUnmapped()) {
24048        composeConceptMapConceptMapGroupUnmappedComponent("unmapped", element.getUnmapped());
24049      }
24050  }
24051
24052  protected void composeConceptMapSourceElementComponent(String name, ConceptMap.SourceElementComponent element) throws IOException {
24053    if (element != null) {
24054      composeElementAttributes(element);
24055      xml.enter(FHIR_NS, name);
24056      composeConceptMapSourceElementComponentElements(element);
24057      composeElementClose(element);
24058      xml.exit(FHIR_NS, name);
24059    }
24060  }
24061
24062  protected void composeConceptMapSourceElementComponentElements(ConceptMap.SourceElementComponent element) throws IOException {
24063      composeBackboneElements(element);
24064      if (element.hasCodeElement()) {
24065        composeCode("code", element.getCodeElement());
24066      }
24067      if (element.hasDisplayElement()) {
24068        composeString("display", element.getDisplayElement());
24069      }
24070      if (element.hasTarget()) { 
24071        for (ConceptMap.TargetElementComponent e : element.getTarget()) 
24072          composeConceptMapTargetElementComponent("target", e);
24073      }
24074  }
24075
24076  protected void composeConceptMapTargetElementComponent(String name, ConceptMap.TargetElementComponent element) throws IOException {
24077    if (element != null) {
24078      composeElementAttributes(element);
24079      xml.enter(FHIR_NS, name);
24080      composeConceptMapTargetElementComponentElements(element);
24081      composeElementClose(element);
24082      xml.exit(FHIR_NS, name);
24083    }
24084  }
24085
24086  protected void composeConceptMapTargetElementComponentElements(ConceptMap.TargetElementComponent element) throws IOException {
24087      composeBackboneElements(element);
24088      if (element.hasCodeElement()) {
24089        composeCode("code", element.getCodeElement());
24090      }
24091      if (element.hasDisplayElement()) {
24092        composeString("display", element.getDisplayElement());
24093      }
24094      if (element.hasEquivalenceElement())
24095        composeEnumeration("equivalence", element.getEquivalenceElement(), new Enumerations.ConceptMapEquivalenceEnumFactory());
24096      if (element.hasCommentElement()) {
24097        composeString("comment", element.getCommentElement());
24098      }
24099      if (element.hasDependsOn()) { 
24100        for (ConceptMap.OtherElementComponent e : element.getDependsOn()) 
24101          composeConceptMapOtherElementComponent("dependsOn", e);
24102      }
24103      if (element.hasProduct()) { 
24104        for (ConceptMap.OtherElementComponent e : element.getProduct()) 
24105          composeConceptMapOtherElementComponent("product", e);
24106      }
24107  }
24108
24109  protected void composeConceptMapOtherElementComponent(String name, ConceptMap.OtherElementComponent element) throws IOException {
24110    if (element != null) {
24111      composeElementAttributes(element);
24112      xml.enter(FHIR_NS, name);
24113      composeConceptMapOtherElementComponentElements(element);
24114      composeElementClose(element);
24115      xml.exit(FHIR_NS, name);
24116    }
24117  }
24118
24119  protected void composeConceptMapOtherElementComponentElements(ConceptMap.OtherElementComponent element) throws IOException {
24120      composeBackboneElements(element);
24121      if (element.hasPropertyElement()) {
24122        composeUri("property", element.getPropertyElement());
24123      }
24124      if (element.hasSystemElement()) {
24125        composeUri("system", element.getSystemElement());
24126      }
24127      if (element.hasCodeElement()) {
24128        composeString("code", element.getCodeElement());
24129      }
24130      if (element.hasDisplayElement()) {
24131        composeString("display", element.getDisplayElement());
24132      }
24133  }
24134
24135  protected void composeConceptMapConceptMapGroupUnmappedComponent(String name, ConceptMap.ConceptMapGroupUnmappedComponent element) throws IOException {
24136    if (element != null) {
24137      composeElementAttributes(element);
24138      xml.enter(FHIR_NS, name);
24139      composeConceptMapConceptMapGroupUnmappedComponentElements(element);
24140      composeElementClose(element);
24141      xml.exit(FHIR_NS, name);
24142    }
24143  }
24144
24145  protected void composeConceptMapConceptMapGroupUnmappedComponentElements(ConceptMap.ConceptMapGroupUnmappedComponent element) throws IOException {
24146      composeBackboneElements(element);
24147      if (element.hasModeElement())
24148        composeEnumeration("mode", element.getModeElement(), new ConceptMap.ConceptMapGroupUnmappedModeEnumFactory());
24149      if (element.hasCodeElement()) {
24150        composeCode("code", element.getCodeElement());
24151      }
24152      if (element.hasDisplayElement()) {
24153        composeString("display", element.getDisplayElement());
24154      }
24155      if (element.hasUrlElement()) {
24156        composeUri("url", element.getUrlElement());
24157      }
24158  }
24159
24160  protected void composeCondition(String name, Condition element) throws IOException {
24161    if (element != null) {
24162      composeDomainResourceAttributes(element);
24163      xml.enter(FHIR_NS, name);
24164      composeConditionElements(element);
24165      composeElementClose(element);
24166      xml.exit(FHIR_NS, name);
24167    }
24168  }
24169
24170  protected void composeConditionElements(Condition element) throws IOException {
24171      composeDomainResourceElements(element);
24172      if (element.hasIdentifier()) { 
24173        for (Identifier e : element.getIdentifier()) 
24174          composeIdentifier("identifier", e);
24175      }
24176      if (element.hasClinicalStatusElement())
24177        composeEnumeration("clinicalStatus", element.getClinicalStatusElement(), new Condition.ConditionClinicalStatusEnumFactory());
24178      if (element.hasVerificationStatusElement())
24179        composeEnumeration("verificationStatus", element.getVerificationStatusElement(), new Condition.ConditionVerificationStatusEnumFactory());
24180      if (element.hasCategory()) { 
24181        for (CodeableConcept e : element.getCategory()) 
24182          composeCodeableConcept("category", e);
24183      }
24184      if (element.hasSeverity()) {
24185        composeCodeableConcept("severity", element.getSeverity());
24186      }
24187      if (element.hasCode()) {
24188        composeCodeableConcept("code", element.getCode());
24189      }
24190      if (element.hasBodySite()) { 
24191        for (CodeableConcept e : element.getBodySite()) 
24192          composeCodeableConcept("bodySite", e);
24193      }
24194      if (element.hasSubject()) {
24195        composeReference("subject", element.getSubject());
24196      }
24197      if (element.hasContext()) {
24198        composeReference("context", element.getContext());
24199      }
24200      if (element.hasOnset()) {
24201        composeType("onset", element.getOnset());
24202      }      if (element.hasAbatement()) {
24203        composeType("abatement", element.getAbatement());
24204      }      if (element.hasAssertedDateElement()) {
24205        composeDateTime("assertedDate", element.getAssertedDateElement());
24206      }
24207      if (element.hasAsserter()) {
24208        composeReference("asserter", element.getAsserter());
24209      }
24210      if (element.hasStage()) {
24211        composeConditionConditionStageComponent("stage", element.getStage());
24212      }
24213      if (element.hasEvidence()) { 
24214        for (Condition.ConditionEvidenceComponent e : element.getEvidence()) 
24215          composeConditionConditionEvidenceComponent("evidence", e);
24216      }
24217      if (element.hasNote()) { 
24218        for (Annotation e : element.getNote()) 
24219          composeAnnotation("note", e);
24220      }
24221  }
24222
24223  protected void composeConditionConditionStageComponent(String name, Condition.ConditionStageComponent element) throws IOException {
24224    if (element != null) {
24225      composeElementAttributes(element);
24226      xml.enter(FHIR_NS, name);
24227      composeConditionConditionStageComponentElements(element);
24228      composeElementClose(element);
24229      xml.exit(FHIR_NS, name);
24230    }
24231  }
24232
24233  protected void composeConditionConditionStageComponentElements(Condition.ConditionStageComponent element) throws IOException {
24234      composeBackboneElements(element);
24235      if (element.hasSummary()) {
24236        composeCodeableConcept("summary", element.getSummary());
24237      }
24238      if (element.hasAssessment()) { 
24239        for (Reference e : element.getAssessment()) 
24240          composeReference("assessment", e);
24241      }
24242  }
24243
24244  protected void composeConditionConditionEvidenceComponent(String name, Condition.ConditionEvidenceComponent element) throws IOException {
24245    if (element != null) {
24246      composeElementAttributes(element);
24247      xml.enter(FHIR_NS, name);
24248      composeConditionConditionEvidenceComponentElements(element);
24249      composeElementClose(element);
24250      xml.exit(FHIR_NS, name);
24251    }
24252  }
24253
24254  protected void composeConditionConditionEvidenceComponentElements(Condition.ConditionEvidenceComponent element) throws IOException {
24255      composeBackboneElements(element);
24256      if (element.hasCode()) { 
24257        for (CodeableConcept e : element.getCode()) 
24258          composeCodeableConcept("code", e);
24259      }
24260      if (element.hasDetail()) { 
24261        for (Reference e : element.getDetail()) 
24262          composeReference("detail", e);
24263      }
24264  }
24265
24266  protected void composeConsent(String name, Consent element) throws IOException {
24267    if (element != null) {
24268      composeDomainResourceAttributes(element);
24269      xml.enter(FHIR_NS, name);
24270      composeConsentElements(element);
24271      composeElementClose(element);
24272      xml.exit(FHIR_NS, name);
24273    }
24274  }
24275
24276  protected void composeConsentElements(Consent element) throws IOException {
24277      composeDomainResourceElements(element);
24278      if (element.hasIdentifier()) {
24279        composeIdentifier("identifier", element.getIdentifier());
24280      }
24281      if (element.hasStatusElement())
24282        composeEnumeration("status", element.getStatusElement(), new Consent.ConsentStateEnumFactory());
24283      if (element.hasCategory()) { 
24284        for (CodeableConcept e : element.getCategory()) 
24285          composeCodeableConcept("category", e);
24286      }
24287      if (element.hasPatient()) {
24288        composeReference("patient", element.getPatient());
24289      }
24290      if (element.hasPeriod()) {
24291        composePeriod("period", element.getPeriod());
24292      }
24293      if (element.hasDateTimeElement()) {
24294        composeDateTime("dateTime", element.getDateTimeElement());
24295      }
24296      if (element.hasConsentingParty()) { 
24297        for (Reference e : element.getConsentingParty()) 
24298          composeReference("consentingParty", e);
24299      }
24300      if (element.hasActor()) { 
24301        for (Consent.ConsentActorComponent e : element.getActor()) 
24302          composeConsentConsentActorComponent("actor", e);
24303      }
24304      if (element.hasAction()) { 
24305        for (CodeableConcept e : element.getAction()) 
24306          composeCodeableConcept("action", e);
24307      }
24308      if (element.hasOrganization()) { 
24309        for (Reference e : element.getOrganization()) 
24310          composeReference("organization", e);
24311      }
24312      if (element.hasSource()) {
24313        composeType("source", element.getSource());
24314      }      if (element.hasPolicy()) { 
24315        for (Consent.ConsentPolicyComponent e : element.getPolicy()) 
24316          composeConsentConsentPolicyComponent("policy", e);
24317      }
24318      if (element.hasPolicyRuleElement()) {
24319        composeUri("policyRule", element.getPolicyRuleElement());
24320      }
24321      if (element.hasSecurityLabel()) { 
24322        for (Coding e : element.getSecurityLabel()) 
24323          composeCoding("securityLabel", e);
24324      }
24325      if (element.hasPurpose()) { 
24326        for (Coding e : element.getPurpose()) 
24327          composeCoding("purpose", e);
24328      }
24329      if (element.hasDataPeriod()) {
24330        composePeriod("dataPeriod", element.getDataPeriod());
24331      }
24332      if (element.hasData()) { 
24333        for (Consent.ConsentDataComponent e : element.getData()) 
24334          composeConsentConsentDataComponent("data", e);
24335      }
24336      if (element.hasExcept()) { 
24337        for (Consent.ExceptComponent e : element.getExcept()) 
24338          composeConsentExceptComponent("except", e);
24339      }
24340  }
24341
24342  protected void composeConsentConsentActorComponent(String name, Consent.ConsentActorComponent element) throws IOException {
24343    if (element != null) {
24344      composeElementAttributes(element);
24345      xml.enter(FHIR_NS, name);
24346      composeConsentConsentActorComponentElements(element);
24347      composeElementClose(element);
24348      xml.exit(FHIR_NS, name);
24349    }
24350  }
24351
24352  protected void composeConsentConsentActorComponentElements(Consent.ConsentActorComponent element) throws IOException {
24353      composeBackboneElements(element);
24354      if (element.hasRole()) {
24355        composeCodeableConcept("role", element.getRole());
24356      }
24357      if (element.hasReference()) {
24358        composeReference("reference", element.getReference());
24359      }
24360  }
24361
24362  protected void composeConsentConsentPolicyComponent(String name, Consent.ConsentPolicyComponent element) throws IOException {
24363    if (element != null) {
24364      composeElementAttributes(element);
24365      xml.enter(FHIR_NS, name);
24366      composeConsentConsentPolicyComponentElements(element);
24367      composeElementClose(element);
24368      xml.exit(FHIR_NS, name);
24369    }
24370  }
24371
24372  protected void composeConsentConsentPolicyComponentElements(Consent.ConsentPolicyComponent element) throws IOException {
24373      composeBackboneElements(element);
24374      if (element.hasAuthorityElement()) {
24375        composeUri("authority", element.getAuthorityElement());
24376      }
24377      if (element.hasUriElement()) {
24378        composeUri("uri", element.getUriElement());
24379      }
24380  }
24381
24382  protected void composeConsentConsentDataComponent(String name, Consent.ConsentDataComponent element) throws IOException {
24383    if (element != null) {
24384      composeElementAttributes(element);
24385      xml.enter(FHIR_NS, name);
24386      composeConsentConsentDataComponentElements(element);
24387      composeElementClose(element);
24388      xml.exit(FHIR_NS, name);
24389    }
24390  }
24391
24392  protected void composeConsentConsentDataComponentElements(Consent.ConsentDataComponent element) throws IOException {
24393      composeBackboneElements(element);
24394      if (element.hasMeaningElement())
24395        composeEnumeration("meaning", element.getMeaningElement(), new Consent.ConsentDataMeaningEnumFactory());
24396      if (element.hasReference()) {
24397        composeReference("reference", element.getReference());
24398      }
24399  }
24400
24401  protected void composeConsentExceptComponent(String name, Consent.ExceptComponent element) throws IOException {
24402    if (element != null) {
24403      composeElementAttributes(element);
24404      xml.enter(FHIR_NS, name);
24405      composeConsentExceptComponentElements(element);
24406      composeElementClose(element);
24407      xml.exit(FHIR_NS, name);
24408    }
24409  }
24410
24411  protected void composeConsentExceptComponentElements(Consent.ExceptComponent element) throws IOException {
24412      composeBackboneElements(element);
24413      if (element.hasTypeElement())
24414        composeEnumeration("type", element.getTypeElement(), new Consent.ConsentExceptTypeEnumFactory());
24415      if (element.hasPeriod()) {
24416        composePeriod("period", element.getPeriod());
24417      }
24418      if (element.hasActor()) { 
24419        for (Consent.ExceptActorComponent e : element.getActor()) 
24420          composeConsentExceptActorComponent("actor", e);
24421      }
24422      if (element.hasAction()) { 
24423        for (CodeableConcept e : element.getAction()) 
24424          composeCodeableConcept("action", e);
24425      }
24426      if (element.hasSecurityLabel()) { 
24427        for (Coding e : element.getSecurityLabel()) 
24428          composeCoding("securityLabel", e);
24429      }
24430      if (element.hasPurpose()) { 
24431        for (Coding e : element.getPurpose()) 
24432          composeCoding("purpose", e);
24433      }
24434      if (element.hasClass_()) { 
24435        for (Coding e : element.getClass_()) 
24436          composeCoding("class", e);
24437      }
24438      if (element.hasCode()) { 
24439        for (Coding e : element.getCode()) 
24440          composeCoding("code", e);
24441      }
24442      if (element.hasDataPeriod()) {
24443        composePeriod("dataPeriod", element.getDataPeriod());
24444      }
24445      if (element.hasData()) { 
24446        for (Consent.ExceptDataComponent e : element.getData()) 
24447          composeConsentExceptDataComponent("data", e);
24448      }
24449  }
24450
24451  protected void composeConsentExceptActorComponent(String name, Consent.ExceptActorComponent element) throws IOException {
24452    if (element != null) {
24453      composeElementAttributes(element);
24454      xml.enter(FHIR_NS, name);
24455      composeConsentExceptActorComponentElements(element);
24456      composeElementClose(element);
24457      xml.exit(FHIR_NS, name);
24458    }
24459  }
24460
24461  protected void composeConsentExceptActorComponentElements(Consent.ExceptActorComponent element) throws IOException {
24462      composeBackboneElements(element);
24463      if (element.hasRole()) {
24464        composeCodeableConcept("role", element.getRole());
24465      }
24466      if (element.hasReference()) {
24467        composeReference("reference", element.getReference());
24468      }
24469  }
24470
24471  protected void composeConsentExceptDataComponent(String name, Consent.ExceptDataComponent element) throws IOException {
24472    if (element != null) {
24473      composeElementAttributes(element);
24474      xml.enter(FHIR_NS, name);
24475      composeConsentExceptDataComponentElements(element);
24476      composeElementClose(element);
24477      xml.exit(FHIR_NS, name);
24478    }
24479  }
24480
24481  protected void composeConsentExceptDataComponentElements(Consent.ExceptDataComponent element) throws IOException {
24482      composeBackboneElements(element);
24483      if (element.hasMeaningElement())
24484        composeEnumeration("meaning", element.getMeaningElement(), new Consent.ConsentDataMeaningEnumFactory());
24485      if (element.hasReference()) {
24486        composeReference("reference", element.getReference());
24487      }
24488  }
24489
24490  protected void composeContract(String name, Contract element) throws IOException {
24491    if (element != null) {
24492      composeDomainResourceAttributes(element);
24493      xml.enter(FHIR_NS, name);
24494      composeContractElements(element);
24495      composeElementClose(element);
24496      xml.exit(FHIR_NS, name);
24497    }
24498  }
24499
24500  protected void composeContractElements(Contract element) throws IOException {
24501      composeDomainResourceElements(element);
24502      if (element.hasIdentifier()) {
24503        composeIdentifier("identifier", element.getIdentifier());
24504      }
24505      if (element.hasStatusElement())
24506        composeEnumeration("status", element.getStatusElement(), new Contract.ContractStatusEnumFactory());
24507      if (element.hasIssuedElement()) {
24508        composeDateTime("issued", element.getIssuedElement());
24509      }
24510      if (element.hasApplies()) {
24511        composePeriod("applies", element.getApplies());
24512      }
24513      if (element.hasSubject()) { 
24514        for (Reference e : element.getSubject()) 
24515          composeReference("subject", e);
24516      }
24517      if (element.hasTopic()) { 
24518        for (Reference e : element.getTopic()) 
24519          composeReference("topic", e);
24520      }
24521      if (element.hasAuthority()) { 
24522        for (Reference e : element.getAuthority()) 
24523          composeReference("authority", e);
24524      }
24525      if (element.hasDomain()) { 
24526        for (Reference e : element.getDomain()) 
24527          composeReference("domain", e);
24528      }
24529      if (element.hasType()) {
24530        composeCodeableConcept("type", element.getType());
24531      }
24532      if (element.hasSubType()) { 
24533        for (CodeableConcept e : element.getSubType()) 
24534          composeCodeableConcept("subType", e);
24535      }
24536      if (element.hasAction()) { 
24537        for (CodeableConcept e : element.getAction()) 
24538          composeCodeableConcept("action", e);
24539      }
24540      if (element.hasActionReason()) { 
24541        for (CodeableConcept e : element.getActionReason()) 
24542          composeCodeableConcept("actionReason", e);
24543      }
24544      if (element.hasDecisionType()) {
24545        composeCodeableConcept("decisionType", element.getDecisionType());
24546      }
24547      if (element.hasContentDerivative()) {
24548        composeCodeableConcept("contentDerivative", element.getContentDerivative());
24549      }
24550      if (element.hasSecurityLabel()) { 
24551        for (Coding e : element.getSecurityLabel()) 
24552          composeCoding("securityLabel", e);
24553      }
24554      if (element.hasAgent()) { 
24555        for (Contract.AgentComponent e : element.getAgent()) 
24556          composeContractAgentComponent("agent", e);
24557      }
24558      if (element.hasSigner()) { 
24559        for (Contract.SignatoryComponent e : element.getSigner()) 
24560          composeContractSignatoryComponent("signer", e);
24561      }
24562      if (element.hasValuedItem()) { 
24563        for (Contract.ValuedItemComponent e : element.getValuedItem()) 
24564          composeContractValuedItemComponent("valuedItem", e);
24565      }
24566      if (element.hasTerm()) { 
24567        for (Contract.TermComponent e : element.getTerm()) 
24568          composeContractTermComponent("term", e);
24569      }
24570      if (element.hasBinding()) {
24571        composeType("binding", element.getBinding());
24572      }      if (element.hasFriendly()) { 
24573        for (Contract.FriendlyLanguageComponent e : element.getFriendly()) 
24574          composeContractFriendlyLanguageComponent("friendly", e);
24575      }
24576      if (element.hasLegal()) { 
24577        for (Contract.LegalLanguageComponent e : element.getLegal()) 
24578          composeContractLegalLanguageComponent("legal", e);
24579      }
24580      if (element.hasRule()) { 
24581        for (Contract.ComputableLanguageComponent e : element.getRule()) 
24582          composeContractComputableLanguageComponent("rule", e);
24583      }
24584  }
24585
24586  protected void composeContractAgentComponent(String name, Contract.AgentComponent element) throws IOException {
24587    if (element != null) {
24588      composeElementAttributes(element);
24589      xml.enter(FHIR_NS, name);
24590      composeContractAgentComponentElements(element);
24591      composeElementClose(element);
24592      xml.exit(FHIR_NS, name);
24593    }
24594  }
24595
24596  protected void composeContractAgentComponentElements(Contract.AgentComponent element) throws IOException {
24597      composeBackboneElements(element);
24598      if (element.hasActor()) {
24599        composeReference("actor", element.getActor());
24600      }
24601      if (element.hasRole()) { 
24602        for (CodeableConcept e : element.getRole()) 
24603          composeCodeableConcept("role", e);
24604      }
24605  }
24606
24607  protected void composeContractSignatoryComponent(String name, Contract.SignatoryComponent element) throws IOException {
24608    if (element != null) {
24609      composeElementAttributes(element);
24610      xml.enter(FHIR_NS, name);
24611      composeContractSignatoryComponentElements(element);
24612      composeElementClose(element);
24613      xml.exit(FHIR_NS, name);
24614    }
24615  }
24616
24617  protected void composeContractSignatoryComponentElements(Contract.SignatoryComponent element) throws IOException {
24618      composeBackboneElements(element);
24619      if (element.hasType()) {
24620        composeCoding("type", element.getType());
24621      }
24622      if (element.hasParty()) {
24623        composeReference("party", element.getParty());
24624      }
24625      if (element.hasSignature()) { 
24626        for (Signature e : element.getSignature()) 
24627          composeSignature("signature", e);
24628      }
24629  }
24630
24631  protected void composeContractValuedItemComponent(String name, Contract.ValuedItemComponent element) throws IOException {
24632    if (element != null) {
24633      composeElementAttributes(element);
24634      xml.enter(FHIR_NS, name);
24635      composeContractValuedItemComponentElements(element);
24636      composeElementClose(element);
24637      xml.exit(FHIR_NS, name);
24638    }
24639  }
24640
24641  protected void composeContractValuedItemComponentElements(Contract.ValuedItemComponent element) throws IOException {
24642      composeBackboneElements(element);
24643      if (element.hasEntity()) {
24644        composeType("entity", element.getEntity());
24645      }      if (element.hasIdentifier()) {
24646        composeIdentifier("identifier", element.getIdentifier());
24647      }
24648      if (element.hasEffectiveTimeElement()) {
24649        composeDateTime("effectiveTime", element.getEffectiveTimeElement());
24650      }
24651      if (element.hasQuantity()) {
24652        composeSimpleQuantity("quantity", element.getQuantity());
24653      }
24654      if (element.hasUnitPrice()) {
24655        composeMoney("unitPrice", element.getUnitPrice());
24656      }
24657      if (element.hasFactorElement()) {
24658        composeDecimal("factor", element.getFactorElement());
24659      }
24660      if (element.hasPointsElement()) {
24661        composeDecimal("points", element.getPointsElement());
24662      }
24663      if (element.hasNet()) {
24664        composeMoney("net", element.getNet());
24665      }
24666  }
24667
24668  protected void composeContractTermComponent(String name, Contract.TermComponent element) throws IOException {
24669    if (element != null) {
24670      composeElementAttributes(element);
24671      xml.enter(FHIR_NS, name);
24672      composeContractTermComponentElements(element);
24673      composeElementClose(element);
24674      xml.exit(FHIR_NS, name);
24675    }
24676  }
24677
24678  protected void composeContractTermComponentElements(Contract.TermComponent element) throws IOException {
24679      composeBackboneElements(element);
24680      if (element.hasIdentifier()) {
24681        composeIdentifier("identifier", element.getIdentifier());
24682      }
24683      if (element.hasIssuedElement()) {
24684        composeDateTime("issued", element.getIssuedElement());
24685      }
24686      if (element.hasApplies()) {
24687        composePeriod("applies", element.getApplies());
24688      }
24689      if (element.hasType()) {
24690        composeCodeableConcept("type", element.getType());
24691      }
24692      if (element.hasSubType()) {
24693        composeCodeableConcept("subType", element.getSubType());
24694      }
24695      if (element.hasTopic()) { 
24696        for (Reference e : element.getTopic()) 
24697          composeReference("topic", e);
24698      }
24699      if (element.hasAction()) { 
24700        for (CodeableConcept e : element.getAction()) 
24701          composeCodeableConcept("action", e);
24702      }
24703      if (element.hasActionReason()) { 
24704        for (CodeableConcept e : element.getActionReason()) 
24705          composeCodeableConcept("actionReason", e);
24706      }
24707      if (element.hasSecurityLabel()) { 
24708        for (Coding e : element.getSecurityLabel()) 
24709          composeCoding("securityLabel", e);
24710      }
24711      if (element.hasAgent()) { 
24712        for (Contract.TermAgentComponent e : element.getAgent()) 
24713          composeContractTermAgentComponent("agent", e);
24714      }
24715      if (element.hasTextElement()) {
24716        composeString("text", element.getTextElement());
24717      }
24718      if (element.hasValuedItem()) { 
24719        for (Contract.TermValuedItemComponent e : element.getValuedItem()) 
24720          composeContractTermValuedItemComponent("valuedItem", e);
24721      }
24722      if (element.hasGroup()) { 
24723        for (Contract.TermComponent e : element.getGroup()) 
24724          composeContractTermComponent("group", e);
24725      }
24726  }
24727
24728  protected void composeContractTermAgentComponent(String name, Contract.TermAgentComponent element) throws IOException {
24729    if (element != null) {
24730      composeElementAttributes(element);
24731      xml.enter(FHIR_NS, name);
24732      composeContractTermAgentComponentElements(element);
24733      composeElementClose(element);
24734      xml.exit(FHIR_NS, name);
24735    }
24736  }
24737
24738  protected void composeContractTermAgentComponentElements(Contract.TermAgentComponent element) throws IOException {
24739      composeBackboneElements(element);
24740      if (element.hasActor()) {
24741        composeReference("actor", element.getActor());
24742      }
24743      if (element.hasRole()) { 
24744        for (CodeableConcept e : element.getRole()) 
24745          composeCodeableConcept("role", e);
24746      }
24747  }
24748
24749  protected void composeContractTermValuedItemComponent(String name, Contract.TermValuedItemComponent element) throws IOException {
24750    if (element != null) {
24751      composeElementAttributes(element);
24752      xml.enter(FHIR_NS, name);
24753      composeContractTermValuedItemComponentElements(element);
24754      composeElementClose(element);
24755      xml.exit(FHIR_NS, name);
24756    }
24757  }
24758
24759  protected void composeContractTermValuedItemComponentElements(Contract.TermValuedItemComponent element) throws IOException {
24760      composeBackboneElements(element);
24761      if (element.hasEntity()) {
24762        composeType("entity", element.getEntity());
24763      }      if (element.hasIdentifier()) {
24764        composeIdentifier("identifier", element.getIdentifier());
24765      }
24766      if (element.hasEffectiveTimeElement()) {
24767        composeDateTime("effectiveTime", element.getEffectiveTimeElement());
24768      }
24769      if (element.hasQuantity()) {
24770        composeSimpleQuantity("quantity", element.getQuantity());
24771      }
24772      if (element.hasUnitPrice()) {
24773        composeMoney("unitPrice", element.getUnitPrice());
24774      }
24775      if (element.hasFactorElement()) {
24776        composeDecimal("factor", element.getFactorElement());
24777      }
24778      if (element.hasPointsElement()) {
24779        composeDecimal("points", element.getPointsElement());
24780      }
24781      if (element.hasNet()) {
24782        composeMoney("net", element.getNet());
24783      }
24784  }
24785
24786  protected void composeContractFriendlyLanguageComponent(String name, Contract.FriendlyLanguageComponent element) throws IOException {
24787    if (element != null) {
24788      composeElementAttributes(element);
24789      xml.enter(FHIR_NS, name);
24790      composeContractFriendlyLanguageComponentElements(element);
24791      composeElementClose(element);
24792      xml.exit(FHIR_NS, name);
24793    }
24794  }
24795
24796  protected void composeContractFriendlyLanguageComponentElements(Contract.FriendlyLanguageComponent element) throws IOException {
24797      composeBackboneElements(element);
24798      if (element.hasContent()) {
24799        composeType("content", element.getContent());
24800      }  }
24801
24802  protected void composeContractLegalLanguageComponent(String name, Contract.LegalLanguageComponent element) throws IOException {
24803    if (element != null) {
24804      composeElementAttributes(element);
24805      xml.enter(FHIR_NS, name);
24806      composeContractLegalLanguageComponentElements(element);
24807      composeElementClose(element);
24808      xml.exit(FHIR_NS, name);
24809    }
24810  }
24811
24812  protected void composeContractLegalLanguageComponentElements(Contract.LegalLanguageComponent element) throws IOException {
24813      composeBackboneElements(element);
24814      if (element.hasContent()) {
24815        composeType("content", element.getContent());
24816      }  }
24817
24818  protected void composeContractComputableLanguageComponent(String name, Contract.ComputableLanguageComponent element) throws IOException {
24819    if (element != null) {
24820      composeElementAttributes(element);
24821      xml.enter(FHIR_NS, name);
24822      composeContractComputableLanguageComponentElements(element);
24823      composeElementClose(element);
24824      xml.exit(FHIR_NS, name);
24825    }
24826  }
24827
24828  protected void composeContractComputableLanguageComponentElements(Contract.ComputableLanguageComponent element) throws IOException {
24829      composeBackboneElements(element);
24830      if (element.hasContent()) {
24831        composeType("content", element.getContent());
24832      }  }
24833
24834  protected void composeCoverage(String name, Coverage element) throws IOException {
24835    if (element != null) {
24836      composeDomainResourceAttributes(element);
24837      xml.enter(FHIR_NS, name);
24838      composeCoverageElements(element);
24839      composeElementClose(element);
24840      xml.exit(FHIR_NS, name);
24841    }
24842  }
24843
24844  protected void composeCoverageElements(Coverage element) throws IOException {
24845      composeDomainResourceElements(element);
24846      if (element.hasIdentifier()) { 
24847        for (Identifier e : element.getIdentifier()) 
24848          composeIdentifier("identifier", e);
24849      }
24850      if (element.hasStatusElement())
24851        composeEnumeration("status", element.getStatusElement(), new Coverage.CoverageStatusEnumFactory());
24852      if (element.hasType()) {
24853        composeCodeableConcept("type", element.getType());
24854      }
24855      if (element.hasPolicyHolder()) {
24856        composeReference("policyHolder", element.getPolicyHolder());
24857      }
24858      if (element.hasSubscriber()) {
24859        composeReference("subscriber", element.getSubscriber());
24860      }
24861      if (element.hasSubscriberIdElement()) {
24862        composeString("subscriberId", element.getSubscriberIdElement());
24863      }
24864      if (element.hasBeneficiary()) {
24865        composeReference("beneficiary", element.getBeneficiary());
24866      }
24867      if (element.hasRelationship()) {
24868        composeCodeableConcept("relationship", element.getRelationship());
24869      }
24870      if (element.hasPeriod()) {
24871        composePeriod("period", element.getPeriod());
24872      }
24873      if (element.hasPayor()) { 
24874        for (Reference e : element.getPayor()) 
24875          composeReference("payor", e);
24876      }
24877      if (element.hasGrouping()) {
24878        composeCoverageGroupComponent("grouping", element.getGrouping());
24879      }
24880      if (element.hasDependentElement()) {
24881        composeString("dependent", element.getDependentElement());
24882      }
24883      if (element.hasSequenceElement()) {
24884        composeString("sequence", element.getSequenceElement());
24885      }
24886      if (element.hasOrderElement()) {
24887        composePositiveInt("order", element.getOrderElement());
24888      }
24889      if (element.hasNetworkElement()) {
24890        composeString("network", element.getNetworkElement());
24891      }
24892      if (element.hasContract()) { 
24893        for (Reference e : element.getContract()) 
24894          composeReference("contract", e);
24895      }
24896  }
24897
24898  protected void composeCoverageGroupComponent(String name, Coverage.GroupComponent element) throws IOException {
24899    if (element != null) {
24900      composeElementAttributes(element);
24901      xml.enter(FHIR_NS, name);
24902      composeCoverageGroupComponentElements(element);
24903      composeElementClose(element);
24904      xml.exit(FHIR_NS, name);
24905    }
24906  }
24907
24908  protected void composeCoverageGroupComponentElements(Coverage.GroupComponent element) throws IOException {
24909      composeBackboneElements(element);
24910      if (element.hasGroupElement()) {
24911        composeString("group", element.getGroupElement());
24912      }
24913      if (element.hasGroupDisplayElement()) {
24914        composeString("groupDisplay", element.getGroupDisplayElement());
24915      }
24916      if (element.hasSubGroupElement()) {
24917        composeString("subGroup", element.getSubGroupElement());
24918      }
24919      if (element.hasSubGroupDisplayElement()) {
24920        composeString("subGroupDisplay", element.getSubGroupDisplayElement());
24921      }
24922      if (element.hasPlanElement()) {
24923        composeString("plan", element.getPlanElement());
24924      }
24925      if (element.hasPlanDisplayElement()) {
24926        composeString("planDisplay", element.getPlanDisplayElement());
24927      }
24928      if (element.hasSubPlanElement()) {
24929        composeString("subPlan", element.getSubPlanElement());
24930      }
24931      if (element.hasSubPlanDisplayElement()) {
24932        composeString("subPlanDisplay", element.getSubPlanDisplayElement());
24933      }
24934      if (element.hasClass_Element()) {
24935        composeString("class", element.getClass_Element());
24936      }
24937      if (element.hasClassDisplayElement()) {
24938        composeString("classDisplay", element.getClassDisplayElement());
24939      }
24940      if (element.hasSubClassElement()) {
24941        composeString("subClass", element.getSubClassElement());
24942      }
24943      if (element.hasSubClassDisplayElement()) {
24944        composeString("subClassDisplay", element.getSubClassDisplayElement());
24945      }
24946  }
24947
24948  protected void composeDataElement(String name, DataElement element) throws IOException {
24949    if (element != null) {
24950      composeDomainResourceAttributes(element);
24951      xml.enter(FHIR_NS, name);
24952      composeDataElementElements(element);
24953      composeElementClose(element);
24954      xml.exit(FHIR_NS, name);
24955    }
24956  }
24957
24958  protected void composeDataElementElements(DataElement element) throws IOException {
24959      composeDomainResourceElements(element);
24960      if (element.hasUrlElement()) {
24961        composeUri("url", element.getUrlElement());
24962      }
24963      if (element.hasIdentifier()) { 
24964        for (Identifier e : element.getIdentifier()) 
24965          composeIdentifier("identifier", e);
24966      }
24967      if (element.hasVersionElement()) {
24968        composeString("version", element.getVersionElement());
24969      }
24970      if (element.hasStatusElement())
24971        composeEnumeration("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory());
24972      if (element.hasExperimentalElement()) {
24973        composeBoolean("experimental", element.getExperimentalElement());
24974      }
24975      if (element.hasDateElement()) {
24976        composeDateTime("date", element.getDateElement());
24977      }
24978      if (element.hasPublisherElement()) {
24979        composeString("publisher", element.getPublisherElement());
24980      }
24981      if (element.hasNameElement()) {
24982        composeString("name", element.getNameElement());
24983      }
24984      if (element.hasTitleElement()) {
24985        composeString("title", element.getTitleElement());
24986      }
24987      if (element.hasContact()) { 
24988        for (ContactDetail e : element.getContact()) 
24989          composeContactDetail("contact", e);
24990      }
24991      if (element.hasUseContext()) { 
24992        for (UsageContext e : element.getUseContext()) 
24993          composeUsageContext("useContext", e);
24994      }
24995      if (element.hasJurisdiction()) { 
24996        for (CodeableConcept e : element.getJurisdiction()) 
24997          composeCodeableConcept("jurisdiction", e);
24998      }
24999      if (element.hasCopyrightElement()) {
25000        composeMarkdown("copyright", element.getCopyrightElement());
25001      }
25002      if (element.hasStringencyElement())
25003        composeEnumeration("stringency", element.getStringencyElement(), new DataElement.DataElementStringencyEnumFactory());
25004      if (element.hasMapping()) { 
25005        for (DataElement.DataElementMappingComponent e : element.getMapping()) 
25006          composeDataElementDataElementMappingComponent("mapping", e);
25007      }
25008      if (element.hasElement()) { 
25009        for (ElementDefinition e : element.getElement()) 
25010          composeElementDefinition("element", e);
25011      }
25012  }
25013
25014  protected void composeDataElementDataElementMappingComponent(String name, DataElement.DataElementMappingComponent element) throws IOException {
25015    if (element != null) {
25016      composeElementAttributes(element);
25017      xml.enter(FHIR_NS, name);
25018      composeDataElementDataElementMappingComponentElements(element);
25019      composeElementClose(element);
25020      xml.exit(FHIR_NS, name);
25021    }
25022  }
25023
25024  protected void composeDataElementDataElementMappingComponentElements(DataElement.DataElementMappingComponent element) throws IOException {
25025      composeBackboneElements(element);
25026      if (element.hasIdentityElement()) {
25027        composeId("identity", element.getIdentityElement());
25028      }
25029      if (element.hasUriElement()) {
25030        composeUri("uri", element.getUriElement());
25031      }
25032      if (element.hasNameElement()) {
25033        composeString("name", element.getNameElement());
25034      }
25035      if (element.hasCommentElement()) {
25036        composeString("comment", element.getCommentElement());
25037      }
25038  }
25039
25040  protected void composeDetectedIssue(String name, DetectedIssue element) throws IOException {
25041    if (element != null) {
25042      composeDomainResourceAttributes(element);
25043      xml.enter(FHIR_NS, name);
25044      composeDetectedIssueElements(element);
25045      composeElementClose(element);
25046      xml.exit(FHIR_NS, name);
25047    }
25048  }
25049
25050  protected void composeDetectedIssueElements(DetectedIssue element) throws IOException {
25051      composeDomainResourceElements(element);
25052      if (element.hasIdentifier()) {
25053        composeIdentifier("identifier", element.getIdentifier());
25054      }
25055      if (element.hasStatusElement())
25056        composeEnumeration("status", element.getStatusElement(), new DetectedIssue.DetectedIssueStatusEnumFactory());
25057      if (element.hasCategory()) {
25058        composeCodeableConcept("category", element.getCategory());
25059      }
25060      if (element.hasSeverityElement())
25061        composeEnumeration("severity", element.getSeverityElement(), new DetectedIssue.DetectedIssueSeverityEnumFactory());
25062      if (element.hasPatient()) {
25063        composeReference("patient", element.getPatient());
25064      }
25065      if (element.hasDateElement()) {
25066        composeDateTime("date", element.getDateElement());
25067      }
25068      if (element.hasAuthor()) {
25069        composeReference("author", element.getAuthor());
25070      }
25071      if (element.hasImplicated()) { 
25072        for (Reference e : element.getImplicated()) 
25073          composeReference("implicated", e);
25074      }
25075      if (element.hasDetailElement()) {
25076        composeString("detail", element.getDetailElement());
25077      }
25078      if (element.hasReferenceElement()) {
25079        composeUri("reference", element.getReferenceElement());
25080      }
25081      if (element.hasMitigation()) { 
25082        for (DetectedIssue.DetectedIssueMitigationComponent e : element.getMitigation()) 
25083          composeDetectedIssueDetectedIssueMitigationComponent("mitigation", e);
25084      }
25085  }
25086
25087  protected void composeDetectedIssueDetectedIssueMitigationComponent(String name, DetectedIssue.DetectedIssueMitigationComponent element) throws IOException {
25088    if (element != null) {
25089      composeElementAttributes(element);
25090      xml.enter(FHIR_NS, name);
25091      composeDetectedIssueDetectedIssueMitigationComponentElements(element);
25092      composeElementClose(element);
25093      xml.exit(FHIR_NS, name);
25094    }
25095  }
25096
25097  protected void composeDetectedIssueDetectedIssueMitigationComponentElements(DetectedIssue.DetectedIssueMitigationComponent element) throws IOException {
25098      composeBackboneElements(element);
25099      if (element.hasAction()) {
25100        composeCodeableConcept("action", element.getAction());
25101      }
25102      if (element.hasDateElement()) {
25103        composeDateTime("date", element.getDateElement());
25104      }
25105      if (element.hasAuthor()) {
25106        composeReference("author", element.getAuthor());
25107      }
25108  }
25109
25110  protected void composeDevice(String name, Device element) throws IOException {
25111    if (element != null) {
25112      composeDomainResourceAttributes(element);
25113      xml.enter(FHIR_NS, name);
25114      composeDeviceElements(element);
25115      composeElementClose(element);
25116      xml.exit(FHIR_NS, name);
25117    }
25118  }
25119
25120  protected void composeDeviceElements(Device element) throws IOException {
25121      composeDomainResourceElements(element);
25122      if (element.hasIdentifier()) { 
25123        for (Identifier e : element.getIdentifier()) 
25124          composeIdentifier("identifier", e);
25125      }
25126      if (element.hasUdi()) {
25127        composeDeviceDeviceUdiComponent("udi", element.getUdi());
25128      }
25129      if (element.hasStatusElement())
25130        composeEnumeration("status", element.getStatusElement(), new Device.FHIRDeviceStatusEnumFactory());
25131      if (element.hasType()) {
25132        composeCodeableConcept("type", element.getType());
25133      }
25134      if (element.hasLotNumberElement()) {
25135        composeString("lotNumber", element.getLotNumberElement());
25136      }
25137      if (element.hasManufacturerElement()) {
25138        composeString("manufacturer", element.getManufacturerElement());
25139      }
25140      if (element.hasManufactureDateElement()) {
25141        composeDateTime("manufactureDate", element.getManufactureDateElement());
25142      }
25143      if (element.hasExpirationDateElement()) {
25144        composeDateTime("expirationDate", element.getExpirationDateElement());
25145      }
25146      if (element.hasModelElement()) {
25147        composeString("model", element.getModelElement());
25148      }
25149      if (element.hasVersionElement()) {
25150        composeString("version", element.getVersionElement());
25151      }
25152      if (element.hasPatient()) {
25153        composeReference("patient", element.getPatient());
25154      }
25155      if (element.hasOwner()) {
25156        composeReference("owner", element.getOwner());
25157      }
25158      if (element.hasContact()) { 
25159        for (ContactPoint e : element.getContact()) 
25160          composeContactPoint("contact", e);
25161      }
25162      if (element.hasLocation()) {
25163        composeReference("location", element.getLocation());
25164      }
25165      if (element.hasUrlElement()) {
25166        composeUri("url", element.getUrlElement());
25167      }
25168      if (element.hasNote()) { 
25169        for (Annotation e : element.getNote()) 
25170          composeAnnotation("note", e);
25171      }
25172      if (element.hasSafety()) { 
25173        for (CodeableConcept e : element.getSafety()) 
25174          composeCodeableConcept("safety", e);
25175      }
25176  }
25177
25178  protected void composeDeviceDeviceUdiComponent(String name, Device.DeviceUdiComponent element) throws IOException {
25179    if (element != null) {
25180      composeElementAttributes(element);
25181      xml.enter(FHIR_NS, name);
25182      composeDeviceDeviceUdiComponentElements(element);
25183      composeElementClose(element);
25184      xml.exit(FHIR_NS, name);
25185    }
25186  }
25187
25188  protected void composeDeviceDeviceUdiComponentElements(Device.DeviceUdiComponent element) throws IOException {
25189      composeBackboneElements(element);
25190      if (element.hasDeviceIdentifierElement()) {
25191        composeString("deviceIdentifier", element.getDeviceIdentifierElement());
25192      }
25193      if (element.hasNameElement()) {
25194        composeString("name", element.getNameElement());
25195      }
25196      if (element.hasJurisdictionElement()) {
25197        composeUri("jurisdiction", element.getJurisdictionElement());
25198      }
25199      if (element.hasCarrierHRFElement()) {
25200        composeString("carrierHRF", element.getCarrierHRFElement());
25201      }
25202      if (element.hasCarrierAIDCElement()) {
25203        composeBase64Binary("carrierAIDC", element.getCarrierAIDCElement());
25204      }
25205      if (element.hasIssuerElement()) {
25206        composeUri("issuer", element.getIssuerElement());
25207      }
25208      if (element.hasEntryTypeElement())
25209        composeEnumeration("entryType", element.getEntryTypeElement(), new Device.UDIEntryTypeEnumFactory());
25210  }
25211
25212  protected void composeDeviceComponent(String name, DeviceComponent element) throws IOException {
25213    if (element != null) {
25214      composeDomainResourceAttributes(element);
25215      xml.enter(FHIR_NS, name);
25216      composeDeviceComponentElements(element);
25217      composeElementClose(element);
25218      xml.exit(FHIR_NS, name);
25219    }
25220  }
25221
25222  protected void composeDeviceComponentElements(DeviceComponent element) throws IOException {
25223      composeDomainResourceElements(element);
25224      if (element.hasIdentifier()) {
25225        composeIdentifier("identifier", element.getIdentifier());
25226      }
25227      if (element.hasType()) {
25228        composeCodeableConcept("type", element.getType());
25229      }
25230      if (element.hasLastSystemChangeElement()) {
25231        composeInstant("lastSystemChange", element.getLastSystemChangeElement());
25232      }
25233      if (element.hasSource()) {
25234        composeReference("source", element.getSource());
25235      }
25236      if (element.hasParent()) {
25237        composeReference("parent", element.getParent());
25238      }
25239      if (element.hasOperationalStatus()) { 
25240        for (CodeableConcept e : element.getOperationalStatus()) 
25241          composeCodeableConcept("operationalStatus", e);
25242      }
25243      if (element.hasParameterGroup()) {
25244        composeCodeableConcept("parameterGroup", element.getParameterGroup());
25245      }
25246      if (element.hasMeasurementPrincipleElement())
25247        composeEnumeration("measurementPrinciple", element.getMeasurementPrincipleElement(), new DeviceComponent.MeasmntPrincipleEnumFactory());
25248      if (element.hasProductionSpecification()) { 
25249        for (DeviceComponent.DeviceComponentProductionSpecificationComponent e : element.getProductionSpecification()) 
25250          composeDeviceComponentDeviceComponentProductionSpecificationComponent("productionSpecification", e);
25251      }
25252      if (element.hasLanguageCode()) {
25253        composeCodeableConcept("languageCode", element.getLanguageCode());
25254      }
25255  }
25256
25257  protected void composeDeviceComponentDeviceComponentProductionSpecificationComponent(String name, DeviceComponent.DeviceComponentProductionSpecificationComponent element) throws IOException {
25258    if (element != null) {
25259      composeElementAttributes(element);
25260      xml.enter(FHIR_NS, name);
25261      composeDeviceComponentDeviceComponentProductionSpecificationComponentElements(element);
25262      composeElementClose(element);
25263      xml.exit(FHIR_NS, name);
25264    }
25265  }
25266
25267  protected void composeDeviceComponentDeviceComponentProductionSpecificationComponentElements(DeviceComponent.DeviceComponentProductionSpecificationComponent element) throws IOException {
25268      composeBackboneElements(element);
25269      if (element.hasSpecType()) {
25270        composeCodeableConcept("specType", element.getSpecType());
25271      }
25272      if (element.hasComponentId()) {
25273        composeIdentifier("componentId", element.getComponentId());
25274      }
25275      if (element.hasProductionSpecElement()) {
25276        composeString("productionSpec", element.getProductionSpecElement());
25277      }
25278  }
25279
25280  protected void composeDeviceMetric(String name, DeviceMetric element) throws IOException {
25281    if (element != null) {
25282      composeDomainResourceAttributes(element);
25283      xml.enter(FHIR_NS, name);
25284      composeDeviceMetricElements(element);
25285      composeElementClose(element);
25286      xml.exit(FHIR_NS, name);
25287    }
25288  }
25289
25290  protected void composeDeviceMetricElements(DeviceMetric element) throws IOException {
25291      composeDomainResourceElements(element);
25292      if (element.hasIdentifier()) {
25293        composeIdentifier("identifier", element.getIdentifier());
25294      }
25295      if (element.hasType()) {
25296        composeCodeableConcept("type", element.getType());
25297      }
25298      if (element.hasUnit()) {
25299        composeCodeableConcept("unit", element.getUnit());
25300      }
25301      if (element.hasSource()) {
25302        composeReference("source", element.getSource());
25303      }
25304      if (element.hasParent()) {
25305        composeReference("parent", element.getParent());
25306      }
25307      if (element.hasOperationalStatusElement())
25308        composeEnumeration("operationalStatus", element.getOperationalStatusElement(), new DeviceMetric.DeviceMetricOperationalStatusEnumFactory());
25309      if (element.hasColorElement())
25310        composeEnumeration("color", element.getColorElement(), new DeviceMetric.DeviceMetricColorEnumFactory());
25311      if (element.hasCategoryElement())
25312        composeEnumeration("category", element.getCategoryElement(), new DeviceMetric.DeviceMetricCategoryEnumFactory());
25313      if (element.hasMeasurementPeriod()) {
25314        composeTiming("measurementPeriod", element.getMeasurementPeriod());
25315      }
25316      if (element.hasCalibration()) { 
25317        for (DeviceMetric.DeviceMetricCalibrationComponent e : element.getCalibration()) 
25318          composeDeviceMetricDeviceMetricCalibrationComponent("calibration", e);
25319      }
25320  }
25321
25322  protected void composeDeviceMetricDeviceMetricCalibrationComponent(String name, DeviceMetric.DeviceMetricCalibrationComponent element) throws IOException {
25323    if (element != null) {
25324      composeElementAttributes(element);
25325      xml.enter(FHIR_NS, name);
25326      composeDeviceMetricDeviceMetricCalibrationComponentElements(element);
25327      composeElementClose(element);
25328      xml.exit(FHIR_NS, name);
25329    }
25330  }
25331
25332  protected void composeDeviceMetricDeviceMetricCalibrationComponentElements(DeviceMetric.DeviceMetricCalibrationComponent element) throws IOException {
25333      composeBackboneElements(element);
25334      if (element.hasTypeElement())
25335        composeEnumeration("type", element.getTypeElement(), new DeviceMetric.DeviceMetricCalibrationTypeEnumFactory());
25336      if (element.hasStateElement())
25337        composeEnumeration("state", element.getStateElement(), new DeviceMetric.DeviceMetricCalibrationStateEnumFactory());
25338      if (element.hasTimeElement()) {
25339        composeInstant("time", element.getTimeElement());
25340      }
25341  }
25342
25343  protected void composeDeviceRequest(String name, DeviceRequest element) throws IOException {
25344    if (element != null) {
25345      composeDomainResourceAttributes(element);
25346      xml.enter(FHIR_NS, name);
25347      composeDeviceRequestElements(element);
25348      composeElementClose(element);
25349      xml.exit(FHIR_NS, name);
25350    }
25351  }
25352
25353  protected void composeDeviceRequestElements(DeviceRequest element) throws IOException {
25354      composeDomainResourceElements(element);
25355      if (element.hasIdentifier()) { 
25356        for (Identifier e : element.getIdentifier()) 
25357          composeIdentifier("identifier", e);
25358      }
25359      if (element.hasDefinition()) { 
25360        for (Reference e : element.getDefinition()) 
25361          composeReference("definition", e);
25362      }
25363      if (element.hasBasedOn()) { 
25364        for (Reference e : element.getBasedOn()) 
25365          composeReference("basedOn", e);
25366      }
25367      if (element.hasPriorRequest()) { 
25368        for (Reference e : element.getPriorRequest()) 
25369          composeReference("priorRequest", e);
25370      }
25371      if (element.hasGroupIdentifier()) {
25372        composeIdentifier("groupIdentifier", element.getGroupIdentifier());
25373      }
25374      if (element.hasStatusElement())
25375        composeEnumeration("status", element.getStatusElement(), new DeviceRequest.DeviceRequestStatusEnumFactory());
25376      if (element.hasIntent()) {
25377        composeCodeableConcept("intent", element.getIntent());
25378      }
25379      if (element.hasPriorityElement())
25380        composeEnumeration("priority", element.getPriorityElement(), new DeviceRequest.RequestPriorityEnumFactory());
25381      if (element.hasCode()) {
25382        composeType("code", element.getCode());
25383      }      if (element.hasSubject()) {
25384        composeReference("subject", element.getSubject());
25385      }
25386      if (element.hasContext()) {
25387        composeReference("context", element.getContext());
25388      }
25389      if (element.hasOccurrence()) {
25390        composeType("occurrence", element.getOccurrence());
25391      }      if (element.hasAuthoredOnElement()) {
25392        composeDateTime("authoredOn", element.getAuthoredOnElement());
25393      }
25394      if (element.hasRequester()) {
25395        composeDeviceRequestDeviceRequestRequesterComponent("requester", element.getRequester());
25396      }
25397      if (element.hasPerformerType()) {
25398        composeCodeableConcept("performerType", element.getPerformerType());
25399      }
25400      if (element.hasPerformer()) {
25401        composeReference("performer", element.getPerformer());
25402      }
25403      if (element.hasReasonCode()) { 
25404        for (CodeableConcept e : element.getReasonCode()) 
25405          composeCodeableConcept("reasonCode", e);
25406      }
25407      if (element.hasReasonReference()) { 
25408        for (Reference e : element.getReasonReference()) 
25409          composeReference("reasonReference", e);
25410      }
25411      if (element.hasSupportingInfo()) { 
25412        for (Reference e : element.getSupportingInfo()) 
25413          composeReference("supportingInfo", e);
25414      }
25415      if (element.hasNote()) { 
25416        for (Annotation e : element.getNote()) 
25417          composeAnnotation("note", e);
25418      }
25419      if (element.hasRelevantHistory()) { 
25420        for (Reference e : element.getRelevantHistory()) 
25421          composeReference("relevantHistory", e);
25422      }
25423  }
25424
25425  protected void composeDeviceRequestDeviceRequestRequesterComponent(String name, DeviceRequest.DeviceRequestRequesterComponent element) throws IOException {
25426    if (element != null) {
25427      composeElementAttributes(element);
25428      xml.enter(FHIR_NS, name);
25429      composeDeviceRequestDeviceRequestRequesterComponentElements(element);
25430      composeElementClose(element);
25431      xml.exit(FHIR_NS, name);
25432    }
25433  }
25434
25435  protected void composeDeviceRequestDeviceRequestRequesterComponentElements(DeviceRequest.DeviceRequestRequesterComponent element) throws IOException {
25436      composeBackboneElements(element);
25437      if (element.hasAgent()) {
25438        composeReference("agent", element.getAgent());
25439      }
25440      if (element.hasOnBehalfOf()) {
25441        composeReference("onBehalfOf", element.getOnBehalfOf());
25442      }
25443  }
25444
25445  protected void composeDeviceUseStatement(String name, DeviceUseStatement element) throws IOException {
25446    if (element != null) {
25447      composeDomainResourceAttributes(element);
25448      xml.enter(FHIR_NS, name);
25449      composeDeviceUseStatementElements(element);
25450      composeElementClose(element);
25451      xml.exit(FHIR_NS, name);
25452    }
25453  }
25454
25455  protected void composeDeviceUseStatementElements(DeviceUseStatement element) throws IOException {
25456      composeDomainResourceElements(element);
25457      if (element.hasIdentifier()) { 
25458        for (Identifier e : element.getIdentifier()) 
25459          composeIdentifier("identifier", e);
25460      }
25461      if (element.hasStatusElement())
25462        composeEnumeration("status", element.getStatusElement(), new DeviceUseStatement.DeviceUseStatementStatusEnumFactory());
25463      if (element.hasSubject()) {
25464        composeReference("subject", element.getSubject());
25465      }
25466      if (element.hasWhenUsed()) {
25467        composePeriod("whenUsed", element.getWhenUsed());
25468      }
25469      if (element.hasTiming()) {
25470        composeType("timing", element.getTiming());
25471      }      if (element.hasRecordedOnElement()) {
25472        composeDateTime("recordedOn", element.getRecordedOnElement());
25473      }
25474      if (element.hasSource()) {
25475        composeReference("source", element.getSource());
25476      }
25477      if (element.hasDevice()) {
25478        composeReference("device", element.getDevice());
25479      }
25480      if (element.hasIndication()) { 
25481        for (CodeableConcept e : element.getIndication()) 
25482          composeCodeableConcept("indication", e);
25483      }
25484      if (element.hasBodySite()) {
25485        composeCodeableConcept("bodySite", element.getBodySite());
25486      }
25487      if (element.hasNote()) { 
25488        for (Annotation e : element.getNote()) 
25489          composeAnnotation("note", e);
25490      }
25491  }
25492
25493  protected void composeDiagnosticReport(String name, DiagnosticReport element) throws IOException {
25494    if (element != null) {
25495      composeDomainResourceAttributes(element);
25496      xml.enter(FHIR_NS, name);
25497      composeDiagnosticReportElements(element);
25498      composeElementClose(element);
25499      xml.exit(FHIR_NS, name);
25500    }
25501  }
25502
25503  protected void composeDiagnosticReportElements(DiagnosticReport element) throws IOException {
25504      composeDomainResourceElements(element);
25505      if (element.hasIdentifier()) { 
25506        for (Identifier e : element.getIdentifier()) 
25507          composeIdentifier("identifier", e);
25508      }
25509      if (element.hasBasedOn()) { 
25510        for (Reference e : element.getBasedOn()) 
25511          composeReference("basedOn", e);
25512      }
25513      if (element.hasStatusElement())
25514        composeEnumeration("status", element.getStatusElement(), new DiagnosticReport.DiagnosticReportStatusEnumFactory());
25515      if (element.hasCategory()) {
25516        composeCodeableConcept("category", element.getCategory());
25517      }
25518      if (element.hasCode()) {
25519        composeCodeableConcept("code", element.getCode());
25520      }
25521      if (element.hasSubject()) {
25522        composeReference("subject", element.getSubject());
25523      }
25524      if (element.hasContext()) {
25525        composeReference("context", element.getContext());
25526      }
25527      if (element.hasEffective()) {
25528        composeType("effective", element.getEffective());
25529      }      if (element.hasIssuedElement()) {
25530        composeInstant("issued", element.getIssuedElement());
25531      }
25532      if (element.hasPerformer()) { 
25533        for (DiagnosticReport.DiagnosticReportPerformerComponent e : element.getPerformer()) 
25534          composeDiagnosticReportDiagnosticReportPerformerComponent("performer", e);
25535      }
25536      if (element.hasSpecimen()) { 
25537        for (Reference e : element.getSpecimen()) 
25538          composeReference("specimen", e);
25539      }
25540      if (element.hasResult()) { 
25541        for (Reference e : element.getResult()) 
25542          composeReference("result", e);
25543      }
25544      if (element.hasImagingStudy()) { 
25545        for (Reference e : element.getImagingStudy()) 
25546          composeReference("imagingStudy", e);
25547      }
25548      if (element.hasImage()) { 
25549        for (DiagnosticReport.DiagnosticReportImageComponent e : element.getImage()) 
25550          composeDiagnosticReportDiagnosticReportImageComponent("image", e);
25551      }
25552      if (element.hasConclusionElement()) {
25553        composeString("conclusion", element.getConclusionElement());
25554      }
25555      if (element.hasCodedDiagnosis()) { 
25556        for (CodeableConcept e : element.getCodedDiagnosis()) 
25557          composeCodeableConcept("codedDiagnosis", e);
25558      }
25559      if (element.hasPresentedForm()) { 
25560        for (Attachment e : element.getPresentedForm()) 
25561          composeAttachment("presentedForm", e);
25562      }
25563  }
25564
25565  protected void composeDiagnosticReportDiagnosticReportPerformerComponent(String name, DiagnosticReport.DiagnosticReportPerformerComponent element) throws IOException {
25566    if (element != null) {
25567      composeElementAttributes(element);
25568      xml.enter(FHIR_NS, name);
25569      composeDiagnosticReportDiagnosticReportPerformerComponentElements(element);
25570      composeElementClose(element);
25571      xml.exit(FHIR_NS, name);
25572    }
25573  }
25574
25575  protected void composeDiagnosticReportDiagnosticReportPerformerComponentElements(DiagnosticReport.DiagnosticReportPerformerComponent element) throws IOException {
25576      composeBackboneElements(element);
25577      if (element.hasRole()) {
25578        composeCodeableConcept("role", element.getRole());
25579      }
25580      if (element.hasActor()) {
25581        composeReference("actor", element.getActor());
25582      }
25583  }
25584
25585  protected void composeDiagnosticReportDiagnosticReportImageComponent(String name, DiagnosticReport.DiagnosticReportImageComponent element) throws IOException {
25586    if (element != null) {
25587      composeElementAttributes(element);
25588      xml.enter(FHIR_NS, name);
25589      composeDiagnosticReportDiagnosticReportImageComponentElements(element);
25590      composeElementClose(element);
25591      xml.exit(FHIR_NS, name);
25592    }
25593  }
25594
25595  protected void composeDiagnosticReportDiagnosticReportImageComponentElements(DiagnosticReport.DiagnosticReportImageComponent element) throws IOException {
25596      composeBackboneElements(element);
25597      if (element.hasCommentElement()) {
25598        composeString("comment", element.getCommentElement());
25599      }
25600      if (element.hasLink()) {
25601        composeReference("link", element.getLink());
25602      }
25603  }
25604
25605  protected void composeDocumentManifest(String name, DocumentManifest element) throws IOException {
25606    if (element != null) {
25607      composeDomainResourceAttributes(element);
25608      xml.enter(FHIR_NS, name);
25609      composeDocumentManifestElements(element);
25610      composeElementClose(element);
25611      xml.exit(FHIR_NS, name);
25612    }
25613  }
25614
25615  protected void composeDocumentManifestElements(DocumentManifest element) throws IOException {
25616      composeDomainResourceElements(element);
25617      if (element.hasMasterIdentifier()) {
25618        composeIdentifier("masterIdentifier", element.getMasterIdentifier());
25619      }
25620      if (element.hasIdentifier()) { 
25621        for (Identifier e : element.getIdentifier()) 
25622          composeIdentifier("identifier", e);
25623      }
25624      if (element.hasStatusElement())
25625        composeEnumeration("status", element.getStatusElement(), new Enumerations.DocumentReferenceStatusEnumFactory());
25626      if (element.hasType()) {
25627        composeCodeableConcept("type", element.getType());
25628      }
25629      if (element.hasSubject()) {
25630        composeReference("subject", element.getSubject());
25631      }
25632      if (element.hasCreatedElement()) {
25633        composeDateTime("created", element.getCreatedElement());
25634      }
25635      if (element.hasAuthor()) { 
25636        for (Reference e : element.getAuthor()) 
25637          composeReference("author", e);
25638      }
25639      if (element.hasRecipient()) { 
25640        for (Reference e : element.getRecipient()) 
25641          composeReference("recipient", e);
25642      }
25643      if (element.hasSourceElement()) {
25644        composeUri("source", element.getSourceElement());
25645      }
25646      if (element.hasDescriptionElement()) {
25647        composeString("description", element.getDescriptionElement());
25648      }
25649      if (element.hasContent()) { 
25650        for (DocumentManifest.DocumentManifestContentComponent e : element.getContent()) 
25651          composeDocumentManifestDocumentManifestContentComponent("content", e);
25652      }
25653      if (element.hasRelated()) { 
25654        for (DocumentManifest.DocumentManifestRelatedComponent e : element.getRelated()) 
25655          composeDocumentManifestDocumentManifestRelatedComponent("related", e);
25656      }
25657  }
25658
25659  protected void composeDocumentManifestDocumentManifestContentComponent(String name, DocumentManifest.DocumentManifestContentComponent element) throws IOException {
25660    if (element != null) {
25661      composeElementAttributes(element);
25662      xml.enter(FHIR_NS, name);
25663      composeDocumentManifestDocumentManifestContentComponentElements(element);
25664      composeElementClose(element);
25665      xml.exit(FHIR_NS, name);
25666    }
25667  }
25668
25669  protected void composeDocumentManifestDocumentManifestContentComponentElements(DocumentManifest.DocumentManifestContentComponent element) throws IOException {
25670      composeBackboneElements(element);
25671      if (element.hasP()) {
25672        composeType("p", element.getP());
25673      }  }
25674
25675  protected void composeDocumentManifestDocumentManifestRelatedComponent(String name, DocumentManifest.DocumentManifestRelatedComponent element) throws IOException {
25676    if (element != null) {
25677      composeElementAttributes(element);
25678      xml.enter(FHIR_NS, name);
25679      composeDocumentManifestDocumentManifestRelatedComponentElements(element);
25680      composeElementClose(element);
25681      xml.exit(FHIR_NS, name);
25682    }
25683  }
25684
25685  protected void composeDocumentManifestDocumentManifestRelatedComponentElements(DocumentManifest.DocumentManifestRelatedComponent element) throws IOException {
25686      composeBackboneElements(element);
25687      if (element.hasIdentifier()) {
25688        composeIdentifier("identifier", element.getIdentifier());
25689      }
25690      if (element.hasRef()) {
25691        composeReference("ref", element.getRef());
25692      }
25693  }
25694
25695  protected void composeDocumentReference(String name, DocumentReference element) throws IOException {
25696    if (element != null) {
25697      composeDomainResourceAttributes(element);
25698      xml.enter(FHIR_NS, name);
25699      composeDocumentReferenceElements(element);
25700      composeElementClose(element);
25701      xml.exit(FHIR_NS, name);
25702    }
25703  }
25704
25705  protected void composeDocumentReferenceElements(DocumentReference element) throws IOException {
25706      composeDomainResourceElements(element);
25707      if (element.hasMasterIdentifier()) {
25708        composeIdentifier("masterIdentifier", element.getMasterIdentifier());
25709      }
25710      if (element.hasIdentifier()) { 
25711        for (Identifier e : element.getIdentifier()) 
25712          composeIdentifier("identifier", e);
25713      }
25714      if (element.hasStatusElement())
25715        composeEnumeration("status", element.getStatusElement(), new Enumerations.DocumentReferenceStatusEnumFactory());
25716      if (element.hasDocStatusElement())
25717        composeEnumeration("docStatus", element.getDocStatusElement(), new DocumentReference.ReferredDocumentStatusEnumFactory());
25718      if (element.hasType()) {
25719        composeCodeableConcept("type", element.getType());
25720      }
25721      if (element.hasClass_()) {
25722        composeCodeableConcept("class", element.getClass_());
25723      }
25724      if (element.hasSubject()) {
25725        composeReference("subject", element.getSubject());
25726      }
25727      if (element.hasCreatedElement()) {
25728        composeDateTime("created", element.getCreatedElement());
25729      }
25730      if (element.hasIndexedElement()) {
25731        composeInstant("indexed", element.getIndexedElement());
25732      }
25733      if (element.hasAuthor()) { 
25734        for (Reference e : element.getAuthor()) 
25735          composeReference("author", e);
25736      }
25737      if (element.hasAuthenticator()) {
25738        composeReference("authenticator", element.getAuthenticator());
25739      }
25740      if (element.hasCustodian()) {
25741        composeReference("custodian", element.getCustodian());
25742      }
25743      if (element.hasRelatesTo()) { 
25744        for (DocumentReference.DocumentReferenceRelatesToComponent e : element.getRelatesTo()) 
25745          composeDocumentReferenceDocumentReferenceRelatesToComponent("relatesTo", e);
25746      }
25747      if (element.hasDescriptionElement()) {
25748        composeString("description", element.getDescriptionElement());
25749      }
25750      if (element.hasSecurityLabel()) { 
25751        for (CodeableConcept e : element.getSecurityLabel()) 
25752          composeCodeableConcept("securityLabel", e);
25753      }
25754      if (element.hasContent()) { 
25755        for (DocumentReference.DocumentReferenceContentComponent e : element.getContent()) 
25756          composeDocumentReferenceDocumentReferenceContentComponent("content", e);
25757      }
25758      if (element.hasContext()) {
25759        composeDocumentReferenceDocumentReferenceContextComponent("context", element.getContext());
25760      }
25761  }
25762
25763  protected void composeDocumentReferenceDocumentReferenceRelatesToComponent(String name, DocumentReference.DocumentReferenceRelatesToComponent element) throws IOException {
25764    if (element != null) {
25765      composeElementAttributes(element);
25766      xml.enter(FHIR_NS, name);
25767      composeDocumentReferenceDocumentReferenceRelatesToComponentElements(element);
25768      composeElementClose(element);
25769      xml.exit(FHIR_NS, name);
25770    }
25771  }
25772
25773  protected void composeDocumentReferenceDocumentReferenceRelatesToComponentElements(DocumentReference.DocumentReferenceRelatesToComponent element) throws IOException {
25774      composeBackboneElements(element);
25775      if (element.hasCodeElement())
25776        composeEnumeration("code", element.getCodeElement(), new DocumentReference.DocumentRelationshipTypeEnumFactory());
25777      if (element.hasTarget()) {
25778        composeReference("target", element.getTarget());
25779      }
25780  }
25781
25782  protected void composeDocumentReferenceDocumentReferenceContentComponent(String name, DocumentReference.DocumentReferenceContentComponent element) throws IOException {
25783    if (element != null) {
25784      composeElementAttributes(element);
25785      xml.enter(FHIR_NS, name);
25786      composeDocumentReferenceDocumentReferenceContentComponentElements(element);
25787      composeElementClose(element);
25788      xml.exit(FHIR_NS, name);
25789    }
25790  }
25791
25792  protected void composeDocumentReferenceDocumentReferenceContentComponentElements(DocumentReference.DocumentReferenceContentComponent element) throws IOException {
25793      composeBackboneElements(element);
25794      if (element.hasAttachment()) {
25795        composeAttachment("attachment", element.getAttachment());
25796      }
25797      if (element.hasFormat()) {
25798        composeCoding("format", element.getFormat());
25799      }
25800  }
25801
25802  protected void composeDocumentReferenceDocumentReferenceContextComponent(String name, DocumentReference.DocumentReferenceContextComponent element) throws IOException {
25803    if (element != null) {
25804      composeElementAttributes(element);
25805      xml.enter(FHIR_NS, name);
25806      composeDocumentReferenceDocumentReferenceContextComponentElements(element);
25807      composeElementClose(element);
25808      xml.exit(FHIR_NS, name);
25809    }
25810  }
25811
25812  protected void composeDocumentReferenceDocumentReferenceContextComponentElements(DocumentReference.DocumentReferenceContextComponent element) throws IOException {
25813      composeBackboneElements(element);
25814      if (element.hasEncounter()) {
25815        composeReference("encounter", element.getEncounter());
25816      }
25817      if (element.hasEvent()) { 
25818        for (CodeableConcept e : element.getEvent()) 
25819          composeCodeableConcept("event", e);
25820      }
25821      if (element.hasPeriod()) {
25822        composePeriod("period", element.getPeriod());
25823      }
25824      if (element.hasFacilityType()) {
25825        composeCodeableConcept("facilityType", element.getFacilityType());
25826      }
25827      if (element.hasPracticeSetting()) {
25828        composeCodeableConcept("practiceSetting", element.getPracticeSetting());
25829      }
25830      if (element.hasSourcePatientInfo()) {
25831        composeReference("sourcePatientInfo", element.getSourcePatientInfo());
25832      }
25833      if (element.hasRelated()) { 
25834        for (DocumentReference.DocumentReferenceContextRelatedComponent e : element.getRelated()) 
25835          composeDocumentReferenceDocumentReferenceContextRelatedComponent("related", e);
25836      }
25837  }
25838
25839  protected void composeDocumentReferenceDocumentReferenceContextRelatedComponent(String name, DocumentReference.DocumentReferenceContextRelatedComponent element) throws IOException {
25840    if (element != null) {
25841      composeElementAttributes(element);
25842      xml.enter(FHIR_NS, name);
25843      composeDocumentReferenceDocumentReferenceContextRelatedComponentElements(element);
25844      composeElementClose(element);
25845      xml.exit(FHIR_NS, name);
25846    }
25847  }
25848
25849  protected void composeDocumentReferenceDocumentReferenceContextRelatedComponentElements(DocumentReference.DocumentReferenceContextRelatedComponent element) throws IOException {
25850      composeBackboneElements(element);
25851      if (element.hasIdentifier()) {
25852        composeIdentifier("identifier", element.getIdentifier());
25853      }
25854      if (element.hasRef()) {
25855        composeReference("ref", element.getRef());
25856      }
25857  }
25858
25859  protected void composeEligibilityRequest(String name, EligibilityRequest element) throws IOException {
25860    if (element != null) {
25861      composeDomainResourceAttributes(element);
25862      xml.enter(FHIR_NS, name);
25863      composeEligibilityRequestElements(element);
25864      composeElementClose(element);
25865      xml.exit(FHIR_NS, name);
25866    }
25867  }
25868
25869  protected void composeEligibilityRequestElements(EligibilityRequest element) throws IOException {
25870      composeDomainResourceElements(element);
25871      if (element.hasIdentifier()) { 
25872        for (Identifier e : element.getIdentifier()) 
25873          composeIdentifier("identifier", e);
25874      }
25875      if (element.hasStatusElement())
25876        composeEnumeration("status", element.getStatusElement(), new EligibilityRequest.EligibilityRequestStatusEnumFactory());
25877      if (element.hasPriority()) {
25878        composeCodeableConcept("priority", element.getPriority());
25879      }
25880      if (element.hasPatient()) {
25881        composeReference("patient", element.getPatient());
25882      }
25883      if (element.hasServiced()) {
25884        composeType("serviced", element.getServiced());
25885      }      if (element.hasCreatedElement()) {
25886        composeDateTime("created", element.getCreatedElement());
25887      }
25888      if (element.hasEnterer()) {
25889        composeReference("enterer", element.getEnterer());
25890      }
25891      if (element.hasProvider()) {
25892        composeReference("provider", element.getProvider());
25893      }
25894      if (element.hasOrganization()) {
25895        composeReference("organization", element.getOrganization());
25896      }
25897      if (element.hasInsurer()) {
25898        composeReference("insurer", element.getInsurer());
25899      }
25900      if (element.hasFacility()) {
25901        composeReference("facility", element.getFacility());
25902      }
25903      if (element.hasCoverage()) {
25904        composeReference("coverage", element.getCoverage());
25905      }
25906      if (element.hasBusinessArrangementElement()) {
25907        composeString("businessArrangement", element.getBusinessArrangementElement());
25908      }
25909      if (element.hasBenefitCategory()) {
25910        composeCodeableConcept("benefitCategory", element.getBenefitCategory());
25911      }
25912      if (element.hasBenefitSubCategory()) {
25913        composeCodeableConcept("benefitSubCategory", element.getBenefitSubCategory());
25914      }
25915  }
25916
25917  protected void composeEligibilityResponse(String name, EligibilityResponse element) throws IOException {
25918    if (element != null) {
25919      composeDomainResourceAttributes(element);
25920      xml.enter(FHIR_NS, name);
25921      composeEligibilityResponseElements(element);
25922      composeElementClose(element);
25923      xml.exit(FHIR_NS, name);
25924    }
25925  }
25926
25927  protected void composeEligibilityResponseElements(EligibilityResponse element) throws IOException {
25928      composeDomainResourceElements(element);
25929      if (element.hasIdentifier()) { 
25930        for (Identifier e : element.getIdentifier()) 
25931          composeIdentifier("identifier", e);
25932      }
25933      if (element.hasStatusElement())
25934        composeEnumeration("status", element.getStatusElement(), new EligibilityResponse.EligibilityResponseStatusEnumFactory());
25935      if (element.hasCreatedElement()) {
25936        composeDateTime("created", element.getCreatedElement());
25937      }
25938      if (element.hasRequestProvider()) {
25939        composeReference("requestProvider", element.getRequestProvider());
25940      }
25941      if (element.hasRequestOrganization()) {
25942        composeReference("requestOrganization", element.getRequestOrganization());
25943      }
25944      if (element.hasRequest()) {
25945        composeReference("request", element.getRequest());
25946      }
25947      if (element.hasOutcome()) {
25948        composeCodeableConcept("outcome", element.getOutcome());
25949      }
25950      if (element.hasDispositionElement()) {
25951        composeString("disposition", element.getDispositionElement());
25952      }
25953      if (element.hasInsurer()) {
25954        composeReference("insurer", element.getInsurer());
25955      }
25956      if (element.hasInforceElement()) {
25957        composeBoolean("inforce", element.getInforceElement());
25958      }
25959      if (element.hasInsurance()) { 
25960        for (EligibilityResponse.InsuranceComponent e : element.getInsurance()) 
25961          composeEligibilityResponseInsuranceComponent("insurance", e);
25962      }
25963      if (element.hasForm()) {
25964        composeCodeableConcept("form", element.getForm());
25965      }
25966      if (element.hasError()) { 
25967        for (EligibilityResponse.ErrorsComponent e : element.getError()) 
25968          composeEligibilityResponseErrorsComponent("error", e);
25969      }
25970  }
25971
25972  protected void composeEligibilityResponseInsuranceComponent(String name, EligibilityResponse.InsuranceComponent element) throws IOException {
25973    if (element != null) {
25974      composeElementAttributes(element);
25975      xml.enter(FHIR_NS, name);
25976      composeEligibilityResponseInsuranceComponentElements(element);
25977      composeElementClose(element);
25978      xml.exit(FHIR_NS, name);
25979    }
25980  }
25981
25982  protected void composeEligibilityResponseInsuranceComponentElements(EligibilityResponse.InsuranceComponent element) throws IOException {
25983      composeBackboneElements(element);
25984      if (element.hasCoverage()) {
25985        composeReference("coverage", element.getCoverage());
25986      }
25987      if (element.hasContract()) {
25988        composeReference("contract", element.getContract());
25989      }
25990      if (element.hasBenefitBalance()) { 
25991        for (EligibilityResponse.BenefitsComponent e : element.getBenefitBalance()) 
25992          composeEligibilityResponseBenefitsComponent("benefitBalance", e);
25993      }
25994  }
25995
25996  protected void composeEligibilityResponseBenefitsComponent(String name, EligibilityResponse.BenefitsComponent element) throws IOException {
25997    if (element != null) {
25998      composeElementAttributes(element);
25999      xml.enter(FHIR_NS, name);
26000      composeEligibilityResponseBenefitsComponentElements(element);
26001      composeElementClose(element);
26002      xml.exit(FHIR_NS, name);
26003    }
26004  }
26005
26006  protected void composeEligibilityResponseBenefitsComponentElements(EligibilityResponse.BenefitsComponent element) throws IOException {
26007      composeBackboneElements(element);
26008      if (element.hasCategory()) {
26009        composeCodeableConcept("category", element.getCategory());
26010      }
26011      if (element.hasSubCategory()) {
26012        composeCodeableConcept("subCategory", element.getSubCategory());
26013      }
26014      if (element.hasExcludedElement()) {
26015        composeBoolean("excluded", element.getExcludedElement());
26016      }
26017      if (element.hasNameElement()) {
26018        composeString("name", element.getNameElement());
26019      }
26020      if (element.hasDescriptionElement()) {
26021        composeString("description", element.getDescriptionElement());
26022      }
26023      if (element.hasNetwork()) {
26024        composeCodeableConcept("network", element.getNetwork());
26025      }
26026      if (element.hasUnit()) {
26027        composeCodeableConcept("unit", element.getUnit());
26028      }
26029      if (element.hasTerm()) {
26030        composeCodeableConcept("term", element.getTerm());
26031      }
26032      if (element.hasFinancial()) { 
26033        for (EligibilityResponse.BenefitComponent e : element.getFinancial()) 
26034          composeEligibilityResponseBenefitComponent("financial", e);
26035      }
26036  }
26037
26038  protected void composeEligibilityResponseBenefitComponent(String name, EligibilityResponse.BenefitComponent element) throws IOException {
26039    if (element != null) {
26040      composeElementAttributes(element);
26041      xml.enter(FHIR_NS, name);
26042      composeEligibilityResponseBenefitComponentElements(element);
26043      composeElementClose(element);
26044      xml.exit(FHIR_NS, name);
26045    }
26046  }
26047
26048  protected void composeEligibilityResponseBenefitComponentElements(EligibilityResponse.BenefitComponent element) throws IOException {
26049      composeBackboneElements(element);
26050      if (element.hasType()) {
26051        composeCodeableConcept("type", element.getType());
26052      }
26053      if (element.hasAllowed()) {
26054        composeType("allowed", element.getAllowed());
26055      }      if (element.hasUsed()) {
26056        composeType("used", element.getUsed());
26057      }  }
26058
26059  protected void composeEligibilityResponseErrorsComponent(String name, EligibilityResponse.ErrorsComponent element) throws IOException {
26060    if (element != null) {
26061      composeElementAttributes(element);
26062      xml.enter(FHIR_NS, name);
26063      composeEligibilityResponseErrorsComponentElements(element);
26064      composeElementClose(element);
26065      xml.exit(FHIR_NS, name);
26066    }
26067  }
26068
26069  protected void composeEligibilityResponseErrorsComponentElements(EligibilityResponse.ErrorsComponent element) throws IOException {
26070      composeBackboneElements(element);
26071      if (element.hasCode()) {
26072        composeCodeableConcept("code", element.getCode());
26073      }
26074  }
26075
26076  protected void composeEncounter(String name, Encounter element) throws IOException {
26077    if (element != null) {
26078      composeDomainResourceAttributes(element);
26079      xml.enter(FHIR_NS, name);
26080      composeEncounterElements(element);
26081      composeElementClose(element);
26082      xml.exit(FHIR_NS, name);
26083    }
26084  }
26085
26086  protected void composeEncounterElements(Encounter element) throws IOException {
26087      composeDomainResourceElements(element);
26088      if (element.hasIdentifier()) { 
26089        for (Identifier e : element.getIdentifier()) 
26090          composeIdentifier("identifier", e);
26091      }
26092      if (element.hasStatusElement())
26093        composeEnumeration("status", element.getStatusElement(), new Encounter.EncounterStatusEnumFactory());
26094      if (element.hasStatusHistory()) { 
26095        for (Encounter.StatusHistoryComponent e : element.getStatusHistory()) 
26096          composeEncounterStatusHistoryComponent("statusHistory", e);
26097      }
26098      if (element.hasClass_()) {
26099        composeCoding("class", element.getClass_());
26100      }
26101      if (element.hasClassHistory()) { 
26102        for (Encounter.ClassHistoryComponent e : element.getClassHistory()) 
26103          composeEncounterClassHistoryComponent("classHistory", e);
26104      }
26105      if (element.hasType()) { 
26106        for (CodeableConcept e : element.getType()) 
26107          composeCodeableConcept("type", e);
26108      }
26109      if (element.hasPriority()) {
26110        composeCodeableConcept("priority", element.getPriority());
26111      }
26112      if (element.hasSubject()) {
26113        composeReference("subject", element.getSubject());
26114      }
26115      if (element.hasEpisodeOfCare()) { 
26116        for (Reference e : element.getEpisodeOfCare()) 
26117          composeReference("episodeOfCare", e);
26118      }
26119      if (element.hasIncomingReferral()) { 
26120        for (Reference e : element.getIncomingReferral()) 
26121          composeReference("incomingReferral", e);
26122      }
26123      if (element.hasParticipant()) { 
26124        for (Encounter.EncounterParticipantComponent e : element.getParticipant()) 
26125          composeEncounterEncounterParticipantComponent("participant", e);
26126      }
26127      if (element.hasAppointment()) {
26128        composeReference("appointment", element.getAppointment());
26129      }
26130      if (element.hasPeriod()) {
26131        composePeriod("period", element.getPeriod());
26132      }
26133      if (element.hasLength()) {
26134        composeDuration("length", element.getLength());
26135      }
26136      if (element.hasReason()) { 
26137        for (CodeableConcept e : element.getReason()) 
26138          composeCodeableConcept("reason", e);
26139      }
26140      if (element.hasDiagnosis()) { 
26141        for (Encounter.DiagnosisComponent e : element.getDiagnosis()) 
26142          composeEncounterDiagnosisComponent("diagnosis", e);
26143      }
26144      if (element.hasAccount()) { 
26145        for (Reference e : element.getAccount()) 
26146          composeReference("account", e);
26147      }
26148      if (element.hasHospitalization()) {
26149        composeEncounterEncounterHospitalizationComponent("hospitalization", element.getHospitalization());
26150      }
26151      if (element.hasLocation()) { 
26152        for (Encounter.EncounterLocationComponent e : element.getLocation()) 
26153          composeEncounterEncounterLocationComponent("location", e);
26154      }
26155      if (element.hasServiceProvider()) {
26156        composeReference("serviceProvider", element.getServiceProvider());
26157      }
26158      if (element.hasPartOf()) {
26159        composeReference("partOf", element.getPartOf());
26160      }
26161  }
26162
26163  protected void composeEncounterStatusHistoryComponent(String name, Encounter.StatusHistoryComponent element) throws IOException {
26164    if (element != null) {
26165      composeElementAttributes(element);
26166      xml.enter(FHIR_NS, name);
26167      composeEncounterStatusHistoryComponentElements(element);
26168      composeElementClose(element);
26169      xml.exit(FHIR_NS, name);
26170    }
26171  }
26172
26173  protected void composeEncounterStatusHistoryComponentElements(Encounter.StatusHistoryComponent element) throws IOException {
26174      composeBackboneElements(element);
26175      if (element.hasStatusElement())
26176        composeEnumeration("status", element.getStatusElement(), new Encounter.EncounterStatusEnumFactory());
26177      if (element.hasPeriod()) {
26178        composePeriod("period", element.getPeriod());
26179      }
26180  }
26181
26182  protected void composeEncounterClassHistoryComponent(String name, Encounter.ClassHistoryComponent element) throws IOException {
26183    if (element != null) {
26184      composeElementAttributes(element);
26185      xml.enter(FHIR_NS, name);
26186      composeEncounterClassHistoryComponentElements(element);
26187      composeElementClose(element);
26188      xml.exit(FHIR_NS, name);
26189    }
26190  }
26191
26192  protected void composeEncounterClassHistoryComponentElements(Encounter.ClassHistoryComponent element) throws IOException {
26193      composeBackboneElements(element);
26194      if (element.hasClass_()) {
26195        composeCoding("class", element.getClass_());
26196      }
26197      if (element.hasPeriod()) {
26198        composePeriod("period", element.getPeriod());
26199      }
26200  }
26201
26202  protected void composeEncounterEncounterParticipantComponent(String name, Encounter.EncounterParticipantComponent element) throws IOException {
26203    if (element != null) {
26204      composeElementAttributes(element);
26205      xml.enter(FHIR_NS, name);
26206      composeEncounterEncounterParticipantComponentElements(element);
26207      composeElementClose(element);
26208      xml.exit(FHIR_NS, name);
26209    }
26210  }
26211
26212  protected void composeEncounterEncounterParticipantComponentElements(Encounter.EncounterParticipantComponent element) throws IOException {
26213      composeBackboneElements(element);
26214      if (element.hasType()) { 
26215        for (CodeableConcept e : element.getType()) 
26216          composeCodeableConcept("type", e);
26217      }
26218      if (element.hasPeriod()) {
26219        composePeriod("period", element.getPeriod());
26220      }
26221      if (element.hasIndividual()) {
26222        composeReference("individual", element.getIndividual());
26223      }
26224  }
26225
26226  protected void composeEncounterDiagnosisComponent(String name, Encounter.DiagnosisComponent element) throws IOException {
26227    if (element != null) {
26228      composeElementAttributes(element);
26229      xml.enter(FHIR_NS, name);
26230      composeEncounterDiagnosisComponentElements(element);
26231      composeElementClose(element);
26232      xml.exit(FHIR_NS, name);
26233    }
26234  }
26235
26236  protected void composeEncounterDiagnosisComponentElements(Encounter.DiagnosisComponent element) throws IOException {
26237      composeBackboneElements(element);
26238      if (element.hasCondition()) {
26239        composeReference("condition", element.getCondition());
26240      }
26241      if (element.hasRole()) {
26242        composeCodeableConcept("role", element.getRole());
26243      }
26244      if (element.hasRankElement()) {
26245        composePositiveInt("rank", element.getRankElement());
26246      }
26247  }
26248
26249  protected void composeEncounterEncounterHospitalizationComponent(String name, Encounter.EncounterHospitalizationComponent element) throws IOException {
26250    if (element != null) {
26251      composeElementAttributes(element);
26252      xml.enter(FHIR_NS, name);
26253      composeEncounterEncounterHospitalizationComponentElements(element);
26254      composeElementClose(element);
26255      xml.exit(FHIR_NS, name);
26256    }
26257  }
26258
26259  protected void composeEncounterEncounterHospitalizationComponentElements(Encounter.EncounterHospitalizationComponent element) throws IOException {
26260      composeBackboneElements(element);
26261      if (element.hasPreAdmissionIdentifier()) {
26262        composeIdentifier("preAdmissionIdentifier", element.getPreAdmissionIdentifier());
26263      }
26264      if (element.hasOrigin()) {
26265        composeReference("origin", element.getOrigin());
26266      }
26267      if (element.hasAdmitSource()) {
26268        composeCodeableConcept("admitSource", element.getAdmitSource());
26269      }
26270      if (element.hasReAdmission()) {
26271        composeCodeableConcept("reAdmission", element.getReAdmission());
26272      }
26273      if (element.hasDietPreference()) { 
26274        for (CodeableConcept e : element.getDietPreference()) 
26275          composeCodeableConcept("dietPreference", e);
26276      }
26277      if (element.hasSpecialCourtesy()) { 
26278        for (CodeableConcept e : element.getSpecialCourtesy()) 
26279          composeCodeableConcept("specialCourtesy", e);
26280      }
26281      if (element.hasSpecialArrangement()) { 
26282        for (CodeableConcept e : element.getSpecialArrangement()) 
26283          composeCodeableConcept("specialArrangement", e);
26284      }
26285      if (element.hasDestination()) {
26286        composeReference("destination", element.getDestination());
26287      }
26288      if (element.hasDischargeDisposition()) {
26289        composeCodeableConcept("dischargeDisposition", element.getDischargeDisposition());
26290      }
26291  }
26292
26293  protected void composeEncounterEncounterLocationComponent(String name, Encounter.EncounterLocationComponent element) throws IOException {
26294    if (element != null) {
26295      composeElementAttributes(element);
26296      xml.enter(FHIR_NS, name);
26297      composeEncounterEncounterLocationComponentElements(element);
26298      composeElementClose(element);
26299      xml.exit(FHIR_NS, name);
26300    }
26301  }
26302
26303  protected void composeEncounterEncounterLocationComponentElements(Encounter.EncounterLocationComponent element) throws IOException {
26304      composeBackboneElements(element);
26305      if (element.hasLocation()) {
26306        composeReference("location", element.getLocation());
26307      }
26308      if (element.hasStatusElement())
26309        composeEnumeration("status", element.getStatusElement(), new Encounter.EncounterLocationStatusEnumFactory());
26310      if (element.hasPeriod()) {
26311        composePeriod("period", element.getPeriod());
26312      }
26313  }
26314
26315  protected void composeEndpoint(String name, Endpoint element) throws IOException {
26316    if (element != null) {
26317      composeDomainResourceAttributes(element);
26318      xml.enter(FHIR_NS, name);
26319      composeEndpointElements(element);
26320      composeElementClose(element);
26321      xml.exit(FHIR_NS, name);
26322    }
26323  }
26324
26325  protected void composeEndpointElements(Endpoint element) throws IOException {
26326      composeDomainResourceElements(element);
26327      if (element.hasIdentifier()) { 
26328        for (Identifier e : element.getIdentifier()) 
26329          composeIdentifier("identifier", e);
26330      }
26331      if (element.hasStatusElement())
26332        composeEnumeration("status", element.getStatusElement(), new Endpoint.EndpointStatusEnumFactory());
26333      if (element.hasConnectionType()) {
26334        composeCoding("connectionType", element.getConnectionType());
26335      }
26336      if (element.hasNameElement()) {
26337        composeString("name", element.getNameElement());
26338      }
26339      if (element.hasManagingOrganization()) {
26340        composeReference("managingOrganization", element.getManagingOrganization());
26341      }
26342      if (element.hasContact()) { 
26343        for (ContactPoint e : element.getContact()) 
26344          composeContactPoint("contact", e);
26345      }
26346      if (element.hasPeriod()) {
26347        composePeriod("period", element.getPeriod());
26348      }
26349      if (element.hasPayloadType()) { 
26350        for (CodeableConcept e : element.getPayloadType()) 
26351          composeCodeableConcept("payloadType", e);
26352      }
26353      if (element.hasPayloadMimeType()) { 
26354        for (CodeType e : element.getPayloadMimeType()) 
26355          composeCode("payloadMimeType", e);
26356      }
26357      if (element.hasAddressElement()) {
26358        composeUri("address", element.getAddressElement());
26359      }
26360      if (element.hasHeader()) { 
26361        for (StringType e : element.getHeader()) 
26362          composeString("header", e);
26363      }
26364  }
26365
26366  protected void composeEnrollmentRequest(String name, EnrollmentRequest element) throws IOException {
26367    if (element != null) {
26368      composeDomainResourceAttributes(element);
26369      xml.enter(FHIR_NS, name);
26370      composeEnrollmentRequestElements(element);
26371      composeElementClose(element);
26372      xml.exit(FHIR_NS, name);
26373    }
26374  }
26375
26376  protected void composeEnrollmentRequestElements(EnrollmentRequest element) throws IOException {
26377      composeDomainResourceElements(element);
26378      if (element.hasIdentifier()) { 
26379        for (Identifier e : element.getIdentifier()) 
26380          composeIdentifier("identifier", e);
26381      }
26382      if (element.hasStatusElement())
26383        composeEnumeration("status", element.getStatusElement(), new EnrollmentRequest.EnrollmentRequestStatusEnumFactory());
26384      if (element.hasCreatedElement()) {
26385        composeDateTime("created", element.getCreatedElement());
26386      }
26387      if (element.hasInsurer()) {
26388        composeReference("insurer", element.getInsurer());
26389      }
26390      if (element.hasProvider()) {
26391        composeReference("provider", element.getProvider());
26392      }
26393      if (element.hasOrganization()) {
26394        composeReference("organization", element.getOrganization());
26395      }
26396      if (element.hasSubject()) {
26397        composeReference("subject", element.getSubject());
26398      }
26399      if (element.hasCoverage()) {
26400        composeReference("coverage", element.getCoverage());
26401      }
26402  }
26403
26404  protected void composeEnrollmentResponse(String name, EnrollmentResponse element) throws IOException {
26405    if (element != null) {
26406      composeDomainResourceAttributes(element);
26407      xml.enter(FHIR_NS, name);
26408      composeEnrollmentResponseElements(element);
26409      composeElementClose(element);
26410      xml.exit(FHIR_NS, name);
26411    }
26412  }
26413
26414  protected void composeEnrollmentResponseElements(EnrollmentResponse element) throws IOException {
26415      composeDomainResourceElements(element);
26416      if (element.hasIdentifier()) { 
26417        for (Identifier e : element.getIdentifier()) 
26418          composeIdentifier("identifier", e);
26419      }
26420      if (element.hasStatusElement())
26421        composeEnumeration("status", element.getStatusElement(), new EnrollmentResponse.EnrollmentResponseStatusEnumFactory());
26422      if (element.hasRequest()) {
26423        composeReference("request", element.getRequest());
26424      }
26425      if (element.hasOutcome()) {
26426        composeCodeableConcept("outcome", element.getOutcome());
26427      }
26428      if (element.hasDispositionElement()) {
26429        composeString("disposition", element.getDispositionElement());
26430      }
26431      if (element.hasCreatedElement()) {
26432        composeDateTime("created", element.getCreatedElement());
26433      }
26434      if (element.hasOrganization()) {
26435        composeReference("organization", element.getOrganization());
26436      }
26437      if (element.hasRequestProvider()) {
26438        composeReference("requestProvider", element.getRequestProvider());
26439      }
26440      if (element.hasRequestOrganization()) {
26441        composeReference("requestOrganization", element.getRequestOrganization());
26442      }
26443  }
26444
26445  protected void composeEpisodeOfCare(String name, EpisodeOfCare element) throws IOException {
26446    if (element != null) {
26447      composeDomainResourceAttributes(element);
26448      xml.enter(FHIR_NS, name);
26449      composeEpisodeOfCareElements(element);
26450      composeElementClose(element);
26451      xml.exit(FHIR_NS, name);
26452    }
26453  }
26454
26455  protected void composeEpisodeOfCareElements(EpisodeOfCare element) throws IOException {
26456      composeDomainResourceElements(element);
26457      if (element.hasIdentifier()) { 
26458        for (Identifier e : element.getIdentifier()) 
26459          composeIdentifier("identifier", e);
26460      }
26461      if (element.hasStatusElement())
26462        composeEnumeration("status", element.getStatusElement(), new EpisodeOfCare.EpisodeOfCareStatusEnumFactory());
26463      if (element.hasStatusHistory()) { 
26464        for (EpisodeOfCare.EpisodeOfCareStatusHistoryComponent e : element.getStatusHistory()) 
26465          composeEpisodeOfCareEpisodeOfCareStatusHistoryComponent("statusHistory", e);
26466      }
26467      if (element.hasType()) { 
26468        for (CodeableConcept e : element.getType()) 
26469          composeCodeableConcept("type", e);
26470      }
26471      if (element.hasDiagnosis()) { 
26472        for (EpisodeOfCare.DiagnosisComponent e : element.getDiagnosis()) 
26473          composeEpisodeOfCareDiagnosisComponent("diagnosis", e);
26474      }
26475      if (element.hasPatient()) {
26476        composeReference("patient", element.getPatient());
26477      }
26478      if (element.hasManagingOrganization()) {
26479        composeReference("managingOrganization", element.getManagingOrganization());
26480      }
26481      if (element.hasPeriod()) {
26482        composePeriod("period", element.getPeriod());
26483      }
26484      if (element.hasReferralRequest()) { 
26485        for (Reference e : element.getReferralRequest()) 
26486          composeReference("referralRequest", e);
26487      }
26488      if (element.hasCareManager()) {
26489        composeReference("careManager", element.getCareManager());
26490      }
26491      if (element.hasTeam()) { 
26492        for (Reference e : element.getTeam()) 
26493          composeReference("team", e);
26494      }
26495      if (element.hasAccount()) { 
26496        for (Reference e : element.getAccount()) 
26497          composeReference("account", e);
26498      }
26499  }
26500
26501  protected void composeEpisodeOfCareEpisodeOfCareStatusHistoryComponent(String name, EpisodeOfCare.EpisodeOfCareStatusHistoryComponent element) throws IOException {
26502    if (element != null) {
26503      composeElementAttributes(element);
26504      xml.enter(FHIR_NS, name);
26505      composeEpisodeOfCareEpisodeOfCareStatusHistoryComponentElements(element);
26506      composeElementClose(element);
26507      xml.exit(FHIR_NS, name);
26508    }
26509  }
26510
26511  protected void composeEpisodeOfCareEpisodeOfCareStatusHistoryComponentElements(EpisodeOfCare.EpisodeOfCareStatusHistoryComponent element) throws IOException {
26512      composeBackboneElements(element);
26513      if (element.hasStatusElement())
26514        composeEnumeration("status", element.getStatusElement(), new EpisodeOfCare.EpisodeOfCareStatusEnumFactory());
26515      if (element.hasPeriod()) {
26516        composePeriod("period", element.getPeriod());
26517      }
26518  }
26519
26520  protected void composeEpisodeOfCareDiagnosisComponent(String name, EpisodeOfCare.DiagnosisComponent element) throws IOException {
26521    if (element != null) {
26522      composeElementAttributes(element);
26523      xml.enter(FHIR_NS, name);
26524      composeEpisodeOfCareDiagnosisComponentElements(element);
26525      composeElementClose(element);
26526      xml.exit(FHIR_NS, name);
26527    }
26528  }
26529
26530  protected void composeEpisodeOfCareDiagnosisComponentElements(EpisodeOfCare.DiagnosisComponent element) throws IOException {
26531      composeBackboneElements(element);
26532      if (element.hasCondition()) {
26533        composeReference("condition", element.getCondition());
26534      }
26535      if (element.hasRole()) {
26536        composeCodeableConcept("role", element.getRole());
26537      }
26538      if (element.hasRankElement()) {
26539        composePositiveInt("rank", element.getRankElement());
26540      }
26541  }
26542
26543  protected void composeExpansionProfile(String name, ExpansionProfile element) throws IOException {
26544    if (element != null) {
26545      composeDomainResourceAttributes(element);
26546      xml.enter(FHIR_NS, name);
26547      composeExpansionProfileElements(element);
26548      composeElementClose(element);
26549      xml.exit(FHIR_NS, name);
26550    }
26551  }
26552
26553  protected void composeExpansionProfileElements(ExpansionProfile element) throws IOException {
26554      composeDomainResourceElements(element);
26555      if (element.hasUrlElement()) {
26556        composeUri("url", element.getUrlElement());
26557      }
26558      if (element.hasIdentifier()) {
26559        composeIdentifier("identifier", element.getIdentifier());
26560      }
26561      if (element.hasVersionElement()) {
26562        composeString("version", element.getVersionElement());
26563      }
26564      if (element.hasNameElement()) {
26565        composeString("name", element.getNameElement());
26566      }
26567      if (element.hasStatusElement())
26568        composeEnumeration("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory());
26569      if (element.hasExperimentalElement()) {
26570        composeBoolean("experimental", element.getExperimentalElement());
26571      }
26572      if (element.hasDateElement()) {
26573        composeDateTime("date", element.getDateElement());
26574      }
26575      if (element.hasPublisherElement()) {
26576        composeString("publisher", element.getPublisherElement());
26577      }
26578      if (element.hasContact()) { 
26579        for (ContactDetail e : element.getContact()) 
26580          composeContactDetail("contact", e);
26581      }
26582      if (element.hasDescriptionElement()) {
26583        composeMarkdown("description", element.getDescriptionElement());
26584      }
26585      if (element.hasUseContext()) { 
26586        for (UsageContext e : element.getUseContext()) 
26587          composeUsageContext("useContext", e);
26588      }
26589      if (element.hasJurisdiction()) { 
26590        for (CodeableConcept e : element.getJurisdiction()) 
26591          composeCodeableConcept("jurisdiction", e);
26592      }
26593      if (element.hasFixedVersion()) { 
26594        for (ExpansionProfile.ExpansionProfileFixedVersionComponent e : element.getFixedVersion()) 
26595          composeExpansionProfileExpansionProfileFixedVersionComponent("fixedVersion", e);
26596      }
26597      if (element.hasExcludedSystem()) {
26598        composeExpansionProfileExpansionProfileExcludedSystemComponent("excludedSystem", element.getExcludedSystem());
26599      }
26600      if (element.hasIncludeDesignationsElement()) {
26601        composeBoolean("includeDesignations", element.getIncludeDesignationsElement());
26602      }
26603      if (element.hasDesignation()) {
26604        composeExpansionProfileExpansionProfileDesignationComponent("designation", element.getDesignation());
26605      }
26606      if (element.hasIncludeDefinitionElement()) {
26607        composeBoolean("includeDefinition", element.getIncludeDefinitionElement());
26608      }
26609      if (element.hasActiveOnlyElement()) {
26610        composeBoolean("activeOnly", element.getActiveOnlyElement());
26611      }
26612      if (element.hasExcludeNestedElement()) {
26613        composeBoolean("excludeNested", element.getExcludeNestedElement());
26614      }
26615      if (element.hasExcludeNotForUIElement()) {
26616        composeBoolean("excludeNotForUI", element.getExcludeNotForUIElement());
26617      }
26618      if (element.hasExcludePostCoordinatedElement()) {
26619        composeBoolean("excludePostCoordinated", element.getExcludePostCoordinatedElement());
26620      }
26621      if (element.hasDisplayLanguageElement()) {
26622        composeCode("displayLanguage", element.getDisplayLanguageElement());
26623      }
26624      if (element.hasLimitedExpansionElement()) {
26625        composeBoolean("limitedExpansion", element.getLimitedExpansionElement());
26626      }
26627  }
26628
26629  protected void composeExpansionProfileExpansionProfileFixedVersionComponent(String name, ExpansionProfile.ExpansionProfileFixedVersionComponent element) throws IOException {
26630    if (element != null) {
26631      composeElementAttributes(element);
26632      xml.enter(FHIR_NS, name);
26633      composeExpansionProfileExpansionProfileFixedVersionComponentElements(element);
26634      composeElementClose(element);
26635      xml.exit(FHIR_NS, name);
26636    }
26637  }
26638
26639  protected void composeExpansionProfileExpansionProfileFixedVersionComponentElements(ExpansionProfile.ExpansionProfileFixedVersionComponent element) throws IOException {
26640      composeBackboneElements(element);
26641      if (element.hasSystemElement()) {
26642        composeUri("system", element.getSystemElement());
26643      }
26644      if (element.hasVersionElement()) {
26645        composeString("version", element.getVersionElement());
26646      }
26647      if (element.hasModeElement())
26648        composeEnumeration("mode", element.getModeElement(), new ExpansionProfile.SystemVersionProcessingModeEnumFactory());
26649  }
26650
26651  protected void composeExpansionProfileExpansionProfileExcludedSystemComponent(String name, ExpansionProfile.ExpansionProfileExcludedSystemComponent element) throws IOException {
26652    if (element != null) {
26653      composeElementAttributes(element);
26654      xml.enter(FHIR_NS, name);
26655      composeExpansionProfileExpansionProfileExcludedSystemComponentElements(element);
26656      composeElementClose(element);
26657      xml.exit(FHIR_NS, name);
26658    }
26659  }
26660
26661  protected void composeExpansionProfileExpansionProfileExcludedSystemComponentElements(ExpansionProfile.ExpansionProfileExcludedSystemComponent element) throws IOException {
26662      composeBackboneElements(element);
26663      if (element.hasSystemElement()) {
26664        composeUri("system", element.getSystemElement());
26665      }
26666      if (element.hasVersionElement()) {
26667        composeString("version", element.getVersionElement());
26668      }
26669  }
26670
26671  protected void composeExpansionProfileExpansionProfileDesignationComponent(String name, ExpansionProfile.ExpansionProfileDesignationComponent element) throws IOException {
26672    if (element != null) {
26673      composeElementAttributes(element);
26674      xml.enter(FHIR_NS, name);
26675      composeExpansionProfileExpansionProfileDesignationComponentElements(element);
26676      composeElementClose(element);
26677      xml.exit(FHIR_NS, name);
26678    }
26679  }
26680
26681  protected void composeExpansionProfileExpansionProfileDesignationComponentElements(ExpansionProfile.ExpansionProfileDesignationComponent element) throws IOException {
26682      composeBackboneElements(element);
26683      if (element.hasInclude()) {
26684        composeExpansionProfileDesignationIncludeComponent("include", element.getInclude());
26685      }
26686      if (element.hasExclude()) {
26687        composeExpansionProfileDesignationExcludeComponent("exclude", element.getExclude());
26688      }
26689  }
26690
26691  protected void composeExpansionProfileDesignationIncludeComponent(String name, ExpansionProfile.DesignationIncludeComponent element) throws IOException {
26692    if (element != null) {
26693      composeElementAttributes(element);
26694      xml.enter(FHIR_NS, name);
26695      composeExpansionProfileDesignationIncludeComponentElements(element);
26696      composeElementClose(element);
26697      xml.exit(FHIR_NS, name);
26698    }
26699  }
26700
26701  protected void composeExpansionProfileDesignationIncludeComponentElements(ExpansionProfile.DesignationIncludeComponent element) throws IOException {
26702      composeBackboneElements(element);
26703      if (element.hasDesignation()) { 
26704        for (ExpansionProfile.DesignationIncludeDesignationComponent e : element.getDesignation()) 
26705          composeExpansionProfileDesignationIncludeDesignationComponent("designation", e);
26706      }
26707  }
26708
26709  protected void composeExpansionProfileDesignationIncludeDesignationComponent(String name, ExpansionProfile.DesignationIncludeDesignationComponent element) throws IOException {
26710    if (element != null) {
26711      composeElementAttributes(element);
26712      xml.enter(FHIR_NS, name);
26713      composeExpansionProfileDesignationIncludeDesignationComponentElements(element);
26714      composeElementClose(element);
26715      xml.exit(FHIR_NS, name);
26716    }
26717  }
26718
26719  protected void composeExpansionProfileDesignationIncludeDesignationComponentElements(ExpansionProfile.DesignationIncludeDesignationComponent element) throws IOException {
26720      composeBackboneElements(element);
26721      if (element.hasLanguageElement()) {
26722        composeCode("language", element.getLanguageElement());
26723      }
26724      if (element.hasUse()) {
26725        composeCoding("use", element.getUse());
26726      }
26727  }
26728
26729  protected void composeExpansionProfileDesignationExcludeComponent(String name, ExpansionProfile.DesignationExcludeComponent element) throws IOException {
26730    if (element != null) {
26731      composeElementAttributes(element);
26732      xml.enter(FHIR_NS, name);
26733      composeExpansionProfileDesignationExcludeComponentElements(element);
26734      composeElementClose(element);
26735      xml.exit(FHIR_NS, name);
26736    }
26737  }
26738
26739  protected void composeExpansionProfileDesignationExcludeComponentElements(ExpansionProfile.DesignationExcludeComponent element) throws IOException {
26740      composeBackboneElements(element);
26741      if (element.hasDesignation()) { 
26742        for (ExpansionProfile.DesignationExcludeDesignationComponent e : element.getDesignation()) 
26743          composeExpansionProfileDesignationExcludeDesignationComponent("designation", e);
26744      }
26745  }
26746
26747  protected void composeExpansionProfileDesignationExcludeDesignationComponent(String name, ExpansionProfile.DesignationExcludeDesignationComponent element) throws IOException {
26748    if (element != null) {
26749      composeElementAttributes(element);
26750      xml.enter(FHIR_NS, name);
26751      composeExpansionProfileDesignationExcludeDesignationComponentElements(element);
26752      composeElementClose(element);
26753      xml.exit(FHIR_NS, name);
26754    }
26755  }
26756
26757  protected void composeExpansionProfileDesignationExcludeDesignationComponentElements(ExpansionProfile.DesignationExcludeDesignationComponent element) throws IOException {
26758      composeBackboneElements(element);
26759      if (element.hasLanguageElement()) {
26760        composeCode("language", element.getLanguageElement());
26761      }
26762      if (element.hasUse()) {
26763        composeCoding("use", element.getUse());
26764      }
26765  }
26766
26767  protected void composeExplanationOfBenefit(String name, ExplanationOfBenefit element) throws IOException {
26768    if (element != null) {
26769      composeDomainResourceAttributes(element);
26770      xml.enter(FHIR_NS, name);
26771      composeExplanationOfBenefitElements(element);
26772      composeElementClose(element);
26773      xml.exit(FHIR_NS, name);
26774    }
26775  }
26776
26777  protected void composeExplanationOfBenefitElements(ExplanationOfBenefit element) throws IOException {
26778      composeDomainResourceElements(element);
26779      if (element.hasIdentifier()) { 
26780        for (Identifier e : element.getIdentifier()) 
26781          composeIdentifier("identifier", e);
26782      }
26783      if (element.hasStatusElement())
26784        composeEnumeration("status", element.getStatusElement(), new ExplanationOfBenefit.ExplanationOfBenefitStatusEnumFactory());
26785      if (element.hasType()) {
26786        composeCodeableConcept("type", element.getType());
26787      }
26788      if (element.hasSubType()) { 
26789        for (CodeableConcept e : element.getSubType()) 
26790          composeCodeableConcept("subType", e);
26791      }
26792      if (element.hasPatient()) {
26793        composeReference("patient", element.getPatient());
26794      }
26795      if (element.hasBillablePeriod()) {
26796        composePeriod("billablePeriod", element.getBillablePeriod());
26797      }
26798      if (element.hasCreatedElement()) {
26799        composeDateTime("created", element.getCreatedElement());
26800      }
26801      if (element.hasEnterer()) {
26802        composeReference("enterer", element.getEnterer());
26803      }
26804      if (element.hasInsurer()) {
26805        composeReference("insurer", element.getInsurer());
26806      }
26807      if (element.hasProvider()) {
26808        composeReference("provider", element.getProvider());
26809      }
26810      if (element.hasOrganization()) {
26811        composeReference("organization", element.getOrganization());
26812      }
26813      if (element.hasReferral()) {
26814        composeReference("referral", element.getReferral());
26815      }
26816      if (element.hasFacility()) {
26817        composeReference("facility", element.getFacility());
26818      }
26819      if (element.hasClaim()) {
26820        composeReference("claim", element.getClaim());
26821      }
26822      if (element.hasClaimResponse()) {
26823        composeReference("claimResponse", element.getClaimResponse());
26824      }
26825      if (element.hasOutcome()) {
26826        composeCodeableConcept("outcome", element.getOutcome());
26827      }
26828      if (element.hasDispositionElement()) {
26829        composeString("disposition", element.getDispositionElement());
26830      }
26831      if (element.hasRelated()) { 
26832        for (ExplanationOfBenefit.RelatedClaimComponent e : element.getRelated()) 
26833          composeExplanationOfBenefitRelatedClaimComponent("related", e);
26834      }
26835      if (element.hasPrescription()) {
26836        composeReference("prescription", element.getPrescription());
26837      }
26838      if (element.hasOriginalPrescription()) {
26839        composeReference("originalPrescription", element.getOriginalPrescription());
26840      }
26841      if (element.hasPayee()) {
26842        composeExplanationOfBenefitPayeeComponent("payee", element.getPayee());
26843      }
26844      if (element.hasInformation()) { 
26845        for (ExplanationOfBenefit.SupportingInformationComponent e : element.getInformation()) 
26846          composeExplanationOfBenefitSupportingInformationComponent("information", e);
26847      }
26848      if (element.hasCareTeam()) { 
26849        for (ExplanationOfBenefit.CareTeamComponent e : element.getCareTeam()) 
26850          composeExplanationOfBenefitCareTeamComponent("careTeam", e);
26851      }
26852      if (element.hasDiagnosis()) { 
26853        for (ExplanationOfBenefit.DiagnosisComponent e : element.getDiagnosis()) 
26854          composeExplanationOfBenefitDiagnosisComponent("diagnosis", e);
26855      }
26856      if (element.hasProcedure()) { 
26857        for (ExplanationOfBenefit.ProcedureComponent e : element.getProcedure()) 
26858          composeExplanationOfBenefitProcedureComponent("procedure", e);
26859      }
26860      if (element.hasPrecedenceElement()) {
26861        composePositiveInt("precedence", element.getPrecedenceElement());
26862      }
26863      if (element.hasInsurance()) {
26864        composeExplanationOfBenefitInsuranceComponent("insurance", element.getInsurance());
26865      }
26866      if (element.hasAccident()) {
26867        composeExplanationOfBenefitAccidentComponent("accident", element.getAccident());
26868      }
26869      if (element.hasEmploymentImpacted()) {
26870        composePeriod("employmentImpacted", element.getEmploymentImpacted());
26871      }
26872      if (element.hasHospitalization()) {
26873        composePeriod("hospitalization", element.getHospitalization());
26874      }
26875      if (element.hasItem()) { 
26876        for (ExplanationOfBenefit.ItemComponent e : element.getItem()) 
26877          composeExplanationOfBenefitItemComponent("item", e);
26878      }
26879      if (element.hasAddItem()) { 
26880        for (ExplanationOfBenefit.AddedItemComponent e : element.getAddItem()) 
26881          composeExplanationOfBenefitAddedItemComponent("addItem", e);
26882      }
26883      if (element.hasTotalCost()) {
26884        composeMoney("totalCost", element.getTotalCost());
26885      }
26886      if (element.hasUnallocDeductable()) {
26887        composeMoney("unallocDeductable", element.getUnallocDeductable());
26888      }
26889      if (element.hasTotalBenefit()) {
26890        composeMoney("totalBenefit", element.getTotalBenefit());
26891      }
26892      if (element.hasPayment()) {
26893        composeExplanationOfBenefitPaymentComponent("payment", element.getPayment());
26894      }
26895      if (element.hasForm()) {
26896        composeCodeableConcept("form", element.getForm());
26897      }
26898      if (element.hasProcessNote()) { 
26899        for (ExplanationOfBenefit.NoteComponent e : element.getProcessNote()) 
26900          composeExplanationOfBenefitNoteComponent("processNote", e);
26901      }
26902      if (element.hasBenefitBalance()) { 
26903        for (ExplanationOfBenefit.BenefitBalanceComponent e : element.getBenefitBalance()) 
26904          composeExplanationOfBenefitBenefitBalanceComponent("benefitBalance", e);
26905      }
26906  }
26907
26908  protected void composeExplanationOfBenefitRelatedClaimComponent(String name, ExplanationOfBenefit.RelatedClaimComponent element) throws IOException {
26909    if (element != null) {
26910      composeElementAttributes(element);
26911      xml.enter(FHIR_NS, name);
26912      composeExplanationOfBenefitRelatedClaimComponentElements(element);
26913      composeElementClose(element);
26914      xml.exit(FHIR_NS, name);
26915    }
26916  }
26917
26918  protected void composeExplanationOfBenefitRelatedClaimComponentElements(ExplanationOfBenefit.RelatedClaimComponent element) throws IOException {
26919      composeBackboneElements(element);
26920      if (element.hasClaim()) {
26921        composeReference("claim", element.getClaim());
26922      }
26923      if (element.hasRelationship()) {
26924        composeCodeableConcept("relationship", element.getRelationship());
26925      }
26926      if (element.hasReference()) {
26927        composeIdentifier("reference", element.getReference());
26928      }
26929  }
26930
26931  protected void composeExplanationOfBenefitPayeeComponent(String name, ExplanationOfBenefit.PayeeComponent element) throws IOException {
26932    if (element != null) {
26933      composeElementAttributes(element);
26934      xml.enter(FHIR_NS, name);
26935      composeExplanationOfBenefitPayeeComponentElements(element);
26936      composeElementClose(element);
26937      xml.exit(FHIR_NS, name);
26938    }
26939  }
26940
26941  protected void composeExplanationOfBenefitPayeeComponentElements(ExplanationOfBenefit.PayeeComponent element) throws IOException {
26942      composeBackboneElements(element);
26943      if (element.hasType()) {
26944        composeCodeableConcept("type", element.getType());
26945      }
26946      if (element.hasResourceType()) {
26947        composeCodeableConcept("resourceType", element.getResourceType());
26948      }
26949      if (element.hasParty()) {
26950        composeReference("party", element.getParty());
26951      }
26952  }
26953
26954  protected void composeExplanationOfBenefitSupportingInformationComponent(String name, ExplanationOfBenefit.SupportingInformationComponent element) throws IOException {
26955    if (element != null) {
26956      composeElementAttributes(element);
26957      xml.enter(FHIR_NS, name);
26958      composeExplanationOfBenefitSupportingInformationComponentElements(element);
26959      composeElementClose(element);
26960      xml.exit(FHIR_NS, name);
26961    }
26962  }
26963
26964  protected void composeExplanationOfBenefitSupportingInformationComponentElements(ExplanationOfBenefit.SupportingInformationComponent element) throws IOException {
26965      composeBackboneElements(element);
26966      if (element.hasSequenceElement()) {
26967        composePositiveInt("sequence", element.getSequenceElement());
26968      }
26969      if (element.hasCategory()) {
26970        composeCodeableConcept("category", element.getCategory());
26971      }
26972      if (element.hasCode()) {
26973        composeCodeableConcept("code", element.getCode());
26974      }
26975      if (element.hasTiming()) {
26976        composeType("timing", element.getTiming());
26977      }      if (element.hasValue()) {
26978        composeType("value", element.getValue());
26979      }      if (element.hasReason()) {
26980        composeCoding("reason", element.getReason());
26981      }
26982  }
26983
26984  protected void composeExplanationOfBenefitCareTeamComponent(String name, ExplanationOfBenefit.CareTeamComponent element) throws IOException {
26985    if (element != null) {
26986      composeElementAttributes(element);
26987      xml.enter(FHIR_NS, name);
26988      composeExplanationOfBenefitCareTeamComponentElements(element);
26989      composeElementClose(element);
26990      xml.exit(FHIR_NS, name);
26991    }
26992  }
26993
26994  protected void composeExplanationOfBenefitCareTeamComponentElements(ExplanationOfBenefit.CareTeamComponent element) throws IOException {
26995      composeBackboneElements(element);
26996      if (element.hasSequenceElement()) {
26997        composePositiveInt("sequence", element.getSequenceElement());
26998      }
26999      if (element.hasProvider()) {
27000        composeReference("provider", element.getProvider());
27001      }
27002      if (element.hasResponsibleElement()) {
27003        composeBoolean("responsible", element.getResponsibleElement());
27004      }
27005      if (element.hasRole()) {
27006        composeCodeableConcept("role", element.getRole());
27007      }
27008      if (element.hasQualification()) {
27009        composeCodeableConcept("qualification", element.getQualification());
27010      }
27011  }
27012
27013  protected void composeExplanationOfBenefitDiagnosisComponent(String name, ExplanationOfBenefit.DiagnosisComponent element) throws IOException {
27014    if (element != null) {
27015      composeElementAttributes(element);
27016      xml.enter(FHIR_NS, name);
27017      composeExplanationOfBenefitDiagnosisComponentElements(element);
27018      composeElementClose(element);
27019      xml.exit(FHIR_NS, name);
27020    }
27021  }
27022
27023  protected void composeExplanationOfBenefitDiagnosisComponentElements(ExplanationOfBenefit.DiagnosisComponent element) throws IOException {
27024      composeBackboneElements(element);
27025      if (element.hasSequenceElement()) {
27026        composePositiveInt("sequence", element.getSequenceElement());
27027      }
27028      if (element.hasDiagnosis()) {
27029        composeType("diagnosis", element.getDiagnosis());
27030      }      if (element.hasType()) { 
27031        for (CodeableConcept e : element.getType()) 
27032          composeCodeableConcept("type", e);
27033      }
27034      if (element.hasPackageCode()) {
27035        composeCodeableConcept("packageCode", element.getPackageCode());
27036      }
27037  }
27038
27039  protected void composeExplanationOfBenefitProcedureComponent(String name, ExplanationOfBenefit.ProcedureComponent element) throws IOException {
27040    if (element != null) {
27041      composeElementAttributes(element);
27042      xml.enter(FHIR_NS, name);
27043      composeExplanationOfBenefitProcedureComponentElements(element);
27044      composeElementClose(element);
27045      xml.exit(FHIR_NS, name);
27046    }
27047  }
27048
27049  protected void composeExplanationOfBenefitProcedureComponentElements(ExplanationOfBenefit.ProcedureComponent element) throws IOException {
27050      composeBackboneElements(element);
27051      if (element.hasSequenceElement()) {
27052        composePositiveInt("sequence", element.getSequenceElement());
27053      }
27054      if (element.hasDateElement()) {
27055        composeDateTime("date", element.getDateElement());
27056      }
27057      if (element.hasProcedure()) {
27058        composeType("procedure", element.getProcedure());
27059      }  }
27060
27061  protected void composeExplanationOfBenefitInsuranceComponent(String name, ExplanationOfBenefit.InsuranceComponent element) throws IOException {
27062    if (element != null) {
27063      composeElementAttributes(element);
27064      xml.enter(FHIR_NS, name);
27065      composeExplanationOfBenefitInsuranceComponentElements(element);
27066      composeElementClose(element);
27067      xml.exit(FHIR_NS, name);
27068    }
27069  }
27070
27071  protected void composeExplanationOfBenefitInsuranceComponentElements(ExplanationOfBenefit.InsuranceComponent element) throws IOException {
27072      composeBackboneElements(element);
27073      if (element.hasCoverage()) {
27074        composeReference("coverage", element.getCoverage());
27075      }
27076      if (element.hasPreAuthRef()) { 
27077        for (StringType e : element.getPreAuthRef()) 
27078          composeString("preAuthRef", e);
27079      }
27080  }
27081
27082  protected void composeExplanationOfBenefitAccidentComponent(String name, ExplanationOfBenefit.AccidentComponent element) throws IOException {
27083    if (element != null) {
27084      composeElementAttributes(element);
27085      xml.enter(FHIR_NS, name);
27086      composeExplanationOfBenefitAccidentComponentElements(element);
27087      composeElementClose(element);
27088      xml.exit(FHIR_NS, name);
27089    }
27090  }
27091
27092  protected void composeExplanationOfBenefitAccidentComponentElements(ExplanationOfBenefit.AccidentComponent element) throws IOException {
27093      composeBackboneElements(element);
27094      if (element.hasDateElement()) {
27095        composeDate("date", element.getDateElement());
27096      }
27097      if (element.hasType()) {
27098        composeCodeableConcept("type", element.getType());
27099      }
27100      if (element.hasLocation()) {
27101        composeType("location", element.getLocation());
27102      }  }
27103
27104  protected void composeExplanationOfBenefitItemComponent(String name, ExplanationOfBenefit.ItemComponent element) throws IOException {
27105    if (element != null) {
27106      composeElementAttributes(element);
27107      xml.enter(FHIR_NS, name);
27108      composeExplanationOfBenefitItemComponentElements(element);
27109      composeElementClose(element);
27110      xml.exit(FHIR_NS, name);
27111    }
27112  }
27113
27114  protected void composeExplanationOfBenefitItemComponentElements(ExplanationOfBenefit.ItemComponent element) throws IOException {
27115      composeBackboneElements(element);
27116      if (element.hasSequenceElement()) {
27117        composePositiveInt("sequence", element.getSequenceElement());
27118      }
27119      if (element.hasCareTeamLinkId()) { 
27120        for (PositiveIntType e : element.getCareTeamLinkId()) 
27121          composePositiveInt("careTeamLinkId", e);
27122      }
27123      if (element.hasDiagnosisLinkId()) { 
27124        for (PositiveIntType e : element.getDiagnosisLinkId()) 
27125          composePositiveInt("diagnosisLinkId", e);
27126      }
27127      if (element.hasProcedureLinkId()) { 
27128        for (PositiveIntType e : element.getProcedureLinkId()) 
27129          composePositiveInt("procedureLinkId", e);
27130      }
27131      if (element.hasInformationLinkId()) { 
27132        for (PositiveIntType e : element.getInformationLinkId()) 
27133          composePositiveInt("informationLinkId", e);
27134      }
27135      if (element.hasRevenue()) {
27136        composeCodeableConcept("revenue", element.getRevenue());
27137      }
27138      if (element.hasCategory()) {
27139        composeCodeableConcept("category", element.getCategory());
27140      }
27141      if (element.hasService()) {
27142        composeCodeableConcept("service", element.getService());
27143      }
27144      if (element.hasModifier()) { 
27145        for (CodeableConcept e : element.getModifier()) 
27146          composeCodeableConcept("modifier", e);
27147      }
27148      if (element.hasProgramCode()) { 
27149        for (CodeableConcept e : element.getProgramCode()) 
27150          composeCodeableConcept("programCode", e);
27151      }
27152      if (element.hasServiced()) {
27153        composeType("serviced", element.getServiced());
27154      }      if (element.hasLocation()) {
27155        composeType("location", element.getLocation());
27156      }      if (element.hasQuantity()) {
27157        composeSimpleQuantity("quantity", element.getQuantity());
27158      }
27159      if (element.hasUnitPrice()) {
27160        composeMoney("unitPrice", element.getUnitPrice());
27161      }
27162      if (element.hasFactorElement()) {
27163        composeDecimal("factor", element.getFactorElement());
27164      }
27165      if (element.hasNet()) {
27166        composeMoney("net", element.getNet());
27167      }
27168      if (element.hasUdi()) { 
27169        for (Reference e : element.getUdi()) 
27170          composeReference("udi", e);
27171      }
27172      if (element.hasBodySite()) {
27173        composeCodeableConcept("bodySite", element.getBodySite());
27174      }
27175      if (element.hasSubSite()) { 
27176        for (CodeableConcept e : element.getSubSite()) 
27177          composeCodeableConcept("subSite", e);
27178      }
27179      if (element.hasEncounter()) { 
27180        for (Reference e : element.getEncounter()) 
27181          composeReference("encounter", e);
27182      }
27183      if (element.hasNoteNumber()) { 
27184        for (PositiveIntType e : element.getNoteNumber()) 
27185          composePositiveInt("noteNumber", e);
27186      }
27187      if (element.hasAdjudication()) { 
27188        for (ExplanationOfBenefit.AdjudicationComponent e : element.getAdjudication()) 
27189          composeExplanationOfBenefitAdjudicationComponent("adjudication", e);
27190      }
27191      if (element.hasDetail()) { 
27192        for (ExplanationOfBenefit.DetailComponent e : element.getDetail()) 
27193          composeExplanationOfBenefitDetailComponent("detail", e);
27194      }
27195  }
27196
27197  protected void composeExplanationOfBenefitAdjudicationComponent(String name, ExplanationOfBenefit.AdjudicationComponent element) throws IOException {
27198    if (element != null) {
27199      composeElementAttributes(element);
27200      xml.enter(FHIR_NS, name);
27201      composeExplanationOfBenefitAdjudicationComponentElements(element);
27202      composeElementClose(element);
27203      xml.exit(FHIR_NS, name);
27204    }
27205  }
27206
27207  protected void composeExplanationOfBenefitAdjudicationComponentElements(ExplanationOfBenefit.AdjudicationComponent element) throws IOException {
27208      composeBackboneElements(element);
27209      if (element.hasCategory()) {
27210        composeCodeableConcept("category", element.getCategory());
27211      }
27212      if (element.hasReason()) {
27213        composeCodeableConcept("reason", element.getReason());
27214      }
27215      if (element.hasAmount()) {
27216        composeMoney("amount", element.getAmount());
27217      }
27218      if (element.hasValueElement()) {
27219        composeDecimal("value", element.getValueElement());
27220      }
27221  }
27222
27223  protected void composeExplanationOfBenefitDetailComponent(String name, ExplanationOfBenefit.DetailComponent element) throws IOException {
27224    if (element != null) {
27225      composeElementAttributes(element);
27226      xml.enter(FHIR_NS, name);
27227      composeExplanationOfBenefitDetailComponentElements(element);
27228      composeElementClose(element);
27229      xml.exit(FHIR_NS, name);
27230    }
27231  }
27232
27233  protected void composeExplanationOfBenefitDetailComponentElements(ExplanationOfBenefit.DetailComponent element) throws IOException {
27234      composeBackboneElements(element);
27235      if (element.hasSequenceElement()) {
27236        composePositiveInt("sequence", element.getSequenceElement());
27237      }
27238      if (element.hasType()) {
27239        composeCodeableConcept("type", element.getType());
27240      }
27241      if (element.hasRevenue()) {
27242        composeCodeableConcept("revenue", element.getRevenue());
27243      }
27244      if (element.hasCategory()) {
27245        composeCodeableConcept("category", element.getCategory());
27246      }
27247      if (element.hasService()) {
27248        composeCodeableConcept("service", element.getService());
27249      }
27250      if (element.hasModifier()) { 
27251        for (CodeableConcept e : element.getModifier()) 
27252          composeCodeableConcept("modifier", e);
27253      }
27254      if (element.hasProgramCode()) { 
27255        for (CodeableConcept e : element.getProgramCode()) 
27256          composeCodeableConcept("programCode", e);
27257      }
27258      if (element.hasQuantity()) {
27259        composeSimpleQuantity("quantity", element.getQuantity());
27260      }
27261      if (element.hasUnitPrice()) {
27262        composeMoney("unitPrice", element.getUnitPrice());
27263      }
27264      if (element.hasFactorElement()) {
27265        composeDecimal("factor", element.getFactorElement());
27266      }
27267      if (element.hasNet()) {
27268        composeMoney("net", element.getNet());
27269      }
27270      if (element.hasUdi()) { 
27271        for (Reference e : element.getUdi()) 
27272          composeReference("udi", e);
27273      }
27274      if (element.hasNoteNumber()) { 
27275        for (PositiveIntType e : element.getNoteNumber()) 
27276          composePositiveInt("noteNumber", e);
27277      }
27278      if (element.hasAdjudication()) { 
27279        for (ExplanationOfBenefit.AdjudicationComponent e : element.getAdjudication()) 
27280          composeExplanationOfBenefitAdjudicationComponent("adjudication", e);
27281      }
27282      if (element.hasSubDetail()) { 
27283        for (ExplanationOfBenefit.SubDetailComponent e : element.getSubDetail()) 
27284          composeExplanationOfBenefitSubDetailComponent("subDetail", e);
27285      }
27286  }
27287
27288  protected void composeExplanationOfBenefitSubDetailComponent(String name, ExplanationOfBenefit.SubDetailComponent element) throws IOException {
27289    if (element != null) {
27290      composeElementAttributes(element);
27291      xml.enter(FHIR_NS, name);
27292      composeExplanationOfBenefitSubDetailComponentElements(element);
27293      composeElementClose(element);
27294      xml.exit(FHIR_NS, name);
27295    }
27296  }
27297
27298  protected void composeExplanationOfBenefitSubDetailComponentElements(ExplanationOfBenefit.SubDetailComponent element) throws IOException {
27299      composeBackboneElements(element);
27300      if (element.hasSequenceElement()) {
27301        composePositiveInt("sequence", element.getSequenceElement());
27302      }
27303      if (element.hasType()) {
27304        composeCodeableConcept("type", element.getType());
27305      }
27306      if (element.hasRevenue()) {
27307        composeCodeableConcept("revenue", element.getRevenue());
27308      }
27309      if (element.hasCategory()) {
27310        composeCodeableConcept("category", element.getCategory());
27311      }
27312      if (element.hasService()) {
27313        composeCodeableConcept("service", element.getService());
27314      }
27315      if (element.hasModifier()) { 
27316        for (CodeableConcept e : element.getModifier()) 
27317          composeCodeableConcept("modifier", e);
27318      }
27319      if (element.hasProgramCode()) { 
27320        for (CodeableConcept e : element.getProgramCode()) 
27321          composeCodeableConcept("programCode", e);
27322      }
27323      if (element.hasQuantity()) {
27324        composeSimpleQuantity("quantity", element.getQuantity());
27325      }
27326      if (element.hasUnitPrice()) {
27327        composeMoney("unitPrice", element.getUnitPrice());
27328      }
27329      if (element.hasFactorElement()) {
27330        composeDecimal("factor", element.getFactorElement());
27331      }
27332      if (element.hasNet()) {
27333        composeMoney("net", element.getNet());
27334      }
27335      if (element.hasUdi()) { 
27336        for (Reference e : element.getUdi()) 
27337          composeReference("udi", e);
27338      }
27339      if (element.hasNoteNumber()) { 
27340        for (PositiveIntType e : element.getNoteNumber()) 
27341          composePositiveInt("noteNumber", e);
27342      }
27343      if (element.hasAdjudication()) { 
27344        for (ExplanationOfBenefit.AdjudicationComponent e : element.getAdjudication()) 
27345          composeExplanationOfBenefitAdjudicationComponent("adjudication", e);
27346      }
27347  }
27348
27349  protected void composeExplanationOfBenefitAddedItemComponent(String name, ExplanationOfBenefit.AddedItemComponent element) throws IOException {
27350    if (element != null) {
27351      composeElementAttributes(element);
27352      xml.enter(FHIR_NS, name);
27353      composeExplanationOfBenefitAddedItemComponentElements(element);
27354      composeElementClose(element);
27355      xml.exit(FHIR_NS, name);
27356    }
27357  }
27358
27359  protected void composeExplanationOfBenefitAddedItemComponentElements(ExplanationOfBenefit.AddedItemComponent element) throws IOException {
27360      composeBackboneElements(element);
27361      if (element.hasSequenceLinkId()) { 
27362        for (PositiveIntType e : element.getSequenceLinkId()) 
27363          composePositiveInt("sequenceLinkId", e);
27364      }
27365      if (element.hasRevenue()) {
27366        composeCodeableConcept("revenue", element.getRevenue());
27367      }
27368      if (element.hasCategory()) {
27369        composeCodeableConcept("category", element.getCategory());
27370      }
27371      if (element.hasService()) {
27372        composeCodeableConcept("service", element.getService());
27373      }
27374      if (element.hasModifier()) { 
27375        for (CodeableConcept e : element.getModifier()) 
27376          composeCodeableConcept("modifier", e);
27377      }
27378      if (element.hasFee()) {
27379        composeMoney("fee", element.getFee());
27380      }
27381      if (element.hasNoteNumber()) { 
27382        for (PositiveIntType e : element.getNoteNumber()) 
27383          composePositiveInt("noteNumber", e);
27384      }
27385      if (element.hasAdjudication()) { 
27386        for (ExplanationOfBenefit.AdjudicationComponent e : element.getAdjudication()) 
27387          composeExplanationOfBenefitAdjudicationComponent("adjudication", e);
27388      }
27389      if (element.hasDetail()) { 
27390        for (ExplanationOfBenefit.AddedItemsDetailComponent e : element.getDetail()) 
27391          composeExplanationOfBenefitAddedItemsDetailComponent("detail", e);
27392      }
27393  }
27394
27395  protected void composeExplanationOfBenefitAddedItemsDetailComponent(String name, ExplanationOfBenefit.AddedItemsDetailComponent element) throws IOException {
27396    if (element != null) {
27397      composeElementAttributes(element);
27398      xml.enter(FHIR_NS, name);
27399      composeExplanationOfBenefitAddedItemsDetailComponentElements(element);
27400      composeElementClose(element);
27401      xml.exit(FHIR_NS, name);
27402    }
27403  }
27404
27405  protected void composeExplanationOfBenefitAddedItemsDetailComponentElements(ExplanationOfBenefit.AddedItemsDetailComponent element) throws IOException {
27406      composeBackboneElements(element);
27407      if (element.hasRevenue()) {
27408        composeCodeableConcept("revenue", element.getRevenue());
27409      }
27410      if (element.hasCategory()) {
27411        composeCodeableConcept("category", element.getCategory());
27412      }
27413      if (element.hasService()) {
27414        composeCodeableConcept("service", element.getService());
27415      }
27416      if (element.hasModifier()) { 
27417        for (CodeableConcept e : element.getModifier()) 
27418          composeCodeableConcept("modifier", e);
27419      }
27420      if (element.hasFee()) {
27421        composeMoney("fee", element.getFee());
27422      }
27423      if (element.hasNoteNumber()) { 
27424        for (PositiveIntType e : element.getNoteNumber()) 
27425          composePositiveInt("noteNumber", e);
27426      }
27427      if (element.hasAdjudication()) { 
27428        for (ExplanationOfBenefit.AdjudicationComponent e : element.getAdjudication()) 
27429          composeExplanationOfBenefitAdjudicationComponent("adjudication", e);
27430      }
27431  }
27432
27433  protected void composeExplanationOfBenefitPaymentComponent(String name, ExplanationOfBenefit.PaymentComponent element) throws IOException {
27434    if (element != null) {
27435      composeElementAttributes(element);
27436      xml.enter(FHIR_NS, name);
27437      composeExplanationOfBenefitPaymentComponentElements(element);
27438      composeElementClose(element);
27439      xml.exit(FHIR_NS, name);
27440    }
27441  }
27442
27443  protected void composeExplanationOfBenefitPaymentComponentElements(ExplanationOfBenefit.PaymentComponent element) throws IOException {
27444      composeBackboneElements(element);
27445      if (element.hasType()) {
27446        composeCodeableConcept("type", element.getType());
27447      }
27448      if (element.hasAdjustment()) {
27449        composeMoney("adjustment", element.getAdjustment());
27450      }
27451      if (element.hasAdjustmentReason()) {
27452        composeCodeableConcept("adjustmentReason", element.getAdjustmentReason());
27453      }
27454      if (element.hasDateElement()) {
27455        composeDate("date", element.getDateElement());
27456      }
27457      if (element.hasAmount()) {
27458        composeMoney("amount", element.getAmount());
27459      }
27460      if (element.hasIdentifier()) {
27461        composeIdentifier("identifier", element.getIdentifier());
27462      }
27463  }
27464
27465  protected void composeExplanationOfBenefitNoteComponent(String name, ExplanationOfBenefit.NoteComponent element) throws IOException {
27466    if (element != null) {
27467      composeElementAttributes(element);
27468      xml.enter(FHIR_NS, name);
27469      composeExplanationOfBenefitNoteComponentElements(element);
27470      composeElementClose(element);
27471      xml.exit(FHIR_NS, name);
27472    }
27473  }
27474
27475  protected void composeExplanationOfBenefitNoteComponentElements(ExplanationOfBenefit.NoteComponent element) throws IOException {
27476      composeBackboneElements(element);
27477      if (element.hasNumberElement()) {
27478        composePositiveInt("number", element.getNumberElement());
27479      }
27480      if (element.hasType()) {
27481        composeCodeableConcept("type", element.getType());
27482      }
27483      if (element.hasTextElement()) {
27484        composeString("text", element.getTextElement());
27485      }
27486      if (element.hasLanguage()) {
27487        composeCodeableConcept("language", element.getLanguage());
27488      }
27489  }
27490
27491  protected void composeExplanationOfBenefitBenefitBalanceComponent(String name, ExplanationOfBenefit.BenefitBalanceComponent element) throws IOException {
27492    if (element != null) {
27493      composeElementAttributes(element);
27494      xml.enter(FHIR_NS, name);
27495      composeExplanationOfBenefitBenefitBalanceComponentElements(element);
27496      composeElementClose(element);
27497      xml.exit(FHIR_NS, name);
27498    }
27499  }
27500
27501  protected void composeExplanationOfBenefitBenefitBalanceComponentElements(ExplanationOfBenefit.BenefitBalanceComponent element) throws IOException {
27502      composeBackboneElements(element);
27503      if (element.hasCategory()) {
27504        composeCodeableConcept("category", element.getCategory());
27505      }
27506      if (element.hasSubCategory()) {
27507        composeCodeableConcept("subCategory", element.getSubCategory());
27508      }
27509      if (element.hasExcludedElement()) {
27510        composeBoolean("excluded", element.getExcludedElement());
27511      }
27512      if (element.hasNameElement()) {
27513        composeString("name", element.getNameElement());
27514      }
27515      if (element.hasDescriptionElement()) {
27516        composeString("description", element.getDescriptionElement());
27517      }
27518      if (element.hasNetwork()) {
27519        composeCodeableConcept("network", element.getNetwork());
27520      }
27521      if (element.hasUnit()) {
27522        composeCodeableConcept("unit", element.getUnit());
27523      }
27524      if (element.hasTerm()) {
27525        composeCodeableConcept("term", element.getTerm());
27526      }
27527      if (element.hasFinancial()) { 
27528        for (ExplanationOfBenefit.BenefitComponent e : element.getFinancial()) 
27529          composeExplanationOfBenefitBenefitComponent("financial", e);
27530      }
27531  }
27532
27533  protected void composeExplanationOfBenefitBenefitComponent(String name, ExplanationOfBenefit.BenefitComponent element) throws IOException {
27534    if (element != null) {
27535      composeElementAttributes(element);
27536      xml.enter(FHIR_NS, name);
27537      composeExplanationOfBenefitBenefitComponentElements(element);
27538      composeElementClose(element);
27539      xml.exit(FHIR_NS, name);
27540    }
27541  }
27542
27543  protected void composeExplanationOfBenefitBenefitComponentElements(ExplanationOfBenefit.BenefitComponent element) throws IOException {
27544      composeBackboneElements(element);
27545      if (element.hasType()) {
27546        composeCodeableConcept("type", element.getType());
27547      }
27548      if (element.hasAllowed()) {
27549        composeType("allowed", element.getAllowed());
27550      }      if (element.hasUsed()) {
27551        composeType("used", element.getUsed());
27552      }  }
27553
27554  protected void composeFamilyMemberHistory(String name, FamilyMemberHistory element) throws IOException {
27555    if (element != null) {
27556      composeDomainResourceAttributes(element);
27557      xml.enter(FHIR_NS, name);
27558      composeFamilyMemberHistoryElements(element);
27559      composeElementClose(element);
27560      xml.exit(FHIR_NS, name);
27561    }
27562  }
27563
27564  protected void composeFamilyMemberHistoryElements(FamilyMemberHistory element) throws IOException {
27565      composeDomainResourceElements(element);
27566      if (element.hasIdentifier()) { 
27567        for (Identifier e : element.getIdentifier()) 
27568          composeIdentifier("identifier", e);
27569      }
27570      if (element.hasDefinition()) { 
27571        for (Reference e : element.getDefinition()) 
27572          composeReference("definition", e);
27573      }
27574      if (element.hasStatusElement())
27575        composeEnumeration("status", element.getStatusElement(), new FamilyMemberHistory.FamilyHistoryStatusEnumFactory());
27576      if (element.hasNotDoneElement()) {
27577        composeBoolean("notDone", element.getNotDoneElement());
27578      }
27579      if (element.hasNotDoneReason()) {
27580        composeCodeableConcept("notDoneReason", element.getNotDoneReason());
27581      }
27582      if (element.hasPatient()) {
27583        composeReference("patient", element.getPatient());
27584      }
27585      if (element.hasDateElement()) {
27586        composeDateTime("date", element.getDateElement());
27587      }
27588      if (element.hasNameElement()) {
27589        composeString("name", element.getNameElement());
27590      }
27591      if (element.hasRelationship()) {
27592        composeCodeableConcept("relationship", element.getRelationship());
27593      }
27594      if (element.hasGenderElement())
27595        composeEnumeration("gender", element.getGenderElement(), new Enumerations.AdministrativeGenderEnumFactory());
27596      if (element.hasBorn()) {
27597        composeType("born", element.getBorn());
27598      }      if (element.hasAge()) {
27599        composeType("age", element.getAge());
27600      }      if (element.hasEstimatedAgeElement()) {
27601        composeBoolean("estimatedAge", element.getEstimatedAgeElement());
27602      }
27603      if (element.hasDeceased()) {
27604        composeType("deceased", element.getDeceased());
27605      }      if (element.hasReasonCode()) { 
27606        for (CodeableConcept e : element.getReasonCode()) 
27607          composeCodeableConcept("reasonCode", e);
27608      }
27609      if (element.hasReasonReference()) { 
27610        for (Reference e : element.getReasonReference()) 
27611          composeReference("reasonReference", e);
27612      }
27613      if (element.hasNote()) { 
27614        for (Annotation e : element.getNote()) 
27615          composeAnnotation("note", e);
27616      }
27617      if (element.hasCondition()) { 
27618        for (FamilyMemberHistory.FamilyMemberHistoryConditionComponent e : element.getCondition()) 
27619          composeFamilyMemberHistoryFamilyMemberHistoryConditionComponent("condition", e);
27620      }
27621  }
27622
27623  protected void composeFamilyMemberHistoryFamilyMemberHistoryConditionComponent(String name, FamilyMemberHistory.FamilyMemberHistoryConditionComponent element) throws IOException {
27624    if (element != null) {
27625      composeElementAttributes(element);
27626      xml.enter(FHIR_NS, name);
27627      composeFamilyMemberHistoryFamilyMemberHistoryConditionComponentElements(element);
27628      composeElementClose(element);
27629      xml.exit(FHIR_NS, name);
27630    }
27631  }
27632
27633  protected void composeFamilyMemberHistoryFamilyMemberHistoryConditionComponentElements(FamilyMemberHistory.FamilyMemberHistoryConditionComponent element) throws IOException {
27634      composeBackboneElements(element);
27635      if (element.hasCode()) {
27636        composeCodeableConcept("code", element.getCode());
27637      }
27638      if (element.hasOutcome()) {
27639        composeCodeableConcept("outcome", element.getOutcome());
27640      }
27641      if (element.hasOnset()) {
27642        composeType("onset", element.getOnset());
27643      }      if (element.hasNote()) { 
27644        for (Annotation e : element.getNote()) 
27645          composeAnnotation("note", e);
27646      }
27647  }
27648
27649  protected void composeFlag(String name, Flag element) throws IOException {
27650    if (element != null) {
27651      composeDomainResourceAttributes(element);
27652      xml.enter(FHIR_NS, name);
27653      composeFlagElements(element);
27654      composeElementClose(element);
27655      xml.exit(FHIR_NS, name);
27656    }
27657  }
27658
27659  protected void composeFlagElements(Flag element) throws IOException {
27660      composeDomainResourceElements(element);
27661      if (element.hasIdentifier()) { 
27662        for (Identifier e : element.getIdentifier()) 
27663          composeIdentifier("identifier", e);
27664      }
27665      if (element.hasStatusElement())
27666        composeEnumeration("status", element.getStatusElement(), new Flag.FlagStatusEnumFactory());
27667      if (element.hasCategory()) {
27668        composeCodeableConcept("category", element.getCategory());
27669      }
27670      if (element.hasCode()) {
27671        composeCodeableConcept("code", element.getCode());
27672      }
27673      if (element.hasSubject()) {
27674        composeReference("subject", element.getSubject());
27675      }
27676      if (element.hasPeriod()) {
27677        composePeriod("period", element.getPeriod());
27678      }
27679      if (element.hasEncounter()) {
27680        composeReference("encounter", element.getEncounter());
27681      }
27682      if (element.hasAuthor()) {
27683        composeReference("author", element.getAuthor());
27684      }
27685  }
27686
27687  protected void composeGoal(String name, Goal element) throws IOException {
27688    if (element != null) {
27689      composeDomainResourceAttributes(element);
27690      xml.enter(FHIR_NS, name);
27691      composeGoalElements(element);
27692      composeElementClose(element);
27693      xml.exit(FHIR_NS, name);
27694    }
27695  }
27696
27697  protected void composeGoalElements(Goal element) throws IOException {
27698      composeDomainResourceElements(element);
27699      if (element.hasIdentifier()) { 
27700        for (Identifier e : element.getIdentifier()) 
27701          composeIdentifier("identifier", e);
27702      }
27703      if (element.hasStatusElement())
27704        composeEnumeration("status", element.getStatusElement(), new Goal.GoalStatusEnumFactory());
27705      if (element.hasCategory()) { 
27706        for (CodeableConcept e : element.getCategory()) 
27707          composeCodeableConcept("category", e);
27708      }
27709      if (element.hasPriority()) {
27710        composeCodeableConcept("priority", element.getPriority());
27711      }
27712      if (element.hasDescription()) {
27713        composeCodeableConcept("description", element.getDescription());
27714      }
27715      if (element.hasSubject()) {
27716        composeReference("subject", element.getSubject());
27717      }
27718      if (element.hasStart()) {
27719        composeType("start", element.getStart());
27720      }      if (element.hasTarget()) {
27721        composeGoalGoalTargetComponent("target", element.getTarget());
27722      }
27723      if (element.hasStatusDateElement()) {
27724        composeDate("statusDate", element.getStatusDateElement());
27725      }
27726      if (element.hasStatusReasonElement()) {
27727        composeString("statusReason", element.getStatusReasonElement());
27728      }
27729      if (element.hasExpressedBy()) {
27730        composeReference("expressedBy", element.getExpressedBy());
27731      }
27732      if (element.hasAddresses()) { 
27733        for (Reference e : element.getAddresses()) 
27734          composeReference("addresses", e);
27735      }
27736      if (element.hasNote()) { 
27737        for (Annotation e : element.getNote()) 
27738          composeAnnotation("note", e);
27739      }
27740      if (element.hasOutcomeCode()) { 
27741        for (CodeableConcept e : element.getOutcomeCode()) 
27742          composeCodeableConcept("outcomeCode", e);
27743      }
27744      if (element.hasOutcomeReference()) { 
27745        for (Reference e : element.getOutcomeReference()) 
27746          composeReference("outcomeReference", e);
27747      }
27748  }
27749
27750  protected void composeGoalGoalTargetComponent(String name, Goal.GoalTargetComponent element) throws IOException {
27751    if (element != null) {
27752      composeElementAttributes(element);
27753      xml.enter(FHIR_NS, name);
27754      composeGoalGoalTargetComponentElements(element);
27755      composeElementClose(element);
27756      xml.exit(FHIR_NS, name);
27757    }
27758  }
27759
27760  protected void composeGoalGoalTargetComponentElements(Goal.GoalTargetComponent element) throws IOException {
27761      composeBackboneElements(element);
27762      if (element.hasMeasure()) {
27763        composeCodeableConcept("measure", element.getMeasure());
27764      }
27765      if (element.hasDetail()) {
27766        composeType("detail", element.getDetail());
27767      }      if (element.hasDue()) {
27768        composeType("due", element.getDue());
27769      }  }
27770
27771  protected void composeGraphDefinition(String name, GraphDefinition element) throws IOException {
27772    if (element != null) {
27773      composeDomainResourceAttributes(element);
27774      xml.enter(FHIR_NS, name);
27775      composeGraphDefinitionElements(element);
27776      composeElementClose(element);
27777      xml.exit(FHIR_NS, name);
27778    }
27779  }
27780
27781  protected void composeGraphDefinitionElements(GraphDefinition element) throws IOException {
27782      composeDomainResourceElements(element);
27783      if (element.hasUrlElement()) {
27784        composeUri("url", element.getUrlElement());
27785      }
27786      if (element.hasVersionElement()) {
27787        composeString("version", element.getVersionElement());
27788      }
27789      if (element.hasNameElement()) {
27790        composeString("name", element.getNameElement());
27791      }
27792      if (element.hasStatusElement())
27793        composeEnumeration("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory());
27794      if (element.hasExperimentalElement()) {
27795        composeBoolean("experimental", element.getExperimentalElement());
27796      }
27797      if (element.hasDateElement()) {
27798        composeDateTime("date", element.getDateElement());
27799      }
27800      if (element.hasPublisherElement()) {
27801        composeString("publisher", element.getPublisherElement());
27802      }
27803      if (element.hasContact()) { 
27804        for (ContactDetail e : element.getContact()) 
27805          composeContactDetail("contact", e);
27806      }
27807      if (element.hasDescriptionElement()) {
27808        composeMarkdown("description", element.getDescriptionElement());
27809      }
27810      if (element.hasUseContext()) { 
27811        for (UsageContext e : element.getUseContext()) 
27812          composeUsageContext("useContext", e);
27813      }
27814      if (element.hasJurisdiction()) { 
27815        for (CodeableConcept e : element.getJurisdiction()) 
27816          composeCodeableConcept("jurisdiction", e);
27817      }
27818      if (element.hasPurposeElement()) {
27819        composeMarkdown("purpose", element.getPurposeElement());
27820      }
27821      if (element.hasStartElement()) {
27822        composeCode("start", element.getStartElement());
27823      }
27824      if (element.hasProfileElement()) {
27825        composeUri("profile", element.getProfileElement());
27826      }
27827      if (element.hasLink()) { 
27828        for (GraphDefinition.GraphDefinitionLinkComponent e : element.getLink()) 
27829          composeGraphDefinitionGraphDefinitionLinkComponent("link", e);
27830      }
27831  }
27832
27833  protected void composeGraphDefinitionGraphDefinitionLinkComponent(String name, GraphDefinition.GraphDefinitionLinkComponent element) throws IOException {
27834    if (element != null) {
27835      composeElementAttributes(element);
27836      xml.enter(FHIR_NS, name);
27837      composeGraphDefinitionGraphDefinitionLinkComponentElements(element);
27838      composeElementClose(element);
27839      xml.exit(FHIR_NS, name);
27840    }
27841  }
27842
27843  protected void composeGraphDefinitionGraphDefinitionLinkComponentElements(GraphDefinition.GraphDefinitionLinkComponent element) throws IOException {
27844      composeBackboneElements(element);
27845      if (element.hasPathElement()) {
27846        composeString("path", element.getPathElement());
27847      }
27848      if (element.hasSliceNameElement()) {
27849        composeString("sliceName", element.getSliceNameElement());
27850      }
27851      if (element.hasMinElement()) {
27852        composeInteger("min", element.getMinElement());
27853      }
27854      if (element.hasMaxElement()) {
27855        composeString("max", element.getMaxElement());
27856      }
27857      if (element.hasDescriptionElement()) {
27858        composeString("description", element.getDescriptionElement());
27859      }
27860      if (element.hasTarget()) { 
27861        for (GraphDefinition.GraphDefinitionLinkTargetComponent e : element.getTarget()) 
27862          composeGraphDefinitionGraphDefinitionLinkTargetComponent("target", e);
27863      }
27864  }
27865
27866  protected void composeGraphDefinitionGraphDefinitionLinkTargetComponent(String name, GraphDefinition.GraphDefinitionLinkTargetComponent element) throws IOException {
27867    if (element != null) {
27868      composeElementAttributes(element);
27869      xml.enter(FHIR_NS, name);
27870      composeGraphDefinitionGraphDefinitionLinkTargetComponentElements(element);
27871      composeElementClose(element);
27872      xml.exit(FHIR_NS, name);
27873    }
27874  }
27875
27876  protected void composeGraphDefinitionGraphDefinitionLinkTargetComponentElements(GraphDefinition.GraphDefinitionLinkTargetComponent element) throws IOException {
27877      composeBackboneElements(element);
27878      if (element.hasTypeElement()) {
27879        composeCode("type", element.getTypeElement());
27880      }
27881      if (element.hasProfileElement()) {
27882        composeUri("profile", element.getProfileElement());
27883      }
27884      if (element.hasCompartment()) { 
27885        for (GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent e : element.getCompartment()) 
27886          composeGraphDefinitionGraphDefinitionLinkTargetCompartmentComponent("compartment", e);
27887      }
27888      if (element.hasLink()) { 
27889        for (GraphDefinition.GraphDefinitionLinkComponent e : element.getLink()) 
27890          composeGraphDefinitionGraphDefinitionLinkComponent("link", e);
27891      }
27892  }
27893
27894  protected void composeGraphDefinitionGraphDefinitionLinkTargetCompartmentComponent(String name, GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent element) throws IOException {
27895    if (element != null) {
27896      composeElementAttributes(element);
27897      xml.enter(FHIR_NS, name);
27898      composeGraphDefinitionGraphDefinitionLinkTargetCompartmentComponentElements(element);
27899      composeElementClose(element);
27900      xml.exit(FHIR_NS, name);
27901    }
27902  }
27903
27904  protected void composeGraphDefinitionGraphDefinitionLinkTargetCompartmentComponentElements(GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent element) throws IOException {
27905      composeBackboneElements(element);
27906      if (element.hasCodeElement())
27907        composeEnumeration("code", element.getCodeElement(), new GraphDefinition.CompartmentCodeEnumFactory());
27908      if (element.hasRuleElement())
27909        composeEnumeration("rule", element.getRuleElement(), new GraphDefinition.GraphCompartmentRuleEnumFactory());
27910      if (element.hasExpressionElement()) {
27911        composeString("expression", element.getExpressionElement());
27912      }
27913      if (element.hasDescriptionElement()) {
27914        composeString("description", element.getDescriptionElement());
27915      }
27916  }
27917
27918  protected void composeGroup(String name, Group element) throws IOException {
27919    if (element != null) {
27920      composeDomainResourceAttributes(element);
27921      xml.enter(FHIR_NS, name);
27922      composeGroupElements(element);
27923      composeElementClose(element);
27924      xml.exit(FHIR_NS, name);
27925    }
27926  }
27927
27928  protected void composeGroupElements(Group element) throws IOException {
27929      composeDomainResourceElements(element);
27930      if (element.hasIdentifier()) { 
27931        for (Identifier e : element.getIdentifier()) 
27932          composeIdentifier("identifier", e);
27933      }
27934      if (element.hasActiveElement()) {
27935        composeBoolean("active", element.getActiveElement());
27936      }
27937      if (element.hasTypeElement())
27938        composeEnumeration("type", element.getTypeElement(), new Group.GroupTypeEnumFactory());
27939      if (element.hasActualElement()) {
27940        composeBoolean("actual", element.getActualElement());
27941      }
27942      if (element.hasCode()) {
27943        composeCodeableConcept("code", element.getCode());
27944      }
27945      if (element.hasNameElement()) {
27946        composeString("name", element.getNameElement());
27947      }
27948      if (element.hasQuantityElement()) {
27949        composeUnsignedInt("quantity", element.getQuantityElement());
27950      }
27951      if (element.hasCharacteristic()) { 
27952        for (Group.GroupCharacteristicComponent e : element.getCharacteristic()) 
27953          composeGroupGroupCharacteristicComponent("characteristic", e);
27954      }
27955      if (element.hasMember()) { 
27956        for (Group.GroupMemberComponent e : element.getMember()) 
27957          composeGroupGroupMemberComponent("member", e);
27958      }
27959  }
27960
27961  protected void composeGroupGroupCharacteristicComponent(String name, Group.GroupCharacteristicComponent element) throws IOException {
27962    if (element != null) {
27963      composeElementAttributes(element);
27964      xml.enter(FHIR_NS, name);
27965      composeGroupGroupCharacteristicComponentElements(element);
27966      composeElementClose(element);
27967      xml.exit(FHIR_NS, name);
27968    }
27969  }
27970
27971  protected void composeGroupGroupCharacteristicComponentElements(Group.GroupCharacteristicComponent element) throws IOException {
27972      composeBackboneElements(element);
27973      if (element.hasCode()) {
27974        composeCodeableConcept("code", element.getCode());
27975      }
27976      if (element.hasValue()) {
27977        composeType("value", element.getValue());
27978      }      if (element.hasExcludeElement()) {
27979        composeBoolean("exclude", element.getExcludeElement());
27980      }
27981      if (element.hasPeriod()) {
27982        composePeriod("period", element.getPeriod());
27983      }
27984  }
27985
27986  protected void composeGroupGroupMemberComponent(String name, Group.GroupMemberComponent element) throws IOException {
27987    if (element != null) {
27988      composeElementAttributes(element);
27989      xml.enter(FHIR_NS, name);
27990      composeGroupGroupMemberComponentElements(element);
27991      composeElementClose(element);
27992      xml.exit(FHIR_NS, name);
27993    }
27994  }
27995
27996  protected void composeGroupGroupMemberComponentElements(Group.GroupMemberComponent element) throws IOException {
27997      composeBackboneElements(element);
27998      if (element.hasEntity()) {
27999        composeReference("entity", element.getEntity());
28000      }
28001      if (element.hasPeriod()) {
28002        composePeriod("period", element.getPeriod());
28003      }
28004      if (element.hasInactiveElement()) {
28005        composeBoolean("inactive", element.getInactiveElement());
28006      }
28007  }
28008
28009  protected void composeGuidanceResponse(String name, GuidanceResponse element) throws IOException {
28010    if (element != null) {
28011      composeDomainResourceAttributes(element);
28012      xml.enter(FHIR_NS, name);
28013      composeGuidanceResponseElements(element);
28014      composeElementClose(element);
28015      xml.exit(FHIR_NS, name);
28016    }
28017  }
28018
28019  protected void composeGuidanceResponseElements(GuidanceResponse element) throws IOException {
28020      composeDomainResourceElements(element);
28021      if (element.hasRequestIdElement()) {
28022        composeId("requestId", element.getRequestIdElement());
28023      }
28024      if (element.hasIdentifier()) {
28025        composeIdentifier("identifier", element.getIdentifier());
28026      }
28027      if (element.hasModule()) {
28028        composeReference("module", element.getModule());
28029      }
28030      if (element.hasStatusElement())
28031        composeEnumeration("status", element.getStatusElement(), new GuidanceResponse.GuidanceResponseStatusEnumFactory());
28032      if (element.hasSubject()) {
28033        composeReference("subject", element.getSubject());
28034      }
28035      if (element.hasContext()) {
28036        composeReference("context", element.getContext());
28037      }
28038      if (element.hasOccurrenceDateTimeElement()) {
28039        composeDateTime("occurrenceDateTime", element.getOccurrenceDateTimeElement());
28040      }
28041      if (element.hasPerformer()) {
28042        composeReference("performer", element.getPerformer());
28043      }
28044      if (element.hasReason()) {
28045        composeType("reason", element.getReason());
28046      }      if (element.hasNote()) { 
28047        for (Annotation e : element.getNote()) 
28048          composeAnnotation("note", e);
28049      }
28050      if (element.hasEvaluationMessage()) { 
28051        for (Reference e : element.getEvaluationMessage()) 
28052          composeReference("evaluationMessage", e);
28053      }
28054      if (element.hasOutputParameters()) {
28055        composeReference("outputParameters", element.getOutputParameters());
28056      }
28057      if (element.hasResult()) {
28058        composeReference("result", element.getResult());
28059      }
28060      if (element.hasDataRequirement()) { 
28061        for (DataRequirement e : element.getDataRequirement()) 
28062          composeDataRequirement("dataRequirement", e);
28063      }
28064  }
28065
28066  protected void composeHealthcareService(String name, HealthcareService element) throws IOException {
28067    if (element != null) {
28068      composeDomainResourceAttributes(element);
28069      xml.enter(FHIR_NS, name);
28070      composeHealthcareServiceElements(element);
28071      composeElementClose(element);
28072      xml.exit(FHIR_NS, name);
28073    }
28074  }
28075
28076  protected void composeHealthcareServiceElements(HealthcareService element) throws IOException {
28077      composeDomainResourceElements(element);
28078      if (element.hasIdentifier()) { 
28079        for (Identifier e : element.getIdentifier()) 
28080          composeIdentifier("identifier", e);
28081      }
28082      if (element.hasActiveElement()) {
28083        composeBoolean("active", element.getActiveElement());
28084      }
28085      if (element.hasProvidedBy()) {
28086        composeReference("providedBy", element.getProvidedBy());
28087      }
28088      if (element.hasCategory()) {
28089        composeCodeableConcept("category", element.getCategory());
28090      }
28091      if (element.hasType()) { 
28092        for (CodeableConcept e : element.getType()) 
28093          composeCodeableConcept("type", e);
28094      }
28095      if (element.hasSpecialty()) { 
28096        for (CodeableConcept e : element.getSpecialty()) 
28097          composeCodeableConcept("specialty", e);
28098      }
28099      if (element.hasLocation()) { 
28100        for (Reference e : element.getLocation()) 
28101          composeReference("location", e);
28102      }
28103      if (element.hasNameElement()) {
28104        composeString("name", element.getNameElement());
28105      }
28106      if (element.hasCommentElement()) {
28107        composeString("comment", element.getCommentElement());
28108      }
28109      if (element.hasExtraDetailsElement()) {
28110        composeString("extraDetails", element.getExtraDetailsElement());
28111      }
28112      if (element.hasPhoto()) {
28113        composeAttachment("photo", element.getPhoto());
28114      }
28115      if (element.hasTelecom()) { 
28116        for (ContactPoint e : element.getTelecom()) 
28117          composeContactPoint("telecom", e);
28118      }
28119      if (element.hasCoverageArea()) { 
28120        for (Reference e : element.getCoverageArea()) 
28121          composeReference("coverageArea", e);
28122      }
28123      if (element.hasServiceProvisionCode()) { 
28124        for (CodeableConcept e : element.getServiceProvisionCode()) 
28125          composeCodeableConcept("serviceProvisionCode", e);
28126      }
28127      if (element.hasEligibility()) {
28128        composeCodeableConcept("eligibility", element.getEligibility());
28129      }
28130      if (element.hasEligibilityNoteElement()) {
28131        composeString("eligibilityNote", element.getEligibilityNoteElement());
28132      }
28133      if (element.hasProgramName()) { 
28134        for (StringType e : element.getProgramName()) 
28135          composeString("programName", e);
28136      }
28137      if (element.hasCharacteristic()) { 
28138        for (CodeableConcept e : element.getCharacteristic()) 
28139          composeCodeableConcept("characteristic", e);
28140      }
28141      if (element.hasReferralMethod()) { 
28142        for (CodeableConcept e : element.getReferralMethod()) 
28143          composeCodeableConcept("referralMethod", e);
28144      }
28145      if (element.hasAppointmentRequiredElement()) {
28146        composeBoolean("appointmentRequired", element.getAppointmentRequiredElement());
28147      }
28148      if (element.hasAvailableTime()) { 
28149        for (HealthcareService.HealthcareServiceAvailableTimeComponent e : element.getAvailableTime()) 
28150          composeHealthcareServiceHealthcareServiceAvailableTimeComponent("availableTime", e);
28151      }
28152      if (element.hasNotAvailable()) { 
28153        for (HealthcareService.HealthcareServiceNotAvailableComponent e : element.getNotAvailable()) 
28154          composeHealthcareServiceHealthcareServiceNotAvailableComponent("notAvailable", e);
28155      }
28156      if (element.hasAvailabilityExceptionsElement()) {
28157        composeString("availabilityExceptions", element.getAvailabilityExceptionsElement());
28158      }
28159      if (element.hasEndpoint()) { 
28160        for (Reference e : element.getEndpoint()) 
28161          composeReference("endpoint", e);
28162      }
28163  }
28164
28165  protected void composeHealthcareServiceHealthcareServiceAvailableTimeComponent(String name, HealthcareService.HealthcareServiceAvailableTimeComponent element) throws IOException {
28166    if (element != null) {
28167      composeElementAttributes(element);
28168      xml.enter(FHIR_NS, name);
28169      composeHealthcareServiceHealthcareServiceAvailableTimeComponentElements(element);
28170      composeElementClose(element);
28171      xml.exit(FHIR_NS, name);
28172    }
28173  }
28174
28175  protected void composeHealthcareServiceHealthcareServiceAvailableTimeComponentElements(HealthcareService.HealthcareServiceAvailableTimeComponent element) throws IOException {
28176      composeBackboneElements(element);
28177        if (element.hasDaysOfWeek()) 
28178          for (Enumeration<HealthcareService.DaysOfWeek> e : element.getDaysOfWeek()) 
28179            composeEnumeration("daysOfWeek", e, new HealthcareService.DaysOfWeekEnumFactory());
28180      if (element.hasAllDayElement()) {
28181        composeBoolean("allDay", element.getAllDayElement());
28182      }
28183      if (element.hasAvailableStartTimeElement()) {
28184        composeTime("availableStartTime", element.getAvailableStartTimeElement());
28185      }
28186      if (element.hasAvailableEndTimeElement()) {
28187        composeTime("availableEndTime", element.getAvailableEndTimeElement());
28188      }
28189  }
28190
28191  protected void composeHealthcareServiceHealthcareServiceNotAvailableComponent(String name, HealthcareService.HealthcareServiceNotAvailableComponent element) throws IOException {
28192    if (element != null) {
28193      composeElementAttributes(element);
28194      xml.enter(FHIR_NS, name);
28195      composeHealthcareServiceHealthcareServiceNotAvailableComponentElements(element);
28196      composeElementClose(element);
28197      xml.exit(FHIR_NS, name);
28198    }
28199  }
28200
28201  protected void composeHealthcareServiceHealthcareServiceNotAvailableComponentElements(HealthcareService.HealthcareServiceNotAvailableComponent element) throws IOException {
28202      composeBackboneElements(element);
28203      if (element.hasDescriptionElement()) {
28204        composeString("description", element.getDescriptionElement());
28205      }
28206      if (element.hasDuring()) {
28207        composePeriod("during", element.getDuring());
28208      }
28209  }
28210
28211  protected void composeImagingManifest(String name, ImagingManifest element) throws IOException {
28212    if (element != null) {
28213      composeDomainResourceAttributes(element);
28214      xml.enter(FHIR_NS, name);
28215      composeImagingManifestElements(element);
28216      composeElementClose(element);
28217      xml.exit(FHIR_NS, name);
28218    }
28219  }
28220
28221  protected void composeImagingManifestElements(ImagingManifest element) throws IOException {
28222      composeDomainResourceElements(element);
28223      if (element.hasIdentifier()) {
28224        composeIdentifier("identifier", element.getIdentifier());
28225      }
28226      if (element.hasPatient()) {
28227        composeReference("patient", element.getPatient());
28228      }
28229      if (element.hasAuthoringTimeElement()) {
28230        composeDateTime("authoringTime", element.getAuthoringTimeElement());
28231      }
28232      if (element.hasAuthor()) {
28233        composeReference("author", element.getAuthor());
28234      }
28235      if (element.hasDescriptionElement()) {
28236        composeString("description", element.getDescriptionElement());
28237      }
28238      if (element.hasStudy()) { 
28239        for (ImagingManifest.StudyComponent e : element.getStudy()) 
28240          composeImagingManifestStudyComponent("study", e);
28241      }
28242  }
28243
28244  protected void composeImagingManifestStudyComponent(String name, ImagingManifest.StudyComponent element) throws IOException {
28245    if (element != null) {
28246      composeElementAttributes(element);
28247      xml.enter(FHIR_NS, name);
28248      composeImagingManifestStudyComponentElements(element);
28249      composeElementClose(element);
28250      xml.exit(FHIR_NS, name);
28251    }
28252  }
28253
28254  protected void composeImagingManifestStudyComponentElements(ImagingManifest.StudyComponent element) throws IOException {
28255      composeBackboneElements(element);
28256      if (element.hasUidElement()) {
28257        composeOid("uid", element.getUidElement());
28258      }
28259      if (element.hasImagingStudy()) {
28260        composeReference("imagingStudy", element.getImagingStudy());
28261      }
28262      if (element.hasEndpoint()) { 
28263        for (Reference e : element.getEndpoint()) 
28264          composeReference("endpoint", e);
28265      }
28266      if (element.hasSeries()) { 
28267        for (ImagingManifest.SeriesComponent e : element.getSeries()) 
28268          composeImagingManifestSeriesComponent("series", e);
28269      }
28270  }
28271
28272  protected void composeImagingManifestSeriesComponent(String name, ImagingManifest.SeriesComponent element) throws IOException {
28273    if (element != null) {
28274      composeElementAttributes(element);
28275      xml.enter(FHIR_NS, name);
28276      composeImagingManifestSeriesComponentElements(element);
28277      composeElementClose(element);
28278      xml.exit(FHIR_NS, name);
28279    }
28280  }
28281
28282  protected void composeImagingManifestSeriesComponentElements(ImagingManifest.SeriesComponent element) throws IOException {
28283      composeBackboneElements(element);
28284      if (element.hasUidElement()) {
28285        composeOid("uid", element.getUidElement());
28286      }
28287      if (element.hasEndpoint()) { 
28288        for (Reference e : element.getEndpoint()) 
28289          composeReference("endpoint", e);
28290      }
28291      if (element.hasInstance()) { 
28292        for (ImagingManifest.InstanceComponent e : element.getInstance()) 
28293          composeImagingManifestInstanceComponent("instance", e);
28294      }
28295  }
28296
28297  protected void composeImagingManifestInstanceComponent(String name, ImagingManifest.InstanceComponent element) throws IOException {
28298    if (element != null) {
28299      composeElementAttributes(element);
28300      xml.enter(FHIR_NS, name);
28301      composeImagingManifestInstanceComponentElements(element);
28302      composeElementClose(element);
28303      xml.exit(FHIR_NS, name);
28304    }
28305  }
28306
28307  protected void composeImagingManifestInstanceComponentElements(ImagingManifest.InstanceComponent element) throws IOException {
28308      composeBackboneElements(element);
28309      if (element.hasSopClassElement()) {
28310        composeOid("sopClass", element.getSopClassElement());
28311      }
28312      if (element.hasUidElement()) {
28313        composeOid("uid", element.getUidElement());
28314      }
28315  }
28316
28317  protected void composeImagingStudy(String name, ImagingStudy element) throws IOException {
28318    if (element != null) {
28319      composeDomainResourceAttributes(element);
28320      xml.enter(FHIR_NS, name);
28321      composeImagingStudyElements(element);
28322      composeElementClose(element);
28323      xml.exit(FHIR_NS, name);
28324    }
28325  }
28326
28327  protected void composeImagingStudyElements(ImagingStudy element) throws IOException {
28328      composeDomainResourceElements(element);
28329      if (element.hasUidElement()) {
28330        composeOid("uid", element.getUidElement());
28331      }
28332      if (element.hasAccession()) {
28333        composeIdentifier("accession", element.getAccession());
28334      }
28335      if (element.hasIdentifier()) { 
28336        for (Identifier e : element.getIdentifier()) 
28337          composeIdentifier("identifier", e);
28338      }
28339      if (element.hasAvailabilityElement())
28340        composeEnumeration("availability", element.getAvailabilityElement(), new ImagingStudy.InstanceAvailabilityEnumFactory());
28341      if (element.hasModalityList()) { 
28342        for (Coding e : element.getModalityList()) 
28343          composeCoding("modalityList", e);
28344      }
28345      if (element.hasPatient()) {
28346        composeReference("patient", element.getPatient());
28347      }
28348      if (element.hasContext()) {
28349        composeReference("context", element.getContext());
28350      }
28351      if (element.hasStartedElement()) {
28352        composeDateTime("started", element.getStartedElement());
28353      }
28354      if (element.hasBasedOn()) { 
28355        for (Reference e : element.getBasedOn()) 
28356          composeReference("basedOn", e);
28357      }
28358      if (element.hasReferrer()) {
28359        composeReference("referrer", element.getReferrer());
28360      }
28361      if (element.hasInterpreter()) { 
28362        for (Reference e : element.getInterpreter()) 
28363          composeReference("interpreter", e);
28364      }
28365      if (element.hasEndpoint()) { 
28366        for (Reference e : element.getEndpoint()) 
28367          composeReference("endpoint", e);
28368      }
28369      if (element.hasNumberOfSeriesElement()) {
28370        composeUnsignedInt("numberOfSeries", element.getNumberOfSeriesElement());
28371      }
28372      if (element.hasNumberOfInstancesElement()) {
28373        composeUnsignedInt("numberOfInstances", element.getNumberOfInstancesElement());
28374      }
28375      if (element.hasProcedureReference()) { 
28376        for (Reference e : element.getProcedureReference()) 
28377          composeReference("procedureReference", e);
28378      }
28379      if (element.hasProcedureCode()) { 
28380        for (CodeableConcept e : element.getProcedureCode()) 
28381          composeCodeableConcept("procedureCode", e);
28382      }
28383      if (element.hasReason()) {
28384        composeCodeableConcept("reason", element.getReason());
28385      }
28386      if (element.hasDescriptionElement()) {
28387        composeString("description", element.getDescriptionElement());
28388      }
28389      if (element.hasSeries()) { 
28390        for (ImagingStudy.ImagingStudySeriesComponent e : element.getSeries()) 
28391          composeImagingStudyImagingStudySeriesComponent("series", e);
28392      }
28393  }
28394
28395  protected void composeImagingStudyImagingStudySeriesComponent(String name, ImagingStudy.ImagingStudySeriesComponent element) throws IOException {
28396    if (element != null) {
28397      composeElementAttributes(element);
28398      xml.enter(FHIR_NS, name);
28399      composeImagingStudyImagingStudySeriesComponentElements(element);
28400      composeElementClose(element);
28401      xml.exit(FHIR_NS, name);
28402    }
28403  }
28404
28405  protected void composeImagingStudyImagingStudySeriesComponentElements(ImagingStudy.ImagingStudySeriesComponent element) throws IOException {
28406      composeBackboneElements(element);
28407      if (element.hasUidElement()) {
28408        composeOid("uid", element.getUidElement());
28409      }
28410      if (element.hasNumberElement()) {
28411        composeUnsignedInt("number", element.getNumberElement());
28412      }
28413      if (element.hasModality()) {
28414        composeCoding("modality", element.getModality());
28415      }
28416      if (element.hasDescriptionElement()) {
28417        composeString("description", element.getDescriptionElement());
28418      }
28419      if (element.hasNumberOfInstancesElement()) {
28420        composeUnsignedInt("numberOfInstances", element.getNumberOfInstancesElement());
28421      }
28422      if (element.hasAvailabilityElement())
28423        composeEnumeration("availability", element.getAvailabilityElement(), new ImagingStudy.InstanceAvailabilityEnumFactory());
28424      if (element.hasEndpoint()) { 
28425        for (Reference e : element.getEndpoint()) 
28426          composeReference("endpoint", e);
28427      }
28428      if (element.hasBodySite()) {
28429        composeCoding("bodySite", element.getBodySite());
28430      }
28431      if (element.hasLaterality()) {
28432        composeCoding("laterality", element.getLaterality());
28433      }
28434      if (element.hasStartedElement()) {
28435        composeDateTime("started", element.getStartedElement());
28436      }
28437      if (element.hasPerformer()) { 
28438        for (Reference e : element.getPerformer()) 
28439          composeReference("performer", e);
28440      }
28441      if (element.hasInstance()) { 
28442        for (ImagingStudy.ImagingStudySeriesInstanceComponent e : element.getInstance()) 
28443          composeImagingStudyImagingStudySeriesInstanceComponent("instance", e);
28444      }
28445  }
28446
28447  protected void composeImagingStudyImagingStudySeriesInstanceComponent(String name, ImagingStudy.ImagingStudySeriesInstanceComponent element) throws IOException {
28448    if (element != null) {
28449      composeElementAttributes(element);
28450      xml.enter(FHIR_NS, name);
28451      composeImagingStudyImagingStudySeriesInstanceComponentElements(element);
28452      composeElementClose(element);
28453      xml.exit(FHIR_NS, name);
28454    }
28455  }
28456
28457  protected void composeImagingStudyImagingStudySeriesInstanceComponentElements(ImagingStudy.ImagingStudySeriesInstanceComponent element) throws IOException {
28458      composeBackboneElements(element);
28459      if (element.hasUidElement()) {
28460        composeOid("uid", element.getUidElement());
28461      }
28462      if (element.hasNumberElement()) {
28463        composeUnsignedInt("number", element.getNumberElement());
28464      }
28465      if (element.hasSopClassElement()) {
28466        composeOid("sopClass", element.getSopClassElement());
28467      }
28468      if (element.hasTitleElement()) {
28469        composeString("title", element.getTitleElement());
28470      }
28471  }
28472
28473  protected void composeImmunization(String name, Immunization element) throws IOException {
28474    if (element != null) {
28475      composeDomainResourceAttributes(element);
28476      xml.enter(FHIR_NS, name);
28477      composeImmunizationElements(element);
28478      composeElementClose(element);
28479      xml.exit(FHIR_NS, name);
28480    }
28481  }
28482
28483  protected void composeImmunizationElements(Immunization element) throws IOException {
28484      composeDomainResourceElements(element);
28485      if (element.hasIdentifier()) { 
28486        for (Identifier e : element.getIdentifier()) 
28487          composeIdentifier("identifier", e);
28488      }
28489      if (element.hasStatusElement())
28490        composeEnumeration("status", element.getStatusElement(), new Immunization.ImmunizationStatusEnumFactory());
28491      if (element.hasNotGivenElement()) {
28492        composeBoolean("notGiven", element.getNotGivenElement());
28493      }
28494      if (element.hasVaccineCode()) {
28495        composeCodeableConcept("vaccineCode", element.getVaccineCode());
28496      }
28497      if (element.hasPatient()) {
28498        composeReference("patient", element.getPatient());
28499      }
28500      if (element.hasEncounter()) {
28501        composeReference("encounter", element.getEncounter());
28502      }
28503      if (element.hasDateElement()) {
28504        composeDateTime("date", element.getDateElement());
28505      }
28506      if (element.hasPrimarySourceElement()) {
28507        composeBoolean("primarySource", element.getPrimarySourceElement());
28508      }
28509      if (element.hasReportOrigin()) {
28510        composeCodeableConcept("reportOrigin", element.getReportOrigin());
28511      }
28512      if (element.hasLocation()) {
28513        composeReference("location", element.getLocation());
28514      }
28515      if (element.hasManufacturer()) {
28516        composeReference("manufacturer", element.getManufacturer());
28517      }
28518      if (element.hasLotNumberElement()) {
28519        composeString("lotNumber", element.getLotNumberElement());
28520      }
28521      if (element.hasExpirationDateElement()) {
28522        composeDate("expirationDate", element.getExpirationDateElement());
28523      }
28524      if (element.hasSite()) {
28525        composeCodeableConcept("site", element.getSite());
28526      }
28527      if (element.hasRoute()) {
28528        composeCodeableConcept("route", element.getRoute());
28529      }
28530      if (element.hasDoseQuantity()) {
28531        composeSimpleQuantity("doseQuantity", element.getDoseQuantity());
28532      }
28533      if (element.hasPractitioner()) { 
28534        for (Immunization.ImmunizationPractitionerComponent e : element.getPractitioner()) 
28535          composeImmunizationImmunizationPractitionerComponent("practitioner", e);
28536      }
28537      if (element.hasNote()) { 
28538        for (Annotation e : element.getNote()) 
28539          composeAnnotation("note", e);
28540      }
28541      if (element.hasExplanation()) {
28542        composeImmunizationImmunizationExplanationComponent("explanation", element.getExplanation());
28543      }
28544      if (element.hasReaction()) { 
28545        for (Immunization.ImmunizationReactionComponent e : element.getReaction()) 
28546          composeImmunizationImmunizationReactionComponent("reaction", e);
28547      }
28548      if (element.hasVaccinationProtocol()) { 
28549        for (Immunization.ImmunizationVaccinationProtocolComponent e : element.getVaccinationProtocol()) 
28550          composeImmunizationImmunizationVaccinationProtocolComponent("vaccinationProtocol", e);
28551      }
28552  }
28553
28554  protected void composeImmunizationImmunizationPractitionerComponent(String name, Immunization.ImmunizationPractitionerComponent element) throws IOException {
28555    if (element != null) {
28556      composeElementAttributes(element);
28557      xml.enter(FHIR_NS, name);
28558      composeImmunizationImmunizationPractitionerComponentElements(element);
28559      composeElementClose(element);
28560      xml.exit(FHIR_NS, name);
28561    }
28562  }
28563
28564  protected void composeImmunizationImmunizationPractitionerComponentElements(Immunization.ImmunizationPractitionerComponent element) throws IOException {
28565      composeBackboneElements(element);
28566      if (element.hasRole()) {
28567        composeCodeableConcept("role", element.getRole());
28568      }
28569      if (element.hasActor()) {
28570        composeReference("actor", element.getActor());
28571      }
28572  }
28573
28574  protected void composeImmunizationImmunizationExplanationComponent(String name, Immunization.ImmunizationExplanationComponent element) throws IOException {
28575    if (element != null) {
28576      composeElementAttributes(element);
28577      xml.enter(FHIR_NS, name);
28578      composeImmunizationImmunizationExplanationComponentElements(element);
28579      composeElementClose(element);
28580      xml.exit(FHIR_NS, name);
28581    }
28582  }
28583
28584  protected void composeImmunizationImmunizationExplanationComponentElements(Immunization.ImmunizationExplanationComponent element) throws IOException {
28585      composeBackboneElements(element);
28586      if (element.hasReason()) { 
28587        for (CodeableConcept e : element.getReason()) 
28588          composeCodeableConcept("reason", e);
28589      }
28590      if (element.hasReasonNotGiven()) { 
28591        for (CodeableConcept e : element.getReasonNotGiven()) 
28592          composeCodeableConcept("reasonNotGiven", e);
28593      }
28594  }
28595
28596  protected void composeImmunizationImmunizationReactionComponent(String name, Immunization.ImmunizationReactionComponent element) throws IOException {
28597    if (element != null) {
28598      composeElementAttributes(element);
28599      xml.enter(FHIR_NS, name);
28600      composeImmunizationImmunizationReactionComponentElements(element);
28601      composeElementClose(element);
28602      xml.exit(FHIR_NS, name);
28603    }
28604  }
28605
28606  protected void composeImmunizationImmunizationReactionComponentElements(Immunization.ImmunizationReactionComponent element) throws IOException {
28607      composeBackboneElements(element);
28608      if (element.hasDateElement()) {
28609        composeDateTime("date", element.getDateElement());
28610      }
28611      if (element.hasDetail()) {
28612        composeReference("detail", element.getDetail());
28613      }
28614      if (element.hasReportedElement()) {
28615        composeBoolean("reported", element.getReportedElement());
28616      }
28617  }
28618
28619  protected void composeImmunizationImmunizationVaccinationProtocolComponent(String name, Immunization.ImmunizationVaccinationProtocolComponent element) throws IOException {
28620    if (element != null) {
28621      composeElementAttributes(element);
28622      xml.enter(FHIR_NS, name);
28623      composeImmunizationImmunizationVaccinationProtocolComponentElements(element);
28624      composeElementClose(element);
28625      xml.exit(FHIR_NS, name);
28626    }
28627  }
28628
28629  protected void composeImmunizationImmunizationVaccinationProtocolComponentElements(Immunization.ImmunizationVaccinationProtocolComponent element) throws IOException {
28630      composeBackboneElements(element);
28631      if (element.hasDoseSequenceElement()) {
28632        composePositiveInt("doseSequence", element.getDoseSequenceElement());
28633      }
28634      if (element.hasDescriptionElement()) {
28635        composeString("description", element.getDescriptionElement());
28636      }
28637      if (element.hasAuthority()) {
28638        composeReference("authority", element.getAuthority());
28639      }
28640      if (element.hasSeriesElement()) {
28641        composeString("series", element.getSeriesElement());
28642      }
28643      if (element.hasSeriesDosesElement()) {
28644        composePositiveInt("seriesDoses", element.getSeriesDosesElement());
28645      }
28646      if (element.hasTargetDisease()) { 
28647        for (CodeableConcept e : element.getTargetDisease()) 
28648          composeCodeableConcept("targetDisease", e);
28649      }
28650      if (element.hasDoseStatus()) {
28651        composeCodeableConcept("doseStatus", element.getDoseStatus());
28652      }
28653      if (element.hasDoseStatusReason()) {
28654        composeCodeableConcept("doseStatusReason", element.getDoseStatusReason());
28655      }
28656  }
28657
28658  protected void composeImmunizationRecommendation(String name, ImmunizationRecommendation element) throws IOException {
28659    if (element != null) {
28660      composeDomainResourceAttributes(element);
28661      xml.enter(FHIR_NS, name);
28662      composeImmunizationRecommendationElements(element);
28663      composeElementClose(element);
28664      xml.exit(FHIR_NS, name);
28665    }
28666  }
28667
28668  protected void composeImmunizationRecommendationElements(ImmunizationRecommendation element) throws IOException {
28669      composeDomainResourceElements(element);
28670      if (element.hasIdentifier()) { 
28671        for (Identifier e : element.getIdentifier()) 
28672          composeIdentifier("identifier", e);
28673      }
28674      if (element.hasPatient()) {
28675        composeReference("patient", element.getPatient());
28676      }
28677      if (element.hasRecommendation()) { 
28678        for (ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent e : element.getRecommendation()) 
28679          composeImmunizationRecommendationImmunizationRecommendationRecommendationComponent("recommendation", e);
28680      }
28681  }
28682
28683  protected void composeImmunizationRecommendationImmunizationRecommendationRecommendationComponent(String name, ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent element) throws IOException {
28684    if (element != null) {
28685      composeElementAttributes(element);
28686      xml.enter(FHIR_NS, name);
28687      composeImmunizationRecommendationImmunizationRecommendationRecommendationComponentElements(element);
28688      composeElementClose(element);
28689      xml.exit(FHIR_NS, name);
28690    }
28691  }
28692
28693  protected void composeImmunizationRecommendationImmunizationRecommendationRecommendationComponentElements(ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent element) throws IOException {
28694      composeBackboneElements(element);
28695      if (element.hasDateElement()) {
28696        composeDateTime("date", element.getDateElement());
28697      }
28698      if (element.hasVaccineCode()) {
28699        composeCodeableConcept("vaccineCode", element.getVaccineCode());
28700      }
28701      if (element.hasTargetDisease()) {
28702        composeCodeableConcept("targetDisease", element.getTargetDisease());
28703      }
28704      if (element.hasDoseNumberElement()) {
28705        composePositiveInt("doseNumber", element.getDoseNumberElement());
28706      }
28707      if (element.hasForecastStatus()) {
28708        composeCodeableConcept("forecastStatus", element.getForecastStatus());
28709      }
28710      if (element.hasDateCriterion()) { 
28711        for (ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent e : element.getDateCriterion()) 
28712          composeImmunizationRecommendationImmunizationRecommendationRecommendationDateCriterionComponent("dateCriterion", e);
28713      }
28714      if (element.hasProtocol()) {
28715        composeImmunizationRecommendationImmunizationRecommendationRecommendationProtocolComponent("protocol", element.getProtocol());
28716      }
28717      if (element.hasSupportingImmunization()) { 
28718        for (Reference e : element.getSupportingImmunization()) 
28719          composeReference("supportingImmunization", e);
28720      }
28721      if (element.hasSupportingPatientInformation()) { 
28722        for (Reference e : element.getSupportingPatientInformation()) 
28723          composeReference("supportingPatientInformation", e);
28724      }
28725  }
28726
28727  protected void composeImmunizationRecommendationImmunizationRecommendationRecommendationDateCriterionComponent(String name, ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent element) throws IOException {
28728    if (element != null) {
28729      composeElementAttributes(element);
28730      xml.enter(FHIR_NS, name);
28731      composeImmunizationRecommendationImmunizationRecommendationRecommendationDateCriterionComponentElements(element);
28732      composeElementClose(element);
28733      xml.exit(FHIR_NS, name);
28734    }
28735  }
28736
28737  protected void composeImmunizationRecommendationImmunizationRecommendationRecommendationDateCriterionComponentElements(ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent element) throws IOException {
28738      composeBackboneElements(element);
28739      if (element.hasCode()) {
28740        composeCodeableConcept("code", element.getCode());
28741      }
28742      if (element.hasValueElement()) {
28743        composeDateTime("value", element.getValueElement());
28744      }
28745  }
28746
28747  protected void composeImmunizationRecommendationImmunizationRecommendationRecommendationProtocolComponent(String name, ImmunizationRecommendation.ImmunizationRecommendationRecommendationProtocolComponent element) throws IOException {
28748    if (element != null) {
28749      composeElementAttributes(element);
28750      xml.enter(FHIR_NS, name);
28751      composeImmunizationRecommendationImmunizationRecommendationRecommendationProtocolComponentElements(element);
28752      composeElementClose(element);
28753      xml.exit(FHIR_NS, name);
28754    }
28755  }
28756
28757  protected void composeImmunizationRecommendationImmunizationRecommendationRecommendationProtocolComponentElements(ImmunizationRecommendation.ImmunizationRecommendationRecommendationProtocolComponent element) throws IOException {
28758      composeBackboneElements(element);
28759      if (element.hasDoseSequenceElement()) {
28760        composePositiveInt("doseSequence", element.getDoseSequenceElement());
28761      }
28762      if (element.hasDescriptionElement()) {
28763        composeString("description", element.getDescriptionElement());
28764      }
28765      if (element.hasAuthority()) {
28766        composeReference("authority", element.getAuthority());
28767      }
28768      if (element.hasSeriesElement()) {
28769        composeString("series", element.getSeriesElement());
28770      }
28771  }
28772
28773  protected void composeImplementationGuide(String name, ImplementationGuide element) throws IOException {
28774    if (element != null) {
28775      composeDomainResourceAttributes(element);
28776      xml.enter(FHIR_NS, name);
28777      composeImplementationGuideElements(element);
28778      composeElementClose(element);
28779      xml.exit(FHIR_NS, name);
28780    }
28781  }
28782
28783  protected void composeImplementationGuideElements(ImplementationGuide element) throws IOException {
28784      composeDomainResourceElements(element);
28785      if (element.hasUrlElement()) {
28786        composeUri("url", element.getUrlElement());
28787      }
28788      if (element.hasVersionElement()) {
28789        composeString("version", element.getVersionElement());
28790      }
28791      if (element.hasNameElement()) {
28792        composeString("name", element.getNameElement());
28793      }
28794      if (element.hasStatusElement())
28795        composeEnumeration("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory());
28796      if (element.hasExperimentalElement()) {
28797        composeBoolean("experimental", element.getExperimentalElement());
28798      }
28799      if (element.hasDateElement()) {
28800        composeDateTime("date", element.getDateElement());
28801      }
28802      if (element.hasPublisherElement()) {
28803        composeString("publisher", element.getPublisherElement());
28804      }
28805      if (element.hasContact()) { 
28806        for (ContactDetail e : element.getContact()) 
28807          composeContactDetail("contact", e);
28808      }
28809      if (element.hasDescriptionElement()) {
28810        composeMarkdown("description", element.getDescriptionElement());
28811      }
28812      if (element.hasUseContext()) { 
28813        for (UsageContext e : element.getUseContext()) 
28814          composeUsageContext("useContext", e);
28815      }
28816      if (element.hasJurisdiction()) { 
28817        for (CodeableConcept e : element.getJurisdiction()) 
28818          composeCodeableConcept("jurisdiction", e);
28819      }
28820      if (element.hasCopyrightElement()) {
28821        composeMarkdown("copyright", element.getCopyrightElement());
28822      }
28823      if (element.hasFhirVersionElement()) {
28824        composeId("fhirVersion", element.getFhirVersionElement());
28825      }
28826      if (element.hasDependency()) { 
28827        for (ImplementationGuide.ImplementationGuideDependencyComponent e : element.getDependency()) 
28828          composeImplementationGuideImplementationGuideDependencyComponent("dependency", e);
28829      }
28830      if (element.hasPackage()) { 
28831        for (ImplementationGuide.ImplementationGuidePackageComponent e : element.getPackage()) 
28832          composeImplementationGuideImplementationGuidePackageComponent("package", e);
28833      }
28834      if (element.hasGlobal()) { 
28835        for (ImplementationGuide.ImplementationGuideGlobalComponent e : element.getGlobal()) 
28836          composeImplementationGuideImplementationGuideGlobalComponent("global", e);
28837      }
28838      if (element.hasBinary()) { 
28839        for (UriType e : element.getBinary()) 
28840          composeUri("binary", e);
28841      }
28842      if (element.hasPage()) {
28843        composeImplementationGuideImplementationGuidePageComponent("page", element.getPage());
28844      }
28845  }
28846
28847  protected void composeImplementationGuideImplementationGuideDependencyComponent(String name, ImplementationGuide.ImplementationGuideDependencyComponent element) throws IOException {
28848    if (element != null) {
28849      composeElementAttributes(element);
28850      xml.enter(FHIR_NS, name);
28851      composeImplementationGuideImplementationGuideDependencyComponentElements(element);
28852      composeElementClose(element);
28853      xml.exit(FHIR_NS, name);
28854    }
28855  }
28856
28857  protected void composeImplementationGuideImplementationGuideDependencyComponentElements(ImplementationGuide.ImplementationGuideDependencyComponent element) throws IOException {
28858      composeBackboneElements(element);
28859      if (element.hasTypeElement())
28860        composeEnumeration("type", element.getTypeElement(), new ImplementationGuide.GuideDependencyTypeEnumFactory());
28861      if (element.hasUriElement()) {
28862        composeUri("uri", element.getUriElement());
28863      }
28864  }
28865
28866  protected void composeImplementationGuideImplementationGuidePackageComponent(String name, ImplementationGuide.ImplementationGuidePackageComponent element) throws IOException {
28867    if (element != null) {
28868      composeElementAttributes(element);
28869      xml.enter(FHIR_NS, name);
28870      composeImplementationGuideImplementationGuidePackageComponentElements(element);
28871      composeElementClose(element);
28872      xml.exit(FHIR_NS, name);
28873    }
28874  }
28875
28876  protected void composeImplementationGuideImplementationGuidePackageComponentElements(ImplementationGuide.ImplementationGuidePackageComponent element) throws IOException {
28877      composeBackboneElements(element);
28878      if (element.hasNameElement()) {
28879        composeString("name", element.getNameElement());
28880      }
28881      if (element.hasDescriptionElement()) {
28882        composeString("description", element.getDescriptionElement());
28883      }
28884      if (element.hasResource()) { 
28885        for (ImplementationGuide.ImplementationGuidePackageResourceComponent e : element.getResource()) 
28886          composeImplementationGuideImplementationGuidePackageResourceComponent("resource", e);
28887      }
28888  }
28889
28890  protected void composeImplementationGuideImplementationGuidePackageResourceComponent(String name, ImplementationGuide.ImplementationGuidePackageResourceComponent element) throws IOException {
28891    if (element != null) {
28892      composeElementAttributes(element);
28893      xml.enter(FHIR_NS, name);
28894      composeImplementationGuideImplementationGuidePackageResourceComponentElements(element);
28895      composeElementClose(element);
28896      xml.exit(FHIR_NS, name);
28897    }
28898  }
28899
28900  protected void composeImplementationGuideImplementationGuidePackageResourceComponentElements(ImplementationGuide.ImplementationGuidePackageResourceComponent element) throws IOException {
28901      composeBackboneElements(element);
28902      if (element.hasExampleElement()) {
28903        composeBoolean("example", element.getExampleElement());
28904      }
28905      if (element.hasNameElement()) {
28906        composeString("name", element.getNameElement());
28907      }
28908      if (element.hasDescriptionElement()) {
28909        composeString("description", element.getDescriptionElement());
28910      }
28911      if (element.hasAcronymElement()) {
28912        composeString("acronym", element.getAcronymElement());
28913      }
28914      if (element.hasSource()) {
28915        composeType("source", element.getSource());
28916      }      if (element.hasExampleFor()) {
28917        composeReference("exampleFor", element.getExampleFor());
28918      }
28919  }
28920
28921  protected void composeImplementationGuideImplementationGuideGlobalComponent(String name, ImplementationGuide.ImplementationGuideGlobalComponent element) throws IOException {
28922    if (element != null) {
28923      composeElementAttributes(element);
28924      xml.enter(FHIR_NS, name);
28925      composeImplementationGuideImplementationGuideGlobalComponentElements(element);
28926      composeElementClose(element);
28927      xml.exit(FHIR_NS, name);
28928    }
28929  }
28930
28931  protected void composeImplementationGuideImplementationGuideGlobalComponentElements(ImplementationGuide.ImplementationGuideGlobalComponent element) throws IOException {
28932      composeBackboneElements(element);
28933      if (element.hasTypeElement()) {
28934        composeCode("type", element.getTypeElement());
28935      }
28936      if (element.hasProfile()) {
28937        composeReference("profile", element.getProfile());
28938      }
28939  }
28940
28941  protected void composeImplementationGuideImplementationGuidePageComponent(String name, ImplementationGuide.ImplementationGuidePageComponent element) throws IOException {
28942    if (element != null) {
28943      composeElementAttributes(element);
28944      xml.enter(FHIR_NS, name);
28945      composeImplementationGuideImplementationGuidePageComponentElements(element);
28946      composeElementClose(element);
28947      xml.exit(FHIR_NS, name);
28948    }
28949  }
28950
28951  protected void composeImplementationGuideImplementationGuidePageComponentElements(ImplementationGuide.ImplementationGuidePageComponent element) throws IOException {
28952      composeBackboneElements(element);
28953      if (element.hasSourceElement()) {
28954        composeUri("source", element.getSourceElement());
28955      }
28956      if (element.hasTitleElement()) {
28957        composeString("title", element.getTitleElement());
28958      }
28959      if (element.hasKindElement())
28960        composeEnumeration("kind", element.getKindElement(), new ImplementationGuide.GuidePageKindEnumFactory());
28961      if (element.hasType()) { 
28962        for (CodeType e : element.getType()) 
28963          composeCode("type", e);
28964      }
28965      if (element.hasPackage()) { 
28966        for (StringType e : element.getPackage()) 
28967          composeString("package", e);
28968      }
28969      if (element.hasFormatElement()) {
28970        composeCode("format", element.getFormatElement());
28971      }
28972      if (element.hasPage()) { 
28973        for (ImplementationGuide.ImplementationGuidePageComponent e : element.getPage()) 
28974          composeImplementationGuideImplementationGuidePageComponent("page", e);
28975      }
28976  }
28977
28978  protected void composeLibrary(String name, Library element) throws IOException {
28979    if (element != null) {
28980      composeDomainResourceAttributes(element);
28981      xml.enter(FHIR_NS, name);
28982      composeLibraryElements(element);
28983      composeElementClose(element);
28984      xml.exit(FHIR_NS, name);
28985    }
28986  }
28987
28988  protected void composeLibraryElements(Library element) throws IOException {
28989      composeDomainResourceElements(element);
28990      if (element.hasUrlElement()) {
28991        composeUri("url", element.getUrlElement());
28992      }
28993      if (element.hasIdentifier()) { 
28994        for (Identifier e : element.getIdentifier()) 
28995          composeIdentifier("identifier", e);
28996      }
28997      if (element.hasVersionElement()) {
28998        composeString("version", element.getVersionElement());
28999      }
29000      if (element.hasNameElement()) {
29001        composeString("name", element.getNameElement());
29002      }
29003      if (element.hasTitleElement()) {
29004        composeString("title", element.getTitleElement());
29005      }
29006      if (element.hasStatusElement())
29007        composeEnumeration("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory());
29008      if (element.hasExperimentalElement()) {
29009        composeBoolean("experimental", element.getExperimentalElement());
29010      }
29011      if (element.hasType()) {
29012        composeCodeableConcept("type", element.getType());
29013      }
29014      if (element.hasDateElement()) {
29015        composeDateTime("date", element.getDateElement());
29016      }
29017      if (element.hasPublisherElement()) {
29018        composeString("publisher", element.getPublisherElement());
29019      }
29020      if (element.hasDescriptionElement()) {
29021        composeMarkdown("description", element.getDescriptionElement());
29022      }
29023      if (element.hasPurposeElement()) {
29024        composeMarkdown("purpose", element.getPurposeElement());
29025      }
29026      if (element.hasUsageElement()) {
29027        composeString("usage", element.getUsageElement());
29028      }
29029      if (element.hasApprovalDateElement()) {
29030        composeDate("approvalDate", element.getApprovalDateElement());
29031      }
29032      if (element.hasLastReviewDateElement()) {
29033        composeDate("lastReviewDate", element.getLastReviewDateElement());
29034      }
29035      if (element.hasEffectivePeriod()) {
29036        composePeriod("effectivePeriod", element.getEffectivePeriod());
29037      }
29038      if (element.hasUseContext()) { 
29039        for (UsageContext e : element.getUseContext()) 
29040          composeUsageContext("useContext", e);
29041      }
29042      if (element.hasJurisdiction()) { 
29043        for (CodeableConcept e : element.getJurisdiction()) 
29044          composeCodeableConcept("jurisdiction", e);
29045      }
29046      if (element.hasTopic()) { 
29047        for (CodeableConcept e : element.getTopic()) 
29048          composeCodeableConcept("topic", e);
29049      }
29050      if (element.hasContributor()) { 
29051        for (Contributor e : element.getContributor()) 
29052          composeContributor("contributor", e);
29053      }
29054      if (element.hasContact()) { 
29055        for (ContactDetail e : element.getContact()) 
29056          composeContactDetail("contact", e);
29057      }
29058      if (element.hasCopyrightElement()) {
29059        composeMarkdown("copyright", element.getCopyrightElement());
29060      }
29061      if (element.hasRelatedArtifact()) { 
29062        for (RelatedArtifact e : element.getRelatedArtifact()) 
29063          composeRelatedArtifact("relatedArtifact", e);
29064      }
29065      if (element.hasParameter()) { 
29066        for (ParameterDefinition e : element.getParameter()) 
29067          composeParameterDefinition("parameter", e);
29068      }
29069      if (element.hasDataRequirement()) { 
29070        for (DataRequirement e : element.getDataRequirement()) 
29071          composeDataRequirement("dataRequirement", e);
29072      }
29073      if (element.hasContent()) { 
29074        for (Attachment e : element.getContent()) 
29075          composeAttachment("content", e);
29076      }
29077  }
29078
29079  protected void composeLinkage(String name, Linkage element) throws IOException {
29080    if (element != null) {
29081      composeDomainResourceAttributes(element);
29082      xml.enter(FHIR_NS, name);
29083      composeLinkageElements(element);
29084      composeElementClose(element);
29085      xml.exit(FHIR_NS, name);
29086    }
29087  }
29088
29089  protected void composeLinkageElements(Linkage element) throws IOException {
29090      composeDomainResourceElements(element);
29091      if (element.hasActiveElement()) {
29092        composeBoolean("active", element.getActiveElement());
29093      }
29094      if (element.hasAuthor()) {
29095        composeReference("author", element.getAuthor());
29096      }
29097      if (element.hasItem()) { 
29098        for (Linkage.LinkageItemComponent e : element.getItem()) 
29099          composeLinkageLinkageItemComponent("item", e);
29100      }
29101  }
29102
29103  protected void composeLinkageLinkageItemComponent(String name, Linkage.LinkageItemComponent element) throws IOException {
29104    if (element != null) {
29105      composeElementAttributes(element);
29106      xml.enter(FHIR_NS, name);
29107      composeLinkageLinkageItemComponentElements(element);
29108      composeElementClose(element);
29109      xml.exit(FHIR_NS, name);
29110    }
29111  }
29112
29113  protected void composeLinkageLinkageItemComponentElements(Linkage.LinkageItemComponent element) throws IOException {
29114      composeBackboneElements(element);
29115      if (element.hasTypeElement())
29116        composeEnumeration("type", element.getTypeElement(), new Linkage.LinkageTypeEnumFactory());
29117      if (element.hasResource()) {
29118        composeReference("resource", element.getResource());
29119      }
29120  }
29121
29122  protected void composeListResource(String name, ListResource element) throws IOException {
29123    if (element != null) {
29124      composeDomainResourceAttributes(element);
29125      xml.enter(FHIR_NS, name);
29126      composeListResourceElements(element);
29127      composeElementClose(element);
29128      xml.exit(FHIR_NS, name);
29129    }
29130  }
29131
29132  protected void composeListResourceElements(ListResource element) throws IOException {
29133      composeDomainResourceElements(element);
29134      if (element.hasIdentifier()) { 
29135        for (Identifier e : element.getIdentifier()) 
29136          composeIdentifier("identifier", e);
29137      }
29138      if (element.hasStatusElement())
29139        composeEnumeration("status", element.getStatusElement(), new ListResource.ListStatusEnumFactory());
29140      if (element.hasModeElement())
29141        composeEnumeration("mode", element.getModeElement(), new ListResource.ListModeEnumFactory());
29142      if (element.hasTitleElement()) {
29143        composeString("title", element.getTitleElement());
29144      }
29145      if (element.hasCode()) {
29146        composeCodeableConcept("code", element.getCode());
29147      }
29148      if (element.hasSubject()) {
29149        composeReference("subject", element.getSubject());
29150      }
29151      if (element.hasEncounter()) {
29152        composeReference("encounter", element.getEncounter());
29153      }
29154      if (element.hasDateElement()) {
29155        composeDateTime("date", element.getDateElement());
29156      }
29157      if (element.hasSource()) {
29158        composeReference("source", element.getSource());
29159      }
29160      if (element.hasOrderedBy()) {
29161        composeCodeableConcept("orderedBy", element.getOrderedBy());
29162      }
29163      if (element.hasNote()) { 
29164        for (Annotation e : element.getNote()) 
29165          composeAnnotation("note", e);
29166      }
29167      if (element.hasEntry()) { 
29168        for (ListResource.ListEntryComponent e : element.getEntry()) 
29169          composeListResourceListEntryComponent("entry", e);
29170      }
29171      if (element.hasEmptyReason()) {
29172        composeCodeableConcept("emptyReason", element.getEmptyReason());
29173      }
29174  }
29175
29176  protected void composeListResourceListEntryComponent(String name, ListResource.ListEntryComponent element) throws IOException {
29177    if (element != null) {
29178      composeElementAttributes(element);
29179      xml.enter(FHIR_NS, name);
29180      composeListResourceListEntryComponentElements(element);
29181      composeElementClose(element);
29182      xml.exit(FHIR_NS, name);
29183    }
29184  }
29185
29186  protected void composeListResourceListEntryComponentElements(ListResource.ListEntryComponent element) throws IOException {
29187      composeBackboneElements(element);
29188      if (element.hasFlag()) {
29189        composeCodeableConcept("flag", element.getFlag());
29190      }
29191      if (element.hasDeletedElement()) {
29192        composeBoolean("deleted", element.getDeletedElement());
29193      }
29194      if (element.hasDateElement()) {
29195        composeDateTime("date", element.getDateElement());
29196      }
29197      if (element.hasItem()) {
29198        composeReference("item", element.getItem());
29199      }
29200  }
29201
29202  protected void composeLocation(String name, Location element) throws IOException {
29203    if (element != null) {
29204      composeDomainResourceAttributes(element);
29205      xml.enter(FHIR_NS, name);
29206      composeLocationElements(element);
29207      composeElementClose(element);
29208      xml.exit(FHIR_NS, name);
29209    }
29210  }
29211
29212  protected void composeLocationElements(Location element) throws IOException {
29213      composeDomainResourceElements(element);
29214      if (element.hasIdentifier()) { 
29215        for (Identifier e : element.getIdentifier()) 
29216          composeIdentifier("identifier", e);
29217      }
29218      if (element.hasStatusElement())
29219        composeEnumeration("status", element.getStatusElement(), new Location.LocationStatusEnumFactory());
29220      if (element.hasOperationalStatus()) {
29221        composeCoding("operationalStatus", element.getOperationalStatus());
29222      }
29223      if (element.hasNameElement()) {
29224        composeString("name", element.getNameElement());
29225      }
29226      if (element.hasAlias()) { 
29227        for (StringType e : element.getAlias()) 
29228          composeString("alias", e);
29229      }
29230      if (element.hasDescriptionElement()) {
29231        composeString("description", element.getDescriptionElement());
29232      }
29233      if (element.hasModeElement())
29234        composeEnumeration("mode", element.getModeElement(), new Location.LocationModeEnumFactory());
29235      if (element.hasType()) {
29236        composeCodeableConcept("type", element.getType());
29237      }
29238      if (element.hasTelecom()) { 
29239        for (ContactPoint e : element.getTelecom()) 
29240          composeContactPoint("telecom", e);
29241      }
29242      if (element.hasAddress()) {
29243        composeAddress("address", element.getAddress());
29244      }
29245      if (element.hasPhysicalType()) {
29246        composeCodeableConcept("physicalType", element.getPhysicalType());
29247      }
29248      if (element.hasPosition()) {
29249        composeLocationLocationPositionComponent("position", element.getPosition());
29250      }
29251      if (element.hasManagingOrganization()) {
29252        composeReference("managingOrganization", element.getManagingOrganization());
29253      }
29254      if (element.hasPartOf()) {
29255        composeReference("partOf", element.getPartOf());
29256      }
29257      if (element.hasEndpoint()) { 
29258        for (Reference e : element.getEndpoint()) 
29259          composeReference("endpoint", e);
29260      }
29261  }
29262
29263  protected void composeLocationLocationPositionComponent(String name, Location.LocationPositionComponent element) throws IOException {
29264    if (element != null) {
29265      composeElementAttributes(element);
29266      xml.enter(FHIR_NS, name);
29267      composeLocationLocationPositionComponentElements(element);
29268      composeElementClose(element);
29269      xml.exit(FHIR_NS, name);
29270    }
29271  }
29272
29273  protected void composeLocationLocationPositionComponentElements(Location.LocationPositionComponent element) throws IOException {
29274      composeBackboneElements(element);
29275      if (element.hasLongitudeElement()) {
29276        composeDecimal("longitude", element.getLongitudeElement());
29277      }
29278      if (element.hasLatitudeElement()) {
29279        composeDecimal("latitude", element.getLatitudeElement());
29280      }
29281      if (element.hasAltitudeElement()) {
29282        composeDecimal("altitude", element.getAltitudeElement());
29283      }
29284  }
29285
29286  protected void composeMeasure(String name, Measure element) throws IOException {
29287    if (element != null) {
29288      composeDomainResourceAttributes(element);
29289      xml.enter(FHIR_NS, name);
29290      composeMeasureElements(element);
29291      composeElementClose(element);
29292      xml.exit(FHIR_NS, name);
29293    }
29294  }
29295
29296  protected void composeMeasureElements(Measure element) throws IOException {
29297      composeDomainResourceElements(element);
29298      if (element.hasUrlElement()) {
29299        composeUri("url", element.getUrlElement());
29300      }
29301      if (element.hasIdentifier()) { 
29302        for (Identifier e : element.getIdentifier()) 
29303          composeIdentifier("identifier", e);
29304      }
29305      if (element.hasVersionElement()) {
29306        composeString("version", element.getVersionElement());
29307      }
29308      if (element.hasNameElement()) {
29309        composeString("name", element.getNameElement());
29310      }
29311      if (element.hasTitleElement()) {
29312        composeString("title", element.getTitleElement());
29313      }
29314      if (element.hasStatusElement())
29315        composeEnumeration("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory());
29316      if (element.hasExperimentalElement()) {
29317        composeBoolean("experimental", element.getExperimentalElement());
29318      }
29319      if (element.hasDateElement()) {
29320        composeDateTime("date", element.getDateElement());
29321      }
29322      if (element.hasPublisherElement()) {
29323        composeString("publisher", element.getPublisherElement());
29324      }
29325      if (element.hasDescriptionElement()) {
29326        composeMarkdown("description", element.getDescriptionElement());
29327      }
29328      if (element.hasPurposeElement()) {
29329        composeMarkdown("purpose", element.getPurposeElement());
29330      }
29331      if (element.hasUsageElement()) {
29332        composeString("usage", element.getUsageElement());
29333      }
29334      if (element.hasApprovalDateElement()) {
29335        composeDate("approvalDate", element.getApprovalDateElement());
29336      }
29337      if (element.hasLastReviewDateElement()) {
29338        composeDate("lastReviewDate", element.getLastReviewDateElement());
29339      }
29340      if (element.hasEffectivePeriod()) {
29341        composePeriod("effectivePeriod", element.getEffectivePeriod());
29342      }
29343      if (element.hasUseContext()) { 
29344        for (UsageContext e : element.getUseContext()) 
29345          composeUsageContext("useContext", e);
29346      }
29347      if (element.hasJurisdiction()) { 
29348        for (CodeableConcept e : element.getJurisdiction()) 
29349          composeCodeableConcept("jurisdiction", e);
29350      }
29351      if (element.hasTopic()) { 
29352        for (CodeableConcept e : element.getTopic()) 
29353          composeCodeableConcept("topic", e);
29354      }
29355      if (element.hasContributor()) { 
29356        for (Contributor e : element.getContributor()) 
29357          composeContributor("contributor", e);
29358      }
29359      if (element.hasContact()) { 
29360        for (ContactDetail e : element.getContact()) 
29361          composeContactDetail("contact", e);
29362      }
29363      if (element.hasCopyrightElement()) {
29364        composeMarkdown("copyright", element.getCopyrightElement());
29365      }
29366      if (element.hasRelatedArtifact()) { 
29367        for (RelatedArtifact e : element.getRelatedArtifact()) 
29368          composeRelatedArtifact("relatedArtifact", e);
29369      }
29370      if (element.hasLibrary()) { 
29371        for (Reference e : element.getLibrary()) 
29372          composeReference("library", e);
29373      }
29374      if (element.hasDisclaimerElement()) {
29375        composeMarkdown("disclaimer", element.getDisclaimerElement());
29376      }
29377      if (element.hasScoring()) {
29378        composeCodeableConcept("scoring", element.getScoring());
29379      }
29380      if (element.hasCompositeScoring()) {
29381        composeCodeableConcept("compositeScoring", element.getCompositeScoring());
29382      }
29383      if (element.hasType()) { 
29384        for (CodeableConcept e : element.getType()) 
29385          composeCodeableConcept("type", e);
29386      }
29387      if (element.hasRiskAdjustmentElement()) {
29388        composeString("riskAdjustment", element.getRiskAdjustmentElement());
29389      }
29390      if (element.hasRateAggregationElement()) {
29391        composeString("rateAggregation", element.getRateAggregationElement());
29392      }
29393      if (element.hasRationaleElement()) {
29394        composeMarkdown("rationale", element.getRationaleElement());
29395      }
29396      if (element.hasClinicalRecommendationStatementElement()) {
29397        composeMarkdown("clinicalRecommendationStatement", element.getClinicalRecommendationStatementElement());
29398      }
29399      if (element.hasImprovementNotationElement()) {
29400        composeString("improvementNotation", element.getImprovementNotationElement());
29401      }
29402      if (element.hasDefinition()) { 
29403        for (MarkdownType e : element.getDefinition()) 
29404          composeMarkdown("definition", e);
29405      }
29406      if (element.hasGuidanceElement()) {
29407        composeMarkdown("guidance", element.getGuidanceElement());
29408      }
29409      if (element.hasSetElement()) {
29410        composeString("set", element.getSetElement());
29411      }
29412      if (element.hasGroup()) { 
29413        for (Measure.MeasureGroupComponent e : element.getGroup()) 
29414          composeMeasureMeasureGroupComponent("group", e);
29415      }
29416      if (element.hasSupplementalData()) { 
29417        for (Measure.MeasureSupplementalDataComponent e : element.getSupplementalData()) 
29418          composeMeasureMeasureSupplementalDataComponent("supplementalData", e);
29419      }
29420  }
29421
29422  protected void composeMeasureMeasureGroupComponent(String name, Measure.MeasureGroupComponent element) throws IOException {
29423    if (element != null) {
29424      composeElementAttributes(element);
29425      xml.enter(FHIR_NS, name);
29426      composeMeasureMeasureGroupComponentElements(element);
29427      composeElementClose(element);
29428      xml.exit(FHIR_NS, name);
29429    }
29430  }
29431
29432  protected void composeMeasureMeasureGroupComponentElements(Measure.MeasureGroupComponent element) throws IOException {
29433      composeBackboneElements(element);
29434      if (element.hasIdentifier()) {
29435        composeIdentifier("identifier", element.getIdentifier());
29436      }
29437      if (element.hasNameElement()) {
29438        composeString("name", element.getNameElement());
29439      }
29440      if (element.hasDescriptionElement()) {
29441        composeString("description", element.getDescriptionElement());
29442      }
29443      if (element.hasPopulation()) { 
29444        for (Measure.MeasureGroupPopulationComponent e : element.getPopulation()) 
29445          composeMeasureMeasureGroupPopulationComponent("population", e);
29446      }
29447      if (element.hasStratifier()) { 
29448        for (Measure.MeasureGroupStratifierComponent e : element.getStratifier()) 
29449          composeMeasureMeasureGroupStratifierComponent("stratifier", e);
29450      }
29451  }
29452
29453  protected void composeMeasureMeasureGroupPopulationComponent(String name, Measure.MeasureGroupPopulationComponent element) throws IOException {
29454    if (element != null) {
29455      composeElementAttributes(element);
29456      xml.enter(FHIR_NS, name);
29457      composeMeasureMeasureGroupPopulationComponentElements(element);
29458      composeElementClose(element);
29459      xml.exit(FHIR_NS, name);
29460    }
29461  }
29462
29463  protected void composeMeasureMeasureGroupPopulationComponentElements(Measure.MeasureGroupPopulationComponent element) throws IOException {
29464      composeBackboneElements(element);
29465      if (element.hasIdentifier()) {
29466        composeIdentifier("identifier", element.getIdentifier());
29467      }
29468      if (element.hasCode()) {
29469        composeCodeableConcept("code", element.getCode());
29470      }
29471      if (element.hasNameElement()) {
29472        composeString("name", element.getNameElement());
29473      }
29474      if (element.hasDescriptionElement()) {
29475        composeString("description", element.getDescriptionElement());
29476      }
29477      if (element.hasCriteriaElement()) {
29478        composeString("criteria", element.getCriteriaElement());
29479      }
29480  }
29481
29482  protected void composeMeasureMeasureGroupStratifierComponent(String name, Measure.MeasureGroupStratifierComponent element) throws IOException {
29483    if (element != null) {
29484      composeElementAttributes(element);
29485      xml.enter(FHIR_NS, name);
29486      composeMeasureMeasureGroupStratifierComponentElements(element);
29487      composeElementClose(element);
29488      xml.exit(FHIR_NS, name);
29489    }
29490  }
29491
29492  protected void composeMeasureMeasureGroupStratifierComponentElements(Measure.MeasureGroupStratifierComponent element) throws IOException {
29493      composeBackboneElements(element);
29494      if (element.hasIdentifier()) {
29495        composeIdentifier("identifier", element.getIdentifier());
29496      }
29497      if (element.hasCriteriaElement()) {
29498        composeString("criteria", element.getCriteriaElement());
29499      }
29500      if (element.hasPathElement()) {
29501        composeString("path", element.getPathElement());
29502      }
29503  }
29504
29505  protected void composeMeasureMeasureSupplementalDataComponent(String name, Measure.MeasureSupplementalDataComponent element) throws IOException {
29506    if (element != null) {
29507      composeElementAttributes(element);
29508      xml.enter(FHIR_NS, name);
29509      composeMeasureMeasureSupplementalDataComponentElements(element);
29510      composeElementClose(element);
29511      xml.exit(FHIR_NS, name);
29512    }
29513  }
29514
29515  protected void composeMeasureMeasureSupplementalDataComponentElements(Measure.MeasureSupplementalDataComponent element) throws IOException {
29516      composeBackboneElements(element);
29517      if (element.hasIdentifier()) {
29518        composeIdentifier("identifier", element.getIdentifier());
29519      }
29520      if (element.hasUsage()) { 
29521        for (CodeableConcept e : element.getUsage()) 
29522          composeCodeableConcept("usage", e);
29523      }
29524      if (element.hasCriteriaElement()) {
29525        composeString("criteria", element.getCriteriaElement());
29526      }
29527      if (element.hasPathElement()) {
29528        composeString("path", element.getPathElement());
29529      }
29530  }
29531
29532  protected void composeMeasureReport(String name, MeasureReport element) throws IOException {
29533    if (element != null) {
29534      composeDomainResourceAttributes(element);
29535      xml.enter(FHIR_NS, name);
29536      composeMeasureReportElements(element);
29537      composeElementClose(element);
29538      xml.exit(FHIR_NS, name);
29539    }
29540  }
29541
29542  protected void composeMeasureReportElements(MeasureReport element) throws IOException {
29543      composeDomainResourceElements(element);
29544      if (element.hasIdentifier()) {
29545        composeIdentifier("identifier", element.getIdentifier());
29546      }
29547      if (element.hasStatusElement())
29548        composeEnumeration("status", element.getStatusElement(), new MeasureReport.MeasureReportStatusEnumFactory());
29549      if (element.hasTypeElement())
29550        composeEnumeration("type", element.getTypeElement(), new MeasureReport.MeasureReportTypeEnumFactory());
29551      if (element.hasMeasure()) {
29552        composeReference("measure", element.getMeasure());
29553      }
29554      if (element.hasPatient()) {
29555        composeReference("patient", element.getPatient());
29556      }
29557      if (element.hasDateElement()) {
29558        composeDateTime("date", element.getDateElement());
29559      }
29560      if (element.hasReportingOrganization()) {
29561        composeReference("reportingOrganization", element.getReportingOrganization());
29562      }
29563      if (element.hasPeriod()) {
29564        composePeriod("period", element.getPeriod());
29565      }
29566      if (element.hasGroup()) { 
29567        for (MeasureReport.MeasureReportGroupComponent e : element.getGroup()) 
29568          composeMeasureReportMeasureReportGroupComponent("group", e);
29569      }
29570      if (element.hasEvaluatedResources()) {
29571        composeReference("evaluatedResources", element.getEvaluatedResources());
29572      }
29573  }
29574
29575  protected void composeMeasureReportMeasureReportGroupComponent(String name, MeasureReport.MeasureReportGroupComponent element) throws IOException {
29576    if (element != null) {
29577      composeElementAttributes(element);
29578      xml.enter(FHIR_NS, name);
29579      composeMeasureReportMeasureReportGroupComponentElements(element);
29580      composeElementClose(element);
29581      xml.exit(FHIR_NS, name);
29582    }
29583  }
29584
29585  protected void composeMeasureReportMeasureReportGroupComponentElements(MeasureReport.MeasureReportGroupComponent element) throws IOException {
29586      composeBackboneElements(element);
29587      if (element.hasIdentifier()) {
29588        composeIdentifier("identifier", element.getIdentifier());
29589      }
29590      if (element.hasPopulation()) { 
29591        for (MeasureReport.MeasureReportGroupPopulationComponent e : element.getPopulation()) 
29592          composeMeasureReportMeasureReportGroupPopulationComponent("population", e);
29593      }
29594      if (element.hasMeasureScoreElement()) {
29595        composeDecimal("measureScore", element.getMeasureScoreElement());
29596      }
29597      if (element.hasStratifier()) { 
29598        for (MeasureReport.MeasureReportGroupStratifierComponent e : element.getStratifier()) 
29599          composeMeasureReportMeasureReportGroupStratifierComponent("stratifier", e);
29600      }
29601  }
29602
29603  protected void composeMeasureReportMeasureReportGroupPopulationComponent(String name, MeasureReport.MeasureReportGroupPopulationComponent element) throws IOException {
29604    if (element != null) {
29605      composeElementAttributes(element);
29606      xml.enter(FHIR_NS, name);
29607      composeMeasureReportMeasureReportGroupPopulationComponentElements(element);
29608      composeElementClose(element);
29609      xml.exit(FHIR_NS, name);
29610    }
29611  }
29612
29613  protected void composeMeasureReportMeasureReportGroupPopulationComponentElements(MeasureReport.MeasureReportGroupPopulationComponent element) throws IOException {
29614      composeBackboneElements(element);
29615      if (element.hasIdentifier()) {
29616        composeIdentifier("identifier", element.getIdentifier());
29617      }
29618      if (element.hasCode()) {
29619        composeCodeableConcept("code", element.getCode());
29620      }
29621      if (element.hasCountElement()) {
29622        composeInteger("count", element.getCountElement());
29623      }
29624      if (element.hasPatients()) {
29625        composeReference("patients", element.getPatients());
29626      }
29627  }
29628
29629  protected void composeMeasureReportMeasureReportGroupStratifierComponent(String name, MeasureReport.MeasureReportGroupStratifierComponent element) throws IOException {
29630    if (element != null) {
29631      composeElementAttributes(element);
29632      xml.enter(FHIR_NS, name);
29633      composeMeasureReportMeasureReportGroupStratifierComponentElements(element);
29634      composeElementClose(element);
29635      xml.exit(FHIR_NS, name);
29636    }
29637  }
29638
29639  protected void composeMeasureReportMeasureReportGroupStratifierComponentElements(MeasureReport.MeasureReportGroupStratifierComponent element) throws IOException {
29640      composeBackboneElements(element);
29641      if (element.hasIdentifier()) {
29642        composeIdentifier("identifier", element.getIdentifier());
29643      }
29644      if (element.hasStratum()) { 
29645        for (MeasureReport.StratifierGroupComponent e : element.getStratum()) 
29646          composeMeasureReportStratifierGroupComponent("stratum", e);
29647      }
29648  }
29649
29650  protected void composeMeasureReportStratifierGroupComponent(String name, MeasureReport.StratifierGroupComponent element) throws IOException {
29651    if (element != null) {
29652      composeElementAttributes(element);
29653      xml.enter(FHIR_NS, name);
29654      composeMeasureReportStratifierGroupComponentElements(element);
29655      composeElementClose(element);
29656      xml.exit(FHIR_NS, name);
29657    }
29658  }
29659
29660  protected void composeMeasureReportStratifierGroupComponentElements(MeasureReport.StratifierGroupComponent element) throws IOException {
29661      composeBackboneElements(element);
29662      if (element.hasValueElement()) {
29663        composeString("value", element.getValueElement());
29664      }
29665      if (element.hasPopulation()) { 
29666        for (MeasureReport.StratifierGroupPopulationComponent e : element.getPopulation()) 
29667          composeMeasureReportStratifierGroupPopulationComponent("population", e);
29668      }
29669      if (element.hasMeasureScoreElement()) {
29670        composeDecimal("measureScore", element.getMeasureScoreElement());
29671      }
29672  }
29673
29674  protected void composeMeasureReportStratifierGroupPopulationComponent(String name, MeasureReport.StratifierGroupPopulationComponent element) throws IOException {
29675    if (element != null) {
29676      composeElementAttributes(element);
29677      xml.enter(FHIR_NS, name);
29678      composeMeasureReportStratifierGroupPopulationComponentElements(element);
29679      composeElementClose(element);
29680      xml.exit(FHIR_NS, name);
29681    }
29682  }
29683
29684  protected void composeMeasureReportStratifierGroupPopulationComponentElements(MeasureReport.StratifierGroupPopulationComponent element) throws IOException {
29685      composeBackboneElements(element);
29686      if (element.hasIdentifier()) {
29687        composeIdentifier("identifier", element.getIdentifier());
29688      }
29689      if (element.hasCode()) {
29690        composeCodeableConcept("code", element.getCode());
29691      }
29692      if (element.hasCountElement()) {
29693        composeInteger("count", element.getCountElement());
29694      }
29695      if (element.hasPatients()) {
29696        composeReference("patients", element.getPatients());
29697      }
29698  }
29699
29700  protected void composeMedia(String name, Media element) throws IOException {
29701    if (element != null) {
29702      composeDomainResourceAttributes(element);
29703      xml.enter(FHIR_NS, name);
29704      composeMediaElements(element);
29705      composeElementClose(element);
29706      xml.exit(FHIR_NS, name);
29707    }
29708  }
29709
29710  protected void composeMediaElements(Media element) throws IOException {
29711      composeDomainResourceElements(element);
29712      if (element.hasIdentifier()) { 
29713        for (Identifier e : element.getIdentifier()) 
29714          composeIdentifier("identifier", e);
29715      }
29716      if (element.hasBasedOn()) { 
29717        for (Reference e : element.getBasedOn()) 
29718          composeReference("basedOn", e);
29719      }
29720      if (element.hasTypeElement())
29721        composeEnumeration("type", element.getTypeElement(), new Media.DigitalMediaTypeEnumFactory());
29722      if (element.hasSubtype()) {
29723        composeCodeableConcept("subtype", element.getSubtype());
29724      }
29725      if (element.hasView()) {
29726        composeCodeableConcept("view", element.getView());
29727      }
29728      if (element.hasSubject()) {
29729        composeReference("subject", element.getSubject());
29730      }
29731      if (element.hasContext()) {
29732        composeReference("context", element.getContext());
29733      }
29734      if (element.hasOccurrence()) {
29735        composeType("occurrence", element.getOccurrence());
29736      }      if (element.hasOperator()) {
29737        composeReference("operator", element.getOperator());
29738      }
29739      if (element.hasReasonCode()) { 
29740        for (CodeableConcept e : element.getReasonCode()) 
29741          composeCodeableConcept("reasonCode", e);
29742      }
29743      if (element.hasBodySite()) {
29744        composeCodeableConcept("bodySite", element.getBodySite());
29745      }
29746      if (element.hasDevice()) {
29747        composeReference("device", element.getDevice());
29748      }
29749      if (element.hasHeightElement()) {
29750        composePositiveInt("height", element.getHeightElement());
29751      }
29752      if (element.hasWidthElement()) {
29753        composePositiveInt("width", element.getWidthElement());
29754      }
29755      if (element.hasFramesElement()) {
29756        composePositiveInt("frames", element.getFramesElement());
29757      }
29758      if (element.hasDurationElement()) {
29759        composeUnsignedInt("duration", element.getDurationElement());
29760      }
29761      if (element.hasContent()) {
29762        composeAttachment("content", element.getContent());
29763      }
29764      if (element.hasNote()) { 
29765        for (Annotation e : element.getNote()) 
29766          composeAnnotation("note", e);
29767      }
29768  }
29769
29770  protected void composeMedication(String name, Medication element) throws IOException {
29771    if (element != null) {
29772      composeDomainResourceAttributes(element);
29773      xml.enter(FHIR_NS, name);
29774      composeMedicationElements(element);
29775      composeElementClose(element);
29776      xml.exit(FHIR_NS, name);
29777    }
29778  }
29779
29780  protected void composeMedicationElements(Medication element) throws IOException {
29781      composeDomainResourceElements(element);
29782      if (element.hasCode()) {
29783        composeCodeableConcept("code", element.getCode());
29784      }
29785      if (element.hasStatusElement())
29786        composeEnumeration("status", element.getStatusElement(), new Medication.MedicationStatusEnumFactory());
29787      if (element.hasIsBrandElement()) {
29788        composeBoolean("isBrand", element.getIsBrandElement());
29789      }
29790      if (element.hasIsOverTheCounterElement()) {
29791        composeBoolean("isOverTheCounter", element.getIsOverTheCounterElement());
29792      }
29793      if (element.hasManufacturer()) {
29794        composeReference("manufacturer", element.getManufacturer());
29795      }
29796      if (element.hasForm()) {
29797        composeCodeableConcept("form", element.getForm());
29798      }
29799      if (element.hasIngredient()) { 
29800        for (Medication.MedicationIngredientComponent e : element.getIngredient()) 
29801          composeMedicationMedicationIngredientComponent("ingredient", e);
29802      }
29803      if (element.hasPackage()) {
29804        composeMedicationMedicationPackageComponent("package", element.getPackage());
29805      }
29806      if (element.hasImage()) { 
29807        for (Attachment e : element.getImage()) 
29808          composeAttachment("image", e);
29809      }
29810  }
29811
29812  protected void composeMedicationMedicationIngredientComponent(String name, Medication.MedicationIngredientComponent element) throws IOException {
29813    if (element != null) {
29814      composeElementAttributes(element);
29815      xml.enter(FHIR_NS, name);
29816      composeMedicationMedicationIngredientComponentElements(element);
29817      composeElementClose(element);
29818      xml.exit(FHIR_NS, name);
29819    }
29820  }
29821
29822  protected void composeMedicationMedicationIngredientComponentElements(Medication.MedicationIngredientComponent element) throws IOException {
29823      composeBackboneElements(element);
29824      if (element.hasItem()) {
29825        composeType("item", element.getItem());
29826      }      if (element.hasIsActiveElement()) {
29827        composeBoolean("isActive", element.getIsActiveElement());
29828      }
29829      if (element.hasAmount()) {
29830        composeRatio("amount", element.getAmount());
29831      }
29832  }
29833
29834  protected void composeMedicationMedicationPackageComponent(String name, Medication.MedicationPackageComponent element) throws IOException {
29835    if (element != null) {
29836      composeElementAttributes(element);
29837      xml.enter(FHIR_NS, name);
29838      composeMedicationMedicationPackageComponentElements(element);
29839      composeElementClose(element);
29840      xml.exit(FHIR_NS, name);
29841    }
29842  }
29843
29844  protected void composeMedicationMedicationPackageComponentElements(Medication.MedicationPackageComponent element) throws IOException {
29845      composeBackboneElements(element);
29846      if (element.hasContainer()) {
29847        composeCodeableConcept("container", element.getContainer());
29848      }
29849      if (element.hasContent()) { 
29850        for (Medication.MedicationPackageContentComponent e : element.getContent()) 
29851          composeMedicationMedicationPackageContentComponent("content", e);
29852      }
29853      if (element.hasBatch()) { 
29854        for (Medication.MedicationPackageBatchComponent e : element.getBatch()) 
29855          composeMedicationMedicationPackageBatchComponent("batch", e);
29856      }
29857  }
29858
29859  protected void composeMedicationMedicationPackageContentComponent(String name, Medication.MedicationPackageContentComponent element) throws IOException {
29860    if (element != null) {
29861      composeElementAttributes(element);
29862      xml.enter(FHIR_NS, name);
29863      composeMedicationMedicationPackageContentComponentElements(element);
29864      composeElementClose(element);
29865      xml.exit(FHIR_NS, name);
29866    }
29867  }
29868
29869  protected void composeMedicationMedicationPackageContentComponentElements(Medication.MedicationPackageContentComponent element) throws IOException {
29870      composeBackboneElements(element);
29871      if (element.hasItem()) {
29872        composeType("item", element.getItem());
29873      }      if (element.hasAmount()) {
29874        composeSimpleQuantity("amount", element.getAmount());
29875      }
29876  }
29877
29878  protected void composeMedicationMedicationPackageBatchComponent(String name, Medication.MedicationPackageBatchComponent element) throws IOException {
29879    if (element != null) {
29880      composeElementAttributes(element);
29881      xml.enter(FHIR_NS, name);
29882      composeMedicationMedicationPackageBatchComponentElements(element);
29883      composeElementClose(element);
29884      xml.exit(FHIR_NS, name);
29885    }
29886  }
29887
29888  protected void composeMedicationMedicationPackageBatchComponentElements(Medication.MedicationPackageBatchComponent element) throws IOException {
29889      composeBackboneElements(element);
29890      if (element.hasLotNumberElement()) {
29891        composeString("lotNumber", element.getLotNumberElement());
29892      }
29893      if (element.hasExpirationDateElement()) {
29894        composeDateTime("expirationDate", element.getExpirationDateElement());
29895      }
29896  }
29897
29898  protected void composeMedicationAdministration(String name, MedicationAdministration element) throws IOException {
29899    if (element != null) {
29900      composeDomainResourceAttributes(element);
29901      xml.enter(FHIR_NS, name);
29902      composeMedicationAdministrationElements(element);
29903      composeElementClose(element);
29904      xml.exit(FHIR_NS, name);
29905    }
29906  }
29907
29908  protected void composeMedicationAdministrationElements(MedicationAdministration element) throws IOException {
29909      composeDomainResourceElements(element);
29910      if (element.hasIdentifier()) { 
29911        for (Identifier e : element.getIdentifier()) 
29912          composeIdentifier("identifier", e);
29913      }
29914      if (element.hasDefinition()) { 
29915        for (Reference e : element.getDefinition()) 
29916          composeReference("definition", e);
29917      }
29918      if (element.hasPartOf()) { 
29919        for (Reference e : element.getPartOf()) 
29920          composeReference("partOf", e);
29921      }
29922      if (element.hasStatusElement())
29923        composeEnumeration("status", element.getStatusElement(), new MedicationAdministration.MedicationAdministrationStatusEnumFactory());
29924      if (element.hasCategory()) {
29925        composeCodeableConcept("category", element.getCategory());
29926      }
29927      if (element.hasMedication()) {
29928        composeType("medication", element.getMedication());
29929      }      if (element.hasSubject()) {
29930        composeReference("subject", element.getSubject());
29931      }
29932      if (element.hasContext()) {
29933        composeReference("context", element.getContext());
29934      }
29935      if (element.hasSupportingInformation()) { 
29936        for (Reference e : element.getSupportingInformation()) 
29937          composeReference("supportingInformation", e);
29938      }
29939      if (element.hasEffective()) {
29940        composeType("effective", element.getEffective());
29941      }      if (element.hasPerformer()) { 
29942        for (MedicationAdministration.MedicationAdministrationPerformerComponent e : element.getPerformer()) 
29943          composeMedicationAdministrationMedicationAdministrationPerformerComponent("performer", e);
29944      }
29945      if (element.hasNotGivenElement()) {
29946        composeBoolean("notGiven", element.getNotGivenElement());
29947      }
29948      if (element.hasReasonNotGiven()) { 
29949        for (CodeableConcept e : element.getReasonNotGiven()) 
29950          composeCodeableConcept("reasonNotGiven", e);
29951      }
29952      if (element.hasReasonCode()) { 
29953        for (CodeableConcept e : element.getReasonCode()) 
29954          composeCodeableConcept("reasonCode", e);
29955      }
29956      if (element.hasReasonReference()) { 
29957        for (Reference e : element.getReasonReference()) 
29958          composeReference("reasonReference", e);
29959      }
29960      if (element.hasPrescription()) {
29961        composeReference("prescription", element.getPrescription());
29962      }
29963      if (element.hasDevice()) { 
29964        for (Reference e : element.getDevice()) 
29965          composeReference("device", e);
29966      }
29967      if (element.hasNote()) { 
29968        for (Annotation e : element.getNote()) 
29969          composeAnnotation("note", e);
29970      }
29971      if (element.hasDosage()) {
29972        composeMedicationAdministrationMedicationAdministrationDosageComponent("dosage", element.getDosage());
29973      }
29974      if (element.hasEventHistory()) { 
29975        for (Reference e : element.getEventHistory()) 
29976          composeReference("eventHistory", e);
29977      }
29978  }
29979
29980  protected void composeMedicationAdministrationMedicationAdministrationPerformerComponent(String name, MedicationAdministration.MedicationAdministrationPerformerComponent element) throws IOException {
29981    if (element != null) {
29982      composeElementAttributes(element);
29983      xml.enter(FHIR_NS, name);
29984      composeMedicationAdministrationMedicationAdministrationPerformerComponentElements(element);
29985      composeElementClose(element);
29986      xml.exit(FHIR_NS, name);
29987    }
29988  }
29989
29990  protected void composeMedicationAdministrationMedicationAdministrationPerformerComponentElements(MedicationAdministration.MedicationAdministrationPerformerComponent element) throws IOException {
29991      composeBackboneElements(element);
29992      if (element.hasActor()) {
29993        composeReference("actor", element.getActor());
29994      }
29995      if (element.hasOnBehalfOf()) {
29996        composeReference("onBehalfOf", element.getOnBehalfOf());
29997      }
29998  }
29999
30000  protected void composeMedicationAdministrationMedicationAdministrationDosageComponent(String name, MedicationAdministration.MedicationAdministrationDosageComponent element) throws IOException {
30001    if (element != null) {
30002      composeElementAttributes(element);
30003      xml.enter(FHIR_NS, name);
30004      composeMedicationAdministrationMedicationAdministrationDosageComponentElements(element);
30005      composeElementClose(element);
30006      xml.exit(FHIR_NS, name);
30007    }
30008  }
30009
30010  protected void composeMedicationAdministrationMedicationAdministrationDosageComponentElements(MedicationAdministration.MedicationAdministrationDosageComponent element) throws IOException {
30011      composeBackboneElements(element);
30012      if (element.hasTextElement()) {
30013        composeString("text", element.getTextElement());
30014      }
30015      if (element.hasSite()) {
30016        composeCodeableConcept("site", element.getSite());
30017      }
30018      if (element.hasRoute()) {
30019        composeCodeableConcept("route", element.getRoute());
30020      }
30021      if (element.hasMethod()) {
30022        composeCodeableConcept("method", element.getMethod());
30023      }
30024      if (element.hasDose()) {
30025        composeSimpleQuantity("dose", element.getDose());
30026      }
30027      if (element.hasRate()) {
30028        composeType("rate", element.getRate());
30029      }  }
30030
30031  protected void composeMedicationDispense(String name, MedicationDispense element) throws IOException {
30032    if (element != null) {
30033      composeDomainResourceAttributes(element);
30034      xml.enter(FHIR_NS, name);
30035      composeMedicationDispenseElements(element);
30036      composeElementClose(element);
30037      xml.exit(FHIR_NS, name);
30038    }
30039  }
30040
30041  protected void composeMedicationDispenseElements(MedicationDispense element) throws IOException {
30042      composeDomainResourceElements(element);
30043      if (element.hasIdentifier()) { 
30044        for (Identifier e : element.getIdentifier()) 
30045          composeIdentifier("identifier", e);
30046      }
30047      if (element.hasPartOf()) { 
30048        for (Reference e : element.getPartOf()) 
30049          composeReference("partOf", e);
30050      }
30051      if (element.hasStatusElement())
30052        composeEnumeration("status", element.getStatusElement(), new MedicationDispense.MedicationDispenseStatusEnumFactory());
30053      if (element.hasCategory()) {
30054        composeCodeableConcept("category", element.getCategory());
30055      }
30056      if (element.hasMedication()) {
30057        composeType("medication", element.getMedication());
30058      }      if (element.hasSubject()) {
30059        composeReference("subject", element.getSubject());
30060      }
30061      if (element.hasContext()) {
30062        composeReference("context", element.getContext());
30063      }
30064      if (element.hasSupportingInformation()) { 
30065        for (Reference e : element.getSupportingInformation()) 
30066          composeReference("supportingInformation", e);
30067      }
30068      if (element.hasPerformer()) { 
30069        for (MedicationDispense.MedicationDispensePerformerComponent e : element.getPerformer()) 
30070          composeMedicationDispenseMedicationDispensePerformerComponent("performer", e);
30071      }
30072      if (element.hasAuthorizingPrescription()) { 
30073        for (Reference e : element.getAuthorizingPrescription()) 
30074          composeReference("authorizingPrescription", e);
30075      }
30076      if (element.hasType()) {
30077        composeCodeableConcept("type", element.getType());
30078      }
30079      if (element.hasQuantity()) {
30080        composeSimpleQuantity("quantity", element.getQuantity());
30081      }
30082      if (element.hasDaysSupply()) {
30083        composeSimpleQuantity("daysSupply", element.getDaysSupply());
30084      }
30085      if (element.hasWhenPreparedElement()) {
30086        composeDateTime("whenPrepared", element.getWhenPreparedElement());
30087      }
30088      if (element.hasWhenHandedOverElement()) {
30089        composeDateTime("whenHandedOver", element.getWhenHandedOverElement());
30090      }
30091      if (element.hasDestination()) {
30092        composeReference("destination", element.getDestination());
30093      }
30094      if (element.hasReceiver()) { 
30095        for (Reference e : element.getReceiver()) 
30096          composeReference("receiver", e);
30097      }
30098      if (element.hasNote()) { 
30099        for (Annotation e : element.getNote()) 
30100          composeAnnotation("note", e);
30101      }
30102      if (element.hasDosageInstruction()) { 
30103        for (Dosage e : element.getDosageInstruction()) 
30104          composeDosage("dosageInstruction", e);
30105      }
30106      if (element.hasSubstitution()) {
30107        composeMedicationDispenseMedicationDispenseSubstitutionComponent("substitution", element.getSubstitution());
30108      }
30109      if (element.hasDetectedIssue()) { 
30110        for (Reference e : element.getDetectedIssue()) 
30111          composeReference("detectedIssue", e);
30112      }
30113      if (element.hasNotDoneElement()) {
30114        composeBoolean("notDone", element.getNotDoneElement());
30115      }
30116      if (element.hasNotDoneReason()) {
30117        composeType("notDoneReason", element.getNotDoneReason());
30118      }      if (element.hasEventHistory()) { 
30119        for (Reference e : element.getEventHistory()) 
30120          composeReference("eventHistory", e);
30121      }
30122  }
30123
30124  protected void composeMedicationDispenseMedicationDispensePerformerComponent(String name, MedicationDispense.MedicationDispensePerformerComponent element) throws IOException {
30125    if (element != null) {
30126      composeElementAttributes(element);
30127      xml.enter(FHIR_NS, name);
30128      composeMedicationDispenseMedicationDispensePerformerComponentElements(element);
30129      composeElementClose(element);
30130      xml.exit(FHIR_NS, name);
30131    }
30132  }
30133
30134  protected void composeMedicationDispenseMedicationDispensePerformerComponentElements(MedicationDispense.MedicationDispensePerformerComponent element) throws IOException {
30135      composeBackboneElements(element);
30136      if (element.hasActor()) {
30137        composeReference("actor", element.getActor());
30138      }
30139      if (element.hasOnBehalfOf()) {
30140        composeReference("onBehalfOf", element.getOnBehalfOf());
30141      }
30142  }
30143
30144  protected void composeMedicationDispenseMedicationDispenseSubstitutionComponent(String name, MedicationDispense.MedicationDispenseSubstitutionComponent element) throws IOException {
30145    if (element != null) {
30146      composeElementAttributes(element);
30147      xml.enter(FHIR_NS, name);
30148      composeMedicationDispenseMedicationDispenseSubstitutionComponentElements(element);
30149      composeElementClose(element);
30150      xml.exit(FHIR_NS, name);
30151    }
30152  }
30153
30154  protected void composeMedicationDispenseMedicationDispenseSubstitutionComponentElements(MedicationDispense.MedicationDispenseSubstitutionComponent element) throws IOException {
30155      composeBackboneElements(element);
30156      if (element.hasWasSubstitutedElement()) {
30157        composeBoolean("wasSubstituted", element.getWasSubstitutedElement());
30158      }
30159      if (element.hasType()) {
30160        composeCodeableConcept("type", element.getType());
30161      }
30162      if (element.hasReason()) { 
30163        for (CodeableConcept e : element.getReason()) 
30164          composeCodeableConcept("reason", e);
30165      }
30166      if (element.hasResponsibleParty()) { 
30167        for (Reference e : element.getResponsibleParty()) 
30168          composeReference("responsibleParty", e);
30169      }
30170  }
30171
30172  protected void composeMedicationRequest(String name, MedicationRequest element) throws IOException {
30173    if (element != null) {
30174      composeDomainResourceAttributes(element);
30175      xml.enter(FHIR_NS, name);
30176      composeMedicationRequestElements(element);
30177      composeElementClose(element);
30178      xml.exit(FHIR_NS, name);
30179    }
30180  }
30181
30182  protected void composeMedicationRequestElements(MedicationRequest element) throws IOException {
30183      composeDomainResourceElements(element);
30184      if (element.hasIdentifier()) { 
30185        for (Identifier e : element.getIdentifier()) 
30186          composeIdentifier("identifier", e);
30187      }
30188      if (element.hasDefinition()) { 
30189        for (Reference e : element.getDefinition()) 
30190          composeReference("definition", e);
30191      }
30192      if (element.hasBasedOn()) { 
30193        for (Reference e : element.getBasedOn()) 
30194          composeReference("basedOn", e);
30195      }
30196      if (element.hasGroupIdentifier()) {
30197        composeIdentifier("groupIdentifier", element.getGroupIdentifier());
30198      }
30199      if (element.hasStatusElement())
30200        composeEnumeration("status", element.getStatusElement(), new MedicationRequest.MedicationRequestStatusEnumFactory());
30201      if (element.hasIntentElement())
30202        composeEnumeration("intent", element.getIntentElement(), new MedicationRequest.MedicationRequestIntentEnumFactory());
30203      if (element.hasCategory()) {
30204        composeCodeableConcept("category", element.getCategory());
30205      }
30206      if (element.hasPriorityElement())
30207        composeEnumeration("priority", element.getPriorityElement(), new MedicationRequest.MedicationRequestPriorityEnumFactory());
30208      if (element.hasMedication()) {
30209        composeType("medication", element.getMedication());
30210      }      if (element.hasSubject()) {
30211        composeReference("subject", element.getSubject());
30212      }
30213      if (element.hasContext()) {
30214        composeReference("context", element.getContext());
30215      }
30216      if (element.hasSupportingInformation()) { 
30217        for (Reference e : element.getSupportingInformation()) 
30218          composeReference("supportingInformation", e);
30219      }
30220      if (element.hasAuthoredOnElement()) {
30221        composeDateTime("authoredOn", element.getAuthoredOnElement());
30222      }
30223      if (element.hasRequester()) {
30224        composeMedicationRequestMedicationRequestRequesterComponent("requester", element.getRequester());
30225      }
30226      if (element.hasRecorder()) {
30227        composeReference("recorder", element.getRecorder());
30228      }
30229      if (element.hasReasonCode()) { 
30230        for (CodeableConcept e : element.getReasonCode()) 
30231          composeCodeableConcept("reasonCode", e);
30232      }
30233      if (element.hasReasonReference()) { 
30234        for (Reference e : element.getReasonReference()) 
30235          composeReference("reasonReference", e);
30236      }
30237      if (element.hasNote()) { 
30238        for (Annotation e : element.getNote()) 
30239          composeAnnotation("note", e);
30240      }
30241      if (element.hasDosageInstruction()) { 
30242        for (Dosage e : element.getDosageInstruction()) 
30243          composeDosage("dosageInstruction", e);
30244      }
30245      if (element.hasDispenseRequest()) {
30246        composeMedicationRequestMedicationRequestDispenseRequestComponent("dispenseRequest", element.getDispenseRequest());
30247      }
30248      if (element.hasSubstitution()) {
30249        composeMedicationRequestMedicationRequestSubstitutionComponent("substitution", element.getSubstitution());
30250      }
30251      if (element.hasPriorPrescription()) {
30252        composeReference("priorPrescription", element.getPriorPrescription());
30253      }
30254      if (element.hasDetectedIssue()) { 
30255        for (Reference e : element.getDetectedIssue()) 
30256          composeReference("detectedIssue", e);
30257      }
30258      if (element.hasEventHistory()) { 
30259        for (Reference e : element.getEventHistory()) 
30260          composeReference("eventHistory", e);
30261      }
30262  }
30263
30264  protected void composeMedicationRequestMedicationRequestRequesterComponent(String name, MedicationRequest.MedicationRequestRequesterComponent element) throws IOException {
30265    if (element != null) {
30266      composeElementAttributes(element);
30267      xml.enter(FHIR_NS, name);
30268      composeMedicationRequestMedicationRequestRequesterComponentElements(element);
30269      composeElementClose(element);
30270      xml.exit(FHIR_NS, name);
30271    }
30272  }
30273
30274  protected void composeMedicationRequestMedicationRequestRequesterComponentElements(MedicationRequest.MedicationRequestRequesterComponent element) throws IOException {
30275      composeBackboneElements(element);
30276      if (element.hasAgent()) {
30277        composeReference("agent", element.getAgent());
30278      }
30279      if (element.hasOnBehalfOf()) {
30280        composeReference("onBehalfOf", element.getOnBehalfOf());
30281      }
30282  }
30283
30284  protected void composeMedicationRequestMedicationRequestDispenseRequestComponent(String name, MedicationRequest.MedicationRequestDispenseRequestComponent element) throws IOException {
30285    if (element != null) {
30286      composeElementAttributes(element);
30287      xml.enter(FHIR_NS, name);
30288      composeMedicationRequestMedicationRequestDispenseRequestComponentElements(element);
30289      composeElementClose(element);
30290      xml.exit(FHIR_NS, name);
30291    }
30292  }
30293
30294  protected void composeMedicationRequestMedicationRequestDispenseRequestComponentElements(MedicationRequest.MedicationRequestDispenseRequestComponent element) throws IOException {
30295      composeBackboneElements(element);
30296      if (element.hasValidityPeriod()) {
30297        composePeriod("validityPeriod", element.getValidityPeriod());
30298      }
30299      if (element.hasNumberOfRepeatsAllowedElement()) {
30300        composePositiveInt("numberOfRepeatsAllowed", element.getNumberOfRepeatsAllowedElement());
30301      }
30302      if (element.hasQuantity()) {
30303        composeSimpleQuantity("quantity", element.getQuantity());
30304      }
30305      if (element.hasExpectedSupplyDuration()) {
30306        composeDuration("expectedSupplyDuration", element.getExpectedSupplyDuration());
30307      }
30308      if (element.hasPerformer()) {
30309        composeReference("performer", element.getPerformer());
30310      }
30311  }
30312
30313  protected void composeMedicationRequestMedicationRequestSubstitutionComponent(String name, MedicationRequest.MedicationRequestSubstitutionComponent element) throws IOException {
30314    if (element != null) {
30315      composeElementAttributes(element);
30316      xml.enter(FHIR_NS, name);
30317      composeMedicationRequestMedicationRequestSubstitutionComponentElements(element);
30318      composeElementClose(element);
30319      xml.exit(FHIR_NS, name);
30320    }
30321  }
30322
30323  protected void composeMedicationRequestMedicationRequestSubstitutionComponentElements(MedicationRequest.MedicationRequestSubstitutionComponent element) throws IOException {
30324      composeBackboneElements(element);
30325      if (element.hasAllowedElement()) {
30326        composeBoolean("allowed", element.getAllowedElement());
30327      }
30328      if (element.hasReason()) {
30329        composeCodeableConcept("reason", element.getReason());
30330      }
30331  }
30332
30333  protected void composeMedicationStatement(String name, MedicationStatement element) throws IOException {
30334    if (element != null) {
30335      composeDomainResourceAttributes(element);
30336      xml.enter(FHIR_NS, name);
30337      composeMedicationStatementElements(element);
30338      composeElementClose(element);
30339      xml.exit(FHIR_NS, name);
30340    }
30341  }
30342
30343  protected void composeMedicationStatementElements(MedicationStatement element) throws IOException {
30344      composeDomainResourceElements(element);
30345      if (element.hasIdentifier()) { 
30346        for (Identifier e : element.getIdentifier()) 
30347          composeIdentifier("identifier", e);
30348      }
30349      if (element.hasBasedOn()) { 
30350        for (Reference e : element.getBasedOn()) 
30351          composeReference("basedOn", e);
30352      }
30353      if (element.hasPartOf()) { 
30354        for (Reference e : element.getPartOf()) 
30355          composeReference("partOf", e);
30356      }
30357      if (element.hasContext()) {
30358        composeReference("context", element.getContext());
30359      }
30360      if (element.hasStatusElement())
30361        composeEnumeration("status", element.getStatusElement(), new MedicationStatement.MedicationStatementStatusEnumFactory());
30362      if (element.hasCategory()) {
30363        composeCodeableConcept("category", element.getCategory());
30364      }
30365      if (element.hasMedication()) {
30366        composeType("medication", element.getMedication());
30367      }      if (element.hasEffective()) {
30368        composeType("effective", element.getEffective());
30369      }      if (element.hasDateAssertedElement()) {
30370        composeDateTime("dateAsserted", element.getDateAssertedElement());
30371      }
30372      if (element.hasInformationSource()) {
30373        composeReference("informationSource", element.getInformationSource());
30374      }
30375      if (element.hasSubject()) {
30376        composeReference("subject", element.getSubject());
30377      }
30378      if (element.hasDerivedFrom()) { 
30379        for (Reference e : element.getDerivedFrom()) 
30380          composeReference("derivedFrom", e);
30381      }
30382      if (element.hasTakenElement())
30383        composeEnumeration("taken", element.getTakenElement(), new MedicationStatement.MedicationStatementTakenEnumFactory());
30384      if (element.hasReasonNotTaken()) { 
30385        for (CodeableConcept e : element.getReasonNotTaken()) 
30386          composeCodeableConcept("reasonNotTaken", e);
30387      }
30388      if (element.hasReasonCode()) { 
30389        for (CodeableConcept e : element.getReasonCode()) 
30390          composeCodeableConcept("reasonCode", e);
30391      }
30392      if (element.hasReasonReference()) { 
30393        for (Reference e : element.getReasonReference()) 
30394          composeReference("reasonReference", e);
30395      }
30396      if (element.hasNote()) { 
30397        for (Annotation e : element.getNote()) 
30398          composeAnnotation("note", e);
30399      }
30400      if (element.hasDosage()) { 
30401        for (Dosage e : element.getDosage()) 
30402          composeDosage("dosage", e);
30403      }
30404  }
30405
30406  protected void composeMessageDefinition(String name, MessageDefinition element) throws IOException {
30407    if (element != null) {
30408      composeDomainResourceAttributes(element);
30409      xml.enter(FHIR_NS, name);
30410      composeMessageDefinitionElements(element);
30411      composeElementClose(element);
30412      xml.exit(FHIR_NS, name);
30413    }
30414  }
30415
30416  protected void composeMessageDefinitionElements(MessageDefinition element) throws IOException {
30417      composeDomainResourceElements(element);
30418      if (element.hasUrlElement()) {
30419        composeUri("url", element.getUrlElement());
30420      }
30421      if (element.hasIdentifier()) {
30422        composeIdentifier("identifier", element.getIdentifier());
30423      }
30424      if (element.hasVersionElement()) {
30425        composeString("version", element.getVersionElement());
30426      }
30427      if (element.hasNameElement()) {
30428        composeString("name", element.getNameElement());
30429      }
30430      if (element.hasTitleElement()) {
30431        composeString("title", element.getTitleElement());
30432      }
30433      if (element.hasStatusElement())
30434        composeEnumeration("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory());
30435      if (element.hasExperimentalElement()) {
30436        composeBoolean("experimental", element.getExperimentalElement());
30437      }
30438      if (element.hasDateElement()) {
30439        composeDateTime("date", element.getDateElement());
30440      }
30441      if (element.hasPublisherElement()) {
30442        composeString("publisher", element.getPublisherElement());
30443      }
30444      if (element.hasContact()) { 
30445        for (ContactDetail e : element.getContact()) 
30446          composeContactDetail("contact", e);
30447      }
30448      if (element.hasDescriptionElement()) {
30449        composeMarkdown("description", element.getDescriptionElement());
30450      }
30451      if (element.hasUseContext()) { 
30452        for (UsageContext e : element.getUseContext()) 
30453          composeUsageContext("useContext", e);
30454      }
30455      if (element.hasJurisdiction()) { 
30456        for (CodeableConcept e : element.getJurisdiction()) 
30457          composeCodeableConcept("jurisdiction", e);
30458      }
30459      if (element.hasPurposeElement()) {
30460        composeMarkdown("purpose", element.getPurposeElement());
30461      }
30462      if (element.hasCopyrightElement()) {
30463        composeMarkdown("copyright", element.getCopyrightElement());
30464      }
30465      if (element.hasBase()) {
30466        composeReference("base", element.getBase());
30467      }
30468      if (element.hasParent()) { 
30469        for (Reference e : element.getParent()) 
30470          composeReference("parent", e);
30471      }
30472      if (element.hasReplaces()) { 
30473        for (Reference e : element.getReplaces()) 
30474          composeReference("replaces", e);
30475      }
30476      if (element.hasEvent()) {
30477        composeCoding("event", element.getEvent());
30478      }
30479      if (element.hasCategoryElement())
30480        composeEnumeration("category", element.getCategoryElement(), new MessageDefinition.MessageSignificanceCategoryEnumFactory());
30481      if (element.hasFocus()) { 
30482        for (MessageDefinition.MessageDefinitionFocusComponent e : element.getFocus()) 
30483          composeMessageDefinitionMessageDefinitionFocusComponent("focus", e);
30484      }
30485      if (element.hasResponseRequiredElement()) {
30486        composeBoolean("responseRequired", element.getResponseRequiredElement());
30487      }
30488      if (element.hasAllowedResponse()) { 
30489        for (MessageDefinition.MessageDefinitionAllowedResponseComponent e : element.getAllowedResponse()) 
30490          composeMessageDefinitionMessageDefinitionAllowedResponseComponent("allowedResponse", e);
30491      }
30492  }
30493
30494  protected void composeMessageDefinitionMessageDefinitionFocusComponent(String name, MessageDefinition.MessageDefinitionFocusComponent element) throws IOException {
30495    if (element != null) {
30496      composeElementAttributes(element);
30497      xml.enter(FHIR_NS, name);
30498      composeMessageDefinitionMessageDefinitionFocusComponentElements(element);
30499      composeElementClose(element);
30500      xml.exit(FHIR_NS, name);
30501    }
30502  }
30503
30504  protected void composeMessageDefinitionMessageDefinitionFocusComponentElements(MessageDefinition.MessageDefinitionFocusComponent element) throws IOException {
30505      composeBackboneElements(element);
30506      if (element.hasCodeElement()) {
30507        composeCode("code", element.getCodeElement());
30508      }
30509      if (element.hasProfile()) {
30510        composeReference("profile", element.getProfile());
30511      }
30512      if (element.hasMinElement()) {
30513        composeUnsignedInt("min", element.getMinElement());
30514      }
30515      if (element.hasMaxElement()) {
30516        composeString("max", element.getMaxElement());
30517      }
30518  }
30519
30520  protected void composeMessageDefinitionMessageDefinitionAllowedResponseComponent(String name, MessageDefinition.MessageDefinitionAllowedResponseComponent element) throws IOException {
30521    if (element != null) {
30522      composeElementAttributes(element);
30523      xml.enter(FHIR_NS, name);
30524      composeMessageDefinitionMessageDefinitionAllowedResponseComponentElements(element);
30525      composeElementClose(element);
30526      xml.exit(FHIR_NS, name);
30527    }
30528  }
30529
30530  protected void composeMessageDefinitionMessageDefinitionAllowedResponseComponentElements(MessageDefinition.MessageDefinitionAllowedResponseComponent element) throws IOException {
30531      composeBackboneElements(element);
30532      if (element.hasMessage()) {
30533        composeReference("message", element.getMessage());
30534      }
30535      if (element.hasSituationElement()) {
30536        composeMarkdown("situation", element.getSituationElement());
30537      }
30538  }
30539
30540  protected void composeMessageHeader(String name, MessageHeader element) throws IOException {
30541    if (element != null) {
30542      composeDomainResourceAttributes(element);
30543      xml.enter(FHIR_NS, name);
30544      composeMessageHeaderElements(element);
30545      composeElementClose(element);
30546      xml.exit(FHIR_NS, name);
30547    }
30548  }
30549
30550  protected void composeMessageHeaderElements(MessageHeader element) throws IOException {
30551      composeDomainResourceElements(element);
30552      if (element.hasEvent()) {
30553        composeCoding("event", element.getEvent());
30554      }
30555      if (element.hasDestination()) { 
30556        for (MessageHeader.MessageDestinationComponent e : element.getDestination()) 
30557          composeMessageHeaderMessageDestinationComponent("destination", e);
30558      }
30559      if (element.hasReceiver()) {
30560        composeReference("receiver", element.getReceiver());
30561      }
30562      if (element.hasSender()) {
30563        composeReference("sender", element.getSender());
30564      }
30565      if (element.hasTimestampElement()) {
30566        composeInstant("timestamp", element.getTimestampElement());
30567      }
30568      if (element.hasEnterer()) {
30569        composeReference("enterer", element.getEnterer());
30570      }
30571      if (element.hasAuthor()) {
30572        composeReference("author", element.getAuthor());
30573      }
30574      if (element.hasSource()) {
30575        composeMessageHeaderMessageSourceComponent("source", element.getSource());
30576      }
30577      if (element.hasResponsible()) {
30578        composeReference("responsible", element.getResponsible());
30579      }
30580      if (element.hasReason()) {
30581        composeCodeableConcept("reason", element.getReason());
30582      }
30583      if (element.hasResponse()) {
30584        composeMessageHeaderMessageHeaderResponseComponent("response", element.getResponse());
30585      }
30586      if (element.hasFocus()) { 
30587        for (Reference e : element.getFocus()) 
30588          composeReference("focus", e);
30589      }
30590  }
30591
30592  protected void composeMessageHeaderMessageDestinationComponent(String name, MessageHeader.MessageDestinationComponent element) throws IOException {
30593    if (element != null) {
30594      composeElementAttributes(element);
30595      xml.enter(FHIR_NS, name);
30596      composeMessageHeaderMessageDestinationComponentElements(element);
30597      composeElementClose(element);
30598      xml.exit(FHIR_NS, name);
30599    }
30600  }
30601
30602  protected void composeMessageHeaderMessageDestinationComponentElements(MessageHeader.MessageDestinationComponent element) throws IOException {
30603      composeBackboneElements(element);
30604      if (element.hasNameElement()) {
30605        composeString("name", element.getNameElement());
30606      }
30607      if (element.hasTarget()) {
30608        composeReference("target", element.getTarget());
30609      }
30610      if (element.hasEndpointElement()) {
30611        composeUri("endpoint", element.getEndpointElement());
30612      }
30613  }
30614
30615  protected void composeMessageHeaderMessageSourceComponent(String name, MessageHeader.MessageSourceComponent element) throws IOException {
30616    if (element != null) {
30617      composeElementAttributes(element);
30618      xml.enter(FHIR_NS, name);
30619      composeMessageHeaderMessageSourceComponentElements(element);
30620      composeElementClose(element);
30621      xml.exit(FHIR_NS, name);
30622    }
30623  }
30624
30625  protected void composeMessageHeaderMessageSourceComponentElements(MessageHeader.MessageSourceComponent element) throws IOException {
30626      composeBackboneElements(element);
30627      if (element.hasNameElement()) {
30628        composeString("name", element.getNameElement());
30629      }
30630      if (element.hasSoftwareElement()) {
30631        composeString("software", element.getSoftwareElement());
30632      }
30633      if (element.hasVersionElement()) {
30634        composeString("version", element.getVersionElement());
30635      }
30636      if (element.hasContact()) {
30637        composeContactPoint("contact", element.getContact());
30638      }
30639      if (element.hasEndpointElement()) {
30640        composeUri("endpoint", element.getEndpointElement());
30641      }
30642  }
30643
30644  protected void composeMessageHeaderMessageHeaderResponseComponent(String name, MessageHeader.MessageHeaderResponseComponent element) throws IOException {
30645    if (element != null) {
30646      composeElementAttributes(element);
30647      xml.enter(FHIR_NS, name);
30648      composeMessageHeaderMessageHeaderResponseComponentElements(element);
30649      composeElementClose(element);
30650      xml.exit(FHIR_NS, name);
30651    }
30652  }
30653
30654  protected void composeMessageHeaderMessageHeaderResponseComponentElements(MessageHeader.MessageHeaderResponseComponent element) throws IOException {
30655      composeBackboneElements(element);
30656      if (element.hasIdentifierElement()) {
30657        composeId("identifier", element.getIdentifierElement());
30658      }
30659      if (element.hasCodeElement())
30660        composeEnumeration("code", element.getCodeElement(), new MessageHeader.ResponseTypeEnumFactory());
30661      if (element.hasDetails()) {
30662        composeReference("details", element.getDetails());
30663      }
30664  }
30665
30666  protected void composeNamingSystem(String name, NamingSystem element) throws IOException {
30667    if (element != null) {
30668      composeDomainResourceAttributes(element);
30669      xml.enter(FHIR_NS, name);
30670      composeNamingSystemElements(element);
30671      composeElementClose(element);
30672      xml.exit(FHIR_NS, name);
30673    }
30674  }
30675
30676  protected void composeNamingSystemElements(NamingSystem element) throws IOException {
30677      composeDomainResourceElements(element);
30678      if (element.hasNameElement()) {
30679        composeString("name", element.getNameElement());
30680      }
30681      if (element.hasStatusElement())
30682        composeEnumeration("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory());
30683      if (element.hasKindElement())
30684        composeEnumeration("kind", element.getKindElement(), new NamingSystem.NamingSystemTypeEnumFactory());
30685      if (element.hasDateElement()) {
30686        composeDateTime("date", element.getDateElement());
30687      }
30688      if (element.hasPublisherElement()) {
30689        composeString("publisher", element.getPublisherElement());
30690      }
30691      if (element.hasContact()) { 
30692        for (ContactDetail e : element.getContact()) 
30693          composeContactDetail("contact", e);
30694      }
30695      if (element.hasResponsibleElement()) {
30696        composeString("responsible", element.getResponsibleElement());
30697      }
30698      if (element.hasType()) {
30699        composeCodeableConcept("type", element.getType());
30700      }
30701      if (element.hasDescriptionElement()) {
30702        composeMarkdown("description", element.getDescriptionElement());
30703      }
30704      if (element.hasUseContext()) { 
30705        for (UsageContext e : element.getUseContext()) 
30706          composeUsageContext("useContext", e);
30707      }
30708      if (element.hasJurisdiction()) { 
30709        for (CodeableConcept e : element.getJurisdiction()) 
30710          composeCodeableConcept("jurisdiction", e);
30711      }
30712      if (element.hasUsageElement()) {
30713        composeString("usage", element.getUsageElement());
30714      }
30715      if (element.hasUniqueId()) { 
30716        for (NamingSystem.NamingSystemUniqueIdComponent e : element.getUniqueId()) 
30717          composeNamingSystemNamingSystemUniqueIdComponent("uniqueId", e);
30718      }
30719      if (element.hasReplacedBy()) {
30720        composeReference("replacedBy", element.getReplacedBy());
30721      }
30722  }
30723
30724  protected void composeNamingSystemNamingSystemUniqueIdComponent(String name, NamingSystem.NamingSystemUniqueIdComponent element) throws IOException {
30725    if (element != null) {
30726      composeElementAttributes(element);
30727      xml.enter(FHIR_NS, name);
30728      composeNamingSystemNamingSystemUniqueIdComponentElements(element);
30729      composeElementClose(element);
30730      xml.exit(FHIR_NS, name);
30731    }
30732  }
30733
30734  protected void composeNamingSystemNamingSystemUniqueIdComponentElements(NamingSystem.NamingSystemUniqueIdComponent element) throws IOException {
30735      composeBackboneElements(element);
30736      if (element.hasTypeElement())
30737        composeEnumeration("type", element.getTypeElement(), new NamingSystem.NamingSystemIdentifierTypeEnumFactory());
30738      if (element.hasValueElement()) {
30739        composeString("value", element.getValueElement());
30740      }
30741      if (element.hasPreferredElement()) {
30742        composeBoolean("preferred", element.getPreferredElement());
30743      }
30744      if (element.hasCommentElement()) {
30745        composeString("comment", element.getCommentElement());
30746      }
30747      if (element.hasPeriod()) {
30748        composePeriod("period", element.getPeriod());
30749      }
30750  }
30751
30752  protected void composeNutritionOrder(String name, NutritionOrder element) throws IOException {
30753    if (element != null) {
30754      composeDomainResourceAttributes(element);
30755      xml.enter(FHIR_NS, name);
30756      composeNutritionOrderElements(element);
30757      composeElementClose(element);
30758      xml.exit(FHIR_NS, name);
30759    }
30760  }
30761
30762  protected void composeNutritionOrderElements(NutritionOrder element) throws IOException {
30763      composeDomainResourceElements(element);
30764      if (element.hasIdentifier()) { 
30765        for (Identifier e : element.getIdentifier()) 
30766          composeIdentifier("identifier", e);
30767      }
30768      if (element.hasStatusElement())
30769        composeEnumeration("status", element.getStatusElement(), new NutritionOrder.NutritionOrderStatusEnumFactory());
30770      if (element.hasPatient()) {
30771        composeReference("patient", element.getPatient());
30772      }
30773      if (element.hasEncounter()) {
30774        composeReference("encounter", element.getEncounter());
30775      }
30776      if (element.hasDateTimeElement()) {
30777        composeDateTime("dateTime", element.getDateTimeElement());
30778      }
30779      if (element.hasOrderer()) {
30780        composeReference("orderer", element.getOrderer());
30781      }
30782      if (element.hasAllergyIntolerance()) { 
30783        for (Reference e : element.getAllergyIntolerance()) 
30784          composeReference("allergyIntolerance", e);
30785      }
30786      if (element.hasFoodPreferenceModifier()) { 
30787        for (CodeableConcept e : element.getFoodPreferenceModifier()) 
30788          composeCodeableConcept("foodPreferenceModifier", e);
30789      }
30790      if (element.hasExcludeFoodModifier()) { 
30791        for (CodeableConcept e : element.getExcludeFoodModifier()) 
30792          composeCodeableConcept("excludeFoodModifier", e);
30793      }
30794      if (element.hasOralDiet()) {
30795        composeNutritionOrderNutritionOrderOralDietComponent("oralDiet", element.getOralDiet());
30796      }
30797      if (element.hasSupplement()) { 
30798        for (NutritionOrder.NutritionOrderSupplementComponent e : element.getSupplement()) 
30799          composeNutritionOrderNutritionOrderSupplementComponent("supplement", e);
30800      }
30801      if (element.hasEnteralFormula()) {
30802        composeNutritionOrderNutritionOrderEnteralFormulaComponent("enteralFormula", element.getEnteralFormula());
30803      }
30804  }
30805
30806  protected void composeNutritionOrderNutritionOrderOralDietComponent(String name, NutritionOrder.NutritionOrderOralDietComponent element) throws IOException {
30807    if (element != null) {
30808      composeElementAttributes(element);
30809      xml.enter(FHIR_NS, name);
30810      composeNutritionOrderNutritionOrderOralDietComponentElements(element);
30811      composeElementClose(element);
30812      xml.exit(FHIR_NS, name);
30813    }
30814  }
30815
30816  protected void composeNutritionOrderNutritionOrderOralDietComponentElements(NutritionOrder.NutritionOrderOralDietComponent element) throws IOException {
30817      composeBackboneElements(element);
30818      if (element.hasType()) { 
30819        for (CodeableConcept e : element.getType()) 
30820          composeCodeableConcept("type", e);
30821      }
30822      if (element.hasSchedule()) { 
30823        for (Timing e : element.getSchedule()) 
30824          composeTiming("schedule", e);
30825      }
30826      if (element.hasNutrient()) { 
30827        for (NutritionOrder.NutritionOrderOralDietNutrientComponent e : element.getNutrient()) 
30828          composeNutritionOrderNutritionOrderOralDietNutrientComponent("nutrient", e);
30829      }
30830      if (element.hasTexture()) { 
30831        for (NutritionOrder.NutritionOrderOralDietTextureComponent e : element.getTexture()) 
30832          composeNutritionOrderNutritionOrderOralDietTextureComponent("texture", e);
30833      }
30834      if (element.hasFluidConsistencyType()) { 
30835        for (CodeableConcept e : element.getFluidConsistencyType()) 
30836          composeCodeableConcept("fluidConsistencyType", e);
30837      }
30838      if (element.hasInstructionElement()) {
30839        composeString("instruction", element.getInstructionElement());
30840      }
30841  }
30842
30843  protected void composeNutritionOrderNutritionOrderOralDietNutrientComponent(String name, NutritionOrder.NutritionOrderOralDietNutrientComponent element) throws IOException {
30844    if (element != null) {
30845      composeElementAttributes(element);
30846      xml.enter(FHIR_NS, name);
30847      composeNutritionOrderNutritionOrderOralDietNutrientComponentElements(element);
30848      composeElementClose(element);
30849      xml.exit(FHIR_NS, name);
30850    }
30851  }
30852
30853  protected void composeNutritionOrderNutritionOrderOralDietNutrientComponentElements(NutritionOrder.NutritionOrderOralDietNutrientComponent element) throws IOException {
30854      composeBackboneElements(element);
30855      if (element.hasModifier()) {
30856        composeCodeableConcept("modifier", element.getModifier());
30857      }
30858      if (element.hasAmount()) {
30859        composeSimpleQuantity("amount", element.getAmount());
30860      }
30861  }
30862
30863  protected void composeNutritionOrderNutritionOrderOralDietTextureComponent(String name, NutritionOrder.NutritionOrderOralDietTextureComponent element) throws IOException {
30864    if (element != null) {
30865      composeElementAttributes(element);
30866      xml.enter(FHIR_NS, name);
30867      composeNutritionOrderNutritionOrderOralDietTextureComponentElements(element);
30868      composeElementClose(element);
30869      xml.exit(FHIR_NS, name);
30870    }
30871  }
30872
30873  protected void composeNutritionOrderNutritionOrderOralDietTextureComponentElements(NutritionOrder.NutritionOrderOralDietTextureComponent element) throws IOException {
30874      composeBackboneElements(element);
30875      if (element.hasModifier()) {
30876        composeCodeableConcept("modifier", element.getModifier());
30877      }
30878      if (element.hasFoodType()) {
30879        composeCodeableConcept("foodType", element.getFoodType());
30880      }
30881  }
30882
30883  protected void composeNutritionOrderNutritionOrderSupplementComponent(String name, NutritionOrder.NutritionOrderSupplementComponent element) throws IOException {
30884    if (element != null) {
30885      composeElementAttributes(element);
30886      xml.enter(FHIR_NS, name);
30887      composeNutritionOrderNutritionOrderSupplementComponentElements(element);
30888      composeElementClose(element);
30889      xml.exit(FHIR_NS, name);
30890    }
30891  }
30892
30893  protected void composeNutritionOrderNutritionOrderSupplementComponentElements(NutritionOrder.NutritionOrderSupplementComponent element) throws IOException {
30894      composeBackboneElements(element);
30895      if (element.hasType()) {
30896        composeCodeableConcept("type", element.getType());
30897      }
30898      if (element.hasProductNameElement()) {
30899        composeString("productName", element.getProductNameElement());
30900      }
30901      if (element.hasSchedule()) { 
30902        for (Timing e : element.getSchedule()) 
30903          composeTiming("schedule", e);
30904      }
30905      if (element.hasQuantity()) {
30906        composeSimpleQuantity("quantity", element.getQuantity());
30907      }
30908      if (element.hasInstructionElement()) {
30909        composeString("instruction", element.getInstructionElement());
30910      }
30911  }
30912
30913  protected void composeNutritionOrderNutritionOrderEnteralFormulaComponent(String name, NutritionOrder.NutritionOrderEnteralFormulaComponent element) throws IOException {
30914    if (element != null) {
30915      composeElementAttributes(element);
30916      xml.enter(FHIR_NS, name);
30917      composeNutritionOrderNutritionOrderEnteralFormulaComponentElements(element);
30918      composeElementClose(element);
30919      xml.exit(FHIR_NS, name);
30920    }
30921  }
30922
30923  protected void composeNutritionOrderNutritionOrderEnteralFormulaComponentElements(NutritionOrder.NutritionOrderEnteralFormulaComponent element) throws IOException {
30924      composeBackboneElements(element);
30925      if (element.hasBaseFormulaType()) {
30926        composeCodeableConcept("baseFormulaType", element.getBaseFormulaType());
30927      }
30928      if (element.hasBaseFormulaProductNameElement()) {
30929        composeString("baseFormulaProductName", element.getBaseFormulaProductNameElement());
30930      }
30931      if (element.hasAdditiveType()) {
30932        composeCodeableConcept("additiveType", element.getAdditiveType());
30933      }
30934      if (element.hasAdditiveProductNameElement()) {
30935        composeString("additiveProductName", element.getAdditiveProductNameElement());
30936      }
30937      if (element.hasCaloricDensity()) {
30938        composeSimpleQuantity("caloricDensity", element.getCaloricDensity());
30939      }
30940      if (element.hasRouteofAdministration()) {
30941        composeCodeableConcept("routeofAdministration", element.getRouteofAdministration());
30942      }
30943      if (element.hasAdministration()) { 
30944        for (NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent e : element.getAdministration()) 
30945          composeNutritionOrderNutritionOrderEnteralFormulaAdministrationComponent("administration", e);
30946      }
30947      if (element.hasMaxVolumeToDeliver()) {
30948        composeSimpleQuantity("maxVolumeToDeliver", element.getMaxVolumeToDeliver());
30949      }
30950      if (element.hasAdministrationInstructionElement()) {
30951        composeString("administrationInstruction", element.getAdministrationInstructionElement());
30952      }
30953  }
30954
30955  protected void composeNutritionOrderNutritionOrderEnteralFormulaAdministrationComponent(String name, NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent element) throws IOException {
30956    if (element != null) {
30957      composeElementAttributes(element);
30958      xml.enter(FHIR_NS, name);
30959      composeNutritionOrderNutritionOrderEnteralFormulaAdministrationComponentElements(element);
30960      composeElementClose(element);
30961      xml.exit(FHIR_NS, name);
30962    }
30963  }
30964
30965  protected void composeNutritionOrderNutritionOrderEnteralFormulaAdministrationComponentElements(NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent element) throws IOException {
30966      composeBackboneElements(element);
30967      if (element.hasSchedule()) {
30968        composeTiming("schedule", element.getSchedule());
30969      }
30970      if (element.hasQuantity()) {
30971        composeSimpleQuantity("quantity", element.getQuantity());
30972      }
30973      if (element.hasRate()) {
30974        composeType("rate", element.getRate());
30975      }  }
30976
30977  protected void composeObservation(String name, Observation element) throws IOException {
30978    if (element != null) {
30979      composeDomainResourceAttributes(element);
30980      xml.enter(FHIR_NS, name);
30981      composeObservationElements(element);
30982      composeElementClose(element);
30983      xml.exit(FHIR_NS, name);
30984    }
30985  }
30986
30987  protected void composeObservationElements(Observation element) throws IOException {
30988      composeDomainResourceElements(element);
30989      if (element.hasIdentifier()) { 
30990        for (Identifier e : element.getIdentifier()) 
30991          composeIdentifier("identifier", e);
30992      }
30993      if (element.hasBasedOn()) { 
30994        for (Reference e : element.getBasedOn()) 
30995          composeReference("basedOn", e);
30996      }
30997      if (element.hasStatusElement())
30998        composeEnumeration("status", element.getStatusElement(), new Observation.ObservationStatusEnumFactory());
30999      if (element.hasCategory()) { 
31000        for (CodeableConcept e : element.getCategory()) 
31001          composeCodeableConcept("category", e);
31002      }
31003      if (element.hasCode()) {
31004        composeCodeableConcept("code", element.getCode());
31005      }
31006      if (element.hasSubject()) {
31007        composeReference("subject", element.getSubject());
31008      }
31009      if (element.hasContext()) {
31010        composeReference("context", element.getContext());
31011      }
31012      if (element.hasEffective()) {
31013        composeType("effective", element.getEffective());
31014      }      if (element.hasIssuedElement()) {
31015        composeInstant("issued", element.getIssuedElement());
31016      }
31017      if (element.hasPerformer()) { 
31018        for (Reference e : element.getPerformer()) 
31019          composeReference("performer", e);
31020      }
31021      if (element.hasValue()) {
31022        composeType("value", element.getValue());
31023      }      if (element.hasDataAbsentReason()) {
31024        composeCodeableConcept("dataAbsentReason", element.getDataAbsentReason());
31025      }
31026      if (element.hasInterpretation()) {
31027        composeCodeableConcept("interpretation", element.getInterpretation());
31028      }
31029      if (element.hasCommentElement()) {
31030        composeString("comment", element.getCommentElement());
31031      }
31032      if (element.hasBodySite()) {
31033        composeCodeableConcept("bodySite", element.getBodySite());
31034      }
31035      if (element.hasMethod()) {
31036        composeCodeableConcept("method", element.getMethod());
31037      }
31038      if (element.hasSpecimen()) {
31039        composeReference("specimen", element.getSpecimen());
31040      }
31041      if (element.hasDevice()) {
31042        composeReference("device", element.getDevice());
31043      }
31044      if (element.hasReferenceRange()) { 
31045        for (Observation.ObservationReferenceRangeComponent e : element.getReferenceRange()) 
31046          composeObservationObservationReferenceRangeComponent("referenceRange", e);
31047      }
31048      if (element.hasRelated()) { 
31049        for (Observation.ObservationRelatedComponent e : element.getRelated()) 
31050          composeObservationObservationRelatedComponent("related", e);
31051      }
31052      if (element.hasComponent()) { 
31053        for (Observation.ObservationComponentComponent e : element.getComponent()) 
31054          composeObservationObservationComponentComponent("component", e);
31055      }
31056  }
31057
31058  protected void composeObservationObservationReferenceRangeComponent(String name, Observation.ObservationReferenceRangeComponent element) throws IOException {
31059    if (element != null) {
31060      composeElementAttributes(element);
31061      xml.enter(FHIR_NS, name);
31062      composeObservationObservationReferenceRangeComponentElements(element);
31063      composeElementClose(element);
31064      xml.exit(FHIR_NS, name);
31065    }
31066  }
31067
31068  protected void composeObservationObservationReferenceRangeComponentElements(Observation.ObservationReferenceRangeComponent element) throws IOException {
31069      composeBackboneElements(element);
31070      if (element.hasLow()) {
31071        composeSimpleQuantity("low", element.getLow());
31072      }
31073      if (element.hasHigh()) {
31074        composeSimpleQuantity("high", element.getHigh());
31075      }
31076      if (element.hasType()) {
31077        composeCodeableConcept("type", element.getType());
31078      }
31079      if (element.hasAppliesTo()) { 
31080        for (CodeableConcept e : element.getAppliesTo()) 
31081          composeCodeableConcept("appliesTo", e);
31082      }
31083      if (element.hasAge()) {
31084        composeRange("age", element.getAge());
31085      }
31086      if (element.hasTextElement()) {
31087        composeString("text", element.getTextElement());
31088      }
31089  }
31090
31091  protected void composeObservationObservationRelatedComponent(String name, Observation.ObservationRelatedComponent element) throws IOException {
31092    if (element != null) {
31093      composeElementAttributes(element);
31094      xml.enter(FHIR_NS, name);
31095      composeObservationObservationRelatedComponentElements(element);
31096      composeElementClose(element);
31097      xml.exit(FHIR_NS, name);
31098    }
31099  }
31100
31101  protected void composeObservationObservationRelatedComponentElements(Observation.ObservationRelatedComponent element) throws IOException {
31102      composeBackboneElements(element);
31103      if (element.hasTypeElement())
31104        composeEnumeration("type", element.getTypeElement(), new Observation.ObservationRelationshipTypeEnumFactory());
31105      if (element.hasTarget()) {
31106        composeReference("target", element.getTarget());
31107      }
31108  }
31109
31110  protected void composeObservationObservationComponentComponent(String name, Observation.ObservationComponentComponent element) throws IOException {
31111    if (element != null) {
31112      composeElementAttributes(element);
31113      xml.enter(FHIR_NS, name);
31114      composeObservationObservationComponentComponentElements(element);
31115      composeElementClose(element);
31116      xml.exit(FHIR_NS, name);
31117    }
31118  }
31119
31120  protected void composeObservationObservationComponentComponentElements(Observation.ObservationComponentComponent element) throws IOException {
31121      composeBackboneElements(element);
31122      if (element.hasCode()) {
31123        composeCodeableConcept("code", element.getCode());
31124      }
31125      if (element.hasValue()) {
31126        composeType("value", element.getValue());
31127      }      if (element.hasDataAbsentReason()) {
31128        composeCodeableConcept("dataAbsentReason", element.getDataAbsentReason());
31129      }
31130      if (element.hasInterpretation()) {
31131        composeCodeableConcept("interpretation", element.getInterpretation());
31132      }
31133      if (element.hasReferenceRange()) { 
31134        for (Observation.ObservationReferenceRangeComponent e : element.getReferenceRange()) 
31135          composeObservationObservationReferenceRangeComponent("referenceRange", e);
31136      }
31137  }
31138
31139  protected void composeOperationDefinition(String name, OperationDefinition element) throws IOException {
31140    if (element != null) {
31141      composeDomainResourceAttributes(element);
31142      xml.enter(FHIR_NS, name);
31143      composeOperationDefinitionElements(element);
31144      composeElementClose(element);
31145      xml.exit(FHIR_NS, name);
31146    }
31147  }
31148
31149  protected void composeOperationDefinitionElements(OperationDefinition element) throws IOException {
31150      composeDomainResourceElements(element);
31151      if (element.hasUrlElement()) {
31152        composeUri("url", element.getUrlElement());
31153      }
31154      if (element.hasVersionElement()) {
31155        composeString("version", element.getVersionElement());
31156      }
31157      if (element.hasNameElement()) {
31158        composeString("name", element.getNameElement());
31159      }
31160      if (element.hasStatusElement())
31161        composeEnumeration("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory());
31162      if (element.hasKindElement())
31163        composeEnumeration("kind", element.getKindElement(), new OperationDefinition.OperationKindEnumFactory());
31164      if (element.hasExperimentalElement()) {
31165        composeBoolean("experimental", element.getExperimentalElement());
31166      }
31167      if (element.hasDateElement()) {
31168        composeDateTime("date", element.getDateElement());
31169      }
31170      if (element.hasPublisherElement()) {
31171        composeString("publisher", element.getPublisherElement());
31172      }
31173      if (element.hasContact()) { 
31174        for (ContactDetail e : element.getContact()) 
31175          composeContactDetail("contact", e);
31176      }
31177      if (element.hasDescriptionElement()) {
31178        composeMarkdown("description", element.getDescriptionElement());
31179      }
31180      if (element.hasUseContext()) { 
31181        for (UsageContext e : element.getUseContext()) 
31182          composeUsageContext("useContext", e);
31183      }
31184      if (element.hasJurisdiction()) { 
31185        for (CodeableConcept e : element.getJurisdiction()) 
31186          composeCodeableConcept("jurisdiction", e);
31187      }
31188      if (element.hasPurposeElement()) {
31189        composeMarkdown("purpose", element.getPurposeElement());
31190      }
31191      if (element.hasIdempotentElement()) {
31192        composeBoolean("idempotent", element.getIdempotentElement());
31193      }
31194      if (element.hasCodeElement()) {
31195        composeCode("code", element.getCodeElement());
31196      }
31197      if (element.hasCommentElement()) {
31198        composeString("comment", element.getCommentElement());
31199      }
31200      if (element.hasBase()) {
31201        composeReference("base", element.getBase());
31202      }
31203      if (element.hasResource()) { 
31204        for (CodeType e : element.getResource()) 
31205          composeCode("resource", e);
31206      }
31207      if (element.hasSystemElement()) {
31208        composeBoolean("system", element.getSystemElement());
31209      }
31210      if (element.hasTypeElement()) {
31211        composeBoolean("type", element.getTypeElement());
31212      }
31213      if (element.hasInstanceElement()) {
31214        composeBoolean("instance", element.getInstanceElement());
31215      }
31216      if (element.hasParameter()) { 
31217        for (OperationDefinition.OperationDefinitionParameterComponent e : element.getParameter()) 
31218          composeOperationDefinitionOperationDefinitionParameterComponent("parameter", e);
31219      }
31220      if (element.hasOverload()) { 
31221        for (OperationDefinition.OperationDefinitionOverloadComponent e : element.getOverload()) 
31222          composeOperationDefinitionOperationDefinitionOverloadComponent("overload", e);
31223      }
31224  }
31225
31226  protected void composeOperationDefinitionOperationDefinitionParameterComponent(String name, OperationDefinition.OperationDefinitionParameterComponent element) throws IOException {
31227    if (element != null) {
31228      composeElementAttributes(element);
31229      xml.enter(FHIR_NS, name);
31230      composeOperationDefinitionOperationDefinitionParameterComponentElements(element);
31231      composeElementClose(element);
31232      xml.exit(FHIR_NS, name);
31233    }
31234  }
31235
31236  protected void composeOperationDefinitionOperationDefinitionParameterComponentElements(OperationDefinition.OperationDefinitionParameterComponent element) throws IOException {
31237      composeBackboneElements(element);
31238      if (element.hasNameElement()) {
31239        composeCode("name", element.getNameElement());
31240      }
31241      if (element.hasUseElement())
31242        composeEnumeration("use", element.getUseElement(), new OperationDefinition.OperationParameterUseEnumFactory());
31243      if (element.hasMinElement()) {
31244        composeInteger("min", element.getMinElement());
31245      }
31246      if (element.hasMaxElement()) {
31247        composeString("max", element.getMaxElement());
31248      }
31249      if (element.hasDocumentationElement()) {
31250        composeString("documentation", element.getDocumentationElement());
31251      }
31252      if (element.hasTypeElement()) {
31253        composeCode("type", element.getTypeElement());
31254      }
31255      if (element.hasSearchTypeElement())
31256        composeEnumeration("searchType", element.getSearchTypeElement(), new Enumerations.SearchParamTypeEnumFactory());
31257      if (element.hasProfile()) {
31258        composeReference("profile", element.getProfile());
31259      }
31260      if (element.hasBinding()) {
31261        composeOperationDefinitionOperationDefinitionParameterBindingComponent("binding", element.getBinding());
31262      }
31263      if (element.hasPart()) { 
31264        for (OperationDefinition.OperationDefinitionParameterComponent e : element.getPart()) 
31265          composeOperationDefinitionOperationDefinitionParameterComponent("part", e);
31266      }
31267  }
31268
31269  protected void composeOperationDefinitionOperationDefinitionParameterBindingComponent(String name, OperationDefinition.OperationDefinitionParameterBindingComponent element) throws IOException {
31270    if (element != null) {
31271      composeElementAttributes(element);
31272      xml.enter(FHIR_NS, name);
31273      composeOperationDefinitionOperationDefinitionParameterBindingComponentElements(element);
31274      composeElementClose(element);
31275      xml.exit(FHIR_NS, name);
31276    }
31277  }
31278
31279  protected void composeOperationDefinitionOperationDefinitionParameterBindingComponentElements(OperationDefinition.OperationDefinitionParameterBindingComponent element) throws IOException {
31280      composeBackboneElements(element);
31281      if (element.hasStrengthElement())
31282        composeEnumeration("strength", element.getStrengthElement(), new Enumerations.BindingStrengthEnumFactory());
31283      if (element.hasValueSet()) {
31284        composeType("valueSet", element.getValueSet());
31285      }  }
31286
31287  protected void composeOperationDefinitionOperationDefinitionOverloadComponent(String name, OperationDefinition.OperationDefinitionOverloadComponent element) throws IOException {
31288    if (element != null) {
31289      composeElementAttributes(element);
31290      xml.enter(FHIR_NS, name);
31291      composeOperationDefinitionOperationDefinitionOverloadComponentElements(element);
31292      composeElementClose(element);
31293      xml.exit(FHIR_NS, name);
31294    }
31295  }
31296
31297  protected void composeOperationDefinitionOperationDefinitionOverloadComponentElements(OperationDefinition.OperationDefinitionOverloadComponent element) throws IOException {
31298      composeBackboneElements(element);
31299      if (element.hasParameterName()) { 
31300        for (StringType e : element.getParameterName()) 
31301          composeString("parameterName", e);
31302      }
31303      if (element.hasCommentElement()) {
31304        composeString("comment", element.getCommentElement());
31305      }
31306  }
31307
31308  protected void composeOperationOutcome(String name, OperationOutcome element) throws IOException {
31309    if (element != null) {
31310      composeDomainResourceAttributes(element);
31311      xml.enter(FHIR_NS, name);
31312      composeOperationOutcomeElements(element);
31313      composeElementClose(element);
31314      xml.exit(FHIR_NS, name);
31315    }
31316  }
31317
31318  protected void composeOperationOutcomeElements(OperationOutcome element) throws IOException {
31319      composeDomainResourceElements(element);
31320      if (element.hasIssue()) { 
31321        for (OperationOutcome.OperationOutcomeIssueComponent e : element.getIssue()) 
31322          composeOperationOutcomeOperationOutcomeIssueComponent("issue", e);
31323      }
31324  }
31325
31326  protected void composeOperationOutcomeOperationOutcomeIssueComponent(String name, OperationOutcome.OperationOutcomeIssueComponent element) throws IOException {
31327    if (element != null) {
31328      composeElementAttributes(element);
31329      xml.enter(FHIR_NS, name);
31330      composeOperationOutcomeOperationOutcomeIssueComponentElements(element);
31331      composeElementClose(element);
31332      xml.exit(FHIR_NS, name);
31333    }
31334  }
31335
31336  protected void composeOperationOutcomeOperationOutcomeIssueComponentElements(OperationOutcome.OperationOutcomeIssueComponent element) throws IOException {
31337      composeBackboneElements(element);
31338      if (element.hasSeverityElement())
31339        composeEnumeration("severity", element.getSeverityElement(), new OperationOutcome.IssueSeverityEnumFactory());
31340      if (element.hasCodeElement())
31341        composeEnumeration("code", element.getCodeElement(), new OperationOutcome.IssueTypeEnumFactory());
31342      if (element.hasDetails()) {
31343        composeCodeableConcept("details", element.getDetails());
31344      }
31345      if (element.hasDiagnosticsElement()) {
31346        composeString("diagnostics", element.getDiagnosticsElement());
31347      }
31348      if (element.hasLocation()) { 
31349        for (StringType e : element.getLocation()) 
31350          composeString("location", e);
31351      }
31352      if (element.hasExpression()) { 
31353        for (StringType e : element.getExpression()) 
31354          composeString("expression", e);
31355      }
31356  }
31357
31358  protected void composeOrganization(String name, Organization element) throws IOException {
31359    if (element != null) {
31360      composeDomainResourceAttributes(element);
31361      xml.enter(FHIR_NS, name);
31362      composeOrganizationElements(element);
31363      composeElementClose(element);
31364      xml.exit(FHIR_NS, name);
31365    }
31366  }
31367
31368  protected void composeOrganizationElements(Organization element) throws IOException {
31369      composeDomainResourceElements(element);
31370      if (element.hasIdentifier()) { 
31371        for (Identifier e : element.getIdentifier()) 
31372          composeIdentifier("identifier", e);
31373      }
31374      if (element.hasActiveElement()) {
31375        composeBoolean("active", element.getActiveElement());
31376      }
31377      if (element.hasType()) { 
31378        for (CodeableConcept e : element.getType()) 
31379          composeCodeableConcept("type", e);
31380      }
31381      if (element.hasNameElement()) {
31382        composeString("name", element.getNameElement());
31383      }
31384      if (element.hasAlias()) { 
31385        for (StringType e : element.getAlias()) 
31386          composeString("alias", e);
31387      }
31388      if (element.hasTelecom()) { 
31389        for (ContactPoint e : element.getTelecom()) 
31390          composeContactPoint("telecom", e);
31391      }
31392      if (element.hasAddress()) { 
31393        for (Address e : element.getAddress()) 
31394          composeAddress("address", e);
31395      }
31396      if (element.hasPartOf()) {
31397        composeReference("partOf", element.getPartOf());
31398      }
31399      if (element.hasContact()) { 
31400        for (Organization.OrganizationContactComponent e : element.getContact()) 
31401          composeOrganizationOrganizationContactComponent("contact", e);
31402      }
31403      if (element.hasEndpoint()) { 
31404        for (Reference e : element.getEndpoint()) 
31405          composeReference("endpoint", e);
31406      }
31407  }
31408
31409  protected void composeOrganizationOrganizationContactComponent(String name, Organization.OrganizationContactComponent element) throws IOException {
31410    if (element != null) {
31411      composeElementAttributes(element);
31412      xml.enter(FHIR_NS, name);
31413      composeOrganizationOrganizationContactComponentElements(element);
31414      composeElementClose(element);
31415      xml.exit(FHIR_NS, name);
31416    }
31417  }
31418
31419  protected void composeOrganizationOrganizationContactComponentElements(Organization.OrganizationContactComponent element) throws IOException {
31420      composeBackboneElements(element);
31421      if (element.hasPurpose()) {
31422        composeCodeableConcept("purpose", element.getPurpose());
31423      }
31424      if (element.hasName()) {
31425        composeHumanName("name", element.getName());
31426      }
31427      if (element.hasTelecom()) { 
31428        for (ContactPoint e : element.getTelecom()) 
31429          composeContactPoint("telecom", e);
31430      }
31431      if (element.hasAddress()) {
31432        composeAddress("address", element.getAddress());
31433      }
31434  }
31435
31436  protected void composePatient(String name, Patient element) throws IOException {
31437    if (element != null) {
31438      composeDomainResourceAttributes(element);
31439      xml.enter(FHIR_NS, name);
31440      composePatientElements(element);
31441      composeElementClose(element);
31442      xml.exit(FHIR_NS, name);
31443    }
31444  }
31445
31446  protected void composePatientElements(Patient element) throws IOException {
31447      composeDomainResourceElements(element);
31448      if (element.hasIdentifier()) { 
31449        for (Identifier e : element.getIdentifier()) 
31450          composeIdentifier("identifier", e);
31451      }
31452      if (element.hasActiveElement()) {
31453        composeBoolean("active", element.getActiveElement());
31454      }
31455      if (element.hasName()) { 
31456        for (HumanName e : element.getName()) 
31457          composeHumanName("name", e);
31458      }
31459      if (element.hasTelecom()) { 
31460        for (ContactPoint e : element.getTelecom()) 
31461          composeContactPoint("telecom", e);
31462      }
31463      if (element.hasGenderElement())
31464        composeEnumeration("gender", element.getGenderElement(), new Enumerations.AdministrativeGenderEnumFactory());
31465      if (element.hasBirthDateElement()) {
31466        composeDate("birthDate", element.getBirthDateElement());
31467      }
31468      if (element.hasDeceased()) {
31469        composeType("deceased", element.getDeceased());
31470      }      if (element.hasAddress()) { 
31471        for (Address e : element.getAddress()) 
31472          composeAddress("address", e);
31473      }
31474      if (element.hasMaritalStatus()) {
31475        composeCodeableConcept("maritalStatus", element.getMaritalStatus());
31476      }
31477      if (element.hasMultipleBirth()) {
31478        composeType("multipleBirth", element.getMultipleBirth());
31479      }      if (element.hasPhoto()) { 
31480        for (Attachment e : element.getPhoto()) 
31481          composeAttachment("photo", e);
31482      }
31483      if (element.hasContact()) { 
31484        for (Patient.ContactComponent e : element.getContact()) 
31485          composePatientContactComponent("contact", e);
31486      }
31487      if (element.hasAnimal()) {
31488        composePatientAnimalComponent("animal", element.getAnimal());
31489      }
31490      if (element.hasCommunication()) { 
31491        for (Patient.PatientCommunicationComponent e : element.getCommunication()) 
31492          composePatientPatientCommunicationComponent("communication", e);
31493      }
31494      if (element.hasGeneralPractitioner()) { 
31495        for (Reference e : element.getGeneralPractitioner()) 
31496          composeReference("generalPractitioner", e);
31497      }
31498      if (element.hasManagingOrganization()) {
31499        composeReference("managingOrganization", element.getManagingOrganization());
31500      }
31501      if (element.hasLink()) { 
31502        for (Patient.PatientLinkComponent e : element.getLink()) 
31503          composePatientPatientLinkComponent("link", e);
31504      }
31505  }
31506
31507  protected void composePatientContactComponent(String name, Patient.ContactComponent element) throws IOException {
31508    if (element != null) {
31509      composeElementAttributes(element);
31510      xml.enter(FHIR_NS, name);
31511      composePatientContactComponentElements(element);
31512      composeElementClose(element);
31513      xml.exit(FHIR_NS, name);
31514    }
31515  }
31516
31517  protected void composePatientContactComponentElements(Patient.ContactComponent element) throws IOException {
31518      composeBackboneElements(element);
31519      if (element.hasRelationship()) { 
31520        for (CodeableConcept e : element.getRelationship()) 
31521          composeCodeableConcept("relationship", e);
31522      }
31523      if (element.hasName()) {
31524        composeHumanName("name", element.getName());
31525      }
31526      if (element.hasTelecom()) { 
31527        for (ContactPoint e : element.getTelecom()) 
31528          composeContactPoint("telecom", e);
31529      }
31530      if (element.hasAddress()) {
31531        composeAddress("address", element.getAddress());
31532      }
31533      if (element.hasGenderElement())
31534        composeEnumeration("gender", element.getGenderElement(), new Enumerations.AdministrativeGenderEnumFactory());
31535      if (element.hasOrganization()) {
31536        composeReference("organization", element.getOrganization());
31537      }
31538      if (element.hasPeriod()) {
31539        composePeriod("period", element.getPeriod());
31540      }
31541  }
31542
31543  protected void composePatientAnimalComponent(String name, Patient.AnimalComponent element) throws IOException {
31544    if (element != null) {
31545      composeElementAttributes(element);
31546      xml.enter(FHIR_NS, name);
31547      composePatientAnimalComponentElements(element);
31548      composeElementClose(element);
31549      xml.exit(FHIR_NS, name);
31550    }
31551  }
31552
31553  protected void composePatientAnimalComponentElements(Patient.AnimalComponent element) throws IOException {
31554      composeBackboneElements(element);
31555      if (element.hasSpecies()) {
31556        composeCodeableConcept("species", element.getSpecies());
31557      }
31558      if (element.hasBreed()) {
31559        composeCodeableConcept("breed", element.getBreed());
31560      }
31561      if (element.hasGenderStatus()) {
31562        composeCodeableConcept("genderStatus", element.getGenderStatus());
31563      }
31564  }
31565
31566  protected void composePatientPatientCommunicationComponent(String name, Patient.PatientCommunicationComponent element) throws IOException {
31567    if (element != null) {
31568      composeElementAttributes(element);
31569      xml.enter(FHIR_NS, name);
31570      composePatientPatientCommunicationComponentElements(element);
31571      composeElementClose(element);
31572      xml.exit(FHIR_NS, name);
31573    }
31574  }
31575
31576  protected void composePatientPatientCommunicationComponentElements(Patient.PatientCommunicationComponent element) throws IOException {
31577      composeBackboneElements(element);
31578      if (element.hasLanguage()) {
31579        composeCodeableConcept("language", element.getLanguage());
31580      }
31581      if (element.hasPreferredElement()) {
31582        composeBoolean("preferred", element.getPreferredElement());
31583      }
31584  }
31585
31586  protected void composePatientPatientLinkComponent(String name, Patient.PatientLinkComponent element) throws IOException {
31587    if (element != null) {
31588      composeElementAttributes(element);
31589      xml.enter(FHIR_NS, name);
31590      composePatientPatientLinkComponentElements(element);
31591      composeElementClose(element);
31592      xml.exit(FHIR_NS, name);
31593    }
31594  }
31595
31596  protected void composePatientPatientLinkComponentElements(Patient.PatientLinkComponent element) throws IOException {
31597      composeBackboneElements(element);
31598      if (element.hasOther()) {
31599        composeReference("other", element.getOther());
31600      }
31601      if (element.hasTypeElement())
31602        composeEnumeration("type", element.getTypeElement(), new Patient.LinkTypeEnumFactory());
31603  }
31604
31605  protected void composePaymentNotice(String name, PaymentNotice element) throws IOException {
31606    if (element != null) {
31607      composeDomainResourceAttributes(element);
31608      xml.enter(FHIR_NS, name);
31609      composePaymentNoticeElements(element);
31610      composeElementClose(element);
31611      xml.exit(FHIR_NS, name);
31612    }
31613  }
31614
31615  protected void composePaymentNoticeElements(PaymentNotice element) throws IOException {
31616      composeDomainResourceElements(element);
31617      if (element.hasIdentifier()) { 
31618        for (Identifier e : element.getIdentifier()) 
31619          composeIdentifier("identifier", e);
31620      }
31621      if (element.hasStatusElement())
31622        composeEnumeration("status", element.getStatusElement(), new PaymentNotice.PaymentNoticeStatusEnumFactory());
31623      if (element.hasRequest()) {
31624        composeReference("request", element.getRequest());
31625      }
31626      if (element.hasResponse()) {
31627        composeReference("response", element.getResponse());
31628      }
31629      if (element.hasStatusDateElement()) {
31630        composeDate("statusDate", element.getStatusDateElement());
31631      }
31632      if (element.hasCreatedElement()) {
31633        composeDateTime("created", element.getCreatedElement());
31634      }
31635      if (element.hasTarget()) {
31636        composeReference("target", element.getTarget());
31637      }
31638      if (element.hasProvider()) {
31639        composeReference("provider", element.getProvider());
31640      }
31641      if (element.hasOrganization()) {
31642        composeReference("organization", element.getOrganization());
31643      }
31644      if (element.hasPaymentStatus()) {
31645        composeCodeableConcept("paymentStatus", element.getPaymentStatus());
31646      }
31647  }
31648
31649  protected void composePaymentReconciliation(String name, PaymentReconciliation element) throws IOException {
31650    if (element != null) {
31651      composeDomainResourceAttributes(element);
31652      xml.enter(FHIR_NS, name);
31653      composePaymentReconciliationElements(element);
31654      composeElementClose(element);
31655      xml.exit(FHIR_NS, name);
31656    }
31657  }
31658
31659  protected void composePaymentReconciliationElements(PaymentReconciliation element) throws IOException {
31660      composeDomainResourceElements(element);
31661      if (element.hasIdentifier()) { 
31662        for (Identifier e : element.getIdentifier()) 
31663          composeIdentifier("identifier", e);
31664      }
31665      if (element.hasStatusElement())
31666        composeEnumeration("status", element.getStatusElement(), new PaymentReconciliation.PaymentReconciliationStatusEnumFactory());
31667      if (element.hasPeriod()) {
31668        composePeriod("period", element.getPeriod());
31669      }
31670      if (element.hasCreatedElement()) {
31671        composeDateTime("created", element.getCreatedElement());
31672      }
31673      if (element.hasOrganization()) {
31674        composeReference("organization", element.getOrganization());
31675      }
31676      if (element.hasRequest()) {
31677        composeReference("request", element.getRequest());
31678      }
31679      if (element.hasOutcome()) {
31680        composeCodeableConcept("outcome", element.getOutcome());
31681      }
31682      if (element.hasDispositionElement()) {
31683        composeString("disposition", element.getDispositionElement());
31684      }
31685      if (element.hasRequestProvider()) {
31686        composeReference("requestProvider", element.getRequestProvider());
31687      }
31688      if (element.hasRequestOrganization()) {
31689        composeReference("requestOrganization", element.getRequestOrganization());
31690      }
31691      if (element.hasDetail()) { 
31692        for (PaymentReconciliation.DetailsComponent e : element.getDetail()) 
31693          composePaymentReconciliationDetailsComponent("detail", e);
31694      }
31695      if (element.hasForm()) {
31696        composeCodeableConcept("form", element.getForm());
31697      }
31698      if (element.hasTotal()) {
31699        composeMoney("total", element.getTotal());
31700      }
31701      if (element.hasProcessNote()) { 
31702        for (PaymentReconciliation.NotesComponent e : element.getProcessNote()) 
31703          composePaymentReconciliationNotesComponent("processNote", e);
31704      }
31705  }
31706
31707  protected void composePaymentReconciliationDetailsComponent(String name, PaymentReconciliation.DetailsComponent element) throws IOException {
31708    if (element != null) {
31709      composeElementAttributes(element);
31710      xml.enter(FHIR_NS, name);
31711      composePaymentReconciliationDetailsComponentElements(element);
31712      composeElementClose(element);
31713      xml.exit(FHIR_NS, name);
31714    }
31715  }
31716
31717  protected void composePaymentReconciliationDetailsComponentElements(PaymentReconciliation.DetailsComponent element) throws IOException {
31718      composeBackboneElements(element);
31719      if (element.hasType()) {
31720        composeCodeableConcept("type", element.getType());
31721      }
31722      if (element.hasRequest()) {
31723        composeReference("request", element.getRequest());
31724      }
31725      if (element.hasResponse()) {
31726        composeReference("response", element.getResponse());
31727      }
31728      if (element.hasSubmitter()) {
31729        composeReference("submitter", element.getSubmitter());
31730      }
31731      if (element.hasPayee()) {
31732        composeReference("payee", element.getPayee());
31733      }
31734      if (element.hasDateElement()) {
31735        composeDate("date", element.getDateElement());
31736      }
31737      if (element.hasAmount()) {
31738        composeMoney("amount", element.getAmount());
31739      }
31740  }
31741
31742  protected void composePaymentReconciliationNotesComponent(String name, PaymentReconciliation.NotesComponent element) throws IOException {
31743    if (element != null) {
31744      composeElementAttributes(element);
31745      xml.enter(FHIR_NS, name);
31746      composePaymentReconciliationNotesComponentElements(element);
31747      composeElementClose(element);
31748      xml.exit(FHIR_NS, name);
31749    }
31750  }
31751
31752  protected void composePaymentReconciliationNotesComponentElements(PaymentReconciliation.NotesComponent element) throws IOException {
31753      composeBackboneElements(element);
31754      if (element.hasType()) {
31755        composeCodeableConcept("type", element.getType());
31756      }
31757      if (element.hasTextElement()) {
31758        composeString("text", element.getTextElement());
31759      }
31760  }
31761
31762  protected void composePerson(String name, Person element) throws IOException {
31763    if (element != null) {
31764      composeDomainResourceAttributes(element);
31765      xml.enter(FHIR_NS, name);
31766      composePersonElements(element);
31767      composeElementClose(element);
31768      xml.exit(FHIR_NS, name);
31769    }
31770  }
31771
31772  protected void composePersonElements(Person element) throws IOException {
31773      composeDomainResourceElements(element);
31774      if (element.hasIdentifier()) { 
31775        for (Identifier e : element.getIdentifier()) 
31776          composeIdentifier("identifier", e);
31777      }
31778      if (element.hasName()) { 
31779        for (HumanName e : element.getName()) 
31780          composeHumanName("name", e);
31781      }
31782      if (element.hasTelecom()) { 
31783        for (ContactPoint e : element.getTelecom()) 
31784          composeContactPoint("telecom", e);
31785      }
31786      if (element.hasGenderElement())
31787        composeEnumeration("gender", element.getGenderElement(), new Enumerations.AdministrativeGenderEnumFactory());
31788      if (element.hasBirthDateElement()) {
31789        composeDate("birthDate", element.getBirthDateElement());
31790      }
31791      if (element.hasAddress()) { 
31792        for (Address e : element.getAddress()) 
31793          composeAddress("address", e);
31794      }
31795      if (element.hasPhoto()) {
31796        composeAttachment("photo", element.getPhoto());
31797      }
31798      if (element.hasManagingOrganization()) {
31799        composeReference("managingOrganization", element.getManagingOrganization());
31800      }
31801      if (element.hasActiveElement()) {
31802        composeBoolean("active", element.getActiveElement());
31803      }
31804      if (element.hasLink()) { 
31805        for (Person.PersonLinkComponent e : element.getLink()) 
31806          composePersonPersonLinkComponent("link", e);
31807      }
31808  }
31809
31810  protected void composePersonPersonLinkComponent(String name, Person.PersonLinkComponent element) throws IOException {
31811    if (element != null) {
31812      composeElementAttributes(element);
31813      xml.enter(FHIR_NS, name);
31814      composePersonPersonLinkComponentElements(element);
31815      composeElementClose(element);
31816      xml.exit(FHIR_NS, name);
31817    }
31818  }
31819
31820  protected void composePersonPersonLinkComponentElements(Person.PersonLinkComponent element) throws IOException {
31821      composeBackboneElements(element);
31822      if (element.hasTarget()) {
31823        composeReference("target", element.getTarget());
31824      }
31825      if (element.hasAssuranceElement())
31826        composeEnumeration("assurance", element.getAssuranceElement(), new Person.IdentityAssuranceLevelEnumFactory());
31827  }
31828
31829  protected void composePlanDefinition(String name, PlanDefinition element) throws IOException {
31830    if (element != null) {
31831      composeDomainResourceAttributes(element);
31832      xml.enter(FHIR_NS, name);
31833      composePlanDefinitionElements(element);
31834      composeElementClose(element);
31835      xml.exit(FHIR_NS, name);
31836    }
31837  }
31838
31839  protected void composePlanDefinitionElements(PlanDefinition element) throws IOException {
31840      composeDomainResourceElements(element);
31841      if (element.hasUrlElement()) {
31842        composeUri("url", element.getUrlElement());
31843      }
31844      if (element.hasIdentifier()) { 
31845        for (Identifier e : element.getIdentifier()) 
31846          composeIdentifier("identifier", e);
31847      }
31848      if (element.hasVersionElement()) {
31849        composeString("version", element.getVersionElement());
31850      }
31851      if (element.hasNameElement()) {
31852        composeString("name", element.getNameElement());
31853      }
31854      if (element.hasTitleElement()) {
31855        composeString("title", element.getTitleElement());
31856      }
31857      if (element.hasType()) {
31858        composeCodeableConcept("type", element.getType());
31859      }
31860      if (element.hasStatusElement())
31861        composeEnumeration("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory());
31862      if (element.hasExperimentalElement()) {
31863        composeBoolean("experimental", element.getExperimentalElement());
31864      }
31865      if (element.hasDateElement()) {
31866        composeDateTime("date", element.getDateElement());
31867      }
31868      if (element.hasPublisherElement()) {
31869        composeString("publisher", element.getPublisherElement());
31870      }
31871      if (element.hasDescriptionElement()) {
31872        composeMarkdown("description", element.getDescriptionElement());
31873      }
31874      if (element.hasPurposeElement()) {
31875        composeMarkdown("purpose", element.getPurposeElement());
31876      }
31877      if (element.hasUsageElement()) {
31878        composeString("usage", element.getUsageElement());
31879      }
31880      if (element.hasApprovalDateElement()) {
31881        composeDate("approvalDate", element.getApprovalDateElement());
31882      }
31883      if (element.hasLastReviewDateElement()) {
31884        composeDate("lastReviewDate", element.getLastReviewDateElement());
31885      }
31886      if (element.hasEffectivePeriod()) {
31887        composePeriod("effectivePeriod", element.getEffectivePeriod());
31888      }
31889      if (element.hasUseContext()) { 
31890        for (UsageContext e : element.getUseContext()) 
31891          composeUsageContext("useContext", e);
31892      }
31893      if (element.hasJurisdiction()) { 
31894        for (CodeableConcept e : element.getJurisdiction()) 
31895          composeCodeableConcept("jurisdiction", e);
31896      }
31897      if (element.hasTopic()) { 
31898        for (CodeableConcept e : element.getTopic()) 
31899          composeCodeableConcept("topic", e);
31900      }
31901      if (element.hasContributor()) { 
31902        for (Contributor e : element.getContributor()) 
31903          composeContributor("contributor", e);
31904      }
31905      if (element.hasContact()) { 
31906        for (ContactDetail e : element.getContact()) 
31907          composeContactDetail("contact", e);
31908      }
31909      if (element.hasCopyrightElement()) {
31910        composeMarkdown("copyright", element.getCopyrightElement());
31911      }
31912      if (element.hasRelatedArtifact()) { 
31913        for (RelatedArtifact e : element.getRelatedArtifact()) 
31914          composeRelatedArtifact("relatedArtifact", e);
31915      }
31916      if (element.hasLibrary()) { 
31917        for (Reference e : element.getLibrary()) 
31918          composeReference("library", e);
31919      }
31920      if (element.hasGoal()) { 
31921        for (PlanDefinition.PlanDefinitionGoalComponent e : element.getGoal()) 
31922          composePlanDefinitionPlanDefinitionGoalComponent("goal", e);
31923      }
31924      if (element.hasAction()) { 
31925        for (PlanDefinition.PlanDefinitionActionComponent e : element.getAction()) 
31926          composePlanDefinitionPlanDefinitionActionComponent("action", e);
31927      }
31928  }
31929
31930  protected void composePlanDefinitionPlanDefinitionGoalComponent(String name, PlanDefinition.PlanDefinitionGoalComponent element) throws IOException {
31931    if (element != null) {
31932      composeElementAttributes(element);
31933      xml.enter(FHIR_NS, name);
31934      composePlanDefinitionPlanDefinitionGoalComponentElements(element);
31935      composeElementClose(element);
31936      xml.exit(FHIR_NS, name);
31937    }
31938  }
31939
31940  protected void composePlanDefinitionPlanDefinitionGoalComponentElements(PlanDefinition.PlanDefinitionGoalComponent element) throws IOException {
31941      composeBackboneElements(element);
31942      if (element.hasCategory()) {
31943        composeCodeableConcept("category", element.getCategory());
31944      }
31945      if (element.hasDescription()) {
31946        composeCodeableConcept("description", element.getDescription());
31947      }
31948      if (element.hasPriority()) {
31949        composeCodeableConcept("priority", element.getPriority());
31950      }
31951      if (element.hasStart()) {
31952        composeCodeableConcept("start", element.getStart());
31953      }
31954      if (element.hasAddresses()) { 
31955        for (CodeableConcept e : element.getAddresses()) 
31956          composeCodeableConcept("addresses", e);
31957      }
31958      if (element.hasDocumentation()) { 
31959        for (RelatedArtifact e : element.getDocumentation()) 
31960          composeRelatedArtifact("documentation", e);
31961      }
31962      if (element.hasTarget()) { 
31963        for (PlanDefinition.PlanDefinitionGoalTargetComponent e : element.getTarget()) 
31964          composePlanDefinitionPlanDefinitionGoalTargetComponent("target", e);
31965      }
31966  }
31967
31968  protected void composePlanDefinitionPlanDefinitionGoalTargetComponent(String name, PlanDefinition.PlanDefinitionGoalTargetComponent element) throws IOException {
31969    if (element != null) {
31970      composeElementAttributes(element);
31971      xml.enter(FHIR_NS, name);
31972      composePlanDefinitionPlanDefinitionGoalTargetComponentElements(element);
31973      composeElementClose(element);
31974      xml.exit(FHIR_NS, name);
31975    }
31976  }
31977
31978  protected void composePlanDefinitionPlanDefinitionGoalTargetComponentElements(PlanDefinition.PlanDefinitionGoalTargetComponent element) throws IOException {
31979      composeBackboneElements(element);
31980      if (element.hasMeasure()) {
31981        composeCodeableConcept("measure", element.getMeasure());
31982      }
31983      if (element.hasDetail()) {
31984        composeType("detail", element.getDetail());
31985      }      if (element.hasDue()) {
31986        composeDuration("due", element.getDue());
31987      }
31988  }
31989
31990  protected void composePlanDefinitionPlanDefinitionActionComponent(String name, PlanDefinition.PlanDefinitionActionComponent element) throws IOException {
31991    if (element != null) {
31992      composeElementAttributes(element);
31993      xml.enter(FHIR_NS, name);
31994      composePlanDefinitionPlanDefinitionActionComponentElements(element);
31995      composeElementClose(element);
31996      xml.exit(FHIR_NS, name);
31997    }
31998  }
31999
32000  protected void composePlanDefinitionPlanDefinitionActionComponentElements(PlanDefinition.PlanDefinitionActionComponent element) throws IOException {
32001      composeBackboneElements(element);
32002      if (element.hasLabelElement()) {
32003        composeString("label", element.getLabelElement());
32004      }
32005      if (element.hasTitleElement()) {
32006        composeString("title", element.getTitleElement());
32007      }
32008      if (element.hasDescriptionElement()) {
32009        composeString("description", element.getDescriptionElement());
32010      }
32011      if (element.hasTextEquivalentElement()) {
32012        composeString("textEquivalent", element.getTextEquivalentElement());
32013      }
32014      if (element.hasCode()) { 
32015        for (CodeableConcept e : element.getCode()) 
32016          composeCodeableConcept("code", e);
32017      }
32018      if (element.hasReason()) { 
32019        for (CodeableConcept e : element.getReason()) 
32020          composeCodeableConcept("reason", e);
32021      }
32022      if (element.hasDocumentation()) { 
32023        for (RelatedArtifact e : element.getDocumentation()) 
32024          composeRelatedArtifact("documentation", e);
32025      }
32026      if (element.hasGoalId()) { 
32027        for (IdType e : element.getGoalId()) 
32028          composeId("goalId", e);
32029      }
32030      if (element.hasTriggerDefinition()) { 
32031        for (TriggerDefinition e : element.getTriggerDefinition()) 
32032          composeTriggerDefinition("triggerDefinition", e);
32033      }
32034      if (element.hasCondition()) { 
32035        for (PlanDefinition.PlanDefinitionActionConditionComponent e : element.getCondition()) 
32036          composePlanDefinitionPlanDefinitionActionConditionComponent("condition", e);
32037      }
32038      if (element.hasInput()) { 
32039        for (DataRequirement e : element.getInput()) 
32040          composeDataRequirement("input", e);
32041      }
32042      if (element.hasOutput()) { 
32043        for (DataRequirement e : element.getOutput()) 
32044          composeDataRequirement("output", e);
32045      }
32046      if (element.hasRelatedAction()) { 
32047        for (PlanDefinition.PlanDefinitionActionRelatedActionComponent e : element.getRelatedAction()) 
32048          composePlanDefinitionPlanDefinitionActionRelatedActionComponent("relatedAction", e);
32049      }
32050      if (element.hasTiming()) {
32051        composeType("timing", element.getTiming());
32052      }      if (element.hasParticipant()) { 
32053        for (PlanDefinition.PlanDefinitionActionParticipantComponent e : element.getParticipant()) 
32054          composePlanDefinitionPlanDefinitionActionParticipantComponent("participant", e);
32055      }
32056      if (element.hasType()) {
32057        composeCoding("type", element.getType());
32058      }
32059      if (element.hasGroupingBehaviorElement())
32060        composeEnumeration("groupingBehavior", element.getGroupingBehaviorElement(), new PlanDefinition.ActionGroupingBehaviorEnumFactory());
32061      if (element.hasSelectionBehaviorElement())
32062        composeEnumeration("selectionBehavior", element.getSelectionBehaviorElement(), new PlanDefinition.ActionSelectionBehaviorEnumFactory());
32063      if (element.hasRequiredBehaviorElement())
32064        composeEnumeration("requiredBehavior", element.getRequiredBehaviorElement(), new PlanDefinition.ActionRequiredBehaviorEnumFactory());
32065      if (element.hasPrecheckBehaviorElement())
32066        composeEnumeration("precheckBehavior", element.getPrecheckBehaviorElement(), new PlanDefinition.ActionPrecheckBehaviorEnumFactory());
32067      if (element.hasCardinalityBehaviorElement())
32068        composeEnumeration("cardinalityBehavior", element.getCardinalityBehaviorElement(), new PlanDefinition.ActionCardinalityBehaviorEnumFactory());
32069      if (element.hasDefinition()) {
32070        composeReference("definition", element.getDefinition());
32071      }
32072      if (element.hasTransform()) {
32073        composeReference("transform", element.getTransform());
32074      }
32075      if (element.hasDynamicValue()) { 
32076        for (PlanDefinition.PlanDefinitionActionDynamicValueComponent e : element.getDynamicValue()) 
32077          composePlanDefinitionPlanDefinitionActionDynamicValueComponent("dynamicValue", e);
32078      }
32079      if (element.hasAction()) { 
32080        for (PlanDefinition.PlanDefinitionActionComponent e : element.getAction()) 
32081          composePlanDefinitionPlanDefinitionActionComponent("action", e);
32082      }
32083  }
32084
32085  protected void composePlanDefinitionPlanDefinitionActionConditionComponent(String name, PlanDefinition.PlanDefinitionActionConditionComponent element) throws IOException {
32086    if (element != null) {
32087      composeElementAttributes(element);
32088      xml.enter(FHIR_NS, name);
32089      composePlanDefinitionPlanDefinitionActionConditionComponentElements(element);
32090      composeElementClose(element);
32091      xml.exit(FHIR_NS, name);
32092    }
32093  }
32094
32095  protected void composePlanDefinitionPlanDefinitionActionConditionComponentElements(PlanDefinition.PlanDefinitionActionConditionComponent element) throws IOException {
32096      composeBackboneElements(element);
32097      if (element.hasKindElement())
32098        composeEnumeration("kind", element.getKindElement(), new PlanDefinition.ActionConditionKindEnumFactory());
32099      if (element.hasDescriptionElement()) {
32100        composeString("description", element.getDescriptionElement());
32101      }
32102      if (element.hasLanguageElement()) {
32103        composeString("language", element.getLanguageElement());
32104      }
32105      if (element.hasExpressionElement()) {
32106        composeString("expression", element.getExpressionElement());
32107      }
32108  }
32109
32110  protected void composePlanDefinitionPlanDefinitionActionRelatedActionComponent(String name, PlanDefinition.PlanDefinitionActionRelatedActionComponent element) throws IOException {
32111    if (element != null) {
32112      composeElementAttributes(element);
32113      xml.enter(FHIR_NS, name);
32114      composePlanDefinitionPlanDefinitionActionRelatedActionComponentElements(element);
32115      composeElementClose(element);
32116      xml.exit(FHIR_NS, name);
32117    }
32118  }
32119
32120  protected void composePlanDefinitionPlanDefinitionActionRelatedActionComponentElements(PlanDefinition.PlanDefinitionActionRelatedActionComponent element) throws IOException {
32121      composeBackboneElements(element);
32122      if (element.hasActionIdElement()) {
32123        composeId("actionId", element.getActionIdElement());
32124      }
32125      if (element.hasRelationshipElement())
32126        composeEnumeration("relationship", element.getRelationshipElement(), new PlanDefinition.ActionRelationshipTypeEnumFactory());
32127      if (element.hasOffset()) {
32128        composeType("offset", element.getOffset());
32129      }  }
32130
32131  protected void composePlanDefinitionPlanDefinitionActionParticipantComponent(String name, PlanDefinition.PlanDefinitionActionParticipantComponent element) throws IOException {
32132    if (element != null) {
32133      composeElementAttributes(element);
32134      xml.enter(FHIR_NS, name);
32135      composePlanDefinitionPlanDefinitionActionParticipantComponentElements(element);
32136      composeElementClose(element);
32137      xml.exit(FHIR_NS, name);
32138    }
32139  }
32140
32141  protected void composePlanDefinitionPlanDefinitionActionParticipantComponentElements(PlanDefinition.PlanDefinitionActionParticipantComponent element) throws IOException {
32142      composeBackboneElements(element);
32143      if (element.hasTypeElement())
32144        composeEnumeration("type", element.getTypeElement(), new PlanDefinition.ActionParticipantTypeEnumFactory());
32145      if (element.hasRole()) {
32146        composeCodeableConcept("role", element.getRole());
32147      }
32148  }
32149
32150  protected void composePlanDefinitionPlanDefinitionActionDynamicValueComponent(String name, PlanDefinition.PlanDefinitionActionDynamicValueComponent element) throws IOException {
32151    if (element != null) {
32152      composeElementAttributes(element);
32153      xml.enter(FHIR_NS, name);
32154      composePlanDefinitionPlanDefinitionActionDynamicValueComponentElements(element);
32155      composeElementClose(element);
32156      xml.exit(FHIR_NS, name);
32157    }
32158  }
32159
32160  protected void composePlanDefinitionPlanDefinitionActionDynamicValueComponentElements(PlanDefinition.PlanDefinitionActionDynamicValueComponent element) throws IOException {
32161      composeBackboneElements(element);
32162      if (element.hasDescriptionElement()) {
32163        composeString("description", element.getDescriptionElement());
32164      }
32165      if (element.hasPathElement()) {
32166        composeString("path", element.getPathElement());
32167      }
32168      if (element.hasLanguageElement()) {
32169        composeString("language", element.getLanguageElement());
32170      }
32171      if (element.hasExpressionElement()) {
32172        composeString("expression", element.getExpressionElement());
32173      }
32174  }
32175
32176  protected void composePractitioner(String name, Practitioner element) throws IOException {
32177    if (element != null) {
32178      composeDomainResourceAttributes(element);
32179      xml.enter(FHIR_NS, name);
32180      composePractitionerElements(element);
32181      composeElementClose(element);
32182      xml.exit(FHIR_NS, name);
32183    }
32184  }
32185
32186  protected void composePractitionerElements(Practitioner element) throws IOException {
32187      composeDomainResourceElements(element);
32188      if (element.hasIdentifier()) { 
32189        for (Identifier e : element.getIdentifier()) 
32190          composeIdentifier("identifier", e);
32191      }
32192      if (element.hasActiveElement()) {
32193        composeBoolean("active", element.getActiveElement());
32194      }
32195      if (element.hasName()) { 
32196        for (HumanName e : element.getName()) 
32197          composeHumanName("name", e);
32198      }
32199      if (element.hasTelecom()) { 
32200        for (ContactPoint e : element.getTelecom()) 
32201          composeContactPoint("telecom", e);
32202      }
32203      if (element.hasAddress()) { 
32204        for (Address e : element.getAddress()) 
32205          composeAddress("address", e);
32206      }
32207      if (element.hasGenderElement())
32208        composeEnumeration("gender", element.getGenderElement(), new Enumerations.AdministrativeGenderEnumFactory());
32209      if (element.hasBirthDateElement()) {
32210        composeDate("birthDate", element.getBirthDateElement());
32211      }
32212      if (element.hasPhoto()) { 
32213        for (Attachment e : element.getPhoto()) 
32214          composeAttachment("photo", e);
32215      }
32216      if (element.hasQualification()) { 
32217        for (Practitioner.PractitionerQualificationComponent e : element.getQualification()) 
32218          composePractitionerPractitionerQualificationComponent("qualification", e);
32219      }
32220      if (element.hasCommunication()) { 
32221        for (CodeableConcept e : element.getCommunication()) 
32222          composeCodeableConcept("communication", e);
32223      }
32224  }
32225
32226  protected void composePractitionerPractitionerQualificationComponent(String name, Practitioner.PractitionerQualificationComponent element) throws IOException {
32227    if (element != null) {
32228      composeElementAttributes(element);
32229      xml.enter(FHIR_NS, name);
32230      composePractitionerPractitionerQualificationComponentElements(element);
32231      composeElementClose(element);
32232      xml.exit(FHIR_NS, name);
32233    }
32234  }
32235
32236  protected void composePractitionerPractitionerQualificationComponentElements(Practitioner.PractitionerQualificationComponent element) throws IOException {
32237      composeBackboneElements(element);
32238      if (element.hasIdentifier()) { 
32239        for (Identifier e : element.getIdentifier()) 
32240          composeIdentifier("identifier", e);
32241      }
32242      if (element.hasCode()) {
32243        composeCodeableConcept("code", element.getCode());
32244      }
32245      if (element.hasPeriod()) {
32246        composePeriod("period", element.getPeriod());
32247      }
32248      if (element.hasIssuer()) {
32249        composeReference("issuer", element.getIssuer());
32250      }
32251  }
32252
32253  protected void composePractitionerRole(String name, PractitionerRole element) throws IOException {
32254    if (element != null) {
32255      composeDomainResourceAttributes(element);
32256      xml.enter(FHIR_NS, name);
32257      composePractitionerRoleElements(element);
32258      composeElementClose(element);
32259      xml.exit(FHIR_NS, name);
32260    }
32261  }
32262
32263  protected void composePractitionerRoleElements(PractitionerRole element) throws IOException {
32264      composeDomainResourceElements(element);
32265      if (element.hasIdentifier()) { 
32266        for (Identifier e : element.getIdentifier()) 
32267          composeIdentifier("identifier", e);
32268      }
32269      if (element.hasActiveElement()) {
32270        composeBoolean("active", element.getActiveElement());
32271      }
32272      if (element.hasPeriod()) {
32273        composePeriod("period", element.getPeriod());
32274      }
32275      if (element.hasPractitioner()) {
32276        composeReference("practitioner", element.getPractitioner());
32277      }
32278      if (element.hasOrganization()) {
32279        composeReference("organization", element.getOrganization());
32280      }
32281      if (element.hasCode()) { 
32282        for (CodeableConcept e : element.getCode()) 
32283          composeCodeableConcept("code", e);
32284      }
32285      if (element.hasSpecialty()) { 
32286        for (CodeableConcept e : element.getSpecialty()) 
32287          composeCodeableConcept("specialty", e);
32288      }
32289      if (element.hasLocation()) { 
32290        for (Reference e : element.getLocation()) 
32291          composeReference("location", e);
32292      }
32293      if (element.hasHealthcareService()) { 
32294        for (Reference e : element.getHealthcareService()) 
32295          composeReference("healthcareService", e);
32296      }
32297      if (element.hasTelecom()) { 
32298        for (ContactPoint e : element.getTelecom()) 
32299          composeContactPoint("telecom", e);
32300      }
32301      if (element.hasAvailableTime()) { 
32302        for (PractitionerRole.PractitionerRoleAvailableTimeComponent e : element.getAvailableTime()) 
32303          composePractitionerRolePractitionerRoleAvailableTimeComponent("availableTime", e);
32304      }
32305      if (element.hasNotAvailable()) { 
32306        for (PractitionerRole.PractitionerRoleNotAvailableComponent e : element.getNotAvailable()) 
32307          composePractitionerRolePractitionerRoleNotAvailableComponent("notAvailable", e);
32308      }
32309      if (element.hasAvailabilityExceptionsElement()) {
32310        composeString("availabilityExceptions", element.getAvailabilityExceptionsElement());
32311      }
32312      if (element.hasEndpoint()) { 
32313        for (Reference e : element.getEndpoint()) 
32314          composeReference("endpoint", e);
32315      }
32316  }
32317
32318  protected void composePractitionerRolePractitionerRoleAvailableTimeComponent(String name, PractitionerRole.PractitionerRoleAvailableTimeComponent element) throws IOException {
32319    if (element != null) {
32320      composeElementAttributes(element);
32321      xml.enter(FHIR_NS, name);
32322      composePractitionerRolePractitionerRoleAvailableTimeComponentElements(element);
32323      composeElementClose(element);
32324      xml.exit(FHIR_NS, name);
32325    }
32326  }
32327
32328  protected void composePractitionerRolePractitionerRoleAvailableTimeComponentElements(PractitionerRole.PractitionerRoleAvailableTimeComponent element) throws IOException {
32329      composeBackboneElements(element);
32330        if (element.hasDaysOfWeek()) 
32331          for (Enumeration<PractitionerRole.DaysOfWeek> e : element.getDaysOfWeek()) 
32332            composeEnumeration("daysOfWeek", e, new PractitionerRole.DaysOfWeekEnumFactory());
32333      if (element.hasAllDayElement()) {
32334        composeBoolean("allDay", element.getAllDayElement());
32335      }
32336      if (element.hasAvailableStartTimeElement()) {
32337        composeTime("availableStartTime", element.getAvailableStartTimeElement());
32338      }
32339      if (element.hasAvailableEndTimeElement()) {
32340        composeTime("availableEndTime", element.getAvailableEndTimeElement());
32341      }
32342  }
32343
32344  protected void composePractitionerRolePractitionerRoleNotAvailableComponent(String name, PractitionerRole.PractitionerRoleNotAvailableComponent element) throws IOException {
32345    if (element != null) {
32346      composeElementAttributes(element);
32347      xml.enter(FHIR_NS, name);
32348      composePractitionerRolePractitionerRoleNotAvailableComponentElements(element);
32349      composeElementClose(element);
32350      xml.exit(FHIR_NS, name);
32351    }
32352  }
32353
32354  protected void composePractitionerRolePractitionerRoleNotAvailableComponentElements(PractitionerRole.PractitionerRoleNotAvailableComponent element) throws IOException {
32355      composeBackboneElements(element);
32356      if (element.hasDescriptionElement()) {
32357        composeString("description", element.getDescriptionElement());
32358      }
32359      if (element.hasDuring()) {
32360        composePeriod("during", element.getDuring());
32361      }
32362  }
32363
32364  protected void composeProcedure(String name, Procedure element) throws IOException {
32365    if (element != null) {
32366      composeDomainResourceAttributes(element);
32367      xml.enter(FHIR_NS, name);
32368      composeProcedureElements(element);
32369      composeElementClose(element);
32370      xml.exit(FHIR_NS, name);
32371    }
32372  }
32373
32374  protected void composeProcedureElements(Procedure element) throws IOException {
32375      composeDomainResourceElements(element);
32376      if (element.hasIdentifier()) { 
32377        for (Identifier e : element.getIdentifier()) 
32378          composeIdentifier("identifier", e);
32379      }
32380      if (element.hasDefinition()) { 
32381        for (Reference e : element.getDefinition()) 
32382          composeReference("definition", e);
32383      }
32384      if (element.hasBasedOn()) { 
32385        for (Reference e : element.getBasedOn()) 
32386          composeReference("basedOn", e);
32387      }
32388      if (element.hasPartOf()) { 
32389        for (Reference e : element.getPartOf()) 
32390          composeReference("partOf", e);
32391      }
32392      if (element.hasStatusElement())
32393        composeEnumeration("status", element.getStatusElement(), new Procedure.ProcedureStatusEnumFactory());
32394      if (element.hasNotDoneElement()) {
32395        composeBoolean("notDone", element.getNotDoneElement());
32396      }
32397      if (element.hasNotDoneReason()) {
32398        composeCodeableConcept("notDoneReason", element.getNotDoneReason());
32399      }
32400      if (element.hasCategory()) {
32401        composeCodeableConcept("category", element.getCategory());
32402      }
32403      if (element.hasCode()) {
32404        composeCodeableConcept("code", element.getCode());
32405      }
32406      if (element.hasSubject()) {
32407        composeReference("subject", element.getSubject());
32408      }
32409      if (element.hasContext()) {
32410        composeReference("context", element.getContext());
32411      }
32412      if (element.hasPerformed()) {
32413        composeType("performed", element.getPerformed());
32414      }      if (element.hasPerformer()) { 
32415        for (Procedure.ProcedurePerformerComponent e : element.getPerformer()) 
32416          composeProcedureProcedurePerformerComponent("performer", e);
32417      }
32418      if (element.hasLocation()) {
32419        composeReference("location", element.getLocation());
32420      }
32421      if (element.hasReasonCode()) { 
32422        for (CodeableConcept e : element.getReasonCode()) 
32423          composeCodeableConcept("reasonCode", e);
32424      }
32425      if (element.hasReasonReference()) { 
32426        for (Reference e : element.getReasonReference()) 
32427          composeReference("reasonReference", e);
32428      }
32429      if (element.hasBodySite()) { 
32430        for (CodeableConcept e : element.getBodySite()) 
32431          composeCodeableConcept("bodySite", e);
32432      }
32433      if (element.hasOutcome()) {
32434        composeCodeableConcept("outcome", element.getOutcome());
32435      }
32436      if (element.hasReport()) { 
32437        for (Reference e : element.getReport()) 
32438          composeReference("report", e);
32439      }
32440      if (element.hasComplication()) { 
32441        for (CodeableConcept e : element.getComplication()) 
32442          composeCodeableConcept("complication", e);
32443      }
32444      if (element.hasComplicationDetail()) { 
32445        for (Reference e : element.getComplicationDetail()) 
32446          composeReference("complicationDetail", e);
32447      }
32448      if (element.hasFollowUp()) { 
32449        for (CodeableConcept e : element.getFollowUp()) 
32450          composeCodeableConcept("followUp", e);
32451      }
32452      if (element.hasNote()) { 
32453        for (Annotation e : element.getNote()) 
32454          composeAnnotation("note", e);
32455      }
32456      if (element.hasFocalDevice()) { 
32457        for (Procedure.ProcedureFocalDeviceComponent e : element.getFocalDevice()) 
32458          composeProcedureProcedureFocalDeviceComponent("focalDevice", e);
32459      }
32460      if (element.hasUsedReference()) { 
32461        for (Reference e : element.getUsedReference()) 
32462          composeReference("usedReference", e);
32463      }
32464      if (element.hasUsedCode()) { 
32465        for (CodeableConcept e : element.getUsedCode()) 
32466          composeCodeableConcept("usedCode", e);
32467      }
32468  }
32469
32470  protected void composeProcedureProcedurePerformerComponent(String name, Procedure.ProcedurePerformerComponent element) throws IOException {
32471    if (element != null) {
32472      composeElementAttributes(element);
32473      xml.enter(FHIR_NS, name);
32474      composeProcedureProcedurePerformerComponentElements(element);
32475      composeElementClose(element);
32476      xml.exit(FHIR_NS, name);
32477    }
32478  }
32479
32480  protected void composeProcedureProcedurePerformerComponentElements(Procedure.ProcedurePerformerComponent element) throws IOException {
32481      composeBackboneElements(element);
32482      if (element.hasRole()) {
32483        composeCodeableConcept("role", element.getRole());
32484      }
32485      if (element.hasActor()) {
32486        composeReference("actor", element.getActor());
32487      }
32488      if (element.hasOnBehalfOf()) {
32489        composeReference("onBehalfOf", element.getOnBehalfOf());
32490      }
32491  }
32492
32493  protected void composeProcedureProcedureFocalDeviceComponent(String name, Procedure.ProcedureFocalDeviceComponent element) throws IOException {
32494    if (element != null) {
32495      composeElementAttributes(element);
32496      xml.enter(FHIR_NS, name);
32497      composeProcedureProcedureFocalDeviceComponentElements(element);
32498      composeElementClose(element);
32499      xml.exit(FHIR_NS, name);
32500    }
32501  }
32502
32503  protected void composeProcedureProcedureFocalDeviceComponentElements(Procedure.ProcedureFocalDeviceComponent element) throws IOException {
32504      composeBackboneElements(element);
32505      if (element.hasAction()) {
32506        composeCodeableConcept("action", element.getAction());
32507      }
32508      if (element.hasManipulated()) {
32509        composeReference("manipulated", element.getManipulated());
32510      }
32511  }
32512
32513  protected void composeProcedureRequest(String name, ProcedureRequest element) throws IOException {
32514    if (element != null) {
32515      composeDomainResourceAttributes(element);
32516      xml.enter(FHIR_NS, name);
32517      composeProcedureRequestElements(element);
32518      composeElementClose(element);
32519      xml.exit(FHIR_NS, name);
32520    }
32521  }
32522
32523  protected void composeProcedureRequestElements(ProcedureRequest element) throws IOException {
32524      composeDomainResourceElements(element);
32525      if (element.hasIdentifier()) { 
32526        for (Identifier e : element.getIdentifier()) 
32527          composeIdentifier("identifier", e);
32528      }
32529      if (element.hasDefinition()) { 
32530        for (Reference e : element.getDefinition()) 
32531          composeReference("definition", e);
32532      }
32533      if (element.hasBasedOn()) { 
32534        for (Reference e : element.getBasedOn()) 
32535          composeReference("basedOn", e);
32536      }
32537      if (element.hasReplaces()) { 
32538        for (Reference e : element.getReplaces()) 
32539          composeReference("replaces", e);
32540      }
32541      if (element.hasRequisition()) {
32542        composeIdentifier("requisition", element.getRequisition());
32543      }
32544      if (element.hasStatusElement())
32545        composeEnumeration("status", element.getStatusElement(), new ProcedureRequest.ProcedureRequestStatusEnumFactory());
32546      if (element.hasIntentElement())
32547        composeEnumeration("intent", element.getIntentElement(), new ProcedureRequest.ProcedureRequestIntentEnumFactory());
32548      if (element.hasPriorityElement())
32549        composeEnumeration("priority", element.getPriorityElement(), new ProcedureRequest.ProcedureRequestPriorityEnumFactory());
32550      if (element.hasDoNotPerformElement()) {
32551        composeBoolean("doNotPerform", element.getDoNotPerformElement());
32552      }
32553      if (element.hasCategory()) { 
32554        for (CodeableConcept e : element.getCategory()) 
32555          composeCodeableConcept("category", e);
32556      }
32557      if (element.hasCode()) {
32558        composeCodeableConcept("code", element.getCode());
32559      }
32560      if (element.hasSubject()) {
32561        composeReference("subject", element.getSubject());
32562      }
32563      if (element.hasContext()) {
32564        composeReference("context", element.getContext());
32565      }
32566      if (element.hasOccurrence()) {
32567        composeType("occurrence", element.getOccurrence());
32568      }      if (element.hasAsNeeded()) {
32569        composeType("asNeeded", element.getAsNeeded());
32570      }      if (element.hasAuthoredOnElement()) {
32571        composeDateTime("authoredOn", element.getAuthoredOnElement());
32572      }
32573      if (element.hasRequester()) {
32574        composeProcedureRequestProcedureRequestRequesterComponent("requester", element.getRequester());
32575      }
32576      if (element.hasPerformerType()) {
32577        composeCodeableConcept("performerType", element.getPerformerType());
32578      }
32579      if (element.hasPerformer()) {
32580        composeReference("performer", element.getPerformer());
32581      }
32582      if (element.hasReasonCode()) { 
32583        for (CodeableConcept e : element.getReasonCode()) 
32584          composeCodeableConcept("reasonCode", e);
32585      }
32586      if (element.hasReasonReference()) { 
32587        for (Reference e : element.getReasonReference()) 
32588          composeReference("reasonReference", e);
32589      }
32590      if (element.hasSupportingInfo()) { 
32591        for (Reference e : element.getSupportingInfo()) 
32592          composeReference("supportingInfo", e);
32593      }
32594      if (element.hasSpecimen()) { 
32595        for (Reference e : element.getSpecimen()) 
32596          composeReference("specimen", e);
32597      }
32598      if (element.hasBodySite()) { 
32599        for (CodeableConcept e : element.getBodySite()) 
32600          composeCodeableConcept("bodySite", e);
32601      }
32602      if (element.hasNote()) { 
32603        for (Annotation e : element.getNote()) 
32604          composeAnnotation("note", e);
32605      }
32606      if (element.hasRelevantHistory()) { 
32607        for (Reference e : element.getRelevantHistory()) 
32608          composeReference("relevantHistory", e);
32609      }
32610  }
32611
32612  protected void composeProcedureRequestProcedureRequestRequesterComponent(String name, ProcedureRequest.ProcedureRequestRequesterComponent element) throws IOException {
32613    if (element != null) {
32614      composeElementAttributes(element);
32615      xml.enter(FHIR_NS, name);
32616      composeProcedureRequestProcedureRequestRequesterComponentElements(element);
32617      composeElementClose(element);
32618      xml.exit(FHIR_NS, name);
32619    }
32620  }
32621
32622  protected void composeProcedureRequestProcedureRequestRequesterComponentElements(ProcedureRequest.ProcedureRequestRequesterComponent element) throws IOException {
32623      composeBackboneElements(element);
32624      if (element.hasAgent()) {
32625        composeReference("agent", element.getAgent());
32626      }
32627      if (element.hasOnBehalfOf()) {
32628        composeReference("onBehalfOf", element.getOnBehalfOf());
32629      }
32630  }
32631
32632  protected void composeProcessRequest(String name, ProcessRequest element) throws IOException {
32633    if (element != null) {
32634      composeDomainResourceAttributes(element);
32635      xml.enter(FHIR_NS, name);
32636      composeProcessRequestElements(element);
32637      composeElementClose(element);
32638      xml.exit(FHIR_NS, name);
32639    }
32640  }
32641
32642  protected void composeProcessRequestElements(ProcessRequest element) throws IOException {
32643      composeDomainResourceElements(element);
32644      if (element.hasIdentifier()) { 
32645        for (Identifier e : element.getIdentifier()) 
32646          composeIdentifier("identifier", e);
32647      }
32648      if (element.hasStatusElement())
32649        composeEnumeration("status", element.getStatusElement(), new ProcessRequest.ProcessRequestStatusEnumFactory());
32650      if (element.hasActionElement())
32651        composeEnumeration("action", element.getActionElement(), new ProcessRequest.ActionListEnumFactory());
32652      if (element.hasTarget()) {
32653        composeReference("target", element.getTarget());
32654      }
32655      if (element.hasCreatedElement()) {
32656        composeDateTime("created", element.getCreatedElement());
32657      }
32658      if (element.hasProvider()) {
32659        composeReference("provider", element.getProvider());
32660      }
32661      if (element.hasOrganization()) {
32662        composeReference("organization", element.getOrganization());
32663      }
32664      if (element.hasRequest()) {
32665        composeReference("request", element.getRequest());
32666      }
32667      if (element.hasResponse()) {
32668        composeReference("response", element.getResponse());
32669      }
32670      if (element.hasNullifyElement()) {
32671        composeBoolean("nullify", element.getNullifyElement());
32672      }
32673      if (element.hasReferenceElement()) {
32674        composeString("reference", element.getReferenceElement());
32675      }
32676      if (element.hasItem()) { 
32677        for (ProcessRequest.ItemsComponent e : element.getItem()) 
32678          composeProcessRequestItemsComponent("item", e);
32679      }
32680      if (element.hasInclude()) { 
32681        for (StringType e : element.getInclude()) 
32682          composeString("include", e);
32683      }
32684      if (element.hasExclude()) { 
32685        for (StringType e : element.getExclude()) 
32686          composeString("exclude", e);
32687      }
32688      if (element.hasPeriod()) {
32689        composePeriod("period", element.getPeriod());
32690      }
32691  }
32692
32693  protected void composeProcessRequestItemsComponent(String name, ProcessRequest.ItemsComponent element) throws IOException {
32694    if (element != null) {
32695      composeElementAttributes(element);
32696      xml.enter(FHIR_NS, name);
32697      composeProcessRequestItemsComponentElements(element);
32698      composeElementClose(element);
32699      xml.exit(FHIR_NS, name);
32700    }
32701  }
32702
32703  protected void composeProcessRequestItemsComponentElements(ProcessRequest.ItemsComponent element) throws IOException {
32704      composeBackboneElements(element);
32705      if (element.hasSequenceLinkIdElement()) {
32706        composeInteger("sequenceLinkId", element.getSequenceLinkIdElement());
32707      }
32708  }
32709
32710  protected void composeProcessResponse(String name, ProcessResponse element) throws IOException {
32711    if (element != null) {
32712      composeDomainResourceAttributes(element);
32713      xml.enter(FHIR_NS, name);
32714      composeProcessResponseElements(element);
32715      composeElementClose(element);
32716      xml.exit(FHIR_NS, name);
32717    }
32718  }
32719
32720  protected void composeProcessResponseElements(ProcessResponse element) throws IOException {
32721      composeDomainResourceElements(element);
32722      if (element.hasIdentifier()) { 
32723        for (Identifier e : element.getIdentifier()) 
32724          composeIdentifier("identifier", e);
32725      }
32726      if (element.hasStatusElement())
32727        composeEnumeration("status", element.getStatusElement(), new ProcessResponse.ProcessResponseStatusEnumFactory());
32728      if (element.hasCreatedElement()) {
32729        composeDateTime("created", element.getCreatedElement());
32730      }
32731      if (element.hasOrganization()) {
32732        composeReference("organization", element.getOrganization());
32733      }
32734      if (element.hasRequest()) {
32735        composeReference("request", element.getRequest());
32736      }
32737      if (element.hasOutcome()) {
32738        composeCodeableConcept("outcome", element.getOutcome());
32739      }
32740      if (element.hasDispositionElement()) {
32741        composeString("disposition", element.getDispositionElement());
32742      }
32743      if (element.hasRequestProvider()) {
32744        composeReference("requestProvider", element.getRequestProvider());
32745      }
32746      if (element.hasRequestOrganization()) {
32747        composeReference("requestOrganization", element.getRequestOrganization());
32748      }
32749      if (element.hasForm()) {
32750        composeCodeableConcept("form", element.getForm());
32751      }
32752      if (element.hasProcessNote()) { 
32753        for (ProcessResponse.ProcessResponseProcessNoteComponent e : element.getProcessNote()) 
32754          composeProcessResponseProcessResponseProcessNoteComponent("processNote", e);
32755      }
32756      if (element.hasError()) { 
32757        for (CodeableConcept e : element.getError()) 
32758          composeCodeableConcept("error", e);
32759      }
32760      if (element.hasCommunicationRequest()) { 
32761        for (Reference e : element.getCommunicationRequest()) 
32762          composeReference("communicationRequest", e);
32763      }
32764  }
32765
32766  protected void composeProcessResponseProcessResponseProcessNoteComponent(String name, ProcessResponse.ProcessResponseProcessNoteComponent element) throws IOException {
32767    if (element != null) {
32768      composeElementAttributes(element);
32769      xml.enter(FHIR_NS, name);
32770      composeProcessResponseProcessResponseProcessNoteComponentElements(element);
32771      composeElementClose(element);
32772      xml.exit(FHIR_NS, name);
32773    }
32774  }
32775
32776  protected void composeProcessResponseProcessResponseProcessNoteComponentElements(ProcessResponse.ProcessResponseProcessNoteComponent element) throws IOException {
32777      composeBackboneElements(element);
32778      if (element.hasType()) {
32779        composeCodeableConcept("type", element.getType());
32780      }
32781      if (element.hasTextElement()) {
32782        composeString("text", element.getTextElement());
32783      }
32784  }
32785
32786  protected void composeProvenance(String name, Provenance element) throws IOException {
32787    if (element != null) {
32788      composeDomainResourceAttributes(element);
32789      xml.enter(FHIR_NS, name);
32790      composeProvenanceElements(element);
32791      composeElementClose(element);
32792      xml.exit(FHIR_NS, name);
32793    }
32794  }
32795
32796  protected void composeProvenanceElements(Provenance element) throws IOException {
32797      composeDomainResourceElements(element);
32798      if (element.hasTarget()) { 
32799        for (Reference e : element.getTarget()) 
32800          composeReference("target", e);
32801      }
32802      if (element.hasPeriod()) {
32803        composePeriod("period", element.getPeriod());
32804      }
32805      if (element.hasRecordedElement()) {
32806        composeInstant("recorded", element.getRecordedElement());
32807      }
32808      if (element.hasPolicy()) { 
32809        for (UriType e : element.getPolicy()) 
32810          composeUri("policy", e);
32811      }
32812      if (element.hasLocation()) {
32813        composeReference("location", element.getLocation());
32814      }
32815      if (element.hasReason()) { 
32816        for (Coding e : element.getReason()) 
32817          composeCoding("reason", e);
32818      }
32819      if (element.hasActivity()) {
32820        composeCoding("activity", element.getActivity());
32821      }
32822      if (element.hasAgent()) { 
32823        for (Provenance.ProvenanceAgentComponent e : element.getAgent()) 
32824          composeProvenanceProvenanceAgentComponent("agent", e);
32825      }
32826      if (element.hasEntity()) { 
32827        for (Provenance.ProvenanceEntityComponent e : element.getEntity()) 
32828          composeProvenanceProvenanceEntityComponent("entity", e);
32829      }
32830      if (element.hasSignature()) { 
32831        for (Signature e : element.getSignature()) 
32832          composeSignature("signature", e);
32833      }
32834  }
32835
32836  protected void composeProvenanceProvenanceAgentComponent(String name, Provenance.ProvenanceAgentComponent element) throws IOException {
32837    if (element != null) {
32838      composeElementAttributes(element);
32839      xml.enter(FHIR_NS, name);
32840      composeProvenanceProvenanceAgentComponentElements(element);
32841      composeElementClose(element);
32842      xml.exit(FHIR_NS, name);
32843    }
32844  }
32845
32846  protected void composeProvenanceProvenanceAgentComponentElements(Provenance.ProvenanceAgentComponent element) throws IOException {
32847      composeBackboneElements(element);
32848      if (element.hasRole()) { 
32849        for (CodeableConcept e : element.getRole()) 
32850          composeCodeableConcept("role", e);
32851      }
32852      if (element.hasWho()) {
32853        composeType("who", element.getWho());
32854      }      if (element.hasOnBehalfOf()) {
32855        composeType("onBehalfOf", element.getOnBehalfOf());
32856      }      if (element.hasRelatedAgentType()) {
32857        composeCodeableConcept("relatedAgentType", element.getRelatedAgentType());
32858      }
32859  }
32860
32861  protected void composeProvenanceProvenanceEntityComponent(String name, Provenance.ProvenanceEntityComponent element) throws IOException {
32862    if (element != null) {
32863      composeElementAttributes(element);
32864      xml.enter(FHIR_NS, name);
32865      composeProvenanceProvenanceEntityComponentElements(element);
32866      composeElementClose(element);
32867      xml.exit(FHIR_NS, name);
32868    }
32869  }
32870
32871  protected void composeProvenanceProvenanceEntityComponentElements(Provenance.ProvenanceEntityComponent element) throws IOException {
32872      composeBackboneElements(element);
32873      if (element.hasRoleElement())
32874        composeEnumeration("role", element.getRoleElement(), new Provenance.ProvenanceEntityRoleEnumFactory());
32875      if (element.hasWhat()) {
32876        composeType("what", element.getWhat());
32877      }      if (element.hasAgent()) { 
32878        for (Provenance.ProvenanceAgentComponent e : element.getAgent()) 
32879          composeProvenanceProvenanceAgentComponent("agent", e);
32880      }
32881  }
32882
32883  protected void composeQuestionnaire(String name, Questionnaire element) throws IOException {
32884    if (element != null) {
32885      composeDomainResourceAttributes(element);
32886      xml.enter(FHIR_NS, name);
32887      composeQuestionnaireElements(element);
32888      composeElementClose(element);
32889      xml.exit(FHIR_NS, name);
32890    }
32891  }
32892
32893  protected void composeQuestionnaireElements(Questionnaire element) throws IOException {
32894      composeDomainResourceElements(element);
32895      if (element.hasUrlElement()) {
32896        composeUri("url", element.getUrlElement());
32897      }
32898      if (element.hasIdentifier()) { 
32899        for (Identifier e : element.getIdentifier()) 
32900          composeIdentifier("identifier", e);
32901      }
32902      if (element.hasVersionElement()) {
32903        composeString("version", element.getVersionElement());
32904      }
32905      if (element.hasNameElement()) {
32906        composeString("name", element.getNameElement());
32907      }
32908      if (element.hasTitleElement()) {
32909        composeString("title", element.getTitleElement());
32910      }
32911      if (element.hasStatusElement())
32912        composeEnumeration("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory());
32913      if (element.hasExperimentalElement()) {
32914        composeBoolean("experimental", element.getExperimentalElement());
32915      }
32916      if (element.hasDateElement()) {
32917        composeDateTime("date", element.getDateElement());
32918      }
32919      if (element.hasPublisherElement()) {
32920        composeString("publisher", element.getPublisherElement());
32921      }
32922      if (element.hasDescriptionElement()) {
32923        composeMarkdown("description", element.getDescriptionElement());
32924      }
32925      if (element.hasPurposeElement()) {
32926        composeMarkdown("purpose", element.getPurposeElement());
32927      }
32928      if (element.hasApprovalDateElement()) {
32929        composeDate("approvalDate", element.getApprovalDateElement());
32930      }
32931      if (element.hasLastReviewDateElement()) {
32932        composeDate("lastReviewDate", element.getLastReviewDateElement());
32933      }
32934      if (element.hasEffectivePeriod()) {
32935        composePeriod("effectivePeriod", element.getEffectivePeriod());
32936      }
32937      if (element.hasUseContext()) { 
32938        for (UsageContext e : element.getUseContext()) 
32939          composeUsageContext("useContext", e);
32940      }
32941      if (element.hasJurisdiction()) { 
32942        for (CodeableConcept e : element.getJurisdiction()) 
32943          composeCodeableConcept("jurisdiction", e);
32944      }
32945      if (element.hasContact()) { 
32946        for (ContactDetail e : element.getContact()) 
32947          composeContactDetail("contact", e);
32948      }
32949      if (element.hasCopyrightElement()) {
32950        composeMarkdown("copyright", element.getCopyrightElement());
32951      }
32952      if (element.hasCode()) { 
32953        for (Coding e : element.getCode()) 
32954          composeCoding("code", e);
32955      }
32956      if (element.hasSubjectType()) { 
32957        for (CodeType e : element.getSubjectType()) 
32958          composeCode("subjectType", e);
32959      }
32960      if (element.hasItem()) { 
32961        for (Questionnaire.QuestionnaireItemComponent e : element.getItem()) 
32962          composeQuestionnaireQuestionnaireItemComponent("item", e);
32963      }
32964  }
32965
32966  protected void composeQuestionnaireQuestionnaireItemComponent(String name, Questionnaire.QuestionnaireItemComponent element) throws IOException {
32967    if (element != null) {
32968      composeElementAttributes(element);
32969      xml.enter(FHIR_NS, name);
32970      composeQuestionnaireQuestionnaireItemComponentElements(element);
32971      composeElementClose(element);
32972      xml.exit(FHIR_NS, name);
32973    }
32974  }
32975
32976  protected void composeQuestionnaireQuestionnaireItemComponentElements(Questionnaire.QuestionnaireItemComponent element) throws IOException {
32977      composeBackboneElements(element);
32978      if (element.hasLinkIdElement()) {
32979        composeString("linkId", element.getLinkIdElement());
32980      }
32981      if (element.hasDefinitionElement()) {
32982        composeUri("definition", element.getDefinitionElement());
32983      }
32984      if (element.hasCode()) { 
32985        for (Coding e : element.getCode()) 
32986          composeCoding("code", e);
32987      }
32988      if (element.hasPrefixElement()) {
32989        composeString("prefix", element.getPrefixElement());
32990      }
32991      if (element.hasTextElement()) {
32992        composeString("text", element.getTextElement());
32993      }
32994      if (element.hasTypeElement())
32995        composeEnumeration("type", element.getTypeElement(), new Questionnaire.QuestionnaireItemTypeEnumFactory());
32996      if (element.hasEnableWhen()) { 
32997        for (Questionnaire.QuestionnaireItemEnableWhenComponent e : element.getEnableWhen()) 
32998          composeQuestionnaireQuestionnaireItemEnableWhenComponent("enableWhen", e);
32999      }
33000      if (element.hasRequiredElement()) {
33001        composeBoolean("required", element.getRequiredElement());
33002      }
33003      if (element.hasRepeatsElement()) {
33004        composeBoolean("repeats", element.getRepeatsElement());
33005      }
33006      if (element.hasReadOnlyElement()) {
33007        composeBoolean("readOnly", element.getReadOnlyElement());
33008      }
33009      if (element.hasMaxLengthElement()) {
33010        composeInteger("maxLength", element.getMaxLengthElement());
33011      }
33012      if (element.hasOptions()) {
33013        composeReference("options", element.getOptions());
33014      }
33015      if (element.hasOption()) { 
33016        for (Questionnaire.QuestionnaireItemOptionComponent e : element.getOption()) 
33017          composeQuestionnaireQuestionnaireItemOptionComponent("option", e);
33018      }
33019      if (element.hasInitial()) {
33020        composeType("initial", element.getInitial());
33021      }      if (element.hasItem()) { 
33022        for (Questionnaire.QuestionnaireItemComponent e : element.getItem()) 
33023          composeQuestionnaireQuestionnaireItemComponent("item", e);
33024      }
33025  }
33026
33027  protected void composeQuestionnaireQuestionnaireItemEnableWhenComponent(String name, Questionnaire.QuestionnaireItemEnableWhenComponent element) throws IOException {
33028    if (element != null) {
33029      composeElementAttributes(element);
33030      xml.enter(FHIR_NS, name);
33031      composeQuestionnaireQuestionnaireItemEnableWhenComponentElements(element);
33032      composeElementClose(element);
33033      xml.exit(FHIR_NS, name);
33034    }
33035  }
33036
33037  protected void composeQuestionnaireQuestionnaireItemEnableWhenComponentElements(Questionnaire.QuestionnaireItemEnableWhenComponent element) throws IOException {
33038      composeBackboneElements(element);
33039      if (element.hasQuestionElement()) {
33040        composeString("question", element.getQuestionElement());
33041      }
33042      if (element.hasHasAnswerElement()) {
33043        composeBoolean("hasAnswer", element.getHasAnswerElement());
33044      }
33045      if (element.hasAnswer()) {
33046        composeType("answer", element.getAnswer());
33047      }  }
33048
33049  protected void composeQuestionnaireQuestionnaireItemOptionComponent(String name, Questionnaire.QuestionnaireItemOptionComponent element) throws IOException {
33050    if (element != null) {
33051      composeElementAttributes(element);
33052      xml.enter(FHIR_NS, name);
33053      composeQuestionnaireQuestionnaireItemOptionComponentElements(element);
33054      composeElementClose(element);
33055      xml.exit(FHIR_NS, name);
33056    }
33057  }
33058
33059  protected void composeQuestionnaireQuestionnaireItemOptionComponentElements(Questionnaire.QuestionnaireItemOptionComponent element) throws IOException {
33060      composeBackboneElements(element);
33061      if (element.hasValue()) {
33062        composeType("value", element.getValue());
33063      }  }
33064
33065  protected void composeQuestionnaireResponse(String name, QuestionnaireResponse element) throws IOException {
33066    if (element != null) {
33067      composeDomainResourceAttributes(element);
33068      xml.enter(FHIR_NS, name);
33069      composeQuestionnaireResponseElements(element);
33070      composeElementClose(element);
33071      xml.exit(FHIR_NS, name);
33072    }
33073  }
33074
33075  protected void composeQuestionnaireResponseElements(QuestionnaireResponse element) throws IOException {
33076      composeDomainResourceElements(element);
33077      if (element.hasIdentifier()) {
33078        composeIdentifier("identifier", element.getIdentifier());
33079      }
33080      if (element.hasBasedOn()) { 
33081        for (Reference e : element.getBasedOn()) 
33082          composeReference("basedOn", e);
33083      }
33084      if (element.hasParent()) { 
33085        for (Reference e : element.getParent()) 
33086          composeReference("parent", e);
33087      }
33088      if (element.hasQuestionnaire()) {
33089        composeReference("questionnaire", element.getQuestionnaire());
33090      }
33091      if (element.hasStatusElement())
33092        composeEnumeration("status", element.getStatusElement(), new QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory());
33093      if (element.hasSubject()) {
33094        composeReference("subject", element.getSubject());
33095      }
33096      if (element.hasContext()) {
33097        composeReference("context", element.getContext());
33098      }
33099      if (element.hasAuthoredElement()) {
33100        composeDateTime("authored", element.getAuthoredElement());
33101      }
33102      if (element.hasAuthor()) {
33103        composeReference("author", element.getAuthor());
33104      }
33105      if (element.hasSource()) {
33106        composeReference("source", element.getSource());
33107      }
33108      if (element.hasItem()) { 
33109        for (QuestionnaireResponse.QuestionnaireResponseItemComponent e : element.getItem()) 
33110          composeQuestionnaireResponseQuestionnaireResponseItemComponent("item", e);
33111      }
33112  }
33113
33114  protected void composeQuestionnaireResponseQuestionnaireResponseItemComponent(String name, QuestionnaireResponse.QuestionnaireResponseItemComponent element) throws IOException {
33115    if (element != null) {
33116      composeElementAttributes(element);
33117      xml.enter(FHIR_NS, name);
33118      composeQuestionnaireResponseQuestionnaireResponseItemComponentElements(element);
33119      composeElementClose(element);
33120      xml.exit(FHIR_NS, name);
33121    }
33122  }
33123
33124  protected void composeQuestionnaireResponseQuestionnaireResponseItemComponentElements(QuestionnaireResponse.QuestionnaireResponseItemComponent element) throws IOException {
33125      composeBackboneElements(element);
33126      if (element.hasLinkIdElement()) {
33127        composeString("linkId", element.getLinkIdElement());
33128      }
33129      if (element.hasDefinitionElement()) {
33130        composeUri("definition", element.getDefinitionElement());
33131      }
33132      if (element.hasTextElement()) {
33133        composeString("text", element.getTextElement());
33134      }
33135      if (element.hasSubject()) {
33136        composeReference("subject", element.getSubject());
33137      }
33138      if (element.hasAnswer()) { 
33139        for (QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent e : element.getAnswer()) 
33140          composeQuestionnaireResponseQuestionnaireResponseItemAnswerComponent("answer", e);
33141      }
33142      if (element.hasItem()) { 
33143        for (QuestionnaireResponse.QuestionnaireResponseItemComponent e : element.getItem()) 
33144          composeQuestionnaireResponseQuestionnaireResponseItemComponent("item", e);
33145      }
33146  }
33147
33148  protected void composeQuestionnaireResponseQuestionnaireResponseItemAnswerComponent(String name, QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent element) throws IOException {
33149    if (element != null) {
33150      composeElementAttributes(element);
33151      xml.enter(FHIR_NS, name);
33152      composeQuestionnaireResponseQuestionnaireResponseItemAnswerComponentElements(element);
33153      composeElementClose(element);
33154      xml.exit(FHIR_NS, name);
33155    }
33156  }
33157
33158  protected void composeQuestionnaireResponseQuestionnaireResponseItemAnswerComponentElements(QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent element) throws IOException {
33159      composeBackboneElements(element);
33160      if (element.hasValue()) {
33161        composeType("value", element.getValue());
33162      }      if (element.hasItem()) { 
33163        for (QuestionnaireResponse.QuestionnaireResponseItemComponent e : element.getItem()) 
33164          composeQuestionnaireResponseQuestionnaireResponseItemComponent("item", e);
33165      }
33166  }
33167
33168  protected void composeReferralRequest(String name, ReferralRequest element) throws IOException {
33169    if (element != null) {
33170      composeDomainResourceAttributes(element);
33171      xml.enter(FHIR_NS, name);
33172      composeReferralRequestElements(element);
33173      composeElementClose(element);
33174      xml.exit(FHIR_NS, name);
33175    }
33176  }
33177
33178  protected void composeReferralRequestElements(ReferralRequest element) throws IOException {
33179      composeDomainResourceElements(element);
33180      if (element.hasIdentifier()) { 
33181        for (Identifier e : element.getIdentifier()) 
33182          composeIdentifier("identifier", e);
33183      }
33184      if (element.hasDefinition()) { 
33185        for (Reference e : element.getDefinition()) 
33186          composeReference("definition", e);
33187      }
33188      if (element.hasBasedOn()) { 
33189        for (Reference e : element.getBasedOn()) 
33190          composeReference("basedOn", e);
33191      }
33192      if (element.hasReplaces()) { 
33193        for (Reference e : element.getReplaces()) 
33194          composeReference("replaces", e);
33195      }
33196      if (element.hasGroupIdentifier()) {
33197        composeIdentifier("groupIdentifier", element.getGroupIdentifier());
33198      }
33199      if (element.hasStatusElement())
33200        composeEnumeration("status", element.getStatusElement(), new ReferralRequest.ReferralRequestStatusEnumFactory());
33201      if (element.hasIntentElement())
33202        composeEnumeration("intent", element.getIntentElement(), new ReferralRequest.ReferralCategoryEnumFactory());
33203      if (element.hasType()) {
33204        composeCodeableConcept("type", element.getType());
33205      }
33206      if (element.hasPriorityElement())
33207        composeEnumeration("priority", element.getPriorityElement(), new ReferralRequest.ReferralPriorityEnumFactory());
33208      if (element.hasServiceRequested()) { 
33209        for (CodeableConcept e : element.getServiceRequested()) 
33210          composeCodeableConcept("serviceRequested", e);
33211      }
33212      if (element.hasSubject()) {
33213        composeReference("subject", element.getSubject());
33214      }
33215      if (element.hasContext()) {
33216        composeReference("context", element.getContext());
33217      }
33218      if (element.hasOccurrence()) {
33219        composeType("occurrence", element.getOccurrence());
33220      }      if (element.hasAuthoredOnElement()) {
33221        composeDateTime("authoredOn", element.getAuthoredOnElement());
33222      }
33223      if (element.hasRequester()) {
33224        composeReferralRequestReferralRequestRequesterComponent("requester", element.getRequester());
33225      }
33226      if (element.hasSpecialty()) {
33227        composeCodeableConcept("specialty", element.getSpecialty());
33228      }
33229      if (element.hasRecipient()) { 
33230        for (Reference e : element.getRecipient()) 
33231          composeReference("recipient", e);
33232      }
33233      if (element.hasReasonCode()) { 
33234        for (CodeableConcept e : element.getReasonCode()) 
33235          composeCodeableConcept("reasonCode", e);
33236      }
33237      if (element.hasReasonReference()) { 
33238        for (Reference e : element.getReasonReference()) 
33239          composeReference("reasonReference", e);
33240      }
33241      if (element.hasDescriptionElement()) {
33242        composeString("description", element.getDescriptionElement());
33243      }
33244      if (element.hasSupportingInfo()) { 
33245        for (Reference e : element.getSupportingInfo()) 
33246          composeReference("supportingInfo", e);
33247      }
33248      if (element.hasNote()) { 
33249        for (Annotation e : element.getNote()) 
33250          composeAnnotation("note", e);
33251      }
33252      if (element.hasRelevantHistory()) { 
33253        for (Reference e : element.getRelevantHistory()) 
33254          composeReference("relevantHistory", e);
33255      }
33256  }
33257
33258  protected void composeReferralRequestReferralRequestRequesterComponent(String name, ReferralRequest.ReferralRequestRequesterComponent element) throws IOException {
33259    if (element != null) {
33260      composeElementAttributes(element);
33261      xml.enter(FHIR_NS, name);
33262      composeReferralRequestReferralRequestRequesterComponentElements(element);
33263      composeElementClose(element);
33264      xml.exit(FHIR_NS, name);
33265    }
33266  }
33267
33268  protected void composeReferralRequestReferralRequestRequesterComponentElements(ReferralRequest.ReferralRequestRequesterComponent element) throws IOException {
33269      composeBackboneElements(element);
33270      if (element.hasAgent()) {
33271        composeReference("agent", element.getAgent());
33272      }
33273      if (element.hasOnBehalfOf()) {
33274        composeReference("onBehalfOf", element.getOnBehalfOf());
33275      }
33276  }
33277
33278  protected void composeRelatedPerson(String name, RelatedPerson element) throws IOException {
33279    if (element != null) {
33280      composeDomainResourceAttributes(element);
33281      xml.enter(FHIR_NS, name);
33282      composeRelatedPersonElements(element);
33283      composeElementClose(element);
33284      xml.exit(FHIR_NS, name);
33285    }
33286  }
33287
33288  protected void composeRelatedPersonElements(RelatedPerson element) throws IOException {
33289      composeDomainResourceElements(element);
33290      if (element.hasIdentifier()) { 
33291        for (Identifier e : element.getIdentifier()) 
33292          composeIdentifier("identifier", e);
33293      }
33294      if (element.hasActiveElement()) {
33295        composeBoolean("active", element.getActiveElement());
33296      }
33297      if (element.hasPatient()) {
33298        composeReference("patient", element.getPatient());
33299      }
33300      if (element.hasRelationship()) {
33301        composeCodeableConcept("relationship", element.getRelationship());
33302      }
33303      if (element.hasName()) { 
33304        for (HumanName e : element.getName()) 
33305          composeHumanName("name", e);
33306      }
33307      if (element.hasTelecom()) { 
33308        for (ContactPoint e : element.getTelecom()) 
33309          composeContactPoint("telecom", e);
33310      }
33311      if (element.hasGenderElement())
33312        composeEnumeration("gender", element.getGenderElement(), new Enumerations.AdministrativeGenderEnumFactory());
33313      if (element.hasBirthDateElement()) {
33314        composeDate("birthDate", element.getBirthDateElement());
33315      }
33316      if (element.hasAddress()) { 
33317        for (Address e : element.getAddress()) 
33318          composeAddress("address", e);
33319      }
33320      if (element.hasPhoto()) { 
33321        for (Attachment e : element.getPhoto()) 
33322          composeAttachment("photo", e);
33323      }
33324      if (element.hasPeriod()) {
33325        composePeriod("period", element.getPeriod());
33326      }
33327  }
33328
33329  protected void composeRequestGroup(String name, RequestGroup element) throws IOException {
33330    if (element != null) {
33331      composeDomainResourceAttributes(element);
33332      xml.enter(FHIR_NS, name);
33333      composeRequestGroupElements(element);
33334      composeElementClose(element);
33335      xml.exit(FHIR_NS, name);
33336    }
33337  }
33338
33339  protected void composeRequestGroupElements(RequestGroup element) throws IOException {
33340      composeDomainResourceElements(element);
33341      if (element.hasIdentifier()) { 
33342        for (Identifier e : element.getIdentifier()) 
33343          composeIdentifier("identifier", e);
33344      }
33345      if (element.hasDefinition()) { 
33346        for (Reference e : element.getDefinition()) 
33347          composeReference("definition", e);
33348      }
33349      if (element.hasBasedOn()) { 
33350        for (Reference e : element.getBasedOn()) 
33351          composeReference("basedOn", e);
33352      }
33353      if (element.hasReplaces()) { 
33354        for (Reference e : element.getReplaces()) 
33355          composeReference("replaces", e);
33356      }
33357      if (element.hasGroupIdentifier()) {
33358        composeIdentifier("groupIdentifier", element.getGroupIdentifier());
33359      }
33360      if (element.hasStatusElement())
33361        composeEnumeration("status", element.getStatusElement(), new RequestGroup.RequestStatusEnumFactory());
33362      if (element.hasIntentElement())
33363        composeEnumeration("intent", element.getIntentElement(), new RequestGroup.RequestIntentEnumFactory());
33364      if (element.hasPriorityElement())
33365        composeEnumeration("priority", element.getPriorityElement(), new RequestGroup.RequestPriorityEnumFactory());
33366      if (element.hasSubject()) {
33367        composeReference("subject", element.getSubject());
33368      }
33369      if (element.hasContext()) {
33370        composeReference("context", element.getContext());
33371      }
33372      if (element.hasAuthoredOnElement()) {
33373        composeDateTime("authoredOn", element.getAuthoredOnElement());
33374      }
33375      if (element.hasAuthor()) {
33376        composeReference("author", element.getAuthor());
33377      }
33378      if (element.hasReason()) {
33379        composeType("reason", element.getReason());
33380      }      if (element.hasNote()) { 
33381        for (Annotation e : element.getNote()) 
33382          composeAnnotation("note", e);
33383      }
33384      if (element.hasAction()) { 
33385        for (RequestGroup.RequestGroupActionComponent e : element.getAction()) 
33386          composeRequestGroupRequestGroupActionComponent("action", e);
33387      }
33388  }
33389
33390  protected void composeRequestGroupRequestGroupActionComponent(String name, RequestGroup.RequestGroupActionComponent element) throws IOException {
33391    if (element != null) {
33392      composeElementAttributes(element);
33393      xml.enter(FHIR_NS, name);
33394      composeRequestGroupRequestGroupActionComponentElements(element);
33395      composeElementClose(element);
33396      xml.exit(FHIR_NS, name);
33397    }
33398  }
33399
33400  protected void composeRequestGroupRequestGroupActionComponentElements(RequestGroup.RequestGroupActionComponent element) throws IOException {
33401      composeBackboneElements(element);
33402      if (element.hasLabelElement()) {
33403        composeString("label", element.getLabelElement());
33404      }
33405      if (element.hasTitleElement()) {
33406        composeString("title", element.getTitleElement());
33407      }
33408      if (element.hasDescriptionElement()) {
33409        composeString("description", element.getDescriptionElement());
33410      }
33411      if (element.hasTextEquivalentElement()) {
33412        composeString("textEquivalent", element.getTextEquivalentElement());
33413      }
33414      if (element.hasCode()) { 
33415        for (CodeableConcept e : element.getCode()) 
33416          composeCodeableConcept("code", e);
33417      }
33418      if (element.hasDocumentation()) { 
33419        for (RelatedArtifact e : element.getDocumentation()) 
33420          composeRelatedArtifact("documentation", e);
33421      }
33422      if (element.hasCondition()) { 
33423        for (RequestGroup.RequestGroupActionConditionComponent e : element.getCondition()) 
33424          composeRequestGroupRequestGroupActionConditionComponent("condition", e);
33425      }
33426      if (element.hasRelatedAction()) { 
33427        for (RequestGroup.RequestGroupActionRelatedActionComponent e : element.getRelatedAction()) 
33428          composeRequestGroupRequestGroupActionRelatedActionComponent("relatedAction", e);
33429      }
33430      if (element.hasTiming()) {
33431        composeType("timing", element.getTiming());
33432      }      if (element.hasParticipant()) { 
33433        for (Reference e : element.getParticipant()) 
33434          composeReference("participant", e);
33435      }
33436      if (element.hasType()) {
33437        composeCoding("type", element.getType());
33438      }
33439      if (element.hasGroupingBehaviorElement())
33440        composeEnumeration("groupingBehavior", element.getGroupingBehaviorElement(), new RequestGroup.ActionGroupingBehaviorEnumFactory());
33441      if (element.hasSelectionBehaviorElement())
33442        composeEnumeration("selectionBehavior", element.getSelectionBehaviorElement(), new RequestGroup.ActionSelectionBehaviorEnumFactory());
33443      if (element.hasRequiredBehaviorElement())
33444        composeEnumeration("requiredBehavior", element.getRequiredBehaviorElement(), new RequestGroup.ActionRequiredBehaviorEnumFactory());
33445      if (element.hasPrecheckBehaviorElement())
33446        composeEnumeration("precheckBehavior", element.getPrecheckBehaviorElement(), new RequestGroup.ActionPrecheckBehaviorEnumFactory());
33447      if (element.hasCardinalityBehaviorElement())
33448        composeEnumeration("cardinalityBehavior", element.getCardinalityBehaviorElement(), new RequestGroup.ActionCardinalityBehaviorEnumFactory());
33449      if (element.hasResource()) {
33450        composeReference("resource", element.getResource());
33451      }
33452      if (element.hasAction()) { 
33453        for (RequestGroup.RequestGroupActionComponent e : element.getAction()) 
33454          composeRequestGroupRequestGroupActionComponent("action", e);
33455      }
33456  }
33457
33458  protected void composeRequestGroupRequestGroupActionConditionComponent(String name, RequestGroup.RequestGroupActionConditionComponent element) throws IOException {
33459    if (element != null) {
33460      composeElementAttributes(element);
33461      xml.enter(FHIR_NS, name);
33462      composeRequestGroupRequestGroupActionConditionComponentElements(element);
33463      composeElementClose(element);
33464      xml.exit(FHIR_NS, name);
33465    }
33466  }
33467
33468  protected void composeRequestGroupRequestGroupActionConditionComponentElements(RequestGroup.RequestGroupActionConditionComponent element) throws IOException {
33469      composeBackboneElements(element);
33470      if (element.hasKindElement())
33471        composeEnumeration("kind", element.getKindElement(), new RequestGroup.ActionConditionKindEnumFactory());
33472      if (element.hasDescriptionElement()) {
33473        composeString("description", element.getDescriptionElement());
33474      }
33475      if (element.hasLanguageElement()) {
33476        composeString("language", element.getLanguageElement());
33477      }
33478      if (element.hasExpressionElement()) {
33479        composeString("expression", element.getExpressionElement());
33480      }
33481  }
33482
33483  protected void composeRequestGroupRequestGroupActionRelatedActionComponent(String name, RequestGroup.RequestGroupActionRelatedActionComponent element) throws IOException {
33484    if (element != null) {
33485      composeElementAttributes(element);
33486      xml.enter(FHIR_NS, name);
33487      composeRequestGroupRequestGroupActionRelatedActionComponentElements(element);
33488      composeElementClose(element);
33489      xml.exit(FHIR_NS, name);
33490    }
33491  }
33492
33493  protected void composeRequestGroupRequestGroupActionRelatedActionComponentElements(RequestGroup.RequestGroupActionRelatedActionComponent element) throws IOException {
33494      composeBackboneElements(element);
33495      if (element.hasActionIdElement()) {
33496        composeId("actionId", element.getActionIdElement());
33497      }
33498      if (element.hasRelationshipElement())
33499        composeEnumeration("relationship", element.getRelationshipElement(), new RequestGroup.ActionRelationshipTypeEnumFactory());
33500      if (element.hasOffset()) {
33501        composeType("offset", element.getOffset());
33502      }  }
33503
33504  protected void composeResearchStudy(String name, ResearchStudy element) throws IOException {
33505    if (element != null) {
33506      composeDomainResourceAttributes(element);
33507      xml.enter(FHIR_NS, name);
33508      composeResearchStudyElements(element);
33509      composeElementClose(element);
33510      xml.exit(FHIR_NS, name);
33511    }
33512  }
33513
33514  protected void composeResearchStudyElements(ResearchStudy element) throws IOException {
33515      composeDomainResourceElements(element);
33516      if (element.hasIdentifier()) { 
33517        for (Identifier e : element.getIdentifier()) 
33518          composeIdentifier("identifier", e);
33519      }
33520      if (element.hasTitleElement()) {
33521        composeString("title", element.getTitleElement());
33522      }
33523      if (element.hasProtocol()) { 
33524        for (Reference e : element.getProtocol()) 
33525          composeReference("protocol", e);
33526      }
33527      if (element.hasPartOf()) { 
33528        for (Reference e : element.getPartOf()) 
33529          composeReference("partOf", e);
33530      }
33531      if (element.hasStatusElement())
33532        composeEnumeration("status", element.getStatusElement(), new ResearchStudy.ResearchStudyStatusEnumFactory());
33533      if (element.hasCategory()) { 
33534        for (CodeableConcept e : element.getCategory()) 
33535          composeCodeableConcept("category", e);
33536      }
33537      if (element.hasFocus()) { 
33538        for (CodeableConcept e : element.getFocus()) 
33539          composeCodeableConcept("focus", e);
33540      }
33541      if (element.hasContact()) { 
33542        for (ContactDetail e : element.getContact()) 
33543          composeContactDetail("contact", e);
33544      }
33545      if (element.hasRelatedArtifact()) { 
33546        for (RelatedArtifact e : element.getRelatedArtifact()) 
33547          composeRelatedArtifact("relatedArtifact", e);
33548      }
33549      if (element.hasKeyword()) { 
33550        for (CodeableConcept e : element.getKeyword()) 
33551          composeCodeableConcept("keyword", e);
33552      }
33553      if (element.hasJurisdiction()) { 
33554        for (CodeableConcept e : element.getJurisdiction()) 
33555          composeCodeableConcept("jurisdiction", e);
33556      }
33557      if (element.hasDescriptionElement()) {
33558        composeMarkdown("description", element.getDescriptionElement());
33559      }
33560      if (element.hasEnrollment()) { 
33561        for (Reference e : element.getEnrollment()) 
33562          composeReference("enrollment", e);
33563      }
33564      if (element.hasPeriod()) {
33565        composePeriod("period", element.getPeriod());
33566      }
33567      if (element.hasSponsor()) {
33568        composeReference("sponsor", element.getSponsor());
33569      }
33570      if (element.hasPrincipalInvestigator()) {
33571        composeReference("principalInvestigator", element.getPrincipalInvestigator());
33572      }
33573      if (element.hasSite()) { 
33574        for (Reference e : element.getSite()) 
33575          composeReference("site", e);
33576      }
33577      if (element.hasReasonStopped()) {
33578        composeCodeableConcept("reasonStopped", element.getReasonStopped());
33579      }
33580      if (element.hasNote()) { 
33581        for (Annotation e : element.getNote()) 
33582          composeAnnotation("note", e);
33583      }
33584      if (element.hasArm()) { 
33585        for (ResearchStudy.ResearchStudyArmComponent e : element.getArm()) 
33586          composeResearchStudyResearchStudyArmComponent("arm", e);
33587      }
33588  }
33589
33590  protected void composeResearchStudyResearchStudyArmComponent(String name, ResearchStudy.ResearchStudyArmComponent element) throws IOException {
33591    if (element != null) {
33592      composeElementAttributes(element);
33593      xml.enter(FHIR_NS, name);
33594      composeResearchStudyResearchStudyArmComponentElements(element);
33595      composeElementClose(element);
33596      xml.exit(FHIR_NS, name);
33597    }
33598  }
33599
33600  protected void composeResearchStudyResearchStudyArmComponentElements(ResearchStudy.ResearchStudyArmComponent element) throws IOException {
33601      composeBackboneElements(element);
33602      if (element.hasNameElement()) {
33603        composeString("name", element.getNameElement());
33604      }
33605      if (element.hasCode()) {
33606        composeCodeableConcept("code", element.getCode());
33607      }
33608      if (element.hasDescriptionElement()) {
33609        composeString("description", element.getDescriptionElement());
33610      }
33611  }
33612
33613  protected void composeResearchSubject(String name, ResearchSubject element) throws IOException {
33614    if (element != null) {
33615      composeDomainResourceAttributes(element);
33616      xml.enter(FHIR_NS, name);
33617      composeResearchSubjectElements(element);
33618      composeElementClose(element);
33619      xml.exit(FHIR_NS, name);
33620    }
33621  }
33622
33623  protected void composeResearchSubjectElements(ResearchSubject element) throws IOException {
33624      composeDomainResourceElements(element);
33625      if (element.hasIdentifier()) {
33626        composeIdentifier("identifier", element.getIdentifier());
33627      }
33628      if (element.hasStatusElement())
33629        composeEnumeration("status", element.getStatusElement(), new ResearchSubject.ResearchSubjectStatusEnumFactory());
33630      if (element.hasPeriod()) {
33631        composePeriod("period", element.getPeriod());
33632      }
33633      if (element.hasStudy()) {
33634        composeReference("study", element.getStudy());
33635      }
33636      if (element.hasIndividual()) {
33637        composeReference("individual", element.getIndividual());
33638      }
33639      if (element.hasAssignedArmElement()) {
33640        composeString("assignedArm", element.getAssignedArmElement());
33641      }
33642      if (element.hasActualArmElement()) {
33643        composeString("actualArm", element.getActualArmElement());
33644      }
33645      if (element.hasConsent()) {
33646        composeReference("consent", element.getConsent());
33647      }
33648  }
33649
33650  protected void composeRiskAssessment(String name, RiskAssessment element) throws IOException {
33651    if (element != null) {
33652      composeDomainResourceAttributes(element);
33653      xml.enter(FHIR_NS, name);
33654      composeRiskAssessmentElements(element);
33655      composeElementClose(element);
33656      xml.exit(FHIR_NS, name);
33657    }
33658  }
33659
33660  protected void composeRiskAssessmentElements(RiskAssessment element) throws IOException {
33661      composeDomainResourceElements(element);
33662      if (element.hasIdentifier()) {
33663        composeIdentifier("identifier", element.getIdentifier());
33664      }
33665      if (element.hasBasedOn()) {
33666        composeReference("basedOn", element.getBasedOn());
33667      }
33668      if (element.hasParent()) {
33669        composeReference("parent", element.getParent());
33670      }
33671      if (element.hasStatusElement())
33672        composeEnumeration("status", element.getStatusElement(), new RiskAssessment.RiskAssessmentStatusEnumFactory());
33673      if (element.hasMethod()) {
33674        composeCodeableConcept("method", element.getMethod());
33675      }
33676      if (element.hasCode()) {
33677        composeCodeableConcept("code", element.getCode());
33678      }
33679      if (element.hasSubject()) {
33680        composeReference("subject", element.getSubject());
33681      }
33682      if (element.hasContext()) {
33683        composeReference("context", element.getContext());
33684      }
33685      if (element.hasOccurrence()) {
33686        composeType("occurrence", element.getOccurrence());
33687      }      if (element.hasCondition()) {
33688        composeReference("condition", element.getCondition());
33689      }
33690      if (element.hasPerformer()) {
33691        composeReference("performer", element.getPerformer());
33692      }
33693      if (element.hasReason()) {
33694        composeType("reason", element.getReason());
33695      }      if (element.hasBasis()) { 
33696        for (Reference e : element.getBasis()) 
33697          composeReference("basis", e);
33698      }
33699      if (element.hasPrediction()) { 
33700        for (RiskAssessment.RiskAssessmentPredictionComponent e : element.getPrediction()) 
33701          composeRiskAssessmentRiskAssessmentPredictionComponent("prediction", e);
33702      }
33703      if (element.hasMitigationElement()) {
33704        composeString("mitigation", element.getMitigationElement());
33705      }
33706      if (element.hasCommentElement()) {
33707        composeString("comment", element.getCommentElement());
33708      }
33709  }
33710
33711  protected void composeRiskAssessmentRiskAssessmentPredictionComponent(String name, RiskAssessment.RiskAssessmentPredictionComponent element) throws IOException {
33712    if (element != null) {
33713      composeElementAttributes(element);
33714      xml.enter(FHIR_NS, name);
33715      composeRiskAssessmentRiskAssessmentPredictionComponentElements(element);
33716      composeElementClose(element);
33717      xml.exit(FHIR_NS, name);
33718    }
33719  }
33720
33721  protected void composeRiskAssessmentRiskAssessmentPredictionComponentElements(RiskAssessment.RiskAssessmentPredictionComponent element) throws IOException {
33722      composeBackboneElements(element);
33723      if (element.hasOutcome()) {
33724        composeCodeableConcept("outcome", element.getOutcome());
33725      }
33726      if (element.hasProbability()) {
33727        composeType("probability", element.getProbability());
33728      }      if (element.hasQualitativeRisk()) {
33729        composeCodeableConcept("qualitativeRisk", element.getQualitativeRisk());
33730      }
33731      if (element.hasRelativeRiskElement()) {
33732        composeDecimal("relativeRisk", element.getRelativeRiskElement());
33733      }
33734      if (element.hasWhen()) {
33735        composeType("when", element.getWhen());
33736      }      if (element.hasRationaleElement()) {
33737        composeString("rationale", element.getRationaleElement());
33738      }
33739  }
33740
33741  protected void composeSchedule(String name, Schedule element) throws IOException {
33742    if (element != null) {
33743      composeDomainResourceAttributes(element);
33744      xml.enter(FHIR_NS, name);
33745      composeScheduleElements(element);
33746      composeElementClose(element);
33747      xml.exit(FHIR_NS, name);
33748    }
33749  }
33750
33751  protected void composeScheduleElements(Schedule element) throws IOException {
33752      composeDomainResourceElements(element);
33753      if (element.hasIdentifier()) { 
33754        for (Identifier e : element.getIdentifier()) 
33755          composeIdentifier("identifier", e);
33756      }
33757      if (element.hasActiveElement()) {
33758        composeBoolean("active", element.getActiveElement());
33759      }
33760      if (element.hasServiceCategory()) {
33761        composeCodeableConcept("serviceCategory", element.getServiceCategory());
33762      }
33763      if (element.hasServiceType()) { 
33764        for (CodeableConcept e : element.getServiceType()) 
33765          composeCodeableConcept("serviceType", e);
33766      }
33767      if (element.hasSpecialty()) { 
33768        for (CodeableConcept e : element.getSpecialty()) 
33769          composeCodeableConcept("specialty", e);
33770      }
33771      if (element.hasActor()) { 
33772        for (Reference e : element.getActor()) 
33773          composeReference("actor", e);
33774      }
33775      if (element.hasPlanningHorizon()) {
33776        composePeriod("planningHorizon", element.getPlanningHorizon());
33777      }
33778      if (element.hasCommentElement()) {
33779        composeString("comment", element.getCommentElement());
33780      }
33781  }
33782
33783  protected void composeSearchParameter(String name, SearchParameter element) throws IOException {
33784    if (element != null) {
33785      composeDomainResourceAttributes(element);
33786      xml.enter(FHIR_NS, name);
33787      composeSearchParameterElements(element);
33788      composeElementClose(element);
33789      xml.exit(FHIR_NS, name);
33790    }
33791  }
33792
33793  protected void composeSearchParameterElements(SearchParameter element) throws IOException {
33794      composeDomainResourceElements(element);
33795      if (element.hasUrlElement()) {
33796        composeUri("url", element.getUrlElement());
33797      }
33798      if (element.hasVersionElement()) {
33799        composeString("version", element.getVersionElement());
33800      }
33801      if (element.hasNameElement()) {
33802        composeString("name", element.getNameElement());
33803      }
33804      if (element.hasStatusElement())
33805        composeEnumeration("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory());
33806      if (element.hasExperimentalElement()) {
33807        composeBoolean("experimental", element.getExperimentalElement());
33808      }
33809      if (element.hasDateElement()) {
33810        composeDateTime("date", element.getDateElement());
33811      }
33812      if (element.hasPublisherElement()) {
33813        composeString("publisher", element.getPublisherElement());
33814      }
33815      if (element.hasContact()) { 
33816        for (ContactDetail e : element.getContact()) 
33817          composeContactDetail("contact", e);
33818      }
33819      if (element.hasUseContext()) { 
33820        for (UsageContext e : element.getUseContext()) 
33821          composeUsageContext("useContext", e);
33822      }
33823      if (element.hasJurisdiction()) { 
33824        for (CodeableConcept e : element.getJurisdiction()) 
33825          composeCodeableConcept("jurisdiction", e);
33826      }
33827      if (element.hasPurposeElement()) {
33828        composeMarkdown("purpose", element.getPurposeElement());
33829      }
33830      if (element.hasCodeElement()) {
33831        composeCode("code", element.getCodeElement());
33832      }
33833      if (element.hasBase()) { 
33834        for (CodeType e : element.getBase()) 
33835          composeCode("base", e);
33836      }
33837      if (element.hasTypeElement())
33838        composeEnumeration("type", element.getTypeElement(), new Enumerations.SearchParamTypeEnumFactory());
33839      if (element.hasDerivedFromElement()) {
33840        composeUri("derivedFrom", element.getDerivedFromElement());
33841      }
33842      if (element.hasDescriptionElement()) {
33843        composeMarkdown("description", element.getDescriptionElement());
33844      }
33845      if (element.hasExpressionElement()) {
33846        composeString("expression", element.getExpressionElement());
33847      }
33848      if (element.hasXpathElement()) {
33849        composeString("xpath", element.getXpathElement());
33850      }
33851      if (element.hasXpathUsageElement())
33852        composeEnumeration("xpathUsage", element.getXpathUsageElement(), new SearchParameter.XPathUsageTypeEnumFactory());
33853      if (element.hasTarget()) { 
33854        for (CodeType e : element.getTarget()) 
33855          composeCode("target", e);
33856      }
33857        if (element.hasComparator()) 
33858          for (Enumeration<SearchParameter.SearchComparator> e : element.getComparator()) 
33859            composeEnumeration("comparator", e, new SearchParameter.SearchComparatorEnumFactory());
33860        if (element.hasModifier()) 
33861          for (Enumeration<SearchParameter.SearchModifierCode> e : element.getModifier()) 
33862            composeEnumeration("modifier", e, new SearchParameter.SearchModifierCodeEnumFactory());
33863      if (element.hasChain()) { 
33864        for (StringType e : element.getChain()) 
33865          composeString("chain", e);
33866      }
33867      if (element.hasComponent()) { 
33868        for (SearchParameter.SearchParameterComponentComponent e : element.getComponent()) 
33869          composeSearchParameterSearchParameterComponentComponent("component", e);
33870      }
33871  }
33872
33873  protected void composeSearchParameterSearchParameterComponentComponent(String name, SearchParameter.SearchParameterComponentComponent element) throws IOException {
33874    if (element != null) {
33875      composeElementAttributes(element);
33876      xml.enter(FHIR_NS, name);
33877      composeSearchParameterSearchParameterComponentComponentElements(element);
33878      composeElementClose(element);
33879      xml.exit(FHIR_NS, name);
33880    }
33881  }
33882
33883  protected void composeSearchParameterSearchParameterComponentComponentElements(SearchParameter.SearchParameterComponentComponent element) throws IOException {
33884      composeBackboneElements(element);
33885      if (element.hasDefinition()) {
33886        composeReference("definition", element.getDefinition());
33887      }
33888      if (element.hasExpressionElement()) {
33889        composeString("expression", element.getExpressionElement());
33890      }
33891  }
33892
33893  protected void composeSequence(String name, Sequence element) throws IOException {
33894    if (element != null) {
33895      composeDomainResourceAttributes(element);
33896      xml.enter(FHIR_NS, name);
33897      composeSequenceElements(element);
33898      composeElementClose(element);
33899      xml.exit(FHIR_NS, name);
33900    }
33901  }
33902
33903  protected void composeSequenceElements(Sequence element) throws IOException {
33904      composeDomainResourceElements(element);
33905      if (element.hasIdentifier()) { 
33906        for (Identifier e : element.getIdentifier()) 
33907          composeIdentifier("identifier", e);
33908      }
33909      if (element.hasTypeElement())
33910        composeEnumeration("type", element.getTypeElement(), new Sequence.SequenceTypeEnumFactory());
33911      if (element.hasCoordinateSystemElement()) {
33912        composeInteger("coordinateSystem", element.getCoordinateSystemElement());
33913      }
33914      if (element.hasPatient()) {
33915        composeReference("patient", element.getPatient());
33916      }
33917      if (element.hasSpecimen()) {
33918        composeReference("specimen", element.getSpecimen());
33919      }
33920      if (element.hasDevice()) {
33921        composeReference("device", element.getDevice());
33922      }
33923      if (element.hasPerformer()) {
33924        composeReference("performer", element.getPerformer());
33925      }
33926      if (element.hasQuantity()) {
33927        composeQuantity("quantity", element.getQuantity());
33928      }
33929      if (element.hasReferenceSeq()) {
33930        composeSequenceSequenceReferenceSeqComponent("referenceSeq", element.getReferenceSeq());
33931      }
33932      if (element.hasVariant()) { 
33933        for (Sequence.SequenceVariantComponent e : element.getVariant()) 
33934          composeSequenceSequenceVariantComponent("variant", e);
33935      }
33936      if (element.hasObservedSeqElement()) {
33937        composeString("observedSeq", element.getObservedSeqElement());
33938      }
33939      if (element.hasQuality()) { 
33940        for (Sequence.SequenceQualityComponent e : element.getQuality()) 
33941          composeSequenceSequenceQualityComponent("quality", e);
33942      }
33943      if (element.hasReadCoverageElement()) {
33944        composeInteger("readCoverage", element.getReadCoverageElement());
33945      }
33946      if (element.hasRepository()) { 
33947        for (Sequence.SequenceRepositoryComponent e : element.getRepository()) 
33948          composeSequenceSequenceRepositoryComponent("repository", e);
33949      }
33950      if (element.hasPointer()) { 
33951        for (Reference e : element.getPointer()) 
33952          composeReference("pointer", e);
33953      }
33954  }
33955
33956  protected void composeSequenceSequenceReferenceSeqComponent(String name, Sequence.SequenceReferenceSeqComponent element) throws IOException {
33957    if (element != null) {
33958      composeElementAttributes(element);
33959      xml.enter(FHIR_NS, name);
33960      composeSequenceSequenceReferenceSeqComponentElements(element);
33961      composeElementClose(element);
33962      xml.exit(FHIR_NS, name);
33963    }
33964  }
33965
33966  protected void composeSequenceSequenceReferenceSeqComponentElements(Sequence.SequenceReferenceSeqComponent element) throws IOException {
33967      composeBackboneElements(element);
33968      if (element.hasChromosome()) {
33969        composeCodeableConcept("chromosome", element.getChromosome());
33970      }
33971      if (element.hasGenomeBuildElement()) {
33972        composeString("genomeBuild", element.getGenomeBuildElement());
33973      }
33974      if (element.hasReferenceSeqId()) {
33975        composeCodeableConcept("referenceSeqId", element.getReferenceSeqId());
33976      }
33977      if (element.hasReferenceSeqPointer()) {
33978        composeReference("referenceSeqPointer", element.getReferenceSeqPointer());
33979      }
33980      if (element.hasReferenceSeqStringElement()) {
33981        composeString("referenceSeqString", element.getReferenceSeqStringElement());
33982      }
33983      if (element.hasStrandElement()) {
33984        composeInteger("strand", element.getStrandElement());
33985      }
33986      if (element.hasWindowStartElement()) {
33987        composeInteger("windowStart", element.getWindowStartElement());
33988      }
33989      if (element.hasWindowEndElement()) {
33990        composeInteger("windowEnd", element.getWindowEndElement());
33991      }
33992  }
33993
33994  protected void composeSequenceSequenceVariantComponent(String name, Sequence.SequenceVariantComponent element) throws IOException {
33995    if (element != null) {
33996      composeElementAttributes(element);
33997      xml.enter(FHIR_NS, name);
33998      composeSequenceSequenceVariantComponentElements(element);
33999      composeElementClose(element);
34000      xml.exit(FHIR_NS, name);
34001    }
34002  }
34003
34004  protected void composeSequenceSequenceVariantComponentElements(Sequence.SequenceVariantComponent element) throws IOException {
34005      composeBackboneElements(element);
34006      if (element.hasStartElement()) {
34007        composeInteger("start", element.getStartElement());
34008      }
34009      if (element.hasEndElement()) {
34010        composeInteger("end", element.getEndElement());
34011      }
34012      if (element.hasObservedAlleleElement()) {
34013        composeString("observedAllele", element.getObservedAlleleElement());
34014      }
34015      if (element.hasReferenceAlleleElement()) {
34016        composeString("referenceAllele", element.getReferenceAlleleElement());
34017      }
34018      if (element.hasCigarElement()) {
34019        composeString("cigar", element.getCigarElement());
34020      }
34021      if (element.hasVariantPointer()) {
34022        composeReference("variantPointer", element.getVariantPointer());
34023      }
34024  }
34025
34026  protected void composeSequenceSequenceQualityComponent(String name, Sequence.SequenceQualityComponent element) throws IOException {
34027    if (element != null) {
34028      composeElementAttributes(element);
34029      xml.enter(FHIR_NS, name);
34030      composeSequenceSequenceQualityComponentElements(element);
34031      composeElementClose(element);
34032      xml.exit(FHIR_NS, name);
34033    }
34034  }
34035
34036  protected void composeSequenceSequenceQualityComponentElements(Sequence.SequenceQualityComponent element) throws IOException {
34037      composeBackboneElements(element);
34038      if (element.hasTypeElement())
34039        composeEnumeration("type", element.getTypeElement(), new Sequence.QualityTypeEnumFactory());
34040      if (element.hasStandardSequence()) {
34041        composeCodeableConcept("standardSequence", element.getStandardSequence());
34042      }
34043      if (element.hasStartElement()) {
34044        composeInteger("start", element.getStartElement());
34045      }
34046      if (element.hasEndElement()) {
34047        composeInteger("end", element.getEndElement());
34048      }
34049      if (element.hasScore()) {
34050        composeQuantity("score", element.getScore());
34051      }
34052      if (element.hasMethod()) {
34053        composeCodeableConcept("method", element.getMethod());
34054      }
34055      if (element.hasTruthTPElement()) {
34056        composeDecimal("truthTP", element.getTruthTPElement());
34057      }
34058      if (element.hasQueryTPElement()) {
34059        composeDecimal("queryTP", element.getQueryTPElement());
34060      }
34061      if (element.hasTruthFNElement()) {
34062        composeDecimal("truthFN", element.getTruthFNElement());
34063      }
34064      if (element.hasQueryFPElement()) {
34065        composeDecimal("queryFP", element.getQueryFPElement());
34066      }
34067      if (element.hasGtFPElement()) {
34068        composeDecimal("gtFP", element.getGtFPElement());
34069      }
34070      if (element.hasPrecisionElement()) {
34071        composeDecimal("precision", element.getPrecisionElement());
34072      }
34073      if (element.hasRecallElement()) {
34074        composeDecimal("recall", element.getRecallElement());
34075      }
34076      if (element.hasFScoreElement()) {
34077        composeDecimal("fScore", element.getFScoreElement());
34078      }
34079  }
34080
34081  protected void composeSequenceSequenceRepositoryComponent(String name, Sequence.SequenceRepositoryComponent element) throws IOException {
34082    if (element != null) {
34083      composeElementAttributes(element);
34084      xml.enter(FHIR_NS, name);
34085      composeSequenceSequenceRepositoryComponentElements(element);
34086      composeElementClose(element);
34087      xml.exit(FHIR_NS, name);
34088    }
34089  }
34090
34091  protected void composeSequenceSequenceRepositoryComponentElements(Sequence.SequenceRepositoryComponent element) throws IOException {
34092      composeBackboneElements(element);
34093      if (element.hasTypeElement())
34094        composeEnumeration("type", element.getTypeElement(), new Sequence.RepositoryTypeEnumFactory());
34095      if (element.hasUrlElement()) {
34096        composeUri("url", element.getUrlElement());
34097      }
34098      if (element.hasNameElement()) {
34099        composeString("name", element.getNameElement());
34100      }
34101      if (element.hasDatasetIdElement()) {
34102        composeString("datasetId", element.getDatasetIdElement());
34103      }
34104      if (element.hasVariantsetIdElement()) {
34105        composeString("variantsetId", element.getVariantsetIdElement());
34106      }
34107      if (element.hasReadsetIdElement()) {
34108        composeString("readsetId", element.getReadsetIdElement());
34109      }
34110  }
34111
34112  protected void composeServiceDefinition(String name, ServiceDefinition element) throws IOException {
34113    if (element != null) {
34114      composeDomainResourceAttributes(element);
34115      xml.enter(FHIR_NS, name);
34116      composeServiceDefinitionElements(element);
34117      composeElementClose(element);
34118      xml.exit(FHIR_NS, name);
34119    }
34120  }
34121
34122  protected void composeServiceDefinitionElements(ServiceDefinition element) throws IOException {
34123      composeDomainResourceElements(element);
34124      if (element.hasUrlElement()) {
34125        composeUri("url", element.getUrlElement());
34126      }
34127      if (element.hasIdentifier()) { 
34128        for (Identifier e : element.getIdentifier()) 
34129          composeIdentifier("identifier", e);
34130      }
34131      if (element.hasVersionElement()) {
34132        composeString("version", element.getVersionElement());
34133      }
34134      if (element.hasNameElement()) {
34135        composeString("name", element.getNameElement());
34136      }
34137      if (element.hasTitleElement()) {
34138        composeString("title", element.getTitleElement());
34139      }
34140      if (element.hasStatusElement())
34141        composeEnumeration("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory());
34142      if (element.hasExperimentalElement()) {
34143        composeBoolean("experimental", element.getExperimentalElement());
34144      }
34145      if (element.hasDateElement()) {
34146        composeDateTime("date", element.getDateElement());
34147      }
34148      if (element.hasPublisherElement()) {
34149        composeString("publisher", element.getPublisherElement());
34150      }
34151      if (element.hasDescriptionElement()) {
34152        composeMarkdown("description", element.getDescriptionElement());
34153      }
34154      if (element.hasPurposeElement()) {
34155        composeMarkdown("purpose", element.getPurposeElement());
34156      }
34157      if (element.hasUsageElement()) {
34158        composeString("usage", element.getUsageElement());
34159      }
34160      if (element.hasApprovalDateElement()) {
34161        composeDate("approvalDate", element.getApprovalDateElement());
34162      }
34163      if (element.hasLastReviewDateElement()) {
34164        composeDate("lastReviewDate", element.getLastReviewDateElement());
34165      }
34166      if (element.hasEffectivePeriod()) {
34167        composePeriod("effectivePeriod", element.getEffectivePeriod());
34168      }
34169      if (element.hasUseContext()) { 
34170        for (UsageContext e : element.getUseContext()) 
34171          composeUsageContext("useContext", e);
34172      }
34173      if (element.hasJurisdiction()) { 
34174        for (CodeableConcept e : element.getJurisdiction()) 
34175          composeCodeableConcept("jurisdiction", e);
34176      }
34177      if (element.hasTopic()) { 
34178        for (CodeableConcept e : element.getTopic()) 
34179          composeCodeableConcept("topic", e);
34180      }
34181      if (element.hasContributor()) { 
34182        for (Contributor e : element.getContributor()) 
34183          composeContributor("contributor", e);
34184      }
34185      if (element.hasContact()) { 
34186        for (ContactDetail e : element.getContact()) 
34187          composeContactDetail("contact", e);
34188      }
34189      if (element.hasCopyrightElement()) {
34190        composeMarkdown("copyright", element.getCopyrightElement());
34191      }
34192      if (element.hasRelatedArtifact()) { 
34193        for (RelatedArtifact e : element.getRelatedArtifact()) 
34194          composeRelatedArtifact("relatedArtifact", e);
34195      }
34196      if (element.hasTrigger()) { 
34197        for (TriggerDefinition e : element.getTrigger()) 
34198          composeTriggerDefinition("trigger", e);
34199      }
34200      if (element.hasDataRequirement()) { 
34201        for (DataRequirement e : element.getDataRequirement()) 
34202          composeDataRequirement("dataRequirement", e);
34203      }
34204      if (element.hasOperationDefinition()) {
34205        composeReference("operationDefinition", element.getOperationDefinition());
34206      }
34207  }
34208
34209  protected void composeSlot(String name, Slot element) throws IOException {
34210    if (element != null) {
34211      composeDomainResourceAttributes(element);
34212      xml.enter(FHIR_NS, name);
34213      composeSlotElements(element);
34214      composeElementClose(element);
34215      xml.exit(FHIR_NS, name);
34216    }
34217  }
34218
34219  protected void composeSlotElements(Slot element) throws IOException {
34220      composeDomainResourceElements(element);
34221      if (element.hasIdentifier()) { 
34222        for (Identifier e : element.getIdentifier()) 
34223          composeIdentifier("identifier", e);
34224      }
34225      if (element.hasServiceCategory()) {
34226        composeCodeableConcept("serviceCategory", element.getServiceCategory());
34227      }
34228      if (element.hasServiceType()) { 
34229        for (CodeableConcept e : element.getServiceType()) 
34230          composeCodeableConcept("serviceType", e);
34231      }
34232      if (element.hasSpecialty()) { 
34233        for (CodeableConcept e : element.getSpecialty()) 
34234          composeCodeableConcept("specialty", e);
34235      }
34236      if (element.hasAppointmentType()) {
34237        composeCodeableConcept("appointmentType", element.getAppointmentType());
34238      }
34239      if (element.hasSchedule()) {
34240        composeReference("schedule", element.getSchedule());
34241      }
34242      if (element.hasStatusElement())
34243        composeEnumeration("status", element.getStatusElement(), new Slot.SlotStatusEnumFactory());
34244      if (element.hasStartElement()) {
34245        composeInstant("start", element.getStartElement());
34246      }
34247      if (element.hasEndElement()) {
34248        composeInstant("end", element.getEndElement());
34249      }
34250      if (element.hasOverbookedElement()) {
34251        composeBoolean("overbooked", element.getOverbookedElement());
34252      }
34253      if (element.hasCommentElement()) {
34254        composeString("comment", element.getCommentElement());
34255      }
34256  }
34257
34258  protected void composeSpecimen(String name, Specimen element) throws IOException {
34259    if (element != null) {
34260      composeDomainResourceAttributes(element);
34261      xml.enter(FHIR_NS, name);
34262      composeSpecimenElements(element);
34263      composeElementClose(element);
34264      xml.exit(FHIR_NS, name);
34265    }
34266  }
34267
34268  protected void composeSpecimenElements(Specimen element) throws IOException {
34269      composeDomainResourceElements(element);
34270      if (element.hasIdentifier()) { 
34271        for (Identifier e : element.getIdentifier()) 
34272          composeIdentifier("identifier", e);
34273      }
34274      if (element.hasAccessionIdentifier()) {
34275        composeIdentifier("accessionIdentifier", element.getAccessionIdentifier());
34276      }
34277      if (element.hasStatusElement())
34278        composeEnumeration("status", element.getStatusElement(), new Specimen.SpecimenStatusEnumFactory());
34279      if (element.hasType()) {
34280        composeCodeableConcept("type", element.getType());
34281      }
34282      if (element.hasSubject()) {
34283        composeReference("subject", element.getSubject());
34284      }
34285      if (element.hasReceivedTimeElement()) {
34286        composeDateTime("receivedTime", element.getReceivedTimeElement());
34287      }
34288      if (element.hasParent()) { 
34289        for (Reference e : element.getParent()) 
34290          composeReference("parent", e);
34291      }
34292      if (element.hasRequest()) { 
34293        for (Reference e : element.getRequest()) 
34294          composeReference("request", e);
34295      }
34296      if (element.hasCollection()) {
34297        composeSpecimenSpecimenCollectionComponent("collection", element.getCollection());
34298      }
34299      if (element.hasProcessing()) { 
34300        for (Specimen.SpecimenProcessingComponent e : element.getProcessing()) 
34301          composeSpecimenSpecimenProcessingComponent("processing", e);
34302      }
34303      if (element.hasContainer()) { 
34304        for (Specimen.SpecimenContainerComponent e : element.getContainer()) 
34305          composeSpecimenSpecimenContainerComponent("container", e);
34306      }
34307      if (element.hasNote()) { 
34308        for (Annotation e : element.getNote()) 
34309          composeAnnotation("note", e);
34310      }
34311  }
34312
34313  protected void composeSpecimenSpecimenCollectionComponent(String name, Specimen.SpecimenCollectionComponent element) throws IOException {
34314    if (element != null) {
34315      composeElementAttributes(element);
34316      xml.enter(FHIR_NS, name);
34317      composeSpecimenSpecimenCollectionComponentElements(element);
34318      composeElementClose(element);
34319      xml.exit(FHIR_NS, name);
34320    }
34321  }
34322
34323  protected void composeSpecimenSpecimenCollectionComponentElements(Specimen.SpecimenCollectionComponent element) throws IOException {
34324      composeBackboneElements(element);
34325      if (element.hasCollector()) {
34326        composeReference("collector", element.getCollector());
34327      }
34328      if (element.hasCollected()) {
34329        composeType("collected", element.getCollected());
34330      }      if (element.hasQuantity()) {
34331        composeSimpleQuantity("quantity", element.getQuantity());
34332      }
34333      if (element.hasMethod()) {
34334        composeCodeableConcept("method", element.getMethod());
34335      }
34336      if (element.hasBodySite()) {
34337        composeCodeableConcept("bodySite", element.getBodySite());
34338      }
34339  }
34340
34341  protected void composeSpecimenSpecimenProcessingComponent(String name, Specimen.SpecimenProcessingComponent element) throws IOException {
34342    if (element != null) {
34343      composeElementAttributes(element);
34344      xml.enter(FHIR_NS, name);
34345      composeSpecimenSpecimenProcessingComponentElements(element);
34346      composeElementClose(element);
34347      xml.exit(FHIR_NS, name);
34348    }
34349  }
34350
34351  protected void composeSpecimenSpecimenProcessingComponentElements(Specimen.SpecimenProcessingComponent element) throws IOException {
34352      composeBackboneElements(element);
34353      if (element.hasDescriptionElement()) {
34354        composeString("description", element.getDescriptionElement());
34355      }
34356      if (element.hasProcedure()) {
34357        composeCodeableConcept("procedure", element.getProcedure());
34358      }
34359      if (element.hasAdditive()) { 
34360        for (Reference e : element.getAdditive()) 
34361          composeReference("additive", e);
34362      }
34363      if (element.hasTime()) {
34364        composeType("time", element.getTime());
34365      }  }
34366
34367  protected void composeSpecimenSpecimenContainerComponent(String name, Specimen.SpecimenContainerComponent element) throws IOException {
34368    if (element != null) {
34369      composeElementAttributes(element);
34370      xml.enter(FHIR_NS, name);
34371      composeSpecimenSpecimenContainerComponentElements(element);
34372      composeElementClose(element);
34373      xml.exit(FHIR_NS, name);
34374    }
34375  }
34376
34377  protected void composeSpecimenSpecimenContainerComponentElements(Specimen.SpecimenContainerComponent element) throws IOException {
34378      composeBackboneElements(element);
34379      if (element.hasIdentifier()) { 
34380        for (Identifier e : element.getIdentifier()) 
34381          composeIdentifier("identifier", e);
34382      }
34383      if (element.hasDescriptionElement()) {
34384        composeString("description", element.getDescriptionElement());
34385      }
34386      if (element.hasType()) {
34387        composeCodeableConcept("type", element.getType());
34388      }
34389      if (element.hasCapacity()) {
34390        composeSimpleQuantity("capacity", element.getCapacity());
34391      }
34392      if (element.hasSpecimenQuantity()) {
34393        composeSimpleQuantity("specimenQuantity", element.getSpecimenQuantity());
34394      }
34395      if (element.hasAdditive()) {
34396        composeType("additive", element.getAdditive());
34397      }  }
34398
34399  protected void composeStructureDefinition(String name, StructureDefinition element) throws IOException {
34400    if (element != null) {
34401      composeDomainResourceAttributes(element);
34402      xml.enter(FHIR_NS, name);
34403      composeStructureDefinitionElements(element);
34404      composeElementClose(element);
34405      xml.exit(FHIR_NS, name);
34406    }
34407  }
34408
34409  protected void composeStructureDefinitionElements(StructureDefinition element) throws IOException {
34410      composeDomainResourceElements(element);
34411      if (element.hasUrlElement()) {
34412        composeUri("url", element.getUrlElement());
34413      }
34414      if (element.hasIdentifier()) { 
34415        for (Identifier e : element.getIdentifier()) 
34416          composeIdentifier("identifier", e);
34417      }
34418      if (element.hasVersionElement()) {
34419        composeString("version", element.getVersionElement());
34420      }
34421      if (element.hasNameElement()) {
34422        composeString("name", element.getNameElement());
34423      }
34424      if (element.hasTitleElement()) {
34425        composeString("title", element.getTitleElement());
34426      }
34427      if (element.hasStatusElement())
34428        composeEnumeration("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory());
34429      if (element.hasExperimentalElement()) {
34430        composeBoolean("experimental", element.getExperimentalElement());
34431      }
34432      if (element.hasDateElement()) {
34433        composeDateTime("date", element.getDateElement());
34434      }
34435      if (element.hasPublisherElement()) {
34436        composeString("publisher", element.getPublisherElement());
34437      }
34438      if (element.hasContact()) { 
34439        for (ContactDetail e : element.getContact()) 
34440          composeContactDetail("contact", e);
34441      }
34442      if (element.hasDescriptionElement()) {
34443        composeMarkdown("description", element.getDescriptionElement());
34444      }
34445      if (element.hasUseContext()) { 
34446        for (UsageContext e : element.getUseContext()) 
34447          composeUsageContext("useContext", e);
34448      }
34449      if (element.hasJurisdiction()) { 
34450        for (CodeableConcept e : element.getJurisdiction()) 
34451          composeCodeableConcept("jurisdiction", e);
34452      }
34453      if (element.hasPurposeElement()) {
34454        composeMarkdown("purpose", element.getPurposeElement());
34455      }
34456      if (element.hasCopyrightElement()) {
34457        composeMarkdown("copyright", element.getCopyrightElement());
34458      }
34459      if (element.hasKeyword()) { 
34460        for (Coding e : element.getKeyword()) 
34461          composeCoding("keyword", e);
34462      }
34463      if (element.hasFhirVersionElement()) {
34464        composeId("fhirVersion", element.getFhirVersionElement());
34465      }
34466      if (element.hasMapping()) { 
34467        for (StructureDefinition.StructureDefinitionMappingComponent e : element.getMapping()) 
34468          composeStructureDefinitionStructureDefinitionMappingComponent("mapping", e);
34469      }
34470      if (element.hasKindElement())
34471        composeEnumeration("kind", element.getKindElement(), new StructureDefinition.StructureDefinitionKindEnumFactory());
34472      if (element.hasAbstractElement()) {
34473        composeBoolean("abstract", element.getAbstractElement());
34474      }
34475      if (element.hasContextTypeElement())
34476        composeEnumeration("contextType", element.getContextTypeElement(), new StructureDefinition.ExtensionContextEnumFactory());
34477      if (element.hasContext()) { 
34478        for (StringType e : element.getContext()) 
34479          composeString("context", e);
34480      }
34481      if (element.hasContextInvariant()) { 
34482        for (StringType e : element.getContextInvariant()) 
34483          composeString("contextInvariant", e);
34484      }
34485      if (element.hasTypeElement()) {
34486        composeCode("type", element.getTypeElement());
34487      }
34488      if (element.hasBaseDefinitionElement()) {
34489        composeUri("baseDefinition", element.getBaseDefinitionElement());
34490      }
34491      if (element.hasDerivationElement())
34492        composeEnumeration("derivation", element.getDerivationElement(), new StructureDefinition.TypeDerivationRuleEnumFactory());
34493      if (element.hasSnapshot()) {
34494        composeStructureDefinitionStructureDefinitionSnapshotComponent("snapshot", element.getSnapshot());
34495      }
34496      if (element.hasDifferential()) {
34497        composeStructureDefinitionStructureDefinitionDifferentialComponent("differential", element.getDifferential());
34498      }
34499  }
34500
34501  protected void composeStructureDefinitionStructureDefinitionMappingComponent(String name, StructureDefinition.StructureDefinitionMappingComponent element) throws IOException {
34502    if (element != null) {
34503      composeElementAttributes(element);
34504      xml.enter(FHIR_NS, name);
34505      composeStructureDefinitionStructureDefinitionMappingComponentElements(element);
34506      composeElementClose(element);
34507      xml.exit(FHIR_NS, name);
34508    }
34509  }
34510
34511  protected void composeStructureDefinitionStructureDefinitionMappingComponentElements(StructureDefinition.StructureDefinitionMappingComponent element) throws IOException {
34512      composeBackboneElements(element);
34513      if (element.hasIdentityElement()) {
34514        composeId("identity", element.getIdentityElement());
34515      }
34516      if (element.hasUriElement()) {
34517        composeUri("uri", element.getUriElement());
34518      }
34519      if (element.hasNameElement()) {
34520        composeString("name", element.getNameElement());
34521      }
34522      if (element.hasCommentElement()) {
34523        composeString("comment", element.getCommentElement());
34524      }
34525  }
34526
34527  protected void composeStructureDefinitionStructureDefinitionSnapshotComponent(String name, StructureDefinition.StructureDefinitionSnapshotComponent element) throws IOException {
34528    if (element != null) {
34529      composeElementAttributes(element);
34530      xml.enter(FHIR_NS, name);
34531      composeStructureDefinitionStructureDefinitionSnapshotComponentElements(element);
34532      composeElementClose(element);
34533      xml.exit(FHIR_NS, name);
34534    }
34535  }
34536
34537  protected void composeStructureDefinitionStructureDefinitionSnapshotComponentElements(StructureDefinition.StructureDefinitionSnapshotComponent element) throws IOException {
34538      composeBackboneElements(element);
34539      if (element.hasElement()) { 
34540        for (ElementDefinition e : element.getElement()) 
34541          composeElementDefinition("element", e);
34542      }
34543  }
34544
34545  protected void composeStructureDefinitionStructureDefinitionDifferentialComponent(String name, StructureDefinition.StructureDefinitionDifferentialComponent element) throws IOException {
34546    if (element != null) {
34547      composeElementAttributes(element);
34548      xml.enter(FHIR_NS, name);
34549      composeStructureDefinitionStructureDefinitionDifferentialComponentElements(element);
34550      composeElementClose(element);
34551      xml.exit(FHIR_NS, name);
34552    }
34553  }
34554
34555  protected void composeStructureDefinitionStructureDefinitionDifferentialComponentElements(StructureDefinition.StructureDefinitionDifferentialComponent element) throws IOException {
34556      composeBackboneElements(element);
34557      if (element.hasElement()) { 
34558        for (ElementDefinition e : element.getElement()) 
34559          composeElementDefinition("element", e);
34560      }
34561  }
34562
34563  protected void composeStructureMap(String name, StructureMap element) throws IOException {
34564    if (element != null) {
34565      composeDomainResourceAttributes(element);
34566      xml.enter(FHIR_NS, name);
34567      composeStructureMapElements(element);
34568      composeElementClose(element);
34569      xml.exit(FHIR_NS, name);
34570    }
34571  }
34572
34573  protected void composeStructureMapElements(StructureMap element) throws IOException {
34574      composeDomainResourceElements(element);
34575      if (element.hasUrlElement()) {
34576        composeUri("url", element.getUrlElement());
34577      }
34578      if (element.hasIdentifier()) { 
34579        for (Identifier e : element.getIdentifier()) 
34580          composeIdentifier("identifier", e);
34581      }
34582      if (element.hasVersionElement()) {
34583        composeString("version", element.getVersionElement());
34584      }
34585      if (element.hasNameElement()) {
34586        composeString("name", element.getNameElement());
34587      }
34588      if (element.hasTitleElement()) {
34589        composeString("title", element.getTitleElement());
34590      }
34591      if (element.hasStatusElement())
34592        composeEnumeration("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory());
34593      if (element.hasExperimentalElement()) {
34594        composeBoolean("experimental", element.getExperimentalElement());
34595      }
34596      if (element.hasDateElement()) {
34597        composeDateTime("date", element.getDateElement());
34598      }
34599      if (element.hasPublisherElement()) {
34600        composeString("publisher", element.getPublisherElement());
34601      }
34602      if (element.hasContact()) { 
34603        for (ContactDetail e : element.getContact()) 
34604          composeContactDetail("contact", e);
34605      }
34606      if (element.hasDescriptionElement()) {
34607        composeMarkdown("description", element.getDescriptionElement());
34608      }
34609      if (element.hasUseContext()) { 
34610        for (UsageContext e : element.getUseContext()) 
34611          composeUsageContext("useContext", e);
34612      }
34613      if (element.hasJurisdiction()) { 
34614        for (CodeableConcept e : element.getJurisdiction()) 
34615          composeCodeableConcept("jurisdiction", e);
34616      }
34617      if (element.hasPurposeElement()) {
34618        composeMarkdown("purpose", element.getPurposeElement());
34619      }
34620      if (element.hasCopyrightElement()) {
34621        composeMarkdown("copyright", element.getCopyrightElement());
34622      }
34623      if (element.hasStructure()) { 
34624        for (StructureMap.StructureMapStructureComponent e : element.getStructure()) 
34625          composeStructureMapStructureMapStructureComponent("structure", e);
34626      }
34627      if (element.hasImport()) { 
34628        for (UriType e : element.getImport()) 
34629          composeUri("import", e);
34630      }
34631      if (element.hasGroup()) { 
34632        for (StructureMap.StructureMapGroupComponent e : element.getGroup()) 
34633          composeStructureMapStructureMapGroupComponent("group", e);
34634      }
34635  }
34636
34637  protected void composeStructureMapStructureMapStructureComponent(String name, StructureMap.StructureMapStructureComponent element) throws IOException {
34638    if (element != null) {
34639      composeElementAttributes(element);
34640      xml.enter(FHIR_NS, name);
34641      composeStructureMapStructureMapStructureComponentElements(element);
34642      composeElementClose(element);
34643      xml.exit(FHIR_NS, name);
34644    }
34645  }
34646
34647  protected void composeStructureMapStructureMapStructureComponentElements(StructureMap.StructureMapStructureComponent element) throws IOException {
34648      composeBackboneElements(element);
34649      if (element.hasUrlElement()) {
34650        composeUri("url", element.getUrlElement());
34651      }
34652      if (element.hasModeElement())
34653        composeEnumeration("mode", element.getModeElement(), new StructureMap.StructureMapModelModeEnumFactory());
34654      if (element.hasAliasElement()) {
34655        composeString("alias", element.getAliasElement());
34656      }
34657      if (element.hasDocumentationElement()) {
34658        composeString("documentation", element.getDocumentationElement());
34659      }
34660  }
34661
34662  protected void composeStructureMapStructureMapGroupComponent(String name, StructureMap.StructureMapGroupComponent element) throws IOException {
34663    if (element != null) {
34664      composeElementAttributes(element);
34665      xml.enter(FHIR_NS, name);
34666      composeStructureMapStructureMapGroupComponentElements(element);
34667      composeElementClose(element);
34668      xml.exit(FHIR_NS, name);
34669    }
34670  }
34671
34672  protected void composeStructureMapStructureMapGroupComponentElements(StructureMap.StructureMapGroupComponent element) throws IOException {
34673      composeBackboneElements(element);
34674      if (element.hasNameElement()) {
34675        composeId("name", element.getNameElement());
34676      }
34677      if (element.hasExtendsElement()) {
34678        composeId("extends", element.getExtendsElement());
34679      }
34680      if (element.hasTypeModeElement())
34681        composeEnumeration("typeMode", element.getTypeModeElement(), new StructureMap.StructureMapGroupTypeModeEnumFactory());
34682      if (element.hasDocumentationElement()) {
34683        composeString("documentation", element.getDocumentationElement());
34684      }
34685      if (element.hasInput()) { 
34686        for (StructureMap.StructureMapGroupInputComponent e : element.getInput()) 
34687          composeStructureMapStructureMapGroupInputComponent("input", e);
34688      }
34689      if (element.hasRule()) { 
34690        for (StructureMap.StructureMapGroupRuleComponent e : element.getRule()) 
34691          composeStructureMapStructureMapGroupRuleComponent("rule", e);
34692      }
34693  }
34694
34695  protected void composeStructureMapStructureMapGroupInputComponent(String name, StructureMap.StructureMapGroupInputComponent element) throws IOException {
34696    if (element != null) {
34697      composeElementAttributes(element);
34698      xml.enter(FHIR_NS, name);
34699      composeStructureMapStructureMapGroupInputComponentElements(element);
34700      composeElementClose(element);
34701      xml.exit(FHIR_NS, name);
34702    }
34703  }
34704
34705  protected void composeStructureMapStructureMapGroupInputComponentElements(StructureMap.StructureMapGroupInputComponent element) throws IOException {
34706      composeBackboneElements(element);
34707      if (element.hasNameElement()) {
34708        composeId("name", element.getNameElement());
34709      }
34710      if (element.hasTypeElement()) {
34711        composeString("type", element.getTypeElement());
34712      }
34713      if (element.hasModeElement())
34714        composeEnumeration("mode", element.getModeElement(), new StructureMap.StructureMapInputModeEnumFactory());
34715      if (element.hasDocumentationElement()) {
34716        composeString("documentation", element.getDocumentationElement());
34717      }
34718  }
34719
34720  protected void composeStructureMapStructureMapGroupRuleComponent(String name, StructureMap.StructureMapGroupRuleComponent element) throws IOException {
34721    if (element != null) {
34722      composeElementAttributes(element);
34723      xml.enter(FHIR_NS, name);
34724      composeStructureMapStructureMapGroupRuleComponentElements(element);
34725      composeElementClose(element);
34726      xml.exit(FHIR_NS, name);
34727    }
34728  }
34729
34730  protected void composeStructureMapStructureMapGroupRuleComponentElements(StructureMap.StructureMapGroupRuleComponent element) throws IOException {
34731      composeBackboneElements(element);
34732      if (element.hasNameElement()) {
34733        composeId("name", element.getNameElement());
34734      }
34735      if (element.hasSource()) { 
34736        for (StructureMap.StructureMapGroupRuleSourceComponent e : element.getSource()) 
34737          composeStructureMapStructureMapGroupRuleSourceComponent("source", e);
34738      }
34739      if (element.hasTarget()) { 
34740        for (StructureMap.StructureMapGroupRuleTargetComponent e : element.getTarget()) 
34741          composeStructureMapStructureMapGroupRuleTargetComponent("target", e);
34742      }
34743      if (element.hasRule()) { 
34744        for (StructureMap.StructureMapGroupRuleComponent e : element.getRule()) 
34745          composeStructureMapStructureMapGroupRuleComponent("rule", e);
34746      }
34747      if (element.hasDependent()) { 
34748        for (StructureMap.StructureMapGroupRuleDependentComponent e : element.getDependent()) 
34749          composeStructureMapStructureMapGroupRuleDependentComponent("dependent", e);
34750      }
34751      if (element.hasDocumentationElement()) {
34752        composeString("documentation", element.getDocumentationElement());
34753      }
34754  }
34755
34756  protected void composeStructureMapStructureMapGroupRuleSourceComponent(String name, StructureMap.StructureMapGroupRuleSourceComponent element) throws IOException {
34757    if (element != null) {
34758      composeElementAttributes(element);
34759      xml.enter(FHIR_NS, name);
34760      composeStructureMapStructureMapGroupRuleSourceComponentElements(element);
34761      composeElementClose(element);
34762      xml.exit(FHIR_NS, name);
34763    }
34764  }
34765
34766  protected void composeStructureMapStructureMapGroupRuleSourceComponentElements(StructureMap.StructureMapGroupRuleSourceComponent element) throws IOException {
34767      composeBackboneElements(element);
34768      if (element.hasContextElement()) {
34769        composeId("context", element.getContextElement());
34770      }
34771      if (element.hasMinElement()) {
34772        composeInteger("min", element.getMinElement());
34773      }
34774      if (element.hasMaxElement()) {
34775        composeString("max", element.getMaxElement());
34776      }
34777      if (element.hasTypeElement()) {
34778        composeString("type", element.getTypeElement());
34779      }
34780      if (element.hasDefaultValue()) {
34781        composeType("defaultValue", element.getDefaultValue());
34782      }      if (element.hasElementElement()) {
34783        composeString("element", element.getElementElement());
34784      }
34785      if (element.hasListModeElement())
34786        composeEnumeration("listMode", element.getListModeElement(), new StructureMap.StructureMapSourceListModeEnumFactory());
34787      if (element.hasVariableElement()) {
34788        composeId("variable", element.getVariableElement());
34789      }
34790      if (element.hasConditionElement()) {
34791        composeString("condition", element.getConditionElement());
34792      }
34793      if (element.hasCheckElement()) {
34794        composeString("check", element.getCheckElement());
34795      }
34796  }
34797
34798  protected void composeStructureMapStructureMapGroupRuleTargetComponent(String name, StructureMap.StructureMapGroupRuleTargetComponent element) throws IOException {
34799    if (element != null) {
34800      composeElementAttributes(element);
34801      xml.enter(FHIR_NS, name);
34802      composeStructureMapStructureMapGroupRuleTargetComponentElements(element);
34803      composeElementClose(element);
34804      xml.exit(FHIR_NS, name);
34805    }
34806  }
34807
34808  protected void composeStructureMapStructureMapGroupRuleTargetComponentElements(StructureMap.StructureMapGroupRuleTargetComponent element) throws IOException {
34809      composeBackboneElements(element);
34810      if (element.hasContextElement()) {
34811        composeId("context", element.getContextElement());
34812      }
34813      if (element.hasContextTypeElement())
34814        composeEnumeration("contextType", element.getContextTypeElement(), new StructureMap.StructureMapContextTypeEnumFactory());
34815      if (element.hasElementElement()) {
34816        composeString("element", element.getElementElement());
34817      }
34818      if (element.hasVariableElement()) {
34819        composeId("variable", element.getVariableElement());
34820      }
34821        if (element.hasListMode()) 
34822          for (Enumeration<StructureMap.StructureMapTargetListMode> e : element.getListMode()) 
34823            composeEnumeration("listMode", e, new StructureMap.StructureMapTargetListModeEnumFactory());
34824      if (element.hasListRuleIdElement()) {
34825        composeId("listRuleId", element.getListRuleIdElement());
34826      }
34827      if (element.hasTransformElement())
34828        composeEnumeration("transform", element.getTransformElement(), new StructureMap.StructureMapTransformEnumFactory());
34829      if (element.hasParameter()) { 
34830        for (StructureMap.StructureMapGroupRuleTargetParameterComponent e : element.getParameter()) 
34831          composeStructureMapStructureMapGroupRuleTargetParameterComponent("parameter", e);
34832      }
34833  }
34834
34835  protected void composeStructureMapStructureMapGroupRuleTargetParameterComponent(String name, StructureMap.StructureMapGroupRuleTargetParameterComponent element) throws IOException {
34836    if (element != null) {
34837      composeElementAttributes(element);
34838      xml.enter(FHIR_NS, name);
34839      composeStructureMapStructureMapGroupRuleTargetParameterComponentElements(element);
34840      composeElementClose(element);
34841      xml.exit(FHIR_NS, name);
34842    }
34843  }
34844
34845  protected void composeStructureMapStructureMapGroupRuleTargetParameterComponentElements(StructureMap.StructureMapGroupRuleTargetParameterComponent element) throws IOException {
34846      composeBackboneElements(element);
34847      if (element.hasValue()) {
34848        composeType("value", element.getValue());
34849      }  }
34850
34851  protected void composeStructureMapStructureMapGroupRuleDependentComponent(String name, StructureMap.StructureMapGroupRuleDependentComponent element) throws IOException {
34852    if (element != null) {
34853      composeElementAttributes(element);
34854      xml.enter(FHIR_NS, name);
34855      composeStructureMapStructureMapGroupRuleDependentComponentElements(element);
34856      composeElementClose(element);
34857      xml.exit(FHIR_NS, name);
34858    }
34859  }
34860
34861  protected void composeStructureMapStructureMapGroupRuleDependentComponentElements(StructureMap.StructureMapGroupRuleDependentComponent element) throws IOException {
34862      composeBackboneElements(element);
34863      if (element.hasNameElement()) {
34864        composeId("name", element.getNameElement());
34865      }
34866      if (element.hasVariable()) { 
34867        for (StringType e : element.getVariable()) 
34868          composeString("variable", e);
34869      }
34870  }
34871
34872  protected void composeSubscription(String name, Subscription element) throws IOException {
34873    if (element != null) {
34874      composeDomainResourceAttributes(element);
34875      xml.enter(FHIR_NS, name);
34876      composeSubscriptionElements(element);
34877      composeElementClose(element);
34878      xml.exit(FHIR_NS, name);
34879    }
34880  }
34881
34882  protected void composeSubscriptionElements(Subscription element) throws IOException {
34883      composeDomainResourceElements(element);
34884      if (element.hasStatusElement())
34885        composeEnumeration("status", element.getStatusElement(), new Subscription.SubscriptionStatusEnumFactory());
34886      if (element.hasContact()) { 
34887        for (ContactPoint e : element.getContact()) 
34888          composeContactPoint("contact", e);
34889      }
34890      if (element.hasEndElement()) {
34891        composeInstant("end", element.getEndElement());
34892      }
34893      if (element.hasReasonElement()) {
34894        composeString("reason", element.getReasonElement());
34895      }
34896      if (element.hasCriteriaElement()) {
34897        composeString("criteria", element.getCriteriaElement());
34898      }
34899      if (element.hasErrorElement()) {
34900        composeString("error", element.getErrorElement());
34901      }
34902      if (element.hasChannel()) {
34903        composeSubscriptionSubscriptionChannelComponent("channel", element.getChannel());
34904      }
34905      if (element.hasTag()) { 
34906        for (Coding e : element.getTag()) 
34907          composeCoding("tag", e);
34908      }
34909  }
34910
34911  protected void composeSubscriptionSubscriptionChannelComponent(String name, Subscription.SubscriptionChannelComponent element) throws IOException {
34912    if (element != null) {
34913      composeElementAttributes(element);
34914      xml.enter(FHIR_NS, name);
34915      composeSubscriptionSubscriptionChannelComponentElements(element);
34916      composeElementClose(element);
34917      xml.exit(FHIR_NS, name);
34918    }
34919  }
34920
34921  protected void composeSubscriptionSubscriptionChannelComponentElements(Subscription.SubscriptionChannelComponent element) throws IOException {
34922      composeBackboneElements(element);
34923      if (element.hasTypeElement())
34924        composeEnumeration("type", element.getTypeElement(), new Subscription.SubscriptionChannelTypeEnumFactory());
34925      if (element.hasEndpointElement()) {
34926        composeUri("endpoint", element.getEndpointElement());
34927      }
34928      if (element.hasPayloadElement()) {
34929        composeString("payload", element.getPayloadElement());
34930      }
34931      if (element.hasHeader()) { 
34932        for (StringType e : element.getHeader()) 
34933          composeString("header", e);
34934      }
34935  }
34936
34937  protected void composeSubstance(String name, Substance element) throws IOException {
34938    if (element != null) {
34939      composeDomainResourceAttributes(element);
34940      xml.enter(FHIR_NS, name);
34941      composeSubstanceElements(element);
34942      composeElementClose(element);
34943      xml.exit(FHIR_NS, name);
34944    }
34945  }
34946
34947  protected void composeSubstanceElements(Substance element) throws IOException {
34948      composeDomainResourceElements(element);
34949      if (element.hasIdentifier()) { 
34950        for (Identifier e : element.getIdentifier()) 
34951          composeIdentifier("identifier", e);
34952      }
34953      if (element.hasStatusElement())
34954        composeEnumeration("status", element.getStatusElement(), new Substance.FHIRSubstanceStatusEnumFactory());
34955      if (element.hasCategory()) { 
34956        for (CodeableConcept e : element.getCategory()) 
34957          composeCodeableConcept("category", e);
34958      }
34959      if (element.hasCode()) {
34960        composeCodeableConcept("code", element.getCode());
34961      }
34962      if (element.hasDescriptionElement()) {
34963        composeString("description", element.getDescriptionElement());
34964      }
34965      if (element.hasInstance()) { 
34966        for (Substance.SubstanceInstanceComponent e : element.getInstance()) 
34967          composeSubstanceSubstanceInstanceComponent("instance", e);
34968      }
34969      if (element.hasIngredient()) { 
34970        for (Substance.SubstanceIngredientComponent e : element.getIngredient()) 
34971          composeSubstanceSubstanceIngredientComponent("ingredient", e);
34972      }
34973  }
34974
34975  protected void composeSubstanceSubstanceInstanceComponent(String name, Substance.SubstanceInstanceComponent element) throws IOException {
34976    if (element != null) {
34977      composeElementAttributes(element);
34978      xml.enter(FHIR_NS, name);
34979      composeSubstanceSubstanceInstanceComponentElements(element);
34980      composeElementClose(element);
34981      xml.exit(FHIR_NS, name);
34982    }
34983  }
34984
34985  protected void composeSubstanceSubstanceInstanceComponentElements(Substance.SubstanceInstanceComponent element) throws IOException {
34986      composeBackboneElements(element);
34987      if (element.hasIdentifier()) {
34988        composeIdentifier("identifier", element.getIdentifier());
34989      }
34990      if (element.hasExpiryElement()) {
34991        composeDateTime("expiry", element.getExpiryElement());
34992      }
34993      if (element.hasQuantity()) {
34994        composeSimpleQuantity("quantity", element.getQuantity());
34995      }
34996  }
34997
34998  protected void composeSubstanceSubstanceIngredientComponent(String name, Substance.SubstanceIngredientComponent element) throws IOException {
34999    if (element != null) {
35000      composeElementAttributes(element);
35001      xml.enter(FHIR_NS, name);
35002      composeSubstanceSubstanceIngredientComponentElements(element);
35003      composeElementClose(element);
35004      xml.exit(FHIR_NS, name);
35005    }
35006  }
35007
35008  protected void composeSubstanceSubstanceIngredientComponentElements(Substance.SubstanceIngredientComponent element) throws IOException {
35009      composeBackboneElements(element);
35010      if (element.hasQuantity()) {
35011        composeRatio("quantity", element.getQuantity());
35012      }
35013      if (element.hasSubstance()) {
35014        composeType("substance", element.getSubstance());
35015      }  }
35016
35017  protected void composeSupplyDelivery(String name, SupplyDelivery element) throws IOException {
35018    if (element != null) {
35019      composeDomainResourceAttributes(element);
35020      xml.enter(FHIR_NS, name);
35021      composeSupplyDeliveryElements(element);
35022      composeElementClose(element);
35023      xml.exit(FHIR_NS, name);
35024    }
35025  }
35026
35027  protected void composeSupplyDeliveryElements(SupplyDelivery element) throws IOException {
35028      composeDomainResourceElements(element);
35029      if (element.hasIdentifier()) {
35030        composeIdentifier("identifier", element.getIdentifier());
35031      }
35032      if (element.hasBasedOn()) { 
35033        for (Reference e : element.getBasedOn()) 
35034          composeReference("basedOn", e);
35035      }
35036      if (element.hasPartOf()) { 
35037        for (Reference e : element.getPartOf()) 
35038          composeReference("partOf", e);
35039      }
35040      if (element.hasStatusElement())
35041        composeEnumeration("status", element.getStatusElement(), new SupplyDelivery.SupplyDeliveryStatusEnumFactory());
35042      if (element.hasPatient()) {
35043        composeReference("patient", element.getPatient());
35044      }
35045      if (element.hasType()) {
35046        composeCodeableConcept("type", element.getType());
35047      }
35048      if (element.hasSuppliedItem()) {
35049        composeSupplyDeliverySupplyDeliverySuppliedItemComponent("suppliedItem", element.getSuppliedItem());
35050      }
35051      if (element.hasOccurrence()) {
35052        composeType("occurrence", element.getOccurrence());
35053      }      if (element.hasSupplier()) {
35054        composeReference("supplier", element.getSupplier());
35055      }
35056      if (element.hasDestination()) {
35057        composeReference("destination", element.getDestination());
35058      }
35059      if (element.hasReceiver()) { 
35060        for (Reference e : element.getReceiver()) 
35061          composeReference("receiver", e);
35062      }
35063  }
35064
35065  protected void composeSupplyDeliverySupplyDeliverySuppliedItemComponent(String name, SupplyDelivery.SupplyDeliverySuppliedItemComponent element) throws IOException {
35066    if (element != null) {
35067      composeElementAttributes(element);
35068      xml.enter(FHIR_NS, name);
35069      composeSupplyDeliverySupplyDeliverySuppliedItemComponentElements(element);
35070      composeElementClose(element);
35071      xml.exit(FHIR_NS, name);
35072    }
35073  }
35074
35075  protected void composeSupplyDeliverySupplyDeliverySuppliedItemComponentElements(SupplyDelivery.SupplyDeliverySuppliedItemComponent element) throws IOException {
35076      composeBackboneElements(element);
35077      if (element.hasQuantity()) {
35078        composeSimpleQuantity("quantity", element.getQuantity());
35079      }
35080      if (element.hasItem()) {
35081        composeType("item", element.getItem());
35082      }  }
35083
35084  protected void composeSupplyRequest(String name, SupplyRequest element) throws IOException {
35085    if (element != null) {
35086      composeDomainResourceAttributes(element);
35087      xml.enter(FHIR_NS, name);
35088      composeSupplyRequestElements(element);
35089      composeElementClose(element);
35090      xml.exit(FHIR_NS, name);
35091    }
35092  }
35093
35094  protected void composeSupplyRequestElements(SupplyRequest element) throws IOException {
35095      composeDomainResourceElements(element);
35096      if (element.hasIdentifier()) {
35097        composeIdentifier("identifier", element.getIdentifier());
35098      }
35099      if (element.hasStatusElement())
35100        composeEnumeration("status", element.getStatusElement(), new SupplyRequest.SupplyRequestStatusEnumFactory());
35101      if (element.hasCategory()) {
35102        composeCodeableConcept("category", element.getCategory());
35103      }
35104      if (element.hasPriorityElement())
35105        composeEnumeration("priority", element.getPriorityElement(), new SupplyRequest.RequestPriorityEnumFactory());
35106      if (element.hasOrderedItem()) {
35107        composeSupplyRequestSupplyRequestOrderedItemComponent("orderedItem", element.getOrderedItem());
35108      }
35109      if (element.hasOccurrence()) {
35110        composeType("occurrence", element.getOccurrence());
35111      }      if (element.hasAuthoredOnElement()) {
35112        composeDateTime("authoredOn", element.getAuthoredOnElement());
35113      }
35114      if (element.hasRequester()) {
35115        composeSupplyRequestSupplyRequestRequesterComponent("requester", element.getRequester());
35116      }
35117      if (element.hasSupplier()) { 
35118        for (Reference e : element.getSupplier()) 
35119          composeReference("supplier", e);
35120      }
35121      if (element.hasReason()) {
35122        composeType("reason", element.getReason());
35123      }      if (element.hasDeliverFrom()) {
35124        composeReference("deliverFrom", element.getDeliverFrom());
35125      }
35126      if (element.hasDeliverTo()) {
35127        composeReference("deliverTo", element.getDeliverTo());
35128      }
35129  }
35130
35131  protected void composeSupplyRequestSupplyRequestOrderedItemComponent(String name, SupplyRequest.SupplyRequestOrderedItemComponent element) throws IOException {
35132    if (element != null) {
35133      composeElementAttributes(element);
35134      xml.enter(FHIR_NS, name);
35135      composeSupplyRequestSupplyRequestOrderedItemComponentElements(element);
35136      composeElementClose(element);
35137      xml.exit(FHIR_NS, name);
35138    }
35139  }
35140
35141  protected void composeSupplyRequestSupplyRequestOrderedItemComponentElements(SupplyRequest.SupplyRequestOrderedItemComponent element) throws IOException {
35142      composeBackboneElements(element);
35143      if (element.hasQuantity()) {
35144        composeQuantity("quantity", element.getQuantity());
35145      }
35146      if (element.hasItem()) {
35147        composeType("item", element.getItem());
35148      }  }
35149
35150  protected void composeSupplyRequestSupplyRequestRequesterComponent(String name, SupplyRequest.SupplyRequestRequesterComponent element) throws IOException {
35151    if (element != null) {
35152      composeElementAttributes(element);
35153      xml.enter(FHIR_NS, name);
35154      composeSupplyRequestSupplyRequestRequesterComponentElements(element);
35155      composeElementClose(element);
35156      xml.exit(FHIR_NS, name);
35157    }
35158  }
35159
35160  protected void composeSupplyRequestSupplyRequestRequesterComponentElements(SupplyRequest.SupplyRequestRequesterComponent element) throws IOException {
35161      composeBackboneElements(element);
35162      if (element.hasAgent()) {
35163        composeReference("agent", element.getAgent());
35164      }
35165      if (element.hasOnBehalfOf()) {
35166        composeReference("onBehalfOf", element.getOnBehalfOf());
35167      }
35168  }
35169
35170  protected void composeTask(String name, Task element) throws IOException {
35171    if (element != null) {
35172      composeDomainResourceAttributes(element);
35173      xml.enter(FHIR_NS, name);
35174      composeTaskElements(element);
35175      composeElementClose(element);
35176      xml.exit(FHIR_NS, name);
35177    }
35178  }
35179
35180  protected void composeTaskElements(Task element) throws IOException {
35181      composeDomainResourceElements(element);
35182      if (element.hasIdentifier()) { 
35183        for (Identifier e : element.getIdentifier()) 
35184          composeIdentifier("identifier", e);
35185      }
35186      if (element.hasDefinition()) {
35187        composeType("definition", element.getDefinition());
35188      }      if (element.hasBasedOn()) { 
35189        for (Reference e : element.getBasedOn()) 
35190          composeReference("basedOn", e);
35191      }
35192      if (element.hasGroupIdentifier()) {
35193        composeIdentifier("groupIdentifier", element.getGroupIdentifier());
35194      }
35195      if (element.hasPartOf()) { 
35196        for (Reference e : element.getPartOf()) 
35197          composeReference("partOf", e);
35198      }
35199      if (element.hasStatusElement())
35200        composeEnumeration("status", element.getStatusElement(), new Task.TaskStatusEnumFactory());
35201      if (element.hasStatusReason()) {
35202        composeCodeableConcept("statusReason", element.getStatusReason());
35203      }
35204      if (element.hasBusinessStatus()) {
35205        composeCodeableConcept("businessStatus", element.getBusinessStatus());
35206      }
35207      if (element.hasIntentElement())
35208        composeEnumeration("intent", element.getIntentElement(), new Task.TaskIntentEnumFactory());
35209      if (element.hasPriorityElement())
35210        composeEnumeration("priority", element.getPriorityElement(), new Task.TaskPriorityEnumFactory());
35211      if (element.hasCode()) {
35212        composeCodeableConcept("code", element.getCode());
35213      }
35214      if (element.hasDescriptionElement()) {
35215        composeString("description", element.getDescriptionElement());
35216      }
35217      if (element.hasFocus()) {
35218        composeReference("focus", element.getFocus());
35219      }
35220      if (element.hasFor()) {
35221        composeReference("for", element.getFor());
35222      }
35223      if (element.hasContext()) {
35224        composeReference("context", element.getContext());
35225      }
35226      if (element.hasExecutionPeriod()) {
35227        composePeriod("executionPeriod", element.getExecutionPeriod());
35228      }
35229      if (element.hasAuthoredOnElement()) {
35230        composeDateTime("authoredOn", element.getAuthoredOnElement());
35231      }
35232      if (element.hasLastModifiedElement()) {
35233        composeDateTime("lastModified", element.getLastModifiedElement());
35234      }
35235      if (element.hasRequester()) {
35236        composeTaskTaskRequesterComponent("requester", element.getRequester());
35237      }
35238      if (element.hasPerformerType()) { 
35239        for (CodeableConcept e : element.getPerformerType()) 
35240          composeCodeableConcept("performerType", e);
35241      }
35242      if (element.hasOwner()) {
35243        composeReference("owner", element.getOwner());
35244      }
35245      if (element.hasReason()) {
35246        composeCodeableConcept("reason", element.getReason());
35247      }
35248      if (element.hasNote()) { 
35249        for (Annotation e : element.getNote()) 
35250          composeAnnotation("note", e);
35251      }
35252      if (element.hasRelevantHistory()) { 
35253        for (Reference e : element.getRelevantHistory()) 
35254          composeReference("relevantHistory", e);
35255      }
35256      if (element.hasRestriction()) {
35257        composeTaskTaskRestrictionComponent("restriction", element.getRestriction());
35258      }
35259      if (element.hasInput()) { 
35260        for (Task.ParameterComponent e : element.getInput()) 
35261          composeTaskParameterComponent("input", e);
35262      }
35263      if (element.hasOutput()) { 
35264        for (Task.TaskOutputComponent e : element.getOutput()) 
35265          composeTaskTaskOutputComponent("output", e);
35266      }
35267  }
35268
35269  protected void composeTaskTaskRequesterComponent(String name, Task.TaskRequesterComponent element) throws IOException {
35270    if (element != null) {
35271      composeElementAttributes(element);
35272      xml.enter(FHIR_NS, name);
35273      composeTaskTaskRequesterComponentElements(element);
35274      composeElementClose(element);
35275      xml.exit(FHIR_NS, name);
35276    }
35277  }
35278
35279  protected void composeTaskTaskRequesterComponentElements(Task.TaskRequesterComponent element) throws IOException {
35280      composeBackboneElements(element);
35281      if (element.hasAgent()) {
35282        composeReference("agent", element.getAgent());
35283      }
35284      if (element.hasOnBehalfOf()) {
35285        composeReference("onBehalfOf", element.getOnBehalfOf());
35286      }
35287  }
35288
35289  protected void composeTaskTaskRestrictionComponent(String name, Task.TaskRestrictionComponent element) throws IOException {
35290    if (element != null) {
35291      composeElementAttributes(element);
35292      xml.enter(FHIR_NS, name);
35293      composeTaskTaskRestrictionComponentElements(element);
35294      composeElementClose(element);
35295      xml.exit(FHIR_NS, name);
35296    }
35297  }
35298
35299  protected void composeTaskTaskRestrictionComponentElements(Task.TaskRestrictionComponent element) throws IOException {
35300      composeBackboneElements(element);
35301      if (element.hasRepetitionsElement()) {
35302        composePositiveInt("repetitions", element.getRepetitionsElement());
35303      }
35304      if (element.hasPeriod()) {
35305        composePeriod("period", element.getPeriod());
35306      }
35307      if (element.hasRecipient()) { 
35308        for (Reference e : element.getRecipient()) 
35309          composeReference("recipient", e);
35310      }
35311  }
35312
35313  protected void composeTaskParameterComponent(String name, Task.ParameterComponent element) throws IOException {
35314    if (element != null) {
35315      composeElementAttributes(element);
35316      xml.enter(FHIR_NS, name);
35317      composeTaskParameterComponentElements(element);
35318      composeElementClose(element);
35319      xml.exit(FHIR_NS, name);
35320    }
35321  }
35322
35323  protected void composeTaskParameterComponentElements(Task.ParameterComponent element) throws IOException {
35324      composeBackboneElements(element);
35325      if (element.hasType()) {
35326        composeCodeableConcept("type", element.getType());
35327      }
35328      if (element.hasValue()) {
35329        composeType("value", element.getValue());
35330      }  }
35331
35332  protected void composeTaskTaskOutputComponent(String name, Task.TaskOutputComponent element) throws IOException {
35333    if (element != null) {
35334      composeElementAttributes(element);
35335      xml.enter(FHIR_NS, name);
35336      composeTaskTaskOutputComponentElements(element);
35337      composeElementClose(element);
35338      xml.exit(FHIR_NS, name);
35339    }
35340  }
35341
35342  protected void composeTaskTaskOutputComponentElements(Task.TaskOutputComponent element) throws IOException {
35343      composeBackboneElements(element);
35344      if (element.hasType()) {
35345        composeCodeableConcept("type", element.getType());
35346      }
35347      if (element.hasValue()) {
35348        composeType("value", element.getValue());
35349      }  }
35350
35351  protected void composeTestReport(String name, TestReport element) throws IOException {
35352    if (element != null) {
35353      composeDomainResourceAttributes(element);
35354      xml.enter(FHIR_NS, name);
35355      composeTestReportElements(element);
35356      composeElementClose(element);
35357      xml.exit(FHIR_NS, name);
35358    }
35359  }
35360
35361  protected void composeTestReportElements(TestReport element) throws IOException {
35362      composeDomainResourceElements(element);
35363      if (element.hasIdentifier()) {
35364        composeIdentifier("identifier", element.getIdentifier());
35365      }
35366      if (element.hasNameElement()) {
35367        composeString("name", element.getNameElement());
35368      }
35369      if (element.hasStatusElement())
35370        composeEnumeration("status", element.getStatusElement(), new TestReport.TestReportStatusEnumFactory());
35371      if (element.hasTestScript()) {
35372        composeReference("testScript", element.getTestScript());
35373      }
35374      if (element.hasResultElement())
35375        composeEnumeration("result", element.getResultElement(), new TestReport.TestReportResultEnumFactory());
35376      if (element.hasScoreElement()) {
35377        composeDecimal("score", element.getScoreElement());
35378      }
35379      if (element.hasTesterElement()) {
35380        composeString("tester", element.getTesterElement());
35381      }
35382      if (element.hasIssuedElement()) {
35383        composeDateTime("issued", element.getIssuedElement());
35384      }
35385      if (element.hasParticipant()) { 
35386        for (TestReport.TestReportParticipantComponent e : element.getParticipant()) 
35387          composeTestReportTestReportParticipantComponent("participant", e);
35388      }
35389      if (element.hasSetup()) {
35390        composeTestReportTestReportSetupComponent("setup", element.getSetup());
35391      }
35392      if (element.hasTest()) { 
35393        for (TestReport.TestReportTestComponent e : element.getTest()) 
35394          composeTestReportTestReportTestComponent("test", e);
35395      }
35396      if (element.hasTeardown()) {
35397        composeTestReportTestReportTeardownComponent("teardown", element.getTeardown());
35398      }
35399  }
35400
35401  protected void composeTestReportTestReportParticipantComponent(String name, TestReport.TestReportParticipantComponent element) throws IOException {
35402    if (element != null) {
35403      composeElementAttributes(element);
35404      xml.enter(FHIR_NS, name);
35405      composeTestReportTestReportParticipantComponentElements(element);
35406      composeElementClose(element);
35407      xml.exit(FHIR_NS, name);
35408    }
35409  }
35410
35411  protected void composeTestReportTestReportParticipantComponentElements(TestReport.TestReportParticipantComponent element) throws IOException {
35412      composeBackboneElements(element);
35413      if (element.hasTypeElement())
35414        composeEnumeration("type", element.getTypeElement(), new TestReport.TestReportParticipantTypeEnumFactory());
35415      if (element.hasUriElement()) {
35416        composeUri("uri", element.getUriElement());
35417      }
35418      if (element.hasDisplayElement()) {
35419        composeString("display", element.getDisplayElement());
35420      }
35421  }
35422
35423  protected void composeTestReportTestReportSetupComponent(String name, TestReport.TestReportSetupComponent element) throws IOException {
35424    if (element != null) {
35425      composeElementAttributes(element);
35426      xml.enter(FHIR_NS, name);
35427      composeTestReportTestReportSetupComponentElements(element);
35428      composeElementClose(element);
35429      xml.exit(FHIR_NS, name);
35430    }
35431  }
35432
35433  protected void composeTestReportTestReportSetupComponentElements(TestReport.TestReportSetupComponent element) throws IOException {
35434      composeBackboneElements(element);
35435      if (element.hasAction()) { 
35436        for (TestReport.SetupActionComponent e : element.getAction()) 
35437          composeTestReportSetupActionComponent("action", e);
35438      }
35439  }
35440
35441  protected void composeTestReportSetupActionComponent(String name, TestReport.SetupActionComponent element) throws IOException {
35442    if (element != null) {
35443      composeElementAttributes(element);
35444      xml.enter(FHIR_NS, name);
35445      composeTestReportSetupActionComponentElements(element);
35446      composeElementClose(element);
35447      xml.exit(FHIR_NS, name);
35448    }
35449  }
35450
35451  protected void composeTestReportSetupActionComponentElements(TestReport.SetupActionComponent element) throws IOException {
35452      composeBackboneElements(element);
35453      if (element.hasOperation()) {
35454        composeTestReportSetupActionOperationComponent("operation", element.getOperation());
35455      }
35456      if (element.hasAssert()) {
35457        composeTestReportSetupActionAssertComponent("assert", element.getAssert());
35458      }
35459  }
35460
35461  protected void composeTestReportSetupActionOperationComponent(String name, TestReport.SetupActionOperationComponent element) throws IOException {
35462    if (element != null) {
35463      composeElementAttributes(element);
35464      xml.enter(FHIR_NS, name);
35465      composeTestReportSetupActionOperationComponentElements(element);
35466      composeElementClose(element);
35467      xml.exit(FHIR_NS, name);
35468    }
35469  }
35470
35471  protected void composeTestReportSetupActionOperationComponentElements(TestReport.SetupActionOperationComponent element) throws IOException {
35472      composeBackboneElements(element);
35473      if (element.hasResultElement())
35474        composeEnumeration("result", element.getResultElement(), new TestReport.TestReportActionResultEnumFactory());
35475      if (element.hasMessageElement()) {
35476        composeMarkdown("message", element.getMessageElement());
35477      }
35478      if (element.hasDetailElement()) {
35479        composeUri("detail", element.getDetailElement());
35480      }
35481  }
35482
35483  protected void composeTestReportSetupActionAssertComponent(String name, TestReport.SetupActionAssertComponent element) throws IOException {
35484    if (element != null) {
35485      composeElementAttributes(element);
35486      xml.enter(FHIR_NS, name);
35487      composeTestReportSetupActionAssertComponentElements(element);
35488      composeElementClose(element);
35489      xml.exit(FHIR_NS, name);
35490    }
35491  }
35492
35493  protected void composeTestReportSetupActionAssertComponentElements(TestReport.SetupActionAssertComponent element) throws IOException {
35494      composeBackboneElements(element);
35495      if (element.hasResultElement())
35496        composeEnumeration("result", element.getResultElement(), new TestReport.TestReportActionResultEnumFactory());
35497      if (element.hasMessageElement()) {
35498        composeMarkdown("message", element.getMessageElement());
35499      }
35500      if (element.hasDetailElement()) {
35501        composeString("detail", element.getDetailElement());
35502      }
35503  }
35504
35505  protected void composeTestReportTestReportTestComponent(String name, TestReport.TestReportTestComponent element) throws IOException {
35506    if (element != null) {
35507      composeElementAttributes(element);
35508      xml.enter(FHIR_NS, name);
35509      composeTestReportTestReportTestComponentElements(element);
35510      composeElementClose(element);
35511      xml.exit(FHIR_NS, name);
35512    }
35513  }
35514
35515  protected void composeTestReportTestReportTestComponentElements(TestReport.TestReportTestComponent element) throws IOException {
35516      composeBackboneElements(element);
35517      if (element.hasNameElement()) {
35518        composeString("name", element.getNameElement());
35519      }
35520      if (element.hasDescriptionElement()) {
35521        composeString("description", element.getDescriptionElement());
35522      }
35523      if (element.hasAction()) { 
35524        for (TestReport.TestActionComponent e : element.getAction()) 
35525          composeTestReportTestActionComponent("action", e);
35526      }
35527  }
35528
35529  protected void composeTestReportTestActionComponent(String name, TestReport.TestActionComponent element) throws IOException {
35530    if (element != null) {
35531      composeElementAttributes(element);
35532      xml.enter(FHIR_NS, name);
35533      composeTestReportTestActionComponentElements(element);
35534      composeElementClose(element);
35535      xml.exit(FHIR_NS, name);
35536    }
35537  }
35538
35539  protected void composeTestReportTestActionComponentElements(TestReport.TestActionComponent element) throws IOException {
35540      composeBackboneElements(element);
35541      if (element.hasOperation()) {
35542        composeTestReportSetupActionOperationComponent("operation", element.getOperation());
35543      }
35544      if (element.hasAssert()) {
35545        composeTestReportSetupActionAssertComponent("assert", element.getAssert());
35546      }
35547  }
35548
35549  protected void composeTestReportTestReportTeardownComponent(String name, TestReport.TestReportTeardownComponent element) throws IOException {
35550    if (element != null) {
35551      composeElementAttributes(element);
35552      xml.enter(FHIR_NS, name);
35553      composeTestReportTestReportTeardownComponentElements(element);
35554      composeElementClose(element);
35555      xml.exit(FHIR_NS, name);
35556    }
35557  }
35558
35559  protected void composeTestReportTestReportTeardownComponentElements(TestReport.TestReportTeardownComponent element) throws IOException {
35560      composeBackboneElements(element);
35561      if (element.hasAction()) { 
35562        for (TestReport.TeardownActionComponent e : element.getAction()) 
35563          composeTestReportTeardownActionComponent("action", e);
35564      }
35565  }
35566
35567  protected void composeTestReportTeardownActionComponent(String name, TestReport.TeardownActionComponent element) throws IOException {
35568    if (element != null) {
35569      composeElementAttributes(element);
35570      xml.enter(FHIR_NS, name);
35571      composeTestReportTeardownActionComponentElements(element);
35572      composeElementClose(element);
35573      xml.exit(FHIR_NS, name);
35574    }
35575  }
35576
35577  protected void composeTestReportTeardownActionComponentElements(TestReport.TeardownActionComponent element) throws IOException {
35578      composeBackboneElements(element);
35579      if (element.hasOperation()) {
35580        composeTestReportSetupActionOperationComponent("operation", element.getOperation());
35581      }
35582  }
35583
35584  protected void composeTestScript(String name, TestScript element) throws IOException {
35585    if (element != null) {
35586      composeDomainResourceAttributes(element);
35587      xml.enter(FHIR_NS, name);
35588      composeTestScriptElements(element);
35589      composeElementClose(element);
35590      xml.exit(FHIR_NS, name);
35591    }
35592  }
35593
35594  protected void composeTestScriptElements(TestScript element) throws IOException {
35595      composeDomainResourceElements(element);
35596      if (element.hasUrlElement()) {
35597        composeUri("url", element.getUrlElement());
35598      }
35599      if (element.hasIdentifier()) {
35600        composeIdentifier("identifier", element.getIdentifier());
35601      }
35602      if (element.hasVersionElement()) {
35603        composeString("version", element.getVersionElement());
35604      }
35605      if (element.hasNameElement()) {
35606        composeString("name", element.getNameElement());
35607      }
35608      if (element.hasTitleElement()) {
35609        composeString("title", element.getTitleElement());
35610      }
35611      if (element.hasStatusElement())
35612        composeEnumeration("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory());
35613      if (element.hasExperimentalElement()) {
35614        composeBoolean("experimental", element.getExperimentalElement());
35615      }
35616      if (element.hasDateElement()) {
35617        composeDateTime("date", element.getDateElement());
35618      }
35619      if (element.hasPublisherElement()) {
35620        composeString("publisher", element.getPublisherElement());
35621      }
35622      if (element.hasContact()) { 
35623        for (ContactDetail e : element.getContact()) 
35624          composeContactDetail("contact", e);
35625      }
35626      if (element.hasDescriptionElement()) {
35627        composeMarkdown("description", element.getDescriptionElement());
35628      }
35629      if (element.hasUseContext()) { 
35630        for (UsageContext e : element.getUseContext()) 
35631          composeUsageContext("useContext", e);
35632      }
35633      if (element.hasJurisdiction()) { 
35634        for (CodeableConcept e : element.getJurisdiction()) 
35635          composeCodeableConcept("jurisdiction", e);
35636      }
35637      if (element.hasPurposeElement()) {
35638        composeMarkdown("purpose", element.getPurposeElement());
35639      }
35640      if (element.hasCopyrightElement()) {
35641        composeMarkdown("copyright", element.getCopyrightElement());
35642      }
35643      if (element.hasOrigin()) { 
35644        for (TestScript.TestScriptOriginComponent e : element.getOrigin()) 
35645          composeTestScriptTestScriptOriginComponent("origin", e);
35646      }
35647      if (element.hasDestination()) { 
35648        for (TestScript.TestScriptDestinationComponent e : element.getDestination()) 
35649          composeTestScriptTestScriptDestinationComponent("destination", e);
35650      }
35651      if (element.hasMetadata()) {
35652        composeTestScriptTestScriptMetadataComponent("metadata", element.getMetadata());
35653      }
35654      if (element.hasFixture()) { 
35655        for (TestScript.TestScriptFixtureComponent e : element.getFixture()) 
35656          composeTestScriptTestScriptFixtureComponent("fixture", e);
35657      }
35658      if (element.hasProfile()) { 
35659        for (Reference e : element.getProfile()) 
35660          composeReference("profile", e);
35661      }
35662      if (element.hasVariable()) { 
35663        for (TestScript.TestScriptVariableComponent e : element.getVariable()) 
35664          composeTestScriptTestScriptVariableComponent("variable", e);
35665      }
35666      if (element.hasRule()) { 
35667        for (TestScript.TestScriptRuleComponent e : element.getRule()) 
35668          composeTestScriptTestScriptRuleComponent("rule", e);
35669      }
35670      if (element.hasRuleset()) { 
35671        for (TestScript.TestScriptRulesetComponent e : element.getRuleset()) 
35672          composeTestScriptTestScriptRulesetComponent("ruleset", e);
35673      }
35674      if (element.hasSetup()) {
35675        composeTestScriptTestScriptSetupComponent("setup", element.getSetup());
35676      }
35677      if (element.hasTest()) { 
35678        for (TestScript.TestScriptTestComponent e : element.getTest()) 
35679          composeTestScriptTestScriptTestComponent("test", e);
35680      }
35681      if (element.hasTeardown()) {
35682        composeTestScriptTestScriptTeardownComponent("teardown", element.getTeardown());
35683      }
35684  }
35685
35686  protected void composeTestScriptTestScriptOriginComponent(String name, TestScript.TestScriptOriginComponent element) throws IOException {
35687    if (element != null) {
35688      composeElementAttributes(element);
35689      xml.enter(FHIR_NS, name);
35690      composeTestScriptTestScriptOriginComponentElements(element);
35691      composeElementClose(element);
35692      xml.exit(FHIR_NS, name);
35693    }
35694  }
35695
35696  protected void composeTestScriptTestScriptOriginComponentElements(TestScript.TestScriptOriginComponent element) throws IOException {
35697      composeBackboneElements(element);
35698      if (element.hasIndexElement()) {
35699        composeInteger("index", element.getIndexElement());
35700      }
35701      if (element.hasProfile()) {
35702        composeCoding("profile", element.getProfile());
35703      }
35704  }
35705
35706  protected void composeTestScriptTestScriptDestinationComponent(String name, TestScript.TestScriptDestinationComponent element) throws IOException {
35707    if (element != null) {
35708      composeElementAttributes(element);
35709      xml.enter(FHIR_NS, name);
35710      composeTestScriptTestScriptDestinationComponentElements(element);
35711      composeElementClose(element);
35712      xml.exit(FHIR_NS, name);
35713    }
35714  }
35715
35716  protected void composeTestScriptTestScriptDestinationComponentElements(TestScript.TestScriptDestinationComponent element) throws IOException {
35717      composeBackboneElements(element);
35718      if (element.hasIndexElement()) {
35719        composeInteger("index", element.getIndexElement());
35720      }
35721      if (element.hasProfile()) {
35722        composeCoding("profile", element.getProfile());
35723      }
35724  }
35725
35726  protected void composeTestScriptTestScriptMetadataComponent(String name, TestScript.TestScriptMetadataComponent element) throws IOException {
35727    if (element != null) {
35728      composeElementAttributes(element);
35729      xml.enter(FHIR_NS, name);
35730      composeTestScriptTestScriptMetadataComponentElements(element);
35731      composeElementClose(element);
35732      xml.exit(FHIR_NS, name);
35733    }
35734  }
35735
35736  protected void composeTestScriptTestScriptMetadataComponentElements(TestScript.TestScriptMetadataComponent element) throws IOException {
35737      composeBackboneElements(element);
35738      if (element.hasLink()) { 
35739        for (TestScript.TestScriptMetadataLinkComponent e : element.getLink()) 
35740          composeTestScriptTestScriptMetadataLinkComponent("link", e);
35741      }
35742      if (element.hasCapability()) { 
35743        for (TestScript.TestScriptMetadataCapabilityComponent e : element.getCapability()) 
35744          composeTestScriptTestScriptMetadataCapabilityComponent("capability", e);
35745      }
35746  }
35747
35748  protected void composeTestScriptTestScriptMetadataLinkComponent(String name, TestScript.TestScriptMetadataLinkComponent element) throws IOException {
35749    if (element != null) {
35750      composeElementAttributes(element);
35751      xml.enter(FHIR_NS, name);
35752      composeTestScriptTestScriptMetadataLinkComponentElements(element);
35753      composeElementClose(element);
35754      xml.exit(FHIR_NS, name);
35755    }
35756  }
35757
35758  protected void composeTestScriptTestScriptMetadataLinkComponentElements(TestScript.TestScriptMetadataLinkComponent element) throws IOException {
35759      composeBackboneElements(element);
35760      if (element.hasUrlElement()) {
35761        composeUri("url", element.getUrlElement());
35762      }
35763      if (element.hasDescriptionElement()) {
35764        composeString("description", element.getDescriptionElement());
35765      }
35766  }
35767
35768  protected void composeTestScriptTestScriptMetadataCapabilityComponent(String name, TestScript.TestScriptMetadataCapabilityComponent element) throws IOException {
35769    if (element != null) {
35770      composeElementAttributes(element);
35771      xml.enter(FHIR_NS, name);
35772      composeTestScriptTestScriptMetadataCapabilityComponentElements(element);
35773      composeElementClose(element);
35774      xml.exit(FHIR_NS, name);
35775    }
35776  }
35777
35778  protected void composeTestScriptTestScriptMetadataCapabilityComponentElements(TestScript.TestScriptMetadataCapabilityComponent element) throws IOException {
35779      composeBackboneElements(element);
35780      if (element.hasRequiredElement()) {
35781        composeBoolean("required", element.getRequiredElement());
35782      }
35783      if (element.hasValidatedElement()) {
35784        composeBoolean("validated", element.getValidatedElement());
35785      }
35786      if (element.hasDescriptionElement()) {
35787        composeString("description", element.getDescriptionElement());
35788      }
35789      if (element.hasOrigin()) { 
35790        for (IntegerType e : element.getOrigin()) 
35791          composeInteger("origin", e);
35792      }
35793      if (element.hasDestinationElement()) {
35794        composeInteger("destination", element.getDestinationElement());
35795      }
35796      if (element.hasLink()) { 
35797        for (UriType e : element.getLink()) 
35798          composeUri("link", e);
35799      }
35800      if (element.hasCapabilities()) {
35801        composeReference("capabilities", element.getCapabilities());
35802      }
35803  }
35804
35805  protected void composeTestScriptTestScriptFixtureComponent(String name, TestScript.TestScriptFixtureComponent element) throws IOException {
35806    if (element != null) {
35807      composeElementAttributes(element);
35808      xml.enter(FHIR_NS, name);
35809      composeTestScriptTestScriptFixtureComponentElements(element);
35810      composeElementClose(element);
35811      xml.exit(FHIR_NS, name);
35812    }
35813  }
35814
35815  protected void composeTestScriptTestScriptFixtureComponentElements(TestScript.TestScriptFixtureComponent element) throws IOException {
35816      composeBackboneElements(element);
35817      if (element.hasAutocreateElement()) {
35818        composeBoolean("autocreate", element.getAutocreateElement());
35819      }
35820      if (element.hasAutodeleteElement()) {
35821        composeBoolean("autodelete", element.getAutodeleteElement());
35822      }
35823      if (element.hasResource()) {
35824        composeReference("resource", element.getResource());
35825      }
35826  }
35827
35828  protected void composeTestScriptTestScriptVariableComponent(String name, TestScript.TestScriptVariableComponent element) throws IOException {
35829    if (element != null) {
35830      composeElementAttributes(element);
35831      xml.enter(FHIR_NS, name);
35832      composeTestScriptTestScriptVariableComponentElements(element);
35833      composeElementClose(element);
35834      xml.exit(FHIR_NS, name);
35835    }
35836  }
35837
35838  protected void composeTestScriptTestScriptVariableComponentElements(TestScript.TestScriptVariableComponent element) throws IOException {
35839      composeBackboneElements(element);
35840      if (element.hasNameElement()) {
35841        composeString("name", element.getNameElement());
35842      }
35843      if (element.hasDefaultValueElement()) {
35844        composeString("defaultValue", element.getDefaultValueElement());
35845      }
35846      if (element.hasDescriptionElement()) {
35847        composeString("description", element.getDescriptionElement());
35848      }
35849      if (element.hasExpressionElement()) {
35850        composeString("expression", element.getExpressionElement());
35851      }
35852      if (element.hasHeaderFieldElement()) {
35853        composeString("headerField", element.getHeaderFieldElement());
35854      }
35855      if (element.hasHintElement()) {
35856        composeString("hint", element.getHintElement());
35857      }
35858      if (element.hasPathElement()) {
35859        composeString("path", element.getPathElement());
35860      }
35861      if (element.hasSourceIdElement()) {
35862        composeId("sourceId", element.getSourceIdElement());
35863      }
35864  }
35865
35866  protected void composeTestScriptTestScriptRuleComponent(String name, TestScript.TestScriptRuleComponent element) throws IOException {
35867    if (element != null) {
35868      composeElementAttributes(element);
35869      xml.enter(FHIR_NS, name);
35870      composeTestScriptTestScriptRuleComponentElements(element);
35871      composeElementClose(element);
35872      xml.exit(FHIR_NS, name);
35873    }
35874  }
35875
35876  protected void composeTestScriptTestScriptRuleComponentElements(TestScript.TestScriptRuleComponent element) throws IOException {
35877      composeBackboneElements(element);
35878      if (element.hasResource()) {
35879        composeReference("resource", element.getResource());
35880      }
35881      if (element.hasParam()) { 
35882        for (TestScript.RuleParamComponent e : element.getParam()) 
35883          composeTestScriptRuleParamComponent("param", e);
35884      }
35885  }
35886
35887  protected void composeTestScriptRuleParamComponent(String name, TestScript.RuleParamComponent element) throws IOException {
35888    if (element != null) {
35889      composeElementAttributes(element);
35890      xml.enter(FHIR_NS, name);
35891      composeTestScriptRuleParamComponentElements(element);
35892      composeElementClose(element);
35893      xml.exit(FHIR_NS, name);
35894    }
35895  }
35896
35897  protected void composeTestScriptRuleParamComponentElements(TestScript.RuleParamComponent element) throws IOException {
35898      composeBackboneElements(element);
35899      if (element.hasNameElement()) {
35900        composeString("name", element.getNameElement());
35901      }
35902      if (element.hasValueElement()) {
35903        composeString("value", element.getValueElement());
35904      }
35905  }
35906
35907  protected void composeTestScriptTestScriptRulesetComponent(String name, TestScript.TestScriptRulesetComponent element) throws IOException {
35908    if (element != null) {
35909      composeElementAttributes(element);
35910      xml.enter(FHIR_NS, name);
35911      composeTestScriptTestScriptRulesetComponentElements(element);
35912      composeElementClose(element);
35913      xml.exit(FHIR_NS, name);
35914    }
35915  }
35916
35917  protected void composeTestScriptTestScriptRulesetComponentElements(TestScript.TestScriptRulesetComponent element) throws IOException {
35918      composeBackboneElements(element);
35919      if (element.hasResource()) {
35920        composeReference("resource", element.getResource());
35921      }
35922      if (element.hasRule()) { 
35923        for (TestScript.RulesetRuleComponent e : element.getRule()) 
35924          composeTestScriptRulesetRuleComponent("rule", e);
35925      }
35926  }
35927
35928  protected void composeTestScriptRulesetRuleComponent(String name, TestScript.RulesetRuleComponent element) throws IOException {
35929    if (element != null) {
35930      composeElementAttributes(element);
35931      xml.enter(FHIR_NS, name);
35932      composeTestScriptRulesetRuleComponentElements(element);
35933      composeElementClose(element);
35934      xml.exit(FHIR_NS, name);
35935    }
35936  }
35937
35938  protected void composeTestScriptRulesetRuleComponentElements(TestScript.RulesetRuleComponent element) throws IOException {
35939      composeBackboneElements(element);
35940      if (element.hasRuleIdElement()) {
35941        composeId("ruleId", element.getRuleIdElement());
35942      }
35943      if (element.hasParam()) { 
35944        for (TestScript.RulesetRuleParamComponent e : element.getParam()) 
35945          composeTestScriptRulesetRuleParamComponent("param", e);
35946      }
35947  }
35948
35949  protected void composeTestScriptRulesetRuleParamComponent(String name, TestScript.RulesetRuleParamComponent element) throws IOException {
35950    if (element != null) {
35951      composeElementAttributes(element);
35952      xml.enter(FHIR_NS, name);
35953      composeTestScriptRulesetRuleParamComponentElements(element);
35954      composeElementClose(element);
35955      xml.exit(FHIR_NS, name);
35956    }
35957  }
35958
35959  protected void composeTestScriptRulesetRuleParamComponentElements(TestScript.RulesetRuleParamComponent element) throws IOException {
35960      composeBackboneElements(element);
35961      if (element.hasNameElement()) {
35962        composeString("name", element.getNameElement());
35963      }
35964      if (element.hasValueElement()) {
35965        composeString("value", element.getValueElement());
35966      }
35967  }
35968
35969  protected void composeTestScriptTestScriptSetupComponent(String name, TestScript.TestScriptSetupComponent element) throws IOException {
35970    if (element != null) {
35971      composeElementAttributes(element);
35972      xml.enter(FHIR_NS, name);
35973      composeTestScriptTestScriptSetupComponentElements(element);
35974      composeElementClose(element);
35975      xml.exit(FHIR_NS, name);
35976    }
35977  }
35978
35979  protected void composeTestScriptTestScriptSetupComponentElements(TestScript.TestScriptSetupComponent element) throws IOException {
35980      composeBackboneElements(element);
35981      if (element.hasAction()) { 
35982        for (TestScript.SetupActionComponent e : element.getAction()) 
35983          composeTestScriptSetupActionComponent("action", e);
35984      }
35985  }
35986
35987  protected void composeTestScriptSetupActionComponent(String name, TestScript.SetupActionComponent element) throws IOException {
35988    if (element != null) {
35989      composeElementAttributes(element);
35990      xml.enter(FHIR_NS, name);
35991      composeTestScriptSetupActionComponentElements(element);
35992      composeElementClose(element);
35993      xml.exit(FHIR_NS, name);
35994    }
35995  }
35996
35997  protected void composeTestScriptSetupActionComponentElements(TestScript.SetupActionComponent element) throws IOException {
35998      composeBackboneElements(element);
35999      if (element.hasOperation()) {
36000        composeTestScriptSetupActionOperationComponent("operation", element.getOperation());
36001      }
36002      if (element.hasAssert()) {
36003        composeTestScriptSetupActionAssertComponent("assert", element.getAssert());
36004      }
36005  }
36006
36007  protected void composeTestScriptSetupActionOperationComponent(String name, TestScript.SetupActionOperationComponent element) throws IOException {
36008    if (element != null) {
36009      composeElementAttributes(element);
36010      xml.enter(FHIR_NS, name);
36011      composeTestScriptSetupActionOperationComponentElements(element);
36012      composeElementClose(element);
36013      xml.exit(FHIR_NS, name);
36014    }
36015  }
36016
36017  protected void composeTestScriptSetupActionOperationComponentElements(TestScript.SetupActionOperationComponent element) throws IOException {
36018      composeBackboneElements(element);
36019      if (element.hasType()) {
36020        composeCoding("type", element.getType());
36021      }
36022      if (element.hasResourceElement()) {
36023        composeCode("resource", element.getResourceElement());
36024      }
36025      if (element.hasLabelElement()) {
36026        composeString("label", element.getLabelElement());
36027      }
36028      if (element.hasDescriptionElement()) {
36029        composeString("description", element.getDescriptionElement());
36030      }
36031      if (element.hasAcceptElement())
36032        composeEnumeration("accept", element.getAcceptElement(), new TestScript.ContentTypeEnumFactory());
36033      if (element.hasContentTypeElement())
36034        composeEnumeration("contentType", element.getContentTypeElement(), new TestScript.ContentTypeEnumFactory());
36035      if (element.hasDestinationElement()) {
36036        composeInteger("destination", element.getDestinationElement());
36037      }
36038      if (element.hasEncodeRequestUrlElement()) {
36039        composeBoolean("encodeRequestUrl", element.getEncodeRequestUrlElement());
36040      }
36041      if (element.hasOriginElement()) {
36042        composeInteger("origin", element.getOriginElement());
36043      }
36044      if (element.hasParamsElement()) {
36045        composeString("params", element.getParamsElement());
36046      }
36047      if (element.hasRequestHeader()) { 
36048        for (TestScript.SetupActionOperationRequestHeaderComponent e : element.getRequestHeader()) 
36049          composeTestScriptSetupActionOperationRequestHeaderComponent("requestHeader", e);
36050      }
36051      if (element.hasRequestIdElement()) {
36052        composeId("requestId", element.getRequestIdElement());
36053      }
36054      if (element.hasResponseIdElement()) {
36055        composeId("responseId", element.getResponseIdElement());
36056      }
36057      if (element.hasSourceIdElement()) {
36058        composeId("sourceId", element.getSourceIdElement());
36059      }
36060      if (element.hasTargetIdElement()) {
36061        composeId("targetId", element.getTargetIdElement());
36062      }
36063      if (element.hasUrlElement()) {
36064        composeString("url", element.getUrlElement());
36065      }
36066  }
36067
36068  protected void composeTestScriptSetupActionOperationRequestHeaderComponent(String name, TestScript.SetupActionOperationRequestHeaderComponent element) throws IOException {
36069    if (element != null) {
36070      composeElementAttributes(element);
36071      xml.enter(FHIR_NS, name);
36072      composeTestScriptSetupActionOperationRequestHeaderComponentElements(element);
36073      composeElementClose(element);
36074      xml.exit(FHIR_NS, name);
36075    }
36076  }
36077
36078  protected void composeTestScriptSetupActionOperationRequestHeaderComponentElements(TestScript.SetupActionOperationRequestHeaderComponent element) throws IOException {
36079      composeBackboneElements(element);
36080      if (element.hasFieldElement()) {
36081        composeString("field", element.getFieldElement());
36082      }
36083      if (element.hasValueElement()) {
36084        composeString("value", element.getValueElement());
36085      }
36086  }
36087
36088  protected void composeTestScriptSetupActionAssertComponent(String name, TestScript.SetupActionAssertComponent element) throws IOException {
36089    if (element != null) {
36090      composeElementAttributes(element);
36091      xml.enter(FHIR_NS, name);
36092      composeTestScriptSetupActionAssertComponentElements(element);
36093      composeElementClose(element);
36094      xml.exit(FHIR_NS, name);
36095    }
36096  }
36097
36098  protected void composeTestScriptSetupActionAssertComponentElements(TestScript.SetupActionAssertComponent element) throws IOException {
36099      composeBackboneElements(element);
36100      if (element.hasLabelElement()) {
36101        composeString("label", element.getLabelElement());
36102      }
36103      if (element.hasDescriptionElement()) {
36104        composeString("description", element.getDescriptionElement());
36105      }
36106      if (element.hasDirectionElement())
36107        composeEnumeration("direction", element.getDirectionElement(), new TestScript.AssertionDirectionTypeEnumFactory());
36108      if (element.hasCompareToSourceIdElement()) {
36109        composeString("compareToSourceId", element.getCompareToSourceIdElement());
36110      }
36111      if (element.hasCompareToSourceExpressionElement()) {
36112        composeString("compareToSourceExpression", element.getCompareToSourceExpressionElement());
36113      }
36114      if (element.hasCompareToSourcePathElement()) {
36115        composeString("compareToSourcePath", element.getCompareToSourcePathElement());
36116      }
36117      if (element.hasContentTypeElement())
36118        composeEnumeration("contentType", element.getContentTypeElement(), new TestScript.ContentTypeEnumFactory());
36119      if (element.hasExpressionElement()) {
36120        composeString("expression", element.getExpressionElement());
36121      }
36122      if (element.hasHeaderFieldElement()) {
36123        composeString("headerField", element.getHeaderFieldElement());
36124      }
36125      if (element.hasMinimumIdElement()) {
36126        composeString("minimumId", element.getMinimumIdElement());
36127      }
36128      if (element.hasNavigationLinksElement()) {
36129        composeBoolean("navigationLinks", element.getNavigationLinksElement());
36130      }
36131      if (element.hasOperatorElement())
36132        composeEnumeration("operator", element.getOperatorElement(), new TestScript.AssertionOperatorTypeEnumFactory());
36133      if (element.hasPathElement()) {
36134        composeString("path", element.getPathElement());
36135      }
36136      if (element.hasRequestMethodElement())
36137        composeEnumeration("requestMethod", element.getRequestMethodElement(), new TestScript.TestScriptRequestMethodCodeEnumFactory());
36138      if (element.hasRequestURLElement()) {
36139        composeString("requestURL", element.getRequestURLElement());
36140      }
36141      if (element.hasResourceElement()) {
36142        composeCode("resource", element.getResourceElement());
36143      }
36144      if (element.hasResponseElement())
36145        composeEnumeration("response", element.getResponseElement(), new TestScript.AssertionResponseTypesEnumFactory());
36146      if (element.hasResponseCodeElement()) {
36147        composeString("responseCode", element.getResponseCodeElement());
36148      }
36149      if (element.hasRule()) {
36150        composeTestScriptActionAssertRuleComponent("rule", element.getRule());
36151      }
36152      if (element.hasRuleset()) {
36153        composeTestScriptActionAssertRulesetComponent("ruleset", element.getRuleset());
36154      }
36155      if (element.hasSourceIdElement()) {
36156        composeId("sourceId", element.getSourceIdElement());
36157      }
36158      if (element.hasValidateProfileIdElement()) {
36159        composeId("validateProfileId", element.getValidateProfileIdElement());
36160      }
36161      if (element.hasValueElement()) {
36162        composeString("value", element.getValueElement());
36163      }
36164      if (element.hasWarningOnlyElement()) {
36165        composeBoolean("warningOnly", element.getWarningOnlyElement());
36166      }
36167  }
36168
36169  protected void composeTestScriptActionAssertRuleComponent(String name, TestScript.ActionAssertRuleComponent element) throws IOException {
36170    if (element != null) {
36171      composeElementAttributes(element);
36172      xml.enter(FHIR_NS, name);
36173      composeTestScriptActionAssertRuleComponentElements(element);
36174      composeElementClose(element);
36175      xml.exit(FHIR_NS, name);
36176    }
36177  }
36178
36179  protected void composeTestScriptActionAssertRuleComponentElements(TestScript.ActionAssertRuleComponent element) throws IOException {
36180      composeBackboneElements(element);
36181      if (element.hasRuleIdElement()) {
36182        composeId("ruleId", element.getRuleIdElement());
36183      }
36184      if (element.hasParam()) { 
36185        for (TestScript.ActionAssertRuleParamComponent e : element.getParam()) 
36186          composeTestScriptActionAssertRuleParamComponent("param", e);
36187      }
36188  }
36189
36190  protected void composeTestScriptActionAssertRuleParamComponent(String name, TestScript.ActionAssertRuleParamComponent element) throws IOException {
36191    if (element != null) {
36192      composeElementAttributes(element);
36193      xml.enter(FHIR_NS, name);
36194      composeTestScriptActionAssertRuleParamComponentElements(element);
36195      composeElementClose(element);
36196      xml.exit(FHIR_NS, name);
36197    }
36198  }
36199
36200  protected void composeTestScriptActionAssertRuleParamComponentElements(TestScript.ActionAssertRuleParamComponent element) throws IOException {
36201      composeBackboneElements(element);
36202      if (element.hasNameElement()) {
36203        composeString("name", element.getNameElement());
36204      }
36205      if (element.hasValueElement()) {
36206        composeString("value", element.getValueElement());
36207      }
36208  }
36209
36210  protected void composeTestScriptActionAssertRulesetComponent(String name, TestScript.ActionAssertRulesetComponent element) throws IOException {
36211    if (element != null) {
36212      composeElementAttributes(element);
36213      xml.enter(FHIR_NS, name);
36214      composeTestScriptActionAssertRulesetComponentElements(element);
36215      composeElementClose(element);
36216      xml.exit(FHIR_NS, name);
36217    }
36218  }
36219
36220  protected void composeTestScriptActionAssertRulesetComponentElements(TestScript.ActionAssertRulesetComponent element) throws IOException {
36221      composeBackboneElements(element);
36222      if (element.hasRulesetIdElement()) {
36223        composeId("rulesetId", element.getRulesetIdElement());
36224      }
36225      if (element.hasRule()) { 
36226        for (TestScript.ActionAssertRulesetRuleComponent e : element.getRule()) 
36227          composeTestScriptActionAssertRulesetRuleComponent("rule", e);
36228      }
36229  }
36230
36231  protected void composeTestScriptActionAssertRulesetRuleComponent(String name, TestScript.ActionAssertRulesetRuleComponent element) throws IOException {
36232    if (element != null) {
36233      composeElementAttributes(element);
36234      xml.enter(FHIR_NS, name);
36235      composeTestScriptActionAssertRulesetRuleComponentElements(element);
36236      composeElementClose(element);
36237      xml.exit(FHIR_NS, name);
36238    }
36239  }
36240
36241  protected void composeTestScriptActionAssertRulesetRuleComponentElements(TestScript.ActionAssertRulesetRuleComponent element) throws IOException {
36242      composeBackboneElements(element);
36243      if (element.hasRuleIdElement()) {
36244        composeId("ruleId", element.getRuleIdElement());
36245      }
36246      if (element.hasParam()) { 
36247        for (TestScript.ActionAssertRulesetRuleParamComponent e : element.getParam()) 
36248          composeTestScriptActionAssertRulesetRuleParamComponent("param", e);
36249      }
36250  }
36251
36252  protected void composeTestScriptActionAssertRulesetRuleParamComponent(String name, TestScript.ActionAssertRulesetRuleParamComponent element) throws IOException {
36253    if (element != null) {
36254      composeElementAttributes(element);
36255      xml.enter(FHIR_NS, name);
36256      composeTestScriptActionAssertRulesetRuleParamComponentElements(element);
36257      composeElementClose(element);
36258      xml.exit(FHIR_NS, name);
36259    }
36260  }
36261
36262  protected void composeTestScriptActionAssertRulesetRuleParamComponentElements(TestScript.ActionAssertRulesetRuleParamComponent element) throws IOException {
36263      composeBackboneElements(element);
36264      if (element.hasNameElement()) {
36265        composeString("name", element.getNameElement());
36266      }
36267      if (element.hasValueElement()) {
36268        composeString("value", element.getValueElement());
36269      }
36270  }
36271
36272  protected void composeTestScriptTestScriptTestComponent(String name, TestScript.TestScriptTestComponent element) throws IOException {
36273    if (element != null) {
36274      composeElementAttributes(element);
36275      xml.enter(FHIR_NS, name);
36276      composeTestScriptTestScriptTestComponentElements(element);
36277      composeElementClose(element);
36278      xml.exit(FHIR_NS, name);
36279    }
36280  }
36281
36282  protected void composeTestScriptTestScriptTestComponentElements(TestScript.TestScriptTestComponent element) throws IOException {
36283      composeBackboneElements(element);
36284      if (element.hasNameElement()) {
36285        composeString("name", element.getNameElement());
36286      }
36287      if (element.hasDescriptionElement()) {
36288        composeString("description", element.getDescriptionElement());
36289      }
36290      if (element.hasAction()) { 
36291        for (TestScript.TestActionComponent e : element.getAction()) 
36292          composeTestScriptTestActionComponent("action", e);
36293      }
36294  }
36295
36296  protected void composeTestScriptTestActionComponent(String name, TestScript.TestActionComponent element) throws IOException {
36297    if (element != null) {
36298      composeElementAttributes(element);
36299      xml.enter(FHIR_NS, name);
36300      composeTestScriptTestActionComponentElements(element);
36301      composeElementClose(element);
36302      xml.exit(FHIR_NS, name);
36303    }
36304  }
36305
36306  protected void composeTestScriptTestActionComponentElements(TestScript.TestActionComponent element) throws IOException {
36307      composeBackboneElements(element);
36308      if (element.hasOperation()) {
36309        composeTestScriptSetupActionOperationComponent("operation", element.getOperation());
36310      }
36311      if (element.hasAssert()) {
36312        composeTestScriptSetupActionAssertComponent("assert", element.getAssert());
36313      }
36314  }
36315
36316  protected void composeTestScriptTestScriptTeardownComponent(String name, TestScript.TestScriptTeardownComponent element) throws IOException {
36317    if (element != null) {
36318      composeElementAttributes(element);
36319      xml.enter(FHIR_NS, name);
36320      composeTestScriptTestScriptTeardownComponentElements(element);
36321      composeElementClose(element);
36322      xml.exit(FHIR_NS, name);
36323    }
36324  }
36325
36326  protected void composeTestScriptTestScriptTeardownComponentElements(TestScript.TestScriptTeardownComponent element) throws IOException {
36327      composeBackboneElements(element);
36328      if (element.hasAction()) { 
36329        for (TestScript.TeardownActionComponent e : element.getAction()) 
36330          composeTestScriptTeardownActionComponent("action", e);
36331      }
36332  }
36333
36334  protected void composeTestScriptTeardownActionComponent(String name, TestScript.TeardownActionComponent element) throws IOException {
36335    if (element != null) {
36336      composeElementAttributes(element);
36337      xml.enter(FHIR_NS, name);
36338      composeTestScriptTeardownActionComponentElements(element);
36339      composeElementClose(element);
36340      xml.exit(FHIR_NS, name);
36341    }
36342  }
36343
36344  protected void composeTestScriptTeardownActionComponentElements(TestScript.TeardownActionComponent element) throws IOException {
36345      composeBackboneElements(element);
36346      if (element.hasOperation()) {
36347        composeTestScriptSetupActionOperationComponent("operation", element.getOperation());
36348      }
36349  }
36350
36351  protected void composeValueSet(String name, ValueSet element) throws IOException {
36352    if (element != null) {
36353      composeDomainResourceAttributes(element);
36354      xml.enter(FHIR_NS, name);
36355      composeValueSetElements(element);
36356      composeElementClose(element);
36357      xml.exit(FHIR_NS, name);
36358    }
36359  }
36360
36361  protected void composeValueSetElements(ValueSet element) throws IOException {
36362      composeDomainResourceElements(element);
36363      if (element.hasUrlElement()) {
36364        composeUri("url", element.getUrlElement());
36365      }
36366      if (element.hasIdentifier()) { 
36367        for (Identifier e : element.getIdentifier()) 
36368          composeIdentifier("identifier", e);
36369      }
36370      if (element.hasVersionElement()) {
36371        composeString("version", element.getVersionElement());
36372      }
36373      if (element.hasNameElement()) {
36374        composeString("name", element.getNameElement());
36375      }
36376      if (element.hasTitleElement()) {
36377        composeString("title", element.getTitleElement());
36378      }
36379      if (element.hasStatusElement())
36380        composeEnumeration("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory());
36381      if (element.hasExperimentalElement()) {
36382        composeBoolean("experimental", element.getExperimentalElement());
36383      }
36384      if (element.hasDateElement()) {
36385        composeDateTime("date", element.getDateElement());
36386      }
36387      if (element.hasPublisherElement()) {
36388        composeString("publisher", element.getPublisherElement());
36389      }
36390      if (element.hasContact()) { 
36391        for (ContactDetail e : element.getContact()) 
36392          composeContactDetail("contact", e);
36393      }
36394      if (element.hasDescriptionElement()) {
36395        composeMarkdown("description", element.getDescriptionElement());
36396      }
36397      if (element.hasUseContext()) { 
36398        for (UsageContext e : element.getUseContext()) 
36399          composeUsageContext("useContext", e);
36400      }
36401      if (element.hasJurisdiction()) { 
36402        for (CodeableConcept e : element.getJurisdiction()) 
36403          composeCodeableConcept("jurisdiction", e);
36404      }
36405      if (element.hasImmutableElement()) {
36406        composeBoolean("immutable", element.getImmutableElement());
36407      }
36408      if (element.hasPurposeElement()) {
36409        composeMarkdown("purpose", element.getPurposeElement());
36410      }
36411      if (element.hasCopyrightElement()) {
36412        composeMarkdown("copyright", element.getCopyrightElement());
36413      }
36414      if (element.hasExtensibleElement()) {
36415        composeBoolean("extensible", element.getExtensibleElement());
36416      }
36417      if (element.hasCompose()) {
36418        composeValueSetValueSetComposeComponent("compose", element.getCompose());
36419      }
36420      if (element.hasExpansion()) {
36421        composeValueSetValueSetExpansionComponent("expansion", element.getExpansion());
36422      }
36423  }
36424
36425  protected void composeValueSetValueSetComposeComponent(String name, ValueSet.ValueSetComposeComponent element) throws IOException {
36426    if (element != null) {
36427      composeElementAttributes(element);
36428      xml.enter(FHIR_NS, name);
36429      composeValueSetValueSetComposeComponentElements(element);
36430      composeElementClose(element);
36431      xml.exit(FHIR_NS, name);
36432    }
36433  }
36434
36435  protected void composeValueSetValueSetComposeComponentElements(ValueSet.ValueSetComposeComponent element) throws IOException {
36436      composeBackboneElements(element);
36437      if (element.hasLockedDateElement()) {
36438        composeDate("lockedDate", element.getLockedDateElement());
36439      }
36440      if (element.hasInactiveElement()) {
36441        composeBoolean("inactive", element.getInactiveElement());
36442      }
36443      if (element.hasInclude()) { 
36444        for (ValueSet.ConceptSetComponent e : element.getInclude()) 
36445          composeValueSetConceptSetComponent("include", e);
36446      }
36447      if (element.hasExclude()) { 
36448        for (ValueSet.ConceptSetComponent e : element.getExclude()) 
36449          composeValueSetConceptSetComponent("exclude", e);
36450      }
36451  }
36452
36453  protected void composeValueSetConceptSetComponent(String name, ValueSet.ConceptSetComponent element) throws IOException {
36454    if (element != null) {
36455      composeElementAttributes(element);
36456      xml.enter(FHIR_NS, name);
36457      composeValueSetConceptSetComponentElements(element);
36458      composeElementClose(element);
36459      xml.exit(FHIR_NS, name);
36460    }
36461  }
36462
36463  protected void composeValueSetConceptSetComponentElements(ValueSet.ConceptSetComponent element) throws IOException {
36464      composeBackboneElements(element);
36465      if (element.hasSystemElement()) {
36466        composeUri("system", element.getSystemElement());
36467      }
36468      if (element.hasVersionElement()) {
36469        composeString("version", element.getVersionElement());
36470      }
36471      if (element.hasConcept()) { 
36472        for (ValueSet.ConceptReferenceComponent e : element.getConcept()) 
36473          composeValueSetConceptReferenceComponent("concept", e);
36474      }
36475      if (element.hasFilter()) { 
36476        for (ValueSet.ConceptSetFilterComponent e : element.getFilter()) 
36477          composeValueSetConceptSetFilterComponent("filter", e);
36478      }
36479      if (element.hasValueSet()) { 
36480        for (UriType e : element.getValueSet()) 
36481          composeUri("valueSet", e);
36482      }
36483  }
36484
36485  protected void composeValueSetConceptReferenceComponent(String name, ValueSet.ConceptReferenceComponent element) throws IOException {
36486    if (element != null) {
36487      composeElementAttributes(element);
36488      xml.enter(FHIR_NS, name);
36489      composeValueSetConceptReferenceComponentElements(element);
36490      composeElementClose(element);
36491      xml.exit(FHIR_NS, name);
36492    }
36493  }
36494
36495  protected void composeValueSetConceptReferenceComponentElements(ValueSet.ConceptReferenceComponent element) throws IOException {
36496      composeBackboneElements(element);
36497      if (element.hasCodeElement()) {
36498        composeCode("code", element.getCodeElement());
36499      }
36500      if (element.hasDisplayElement()) {
36501        composeString("display", element.getDisplayElement());
36502      }
36503      if (element.hasDesignation()) { 
36504        for (ValueSet.ConceptReferenceDesignationComponent e : element.getDesignation()) 
36505          composeValueSetConceptReferenceDesignationComponent("designation", e);
36506      }
36507  }
36508
36509  protected void composeValueSetConceptReferenceDesignationComponent(String name, ValueSet.ConceptReferenceDesignationComponent element) throws IOException {
36510    if (element != null) {
36511      composeElementAttributes(element);
36512      xml.enter(FHIR_NS, name);
36513      composeValueSetConceptReferenceDesignationComponentElements(element);
36514      composeElementClose(element);
36515      xml.exit(FHIR_NS, name);
36516    }
36517  }
36518
36519  protected void composeValueSetConceptReferenceDesignationComponentElements(ValueSet.ConceptReferenceDesignationComponent element) throws IOException {
36520      composeBackboneElements(element);
36521      if (element.hasLanguageElement()) {
36522        composeCode("language", element.getLanguageElement());
36523      }
36524      if (element.hasUse()) {
36525        composeCoding("use", element.getUse());
36526      }
36527      if (element.hasValueElement()) {
36528        composeString("value", element.getValueElement());
36529      }
36530  }
36531
36532  protected void composeValueSetConceptSetFilterComponent(String name, ValueSet.ConceptSetFilterComponent element) throws IOException {
36533    if (element != null) {
36534      composeElementAttributes(element);
36535      xml.enter(FHIR_NS, name);
36536      composeValueSetConceptSetFilterComponentElements(element);
36537      composeElementClose(element);
36538      xml.exit(FHIR_NS, name);
36539    }
36540  }
36541
36542  protected void composeValueSetConceptSetFilterComponentElements(ValueSet.ConceptSetFilterComponent element) throws IOException {
36543      composeBackboneElements(element);
36544      if (element.hasPropertyElement()) {
36545        composeCode("property", element.getPropertyElement());
36546      }
36547      if (element.hasOpElement())
36548        composeEnumeration("op", element.getOpElement(), new ValueSet.FilterOperatorEnumFactory());
36549      if (element.hasValueElement()) {
36550        composeCode("value", element.getValueElement());
36551      }
36552  }
36553
36554  protected void composeValueSetValueSetExpansionComponent(String name, ValueSet.ValueSetExpansionComponent element) throws IOException {
36555    if (element != null) {
36556      composeElementAttributes(element);
36557      xml.enter(FHIR_NS, name);
36558      composeValueSetValueSetExpansionComponentElements(element);
36559      composeElementClose(element);
36560      xml.exit(FHIR_NS, name);
36561    }
36562  }
36563
36564  protected void composeValueSetValueSetExpansionComponentElements(ValueSet.ValueSetExpansionComponent element) throws IOException {
36565      composeBackboneElements(element);
36566      if (element.hasIdentifierElement()) {
36567        composeUri("identifier", element.getIdentifierElement());
36568      }
36569      if (element.hasTimestampElement()) {
36570        composeDateTime("timestamp", element.getTimestampElement());
36571      }
36572      if (element.hasTotalElement()) {
36573        composeInteger("total", element.getTotalElement());
36574      }
36575      if (element.hasOffsetElement()) {
36576        composeInteger("offset", element.getOffsetElement());
36577      }
36578      if (element.hasParameter()) { 
36579        for (ValueSet.ValueSetExpansionParameterComponent e : element.getParameter()) 
36580          composeValueSetValueSetExpansionParameterComponent("parameter", e);
36581      }
36582      if (element.hasContains()) { 
36583        for (ValueSet.ValueSetExpansionContainsComponent e : element.getContains()) 
36584          composeValueSetValueSetExpansionContainsComponent("contains", e);
36585      }
36586  }
36587
36588  protected void composeValueSetValueSetExpansionParameterComponent(String name, ValueSet.ValueSetExpansionParameterComponent element) throws IOException {
36589    if (element != null) {
36590      composeElementAttributes(element);
36591      xml.enter(FHIR_NS, name);
36592      composeValueSetValueSetExpansionParameterComponentElements(element);
36593      composeElementClose(element);
36594      xml.exit(FHIR_NS, name);
36595    }
36596  }
36597
36598  protected void composeValueSetValueSetExpansionParameterComponentElements(ValueSet.ValueSetExpansionParameterComponent element) throws IOException {
36599      composeBackboneElements(element);
36600      if (element.hasNameElement()) {
36601        composeString("name", element.getNameElement());
36602      }
36603      if (element.hasValue()) {
36604        composeType("value", element.getValue());
36605      }  }
36606
36607  protected void composeValueSetValueSetExpansionContainsComponent(String name, ValueSet.ValueSetExpansionContainsComponent element) throws IOException {
36608    if (element != null) {
36609      composeElementAttributes(element);
36610      xml.enter(FHIR_NS, name);
36611      composeValueSetValueSetExpansionContainsComponentElements(element);
36612      composeElementClose(element);
36613      xml.exit(FHIR_NS, name);
36614    }
36615  }
36616
36617  protected void composeValueSetValueSetExpansionContainsComponentElements(ValueSet.ValueSetExpansionContainsComponent element) throws IOException {
36618      composeBackboneElements(element);
36619      if (element.hasSystemElement()) {
36620        composeUri("system", element.getSystemElement());
36621      }
36622      if (element.hasAbstractElement()) {
36623        composeBoolean("abstract", element.getAbstractElement());
36624      }
36625      if (element.hasInactiveElement()) {
36626        composeBoolean("inactive", element.getInactiveElement());
36627      }
36628      if (element.hasVersionElement()) {
36629        composeString("version", element.getVersionElement());
36630      }
36631      if (element.hasCodeElement()) {
36632        composeCode("code", element.getCodeElement());
36633      }
36634      if (element.hasDisplayElement()) {
36635        composeString("display", element.getDisplayElement());
36636      }
36637      if (element.hasDesignation()) { 
36638        for (ValueSet.ConceptReferenceDesignationComponent e : element.getDesignation()) 
36639          composeValueSetConceptReferenceDesignationComponent("designation", e);
36640      }
36641      if (element.hasContains()) { 
36642        for (ValueSet.ValueSetExpansionContainsComponent e : element.getContains()) 
36643          composeValueSetValueSetExpansionContainsComponent("contains", e);
36644      }
36645  }
36646
36647  protected void composeVisionPrescription(String name, VisionPrescription element) throws IOException {
36648    if (element != null) {
36649      composeDomainResourceAttributes(element);
36650      xml.enter(FHIR_NS, name);
36651      composeVisionPrescriptionElements(element);
36652      composeElementClose(element);
36653      xml.exit(FHIR_NS, name);
36654    }
36655  }
36656
36657  protected void composeVisionPrescriptionElements(VisionPrescription element) throws IOException {
36658      composeDomainResourceElements(element);
36659      if (element.hasIdentifier()) { 
36660        for (Identifier e : element.getIdentifier()) 
36661          composeIdentifier("identifier", e);
36662      }
36663      if (element.hasStatusElement())
36664        composeEnumeration("status", element.getStatusElement(), new VisionPrescription.VisionStatusEnumFactory());
36665      if (element.hasPatient()) {
36666        composeReference("patient", element.getPatient());
36667      }
36668      if (element.hasEncounter()) {
36669        composeReference("encounter", element.getEncounter());
36670      }
36671      if (element.hasDateWrittenElement()) {
36672        composeDateTime("dateWritten", element.getDateWrittenElement());
36673      }
36674      if (element.hasPrescriber()) {
36675        composeReference("prescriber", element.getPrescriber());
36676      }
36677      if (element.hasReason()) {
36678        composeType("reason", element.getReason());
36679      }      if (element.hasDispense()) { 
36680        for (VisionPrescription.VisionPrescriptionDispenseComponent e : element.getDispense()) 
36681          composeVisionPrescriptionVisionPrescriptionDispenseComponent("dispense", e);
36682      }
36683  }
36684
36685  protected void composeVisionPrescriptionVisionPrescriptionDispenseComponent(String name, VisionPrescription.VisionPrescriptionDispenseComponent element) throws IOException {
36686    if (element != null) {
36687      composeElementAttributes(element);
36688      xml.enter(FHIR_NS, name);
36689      composeVisionPrescriptionVisionPrescriptionDispenseComponentElements(element);
36690      composeElementClose(element);
36691      xml.exit(FHIR_NS, name);
36692    }
36693  }
36694
36695  protected void composeVisionPrescriptionVisionPrescriptionDispenseComponentElements(VisionPrescription.VisionPrescriptionDispenseComponent element) throws IOException {
36696      composeBackboneElements(element);
36697      if (element.hasProduct()) {
36698        composeCodeableConcept("product", element.getProduct());
36699      }
36700      if (element.hasEyeElement())
36701        composeEnumeration("eye", element.getEyeElement(), new VisionPrescription.VisionEyesEnumFactory());
36702      if (element.hasSphereElement()) {
36703        composeDecimal("sphere", element.getSphereElement());
36704      }
36705      if (element.hasCylinderElement()) {
36706        composeDecimal("cylinder", element.getCylinderElement());
36707      }
36708      if (element.hasAxisElement()) {
36709        composeInteger("axis", element.getAxisElement());
36710      }
36711      if (element.hasPrismElement()) {
36712        composeDecimal("prism", element.getPrismElement());
36713      }
36714      if (element.hasBaseElement())
36715        composeEnumeration("base", element.getBaseElement(), new VisionPrescription.VisionBaseEnumFactory());
36716      if (element.hasAddElement()) {
36717        composeDecimal("add", element.getAddElement());
36718      }
36719      if (element.hasPowerElement()) {
36720        composeDecimal("power", element.getPowerElement());
36721      }
36722      if (element.hasBackCurveElement()) {
36723        composeDecimal("backCurve", element.getBackCurveElement());
36724      }
36725      if (element.hasDiameterElement()) {
36726        composeDecimal("diameter", element.getDiameterElement());
36727      }
36728      if (element.hasDuration()) {
36729        composeSimpleQuantity("duration", element.getDuration());
36730      }
36731      if (element.hasColorElement()) {
36732        composeString("color", element.getColorElement());
36733      }
36734      if (element.hasBrandElement()) {
36735        composeString("brand", element.getBrandElement());
36736      }
36737      if (element.hasNote()) { 
36738        for (Annotation e : element.getNote()) 
36739          composeAnnotation("note", e);
36740      }
36741  }
36742
36743  @Override
36744  protected void composeResource(Resource resource) throws IOException {
36745    if (resource instanceof Parameters)
36746      composeParameters("Parameters", (Parameters)resource);
36747    else if (resource instanceof Account)
36748      composeAccount("Account", (Account)resource);
36749    else if (resource instanceof ActivityDefinition)
36750      composeActivityDefinition("ActivityDefinition", (ActivityDefinition)resource);
36751    else if (resource instanceof AdverseEvent)
36752      composeAdverseEvent("AdverseEvent", (AdverseEvent)resource);
36753    else if (resource instanceof AllergyIntolerance)
36754      composeAllergyIntolerance("AllergyIntolerance", (AllergyIntolerance)resource);
36755    else if (resource instanceof Appointment)
36756      composeAppointment("Appointment", (Appointment)resource);
36757    else if (resource instanceof AppointmentResponse)
36758      composeAppointmentResponse("AppointmentResponse", (AppointmentResponse)resource);
36759    else if (resource instanceof AuditEvent)
36760      composeAuditEvent("AuditEvent", (AuditEvent)resource);
36761    else if (resource instanceof Basic)
36762      composeBasic("Basic", (Basic)resource);
36763    else if (resource instanceof Binary)
36764      composeBinary("Binary", (Binary)resource);
36765    else if (resource instanceof BodySite)
36766      composeBodySite("BodySite", (BodySite)resource);
36767    else if (resource instanceof Bundle)
36768      composeBundle("Bundle", (Bundle)resource);
36769    else if (resource instanceof CapabilityStatement)
36770      composeCapabilityStatement("CapabilityStatement", (CapabilityStatement)resource);
36771    else if (resource instanceof CarePlan)
36772      composeCarePlan("CarePlan", (CarePlan)resource);
36773    else if (resource instanceof CareTeam)
36774      composeCareTeam("CareTeam", (CareTeam)resource);
36775    else if (resource instanceof ChargeItem)
36776      composeChargeItem("ChargeItem", (ChargeItem)resource);
36777    else if (resource instanceof Claim)
36778      composeClaim("Claim", (Claim)resource);
36779    else if (resource instanceof ClaimResponse)
36780      composeClaimResponse("ClaimResponse", (ClaimResponse)resource);
36781    else if (resource instanceof ClinicalImpression)
36782      composeClinicalImpression("ClinicalImpression", (ClinicalImpression)resource);
36783    else if (resource instanceof CodeSystem)
36784      composeCodeSystem("CodeSystem", (CodeSystem)resource);
36785    else if (resource instanceof Communication)
36786      composeCommunication("Communication", (Communication)resource);
36787    else if (resource instanceof CommunicationRequest)
36788      composeCommunicationRequest("CommunicationRequest", (CommunicationRequest)resource);
36789    else if (resource instanceof CompartmentDefinition)
36790      composeCompartmentDefinition("CompartmentDefinition", (CompartmentDefinition)resource);
36791    else if (resource instanceof Composition)
36792      composeComposition("Composition", (Composition)resource);
36793    else if (resource instanceof ConceptMap)
36794      composeConceptMap("ConceptMap", (ConceptMap)resource);
36795    else if (resource instanceof Condition)
36796      composeCondition("Condition", (Condition)resource);
36797    else if (resource instanceof Consent)
36798      composeConsent("Consent", (Consent)resource);
36799    else if (resource instanceof Contract)
36800      composeContract("Contract", (Contract)resource);
36801    else if (resource instanceof Coverage)
36802      composeCoverage("Coverage", (Coverage)resource);
36803    else if (resource instanceof DataElement)
36804      composeDataElement("DataElement", (DataElement)resource);
36805    else if (resource instanceof DetectedIssue)
36806      composeDetectedIssue("DetectedIssue", (DetectedIssue)resource);
36807    else if (resource instanceof Device)
36808      composeDevice("Device", (Device)resource);
36809    else if (resource instanceof DeviceComponent)
36810      composeDeviceComponent("DeviceComponent", (DeviceComponent)resource);
36811    else if (resource instanceof DeviceMetric)
36812      composeDeviceMetric("DeviceMetric", (DeviceMetric)resource);
36813    else if (resource instanceof DeviceRequest)
36814      composeDeviceRequest("DeviceRequest", (DeviceRequest)resource);
36815    else if (resource instanceof DeviceUseStatement)
36816      composeDeviceUseStatement("DeviceUseStatement", (DeviceUseStatement)resource);
36817    else if (resource instanceof DiagnosticReport)
36818      composeDiagnosticReport("DiagnosticReport", (DiagnosticReport)resource);
36819    else if (resource instanceof DocumentManifest)
36820      composeDocumentManifest("DocumentManifest", (DocumentManifest)resource);
36821    else if (resource instanceof DocumentReference)
36822      composeDocumentReference("DocumentReference", (DocumentReference)resource);
36823    else if (resource instanceof EligibilityRequest)
36824      composeEligibilityRequest("EligibilityRequest", (EligibilityRequest)resource);
36825    else if (resource instanceof EligibilityResponse)
36826      composeEligibilityResponse("EligibilityResponse", (EligibilityResponse)resource);
36827    else if (resource instanceof Encounter)
36828      composeEncounter("Encounter", (Encounter)resource);
36829    else if (resource instanceof Endpoint)
36830      composeEndpoint("Endpoint", (Endpoint)resource);
36831    else if (resource instanceof EnrollmentRequest)
36832      composeEnrollmentRequest("EnrollmentRequest", (EnrollmentRequest)resource);
36833    else if (resource instanceof EnrollmentResponse)
36834      composeEnrollmentResponse("EnrollmentResponse", (EnrollmentResponse)resource);
36835    else if (resource instanceof EpisodeOfCare)
36836      composeEpisodeOfCare("EpisodeOfCare", (EpisodeOfCare)resource);
36837    else if (resource instanceof ExpansionProfile)
36838      composeExpansionProfile("ExpansionProfile", (ExpansionProfile)resource);
36839    else if (resource instanceof ExplanationOfBenefit)
36840      composeExplanationOfBenefit("ExplanationOfBenefit", (ExplanationOfBenefit)resource);
36841    else if (resource instanceof FamilyMemberHistory)
36842      composeFamilyMemberHistory("FamilyMemberHistory", (FamilyMemberHistory)resource);
36843    else if (resource instanceof Flag)
36844      composeFlag("Flag", (Flag)resource);
36845    else if (resource instanceof Goal)
36846      composeGoal("Goal", (Goal)resource);
36847    else if (resource instanceof GraphDefinition)
36848      composeGraphDefinition("GraphDefinition", (GraphDefinition)resource);
36849    else if (resource instanceof Group)
36850      composeGroup("Group", (Group)resource);
36851    else if (resource instanceof GuidanceResponse)
36852      composeGuidanceResponse("GuidanceResponse", (GuidanceResponse)resource);
36853    else if (resource instanceof HealthcareService)
36854      composeHealthcareService("HealthcareService", (HealthcareService)resource);
36855    else if (resource instanceof ImagingManifest)
36856      composeImagingManifest("ImagingManifest", (ImagingManifest)resource);
36857    else if (resource instanceof ImagingStudy)
36858      composeImagingStudy("ImagingStudy", (ImagingStudy)resource);
36859    else if (resource instanceof Immunization)
36860      composeImmunization("Immunization", (Immunization)resource);
36861    else if (resource instanceof ImmunizationRecommendation)
36862      composeImmunizationRecommendation("ImmunizationRecommendation", (ImmunizationRecommendation)resource);
36863    else if (resource instanceof ImplementationGuide)
36864      composeImplementationGuide("ImplementationGuide", (ImplementationGuide)resource);
36865    else if (resource instanceof Library)
36866      composeLibrary("Library", (Library)resource);
36867    else if (resource instanceof Linkage)
36868      composeLinkage("Linkage", (Linkage)resource);
36869    else if (resource instanceof ListResource)
36870      composeListResource("List", (ListResource)resource);
36871    else if (resource instanceof Location)
36872      composeLocation("Location", (Location)resource);
36873    else if (resource instanceof Measure)
36874      composeMeasure("Measure", (Measure)resource);
36875    else if (resource instanceof MeasureReport)
36876      composeMeasureReport("MeasureReport", (MeasureReport)resource);
36877    else if (resource instanceof Media)
36878      composeMedia("Media", (Media)resource);
36879    else if (resource instanceof Medication)
36880      composeMedication("Medication", (Medication)resource);
36881    else if (resource instanceof MedicationAdministration)
36882      composeMedicationAdministration("MedicationAdministration", (MedicationAdministration)resource);
36883    else if (resource instanceof MedicationDispense)
36884      composeMedicationDispense("MedicationDispense", (MedicationDispense)resource);
36885    else if (resource instanceof MedicationRequest)
36886      composeMedicationRequest("MedicationRequest", (MedicationRequest)resource);
36887    else if (resource instanceof MedicationStatement)
36888      composeMedicationStatement("MedicationStatement", (MedicationStatement)resource);
36889    else if (resource instanceof MessageDefinition)
36890      composeMessageDefinition("MessageDefinition", (MessageDefinition)resource);
36891    else if (resource instanceof MessageHeader)
36892      composeMessageHeader("MessageHeader", (MessageHeader)resource);
36893    else if (resource instanceof NamingSystem)
36894      composeNamingSystem("NamingSystem", (NamingSystem)resource);
36895    else if (resource instanceof NutritionOrder)
36896      composeNutritionOrder("NutritionOrder", (NutritionOrder)resource);
36897    else if (resource instanceof Observation)
36898      composeObservation("Observation", (Observation)resource);
36899    else if (resource instanceof OperationDefinition)
36900      composeOperationDefinition("OperationDefinition", (OperationDefinition)resource);
36901    else if (resource instanceof OperationOutcome)
36902      composeOperationOutcome("OperationOutcome", (OperationOutcome)resource);
36903    else if (resource instanceof Organization)
36904      composeOrganization("Organization", (Organization)resource);
36905    else if (resource instanceof Patient)
36906      composePatient("Patient", (Patient)resource);
36907    else if (resource instanceof PaymentNotice)
36908      composePaymentNotice("PaymentNotice", (PaymentNotice)resource);
36909    else if (resource instanceof PaymentReconciliation)
36910      composePaymentReconciliation("PaymentReconciliation", (PaymentReconciliation)resource);
36911    else if (resource instanceof Person)
36912      composePerson("Person", (Person)resource);
36913    else if (resource instanceof PlanDefinition)
36914      composePlanDefinition("PlanDefinition", (PlanDefinition)resource);
36915    else if (resource instanceof Practitioner)
36916      composePractitioner("Practitioner", (Practitioner)resource);
36917    else if (resource instanceof PractitionerRole)
36918      composePractitionerRole("PractitionerRole", (PractitionerRole)resource);
36919    else if (resource instanceof Procedure)
36920      composeProcedure("Procedure", (Procedure)resource);
36921    else if (resource instanceof ProcedureRequest)
36922      composeProcedureRequest("ProcedureRequest", (ProcedureRequest)resource);
36923    else if (resource instanceof ProcessRequest)
36924      composeProcessRequest("ProcessRequest", (ProcessRequest)resource);
36925    else if (resource instanceof ProcessResponse)
36926      composeProcessResponse("ProcessResponse", (ProcessResponse)resource);
36927    else if (resource instanceof Provenance)
36928      composeProvenance("Provenance", (Provenance)resource);
36929    else if (resource instanceof Questionnaire)
36930      composeQuestionnaire("Questionnaire", (Questionnaire)resource);
36931    else if (resource instanceof QuestionnaireResponse)
36932      composeQuestionnaireResponse("QuestionnaireResponse", (QuestionnaireResponse)resource);
36933    else if (resource instanceof ReferralRequest)
36934      composeReferralRequest("ReferralRequest", (ReferralRequest)resource);
36935    else if (resource instanceof RelatedPerson)
36936      composeRelatedPerson("RelatedPerson", (RelatedPerson)resource);
36937    else if (resource instanceof RequestGroup)
36938      composeRequestGroup("RequestGroup", (RequestGroup)resource);
36939    else if (resource instanceof ResearchStudy)
36940      composeResearchStudy("ResearchStudy", (ResearchStudy)resource);
36941    else if (resource instanceof ResearchSubject)
36942      composeResearchSubject("ResearchSubject", (ResearchSubject)resource);
36943    else if (resource instanceof RiskAssessment)
36944      composeRiskAssessment("RiskAssessment", (RiskAssessment)resource);
36945    else if (resource instanceof Schedule)
36946      composeSchedule("Schedule", (Schedule)resource);
36947    else if (resource instanceof SearchParameter)
36948      composeSearchParameter("SearchParameter", (SearchParameter)resource);
36949    else if (resource instanceof Sequence)
36950      composeSequence("Sequence", (Sequence)resource);
36951    else if (resource instanceof ServiceDefinition)
36952      composeServiceDefinition("ServiceDefinition", (ServiceDefinition)resource);
36953    else if (resource instanceof Slot)
36954      composeSlot("Slot", (Slot)resource);
36955    else if (resource instanceof Specimen)
36956      composeSpecimen("Specimen", (Specimen)resource);
36957    else if (resource instanceof StructureDefinition)
36958      composeStructureDefinition("StructureDefinition", (StructureDefinition)resource);
36959    else if (resource instanceof StructureMap)
36960      composeStructureMap("StructureMap", (StructureMap)resource);
36961    else if (resource instanceof Subscription)
36962      composeSubscription("Subscription", (Subscription)resource);
36963    else if (resource instanceof Substance)
36964      composeSubstance("Substance", (Substance)resource);
36965    else if (resource instanceof SupplyDelivery)
36966      composeSupplyDelivery("SupplyDelivery", (SupplyDelivery)resource);
36967    else if (resource instanceof SupplyRequest)
36968      composeSupplyRequest("SupplyRequest", (SupplyRequest)resource);
36969    else if (resource instanceof Task)
36970      composeTask("Task", (Task)resource);
36971    else if (resource instanceof TestReport)
36972      composeTestReport("TestReport", (TestReport)resource);
36973    else if (resource instanceof TestScript)
36974      composeTestScript("TestScript", (TestScript)resource);
36975    else if (resource instanceof ValueSet)
36976      composeValueSet("ValueSet", (ValueSet)resource);
36977    else if (resource instanceof VisionPrescription)
36978      composeVisionPrescription("VisionPrescription", (VisionPrescription)resource);
36979    else if (resource instanceof Binary)
36980      composeBinary("Binary", (Binary)resource);
36981    else
36982      throw new Error("Unhandled resource type "+resource.getClass().getName());
36983  }
36984
36985  protected void composeResource(String name, Resource resource) throws IOException {
36986    if (resource instanceof Parameters)
36987      composeParameters(name, (Parameters)resource);
36988    else if (resource instanceof Account)
36989      composeAccount(name, (Account)resource);
36990    else if (resource instanceof ActivityDefinition)
36991      composeActivityDefinition(name, (ActivityDefinition)resource);
36992    else if (resource instanceof AdverseEvent)
36993      composeAdverseEvent(name, (AdverseEvent)resource);
36994    else if (resource instanceof AllergyIntolerance)
36995      composeAllergyIntolerance(name, (AllergyIntolerance)resource);
36996    else if (resource instanceof Appointment)
36997      composeAppointment(name, (Appointment)resource);
36998    else if (resource instanceof AppointmentResponse)
36999      composeAppointmentResponse(name, (AppointmentResponse)resource);
37000    else if (resource instanceof AuditEvent)
37001      composeAuditEvent(name, (AuditEvent)resource);
37002    else if (resource instanceof Basic)
37003      composeBasic(name, (Basic)resource);
37004    else if (resource instanceof Binary)
37005      composeBinary(name, (Binary)resource);
37006    else if (resource instanceof BodySite)
37007      composeBodySite(name, (BodySite)resource);
37008    else if (resource instanceof Bundle)
37009      composeBundle(name, (Bundle)resource);
37010    else if (resource instanceof CapabilityStatement)
37011      composeCapabilityStatement(name, (CapabilityStatement)resource);
37012    else if (resource instanceof CarePlan)
37013      composeCarePlan(name, (CarePlan)resource);
37014    else if (resource instanceof CareTeam)
37015      composeCareTeam(name, (CareTeam)resource);
37016    else if (resource instanceof ChargeItem)
37017      composeChargeItem(name, (ChargeItem)resource);
37018    else if (resource instanceof Claim)
37019      composeClaim(name, (Claim)resource);
37020    else if (resource instanceof ClaimResponse)
37021      composeClaimResponse(name, (ClaimResponse)resource);
37022    else if (resource instanceof ClinicalImpression)
37023      composeClinicalImpression(name, (ClinicalImpression)resource);
37024    else if (resource instanceof CodeSystem)
37025      composeCodeSystem(name, (CodeSystem)resource);
37026    else if (resource instanceof Communication)
37027      composeCommunication(name, (Communication)resource);
37028    else if (resource instanceof CommunicationRequest)
37029      composeCommunicationRequest(name, (CommunicationRequest)resource);
37030    else if (resource instanceof CompartmentDefinition)
37031      composeCompartmentDefinition(name, (CompartmentDefinition)resource);
37032    else if (resource instanceof Composition)
37033      composeComposition(name, (Composition)resource);
37034    else if (resource instanceof ConceptMap)
37035      composeConceptMap(name, (ConceptMap)resource);
37036    else if (resource instanceof Condition)
37037      composeCondition(name, (Condition)resource);
37038    else if (resource instanceof Consent)
37039      composeConsent(name, (Consent)resource);
37040    else if (resource instanceof Contract)
37041      composeContract(name, (Contract)resource);
37042    else if (resource instanceof Coverage)
37043      composeCoverage(name, (Coverage)resource);
37044    else if (resource instanceof DataElement)
37045      composeDataElement(name, (DataElement)resource);
37046    else if (resource instanceof DetectedIssue)
37047      composeDetectedIssue(name, (DetectedIssue)resource);
37048    else if (resource instanceof Device)
37049      composeDevice(name, (Device)resource);
37050    else if (resource instanceof DeviceComponent)
37051      composeDeviceComponent(name, (DeviceComponent)resource);
37052    else if (resource instanceof DeviceMetric)
37053      composeDeviceMetric(name, (DeviceMetric)resource);
37054    else if (resource instanceof DeviceRequest)
37055      composeDeviceRequest(name, (DeviceRequest)resource);
37056    else if (resource instanceof DeviceUseStatement)
37057      composeDeviceUseStatement(name, (DeviceUseStatement)resource);
37058    else if (resource instanceof DiagnosticReport)
37059      composeDiagnosticReport(name, (DiagnosticReport)resource);
37060    else if (resource instanceof DocumentManifest)
37061      composeDocumentManifest(name, (DocumentManifest)resource);
37062    else if (resource instanceof DocumentReference)
37063      composeDocumentReference(name, (DocumentReference)resource);
37064    else if (resource instanceof EligibilityRequest)
37065      composeEligibilityRequest(name, (EligibilityRequest)resource);
37066    else if (resource instanceof EligibilityResponse)
37067      composeEligibilityResponse(name, (EligibilityResponse)resource);
37068    else if (resource instanceof Encounter)
37069      composeEncounter(name, (Encounter)resource);
37070    else if (resource instanceof Endpoint)
37071      composeEndpoint(name, (Endpoint)resource);
37072    else if (resource instanceof EnrollmentRequest)
37073      composeEnrollmentRequest(name, (EnrollmentRequest)resource);
37074    else if (resource instanceof EnrollmentResponse)
37075      composeEnrollmentResponse(name, (EnrollmentResponse)resource);
37076    else if (resource instanceof EpisodeOfCare)
37077      composeEpisodeOfCare(name, (EpisodeOfCare)resource);
37078    else if (resource instanceof ExpansionProfile)
37079      composeExpansionProfile(name, (ExpansionProfile)resource);
37080    else if (resource instanceof ExplanationOfBenefit)
37081      composeExplanationOfBenefit(name, (ExplanationOfBenefit)resource);
37082    else if (resource instanceof FamilyMemberHistory)
37083      composeFamilyMemberHistory(name, (FamilyMemberHistory)resource);
37084    else if (resource instanceof Flag)
37085      composeFlag(name, (Flag)resource);
37086    else if (resource instanceof Goal)
37087      composeGoal(name, (Goal)resource);
37088    else if (resource instanceof GraphDefinition)
37089      composeGraphDefinition(name, (GraphDefinition)resource);
37090    else if (resource instanceof Group)
37091      composeGroup(name, (Group)resource);
37092    else if (resource instanceof GuidanceResponse)
37093      composeGuidanceResponse(name, (GuidanceResponse)resource);
37094    else if (resource instanceof HealthcareService)
37095      composeHealthcareService(name, (HealthcareService)resource);
37096    else if (resource instanceof ImagingManifest)
37097      composeImagingManifest(name, (ImagingManifest)resource);
37098    else if (resource instanceof ImagingStudy)
37099      composeImagingStudy(name, (ImagingStudy)resource);
37100    else if (resource instanceof Immunization)
37101      composeImmunization(name, (Immunization)resource);
37102    else if (resource instanceof ImmunizationRecommendation)
37103      composeImmunizationRecommendation(name, (ImmunizationRecommendation)resource);
37104    else if (resource instanceof ImplementationGuide)
37105      composeImplementationGuide(name, (ImplementationGuide)resource);
37106    else if (resource instanceof Library)
37107      composeLibrary(name, (Library)resource);
37108    else if (resource instanceof Linkage)
37109      composeLinkage(name, (Linkage)resource);
37110    else if (resource instanceof ListResource)
37111      composeListResource(name, (ListResource)resource);
37112    else if (resource instanceof Location)
37113      composeLocation(name, (Location)resource);
37114    else if (resource instanceof Measure)
37115      composeMeasure(name, (Measure)resource);
37116    else if (resource instanceof MeasureReport)
37117      composeMeasureReport(name, (MeasureReport)resource);
37118    else if (resource instanceof Media)
37119      composeMedia(name, (Media)resource);
37120    else if (resource instanceof Medication)
37121      composeMedication(name, (Medication)resource);
37122    else if (resource instanceof MedicationAdministration)
37123      composeMedicationAdministration(name, (MedicationAdministration)resource);
37124    else if (resource instanceof MedicationDispense)
37125      composeMedicationDispense(name, (MedicationDispense)resource);
37126    else if (resource instanceof MedicationRequest)
37127      composeMedicationRequest(name, (MedicationRequest)resource);
37128    else if (resource instanceof MedicationStatement)
37129      composeMedicationStatement(name, (MedicationStatement)resource);
37130    else if (resource instanceof MessageDefinition)
37131      composeMessageDefinition(name, (MessageDefinition)resource);
37132    else if (resource instanceof MessageHeader)
37133      composeMessageHeader(name, (MessageHeader)resource);
37134    else if (resource instanceof NamingSystem)
37135      composeNamingSystem(name, (NamingSystem)resource);
37136    else if (resource instanceof NutritionOrder)
37137      composeNutritionOrder(name, (NutritionOrder)resource);
37138    else if (resource instanceof Observation)
37139      composeObservation(name, (Observation)resource);
37140    else if (resource instanceof OperationDefinition)
37141      composeOperationDefinition(name, (OperationDefinition)resource);
37142    else if (resource instanceof OperationOutcome)
37143      composeOperationOutcome(name, (OperationOutcome)resource);
37144    else if (resource instanceof Organization)
37145      composeOrganization(name, (Organization)resource);
37146    else if (resource instanceof Patient)
37147      composePatient(name, (Patient)resource);
37148    else if (resource instanceof PaymentNotice)
37149      composePaymentNotice(name, (PaymentNotice)resource);
37150    else if (resource instanceof PaymentReconciliation)
37151      composePaymentReconciliation(name, (PaymentReconciliation)resource);
37152    else if (resource instanceof Person)
37153      composePerson(name, (Person)resource);
37154    else if (resource instanceof PlanDefinition)
37155      composePlanDefinition(name, (PlanDefinition)resource);
37156    else if (resource instanceof Practitioner)
37157      composePractitioner(name, (Practitioner)resource);
37158    else if (resource instanceof PractitionerRole)
37159      composePractitionerRole(name, (PractitionerRole)resource);
37160    else if (resource instanceof Procedure)
37161      composeProcedure(name, (Procedure)resource);
37162    else if (resource instanceof ProcedureRequest)
37163      composeProcedureRequest(name, (ProcedureRequest)resource);
37164    else if (resource instanceof ProcessRequest)
37165      composeProcessRequest(name, (ProcessRequest)resource);
37166    else if (resource instanceof ProcessResponse)
37167      composeProcessResponse(name, (ProcessResponse)resource);
37168    else if (resource instanceof Provenance)
37169      composeProvenance(name, (Provenance)resource);
37170    else if (resource instanceof Questionnaire)
37171      composeQuestionnaire(name, (Questionnaire)resource);
37172    else if (resource instanceof QuestionnaireResponse)
37173      composeQuestionnaireResponse(name, (QuestionnaireResponse)resource);
37174    else if (resource instanceof ReferralRequest)
37175      composeReferralRequest(name, (ReferralRequest)resource);
37176    else if (resource instanceof RelatedPerson)
37177      composeRelatedPerson(name, (RelatedPerson)resource);
37178    else if (resource instanceof RequestGroup)
37179      composeRequestGroup(name, (RequestGroup)resource);
37180    else if (resource instanceof ResearchStudy)
37181      composeResearchStudy(name, (ResearchStudy)resource);
37182    else if (resource instanceof ResearchSubject)
37183      composeResearchSubject(name, (ResearchSubject)resource);
37184    else if (resource instanceof RiskAssessment)
37185      composeRiskAssessment(name, (RiskAssessment)resource);
37186    else if (resource instanceof Schedule)
37187      composeSchedule(name, (Schedule)resource);
37188    else if (resource instanceof SearchParameter)
37189      composeSearchParameter(name, (SearchParameter)resource);
37190    else if (resource instanceof Sequence)
37191      composeSequence(name, (Sequence)resource);
37192    else if (resource instanceof ServiceDefinition)
37193      composeServiceDefinition(name, (ServiceDefinition)resource);
37194    else if (resource instanceof Slot)
37195      composeSlot(name, (Slot)resource);
37196    else if (resource instanceof Specimen)
37197      composeSpecimen(name, (Specimen)resource);
37198    else if (resource instanceof StructureDefinition)
37199      composeStructureDefinition(name, (StructureDefinition)resource);
37200    else if (resource instanceof StructureMap)
37201      composeStructureMap(name, (StructureMap)resource);
37202    else if (resource instanceof Subscription)
37203      composeSubscription(name, (Subscription)resource);
37204    else if (resource instanceof Substance)
37205      composeSubstance(name, (Substance)resource);
37206    else if (resource instanceof SupplyDelivery)
37207      composeSupplyDelivery(name, (SupplyDelivery)resource);
37208    else if (resource instanceof SupplyRequest)
37209      composeSupplyRequest(name, (SupplyRequest)resource);
37210    else if (resource instanceof Task)
37211      composeTask(name, (Task)resource);
37212    else if (resource instanceof TestReport)
37213      composeTestReport(name, (TestReport)resource);
37214    else if (resource instanceof TestScript)
37215      composeTestScript(name, (TestScript)resource);
37216    else if (resource instanceof ValueSet)
37217      composeValueSet(name, (ValueSet)resource);
37218    else if (resource instanceof VisionPrescription)
37219      composeVisionPrescription(name, (VisionPrescription)resource);
37220    else if (resource instanceof Binary)
37221      composeBinary(name, (Binary)resource);
37222    else
37223      throw new Error("Unhandled resource type "+resource.getClass().getName());
37224  }
37225
37226  protected void composeType(String prefix, Type type) throws IOException {
37227    if (type == null)
37228      ;
37229    else if (type instanceof SimpleQuantity)
37230       composeSimpleQuantity(prefix+"SimpleQuantity", (SimpleQuantity) type);
37231    else if (type instanceof Duration)
37232       composeDuration(prefix+"Duration", (Duration) type);
37233    else if (type instanceof Count)
37234       composeCount(prefix+"Count", (Count) type);
37235    else if (type instanceof Money)
37236       composeMoney(prefix+"Money", (Money) type);
37237    else if (type instanceof Distance)
37238       composeDistance(prefix+"Distance", (Distance) type);
37239    else if (type instanceof Age)
37240       composeAge(prefix+"Age", (Age) type);
37241    else if (type instanceof Reference)
37242       composeReference(prefix+"Reference", (Reference) type);
37243    else if (type instanceof Quantity)
37244       composeQuantity(prefix+"Quantity", (Quantity) type);
37245    else if (type instanceof Period)
37246       composePeriod(prefix+"Period", (Period) type);
37247    else if (type instanceof Attachment)
37248       composeAttachment(prefix+"Attachment", (Attachment) type);
37249    else if (type instanceof Range)
37250       composeRange(prefix+"Range", (Range) type);
37251    else if (type instanceof Annotation)
37252       composeAnnotation(prefix+"Annotation", (Annotation) type);
37253    else if (type instanceof Identifier)
37254       composeIdentifier(prefix+"Identifier", (Identifier) type);
37255    else if (type instanceof Coding)
37256       composeCoding(prefix+"Coding", (Coding) type);
37257    else if (type instanceof Signature)
37258       composeSignature(prefix+"Signature", (Signature) type);
37259    else if (type instanceof SampledData)
37260       composeSampledData(prefix+"SampledData", (SampledData) type);
37261    else if (type instanceof Ratio)
37262       composeRatio(prefix+"Ratio", (Ratio) type);
37263    else if (type instanceof CodeableConcept)
37264       composeCodeableConcept(prefix+"CodeableConcept", (CodeableConcept) type);
37265    else if (type instanceof Meta)
37266       composeMeta(prefix+"Meta", (Meta) type);
37267    else if (type instanceof Address)
37268       composeAddress(prefix+"Address", (Address) type);
37269    else if (type instanceof TriggerDefinition)
37270       composeTriggerDefinition(prefix+"TriggerDefinition", (TriggerDefinition) type);
37271    else if (type instanceof Contributor)
37272       composeContributor(prefix+"Contributor", (Contributor) type);
37273    else if (type instanceof DataRequirement)
37274       composeDataRequirement(prefix+"DataRequirement", (DataRequirement) type);
37275    else if (type instanceof Dosage)
37276       composeDosage(prefix+"Dosage", (Dosage) type);
37277    else if (type instanceof RelatedArtifact)
37278       composeRelatedArtifact(prefix+"RelatedArtifact", (RelatedArtifact) type);
37279    else if (type instanceof ContactDetail)
37280       composeContactDetail(prefix+"ContactDetail", (ContactDetail) type);
37281    else if (type instanceof HumanName)
37282       composeHumanName(prefix+"HumanName", (HumanName) type);
37283    else if (type instanceof ContactPoint)
37284       composeContactPoint(prefix+"ContactPoint", (ContactPoint) type);
37285    else if (type instanceof UsageContext)
37286       composeUsageContext(prefix+"UsageContext", (UsageContext) type);
37287    else if (type instanceof Timing)
37288       composeTiming(prefix+"Timing", (Timing) type);
37289    else if (type instanceof ElementDefinition)
37290       composeElementDefinition(prefix+"ElementDefinition", (ElementDefinition) type);
37291    else if (type instanceof ParameterDefinition)
37292       composeParameterDefinition(prefix+"ParameterDefinition", (ParameterDefinition) type);
37293    else if (type instanceof CodeType)
37294       composeCode(prefix+"Code", (CodeType) type);
37295    else if (type instanceof OidType)
37296       composeOid(prefix+"Oid", (OidType) type);
37297    else if (type instanceof UuidType)
37298       composeUuid(prefix+"Uuid", (UuidType) type);
37299    else if (type instanceof UnsignedIntType)
37300       composeUnsignedInt(prefix+"UnsignedInt", (UnsignedIntType) type);
37301    else if (type instanceof MarkdownType)
37302       composeMarkdown(prefix+"Markdown", (MarkdownType) type);
37303    else if (type instanceof IdType)
37304       composeId(prefix+"Id", (IdType) type);
37305    else if (type instanceof PositiveIntType)
37306       composePositiveInt(prefix+"PositiveInt", (PositiveIntType) type);
37307    else if (type instanceof DateType)
37308       composeDate(prefix+"Date", (DateType) type);
37309    else if (type instanceof DateTimeType)
37310       composeDateTime(prefix+"DateTime", (DateTimeType) type);
37311    else if (type instanceof StringType)
37312       composeString(prefix+"String", (StringType) type);
37313    else if (type instanceof IntegerType)
37314       composeInteger(prefix+"Integer", (IntegerType) type);
37315    else if (type instanceof UriType)
37316       composeUri(prefix+"Uri", (UriType) type);
37317    else if (type instanceof InstantType)
37318       composeInstant(prefix+"Instant", (InstantType) type);
37319    else if (type instanceof BooleanType)
37320       composeBoolean(prefix+"Boolean", (BooleanType) type);
37321    else if (type instanceof Base64BinaryType)
37322       composeBase64Binary(prefix+"Base64Binary", (Base64BinaryType) type);
37323    else if (type instanceof TimeType)
37324       composeTime(prefix+"Time", (TimeType) type);
37325    else if (type instanceof DecimalType)
37326       composeDecimal(prefix+"Decimal", (DecimalType) type);
37327    else
37328      throw new Error("Unhandled type");
37329  }
37330
37331}