001package org.hl7.fhir.dstu3.formats;
002
003import java.io.IOException;
004
005
006
007/*
008  Copyright (c) 2011+, HL7, Inc.
009  All rights reserved.
010  
011  Redistribution and use in source and binary forms, with or without modification, 
012  are permitted provided that the following conditions are met:
013  
014   * Redistributions of source code must retain the above copyright notice, this 
015     list of conditions and the following disclaimer.
016   * Redistributions in binary form must reproduce the above copyright notice, 
017     this list of conditions and the following disclaimer in the documentation 
018     and/or other materials provided with the distribution.
019   * Neither the name of HL7 nor the names of its contributors may be used to 
020     endorse or promote products derived from this software without specific 
021     prior written permission.
022  
023  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
024  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
025  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
026  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
027  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
028  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
029  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
030  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
031  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
032  POSSIBILITY OF SUCH DAMAGE.
033  
034*/
035
036// Generated on Mon, Apr 17, 2017 08:38+1000 for FHIR v3.0.x
037import org.hl7.fhir.dstu3.model.*;
038import org.hl7.fhir.exceptions.FHIRFormatError;
039import org.hl7.fhir.utilities.Utilities;
040import org.xmlpull.v1.XmlPullParser;
041import org.xmlpull.v1.XmlPullParserException;
042
043public class XmlParser extends XmlParserBase {
044
045  public XmlParser() {
046    super();
047  }
048
049  public XmlParser(boolean allowUnknownContent) {
050    super();
051    setAllowUnknownContent(allowUnknownContent);
052  }
053
054
055  protected boolean parseElementContent(int eventType, XmlPullParser xpp, Element res) throws XmlPullParserException, IOException, FHIRFormatError {
056    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("extension")) 
057      res.getExtension().add(parseExtension(xpp));
058    else
059      return false;
060      
061    return true;
062  }
063
064  protected boolean parseBackboneContent(int eventType, XmlPullParser xpp, BackboneElement res) throws XmlPullParserException, IOException, FHIRFormatError {
065    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifierExtension")) 
066      res.getModifierExtension().add(parseExtension(xpp));
067    else
068      return parseElementContent(eventType, xpp, res);
069      
070    return true;
071  }
072
073  @SuppressWarnings("unchecked")
074  protected <E extends Enum<E>> Enumeration<E> parseEnumeration(XmlPullParser xpp, E item, EnumFactory e) throws XmlPullParserException, IOException, FHIRFormatError {
075    Enumeration<E> res = new Enumeration<E>(e);
076    parseElementAttributes(xpp, res);
077    res.setValue((E) e.fromCode(xpp.getAttributeValue(null, "value")));
078    next(xpp);
079    int eventType = nextNoWhitespace(xpp);
080    while (eventType != XmlPullParser.END_TAG) {
081      if (!parseElementContent(eventType, xpp, res))
082        unknownContent(xpp);
083      eventType = nextNoWhitespace(xpp);
084    }
085    next(xpp);
086    parseElementClose(res);
087    return res;
088  }
089
090  protected DateType parseDate(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
091    DateType res = new DateType(xpp.getAttributeValue(null, "value"));
092    parseElementAttributes(xpp, res);
093    next(xpp);
094    int eventType = nextNoWhitespace(xpp);
095    while (eventType != XmlPullParser.END_TAG) {
096      if (!parseElementContent(eventType, xpp, res))
097        unknownContent(xpp);
098      eventType = nextNoWhitespace(xpp);
099    }
100    next(xpp);
101    parseElementClose(res);
102    return res;
103  }
104
105  protected DateTimeType parseDateTime(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
106    DateTimeType res = new DateTimeType(xpp.getAttributeValue(null, "value"));
107    parseElementAttributes(xpp, res);
108    next(xpp);
109    int eventType = nextNoWhitespace(xpp);
110    while (eventType != XmlPullParser.END_TAG) {
111      if (!parseElementContent(eventType, xpp, res))
112        unknownContent(xpp);
113      eventType = nextNoWhitespace(xpp);
114    }
115    next(xpp);
116    parseElementClose(res);
117    return res;
118  }
119
120  protected CodeType parseCode(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
121    CodeType res = new CodeType(xpp.getAttributeValue(null, "value"));
122    parseElementAttributes(xpp, res);
123    next(xpp);
124    int eventType = nextNoWhitespace(xpp);
125    while (eventType != XmlPullParser.END_TAG) {
126      if (!parseElementContent(eventType, xpp, res))
127        unknownContent(xpp);
128      eventType = nextNoWhitespace(xpp);
129    }
130    next(xpp);
131    parseElementClose(res);
132    return res;
133  }
134
135  protected StringType parseString(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
136    StringType res = new StringType(xpp.getAttributeValue(null, "value"));
137    parseElementAttributes(xpp, res);
138    next(xpp);
139    int eventType = nextNoWhitespace(xpp);
140    while (eventType != XmlPullParser.END_TAG) {
141      if (!parseElementContent(eventType, xpp, res))
142        unknownContent(xpp);
143      eventType = nextNoWhitespace(xpp);
144    }
145    next(xpp);
146    parseElementClose(res);
147    return res;
148  }
149
150  protected IntegerType parseInteger(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
151    IntegerType res = new IntegerType(xpp.getAttributeValue(null, "value"));
152    parseElementAttributes(xpp, res);
153    next(xpp);
154    int eventType = nextNoWhitespace(xpp);
155    while (eventType != XmlPullParser.END_TAG) {
156      if (!parseElementContent(eventType, xpp, res))
157        unknownContent(xpp);
158      eventType = nextNoWhitespace(xpp);
159    }
160    next(xpp);
161    parseElementClose(res);
162    return res;
163  }
164
165  protected OidType parseOid(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
166    OidType res = new OidType(xpp.getAttributeValue(null, "value"));
167    parseElementAttributes(xpp, res);
168    next(xpp);
169    int eventType = nextNoWhitespace(xpp);
170    while (eventType != XmlPullParser.END_TAG) {
171      if (!parseElementContent(eventType, xpp, res))
172        unknownContent(xpp);
173      eventType = nextNoWhitespace(xpp);
174    }
175    next(xpp);
176    parseElementClose(res);
177    return res;
178  }
179
180  protected UriType parseUri(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
181    UriType res = new UriType(xpp.getAttributeValue(null, "value"));
182    parseElementAttributes(xpp, res);
183    next(xpp);
184    int eventType = nextNoWhitespace(xpp);
185    while (eventType != XmlPullParser.END_TAG) {
186      if (!parseElementContent(eventType, xpp, res))
187        unknownContent(xpp);
188      eventType = nextNoWhitespace(xpp);
189    }
190    next(xpp);
191    parseElementClose(res);
192    return res;
193  }
194
195  protected UuidType parseUuid(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
196    UuidType res = new UuidType(xpp.getAttributeValue(null, "value"));
197    parseElementAttributes(xpp, res);
198    next(xpp);
199    int eventType = nextNoWhitespace(xpp);
200    while (eventType != XmlPullParser.END_TAG) {
201      if (!parseElementContent(eventType, xpp, res))
202        unknownContent(xpp);
203      eventType = nextNoWhitespace(xpp);
204    }
205    next(xpp);
206    parseElementClose(res);
207    return res;
208  }
209
210  protected InstantType parseInstant(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
211    InstantType res = new InstantType(xpp.getAttributeValue(null, "value"));
212    parseElementAttributes(xpp, res);
213    next(xpp);
214    int eventType = nextNoWhitespace(xpp);
215    while (eventType != XmlPullParser.END_TAG) {
216      if (!parseElementContent(eventType, xpp, res))
217        unknownContent(xpp);
218      eventType = nextNoWhitespace(xpp);
219    }
220    next(xpp);
221    parseElementClose(res);
222    return res;
223  }
224
225  protected BooleanType parseBoolean(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
226    BooleanType res = new BooleanType(xpp.getAttributeValue(null, "value"));
227    parseElementAttributes(xpp, res);
228    next(xpp);
229    int eventType = nextNoWhitespace(xpp);
230    while (eventType != XmlPullParser.END_TAG) {
231      if (!parseElementContent(eventType, xpp, res))
232        unknownContent(xpp);
233      eventType = nextNoWhitespace(xpp);
234    }
235    next(xpp);
236    parseElementClose(res);
237    return res;
238  }
239
240  protected Base64BinaryType parseBase64Binary(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
241    Base64BinaryType res = new Base64BinaryType(xpp.getAttributeValue(null, "value"));
242    parseElementAttributes(xpp, res);
243    next(xpp);
244    int eventType = nextNoWhitespace(xpp);
245    while (eventType != XmlPullParser.END_TAG) {
246      if (!parseElementContent(eventType, xpp, res))
247        unknownContent(xpp);
248      eventType = nextNoWhitespace(xpp);
249    }
250    next(xpp);
251    parseElementClose(res);
252    return res;
253  }
254
255  protected UnsignedIntType parseUnsignedInt(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
256    UnsignedIntType res = new UnsignedIntType(xpp.getAttributeValue(null, "value"));
257    parseElementAttributes(xpp, res);
258    next(xpp);
259    int eventType = nextNoWhitespace(xpp);
260    while (eventType != XmlPullParser.END_TAG) {
261      if (!parseElementContent(eventType, xpp, res))
262        unknownContent(xpp);
263      eventType = nextNoWhitespace(xpp);
264    }
265    next(xpp);
266    parseElementClose(res);
267    return res;
268  }
269
270  protected MarkdownType parseMarkdown(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
271    MarkdownType res = new MarkdownType(xpp.getAttributeValue(null, "value"));
272    parseElementAttributes(xpp, res);
273    next(xpp);
274    int eventType = nextNoWhitespace(xpp);
275    while (eventType != XmlPullParser.END_TAG) {
276      if (!parseElementContent(eventType, xpp, res))
277        unknownContent(xpp);
278      eventType = nextNoWhitespace(xpp);
279    }
280    next(xpp);
281    parseElementClose(res);
282    return res;
283  }
284
285  protected TimeType parseTime(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
286    TimeType res = new TimeType(xpp.getAttributeValue(null, "value"));
287    parseElementAttributes(xpp, res);
288    next(xpp);
289    int eventType = nextNoWhitespace(xpp);
290    while (eventType != XmlPullParser.END_TAG) {
291      if (!parseElementContent(eventType, xpp, res))
292        unknownContent(xpp);
293      eventType = nextNoWhitespace(xpp);
294    }
295    next(xpp);
296    parseElementClose(res);
297    return res;
298  }
299
300  protected IdType parseId(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
301    IdType res = new IdType(xpp.getAttributeValue(null, "value"));
302    parseElementAttributes(xpp, res);
303    next(xpp);
304    int eventType = nextNoWhitespace(xpp);
305    while (eventType != XmlPullParser.END_TAG) {
306      if (!parseElementContent(eventType, xpp, res))
307        unknownContent(xpp);
308      eventType = nextNoWhitespace(xpp);
309    }
310    next(xpp);
311    parseElementClose(res);
312    return res;
313  }
314
315  protected PositiveIntType parsePositiveInt(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
316    PositiveIntType res = new PositiveIntType(xpp.getAttributeValue(null, "value"));
317    parseElementAttributes(xpp, res);
318    next(xpp);
319    int eventType = nextNoWhitespace(xpp);
320    while (eventType != XmlPullParser.END_TAG) {
321      if (!parseElementContent(eventType, xpp, res))
322        unknownContent(xpp);
323      eventType = nextNoWhitespace(xpp);
324    }
325    next(xpp);
326    parseElementClose(res);
327    return res;
328  }
329
330  protected DecimalType parseDecimal(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
331    DecimalType res = new DecimalType(xpp.getAttributeValue(null, "value"));
332    parseElementAttributes(xpp, res);
333    next(xpp);
334    int eventType = nextNoWhitespace(xpp);
335    while (eventType != XmlPullParser.END_TAG) {
336      if (!parseElementContent(eventType, xpp, res))
337        unknownContent(xpp);
338      eventType = nextNoWhitespace(xpp);
339    }
340    next(xpp);
341    parseElementClose(res);
342    return res;
343  }
344
345  protected Extension parseExtension(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
346    Extension res = new Extension();
347    parseElementAttributes(xpp, res);
348    if (xpp.getAttributeValue(null, "url") != null)
349        res.setUrl(xpp.getAttributeValue(null, "url"));
350    next(xpp);
351    int eventType = nextNoWhitespace(xpp);
352    while (eventType != XmlPullParser.END_TAG) {
353  if (!parseExtensionContent(eventType, xpp, res))
354        unknownContent(xpp);
355      eventType = nextNoWhitespace(xpp);
356    }
357    next(xpp);
358    parseElementClose(res);
359    return res;
360  }
361
362  protected boolean parseExtensionContent(int eventType, XmlPullParser xpp, Extension res) throws XmlPullParserException, IOException, FHIRFormatError {
363      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
364        res.setValue(parseType("value", xpp));
365      } else if (!parseElementContent(eventType, xpp, res))
366        return false;
367    return true;
368  }
369
370  protected Narrative parseNarrative(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
371    Narrative res = new Narrative();
372    parseElementAttributes(xpp, res);
373    next(xpp);
374    int eventType = nextNoWhitespace(xpp);
375    while (eventType != XmlPullParser.END_TAG) {
376  if (!parseNarrativeContent(eventType, xpp, res))
377        unknownContent(xpp);
378      eventType = nextNoWhitespace(xpp);
379    }
380    next(xpp);
381    parseElementClose(res);
382    return res;
383  }
384
385  protected boolean parseNarrativeContent(int eventType, XmlPullParser xpp, Narrative res) throws XmlPullParserException, IOException, FHIRFormatError {
386      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
387        res.setStatusElement(parseEnumeration(xpp, Narrative.NarrativeStatus.NULL, new Narrative.NarrativeStatusEnumFactory()));
388      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("div")) {
389        res.setDiv(parseXhtml(xpp));
390      } else if (!parseElementContent(eventType, xpp, res))
391        return false;
392    return true;
393  }
394
395  protected Reference parseReference(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
396    Reference res = new Reference();
397    parseTypeAttributes(xpp, res);
398    next(xpp);
399    int eventType = nextNoWhitespace(xpp);
400    while (eventType != XmlPullParser.END_TAG) {
401  if (!parseReferenceContent(eventType, xpp, res))
402        unknownContent(xpp);
403      eventType = nextNoWhitespace(xpp);
404    }
405    next(xpp);
406    parseElementClose(res);
407    return res;
408  }
409
410  protected boolean parseReferenceContent(int eventType, XmlPullParser xpp, Reference res) throws XmlPullParserException, IOException, FHIRFormatError {
411      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
412        res.setReferenceElement(parseString(xpp));
413      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
414        res.setIdentifier(parseIdentifier(xpp));
415      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
416        res.setDisplayElement(parseString(xpp));
417      } else if (!parseElementContent(eventType, xpp, res))
418        return false;
419    return true;
420  }
421
422  protected Quantity parseQuantity(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
423    Quantity res = new Quantity();
424    parseTypeAttributes(xpp, res);
425    next(xpp);
426    int eventType = nextNoWhitespace(xpp);
427    while (eventType != XmlPullParser.END_TAG) {
428  if (!parseQuantityContent(eventType, xpp, res))
429        unknownContent(xpp);
430      eventType = nextNoWhitespace(xpp);
431    }
432    next(xpp);
433    parseElementClose(res);
434    return res;
435  }
436
437  protected boolean parseQuantityContent(int eventType, XmlPullParser xpp, Quantity res) throws XmlPullParserException, IOException, FHIRFormatError {
438      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
439        res.setValueElement(parseDecimal(xpp));
440      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comparator")) {
441        res.setComparatorElement(parseEnumeration(xpp, Quantity.QuantityComparator.NULL, new Quantity.QuantityComparatorEnumFactory()));
442      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unit")) {
443        res.setUnitElement(parseString(xpp));
444      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
445        res.setSystemElement(parseUri(xpp));
446      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
447        res.setCodeElement(parseCode(xpp));
448      } else if (!parseElementContent(eventType, xpp, res))
449        return false;
450    return true;
451  }
452
453  protected Period parsePeriod(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
454    Period res = new Period();
455    parseTypeAttributes(xpp, res);
456    next(xpp);
457    int eventType = nextNoWhitespace(xpp);
458    while (eventType != XmlPullParser.END_TAG) {
459  if (!parsePeriodContent(eventType, xpp, res))
460        unknownContent(xpp);
461      eventType = nextNoWhitespace(xpp);
462    }
463    next(xpp);
464    parseElementClose(res);
465    return res;
466  }
467
468  protected boolean parsePeriodContent(int eventType, XmlPullParser xpp, Period res) throws XmlPullParserException, IOException, FHIRFormatError {
469      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("start")) {
470        res.setStartElement(parseDateTime(xpp));
471      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("end")) {
472        res.setEndElement(parseDateTime(xpp));
473      } else if (!parseElementContent(eventType, xpp, res))
474        return false;
475    return true;
476  }
477
478  protected Attachment parseAttachment(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
479    Attachment res = new Attachment();
480    parseTypeAttributes(xpp, res);
481    next(xpp);
482    int eventType = nextNoWhitespace(xpp);
483    while (eventType != XmlPullParser.END_TAG) {
484  if (!parseAttachmentContent(eventType, xpp, res))
485        unknownContent(xpp);
486      eventType = nextNoWhitespace(xpp);
487    }
488    next(xpp);
489    parseElementClose(res);
490    return res;
491  }
492
493  protected boolean parseAttachmentContent(int eventType, XmlPullParser xpp, Attachment res) throws XmlPullParserException, IOException, FHIRFormatError {
494      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contentType")) {
495        res.setContentTypeElement(parseCode(xpp));
496      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
497        res.setLanguageElement(parseCode(xpp));
498      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("data")) {
499        res.setDataElement(parseBase64Binary(xpp));
500      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
501        res.setUrlElement(parseUri(xpp));
502      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("size")) {
503        res.setSizeElement(parseUnsignedInt(xpp));
504      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("hash")) {
505        res.setHashElement(parseBase64Binary(xpp));
506      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
507        res.setTitleElement(parseString(xpp));
508      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("creation")) {
509        res.setCreationElement(parseDateTime(xpp));
510      } else if (!parseElementContent(eventType, xpp, res))
511        return false;
512    return true;
513  }
514
515  protected Duration parseDuration(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
516    Duration res = new Duration();
517    parseTypeAttributes(xpp, res);
518    next(xpp);
519    int eventType = nextNoWhitespace(xpp);
520    while (eventType != XmlPullParser.END_TAG) {
521  if (!parseDurationContent(eventType, xpp, res))
522        unknownContent(xpp);
523      eventType = nextNoWhitespace(xpp);
524    }
525    next(xpp);
526    parseElementClose(res);
527    return res;
528  }
529
530  protected boolean parseDurationContent(int eventType, XmlPullParser xpp, Duration res) throws XmlPullParserException, IOException, FHIRFormatError {
531      if (!parseQuantityContent(eventType, xpp, res))
532        return false;
533    return true;
534  }
535
536  protected Count parseCount(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
537    Count res = new Count();
538    parseTypeAttributes(xpp, res);
539    next(xpp);
540    int eventType = nextNoWhitespace(xpp);
541    while (eventType != XmlPullParser.END_TAG) {
542  if (!parseCountContent(eventType, xpp, res))
543        unknownContent(xpp);
544      eventType = nextNoWhitespace(xpp);
545    }
546    next(xpp);
547    parseElementClose(res);
548    return res;
549  }
550
551  protected boolean parseCountContent(int eventType, XmlPullParser xpp, Count res) throws XmlPullParserException, IOException, FHIRFormatError {
552      if (!parseQuantityContent(eventType, xpp, res))
553        return false;
554    return true;
555  }
556
557  protected Range parseRange(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
558    Range res = new Range();
559    parseTypeAttributes(xpp, res);
560    next(xpp);
561    int eventType = nextNoWhitespace(xpp);
562    while (eventType != XmlPullParser.END_TAG) {
563  if (!parseRangeContent(eventType, xpp, res))
564        unknownContent(xpp);
565      eventType = nextNoWhitespace(xpp);
566    }
567    next(xpp);
568    parseElementClose(res);
569    return res;
570  }
571
572  protected boolean parseRangeContent(int eventType, XmlPullParser xpp, Range res) throws XmlPullParserException, IOException, FHIRFormatError {
573      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("low")) {
574        res.setLow(parseSimpleQuantity(xpp));
575      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("high")) {
576        res.setHigh(parseSimpleQuantity(xpp));
577      } else if (!parseElementContent(eventType, xpp, res))
578        return false;
579    return true;
580  }
581
582  protected Annotation parseAnnotation(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
583    Annotation res = new Annotation();
584    parseTypeAttributes(xpp, res);
585    next(xpp);
586    int eventType = nextNoWhitespace(xpp);
587    while (eventType != XmlPullParser.END_TAG) {
588  if (!parseAnnotationContent(eventType, xpp, res))
589        unknownContent(xpp);
590      eventType = nextNoWhitespace(xpp);
591    }
592    next(xpp);
593    parseElementClose(res);
594    return res;
595  }
596
597  protected boolean parseAnnotationContent(int eventType, XmlPullParser xpp, Annotation res) throws XmlPullParserException, IOException, FHIRFormatError {
598      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "author")) {
599        res.setAuthor(parseType("author", xpp));
600      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("time")) {
601        res.setTimeElement(parseDateTime(xpp));
602      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
603        res.setTextElement(parseString(xpp));
604      } else if (!parseElementContent(eventType, xpp, res))
605        return false;
606    return true;
607  }
608
609  protected Money parseMoney(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
610    Money res = new Money();
611    parseTypeAttributes(xpp, res);
612    next(xpp);
613    int eventType = nextNoWhitespace(xpp);
614    while (eventType != XmlPullParser.END_TAG) {
615  if (!parseMoneyContent(eventType, xpp, res))
616        unknownContent(xpp);
617      eventType = nextNoWhitespace(xpp);
618    }
619    next(xpp);
620    parseElementClose(res);
621    return res;
622  }
623
624  protected boolean parseMoneyContent(int eventType, XmlPullParser xpp, Money res) throws XmlPullParserException, IOException, FHIRFormatError {
625      if (!parseQuantityContent(eventType, xpp, res))
626        return false;
627    return true;
628  }
629
630  protected Identifier parseIdentifier(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
631    Identifier res = new Identifier();
632    parseTypeAttributes(xpp, res);
633    next(xpp);
634    int eventType = nextNoWhitespace(xpp);
635    while (eventType != XmlPullParser.END_TAG) {
636  if (!parseIdentifierContent(eventType, xpp, res))
637        unknownContent(xpp);
638      eventType = nextNoWhitespace(xpp);
639    }
640    next(xpp);
641    parseElementClose(res);
642    return res;
643  }
644
645  protected boolean parseIdentifierContent(int eventType, XmlPullParser xpp, Identifier res) throws XmlPullParserException, IOException, FHIRFormatError {
646      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
647        res.setUseElement(parseEnumeration(xpp, Identifier.IdentifierUse.NULL, new Identifier.IdentifierUseEnumFactory()));
648      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
649        res.setType(parseCodeableConcept(xpp));
650      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
651        res.setSystemElement(parseUri(xpp));
652      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
653        res.setValueElement(parseString(xpp));
654      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
655        res.setPeriod(parsePeriod(xpp));
656      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("assigner")) {
657        res.setAssigner(parseReference(xpp));
658      } else if (!parseElementContent(eventType, xpp, res))
659        return false;
660    return true;
661  }
662
663  protected Coding parseCoding(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
664    Coding res = new Coding();
665    parseTypeAttributes(xpp, res);
666    next(xpp);
667    int eventType = nextNoWhitespace(xpp);
668    while (eventType != XmlPullParser.END_TAG) {
669  if (!parseCodingContent(eventType, xpp, res))
670        unknownContent(xpp);
671      eventType = nextNoWhitespace(xpp);
672    }
673    next(xpp);
674    parseElementClose(res);
675    return res;
676  }
677
678  protected boolean parseCodingContent(int eventType, XmlPullParser xpp, Coding res) throws XmlPullParserException, IOException, FHIRFormatError {
679      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
680        res.setSystemElement(parseUri(xpp));
681      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
682        res.setVersionElement(parseString(xpp));
683      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
684        res.setCodeElement(parseCode(xpp));
685      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
686        res.setDisplayElement(parseString(xpp));
687      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("userSelected")) {
688        res.setUserSelectedElement(parseBoolean(xpp));
689      } else if (!parseElementContent(eventType, xpp, res))
690        return false;
691    return true;
692  }
693
694  protected Signature parseSignature(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
695    Signature res = new Signature();
696    parseTypeAttributes(xpp, res);
697    next(xpp);
698    int eventType = nextNoWhitespace(xpp);
699    while (eventType != XmlPullParser.END_TAG) {
700  if (!parseSignatureContent(eventType, xpp, res))
701        unknownContent(xpp);
702      eventType = nextNoWhitespace(xpp);
703    }
704    next(xpp);
705    parseElementClose(res);
706    return res;
707  }
708
709  protected boolean parseSignatureContent(int eventType, XmlPullParser xpp, Signature res) throws XmlPullParserException, IOException, FHIRFormatError {
710      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
711        res.getType().add(parseCoding(xpp));
712      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("when")) {
713        res.setWhenElement(parseInstant(xpp));
714      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "who")) {
715        res.setWho(parseType("who", xpp));
716      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "onBehalfOf")) {
717        res.setOnBehalfOf(parseType("onBehalfOf", xpp));
718      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contentType")) {
719        res.setContentTypeElement(parseCode(xpp));
720      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("blob")) {
721        res.setBlobElement(parseBase64Binary(xpp));
722      } else if (!parseElementContent(eventType, xpp, res))
723        return false;
724    return true;
725  }
726
727  protected SampledData parseSampledData(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
728    SampledData res = new SampledData();
729    parseTypeAttributes(xpp, res);
730    next(xpp);
731    int eventType = nextNoWhitespace(xpp);
732    while (eventType != XmlPullParser.END_TAG) {
733  if (!parseSampledDataContent(eventType, xpp, res))
734        unknownContent(xpp);
735      eventType = nextNoWhitespace(xpp);
736    }
737    next(xpp);
738    parseElementClose(res);
739    return res;
740  }
741
742  protected boolean parseSampledDataContent(int eventType, XmlPullParser xpp, SampledData res) throws XmlPullParserException, IOException, FHIRFormatError {
743      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("origin")) {
744        res.setOrigin(parseSimpleQuantity(xpp));
745      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
746        res.setPeriodElement(parseDecimal(xpp));
747      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
748        res.setFactorElement(parseDecimal(xpp));
749      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lowerLimit")) {
750        res.setLowerLimitElement(parseDecimal(xpp));
751      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("upperLimit")) {
752        res.setUpperLimitElement(parseDecimal(xpp));
753      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dimensions")) {
754        res.setDimensionsElement(parsePositiveInt(xpp));
755      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("data")) {
756        res.setDataElement(parseString(xpp));
757      } else if (!parseElementContent(eventType, xpp, res))
758        return false;
759    return true;
760  }
761
762  protected Ratio parseRatio(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
763    Ratio res = new Ratio();
764    parseTypeAttributes(xpp, res);
765    next(xpp);
766    int eventType = nextNoWhitespace(xpp);
767    while (eventType != XmlPullParser.END_TAG) {
768  if (!parseRatioContent(eventType, xpp, res))
769        unknownContent(xpp);
770      eventType = nextNoWhitespace(xpp);
771    }
772    next(xpp);
773    parseElementClose(res);
774    return res;
775  }
776
777  protected boolean parseRatioContent(int eventType, XmlPullParser xpp, Ratio res) throws XmlPullParserException, IOException, FHIRFormatError {
778      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("numerator")) {
779        res.setNumerator(parseQuantity(xpp));
780      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("denominator")) {
781        res.setDenominator(parseQuantity(xpp));
782      } else if (!parseElementContent(eventType, xpp, res))
783        return false;
784    return true;
785  }
786
787  protected Distance parseDistance(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
788    Distance res = new Distance();
789    parseTypeAttributes(xpp, res);
790    next(xpp);
791    int eventType = nextNoWhitespace(xpp);
792    while (eventType != XmlPullParser.END_TAG) {
793  if (!parseDistanceContent(eventType, xpp, res))
794        unknownContent(xpp);
795      eventType = nextNoWhitespace(xpp);
796    }
797    next(xpp);
798    parseElementClose(res);
799    return res;
800  }
801
802  protected boolean parseDistanceContent(int eventType, XmlPullParser xpp, Distance res) throws XmlPullParserException, IOException, FHIRFormatError {
803      if (!parseQuantityContent(eventType, xpp, res))
804        return false;
805    return true;
806  }
807
808  protected Age parseAge(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
809    Age res = new Age();
810    parseTypeAttributes(xpp, res);
811    next(xpp);
812    int eventType = nextNoWhitespace(xpp);
813    while (eventType != XmlPullParser.END_TAG) {
814  if (!parseAgeContent(eventType, xpp, res))
815        unknownContent(xpp);
816      eventType = nextNoWhitespace(xpp);
817    }
818    next(xpp);
819    parseElementClose(res);
820    return res;
821  }
822
823  protected boolean parseAgeContent(int eventType, XmlPullParser xpp, Age res) throws XmlPullParserException, IOException, FHIRFormatError {
824      if (!parseQuantityContent(eventType, xpp, res))
825        return false;
826    return true;
827  }
828
829  protected CodeableConcept parseCodeableConcept(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
830    CodeableConcept res = new CodeableConcept();
831    parseTypeAttributes(xpp, res);
832    next(xpp);
833    int eventType = nextNoWhitespace(xpp);
834    while (eventType != XmlPullParser.END_TAG) {
835  if (!parseCodeableConceptContent(eventType, xpp, res))
836        unknownContent(xpp);
837      eventType = nextNoWhitespace(xpp);
838    }
839    next(xpp);
840    parseElementClose(res);
841    return res;
842  }
843
844  protected boolean parseCodeableConceptContent(int eventType, XmlPullParser xpp, CodeableConcept res) throws XmlPullParserException, IOException, FHIRFormatError {
845      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coding")) {
846        res.getCoding().add(parseCoding(xpp));
847      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
848        res.setTextElement(parseString(xpp));
849      } else if (!parseElementContent(eventType, xpp, res))
850        return false;
851    return true;
852  }
853
854  protected SimpleQuantity parseSimpleQuantity(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
855    SimpleQuantity res = new SimpleQuantity();
856    parseElementAttributes(xpp, res);
857    next(xpp);
858    int eventType = nextNoWhitespace(xpp);
859    while (eventType != XmlPullParser.END_TAG) {
860  if (!parseSimpleQuantityContent(eventType, xpp, res))
861        unknownContent(xpp);
862      eventType = nextNoWhitespace(xpp);
863    }
864    next(xpp);
865    parseElementClose(res);
866    return res;
867  }
868
869  protected boolean parseSimpleQuantityContent(int eventType, XmlPullParser xpp, SimpleQuantity res) throws XmlPullParserException, IOException, FHIRFormatError {
870      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
871        res.setValueElement(parseDecimal(xpp));
872      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comparator")) {
873        res.setComparatorElement(parseEnumeration(xpp, Quantity.QuantityComparator.NULL, new Quantity.QuantityComparatorEnumFactory()));
874      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unit")) {
875        res.setUnitElement(parseString(xpp));
876      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
877        res.setSystemElement(parseUri(xpp));
878      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
879        res.setCodeElement(parseCode(xpp));
880      } else if (!parseElementContent(eventType, xpp, res))
881        return false;
882    return true;
883  }
884
885  protected Meta parseMeta(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
886    Meta res = new Meta();
887    parseElementAttributes(xpp, res);
888    next(xpp);
889    int eventType = nextNoWhitespace(xpp);
890    while (eventType != XmlPullParser.END_TAG) {
891  if (!parseMetaContent(eventType, xpp, res))
892        unknownContent(xpp);
893      eventType = nextNoWhitespace(xpp);
894    }
895    next(xpp);
896    parseElementClose(res);
897    return res;
898  }
899
900  protected boolean parseMetaContent(int eventType, XmlPullParser xpp, Meta res) throws XmlPullParserException, IOException, FHIRFormatError {
901      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("versionId")) {
902        res.setVersionIdElement(parseId(xpp));
903      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastUpdated")) {
904        res.setLastUpdatedElement(parseInstant(xpp));
905      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
906        res.getProfile().add(parseUri(xpp));
907      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("security")) {
908        res.getSecurity().add(parseCoding(xpp));
909      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("tag")) {
910        res.getTag().add(parseCoding(xpp));
911      } else if (!parseElementContent(eventType, xpp, res))
912        return false;
913    return true;
914  }
915
916  protected Address parseAddress(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
917    Address res = new Address();
918    parseElementAttributes(xpp, res);
919    next(xpp);
920    int eventType = nextNoWhitespace(xpp);
921    while (eventType != XmlPullParser.END_TAG) {
922  if (!parseAddressContent(eventType, xpp, res))
923        unknownContent(xpp);
924      eventType = nextNoWhitespace(xpp);
925    }
926    next(xpp);
927    parseElementClose(res);
928    return res;
929  }
930
931  protected boolean parseAddressContent(int eventType, XmlPullParser xpp, Address res) throws XmlPullParserException, IOException, FHIRFormatError {
932      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
933        res.setUseElement(parseEnumeration(xpp, Address.AddressUse.NULL, new Address.AddressUseEnumFactory()));
934      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
935        res.setTypeElement(parseEnumeration(xpp, Address.AddressType.NULL, new Address.AddressTypeEnumFactory()));
936      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
937        res.setTextElement(parseString(xpp));
938      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("line")) {
939        res.getLine().add(parseString(xpp));
940      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("city")) {
941        res.setCityElement(parseString(xpp));
942      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("district")) {
943        res.setDistrictElement(parseString(xpp));
944      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("state")) {
945        res.setStateElement(parseString(xpp));
946      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("postalCode")) {
947        res.setPostalCodeElement(parseString(xpp));
948      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("country")) {
949        res.setCountryElement(parseString(xpp));
950      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
951        res.setPeriod(parsePeriod(xpp));
952      } else if (!parseElementContent(eventType, xpp, res))
953        return false;
954    return true;
955  }
956
957  protected TriggerDefinition parseTriggerDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
958    TriggerDefinition res = new TriggerDefinition();
959    parseElementAttributes(xpp, res);
960    next(xpp);
961    int eventType = nextNoWhitespace(xpp);
962    while (eventType != XmlPullParser.END_TAG) {
963  if (!parseTriggerDefinitionContent(eventType, xpp, res))
964        unknownContent(xpp);
965      eventType = nextNoWhitespace(xpp);
966    }
967    next(xpp);
968    parseElementClose(res);
969    return res;
970  }
971
972  protected boolean parseTriggerDefinitionContent(int eventType, XmlPullParser xpp, TriggerDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
973      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
974        res.setTypeElement(parseEnumeration(xpp, TriggerDefinition.TriggerType.NULL, new TriggerDefinition.TriggerTypeEnumFactory()));
975      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("eventName")) {
976        res.setEventNameElement(parseString(xpp));
977      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "eventTiming")) {
978        res.setEventTiming(parseType("eventTiming", xpp));
979      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("eventData")) {
980        res.setEventData(parseDataRequirement(xpp));
981      } else if (!parseElementContent(eventType, xpp, res))
982        return false;
983    return true;
984  }
985
986  protected Contributor parseContributor(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
987    Contributor res = new Contributor();
988    parseElementAttributes(xpp, res);
989    next(xpp);
990    int eventType = nextNoWhitespace(xpp);
991    while (eventType != XmlPullParser.END_TAG) {
992  if (!parseContributorContent(eventType, xpp, res))
993        unknownContent(xpp);
994      eventType = nextNoWhitespace(xpp);
995    }
996    next(xpp);
997    parseElementClose(res);
998    return res;
999  }
1000
1001  protected boolean parseContributorContent(int eventType, XmlPullParser xpp, Contributor res) throws XmlPullParserException, IOException, FHIRFormatError {
1002      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1003        res.setTypeElement(parseEnumeration(xpp, Contributor.ContributorType.NULL, new Contributor.ContributorTypeEnumFactory()));
1004      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
1005        res.setNameElement(parseString(xpp));
1006      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
1007        res.getContact().add(parseContactDetail(xpp));
1008      } else if (!parseElementContent(eventType, xpp, res))
1009        return false;
1010    return true;
1011  }
1012
1013  protected DataRequirement parseDataRequirement(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1014    DataRequirement res = new DataRequirement();
1015    parseElementAttributes(xpp, res);
1016    next(xpp);
1017    int eventType = nextNoWhitespace(xpp);
1018    while (eventType != XmlPullParser.END_TAG) {
1019  if (!parseDataRequirementContent(eventType, xpp, res))
1020        unknownContent(xpp);
1021      eventType = nextNoWhitespace(xpp);
1022    }
1023    next(xpp);
1024    parseElementClose(res);
1025    return res;
1026  }
1027
1028  protected boolean parseDataRequirementContent(int eventType, XmlPullParser xpp, DataRequirement res) throws XmlPullParserException, IOException, FHIRFormatError {
1029      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1030        res.setTypeElement(parseCode(xpp));
1031      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
1032        res.getProfile().add(parseUri(xpp));
1033      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mustSupport")) {
1034        res.getMustSupport().add(parseString(xpp));
1035      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("codeFilter")) {
1036        res.getCodeFilter().add(parseDataRequirementDataRequirementCodeFilterComponent(xpp, res));
1037      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dateFilter")) {
1038        res.getDateFilter().add(parseDataRequirementDataRequirementDateFilterComponent(xpp, res));
1039      } else if (!parseElementContent(eventType, xpp, res))
1040        return false;
1041    return true;
1042  }
1043
1044  protected DataRequirement.DataRequirementCodeFilterComponent parseDataRequirementDataRequirementCodeFilterComponent(XmlPullParser xpp, DataRequirement owner) throws XmlPullParserException, IOException, FHIRFormatError {
1045    DataRequirement.DataRequirementCodeFilterComponent res = new DataRequirement.DataRequirementCodeFilterComponent();
1046    parseElementAttributes(xpp, res);
1047    next(xpp);
1048    int eventType = nextNoWhitespace(xpp);
1049    while (eventType != XmlPullParser.END_TAG) {
1050  if (!parseDataRequirementDataRequirementCodeFilterComponentContent(eventType, xpp, owner, res))
1051        unknownContent(xpp);
1052      eventType = nextNoWhitespace(xpp);
1053    }
1054    next(xpp);
1055    parseElementClose(res);
1056    return res;
1057  }
1058
1059  protected boolean parseDataRequirementDataRequirementCodeFilterComponentContent(int eventType, XmlPullParser xpp, DataRequirement owner, DataRequirement.DataRequirementCodeFilterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1060      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
1061        res.setPathElement(parseString(xpp));
1062      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "valueSet")) {
1063        res.setValueSet(parseType("valueSet", xpp));
1064      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueCode")) {
1065        res.getValueCode().add(parseCode(xpp));
1066      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueCoding")) {
1067        res.getValueCoding().add(parseCoding(xpp));
1068      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueCodeableConcept")) {
1069        res.getValueCodeableConcept().add(parseCodeableConcept(xpp));
1070      } else if (!parseElementContent(eventType, xpp, res))
1071        return false;
1072    return true;
1073  }
1074
1075  protected DataRequirement.DataRequirementDateFilterComponent parseDataRequirementDataRequirementDateFilterComponent(XmlPullParser xpp, DataRequirement owner) throws XmlPullParserException, IOException, FHIRFormatError {
1076    DataRequirement.DataRequirementDateFilterComponent res = new DataRequirement.DataRequirementDateFilterComponent();
1077    parseElementAttributes(xpp, res);
1078    next(xpp);
1079    int eventType = nextNoWhitespace(xpp);
1080    while (eventType != XmlPullParser.END_TAG) {
1081  if (!parseDataRequirementDataRequirementDateFilterComponentContent(eventType, xpp, owner, res))
1082        unknownContent(xpp);
1083      eventType = nextNoWhitespace(xpp);
1084    }
1085    next(xpp);
1086    parseElementClose(res);
1087    return res;
1088  }
1089
1090  protected boolean parseDataRequirementDataRequirementDateFilterComponentContent(int eventType, XmlPullParser xpp, DataRequirement owner, DataRequirement.DataRequirementDateFilterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1091      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
1092        res.setPathElement(parseString(xpp));
1093      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
1094        res.setValue(parseType("value", xpp));
1095      } else if (!parseElementContent(eventType, xpp, res))
1096        return false;
1097    return true;
1098  }
1099
1100  protected Dosage parseDosage(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1101    Dosage res = new Dosage();
1102    parseElementAttributes(xpp, res);
1103    next(xpp);
1104    int eventType = nextNoWhitespace(xpp);
1105    while (eventType != XmlPullParser.END_TAG) {
1106  if (!parseDosageContent(eventType, xpp, res))
1107        unknownContent(xpp);
1108      eventType = nextNoWhitespace(xpp);
1109    }
1110    next(xpp);
1111    parseElementClose(res);
1112    return res;
1113  }
1114
1115  protected boolean parseDosageContent(int eventType, XmlPullParser xpp, Dosage res) throws XmlPullParserException, IOException, FHIRFormatError {
1116      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
1117        res.setSequenceElement(parseInteger(xpp));
1118      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
1119        res.setTextElement(parseString(xpp));
1120      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("additionalInstruction")) {
1121        res.getAdditionalInstruction().add(parseCodeableConcept(xpp));
1122      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patientInstruction")) {
1123        res.setPatientInstructionElement(parseString(xpp));
1124      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("timing")) {
1125        res.setTiming(parseTiming(xpp));
1126      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "asNeeded")) {
1127        res.setAsNeeded(parseType("asNeeded", xpp));
1128      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("site")) {
1129        res.setSite(parseCodeableConcept(xpp));
1130      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("route")) {
1131        res.setRoute(parseCodeableConcept(xpp));
1132      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("method")) {
1133        res.setMethod(parseCodeableConcept(xpp));
1134      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "dose")) {
1135        res.setDose(parseType("dose", xpp));
1136      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxDosePerPeriod")) {
1137        res.setMaxDosePerPeriod(parseRatio(xpp));
1138      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxDosePerAdministration")) {
1139        res.setMaxDosePerAdministration(parseSimpleQuantity(xpp));
1140      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxDosePerLifetime")) {
1141        res.setMaxDosePerLifetime(parseSimpleQuantity(xpp));
1142      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "rate")) {
1143        res.setRate(parseType("rate", xpp));
1144      } else if (!parseElementContent(eventType, xpp, res))
1145        return false;
1146    return true;
1147  }
1148
1149  protected RelatedArtifact parseRelatedArtifact(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1150    RelatedArtifact res = new RelatedArtifact();
1151    parseElementAttributes(xpp, res);
1152    next(xpp);
1153    int eventType = nextNoWhitespace(xpp);
1154    while (eventType != XmlPullParser.END_TAG) {
1155  if (!parseRelatedArtifactContent(eventType, xpp, res))
1156        unknownContent(xpp);
1157      eventType = nextNoWhitespace(xpp);
1158    }
1159    next(xpp);
1160    parseElementClose(res);
1161    return res;
1162  }
1163
1164  protected boolean parseRelatedArtifactContent(int eventType, XmlPullParser xpp, RelatedArtifact res) throws XmlPullParserException, IOException, FHIRFormatError {
1165      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1166        res.setTypeElement(parseEnumeration(xpp, RelatedArtifact.RelatedArtifactType.NULL, new RelatedArtifact.RelatedArtifactTypeEnumFactory()));
1167      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
1168        res.setDisplayElement(parseString(xpp));
1169      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("citation")) {
1170        res.setCitationElement(parseString(xpp));
1171      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
1172        res.setUrlElement(parseUri(xpp));
1173      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("document")) {
1174        res.setDocument(parseAttachment(xpp));
1175      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
1176        res.setResource(parseReference(xpp));
1177      } else if (!parseElementContent(eventType, xpp, res))
1178        return false;
1179    return true;
1180  }
1181
1182  protected ContactDetail parseContactDetail(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1183    ContactDetail res = new ContactDetail();
1184    parseElementAttributes(xpp, res);
1185    next(xpp);
1186    int eventType = nextNoWhitespace(xpp);
1187    while (eventType != XmlPullParser.END_TAG) {
1188  if (!parseContactDetailContent(eventType, xpp, res))
1189        unknownContent(xpp);
1190      eventType = nextNoWhitespace(xpp);
1191    }
1192    next(xpp);
1193    parseElementClose(res);
1194    return res;
1195  }
1196
1197  protected boolean parseContactDetailContent(int eventType, XmlPullParser xpp, ContactDetail res) throws XmlPullParserException, IOException, FHIRFormatError {
1198      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
1199        res.setNameElement(parseString(xpp));
1200      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("telecom")) {
1201        res.getTelecom().add(parseContactPoint(xpp));
1202      } else if (!parseElementContent(eventType, xpp, res))
1203        return false;
1204    return true;
1205  }
1206
1207  protected HumanName parseHumanName(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1208    HumanName res = new HumanName();
1209    parseElementAttributes(xpp, res);
1210    next(xpp);
1211    int eventType = nextNoWhitespace(xpp);
1212    while (eventType != XmlPullParser.END_TAG) {
1213  if (!parseHumanNameContent(eventType, xpp, res))
1214        unknownContent(xpp);
1215      eventType = nextNoWhitespace(xpp);
1216    }
1217    next(xpp);
1218    parseElementClose(res);
1219    return res;
1220  }
1221
1222  protected boolean parseHumanNameContent(int eventType, XmlPullParser xpp, HumanName res) throws XmlPullParserException, IOException, FHIRFormatError {
1223      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
1224        res.setUseElement(parseEnumeration(xpp, HumanName.NameUse.NULL, new HumanName.NameUseEnumFactory()));
1225      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
1226        res.setTextElement(parseString(xpp));
1227      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("family")) {
1228        res.setFamilyElement(parseString(xpp));
1229      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("given")) {
1230        res.getGiven().add(parseString(xpp));
1231      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prefix")) {
1232        res.getPrefix().add(parseString(xpp));
1233      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("suffix")) {
1234        res.getSuffix().add(parseString(xpp));
1235      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
1236        res.setPeriod(parsePeriod(xpp));
1237      } else if (!parseElementContent(eventType, xpp, res))
1238        return false;
1239    return true;
1240  }
1241
1242  protected ContactPoint parseContactPoint(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1243    ContactPoint res = new ContactPoint();
1244    parseElementAttributes(xpp, res);
1245    next(xpp);
1246    int eventType = nextNoWhitespace(xpp);
1247    while (eventType != XmlPullParser.END_TAG) {
1248  if (!parseContactPointContent(eventType, xpp, res))
1249        unknownContent(xpp);
1250      eventType = nextNoWhitespace(xpp);
1251    }
1252    next(xpp);
1253    parseElementClose(res);
1254    return res;
1255  }
1256
1257  protected boolean parseContactPointContent(int eventType, XmlPullParser xpp, ContactPoint res) throws XmlPullParserException, IOException, FHIRFormatError {
1258      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
1259        res.setSystemElement(parseEnumeration(xpp, ContactPoint.ContactPointSystem.NULL, new ContactPoint.ContactPointSystemEnumFactory()));
1260      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
1261        res.setValueElement(parseString(xpp));
1262      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
1263        res.setUseElement(parseEnumeration(xpp, ContactPoint.ContactPointUse.NULL, new ContactPoint.ContactPointUseEnumFactory()));
1264      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rank")) {
1265        res.setRankElement(parsePositiveInt(xpp));
1266      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
1267        res.setPeriod(parsePeriod(xpp));
1268      } else if (!parseElementContent(eventType, xpp, res))
1269        return false;
1270    return true;
1271  }
1272
1273  protected UsageContext parseUsageContext(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1274    UsageContext res = new UsageContext();
1275    parseElementAttributes(xpp, res);
1276    next(xpp);
1277    int eventType = nextNoWhitespace(xpp);
1278    while (eventType != XmlPullParser.END_TAG) {
1279  if (!parseUsageContextContent(eventType, xpp, res))
1280        unknownContent(xpp);
1281      eventType = nextNoWhitespace(xpp);
1282    }
1283    next(xpp);
1284    parseElementClose(res);
1285    return res;
1286  }
1287
1288  protected boolean parseUsageContextContent(int eventType, XmlPullParser xpp, UsageContext res) throws XmlPullParserException, IOException, FHIRFormatError {
1289      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
1290        res.setCode(parseCoding(xpp));
1291      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
1292        res.setValue(parseType("value", xpp));
1293      } else if (!parseElementContent(eventType, xpp, res))
1294        return false;
1295    return true;
1296  }
1297
1298  protected Timing parseTiming(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1299    Timing res = new Timing();
1300    parseElementAttributes(xpp, res);
1301    next(xpp);
1302    int eventType = nextNoWhitespace(xpp);
1303    while (eventType != XmlPullParser.END_TAG) {
1304  if (!parseTimingContent(eventType, xpp, res))
1305        unknownContent(xpp);
1306      eventType = nextNoWhitespace(xpp);
1307    }
1308    next(xpp);
1309    parseElementClose(res);
1310    return res;
1311  }
1312
1313  protected boolean parseTimingContent(int eventType, XmlPullParser xpp, Timing res) throws XmlPullParserException, IOException, FHIRFormatError {
1314      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("event")) {
1315        res.getEvent().add(parseDateTime(xpp));
1316      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("repeat")) {
1317        res.setRepeat(parseTimingTimingRepeatComponent(xpp, res));
1318      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
1319        res.setCode(parseCodeableConcept(xpp));
1320      } else if (!parseElementContent(eventType, xpp, res))
1321        return false;
1322    return true;
1323  }
1324
1325  protected Timing.TimingRepeatComponent parseTimingTimingRepeatComponent(XmlPullParser xpp, Timing owner) throws XmlPullParserException, IOException, FHIRFormatError {
1326    Timing.TimingRepeatComponent res = new Timing.TimingRepeatComponent();
1327    parseElementAttributes(xpp, res);
1328    next(xpp);
1329    int eventType = nextNoWhitespace(xpp);
1330    while (eventType != XmlPullParser.END_TAG) {
1331  if (!parseTimingTimingRepeatComponentContent(eventType, xpp, owner, res))
1332        unknownContent(xpp);
1333      eventType = nextNoWhitespace(xpp);
1334    }
1335    next(xpp);
1336    parseElementClose(res);
1337    return res;
1338  }
1339
1340  protected boolean parseTimingTimingRepeatComponentContent(int eventType, XmlPullParser xpp, Timing owner, Timing.TimingRepeatComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1341      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "bounds")) {
1342        res.setBounds(parseType("bounds", xpp));
1343      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("count")) {
1344        res.setCountElement(parseInteger(xpp));
1345      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("countMax")) {
1346        res.setCountMaxElement(parseInteger(xpp));
1347      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("duration")) {
1348        res.setDurationElement(parseDecimal(xpp));
1349      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("durationMax")) {
1350        res.setDurationMaxElement(parseDecimal(xpp));
1351      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("durationUnit")) {
1352        res.setDurationUnitElement(parseEnumeration(xpp, Timing.UnitsOfTime.NULL, new Timing.UnitsOfTimeEnumFactory()));
1353      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("frequency")) {
1354        res.setFrequencyElement(parseInteger(xpp));
1355      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("frequencyMax")) {
1356        res.setFrequencyMaxElement(parseInteger(xpp));
1357      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
1358        res.setPeriodElement(parseDecimal(xpp));
1359      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("periodMax")) {
1360        res.setPeriodMaxElement(parseDecimal(xpp));
1361      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("periodUnit")) {
1362        res.setPeriodUnitElement(parseEnumeration(xpp, Timing.UnitsOfTime.NULL, new Timing.UnitsOfTimeEnumFactory()));
1363      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dayOfWeek")) {
1364        res.getDayOfWeek().add(parseEnumeration(xpp, Timing.DayOfWeek.NULL, new Timing.DayOfWeekEnumFactory()));
1365      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("timeOfDay")) {
1366        res.getTimeOfDay().add(parseTime(xpp));
1367      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("when")) {
1368        res.getWhen().add(parseEnumeration(xpp, Timing.EventTiming.NULL, new Timing.EventTimingEnumFactory()));
1369      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("offset")) {
1370        res.setOffsetElement(parseUnsignedInt(xpp));
1371      } else if (!parseElementContent(eventType, xpp, res))
1372        return false;
1373    return true;
1374  }
1375
1376  protected ElementDefinition parseElementDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1377    ElementDefinition res = new ElementDefinition();
1378    parseElementAttributes(xpp, res);
1379    next(xpp);
1380    int eventType = nextNoWhitespace(xpp);
1381    while (eventType != XmlPullParser.END_TAG) {
1382  if (!parseElementDefinitionContent(eventType, xpp, res))
1383        unknownContent(xpp);
1384      eventType = nextNoWhitespace(xpp);
1385    }
1386    next(xpp);
1387    parseElementClose(res);
1388    return res;
1389  }
1390
1391  protected boolean parseElementDefinitionContent(int eventType, XmlPullParser xpp, ElementDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
1392      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
1393        res.setPathElement(parseString(xpp));
1394      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("representation")) {
1395        res.getRepresentation().add(parseEnumeration(xpp, ElementDefinition.PropertyRepresentation.NULL, new ElementDefinition.PropertyRepresentationEnumFactory()));
1396      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sliceName")) {
1397        res.setSliceNameElement(parseString(xpp));
1398      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("label")) {
1399        res.setLabelElement(parseString(xpp));
1400      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
1401        res.getCode().add(parseCoding(xpp));
1402      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("slicing")) {
1403        res.setSlicing(parseElementDefinitionElementDefinitionSlicingComponent(xpp, res));
1404      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("short")) {
1405        res.setShortElement(parseString(xpp));
1406      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
1407        res.setDefinitionElement(parseMarkdown(xpp));
1408      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
1409        res.setCommentElement(parseMarkdown(xpp));
1410      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requirements")) {
1411        res.setRequirementsElement(parseMarkdown(xpp));
1412      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("alias")) {
1413        res.getAlias().add(parseString(xpp));
1414      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("min")) {
1415        res.setMinElement(parseUnsignedInt(xpp));
1416      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("max")) {
1417        res.setMaxElement(parseString(xpp));
1418      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("base")) {
1419        res.setBase(parseElementDefinitionElementDefinitionBaseComponent(xpp, res));
1420      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contentReference")) {
1421        res.setContentReferenceElement(parseUri(xpp));
1422      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1423        res.getType().add(parseElementDefinitionTypeRefComponent(xpp, res));
1424      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "defaultValue")) {
1425        res.setDefaultValue(parseType("defaultValue", xpp));
1426      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("meaningWhenMissing")) {
1427        res.setMeaningWhenMissingElement(parseMarkdown(xpp));
1428      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("orderMeaning")) {
1429        res.setOrderMeaningElement(parseString(xpp));
1430      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "fixed")) {
1431        res.setFixed(parseType("fixed", xpp));
1432      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "pattern")) {
1433        res.setPattern(parseType("pattern", xpp));
1434      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("example")) {
1435        res.getExample().add(parseElementDefinitionElementDefinitionExampleComponent(xpp, res));
1436      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "minValue")) {
1437        res.setMinValue(parseType("minValue", xpp));
1438      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "maxValue")) {
1439        res.setMaxValue(parseType("maxValue", xpp));
1440      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxLength")) {
1441        res.setMaxLengthElement(parseInteger(xpp));
1442      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("condition")) {
1443        res.getCondition().add(parseId(xpp));
1444      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("constraint")) {
1445        res.getConstraint().add(parseElementDefinitionElementDefinitionConstraintComponent(xpp, res));
1446      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mustSupport")) {
1447        res.setMustSupportElement(parseBoolean(xpp));
1448      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("isModifier")) {
1449        res.setIsModifierElement(parseBoolean(xpp));
1450      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("isSummary")) {
1451        res.setIsSummaryElement(parseBoolean(xpp));
1452      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("binding")) {
1453        res.setBinding(parseElementDefinitionElementDefinitionBindingComponent(xpp, res));
1454      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mapping")) {
1455        res.getMapping().add(parseElementDefinitionElementDefinitionMappingComponent(xpp, res));
1456      } else if (!parseElementContent(eventType, xpp, res))
1457        return false;
1458    return true;
1459  }
1460
1461  protected ElementDefinition.ElementDefinitionSlicingComponent parseElementDefinitionElementDefinitionSlicingComponent(XmlPullParser xpp, ElementDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
1462    ElementDefinition.ElementDefinitionSlicingComponent res = new ElementDefinition.ElementDefinitionSlicingComponent();
1463    parseElementAttributes(xpp, res);
1464    next(xpp);
1465    int eventType = nextNoWhitespace(xpp);
1466    while (eventType != XmlPullParser.END_TAG) {
1467  if (!parseElementDefinitionElementDefinitionSlicingComponentContent(eventType, xpp, owner, res))
1468        unknownContent(xpp);
1469      eventType = nextNoWhitespace(xpp);
1470    }
1471    next(xpp);
1472    parseElementClose(res);
1473    return res;
1474  }
1475
1476  protected boolean parseElementDefinitionElementDefinitionSlicingComponentContent(int eventType, XmlPullParser xpp, ElementDefinition owner, ElementDefinition.ElementDefinitionSlicingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1477      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("discriminator")) {
1478        res.getDiscriminator().add(parseElementDefinitionElementDefinitionSlicingDiscriminatorComponent(xpp, owner));
1479      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
1480        res.setDescriptionElement(parseString(xpp));
1481      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ordered")) {
1482        res.setOrderedElement(parseBoolean(xpp));
1483      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rules")) {
1484        res.setRulesElement(parseEnumeration(xpp, ElementDefinition.SlicingRules.NULL, new ElementDefinition.SlicingRulesEnumFactory()));
1485      } else if (!parseElementContent(eventType, xpp, res))
1486        return false;
1487    return true;
1488  }
1489
1490  protected ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent parseElementDefinitionElementDefinitionSlicingDiscriminatorComponent(XmlPullParser xpp, ElementDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
1491    ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent res = new ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent();
1492    parseElementAttributes(xpp, res);
1493    next(xpp);
1494    int eventType = nextNoWhitespace(xpp);
1495    while (eventType != XmlPullParser.END_TAG) {
1496  if (!parseElementDefinitionElementDefinitionSlicingDiscriminatorComponentContent(eventType, xpp, owner, res))
1497        unknownContent(xpp);
1498      eventType = nextNoWhitespace(xpp);
1499    }
1500    next(xpp);
1501    parseElementClose(res);
1502    return res;
1503  }
1504
1505  protected boolean parseElementDefinitionElementDefinitionSlicingDiscriminatorComponentContent(int eventType, XmlPullParser xpp, ElementDefinition owner, ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1506      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1507        res.setTypeElement(parseEnumeration(xpp, ElementDefinition.DiscriminatorType.NULL, new ElementDefinition.DiscriminatorTypeEnumFactory()));
1508      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
1509        res.setPathElement(parseString(xpp));
1510      } else if (!parseElementContent(eventType, xpp, res))
1511        return false;
1512    return true;
1513  }
1514
1515  protected ElementDefinition.ElementDefinitionBaseComponent parseElementDefinitionElementDefinitionBaseComponent(XmlPullParser xpp, ElementDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
1516    ElementDefinition.ElementDefinitionBaseComponent res = new ElementDefinition.ElementDefinitionBaseComponent();
1517    parseElementAttributes(xpp, res);
1518    next(xpp);
1519    int eventType = nextNoWhitespace(xpp);
1520    while (eventType != XmlPullParser.END_TAG) {
1521  if (!parseElementDefinitionElementDefinitionBaseComponentContent(eventType, xpp, owner, res))
1522        unknownContent(xpp);
1523      eventType = nextNoWhitespace(xpp);
1524    }
1525    next(xpp);
1526    parseElementClose(res);
1527    return res;
1528  }
1529
1530  protected boolean parseElementDefinitionElementDefinitionBaseComponentContent(int eventType, XmlPullParser xpp, ElementDefinition owner, ElementDefinition.ElementDefinitionBaseComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1531      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
1532        res.setPathElement(parseString(xpp));
1533      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("min")) {
1534        res.setMinElement(parseUnsignedInt(xpp));
1535      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("max")) {
1536        res.setMaxElement(parseString(xpp));
1537      } else if (!parseElementContent(eventType, xpp, res))
1538        return false;
1539    return true;
1540  }
1541
1542  protected ElementDefinition.TypeRefComponent parseElementDefinitionTypeRefComponent(XmlPullParser xpp, ElementDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
1543    ElementDefinition.TypeRefComponent res = new ElementDefinition.TypeRefComponent();
1544    parseElementAttributes(xpp, res);
1545    next(xpp);
1546    int eventType = nextNoWhitespace(xpp);
1547    while (eventType != XmlPullParser.END_TAG) {
1548  if (!parseElementDefinitionTypeRefComponentContent(eventType, xpp, owner, res))
1549        unknownContent(xpp);
1550      eventType = nextNoWhitespace(xpp);
1551    }
1552    next(xpp);
1553    parseElementClose(res);
1554    return res;
1555  }
1556
1557  protected boolean parseElementDefinitionTypeRefComponentContent(int eventType, XmlPullParser xpp, ElementDefinition owner, ElementDefinition.TypeRefComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1558      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
1559        res.setCodeElement(parseUri(xpp));
1560      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
1561        res.setProfileElement(parseUri(xpp));
1562      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("targetProfile")) {
1563        res.setTargetProfileElement(parseUri(xpp));
1564      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("aggregation")) {
1565        res.getAggregation().add(parseEnumeration(xpp, ElementDefinition.AggregationMode.NULL, new ElementDefinition.AggregationModeEnumFactory()));
1566      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("versioning")) {
1567        res.setVersioningElement(parseEnumeration(xpp, ElementDefinition.ReferenceVersionRules.NULL, new ElementDefinition.ReferenceVersionRulesEnumFactory()));
1568      } else if (!parseElementContent(eventType, xpp, res))
1569        return false;
1570    return true;
1571  }
1572
1573  protected ElementDefinition.ElementDefinitionExampleComponent parseElementDefinitionElementDefinitionExampleComponent(XmlPullParser xpp, ElementDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
1574    ElementDefinition.ElementDefinitionExampleComponent res = new ElementDefinition.ElementDefinitionExampleComponent();
1575    parseElementAttributes(xpp, res);
1576    next(xpp);
1577    int eventType = nextNoWhitespace(xpp);
1578    while (eventType != XmlPullParser.END_TAG) {
1579  if (!parseElementDefinitionElementDefinitionExampleComponentContent(eventType, xpp, owner, res))
1580        unknownContent(xpp);
1581      eventType = nextNoWhitespace(xpp);
1582    }
1583    next(xpp);
1584    parseElementClose(res);
1585    return res;
1586  }
1587
1588  protected boolean parseElementDefinitionElementDefinitionExampleComponentContent(int eventType, XmlPullParser xpp, ElementDefinition owner, ElementDefinition.ElementDefinitionExampleComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1589      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("label")) {
1590        res.setLabelElement(parseString(xpp));
1591      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
1592        res.setValue(parseType("value", xpp));
1593      } else if (!parseElementContent(eventType, xpp, res))
1594        return false;
1595    return true;
1596  }
1597
1598  protected ElementDefinition.ElementDefinitionConstraintComponent parseElementDefinitionElementDefinitionConstraintComponent(XmlPullParser xpp, ElementDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
1599    ElementDefinition.ElementDefinitionConstraintComponent res = new ElementDefinition.ElementDefinitionConstraintComponent();
1600    parseElementAttributes(xpp, res);
1601    next(xpp);
1602    int eventType = nextNoWhitespace(xpp);
1603    while (eventType != XmlPullParser.END_TAG) {
1604  if (!parseElementDefinitionElementDefinitionConstraintComponentContent(eventType, xpp, owner, res))
1605        unknownContent(xpp);
1606      eventType = nextNoWhitespace(xpp);
1607    }
1608    next(xpp);
1609    parseElementClose(res);
1610    return res;
1611  }
1612
1613  protected boolean parseElementDefinitionElementDefinitionConstraintComponentContent(int eventType, XmlPullParser xpp, ElementDefinition owner, ElementDefinition.ElementDefinitionConstraintComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1614      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("key")) {
1615        res.setKeyElement(parseId(xpp));
1616      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requirements")) {
1617        res.setRequirementsElement(parseString(xpp));
1618      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("severity")) {
1619        res.setSeverityElement(parseEnumeration(xpp, ElementDefinition.ConstraintSeverity.NULL, new ElementDefinition.ConstraintSeverityEnumFactory()));
1620      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("human")) {
1621        res.setHumanElement(parseString(xpp));
1622      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expression")) {
1623        res.setExpressionElement(parseString(xpp));
1624      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("xpath")) {
1625        res.setXpathElement(parseString(xpp));
1626      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
1627        res.setSourceElement(parseUri(xpp));
1628      } else if (!parseElementContent(eventType, xpp, res))
1629        return false;
1630    return true;
1631  }
1632
1633  protected ElementDefinition.ElementDefinitionBindingComponent parseElementDefinitionElementDefinitionBindingComponent(XmlPullParser xpp, ElementDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
1634    ElementDefinition.ElementDefinitionBindingComponent res = new ElementDefinition.ElementDefinitionBindingComponent();
1635    parseElementAttributes(xpp, res);
1636    next(xpp);
1637    int eventType = nextNoWhitespace(xpp);
1638    while (eventType != XmlPullParser.END_TAG) {
1639  if (!parseElementDefinitionElementDefinitionBindingComponentContent(eventType, xpp, owner, res))
1640        unknownContent(xpp);
1641      eventType = nextNoWhitespace(xpp);
1642    }
1643    next(xpp);
1644    parseElementClose(res);
1645    return res;
1646  }
1647
1648  protected boolean parseElementDefinitionElementDefinitionBindingComponentContent(int eventType, XmlPullParser xpp, ElementDefinition owner, ElementDefinition.ElementDefinitionBindingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1649      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("strength")) {
1650        res.setStrengthElement(parseEnumeration(xpp, Enumerations.BindingStrength.NULL, new Enumerations.BindingStrengthEnumFactory()));
1651      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
1652        res.setDescriptionElement(parseString(xpp));
1653      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "valueSet")) {
1654        res.setValueSet(parseType("valueSet", xpp));
1655      } else if (!parseElementContent(eventType, xpp, res))
1656        return false;
1657    return true;
1658  }
1659
1660  protected ElementDefinition.ElementDefinitionMappingComponent parseElementDefinitionElementDefinitionMappingComponent(XmlPullParser xpp, ElementDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
1661    ElementDefinition.ElementDefinitionMappingComponent res = new ElementDefinition.ElementDefinitionMappingComponent();
1662    parseElementAttributes(xpp, res);
1663    next(xpp);
1664    int eventType = nextNoWhitespace(xpp);
1665    while (eventType != XmlPullParser.END_TAG) {
1666  if (!parseElementDefinitionElementDefinitionMappingComponentContent(eventType, xpp, owner, res))
1667        unknownContent(xpp);
1668      eventType = nextNoWhitespace(xpp);
1669    }
1670    next(xpp);
1671    parseElementClose(res);
1672    return res;
1673  }
1674
1675  protected boolean parseElementDefinitionElementDefinitionMappingComponentContent(int eventType, XmlPullParser xpp, ElementDefinition owner, ElementDefinition.ElementDefinitionMappingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1676      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identity")) {
1677        res.setIdentityElement(parseId(xpp));
1678      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
1679        res.setLanguageElement(parseCode(xpp));
1680      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("map")) {
1681        res.setMapElement(parseString(xpp));
1682      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
1683        res.setCommentElement(parseString(xpp));
1684      } else if (!parseElementContent(eventType, xpp, res))
1685        return false;
1686    return true;
1687  }
1688
1689  protected ParameterDefinition parseParameterDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1690    ParameterDefinition res = new ParameterDefinition();
1691    parseElementAttributes(xpp, res);
1692    next(xpp);
1693    int eventType = nextNoWhitespace(xpp);
1694    while (eventType != XmlPullParser.END_TAG) {
1695  if (!parseParameterDefinitionContent(eventType, xpp, res))
1696        unknownContent(xpp);
1697      eventType = nextNoWhitespace(xpp);
1698    }
1699    next(xpp);
1700    parseElementClose(res);
1701    return res;
1702  }
1703
1704  protected boolean parseParameterDefinitionContent(int eventType, XmlPullParser xpp, ParameterDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
1705      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
1706        res.setNameElement(parseCode(xpp));
1707      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
1708        res.setUseElement(parseEnumeration(xpp, ParameterDefinition.ParameterUse.NULL, new ParameterDefinition.ParameterUseEnumFactory()));
1709      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("min")) {
1710        res.setMinElement(parseInteger(xpp));
1711      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("max")) {
1712        res.setMaxElement(parseString(xpp));
1713      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
1714        res.setDocumentationElement(parseString(xpp));
1715      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1716        res.setTypeElement(parseCode(xpp));
1717      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
1718        res.setProfile(parseReference(xpp));
1719      } else if (!parseElementContent(eventType, xpp, res))
1720        return false;
1721    return true;
1722  }
1723
1724  protected void parseDomainResourceAttributes(XmlPullParser xpp, DomainResource res) throws XmlPullParserException, IOException, FHIRFormatError {
1725    parseResourceAttributes(xpp, res);
1726  }
1727
1728  protected boolean parseDomainResourceContent(int eventType, XmlPullParser xpp, DomainResource res) throws XmlPullParserException, IOException, FHIRFormatError {
1729      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
1730        res.setText(parseNarrative(xpp));
1731      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contained")) {
1732        res.getContained().add(parseResourceContained(xpp));
1733      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("extension")) {
1734        res.getExtension().add(parseExtension(xpp));
1735      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifierExtension")) {
1736        res.getModifierExtension().add(parseExtension(xpp));
1737    } else
1738    return parseResourceContent(eventType, xpp, res);
1739    return true;
1740  }
1741
1742  protected Parameters parseParameters(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1743    Parameters res = new Parameters();
1744    parseResourceAttributes(xpp, res);
1745    next(xpp);
1746    int eventType = nextNoWhitespace(xpp);
1747    while (eventType != XmlPullParser.END_TAG) {
1748  if (!parseParametersContent(eventType, xpp, res))
1749        unknownContent(xpp);
1750      eventType = nextNoWhitespace(xpp);
1751    }
1752    next(xpp);
1753    parseElementClose(res);
1754    return res;
1755  }
1756
1757  protected boolean parseParametersContent(int eventType, XmlPullParser xpp, Parameters res) throws XmlPullParserException, IOException, FHIRFormatError {
1758      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("parameter")) {
1759        res.getParameter().add(parseParametersParametersParameterComponent(xpp, res));
1760      } else if (!parseResourceContent(eventType, xpp, res))
1761        return false;
1762    return true;
1763  }
1764
1765  protected Parameters.ParametersParameterComponent parseParametersParametersParameterComponent(XmlPullParser xpp, Parameters owner) throws XmlPullParserException, IOException, FHIRFormatError {
1766    Parameters.ParametersParameterComponent res = new Parameters.ParametersParameterComponent();
1767    parseBackboneAttributes(xpp, res);
1768    next(xpp);
1769    int eventType = nextNoWhitespace(xpp);
1770    while (eventType != XmlPullParser.END_TAG) {
1771  if (!parseParametersParametersParameterComponentContent(eventType, xpp, owner, res))
1772        unknownContent(xpp);
1773      eventType = nextNoWhitespace(xpp);
1774    }
1775    next(xpp);
1776    parseElementClose(res);
1777    return res;
1778  }
1779
1780  protected boolean parseParametersParametersParameterComponentContent(int eventType, XmlPullParser xpp, Parameters owner, Parameters.ParametersParameterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1781      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
1782        res.setNameElement(parseString(xpp));
1783      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
1784        res.setValue(parseType("value", xpp));
1785      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
1786        res.setResource(parseResourceContained(xpp));
1787      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("part")) {
1788        res.getPart().add(parseParametersParametersParameterComponent(xpp, owner));
1789      } else if (!parseBackboneContent(eventType, xpp, res))
1790        return false;
1791    return true;
1792  }
1793
1794  protected void parseResourceAttributes(XmlPullParser xpp, Resource res) throws XmlPullParserException, IOException, FHIRFormatError {
1795    if (!comments.isEmpty()) {
1796      res.getFormatCommentsPre().addAll(comments);
1797      comments.clear();
1798     }
1799  }
1800
1801  protected boolean parseResourceContent(int eventType, XmlPullParser xpp, Resource res) throws XmlPullParserException, IOException, FHIRFormatError {
1802      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("id")) {
1803        res.setIdElement(parseId(xpp));
1804      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("meta")) {
1805        res.setMeta(parseMeta(xpp));
1806      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("implicitRules")) {
1807        res.setImplicitRulesElement(parseUri(xpp));
1808      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
1809        res.setLanguageElement(parseCode(xpp));
1810    } else
1811        return false;
1812    return true;
1813  }
1814
1815  protected Account parseAccount(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1816    Account res = new Account();
1817    parseDomainResourceAttributes(xpp, res);
1818    next(xpp);
1819    int eventType = nextNoWhitespace(xpp);
1820    while (eventType != XmlPullParser.END_TAG) {
1821  if (!parseAccountContent(eventType, xpp, res))
1822        unknownContent(xpp);
1823      eventType = nextNoWhitespace(xpp);
1824    }
1825    next(xpp);
1826    parseElementClose(res);
1827    return res;
1828  }
1829
1830  protected boolean parseAccountContent(int eventType, XmlPullParser xpp, Account res) throws XmlPullParserException, IOException, FHIRFormatError {
1831      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
1832        res.getIdentifier().add(parseIdentifier(xpp));
1833      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
1834        res.setStatusElement(parseEnumeration(xpp, Account.AccountStatus.NULL, new Account.AccountStatusEnumFactory()));
1835      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1836        res.setType(parseCodeableConcept(xpp));
1837      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
1838        res.setNameElement(parseString(xpp));
1839      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
1840        res.setSubject(parseReference(xpp));
1841      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
1842        res.setPeriod(parsePeriod(xpp));
1843      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("active")) {
1844        res.setActive(parsePeriod(xpp));
1845      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("balance")) {
1846        res.setBalance(parseMoney(xpp));
1847      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
1848        res.getCoverage().add(parseAccountCoverageComponent(xpp, res));
1849      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("owner")) {
1850        res.setOwner(parseReference(xpp));
1851      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
1852        res.setDescriptionElement(parseString(xpp));
1853      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("guarantor")) {
1854        res.getGuarantor().add(parseAccountGuarantorComponent(xpp, res));
1855      } else if (!parseDomainResourceContent(eventType, xpp, res))
1856        return false;
1857    return true;
1858  }
1859
1860  protected Account.CoverageComponent parseAccountCoverageComponent(XmlPullParser xpp, Account owner) throws XmlPullParserException, IOException, FHIRFormatError {
1861    Account.CoverageComponent res = new Account.CoverageComponent();
1862    parseBackboneAttributes(xpp, res);
1863    next(xpp);
1864    int eventType = nextNoWhitespace(xpp);
1865    while (eventType != XmlPullParser.END_TAG) {
1866  if (!parseAccountCoverageComponentContent(eventType, xpp, owner, res))
1867        unknownContent(xpp);
1868      eventType = nextNoWhitespace(xpp);
1869    }
1870    next(xpp);
1871    parseElementClose(res);
1872    return res;
1873  }
1874
1875  protected boolean parseAccountCoverageComponentContent(int eventType, XmlPullParser xpp, Account owner, Account.CoverageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1876      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
1877        res.setCoverage(parseReference(xpp));
1878      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
1879        res.setPriorityElement(parsePositiveInt(xpp));
1880      } else if (!parseBackboneContent(eventType, xpp, res))
1881        return false;
1882    return true;
1883  }
1884
1885  protected Account.GuarantorComponent parseAccountGuarantorComponent(XmlPullParser xpp, Account owner) throws XmlPullParserException, IOException, FHIRFormatError {
1886    Account.GuarantorComponent res = new Account.GuarantorComponent();
1887    parseBackboneAttributes(xpp, res);
1888    next(xpp);
1889    int eventType = nextNoWhitespace(xpp);
1890    while (eventType != XmlPullParser.END_TAG) {
1891  if (!parseAccountGuarantorComponentContent(eventType, xpp, owner, res))
1892        unknownContent(xpp);
1893      eventType = nextNoWhitespace(xpp);
1894    }
1895    next(xpp);
1896    parseElementClose(res);
1897    return res;
1898  }
1899
1900  protected boolean parseAccountGuarantorComponentContent(int eventType, XmlPullParser xpp, Account owner, Account.GuarantorComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1901      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("party")) {
1902        res.setParty(parseReference(xpp));
1903      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onHold")) {
1904        res.setOnHoldElement(parseBoolean(xpp));
1905      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
1906        res.setPeriod(parsePeriod(xpp));
1907      } else if (!parseBackboneContent(eventType, xpp, res))
1908        return false;
1909    return true;
1910  }
1911
1912  protected ActivityDefinition parseActivityDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1913    ActivityDefinition res = new ActivityDefinition();
1914    parseDomainResourceAttributes(xpp, res);
1915    next(xpp);
1916    int eventType = nextNoWhitespace(xpp);
1917    while (eventType != XmlPullParser.END_TAG) {
1918  if (!parseActivityDefinitionContent(eventType, xpp, res))
1919        unknownContent(xpp);
1920      eventType = nextNoWhitespace(xpp);
1921    }
1922    next(xpp);
1923    parseElementClose(res);
1924    return res;
1925  }
1926
1927  protected boolean parseActivityDefinitionContent(int eventType, XmlPullParser xpp, ActivityDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
1928      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
1929        res.setUrlElement(parseUri(xpp));
1930      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
1931        res.getIdentifier().add(parseIdentifier(xpp));
1932      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
1933        res.setVersionElement(parseString(xpp));
1934      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
1935        res.setNameElement(parseString(xpp));
1936      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
1937        res.setTitleElement(parseString(xpp));
1938      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
1939        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
1940      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
1941        res.setExperimentalElement(parseBoolean(xpp));
1942      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
1943        res.setDateElement(parseDateTime(xpp));
1944      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
1945        res.setPublisherElement(parseString(xpp));
1946      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
1947        res.setDescriptionElement(parseMarkdown(xpp));
1948      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
1949        res.setPurposeElement(parseMarkdown(xpp));
1950      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("usage")) {
1951        res.setUsageElement(parseString(xpp));
1952      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("approvalDate")) {
1953        res.setApprovalDateElement(parseDate(xpp));
1954      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastReviewDate")) {
1955        res.setLastReviewDateElement(parseDate(xpp));
1956      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("effectivePeriod")) {
1957        res.setEffectivePeriod(parsePeriod(xpp));
1958      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
1959        res.getUseContext().add(parseUsageContext(xpp));
1960      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
1961        res.getJurisdiction().add(parseCodeableConcept(xpp));
1962      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("topic")) {
1963        res.getTopic().add(parseCodeableConcept(xpp));
1964      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contributor")) {
1965        res.getContributor().add(parseContributor(xpp));
1966      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
1967        res.getContact().add(parseContactDetail(xpp));
1968      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
1969        res.setCopyrightElement(parseMarkdown(xpp));
1970      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatedArtifact")) {
1971        res.getRelatedArtifact().add(parseRelatedArtifact(xpp));
1972      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("library")) {
1973        res.getLibrary().add(parseReference(xpp));
1974      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("kind")) {
1975        res.setKindElement(parseEnumeration(xpp, ActivityDefinition.ActivityDefinitionKind.NULL, new ActivityDefinition.ActivityDefinitionKindEnumFactory()));
1976      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
1977        res.setCode(parseCodeableConcept(xpp));
1978      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "timing")) {
1979        res.setTiming(parseType("timing", xpp));
1980      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
1981        res.setLocation(parseReference(xpp));
1982      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
1983        res.getParticipant().add(parseActivityDefinitionActivityDefinitionParticipantComponent(xpp, res));
1984      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "product")) {
1985        res.setProduct(parseType("product", xpp));
1986      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
1987        res.setQuantity(parseSimpleQuantity(xpp));
1988      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dosage")) {
1989        res.getDosage().add(parseDosage(xpp));
1990      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodySite")) {
1991        res.getBodySite().add(parseCodeableConcept(xpp));
1992      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("transform")) {
1993        res.setTransform(parseReference(xpp));
1994      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dynamicValue")) {
1995        res.getDynamicValue().add(parseActivityDefinitionActivityDefinitionDynamicValueComponent(xpp, res));
1996      } else if (!parseDomainResourceContent(eventType, xpp, res))
1997        return false;
1998    return true;
1999  }
2000
2001  protected ActivityDefinition.ActivityDefinitionParticipantComponent parseActivityDefinitionActivityDefinitionParticipantComponent(XmlPullParser xpp, ActivityDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
2002    ActivityDefinition.ActivityDefinitionParticipantComponent res = new ActivityDefinition.ActivityDefinitionParticipantComponent();
2003    parseBackboneAttributes(xpp, res);
2004    next(xpp);
2005    int eventType = nextNoWhitespace(xpp);
2006    while (eventType != XmlPullParser.END_TAG) {
2007  if (!parseActivityDefinitionActivityDefinitionParticipantComponentContent(eventType, xpp, owner, res))
2008        unknownContent(xpp);
2009      eventType = nextNoWhitespace(xpp);
2010    }
2011    next(xpp);
2012    parseElementClose(res);
2013    return res;
2014  }
2015
2016  protected boolean parseActivityDefinitionActivityDefinitionParticipantComponentContent(int eventType, XmlPullParser xpp, ActivityDefinition owner, ActivityDefinition.ActivityDefinitionParticipantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2017      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2018        res.setTypeElement(parseEnumeration(xpp, ActivityDefinition.ActivityParticipantType.NULL, new ActivityDefinition.ActivityParticipantTypeEnumFactory()));
2019      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
2020        res.setRole(parseCodeableConcept(xpp));
2021      } else if (!parseBackboneContent(eventType, xpp, res))
2022        return false;
2023    return true;
2024  }
2025
2026  protected ActivityDefinition.ActivityDefinitionDynamicValueComponent parseActivityDefinitionActivityDefinitionDynamicValueComponent(XmlPullParser xpp, ActivityDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
2027    ActivityDefinition.ActivityDefinitionDynamicValueComponent res = new ActivityDefinition.ActivityDefinitionDynamicValueComponent();
2028    parseBackboneAttributes(xpp, res);
2029    next(xpp);
2030    int eventType = nextNoWhitespace(xpp);
2031    while (eventType != XmlPullParser.END_TAG) {
2032  if (!parseActivityDefinitionActivityDefinitionDynamicValueComponentContent(eventType, xpp, owner, res))
2033        unknownContent(xpp);
2034      eventType = nextNoWhitespace(xpp);
2035    }
2036    next(xpp);
2037    parseElementClose(res);
2038    return res;
2039  }
2040
2041  protected boolean parseActivityDefinitionActivityDefinitionDynamicValueComponentContent(int eventType, XmlPullParser xpp, ActivityDefinition owner, ActivityDefinition.ActivityDefinitionDynamicValueComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2042      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2043        res.setDescriptionElement(parseString(xpp));
2044      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
2045        res.setPathElement(parseString(xpp));
2046      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
2047        res.setLanguageElement(parseString(xpp));
2048      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expression")) {
2049        res.setExpressionElement(parseString(xpp));
2050      } else if (!parseBackboneContent(eventType, xpp, res))
2051        return false;
2052    return true;
2053  }
2054
2055  protected AdverseEvent parseAdverseEvent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2056    AdverseEvent res = new AdverseEvent();
2057    parseDomainResourceAttributes(xpp, res);
2058    next(xpp);
2059    int eventType = nextNoWhitespace(xpp);
2060    while (eventType != XmlPullParser.END_TAG) {
2061  if (!parseAdverseEventContent(eventType, xpp, res))
2062        unknownContent(xpp);
2063      eventType = nextNoWhitespace(xpp);
2064    }
2065    next(xpp);
2066    parseElementClose(res);
2067    return res;
2068  }
2069
2070  protected boolean parseAdverseEventContent(int eventType, XmlPullParser xpp, AdverseEvent res) throws XmlPullParserException, IOException, FHIRFormatError {
2071      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2072        res.setIdentifier(parseIdentifier(xpp));
2073      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
2074        res.setCategoryElement(parseEnumeration(xpp, AdverseEvent.AdverseEventCategory.NULL, new AdverseEvent.AdverseEventCategoryEnumFactory()));
2075      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2076        res.setType(parseCodeableConcept(xpp));
2077      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
2078        res.setSubject(parseReference(xpp));
2079      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
2080        res.setDateElement(parseDateTime(xpp));
2081      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reaction")) {
2082        res.getReaction().add(parseReference(xpp));
2083      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
2084        res.setLocation(parseReference(xpp));
2085      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("seriousness")) {
2086        res.setSeriousness(parseCodeableConcept(xpp));
2087      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
2088        res.setOutcome(parseCodeableConcept(xpp));
2089      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recorder")) {
2090        res.setRecorder(parseReference(xpp));
2091      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("eventParticipant")) {
2092        res.setEventParticipant(parseReference(xpp));
2093      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2094        res.setDescriptionElement(parseString(xpp));
2095      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("suspectEntity")) {
2096        res.getSuspectEntity().add(parseAdverseEventAdverseEventSuspectEntityComponent(xpp, res));
2097      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subjectMedicalHistory")) {
2098        res.getSubjectMedicalHistory().add(parseReference(xpp));
2099      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referenceDocument")) {
2100        res.getReferenceDocument().add(parseReference(xpp));
2101      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("study")) {
2102        res.getStudy().add(parseReference(xpp));
2103      } else if (!parseDomainResourceContent(eventType, xpp, res))
2104        return false;
2105    return true;
2106  }
2107
2108  protected AdverseEvent.AdverseEventSuspectEntityComponent parseAdverseEventAdverseEventSuspectEntityComponent(XmlPullParser xpp, AdverseEvent owner) throws XmlPullParserException, IOException, FHIRFormatError {
2109    AdverseEvent.AdverseEventSuspectEntityComponent res = new AdverseEvent.AdverseEventSuspectEntityComponent();
2110    parseBackboneAttributes(xpp, res);
2111    next(xpp);
2112    int eventType = nextNoWhitespace(xpp);
2113    while (eventType != XmlPullParser.END_TAG) {
2114  if (!parseAdverseEventAdverseEventSuspectEntityComponentContent(eventType, xpp, owner, res))
2115        unknownContent(xpp);
2116      eventType = nextNoWhitespace(xpp);
2117    }
2118    next(xpp);
2119    parseElementClose(res);
2120    return res;
2121  }
2122
2123  protected boolean parseAdverseEventAdverseEventSuspectEntityComponentContent(int eventType, XmlPullParser xpp, AdverseEvent owner, AdverseEvent.AdverseEventSuspectEntityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2124      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instance")) {
2125        res.setInstance(parseReference(xpp));
2126      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("causality")) {
2127        res.setCausalityElement(parseEnumeration(xpp, AdverseEvent.AdverseEventCausality.NULL, new AdverseEvent.AdverseEventCausalityEnumFactory()));
2128      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("causalityAssessment")) {
2129        res.setCausalityAssessment(parseCodeableConcept(xpp));
2130      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("causalityProductRelatedness")) {
2131        res.setCausalityProductRelatednessElement(parseString(xpp));
2132      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("causalityMethod")) {
2133        res.setCausalityMethod(parseCodeableConcept(xpp));
2134      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("causalityAuthor")) {
2135        res.setCausalityAuthor(parseReference(xpp));
2136      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("causalityResult")) {
2137        res.setCausalityResult(parseCodeableConcept(xpp));
2138      } else if (!parseBackboneContent(eventType, xpp, res))
2139        return false;
2140    return true;
2141  }
2142
2143  protected AllergyIntolerance parseAllergyIntolerance(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2144    AllergyIntolerance res = new AllergyIntolerance();
2145    parseDomainResourceAttributes(xpp, res);
2146    next(xpp);
2147    int eventType = nextNoWhitespace(xpp);
2148    while (eventType != XmlPullParser.END_TAG) {
2149  if (!parseAllergyIntoleranceContent(eventType, xpp, res))
2150        unknownContent(xpp);
2151      eventType = nextNoWhitespace(xpp);
2152    }
2153    next(xpp);
2154    parseElementClose(res);
2155    return res;
2156  }
2157
2158  protected boolean parseAllergyIntoleranceContent(int eventType, XmlPullParser xpp, AllergyIntolerance res) throws XmlPullParserException, IOException, FHIRFormatError {
2159      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2160        res.getIdentifier().add(parseIdentifier(xpp));
2161      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("clinicalStatus")) {
2162        res.setClinicalStatusElement(parseEnumeration(xpp, AllergyIntolerance.AllergyIntoleranceClinicalStatus.NULL, new AllergyIntolerance.AllergyIntoleranceClinicalStatusEnumFactory()));
2163      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("verificationStatus")) {
2164        res.setVerificationStatusElement(parseEnumeration(xpp, AllergyIntolerance.AllergyIntoleranceVerificationStatus.NULL, new AllergyIntolerance.AllergyIntoleranceVerificationStatusEnumFactory()));
2165      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2166        res.setTypeElement(parseEnumeration(xpp, AllergyIntolerance.AllergyIntoleranceType.NULL, new AllergyIntolerance.AllergyIntoleranceTypeEnumFactory()));
2167      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
2168        res.getCategory().add(parseEnumeration(xpp, AllergyIntolerance.AllergyIntoleranceCategory.NULL, new AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory()));
2169      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("criticality")) {
2170        res.setCriticalityElement(parseEnumeration(xpp, AllergyIntolerance.AllergyIntoleranceCriticality.NULL, new AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory()));
2171      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
2172        res.setCode(parseCodeableConcept(xpp));
2173      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
2174        res.setPatient(parseReference(xpp));
2175      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "onset")) {
2176        res.setOnset(parseType("onset", xpp));
2177      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("assertedDate")) {
2178        res.setAssertedDateElement(parseDateTime(xpp));
2179      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recorder")) {
2180        res.setRecorder(parseReference(xpp));
2181      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("asserter")) {
2182        res.setAsserter(parseReference(xpp));
2183      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastOccurrence")) {
2184        res.setLastOccurrenceElement(parseDateTime(xpp));
2185      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
2186        res.getNote().add(parseAnnotation(xpp));
2187      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reaction")) {
2188        res.getReaction().add(parseAllergyIntoleranceAllergyIntoleranceReactionComponent(xpp, res));
2189      } else if (!parseDomainResourceContent(eventType, xpp, res))
2190        return false;
2191    return true;
2192  }
2193
2194  protected AllergyIntolerance.AllergyIntoleranceReactionComponent parseAllergyIntoleranceAllergyIntoleranceReactionComponent(XmlPullParser xpp, AllergyIntolerance owner) throws XmlPullParserException, IOException, FHIRFormatError {
2195    AllergyIntolerance.AllergyIntoleranceReactionComponent res = new AllergyIntolerance.AllergyIntoleranceReactionComponent();
2196    parseBackboneAttributes(xpp, res);
2197    next(xpp);
2198    int eventType = nextNoWhitespace(xpp);
2199    while (eventType != XmlPullParser.END_TAG) {
2200  if (!parseAllergyIntoleranceAllergyIntoleranceReactionComponentContent(eventType, xpp, owner, res))
2201        unknownContent(xpp);
2202      eventType = nextNoWhitespace(xpp);
2203    }
2204    next(xpp);
2205    parseElementClose(res);
2206    return res;
2207  }
2208
2209  protected boolean parseAllergyIntoleranceAllergyIntoleranceReactionComponentContent(int eventType, XmlPullParser xpp, AllergyIntolerance owner, AllergyIntolerance.AllergyIntoleranceReactionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2210      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("substance")) {
2211        res.setSubstance(parseCodeableConcept(xpp));
2212      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("manifestation")) {
2213        res.getManifestation().add(parseCodeableConcept(xpp));
2214      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2215        res.setDescriptionElement(parseString(xpp));
2216      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onset")) {
2217        res.setOnsetElement(parseDateTime(xpp));
2218      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("severity")) {
2219        res.setSeverityElement(parseEnumeration(xpp, AllergyIntolerance.AllergyIntoleranceSeverity.NULL, new AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory()));
2220      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("exposureRoute")) {
2221        res.setExposureRoute(parseCodeableConcept(xpp));
2222      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
2223        res.getNote().add(parseAnnotation(xpp));
2224      } else if (!parseBackboneContent(eventType, xpp, res))
2225        return false;
2226    return true;
2227  }
2228
2229  protected Appointment parseAppointment(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2230    Appointment res = new Appointment();
2231    parseDomainResourceAttributes(xpp, res);
2232    next(xpp);
2233    int eventType = nextNoWhitespace(xpp);
2234    while (eventType != XmlPullParser.END_TAG) {
2235  if (!parseAppointmentContent(eventType, xpp, res))
2236        unknownContent(xpp);
2237      eventType = nextNoWhitespace(xpp);
2238    }
2239    next(xpp);
2240    parseElementClose(res);
2241    return res;
2242  }
2243
2244  protected boolean parseAppointmentContent(int eventType, XmlPullParser xpp, Appointment res) throws XmlPullParserException, IOException, FHIRFormatError {
2245      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2246        res.getIdentifier().add(parseIdentifier(xpp));
2247      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
2248        res.setStatusElement(parseEnumeration(xpp, Appointment.AppointmentStatus.NULL, new Appointment.AppointmentStatusEnumFactory()));
2249      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("serviceCategory")) {
2250        res.setServiceCategory(parseCodeableConcept(xpp));
2251      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("serviceType")) {
2252        res.getServiceType().add(parseCodeableConcept(xpp));
2253      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specialty")) {
2254        res.getSpecialty().add(parseCodeableConcept(xpp));
2255      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("appointmentType")) {
2256        res.setAppointmentType(parseCodeableConcept(xpp));
2257      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
2258        res.getReason().add(parseCodeableConcept(xpp));
2259      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("indication")) {
2260        res.getIndication().add(parseReference(xpp));
2261      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
2262        res.setPriorityElement(parseUnsignedInt(xpp));
2263      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2264        res.setDescriptionElement(parseString(xpp));
2265      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInformation")) {
2266        res.getSupportingInformation().add(parseReference(xpp));
2267      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("start")) {
2268        res.setStartElement(parseInstant(xpp));
2269      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("end")) {
2270        res.setEndElement(parseInstant(xpp));
2271      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("minutesDuration")) {
2272        res.setMinutesDurationElement(parsePositiveInt(xpp));
2273      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("slot")) {
2274        res.getSlot().add(parseReference(xpp));
2275      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
2276        res.setCreatedElement(parseDateTime(xpp));
2277      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
2278        res.setCommentElement(parseString(xpp));
2279      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("incomingReferral")) {
2280        res.getIncomingReferral().add(parseReference(xpp));
2281      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
2282        res.getParticipant().add(parseAppointmentAppointmentParticipantComponent(xpp, res));
2283      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestedPeriod")) {
2284        res.getRequestedPeriod().add(parsePeriod(xpp));
2285      } else if (!parseDomainResourceContent(eventType, xpp, res))
2286        return false;
2287    return true;
2288  }
2289
2290  protected Appointment.AppointmentParticipantComponent parseAppointmentAppointmentParticipantComponent(XmlPullParser xpp, Appointment owner) throws XmlPullParserException, IOException, FHIRFormatError {
2291    Appointment.AppointmentParticipantComponent res = new Appointment.AppointmentParticipantComponent();
2292    parseBackboneAttributes(xpp, res);
2293    next(xpp);
2294    int eventType = nextNoWhitespace(xpp);
2295    while (eventType != XmlPullParser.END_TAG) {
2296  if (!parseAppointmentAppointmentParticipantComponentContent(eventType, xpp, owner, res))
2297        unknownContent(xpp);
2298      eventType = nextNoWhitespace(xpp);
2299    }
2300    next(xpp);
2301    parseElementClose(res);
2302    return res;
2303  }
2304
2305  protected boolean parseAppointmentAppointmentParticipantComponentContent(int eventType, XmlPullParser xpp, Appointment owner, Appointment.AppointmentParticipantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2306      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2307        res.getType().add(parseCodeableConcept(xpp));
2308      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
2309        res.setActor(parseReference(xpp));
2310      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("required")) {
2311        res.setRequiredElement(parseEnumeration(xpp, Appointment.ParticipantRequired.NULL, new Appointment.ParticipantRequiredEnumFactory()));
2312      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
2313        res.setStatusElement(parseEnumeration(xpp, Appointment.ParticipationStatus.NULL, new Appointment.ParticipationStatusEnumFactory()));
2314      } else if (!parseBackboneContent(eventType, xpp, res))
2315        return false;
2316    return true;
2317  }
2318
2319  protected AppointmentResponse parseAppointmentResponse(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2320    AppointmentResponse res = new AppointmentResponse();
2321    parseDomainResourceAttributes(xpp, res);
2322    next(xpp);
2323    int eventType = nextNoWhitespace(xpp);
2324    while (eventType != XmlPullParser.END_TAG) {
2325  if (!parseAppointmentResponseContent(eventType, xpp, res))
2326        unknownContent(xpp);
2327      eventType = nextNoWhitespace(xpp);
2328    }
2329    next(xpp);
2330    parseElementClose(res);
2331    return res;
2332  }
2333
2334  protected boolean parseAppointmentResponseContent(int eventType, XmlPullParser xpp, AppointmentResponse res) throws XmlPullParserException, IOException, FHIRFormatError {
2335      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2336        res.getIdentifier().add(parseIdentifier(xpp));
2337      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("appointment")) {
2338        res.setAppointment(parseReference(xpp));
2339      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("start")) {
2340        res.setStartElement(parseInstant(xpp));
2341      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("end")) {
2342        res.setEndElement(parseInstant(xpp));
2343      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participantType")) {
2344        res.getParticipantType().add(parseCodeableConcept(xpp));
2345      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
2346        res.setActor(parseReference(xpp));
2347      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participantStatus")) {
2348        res.setParticipantStatusElement(parseEnumeration(xpp, AppointmentResponse.ParticipantStatus.NULL, new AppointmentResponse.ParticipantStatusEnumFactory()));
2349      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
2350        res.setCommentElement(parseString(xpp));
2351      } else if (!parseDomainResourceContent(eventType, xpp, res))
2352        return false;
2353    return true;
2354  }
2355
2356  protected AuditEvent parseAuditEvent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2357    AuditEvent res = new AuditEvent();
2358    parseDomainResourceAttributes(xpp, res);
2359    next(xpp);
2360    int eventType = nextNoWhitespace(xpp);
2361    while (eventType != XmlPullParser.END_TAG) {
2362  if (!parseAuditEventContent(eventType, xpp, res))
2363        unknownContent(xpp);
2364      eventType = nextNoWhitespace(xpp);
2365    }
2366    next(xpp);
2367    parseElementClose(res);
2368    return res;
2369  }
2370
2371  protected boolean parseAuditEventContent(int eventType, XmlPullParser xpp, AuditEvent res) throws XmlPullParserException, IOException, FHIRFormatError {
2372      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2373        res.setType(parseCoding(xpp));
2374      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subtype")) {
2375        res.getSubtype().add(parseCoding(xpp));
2376      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
2377        res.setActionElement(parseEnumeration(xpp, AuditEvent.AuditEventAction.NULL, new AuditEvent.AuditEventActionEnumFactory()));
2378      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recorded")) {
2379        res.setRecordedElement(parseInstant(xpp));
2380      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
2381        res.setOutcomeElement(parseEnumeration(xpp, AuditEvent.AuditEventOutcome.NULL, new AuditEvent.AuditEventOutcomeEnumFactory()));
2382      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcomeDesc")) {
2383        res.setOutcomeDescElement(parseString(xpp));
2384      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purposeOfEvent")) {
2385        res.getPurposeOfEvent().add(parseCodeableConcept(xpp));
2386      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("agent")) {
2387        res.getAgent().add(parseAuditEventAuditEventAgentComponent(xpp, res));
2388      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
2389        res.setSource(parseAuditEventAuditEventSourceComponent(xpp, res));
2390      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("entity")) {
2391        res.getEntity().add(parseAuditEventAuditEventEntityComponent(xpp, res));
2392      } else if (!parseDomainResourceContent(eventType, xpp, res))
2393        return false;
2394    return true;
2395  }
2396
2397  protected AuditEvent.AuditEventAgentComponent parseAuditEventAuditEventAgentComponent(XmlPullParser xpp, AuditEvent owner) throws XmlPullParserException, IOException, FHIRFormatError {
2398    AuditEvent.AuditEventAgentComponent res = new AuditEvent.AuditEventAgentComponent();
2399    parseBackboneAttributes(xpp, res);
2400    next(xpp);
2401    int eventType = nextNoWhitespace(xpp);
2402    while (eventType != XmlPullParser.END_TAG) {
2403  if (!parseAuditEventAuditEventAgentComponentContent(eventType, xpp, owner, res))
2404        unknownContent(xpp);
2405      eventType = nextNoWhitespace(xpp);
2406    }
2407    next(xpp);
2408    parseElementClose(res);
2409    return res;
2410  }
2411
2412  protected boolean parseAuditEventAuditEventAgentComponentContent(int eventType, XmlPullParser xpp, AuditEvent owner, AuditEvent.AuditEventAgentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2413      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
2414        res.getRole().add(parseCodeableConcept(xpp));
2415      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
2416        res.setReference(parseReference(xpp));
2417      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("userId")) {
2418        res.setUserId(parseIdentifier(xpp));
2419      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("altId")) {
2420        res.setAltIdElement(parseString(xpp));
2421      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
2422        res.setNameElement(parseString(xpp));
2423      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestor")) {
2424        res.setRequestorElement(parseBoolean(xpp));
2425      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
2426        res.setLocation(parseReference(xpp));
2427      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("policy")) {
2428        res.getPolicy().add(parseUri(xpp));
2429      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("media")) {
2430        res.setMedia(parseCoding(xpp));
2431      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("network")) {
2432        res.setNetwork(parseAuditEventAuditEventAgentNetworkComponent(xpp, owner));
2433      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purposeOfUse")) {
2434        res.getPurposeOfUse().add(parseCodeableConcept(xpp));
2435      } else if (!parseBackboneContent(eventType, xpp, res))
2436        return false;
2437    return true;
2438  }
2439
2440  protected AuditEvent.AuditEventAgentNetworkComponent parseAuditEventAuditEventAgentNetworkComponent(XmlPullParser xpp, AuditEvent owner) throws XmlPullParserException, IOException, FHIRFormatError {
2441    AuditEvent.AuditEventAgentNetworkComponent res = new AuditEvent.AuditEventAgentNetworkComponent();
2442    parseBackboneAttributes(xpp, res);
2443    next(xpp);
2444    int eventType = nextNoWhitespace(xpp);
2445    while (eventType != XmlPullParser.END_TAG) {
2446  if (!parseAuditEventAuditEventAgentNetworkComponentContent(eventType, xpp, owner, res))
2447        unknownContent(xpp);
2448      eventType = nextNoWhitespace(xpp);
2449    }
2450    next(xpp);
2451    parseElementClose(res);
2452    return res;
2453  }
2454
2455  protected boolean parseAuditEventAuditEventAgentNetworkComponentContent(int eventType, XmlPullParser xpp, AuditEvent owner, AuditEvent.AuditEventAgentNetworkComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2456      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("address")) {
2457        res.setAddressElement(parseString(xpp));
2458      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2459        res.setTypeElement(parseEnumeration(xpp, AuditEvent.AuditEventAgentNetworkType.NULL, new AuditEvent.AuditEventAgentNetworkTypeEnumFactory()));
2460      } else if (!parseBackboneContent(eventType, xpp, res))
2461        return false;
2462    return true;
2463  }
2464
2465  protected AuditEvent.AuditEventSourceComponent parseAuditEventAuditEventSourceComponent(XmlPullParser xpp, AuditEvent owner) throws XmlPullParserException, IOException, FHIRFormatError {
2466    AuditEvent.AuditEventSourceComponent res = new AuditEvent.AuditEventSourceComponent();
2467    parseBackboneAttributes(xpp, res);
2468    next(xpp);
2469    int eventType = nextNoWhitespace(xpp);
2470    while (eventType != XmlPullParser.END_TAG) {
2471  if (!parseAuditEventAuditEventSourceComponentContent(eventType, xpp, owner, res))
2472        unknownContent(xpp);
2473      eventType = nextNoWhitespace(xpp);
2474    }
2475    next(xpp);
2476    parseElementClose(res);
2477    return res;
2478  }
2479
2480  protected boolean parseAuditEventAuditEventSourceComponentContent(int eventType, XmlPullParser xpp, AuditEvent owner, AuditEvent.AuditEventSourceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2481      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("site")) {
2482        res.setSiteElement(parseString(xpp));
2483      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2484        res.setIdentifier(parseIdentifier(xpp));
2485      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2486        res.getType().add(parseCoding(xpp));
2487      } else if (!parseBackboneContent(eventType, xpp, res))
2488        return false;
2489    return true;
2490  }
2491
2492  protected AuditEvent.AuditEventEntityComponent parseAuditEventAuditEventEntityComponent(XmlPullParser xpp, AuditEvent owner) throws XmlPullParserException, IOException, FHIRFormatError {
2493    AuditEvent.AuditEventEntityComponent res = new AuditEvent.AuditEventEntityComponent();
2494    parseBackboneAttributes(xpp, res);
2495    next(xpp);
2496    int eventType = nextNoWhitespace(xpp);
2497    while (eventType != XmlPullParser.END_TAG) {
2498  if (!parseAuditEventAuditEventEntityComponentContent(eventType, xpp, owner, res))
2499        unknownContent(xpp);
2500      eventType = nextNoWhitespace(xpp);
2501    }
2502    next(xpp);
2503    parseElementClose(res);
2504    return res;
2505  }
2506
2507  protected boolean parseAuditEventAuditEventEntityComponentContent(int eventType, XmlPullParser xpp, AuditEvent owner, AuditEvent.AuditEventEntityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2508      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2509        res.setIdentifier(parseIdentifier(xpp));
2510      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
2511        res.setReference(parseReference(xpp));
2512      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2513        res.setType(parseCoding(xpp));
2514      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
2515        res.setRole(parseCoding(xpp));
2516      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lifecycle")) {
2517        res.setLifecycle(parseCoding(xpp));
2518      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("securityLabel")) {
2519        res.getSecurityLabel().add(parseCoding(xpp));
2520      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
2521        res.setNameElement(parseString(xpp));
2522      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2523        res.setDescriptionElement(parseString(xpp));
2524      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("query")) {
2525        res.setQueryElement(parseBase64Binary(xpp));
2526      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
2527        res.getDetail().add(parseAuditEventAuditEventEntityDetailComponent(xpp, owner));
2528      } else if (!parseBackboneContent(eventType, xpp, res))
2529        return false;
2530    return true;
2531  }
2532
2533  protected AuditEvent.AuditEventEntityDetailComponent parseAuditEventAuditEventEntityDetailComponent(XmlPullParser xpp, AuditEvent owner) throws XmlPullParserException, IOException, FHIRFormatError {
2534    AuditEvent.AuditEventEntityDetailComponent res = new AuditEvent.AuditEventEntityDetailComponent();
2535    parseBackboneAttributes(xpp, res);
2536    next(xpp);
2537    int eventType = nextNoWhitespace(xpp);
2538    while (eventType != XmlPullParser.END_TAG) {
2539  if (!parseAuditEventAuditEventEntityDetailComponentContent(eventType, xpp, owner, res))
2540        unknownContent(xpp);
2541      eventType = nextNoWhitespace(xpp);
2542    }
2543    next(xpp);
2544    parseElementClose(res);
2545    return res;
2546  }
2547
2548  protected boolean parseAuditEventAuditEventEntityDetailComponentContent(int eventType, XmlPullParser xpp, AuditEvent owner, AuditEvent.AuditEventEntityDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2549      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2550        res.setTypeElement(parseString(xpp));
2551      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
2552        res.setValueElement(parseBase64Binary(xpp));
2553      } else if (!parseBackboneContent(eventType, xpp, res))
2554        return false;
2555    return true;
2556  }
2557
2558  protected Basic parseBasic(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2559    Basic res = new Basic();
2560    parseDomainResourceAttributes(xpp, res);
2561    next(xpp);
2562    int eventType = nextNoWhitespace(xpp);
2563    while (eventType != XmlPullParser.END_TAG) {
2564  if (!parseBasicContent(eventType, xpp, res))
2565        unknownContent(xpp);
2566      eventType = nextNoWhitespace(xpp);
2567    }
2568    next(xpp);
2569    parseElementClose(res);
2570    return res;
2571  }
2572
2573  protected boolean parseBasicContent(int eventType, XmlPullParser xpp, Basic res) throws XmlPullParserException, IOException, FHIRFormatError {
2574      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2575        res.getIdentifier().add(parseIdentifier(xpp));
2576      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
2577        res.setCode(parseCodeableConcept(xpp));
2578      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
2579        res.setSubject(parseReference(xpp));
2580      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
2581        res.setCreatedElement(parseDate(xpp));
2582      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
2583        res.setAuthor(parseReference(xpp));
2584      } else if (!parseDomainResourceContent(eventType, xpp, res))
2585        return false;
2586    return true;
2587  }
2588
2589  protected Binary parseBinary(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2590    Binary res = new Binary();
2591    parseResourceAttributes(xpp, res);
2592    next(xpp);
2593    int eventType = nextNoWhitespace(xpp);
2594    while (eventType != XmlPullParser.END_TAG) {
2595  if (!parseBinaryContent(eventType, xpp, res))
2596        unknownContent(xpp);
2597      eventType = nextNoWhitespace(xpp);
2598    }
2599    next(xpp);
2600    parseElementClose(res);
2601    return res;
2602  }
2603
2604  protected boolean parseBinaryContent(int eventType, XmlPullParser xpp, Binary res) throws XmlPullParserException, IOException, FHIRFormatError {
2605      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contentType")) {
2606        res.setContentTypeElement(parseCode(xpp));
2607      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("securityContext")) {
2608        res.setSecurityContext(parseReference(xpp));
2609      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("content")) {
2610        res.setContentElement(parseBase64Binary(xpp));
2611      } else if (!parseResourceContent(eventType, xpp, res))
2612        return false;
2613    return true;
2614  }
2615
2616  protected BodySite parseBodySite(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2617    BodySite res = new BodySite();
2618    parseDomainResourceAttributes(xpp, res);
2619    next(xpp);
2620    int eventType = nextNoWhitespace(xpp);
2621    while (eventType != XmlPullParser.END_TAG) {
2622  if (!parseBodySiteContent(eventType, xpp, res))
2623        unknownContent(xpp);
2624      eventType = nextNoWhitespace(xpp);
2625    }
2626    next(xpp);
2627    parseElementClose(res);
2628    return res;
2629  }
2630
2631  protected boolean parseBodySiteContent(int eventType, XmlPullParser xpp, BodySite res) throws XmlPullParserException, IOException, FHIRFormatError {
2632      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2633        res.getIdentifier().add(parseIdentifier(xpp));
2634      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("active")) {
2635        res.setActiveElement(parseBoolean(xpp));
2636      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
2637        res.setCode(parseCodeableConcept(xpp));
2638      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("qualifier")) {
2639        res.getQualifier().add(parseCodeableConcept(xpp));
2640      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2641        res.setDescriptionElement(parseString(xpp));
2642      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("image")) {
2643        res.getImage().add(parseAttachment(xpp));
2644      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
2645        res.setPatient(parseReference(xpp));
2646      } else if (!parseDomainResourceContent(eventType, xpp, res))
2647        return false;
2648    return true;
2649  }
2650
2651  protected Bundle parseBundle(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2652    Bundle res = new Bundle();
2653    parseResourceAttributes(xpp, res);
2654    next(xpp);
2655    int eventType = nextNoWhitespace(xpp);
2656    while (eventType != XmlPullParser.END_TAG) {
2657  if (!parseBundleContent(eventType, xpp, res))
2658        unknownContent(xpp);
2659      eventType = nextNoWhitespace(xpp);
2660    }
2661    next(xpp);
2662    parseElementClose(res);
2663    return res;
2664  }
2665
2666  protected boolean parseBundleContent(int eventType, XmlPullParser xpp, Bundle res) throws XmlPullParserException, IOException, FHIRFormatError {
2667      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2668        res.setIdentifier(parseIdentifier(xpp));
2669      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2670        res.setTypeElement(parseEnumeration(xpp, Bundle.BundleType.NULL, new Bundle.BundleTypeEnumFactory()));
2671      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("total")) {
2672        res.setTotalElement(parseUnsignedInt(xpp));
2673      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("link")) {
2674        res.getLink().add(parseBundleBundleLinkComponent(xpp, res));
2675      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("entry")) {
2676        res.getEntry().add(parseBundleBundleEntryComponent(xpp, res));
2677      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("signature")) {
2678        res.setSignature(parseSignature(xpp));
2679      } else if (!parseResourceContent(eventType, xpp, res))
2680        return false;
2681    return true;
2682  }
2683
2684  protected Bundle.BundleLinkComponent parseBundleBundleLinkComponent(XmlPullParser xpp, Bundle owner) throws XmlPullParserException, IOException, FHIRFormatError {
2685    Bundle.BundleLinkComponent res = new Bundle.BundleLinkComponent();
2686    parseBackboneAttributes(xpp, res);
2687    next(xpp);
2688    int eventType = nextNoWhitespace(xpp);
2689    while (eventType != XmlPullParser.END_TAG) {
2690  if (!parseBundleBundleLinkComponentContent(eventType, xpp, owner, res))
2691        unknownContent(xpp);
2692      eventType = nextNoWhitespace(xpp);
2693    }
2694    next(xpp);
2695    parseElementClose(res);
2696    return res;
2697  }
2698
2699  protected boolean parseBundleBundleLinkComponentContent(int eventType, XmlPullParser xpp, Bundle owner, Bundle.BundleLinkComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2700      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relation")) {
2701        res.setRelationElement(parseString(xpp));
2702      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
2703        res.setUrlElement(parseUri(xpp));
2704      } else if (!parseBackboneContent(eventType, xpp, res))
2705        return false;
2706    return true;
2707  }
2708
2709  protected Bundle.BundleEntryComponent parseBundleBundleEntryComponent(XmlPullParser xpp, Bundle owner) throws XmlPullParserException, IOException, FHIRFormatError {
2710    Bundle.BundleEntryComponent res = new Bundle.BundleEntryComponent();
2711    parseBackboneAttributes(xpp, res);
2712    next(xpp);
2713    int eventType = nextNoWhitespace(xpp);
2714    while (eventType != XmlPullParser.END_TAG) {
2715  if (!parseBundleBundleEntryComponentContent(eventType, xpp, owner, res))
2716        unknownContent(xpp);
2717      eventType = nextNoWhitespace(xpp);
2718    }
2719    next(xpp);
2720    parseElementClose(res);
2721    return res;
2722  }
2723
2724  protected boolean parseBundleBundleEntryComponentContent(int eventType, XmlPullParser xpp, Bundle owner, Bundle.BundleEntryComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2725      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("link")) {
2726        res.getLink().add(parseBundleBundleLinkComponent(xpp, owner));
2727      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fullUrl")) {
2728        res.setFullUrlElement(parseUri(xpp));
2729      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
2730        res.setResource(parseResourceContained(xpp));
2731      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("search")) {
2732        res.setSearch(parseBundleBundleEntrySearchComponent(xpp, owner));
2733      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
2734        res.setRequest(parseBundleBundleEntryRequestComponent(xpp, owner));
2735      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("response")) {
2736        res.setResponse(parseBundleBundleEntryResponseComponent(xpp, owner));
2737      } else if (!parseBackboneContent(eventType, xpp, res))
2738        return false;
2739    return true;
2740  }
2741
2742  protected Bundle.BundleEntrySearchComponent parseBundleBundleEntrySearchComponent(XmlPullParser xpp, Bundle owner) throws XmlPullParserException, IOException, FHIRFormatError {
2743    Bundle.BundleEntrySearchComponent res = new Bundle.BundleEntrySearchComponent();
2744    parseBackboneAttributes(xpp, res);
2745    next(xpp);
2746    int eventType = nextNoWhitespace(xpp);
2747    while (eventType != XmlPullParser.END_TAG) {
2748  if (!parseBundleBundleEntrySearchComponentContent(eventType, xpp, owner, res))
2749        unknownContent(xpp);
2750      eventType = nextNoWhitespace(xpp);
2751    }
2752    next(xpp);
2753    parseElementClose(res);
2754    return res;
2755  }
2756
2757  protected boolean parseBundleBundleEntrySearchComponentContent(int eventType, XmlPullParser xpp, Bundle owner, Bundle.BundleEntrySearchComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2758      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
2759        res.setModeElement(parseEnumeration(xpp, Bundle.SearchEntryMode.NULL, new Bundle.SearchEntryModeEnumFactory()));
2760      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("score")) {
2761        res.setScoreElement(parseDecimal(xpp));
2762      } else if (!parseBackboneContent(eventType, xpp, res))
2763        return false;
2764    return true;
2765  }
2766
2767  protected Bundle.BundleEntryRequestComponent parseBundleBundleEntryRequestComponent(XmlPullParser xpp, Bundle owner) throws XmlPullParserException, IOException, FHIRFormatError {
2768    Bundle.BundleEntryRequestComponent res = new Bundle.BundleEntryRequestComponent();
2769    parseBackboneAttributes(xpp, res);
2770    next(xpp);
2771    int eventType = nextNoWhitespace(xpp);
2772    while (eventType != XmlPullParser.END_TAG) {
2773  if (!parseBundleBundleEntryRequestComponentContent(eventType, xpp, owner, res))
2774        unknownContent(xpp);
2775      eventType = nextNoWhitespace(xpp);
2776    }
2777    next(xpp);
2778    parseElementClose(res);
2779    return res;
2780  }
2781
2782  protected boolean parseBundleBundleEntryRequestComponentContent(int eventType, XmlPullParser xpp, Bundle owner, Bundle.BundleEntryRequestComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2783      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("method")) {
2784        res.setMethodElement(parseEnumeration(xpp, Bundle.HTTPVerb.NULL, new Bundle.HTTPVerbEnumFactory()));
2785      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
2786        res.setUrlElement(parseUri(xpp));
2787      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ifNoneMatch")) {
2788        res.setIfNoneMatchElement(parseString(xpp));
2789      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ifModifiedSince")) {
2790        res.setIfModifiedSinceElement(parseInstant(xpp));
2791      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ifMatch")) {
2792        res.setIfMatchElement(parseString(xpp));
2793      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ifNoneExist")) {
2794        res.setIfNoneExistElement(parseString(xpp));
2795      } else if (!parseBackboneContent(eventType, xpp, res))
2796        return false;
2797    return true;
2798  }
2799
2800  protected Bundle.BundleEntryResponseComponent parseBundleBundleEntryResponseComponent(XmlPullParser xpp, Bundle owner) throws XmlPullParserException, IOException, FHIRFormatError {
2801    Bundle.BundleEntryResponseComponent res = new Bundle.BundleEntryResponseComponent();
2802    parseBackboneAttributes(xpp, res);
2803    next(xpp);
2804    int eventType = nextNoWhitespace(xpp);
2805    while (eventType != XmlPullParser.END_TAG) {
2806  if (!parseBundleBundleEntryResponseComponentContent(eventType, xpp, owner, res))
2807        unknownContent(xpp);
2808      eventType = nextNoWhitespace(xpp);
2809    }
2810    next(xpp);
2811    parseElementClose(res);
2812    return res;
2813  }
2814
2815  protected boolean parseBundleBundleEntryResponseComponentContent(int eventType, XmlPullParser xpp, Bundle owner, Bundle.BundleEntryResponseComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2816      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
2817        res.setStatusElement(parseString(xpp));
2818      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
2819        res.setLocationElement(parseUri(xpp));
2820      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("etag")) {
2821        res.setEtagElement(parseString(xpp));
2822      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastModified")) {
2823        res.setLastModifiedElement(parseInstant(xpp));
2824      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
2825        res.setOutcome(parseResourceContained(xpp));
2826      } else if (!parseBackboneContent(eventType, xpp, res))
2827        return false;
2828    return true;
2829  }
2830
2831  protected CapabilityStatement parseCapabilityStatement(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2832    CapabilityStatement res = new CapabilityStatement();
2833    parseDomainResourceAttributes(xpp, res);
2834    next(xpp);
2835    int eventType = nextNoWhitespace(xpp);
2836    while (eventType != XmlPullParser.END_TAG) {
2837  if (!parseCapabilityStatementContent(eventType, xpp, res))
2838        unknownContent(xpp);
2839      eventType = nextNoWhitespace(xpp);
2840    }
2841    next(xpp);
2842    parseElementClose(res);
2843    return res;
2844  }
2845
2846  protected boolean parseCapabilityStatementContent(int eventType, XmlPullParser xpp, CapabilityStatement res) throws XmlPullParserException, IOException, FHIRFormatError {
2847      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
2848        res.setUrlElement(parseUri(xpp));
2849      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
2850        res.setVersionElement(parseString(xpp));
2851      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
2852        res.setNameElement(parseString(xpp));
2853      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
2854        res.setTitleElement(parseString(xpp));
2855      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
2856        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
2857      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
2858        res.setExperimentalElement(parseBoolean(xpp));
2859      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
2860        res.setDateElement(parseDateTime(xpp));
2861      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
2862        res.setPublisherElement(parseString(xpp));
2863      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
2864        res.getContact().add(parseContactDetail(xpp));
2865      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2866        res.setDescriptionElement(parseMarkdown(xpp));
2867      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
2868        res.getUseContext().add(parseUsageContext(xpp));
2869      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
2870        res.getJurisdiction().add(parseCodeableConcept(xpp));
2871      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
2872        res.setPurposeElement(parseMarkdown(xpp));
2873      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
2874        res.setCopyrightElement(parseMarkdown(xpp));
2875      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("kind")) {
2876        res.setKindElement(parseEnumeration(xpp, CapabilityStatement.CapabilityStatementKind.NULL, new CapabilityStatement.CapabilityStatementKindEnumFactory()));
2877      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instantiates")) {
2878        res.getInstantiates().add(parseUri(xpp));
2879      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("software")) {
2880        res.setSoftware(parseCapabilityStatementCapabilityStatementSoftwareComponent(xpp, res));
2881      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("implementation")) {
2882        res.setImplementation(parseCapabilityStatementCapabilityStatementImplementationComponent(xpp, res));
2883      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fhirVersion")) {
2884        res.setFhirVersionElement(parseId(xpp));
2885      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("acceptUnknown")) {
2886        res.setAcceptUnknownElement(parseEnumeration(xpp, CapabilityStatement.UnknownContentCode.NULL, new CapabilityStatement.UnknownContentCodeEnumFactory()));
2887      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("format")) {
2888        res.getFormat().add(parseCode(xpp));
2889      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patchFormat")) {
2890        res.getPatchFormat().add(parseCode(xpp));
2891      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("implementationGuide")) {
2892        res.getImplementationGuide().add(parseUri(xpp));
2893      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
2894        res.getProfile().add(parseReference(xpp));
2895      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rest")) {
2896        res.getRest().add(parseCapabilityStatementCapabilityStatementRestComponent(xpp, res));
2897      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("messaging")) {
2898        res.getMessaging().add(parseCapabilityStatementCapabilityStatementMessagingComponent(xpp, res));
2899      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("document")) {
2900        res.getDocument().add(parseCapabilityStatementCapabilityStatementDocumentComponent(xpp, res));
2901      } else if (!parseDomainResourceContent(eventType, xpp, res))
2902        return false;
2903    return true;
2904  }
2905
2906  protected CapabilityStatement.CapabilityStatementSoftwareComponent parseCapabilityStatementCapabilityStatementSoftwareComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
2907    CapabilityStatement.CapabilityStatementSoftwareComponent res = new CapabilityStatement.CapabilityStatementSoftwareComponent();
2908    parseBackboneAttributes(xpp, res);
2909    next(xpp);
2910    int eventType = nextNoWhitespace(xpp);
2911    while (eventType != XmlPullParser.END_TAG) {
2912  if (!parseCapabilityStatementCapabilityStatementSoftwareComponentContent(eventType, xpp, owner, res))
2913        unknownContent(xpp);
2914      eventType = nextNoWhitespace(xpp);
2915    }
2916    next(xpp);
2917    parseElementClose(res);
2918    return res;
2919  }
2920
2921  protected boolean parseCapabilityStatementCapabilityStatementSoftwareComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementSoftwareComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2922      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
2923        res.setNameElement(parseString(xpp));
2924      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
2925        res.setVersionElement(parseString(xpp));
2926      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("releaseDate")) {
2927        res.setReleaseDateElement(parseDateTime(xpp));
2928      } else if (!parseBackboneContent(eventType, xpp, res))
2929        return false;
2930    return true;
2931  }
2932
2933  protected CapabilityStatement.CapabilityStatementImplementationComponent parseCapabilityStatementCapabilityStatementImplementationComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
2934    CapabilityStatement.CapabilityStatementImplementationComponent res = new CapabilityStatement.CapabilityStatementImplementationComponent();
2935    parseBackboneAttributes(xpp, res);
2936    next(xpp);
2937    int eventType = nextNoWhitespace(xpp);
2938    while (eventType != XmlPullParser.END_TAG) {
2939  if (!parseCapabilityStatementCapabilityStatementImplementationComponentContent(eventType, xpp, owner, res))
2940        unknownContent(xpp);
2941      eventType = nextNoWhitespace(xpp);
2942    }
2943    next(xpp);
2944    parseElementClose(res);
2945    return res;
2946  }
2947
2948  protected boolean parseCapabilityStatementCapabilityStatementImplementationComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementImplementationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2949      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2950        res.setDescriptionElement(parseString(xpp));
2951      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
2952        res.setUrlElement(parseUri(xpp));
2953      } else if (!parseBackboneContent(eventType, xpp, res))
2954        return false;
2955    return true;
2956  }
2957
2958  protected CapabilityStatement.CapabilityStatementRestComponent parseCapabilityStatementCapabilityStatementRestComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
2959    CapabilityStatement.CapabilityStatementRestComponent res = new CapabilityStatement.CapabilityStatementRestComponent();
2960    parseBackboneAttributes(xpp, res);
2961    next(xpp);
2962    int eventType = nextNoWhitespace(xpp);
2963    while (eventType != XmlPullParser.END_TAG) {
2964  if (!parseCapabilityStatementCapabilityStatementRestComponentContent(eventType, xpp, owner, res))
2965        unknownContent(xpp);
2966      eventType = nextNoWhitespace(xpp);
2967    }
2968    next(xpp);
2969    parseElementClose(res);
2970    return res;
2971  }
2972
2973  protected boolean parseCapabilityStatementCapabilityStatementRestComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementRestComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2974      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
2975        res.setModeElement(parseEnumeration(xpp, CapabilityStatement.RestfulCapabilityMode.NULL, new CapabilityStatement.RestfulCapabilityModeEnumFactory()));
2976      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
2977        res.setDocumentationElement(parseString(xpp));
2978      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("security")) {
2979        res.setSecurity(parseCapabilityStatementCapabilityStatementRestSecurityComponent(xpp, owner));
2980      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
2981        res.getResource().add(parseCapabilityStatementCapabilityStatementRestResourceComponent(xpp, owner));
2982      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("interaction")) {
2983        res.getInteraction().add(parseCapabilityStatementSystemInteractionComponent(xpp, owner));
2984      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchParam")) {
2985        res.getSearchParam().add(parseCapabilityStatementCapabilityStatementRestResourceSearchParamComponent(xpp, owner));
2986      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operation")) {
2987        res.getOperation().add(parseCapabilityStatementCapabilityStatementRestOperationComponent(xpp, owner));
2988      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("compartment")) {
2989        res.getCompartment().add(parseUri(xpp));
2990      } else if (!parseBackboneContent(eventType, xpp, res))
2991        return false;
2992    return true;
2993  }
2994
2995  protected CapabilityStatement.CapabilityStatementRestSecurityComponent parseCapabilityStatementCapabilityStatementRestSecurityComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
2996    CapabilityStatement.CapabilityStatementRestSecurityComponent res = new CapabilityStatement.CapabilityStatementRestSecurityComponent();
2997    parseBackboneAttributes(xpp, res);
2998    next(xpp);
2999    int eventType = nextNoWhitespace(xpp);
3000    while (eventType != XmlPullParser.END_TAG) {
3001  if (!parseCapabilityStatementCapabilityStatementRestSecurityComponentContent(eventType, xpp, owner, res))
3002        unknownContent(xpp);
3003      eventType = nextNoWhitespace(xpp);
3004    }
3005    next(xpp);
3006    parseElementClose(res);
3007    return res;
3008  }
3009
3010  protected boolean parseCapabilityStatementCapabilityStatementRestSecurityComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementRestSecurityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3011      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("cors")) {
3012        res.setCorsElement(parseBoolean(xpp));
3013      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
3014        res.getService().add(parseCodeableConcept(xpp));
3015      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
3016        res.setDescriptionElement(parseString(xpp));
3017      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("certificate")) {
3018        res.getCertificate().add(parseCapabilityStatementCapabilityStatementRestSecurityCertificateComponent(xpp, owner));
3019      } else if (!parseBackboneContent(eventType, xpp, res))
3020        return false;
3021    return true;
3022  }
3023
3024  protected CapabilityStatement.CapabilityStatementRestSecurityCertificateComponent parseCapabilityStatementCapabilityStatementRestSecurityCertificateComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3025    CapabilityStatement.CapabilityStatementRestSecurityCertificateComponent res = new CapabilityStatement.CapabilityStatementRestSecurityCertificateComponent();
3026    parseBackboneAttributes(xpp, res);
3027    next(xpp);
3028    int eventType = nextNoWhitespace(xpp);
3029    while (eventType != XmlPullParser.END_TAG) {
3030  if (!parseCapabilityStatementCapabilityStatementRestSecurityCertificateComponentContent(eventType, xpp, owner, res))
3031        unknownContent(xpp);
3032      eventType = nextNoWhitespace(xpp);
3033    }
3034    next(xpp);
3035    parseElementClose(res);
3036    return res;
3037  }
3038
3039  protected boolean parseCapabilityStatementCapabilityStatementRestSecurityCertificateComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementRestSecurityCertificateComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3040      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3041        res.setTypeElement(parseCode(xpp));
3042      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("blob")) {
3043        res.setBlobElement(parseBase64Binary(xpp));
3044      } else if (!parseBackboneContent(eventType, xpp, res))
3045        return false;
3046    return true;
3047  }
3048
3049  protected CapabilityStatement.CapabilityStatementRestResourceComponent parseCapabilityStatementCapabilityStatementRestResourceComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3050    CapabilityStatement.CapabilityStatementRestResourceComponent res = new CapabilityStatement.CapabilityStatementRestResourceComponent();
3051    parseBackboneAttributes(xpp, res);
3052    next(xpp);
3053    int eventType = nextNoWhitespace(xpp);
3054    while (eventType != XmlPullParser.END_TAG) {
3055  if (!parseCapabilityStatementCapabilityStatementRestResourceComponentContent(eventType, xpp, owner, res))
3056        unknownContent(xpp);
3057      eventType = nextNoWhitespace(xpp);
3058    }
3059    next(xpp);
3060    parseElementClose(res);
3061    return res;
3062  }
3063
3064  protected boolean parseCapabilityStatementCapabilityStatementRestResourceComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementRestResourceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3065      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3066        res.setTypeElement(parseCode(xpp));
3067      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
3068        res.setProfile(parseReference(xpp));
3069      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
3070        res.setDocumentationElement(parseMarkdown(xpp));
3071      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("interaction")) {
3072        res.getInteraction().add(parseCapabilityStatementResourceInteractionComponent(xpp, owner));
3073      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("versioning")) {
3074        res.setVersioningElement(parseEnumeration(xpp, CapabilityStatement.ResourceVersionPolicy.NULL, new CapabilityStatement.ResourceVersionPolicyEnumFactory()));
3075      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("readHistory")) {
3076        res.setReadHistoryElement(parseBoolean(xpp));
3077      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("updateCreate")) {
3078        res.setUpdateCreateElement(parseBoolean(xpp));
3079      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("conditionalCreate")) {
3080        res.setConditionalCreateElement(parseBoolean(xpp));
3081      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("conditionalRead")) {
3082        res.setConditionalReadElement(parseEnumeration(xpp, CapabilityStatement.ConditionalReadStatus.NULL, new CapabilityStatement.ConditionalReadStatusEnumFactory()));
3083      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("conditionalUpdate")) {
3084        res.setConditionalUpdateElement(parseBoolean(xpp));
3085      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("conditionalDelete")) {
3086        res.setConditionalDeleteElement(parseEnumeration(xpp, CapabilityStatement.ConditionalDeleteStatus.NULL, new CapabilityStatement.ConditionalDeleteStatusEnumFactory()));
3087      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referencePolicy")) {
3088        res.getReferencePolicy().add(parseEnumeration(xpp, CapabilityStatement.ReferenceHandlingPolicy.NULL, new CapabilityStatement.ReferenceHandlingPolicyEnumFactory()));
3089      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchInclude")) {
3090        res.getSearchInclude().add(parseString(xpp));
3091      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchRevInclude")) {
3092        res.getSearchRevInclude().add(parseString(xpp));
3093      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchParam")) {
3094        res.getSearchParam().add(parseCapabilityStatementCapabilityStatementRestResourceSearchParamComponent(xpp, owner));
3095      } else if (!parseBackboneContent(eventType, xpp, res))
3096        return false;
3097    return true;
3098  }
3099
3100  protected CapabilityStatement.ResourceInteractionComponent parseCapabilityStatementResourceInteractionComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3101    CapabilityStatement.ResourceInteractionComponent res = new CapabilityStatement.ResourceInteractionComponent();
3102    parseBackboneAttributes(xpp, res);
3103    next(xpp);
3104    int eventType = nextNoWhitespace(xpp);
3105    while (eventType != XmlPullParser.END_TAG) {
3106  if (!parseCapabilityStatementResourceInteractionComponentContent(eventType, xpp, owner, res))
3107        unknownContent(xpp);
3108      eventType = nextNoWhitespace(xpp);
3109    }
3110    next(xpp);
3111    parseElementClose(res);
3112    return res;
3113  }
3114
3115  protected boolean parseCapabilityStatementResourceInteractionComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.ResourceInteractionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3116      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
3117        res.setCodeElement(parseEnumeration(xpp, CapabilityStatement.TypeRestfulInteraction.NULL, new CapabilityStatement.TypeRestfulInteractionEnumFactory()));
3118      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
3119        res.setDocumentationElement(parseString(xpp));
3120      } else if (!parseBackboneContent(eventType, xpp, res))
3121        return false;
3122    return true;
3123  }
3124
3125  protected CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent parseCapabilityStatementCapabilityStatementRestResourceSearchParamComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3126    CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent res = new CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent();
3127    parseBackboneAttributes(xpp, res);
3128    next(xpp);
3129    int eventType = nextNoWhitespace(xpp);
3130    while (eventType != XmlPullParser.END_TAG) {
3131  if (!parseCapabilityStatementCapabilityStatementRestResourceSearchParamComponentContent(eventType, xpp, owner, res))
3132        unknownContent(xpp);
3133      eventType = nextNoWhitespace(xpp);
3134    }
3135    next(xpp);
3136    parseElementClose(res);
3137    return res;
3138  }
3139
3140  protected boolean parseCapabilityStatementCapabilityStatementRestResourceSearchParamComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3141      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
3142        res.setNameElement(parseString(xpp));
3143      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
3144        res.setDefinitionElement(parseUri(xpp));
3145      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3146        res.setTypeElement(parseEnumeration(xpp, Enumerations.SearchParamType.NULL, new Enumerations.SearchParamTypeEnumFactory()));
3147      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
3148        res.setDocumentationElement(parseString(xpp));
3149      } else if (!parseBackboneContent(eventType, xpp, res))
3150        return false;
3151    return true;
3152  }
3153
3154  protected CapabilityStatement.SystemInteractionComponent parseCapabilityStatementSystemInteractionComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3155    CapabilityStatement.SystemInteractionComponent res = new CapabilityStatement.SystemInteractionComponent();
3156    parseBackboneAttributes(xpp, res);
3157    next(xpp);
3158    int eventType = nextNoWhitespace(xpp);
3159    while (eventType != XmlPullParser.END_TAG) {
3160  if (!parseCapabilityStatementSystemInteractionComponentContent(eventType, xpp, owner, res))
3161        unknownContent(xpp);
3162      eventType = nextNoWhitespace(xpp);
3163    }
3164    next(xpp);
3165    parseElementClose(res);
3166    return res;
3167  }
3168
3169  protected boolean parseCapabilityStatementSystemInteractionComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.SystemInteractionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3170      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
3171        res.setCodeElement(parseEnumeration(xpp, CapabilityStatement.SystemRestfulInteraction.NULL, new CapabilityStatement.SystemRestfulInteractionEnumFactory()));
3172      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
3173        res.setDocumentationElement(parseString(xpp));
3174      } else if (!parseBackboneContent(eventType, xpp, res))
3175        return false;
3176    return true;
3177  }
3178
3179  protected CapabilityStatement.CapabilityStatementRestOperationComponent parseCapabilityStatementCapabilityStatementRestOperationComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3180    CapabilityStatement.CapabilityStatementRestOperationComponent res = new CapabilityStatement.CapabilityStatementRestOperationComponent();
3181    parseBackboneAttributes(xpp, res);
3182    next(xpp);
3183    int eventType = nextNoWhitespace(xpp);
3184    while (eventType != XmlPullParser.END_TAG) {
3185  if (!parseCapabilityStatementCapabilityStatementRestOperationComponentContent(eventType, xpp, owner, res))
3186        unknownContent(xpp);
3187      eventType = nextNoWhitespace(xpp);
3188    }
3189    next(xpp);
3190    parseElementClose(res);
3191    return res;
3192  }
3193
3194  protected boolean parseCapabilityStatementCapabilityStatementRestOperationComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementRestOperationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3195      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
3196        res.setNameElement(parseString(xpp));
3197      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
3198        res.setDefinition(parseReference(xpp));
3199      } else if (!parseBackboneContent(eventType, xpp, res))
3200        return false;
3201    return true;
3202  }
3203
3204  protected CapabilityStatement.CapabilityStatementMessagingComponent parseCapabilityStatementCapabilityStatementMessagingComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3205    CapabilityStatement.CapabilityStatementMessagingComponent res = new CapabilityStatement.CapabilityStatementMessagingComponent();
3206    parseBackboneAttributes(xpp, res);
3207    next(xpp);
3208    int eventType = nextNoWhitespace(xpp);
3209    while (eventType != XmlPullParser.END_TAG) {
3210  if (!parseCapabilityStatementCapabilityStatementMessagingComponentContent(eventType, xpp, owner, res))
3211        unknownContent(xpp);
3212      eventType = nextNoWhitespace(xpp);
3213    }
3214    next(xpp);
3215    parseElementClose(res);
3216    return res;
3217  }
3218
3219  protected boolean parseCapabilityStatementCapabilityStatementMessagingComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementMessagingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3220      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("endpoint")) {
3221        res.getEndpoint().add(parseCapabilityStatementCapabilityStatementMessagingEndpointComponent(xpp, owner));
3222      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reliableCache")) {
3223        res.setReliableCacheElement(parseUnsignedInt(xpp));
3224      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
3225        res.setDocumentationElement(parseString(xpp));
3226      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportedMessage")) {
3227        res.getSupportedMessage().add(parseCapabilityStatementCapabilityStatementMessagingSupportedMessageComponent(xpp, owner));
3228      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("event")) {
3229        res.getEvent().add(parseCapabilityStatementCapabilityStatementMessagingEventComponent(xpp, owner));
3230      } else if (!parseBackboneContent(eventType, xpp, res))
3231        return false;
3232    return true;
3233  }
3234
3235  protected CapabilityStatement.CapabilityStatementMessagingEndpointComponent parseCapabilityStatementCapabilityStatementMessagingEndpointComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3236    CapabilityStatement.CapabilityStatementMessagingEndpointComponent res = new CapabilityStatement.CapabilityStatementMessagingEndpointComponent();
3237    parseBackboneAttributes(xpp, res);
3238    next(xpp);
3239    int eventType = nextNoWhitespace(xpp);
3240    while (eventType != XmlPullParser.END_TAG) {
3241  if (!parseCapabilityStatementCapabilityStatementMessagingEndpointComponentContent(eventType, xpp, owner, res))
3242        unknownContent(xpp);
3243      eventType = nextNoWhitespace(xpp);
3244    }
3245    next(xpp);
3246    parseElementClose(res);
3247    return res;
3248  }
3249
3250  protected boolean parseCapabilityStatementCapabilityStatementMessagingEndpointComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementMessagingEndpointComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3251      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("protocol")) {
3252        res.setProtocol(parseCoding(xpp));
3253      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("address")) {
3254        res.setAddressElement(parseUri(xpp));
3255      } else if (!parseBackboneContent(eventType, xpp, res))
3256        return false;
3257    return true;
3258  }
3259
3260  protected CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent parseCapabilityStatementCapabilityStatementMessagingSupportedMessageComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3261    CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent res = new CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent();
3262    parseBackboneAttributes(xpp, res);
3263    next(xpp);
3264    int eventType = nextNoWhitespace(xpp);
3265    while (eventType != XmlPullParser.END_TAG) {
3266  if (!parseCapabilityStatementCapabilityStatementMessagingSupportedMessageComponentContent(eventType, xpp, owner, res))
3267        unknownContent(xpp);
3268      eventType = nextNoWhitespace(xpp);
3269    }
3270    next(xpp);
3271    parseElementClose(res);
3272    return res;
3273  }
3274
3275  protected boolean parseCapabilityStatementCapabilityStatementMessagingSupportedMessageComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3276      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
3277        res.setModeElement(parseEnumeration(xpp, CapabilityStatement.EventCapabilityMode.NULL, new CapabilityStatement.EventCapabilityModeEnumFactory()));
3278      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
3279        res.setDefinition(parseReference(xpp));
3280      } else if (!parseBackboneContent(eventType, xpp, res))
3281        return false;
3282    return true;
3283  }
3284
3285  protected CapabilityStatement.CapabilityStatementMessagingEventComponent parseCapabilityStatementCapabilityStatementMessagingEventComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3286    CapabilityStatement.CapabilityStatementMessagingEventComponent res = new CapabilityStatement.CapabilityStatementMessagingEventComponent();
3287    parseBackboneAttributes(xpp, res);
3288    next(xpp);
3289    int eventType = nextNoWhitespace(xpp);
3290    while (eventType != XmlPullParser.END_TAG) {
3291  if (!parseCapabilityStatementCapabilityStatementMessagingEventComponentContent(eventType, xpp, owner, res))
3292        unknownContent(xpp);
3293      eventType = nextNoWhitespace(xpp);
3294    }
3295    next(xpp);
3296    parseElementClose(res);
3297    return res;
3298  }
3299
3300  protected boolean parseCapabilityStatementCapabilityStatementMessagingEventComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementMessagingEventComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3301      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
3302        res.setCode(parseCoding(xpp));
3303      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
3304        res.setCategoryElement(parseEnumeration(xpp, CapabilityStatement.MessageSignificanceCategory.NULL, new CapabilityStatement.MessageSignificanceCategoryEnumFactory()));
3305      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
3306        res.setModeElement(parseEnumeration(xpp, CapabilityStatement.EventCapabilityMode.NULL, new CapabilityStatement.EventCapabilityModeEnumFactory()));
3307      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("focus")) {
3308        res.setFocusElement(parseCode(xpp));
3309      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
3310        res.setRequest(parseReference(xpp));
3311      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("response")) {
3312        res.setResponse(parseReference(xpp));
3313      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
3314        res.setDocumentationElement(parseString(xpp));
3315      } else if (!parseBackboneContent(eventType, xpp, res))
3316        return false;
3317    return true;
3318  }
3319
3320  protected CapabilityStatement.CapabilityStatementDocumentComponent parseCapabilityStatementCapabilityStatementDocumentComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3321    CapabilityStatement.CapabilityStatementDocumentComponent res = new CapabilityStatement.CapabilityStatementDocumentComponent();
3322    parseBackboneAttributes(xpp, res);
3323    next(xpp);
3324    int eventType = nextNoWhitespace(xpp);
3325    while (eventType != XmlPullParser.END_TAG) {
3326  if (!parseCapabilityStatementCapabilityStatementDocumentComponentContent(eventType, xpp, owner, res))
3327        unknownContent(xpp);
3328      eventType = nextNoWhitespace(xpp);
3329    }
3330    next(xpp);
3331    parseElementClose(res);
3332    return res;
3333  }
3334
3335  protected boolean parseCapabilityStatementCapabilityStatementDocumentComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementDocumentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3336      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
3337        res.setModeElement(parseEnumeration(xpp, CapabilityStatement.DocumentMode.NULL, new CapabilityStatement.DocumentModeEnumFactory()));
3338      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
3339        res.setDocumentationElement(parseString(xpp));
3340      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
3341        res.setProfile(parseReference(xpp));
3342      } else if (!parseBackboneContent(eventType, xpp, res))
3343        return false;
3344    return true;
3345  }
3346
3347  protected CarePlan parseCarePlan(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3348    CarePlan res = new CarePlan();
3349    parseDomainResourceAttributes(xpp, res);
3350    next(xpp);
3351    int eventType = nextNoWhitespace(xpp);
3352    while (eventType != XmlPullParser.END_TAG) {
3353  if (!parseCarePlanContent(eventType, xpp, res))
3354        unknownContent(xpp);
3355      eventType = nextNoWhitespace(xpp);
3356    }
3357    next(xpp);
3358    parseElementClose(res);
3359    return res;
3360  }
3361
3362  protected boolean parseCarePlanContent(int eventType, XmlPullParser xpp, CarePlan res) throws XmlPullParserException, IOException, FHIRFormatError {
3363      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
3364        res.getIdentifier().add(parseIdentifier(xpp));
3365      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
3366        res.getDefinition().add(parseReference(xpp));
3367      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
3368        res.getBasedOn().add(parseReference(xpp));
3369      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("replaces")) {
3370        res.getReplaces().add(parseReference(xpp));
3371      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
3372        res.getPartOf().add(parseReference(xpp));
3373      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
3374        res.setStatusElement(parseEnumeration(xpp, CarePlan.CarePlanStatus.NULL, new CarePlan.CarePlanStatusEnumFactory()));
3375      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("intent")) {
3376        res.setIntentElement(parseEnumeration(xpp, CarePlan.CarePlanIntent.NULL, new CarePlan.CarePlanIntentEnumFactory()));
3377      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
3378        res.getCategory().add(parseCodeableConcept(xpp));
3379      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
3380        res.setTitleElement(parseString(xpp));
3381      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
3382        res.setDescriptionElement(parseString(xpp));
3383      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
3384        res.setSubject(parseReference(xpp));
3385      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
3386        res.setContext(parseReference(xpp));
3387      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
3388        res.setPeriod(parsePeriod(xpp));
3389      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
3390        res.getAuthor().add(parseReference(xpp));
3391      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("careTeam")) {
3392        res.getCareTeam().add(parseReference(xpp));
3393      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("addresses")) {
3394        res.getAddresses().add(parseReference(xpp));
3395      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInfo")) {
3396        res.getSupportingInfo().add(parseReference(xpp));
3397      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("goal")) {
3398        res.getGoal().add(parseReference(xpp));
3399      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("activity")) {
3400        res.getActivity().add(parseCarePlanCarePlanActivityComponent(xpp, res));
3401      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
3402        res.getNote().add(parseAnnotation(xpp));
3403      } else if (!parseDomainResourceContent(eventType, xpp, res))
3404        return false;
3405    return true;
3406  }
3407
3408  protected CarePlan.CarePlanActivityComponent parseCarePlanCarePlanActivityComponent(XmlPullParser xpp, CarePlan owner) throws XmlPullParserException, IOException, FHIRFormatError {
3409    CarePlan.CarePlanActivityComponent res = new CarePlan.CarePlanActivityComponent();
3410    parseBackboneAttributes(xpp, res);
3411    next(xpp);
3412    int eventType = nextNoWhitespace(xpp);
3413    while (eventType != XmlPullParser.END_TAG) {
3414  if (!parseCarePlanCarePlanActivityComponentContent(eventType, xpp, owner, res))
3415        unknownContent(xpp);
3416      eventType = nextNoWhitespace(xpp);
3417    }
3418    next(xpp);
3419    parseElementClose(res);
3420    return res;
3421  }
3422
3423  protected boolean parseCarePlanCarePlanActivityComponentContent(int eventType, XmlPullParser xpp, CarePlan owner, CarePlan.CarePlanActivityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3424      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcomeCodeableConcept")) {
3425        res.getOutcomeCodeableConcept().add(parseCodeableConcept(xpp));
3426      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcomeReference")) {
3427        res.getOutcomeReference().add(parseReference(xpp));
3428      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("progress")) {
3429        res.getProgress().add(parseAnnotation(xpp));
3430      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
3431        res.setReference(parseReference(xpp));
3432      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
3433        res.setDetail(parseCarePlanCarePlanActivityDetailComponent(xpp, owner));
3434      } else if (!parseBackboneContent(eventType, xpp, res))
3435        return false;
3436    return true;
3437  }
3438
3439  protected CarePlan.CarePlanActivityDetailComponent parseCarePlanCarePlanActivityDetailComponent(XmlPullParser xpp, CarePlan owner) throws XmlPullParserException, IOException, FHIRFormatError {
3440    CarePlan.CarePlanActivityDetailComponent res = new CarePlan.CarePlanActivityDetailComponent();
3441    parseBackboneAttributes(xpp, res);
3442    next(xpp);
3443    int eventType = nextNoWhitespace(xpp);
3444    while (eventType != XmlPullParser.END_TAG) {
3445  if (!parseCarePlanCarePlanActivityDetailComponentContent(eventType, xpp, owner, res))
3446        unknownContent(xpp);
3447      eventType = nextNoWhitespace(xpp);
3448    }
3449    next(xpp);
3450    parseElementClose(res);
3451    return res;
3452  }
3453
3454  protected boolean parseCarePlanCarePlanActivityDetailComponentContent(int eventType, XmlPullParser xpp, CarePlan owner, CarePlan.CarePlanActivityDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3455      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
3456        res.setCategory(parseCodeableConcept(xpp));
3457      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
3458        res.setDefinition(parseReference(xpp));
3459      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
3460        res.setCode(parseCodeableConcept(xpp));
3461      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonCode")) {
3462        res.getReasonCode().add(parseCodeableConcept(xpp));
3463      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonReference")) {
3464        res.getReasonReference().add(parseReference(xpp));
3465      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("goal")) {
3466        res.getGoal().add(parseReference(xpp));
3467      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
3468        res.setStatusElement(parseEnumeration(xpp, CarePlan.CarePlanActivityStatus.NULL, new CarePlan.CarePlanActivityStatusEnumFactory()));
3469      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("statusReason")) {
3470        res.setStatusReasonElement(parseString(xpp));
3471      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prohibited")) {
3472        res.setProhibitedElement(parseBoolean(xpp));
3473      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "scheduled")) {
3474        res.setScheduled(parseType("scheduled", xpp));
3475      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
3476        res.setLocation(parseReference(xpp));
3477      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performer")) {
3478        res.getPerformer().add(parseReference(xpp));
3479      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "product")) {
3480        res.setProduct(parseType("product", xpp));
3481      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dailyAmount")) {
3482        res.setDailyAmount(parseSimpleQuantity(xpp));
3483      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
3484        res.setQuantity(parseSimpleQuantity(xpp));
3485      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
3486        res.setDescriptionElement(parseString(xpp));
3487      } else if (!parseBackboneContent(eventType, xpp, res))
3488        return false;
3489    return true;
3490  }
3491
3492  protected CareTeam parseCareTeam(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3493    CareTeam res = new CareTeam();
3494    parseDomainResourceAttributes(xpp, res);
3495    next(xpp);
3496    int eventType = nextNoWhitespace(xpp);
3497    while (eventType != XmlPullParser.END_TAG) {
3498  if (!parseCareTeamContent(eventType, xpp, res))
3499        unknownContent(xpp);
3500      eventType = nextNoWhitespace(xpp);
3501    }
3502    next(xpp);
3503    parseElementClose(res);
3504    return res;
3505  }
3506
3507  protected boolean parseCareTeamContent(int eventType, XmlPullParser xpp, CareTeam res) throws XmlPullParserException, IOException, FHIRFormatError {
3508      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
3509        res.getIdentifier().add(parseIdentifier(xpp));
3510      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
3511        res.setStatusElement(parseEnumeration(xpp, CareTeam.CareTeamStatus.NULL, new CareTeam.CareTeamStatusEnumFactory()));
3512      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
3513        res.getCategory().add(parseCodeableConcept(xpp));
3514      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
3515        res.setNameElement(parseString(xpp));
3516      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
3517        res.setSubject(parseReference(xpp));
3518      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
3519        res.setContext(parseReference(xpp));
3520      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
3521        res.setPeriod(parsePeriod(xpp));
3522      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
3523        res.getParticipant().add(parseCareTeamCareTeamParticipantComponent(xpp, res));
3524      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonCode")) {
3525        res.getReasonCode().add(parseCodeableConcept(xpp));
3526      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonReference")) {
3527        res.getReasonReference().add(parseReference(xpp));
3528      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("managingOrganization")) {
3529        res.getManagingOrganization().add(parseReference(xpp));
3530      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
3531        res.getNote().add(parseAnnotation(xpp));
3532      } else if (!parseDomainResourceContent(eventType, xpp, res))
3533        return false;
3534    return true;
3535  }
3536
3537  protected CareTeam.CareTeamParticipantComponent parseCareTeamCareTeamParticipantComponent(XmlPullParser xpp, CareTeam owner) throws XmlPullParserException, IOException, FHIRFormatError {
3538    CareTeam.CareTeamParticipantComponent res = new CareTeam.CareTeamParticipantComponent();
3539    parseBackboneAttributes(xpp, res);
3540    next(xpp);
3541    int eventType = nextNoWhitespace(xpp);
3542    while (eventType != XmlPullParser.END_TAG) {
3543  if (!parseCareTeamCareTeamParticipantComponentContent(eventType, xpp, owner, res))
3544        unknownContent(xpp);
3545      eventType = nextNoWhitespace(xpp);
3546    }
3547    next(xpp);
3548    parseElementClose(res);
3549    return res;
3550  }
3551
3552  protected boolean parseCareTeamCareTeamParticipantComponentContent(int eventType, XmlPullParser xpp, CareTeam owner, CareTeam.CareTeamParticipantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3553      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
3554        res.setRole(parseCodeableConcept(xpp));
3555      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("member")) {
3556        res.setMember(parseReference(xpp));
3557      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onBehalfOf")) {
3558        res.setOnBehalfOf(parseReference(xpp));
3559      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
3560        res.setPeriod(parsePeriod(xpp));
3561      } else if (!parseBackboneContent(eventType, xpp, res))
3562        return false;
3563    return true;
3564  }
3565
3566  protected ChargeItem parseChargeItem(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3567    ChargeItem res = new ChargeItem();
3568    parseDomainResourceAttributes(xpp, res);
3569    next(xpp);
3570    int eventType = nextNoWhitespace(xpp);
3571    while (eventType != XmlPullParser.END_TAG) {
3572  if (!parseChargeItemContent(eventType, xpp, res))
3573        unknownContent(xpp);
3574      eventType = nextNoWhitespace(xpp);
3575    }
3576    next(xpp);
3577    parseElementClose(res);
3578    return res;
3579  }
3580
3581  protected boolean parseChargeItemContent(int eventType, XmlPullParser xpp, ChargeItem res) throws XmlPullParserException, IOException, FHIRFormatError {
3582      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
3583        res.setIdentifier(parseIdentifier(xpp));
3584      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
3585        res.getDefinition().add(parseUri(xpp));
3586      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
3587        res.setStatusElement(parseEnumeration(xpp, ChargeItem.ChargeItemStatus.NULL, new ChargeItem.ChargeItemStatusEnumFactory()));
3588      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
3589        res.getPartOf().add(parseReference(xpp));
3590      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
3591        res.setCode(parseCodeableConcept(xpp));
3592      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
3593        res.setSubject(parseReference(xpp));
3594      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
3595        res.setContext(parseReference(xpp));
3596      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "occurrence")) {
3597        res.setOccurrence(parseType("occurrence", xpp));
3598      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
3599        res.getParticipant().add(parseChargeItemChargeItemParticipantComponent(xpp, res));
3600      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performingOrganization")) {
3601        res.setPerformingOrganization(parseReference(xpp));
3602      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestingOrganization")) {
3603        res.setRequestingOrganization(parseReference(xpp));
3604      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
3605        res.setQuantity(parseQuantity(xpp));
3606      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodysite")) {
3607        res.getBodysite().add(parseCodeableConcept(xpp));
3608      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factorOverride")) {
3609        res.setFactorOverrideElement(parseDecimal(xpp));
3610      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priceOverride")) {
3611        res.setPriceOverride(parseMoney(xpp));
3612      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("overrideReason")) {
3613        res.setOverrideReasonElement(parseString(xpp));
3614      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("enterer")) {
3615        res.setEnterer(parseReference(xpp));
3616      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("enteredDate")) {
3617        res.setEnteredDateElement(parseDateTime(xpp));
3618      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
3619        res.getReason().add(parseCodeableConcept(xpp));
3620      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
3621        res.getService().add(parseReference(xpp));
3622      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("account")) {
3623        res.getAccount().add(parseReference(xpp));
3624      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
3625        res.getNote().add(parseAnnotation(xpp));
3626      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInformation")) {
3627        res.getSupportingInformation().add(parseReference(xpp));
3628      } else if (!parseDomainResourceContent(eventType, xpp, res))
3629        return false;
3630    return true;
3631  }
3632
3633  protected ChargeItem.ChargeItemParticipantComponent parseChargeItemChargeItemParticipantComponent(XmlPullParser xpp, ChargeItem owner) throws XmlPullParserException, IOException, FHIRFormatError {
3634    ChargeItem.ChargeItemParticipantComponent res = new ChargeItem.ChargeItemParticipantComponent();
3635    parseBackboneAttributes(xpp, res);
3636    next(xpp);
3637    int eventType = nextNoWhitespace(xpp);
3638    while (eventType != XmlPullParser.END_TAG) {
3639  if (!parseChargeItemChargeItemParticipantComponentContent(eventType, xpp, owner, res))
3640        unknownContent(xpp);
3641      eventType = nextNoWhitespace(xpp);
3642    }
3643    next(xpp);
3644    parseElementClose(res);
3645    return res;
3646  }
3647
3648  protected boolean parseChargeItemChargeItemParticipantComponentContent(int eventType, XmlPullParser xpp, ChargeItem owner, ChargeItem.ChargeItemParticipantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3649      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
3650        res.setRole(parseCodeableConcept(xpp));
3651      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
3652        res.setActor(parseReference(xpp));
3653      } else if (!parseBackboneContent(eventType, xpp, res))
3654        return false;
3655    return true;
3656  }
3657
3658  protected Claim parseClaim(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3659    Claim res = new Claim();
3660    parseDomainResourceAttributes(xpp, res);
3661    next(xpp);
3662    int eventType = nextNoWhitespace(xpp);
3663    while (eventType != XmlPullParser.END_TAG) {
3664  if (!parseClaimContent(eventType, xpp, res))
3665        unknownContent(xpp);
3666      eventType = nextNoWhitespace(xpp);
3667    }
3668    next(xpp);
3669    parseElementClose(res);
3670    return res;
3671  }
3672
3673  protected boolean parseClaimContent(int eventType, XmlPullParser xpp, Claim res) throws XmlPullParserException, IOException, FHIRFormatError {
3674      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
3675        res.getIdentifier().add(parseIdentifier(xpp));
3676      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
3677        res.setStatusElement(parseEnumeration(xpp, Claim.ClaimStatus.NULL, new Claim.ClaimStatusEnumFactory()));
3678      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3679        res.setType(parseCodeableConcept(xpp));
3680      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subType")) {
3681        res.getSubType().add(parseCodeableConcept(xpp));
3682      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
3683        res.setUseElement(parseEnumeration(xpp, Claim.Use.NULL, new Claim.UseEnumFactory()));
3684      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
3685        res.setPatient(parseReference(xpp));
3686      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("billablePeriod")) {
3687        res.setBillablePeriod(parsePeriod(xpp));
3688      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
3689        res.setCreatedElement(parseDateTime(xpp));
3690      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("enterer")) {
3691        res.setEnterer(parseReference(xpp));
3692      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurer")) {
3693        res.setInsurer(parseReference(xpp));
3694      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("provider")) {
3695        res.setProvider(parseReference(xpp));
3696      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("organization")) {
3697        res.setOrganization(parseReference(xpp));
3698      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
3699        res.setPriority(parseCodeableConcept(xpp));
3700      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fundsReserve")) {
3701        res.setFundsReserve(parseCodeableConcept(xpp));
3702      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("related")) {
3703        res.getRelated().add(parseClaimRelatedClaimComponent(xpp, res));
3704      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prescription")) {
3705        res.setPrescription(parseReference(xpp));
3706      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("originalPrescription")) {
3707        res.setOriginalPrescription(parseReference(xpp));
3708      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payee")) {
3709        res.setPayee(parseClaimPayeeComponent(xpp, res));
3710      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referral")) {
3711        res.setReferral(parseReference(xpp));
3712      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("facility")) {
3713        res.setFacility(parseReference(xpp));
3714      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("careTeam")) {
3715        res.getCareTeam().add(parseClaimCareTeamComponent(xpp, res));
3716      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("information")) {
3717        res.getInformation().add(parseClaimSpecialConditionComponent(xpp, res));
3718      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diagnosis")) {
3719        res.getDiagnosis().add(parseClaimDiagnosisComponent(xpp, res));
3720      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("procedure")) {
3721        res.getProcedure().add(parseClaimProcedureComponent(xpp, res));
3722      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurance")) {
3723        res.getInsurance().add(parseClaimInsuranceComponent(xpp, res));
3724      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("accident")) {
3725        res.setAccident(parseClaimAccidentComponent(xpp, res));
3726      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("employmentImpacted")) {
3727        res.setEmploymentImpacted(parsePeriod(xpp));
3728      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("hospitalization")) {
3729        res.setHospitalization(parsePeriod(xpp));
3730      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("item")) {
3731        res.getItem().add(parseClaimItemComponent(xpp, res));
3732      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("total")) {
3733        res.setTotal(parseMoney(xpp));
3734      } else if (!parseDomainResourceContent(eventType, xpp, res))
3735        return false;
3736    return true;
3737  }
3738
3739  protected Claim.RelatedClaimComponent parseClaimRelatedClaimComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3740    Claim.RelatedClaimComponent res = new Claim.RelatedClaimComponent();
3741    parseBackboneAttributes(xpp, res);
3742    next(xpp);
3743    int eventType = nextNoWhitespace(xpp);
3744    while (eventType != XmlPullParser.END_TAG) {
3745  if (!parseClaimRelatedClaimComponentContent(eventType, xpp, owner, res))
3746        unknownContent(xpp);
3747      eventType = nextNoWhitespace(xpp);
3748    }
3749    next(xpp);
3750    parseElementClose(res);
3751    return res;
3752  }
3753
3754  protected boolean parseClaimRelatedClaimComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.RelatedClaimComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3755      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("claim")) {
3756        res.setClaim(parseReference(xpp));
3757      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relationship")) {
3758        res.setRelationship(parseCodeableConcept(xpp));
3759      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
3760        res.setReference(parseIdentifier(xpp));
3761      } else if (!parseBackboneContent(eventType, xpp, res))
3762        return false;
3763    return true;
3764  }
3765
3766  protected Claim.PayeeComponent parseClaimPayeeComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3767    Claim.PayeeComponent res = new Claim.PayeeComponent();
3768    parseBackboneAttributes(xpp, res);
3769    next(xpp);
3770    int eventType = nextNoWhitespace(xpp);
3771    while (eventType != XmlPullParser.END_TAG) {
3772  if (!parseClaimPayeeComponentContent(eventType, xpp, owner, res))
3773        unknownContent(xpp);
3774      eventType = nextNoWhitespace(xpp);
3775    }
3776    next(xpp);
3777    parseElementClose(res);
3778    return res;
3779  }
3780
3781  protected boolean parseClaimPayeeComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.PayeeComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3782      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3783        res.setType(parseCodeableConcept(xpp));
3784      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resourceType")) {
3785        res.setResourceType(parseCoding(xpp));
3786      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("party")) {
3787        res.setParty(parseReference(xpp));
3788      } else if (!parseBackboneContent(eventType, xpp, res))
3789        return false;
3790    return true;
3791  }
3792
3793  protected Claim.CareTeamComponent parseClaimCareTeamComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3794    Claim.CareTeamComponent res = new Claim.CareTeamComponent();
3795    parseBackboneAttributes(xpp, res);
3796    next(xpp);
3797    int eventType = nextNoWhitespace(xpp);
3798    while (eventType != XmlPullParser.END_TAG) {
3799  if (!parseClaimCareTeamComponentContent(eventType, xpp, owner, res))
3800        unknownContent(xpp);
3801      eventType = nextNoWhitespace(xpp);
3802    }
3803    next(xpp);
3804    parseElementClose(res);
3805    return res;
3806  }
3807
3808  protected boolean parseClaimCareTeamComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.CareTeamComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3809      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
3810        res.setSequenceElement(parsePositiveInt(xpp));
3811      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("provider")) {
3812        res.setProvider(parseReference(xpp));
3813      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("responsible")) {
3814        res.setResponsibleElement(parseBoolean(xpp));
3815      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
3816        res.setRole(parseCodeableConcept(xpp));
3817      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("qualification")) {
3818        res.setQualification(parseCodeableConcept(xpp));
3819      } else if (!parseBackboneContent(eventType, xpp, res))
3820        return false;
3821    return true;
3822  }
3823
3824  protected Claim.SpecialConditionComponent parseClaimSpecialConditionComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3825    Claim.SpecialConditionComponent res = new Claim.SpecialConditionComponent();
3826    parseBackboneAttributes(xpp, res);
3827    next(xpp);
3828    int eventType = nextNoWhitespace(xpp);
3829    while (eventType != XmlPullParser.END_TAG) {
3830  if (!parseClaimSpecialConditionComponentContent(eventType, xpp, owner, res))
3831        unknownContent(xpp);
3832      eventType = nextNoWhitespace(xpp);
3833    }
3834    next(xpp);
3835    parseElementClose(res);
3836    return res;
3837  }
3838
3839  protected boolean parseClaimSpecialConditionComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.SpecialConditionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3840      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
3841        res.setSequenceElement(parsePositiveInt(xpp));
3842      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
3843        res.setCategory(parseCodeableConcept(xpp));
3844      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
3845        res.setCode(parseCodeableConcept(xpp));
3846      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "timing")) {
3847        res.setTiming(parseType("timing", xpp));
3848      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
3849        res.setValue(parseType("value", xpp));
3850      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
3851        res.setReason(parseCodeableConcept(xpp));
3852      } else if (!parseBackboneContent(eventType, xpp, res))
3853        return false;
3854    return true;
3855  }
3856
3857  protected Claim.DiagnosisComponent parseClaimDiagnosisComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3858    Claim.DiagnosisComponent res = new Claim.DiagnosisComponent();
3859    parseBackboneAttributes(xpp, res);
3860    next(xpp);
3861    int eventType = nextNoWhitespace(xpp);
3862    while (eventType != XmlPullParser.END_TAG) {
3863  if (!parseClaimDiagnosisComponentContent(eventType, xpp, owner, res))
3864        unknownContent(xpp);
3865      eventType = nextNoWhitespace(xpp);
3866    }
3867    next(xpp);
3868    parseElementClose(res);
3869    return res;
3870  }
3871
3872  protected boolean parseClaimDiagnosisComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.DiagnosisComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3873      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
3874        res.setSequenceElement(parsePositiveInt(xpp));
3875      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "diagnosis")) {
3876        res.setDiagnosis(parseType("diagnosis", xpp));
3877      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3878        res.getType().add(parseCodeableConcept(xpp));
3879      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("packageCode")) {
3880        res.setPackageCode(parseCodeableConcept(xpp));
3881      } else if (!parseBackboneContent(eventType, xpp, res))
3882        return false;
3883    return true;
3884  }
3885
3886  protected Claim.ProcedureComponent parseClaimProcedureComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3887    Claim.ProcedureComponent res = new Claim.ProcedureComponent();
3888    parseBackboneAttributes(xpp, res);
3889    next(xpp);
3890    int eventType = nextNoWhitespace(xpp);
3891    while (eventType != XmlPullParser.END_TAG) {
3892  if (!parseClaimProcedureComponentContent(eventType, xpp, owner, res))
3893        unknownContent(xpp);
3894      eventType = nextNoWhitespace(xpp);
3895    }
3896    next(xpp);
3897    parseElementClose(res);
3898    return res;
3899  }
3900
3901  protected boolean parseClaimProcedureComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.ProcedureComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3902      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
3903        res.setSequenceElement(parsePositiveInt(xpp));
3904      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
3905        res.setDateElement(parseDateTime(xpp));
3906      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "procedure")) {
3907        res.setProcedure(parseType("procedure", xpp));
3908      } else if (!parseBackboneContent(eventType, xpp, res))
3909        return false;
3910    return true;
3911  }
3912
3913  protected Claim.InsuranceComponent parseClaimInsuranceComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3914    Claim.InsuranceComponent res = new Claim.InsuranceComponent();
3915    parseBackboneAttributes(xpp, res);
3916    next(xpp);
3917    int eventType = nextNoWhitespace(xpp);
3918    while (eventType != XmlPullParser.END_TAG) {
3919  if (!parseClaimInsuranceComponentContent(eventType, xpp, owner, res))
3920        unknownContent(xpp);
3921      eventType = nextNoWhitespace(xpp);
3922    }
3923    next(xpp);
3924    parseElementClose(res);
3925    return res;
3926  }
3927
3928  protected boolean parseClaimInsuranceComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.InsuranceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3929      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
3930        res.setSequenceElement(parsePositiveInt(xpp));
3931      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("focal")) {
3932        res.setFocalElement(parseBoolean(xpp));
3933      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
3934        res.setCoverage(parseReference(xpp));
3935      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("businessArrangement")) {
3936        res.setBusinessArrangementElement(parseString(xpp));
3937      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("preAuthRef")) {
3938        res.getPreAuthRef().add(parseString(xpp));
3939      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("claimResponse")) {
3940        res.setClaimResponse(parseReference(xpp));
3941      } else if (!parseBackboneContent(eventType, xpp, res))
3942        return false;
3943    return true;
3944  }
3945
3946  protected Claim.AccidentComponent parseClaimAccidentComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3947    Claim.AccidentComponent res = new Claim.AccidentComponent();
3948    parseBackboneAttributes(xpp, res);
3949    next(xpp);
3950    int eventType = nextNoWhitespace(xpp);
3951    while (eventType != XmlPullParser.END_TAG) {
3952  if (!parseClaimAccidentComponentContent(eventType, xpp, owner, res))
3953        unknownContent(xpp);
3954      eventType = nextNoWhitespace(xpp);
3955    }
3956    next(xpp);
3957    parseElementClose(res);
3958    return res;
3959  }
3960
3961  protected boolean parseClaimAccidentComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.AccidentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3962      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
3963        res.setDateElement(parseDate(xpp));
3964      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3965        res.setType(parseCodeableConcept(xpp));
3966      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "location")) {
3967        res.setLocation(parseType("location", xpp));
3968      } else if (!parseBackboneContent(eventType, xpp, res))
3969        return false;
3970    return true;
3971  }
3972
3973  protected Claim.ItemComponent parseClaimItemComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3974    Claim.ItemComponent res = new Claim.ItemComponent();
3975    parseBackboneAttributes(xpp, res);
3976    next(xpp);
3977    int eventType = nextNoWhitespace(xpp);
3978    while (eventType != XmlPullParser.END_TAG) {
3979  if (!parseClaimItemComponentContent(eventType, xpp, owner, res))
3980        unknownContent(xpp);
3981      eventType = nextNoWhitespace(xpp);
3982    }
3983    next(xpp);
3984    parseElementClose(res);
3985    return res;
3986  }
3987
3988  protected boolean parseClaimItemComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.ItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3989      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
3990        res.setSequenceElement(parsePositiveInt(xpp));
3991      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("careTeamLinkId")) {
3992        res.getCareTeamLinkId().add(parsePositiveInt(xpp));
3993      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diagnosisLinkId")) {
3994        res.getDiagnosisLinkId().add(parsePositiveInt(xpp));
3995      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("procedureLinkId")) {
3996        res.getProcedureLinkId().add(parsePositiveInt(xpp));
3997      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("informationLinkId")) {
3998        res.getInformationLinkId().add(parsePositiveInt(xpp));
3999      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
4000        res.setRevenue(parseCodeableConcept(xpp));
4001      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
4002        res.setCategory(parseCodeableConcept(xpp));
4003      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
4004        res.setService(parseCodeableConcept(xpp));
4005      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
4006        res.getModifier().add(parseCodeableConcept(xpp));
4007      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("programCode")) {
4008        res.getProgramCode().add(parseCodeableConcept(xpp));
4009      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "serviced")) {
4010        res.setServiced(parseType("serviced", xpp));
4011      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "location")) {
4012        res.setLocation(parseType("location", xpp));
4013      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
4014        res.setQuantity(parseSimpleQuantity(xpp));
4015      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
4016        res.setUnitPrice(parseMoney(xpp));
4017      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
4018        res.setFactorElement(parseDecimal(xpp));
4019      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
4020        res.setNet(parseMoney(xpp));
4021      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("udi")) {
4022        res.getUdi().add(parseReference(xpp));
4023      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodySite")) {
4024        res.setBodySite(parseCodeableConcept(xpp));
4025      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subSite")) {
4026        res.getSubSite().add(parseCodeableConcept(xpp));
4027      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
4028        res.getEncounter().add(parseReference(xpp));
4029      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
4030        res.getDetail().add(parseClaimDetailComponent(xpp, owner));
4031      } else if (!parseBackboneContent(eventType, xpp, res))
4032        return false;
4033    return true;
4034  }
4035
4036  protected Claim.DetailComponent parseClaimDetailComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
4037    Claim.DetailComponent res = new Claim.DetailComponent();
4038    parseBackboneAttributes(xpp, res);
4039    next(xpp);
4040    int eventType = nextNoWhitespace(xpp);
4041    while (eventType != XmlPullParser.END_TAG) {
4042  if (!parseClaimDetailComponentContent(eventType, xpp, owner, res))
4043        unknownContent(xpp);
4044      eventType = nextNoWhitespace(xpp);
4045    }
4046    next(xpp);
4047    parseElementClose(res);
4048    return res;
4049  }
4050
4051  protected boolean parseClaimDetailComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.DetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4052      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
4053        res.setSequenceElement(parsePositiveInt(xpp));
4054      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
4055        res.setRevenue(parseCodeableConcept(xpp));
4056      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
4057        res.setCategory(parseCodeableConcept(xpp));
4058      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
4059        res.setService(parseCodeableConcept(xpp));
4060      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
4061        res.getModifier().add(parseCodeableConcept(xpp));
4062      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("programCode")) {
4063        res.getProgramCode().add(parseCodeableConcept(xpp));
4064      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
4065        res.setQuantity(parseSimpleQuantity(xpp));
4066      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
4067        res.setUnitPrice(parseMoney(xpp));
4068      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
4069        res.setFactorElement(parseDecimal(xpp));
4070      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
4071        res.setNet(parseMoney(xpp));
4072      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("udi")) {
4073        res.getUdi().add(parseReference(xpp));
4074      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subDetail")) {
4075        res.getSubDetail().add(parseClaimSubDetailComponent(xpp, owner));
4076      } else if (!parseBackboneContent(eventType, xpp, res))
4077        return false;
4078    return true;
4079  }
4080
4081  protected Claim.SubDetailComponent parseClaimSubDetailComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
4082    Claim.SubDetailComponent res = new Claim.SubDetailComponent();
4083    parseBackboneAttributes(xpp, res);
4084    next(xpp);
4085    int eventType = nextNoWhitespace(xpp);
4086    while (eventType != XmlPullParser.END_TAG) {
4087  if (!parseClaimSubDetailComponentContent(eventType, xpp, owner, res))
4088        unknownContent(xpp);
4089      eventType = nextNoWhitespace(xpp);
4090    }
4091    next(xpp);
4092    parseElementClose(res);
4093    return res;
4094  }
4095
4096  protected boolean parseClaimSubDetailComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.SubDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4097      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
4098        res.setSequenceElement(parsePositiveInt(xpp));
4099      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
4100        res.setRevenue(parseCodeableConcept(xpp));
4101      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
4102        res.setCategory(parseCodeableConcept(xpp));
4103      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
4104        res.setService(parseCodeableConcept(xpp));
4105      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
4106        res.getModifier().add(parseCodeableConcept(xpp));
4107      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("programCode")) {
4108        res.getProgramCode().add(parseCodeableConcept(xpp));
4109      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
4110        res.setQuantity(parseSimpleQuantity(xpp));
4111      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
4112        res.setUnitPrice(parseMoney(xpp));
4113      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
4114        res.setFactorElement(parseDecimal(xpp));
4115      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
4116        res.setNet(parseMoney(xpp));
4117      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("udi")) {
4118        res.getUdi().add(parseReference(xpp));
4119      } else if (!parseBackboneContent(eventType, xpp, res))
4120        return false;
4121    return true;
4122  }
4123
4124  protected ClaimResponse parseClaimResponse(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4125    ClaimResponse res = new ClaimResponse();
4126    parseDomainResourceAttributes(xpp, res);
4127    next(xpp);
4128    int eventType = nextNoWhitespace(xpp);
4129    while (eventType != XmlPullParser.END_TAG) {
4130  if (!parseClaimResponseContent(eventType, xpp, res))
4131        unknownContent(xpp);
4132      eventType = nextNoWhitespace(xpp);
4133    }
4134    next(xpp);
4135    parseElementClose(res);
4136    return res;
4137  }
4138
4139  protected boolean parseClaimResponseContent(int eventType, XmlPullParser xpp, ClaimResponse res) throws XmlPullParserException, IOException, FHIRFormatError {
4140      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4141        res.getIdentifier().add(parseIdentifier(xpp));
4142      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
4143        res.setStatusElement(parseEnumeration(xpp, ClaimResponse.ClaimResponseStatus.NULL, new ClaimResponse.ClaimResponseStatusEnumFactory()));
4144      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
4145        res.setPatient(parseReference(xpp));
4146      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
4147        res.setCreatedElement(parseDateTime(xpp));
4148      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurer")) {
4149        res.setInsurer(parseReference(xpp));
4150      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestProvider")) {
4151        res.setRequestProvider(parseReference(xpp));
4152      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestOrganization")) {
4153        res.setRequestOrganization(parseReference(xpp));
4154      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
4155        res.setRequest(parseReference(xpp));
4156      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
4157        res.setOutcome(parseCodeableConcept(xpp));
4158      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("disposition")) {
4159        res.setDispositionElement(parseString(xpp));
4160      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payeeType")) {
4161        res.setPayeeType(parseCodeableConcept(xpp));
4162      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("item")) {
4163        res.getItem().add(parseClaimResponseItemComponent(xpp, res));
4164      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("addItem")) {
4165        res.getAddItem().add(parseClaimResponseAddedItemComponent(xpp, res));
4166      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("error")) {
4167        res.getError().add(parseClaimResponseErrorComponent(xpp, res));
4168      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("totalCost")) {
4169        res.setTotalCost(parseMoney(xpp));
4170      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unallocDeductable")) {
4171        res.setUnallocDeductable(parseMoney(xpp));
4172      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("totalBenefit")) {
4173        res.setTotalBenefit(parseMoney(xpp));
4174      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payment")) {
4175        res.setPayment(parseClaimResponsePaymentComponent(xpp, res));
4176      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reserved")) {
4177        res.setReserved(parseCoding(xpp));
4178      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("form")) {
4179        res.setForm(parseCodeableConcept(xpp));
4180      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("processNote")) {
4181        res.getProcessNote().add(parseClaimResponseNoteComponent(xpp, res));
4182      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("communicationRequest")) {
4183        res.getCommunicationRequest().add(parseReference(xpp));
4184      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurance")) {
4185        res.getInsurance().add(parseClaimResponseInsuranceComponent(xpp, res));
4186      } else if (!parseDomainResourceContent(eventType, xpp, res))
4187        return false;
4188    return true;
4189  }
4190
4191  protected ClaimResponse.ItemComponent parseClaimResponseItemComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4192    ClaimResponse.ItemComponent res = new ClaimResponse.ItemComponent();
4193    parseBackboneAttributes(xpp, res);
4194    next(xpp);
4195    int eventType = nextNoWhitespace(xpp);
4196    while (eventType != XmlPullParser.END_TAG) {
4197  if (!parseClaimResponseItemComponentContent(eventType, xpp, owner, res))
4198        unknownContent(xpp);
4199      eventType = nextNoWhitespace(xpp);
4200    }
4201    next(xpp);
4202    parseElementClose(res);
4203    return res;
4204  }
4205
4206  protected boolean parseClaimResponseItemComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.ItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4207      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequenceLinkId")) {
4208        res.setSequenceLinkIdElement(parsePositiveInt(xpp));
4209      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
4210        res.getNoteNumber().add(parsePositiveInt(xpp));
4211      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
4212        res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp, owner));
4213      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
4214        res.getDetail().add(parseClaimResponseItemDetailComponent(xpp, owner));
4215      } else if (!parseBackboneContent(eventType, xpp, res))
4216        return false;
4217    return true;
4218  }
4219
4220  protected ClaimResponse.AdjudicationComponent parseClaimResponseAdjudicationComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4221    ClaimResponse.AdjudicationComponent res = new ClaimResponse.AdjudicationComponent();
4222    parseBackboneAttributes(xpp, res);
4223    next(xpp);
4224    int eventType = nextNoWhitespace(xpp);
4225    while (eventType != XmlPullParser.END_TAG) {
4226  if (!parseClaimResponseAdjudicationComponentContent(eventType, xpp, owner, res))
4227        unknownContent(xpp);
4228      eventType = nextNoWhitespace(xpp);
4229    }
4230    next(xpp);
4231    parseElementClose(res);
4232    return res;
4233  }
4234
4235  protected boolean parseClaimResponseAdjudicationComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.AdjudicationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4236      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
4237        res.setCategory(parseCodeableConcept(xpp));
4238      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
4239        res.setReason(parseCodeableConcept(xpp));
4240      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("amount")) {
4241        res.setAmount(parseMoney(xpp));
4242      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
4243        res.setValueElement(parseDecimal(xpp));
4244      } else if (!parseBackboneContent(eventType, xpp, res))
4245        return false;
4246    return true;
4247  }
4248
4249  protected ClaimResponse.ItemDetailComponent parseClaimResponseItemDetailComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4250    ClaimResponse.ItemDetailComponent res = new ClaimResponse.ItemDetailComponent();
4251    parseBackboneAttributes(xpp, res);
4252    next(xpp);
4253    int eventType = nextNoWhitespace(xpp);
4254    while (eventType != XmlPullParser.END_TAG) {
4255  if (!parseClaimResponseItemDetailComponentContent(eventType, xpp, owner, res))
4256        unknownContent(xpp);
4257      eventType = nextNoWhitespace(xpp);
4258    }
4259    next(xpp);
4260    parseElementClose(res);
4261    return res;
4262  }
4263
4264  protected boolean parseClaimResponseItemDetailComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.ItemDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4265      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequenceLinkId")) {
4266        res.setSequenceLinkIdElement(parsePositiveInt(xpp));
4267      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
4268        res.getNoteNumber().add(parsePositiveInt(xpp));
4269      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
4270        res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp, owner));
4271      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subDetail")) {
4272        res.getSubDetail().add(parseClaimResponseSubDetailComponent(xpp, owner));
4273      } else if (!parseBackboneContent(eventType, xpp, res))
4274        return false;
4275    return true;
4276  }
4277
4278  protected ClaimResponse.SubDetailComponent parseClaimResponseSubDetailComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4279    ClaimResponse.SubDetailComponent res = new ClaimResponse.SubDetailComponent();
4280    parseBackboneAttributes(xpp, res);
4281    next(xpp);
4282    int eventType = nextNoWhitespace(xpp);
4283    while (eventType != XmlPullParser.END_TAG) {
4284  if (!parseClaimResponseSubDetailComponentContent(eventType, xpp, owner, res))
4285        unknownContent(xpp);
4286      eventType = nextNoWhitespace(xpp);
4287    }
4288    next(xpp);
4289    parseElementClose(res);
4290    return res;
4291  }
4292
4293  protected boolean parseClaimResponseSubDetailComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.SubDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4294      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequenceLinkId")) {
4295        res.setSequenceLinkIdElement(parsePositiveInt(xpp));
4296      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
4297        res.getNoteNumber().add(parsePositiveInt(xpp));
4298      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
4299        res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp, owner));
4300      } else if (!parseBackboneContent(eventType, xpp, res))
4301        return false;
4302    return true;
4303  }
4304
4305  protected ClaimResponse.AddedItemComponent parseClaimResponseAddedItemComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4306    ClaimResponse.AddedItemComponent res = new ClaimResponse.AddedItemComponent();
4307    parseBackboneAttributes(xpp, res);
4308    next(xpp);
4309    int eventType = nextNoWhitespace(xpp);
4310    while (eventType != XmlPullParser.END_TAG) {
4311  if (!parseClaimResponseAddedItemComponentContent(eventType, xpp, owner, res))
4312        unknownContent(xpp);
4313      eventType = nextNoWhitespace(xpp);
4314    }
4315    next(xpp);
4316    parseElementClose(res);
4317    return res;
4318  }
4319
4320  protected boolean parseClaimResponseAddedItemComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.AddedItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4321      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequenceLinkId")) {
4322        res.getSequenceLinkId().add(parsePositiveInt(xpp));
4323      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
4324        res.setRevenue(parseCodeableConcept(xpp));
4325      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
4326        res.setCategory(parseCodeableConcept(xpp));
4327      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
4328        res.setService(parseCodeableConcept(xpp));
4329      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
4330        res.getModifier().add(parseCodeableConcept(xpp));
4331      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fee")) {
4332        res.setFee(parseMoney(xpp));
4333      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
4334        res.getNoteNumber().add(parsePositiveInt(xpp));
4335      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
4336        res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp, owner));
4337      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
4338        res.getDetail().add(parseClaimResponseAddedItemsDetailComponent(xpp, owner));
4339      } else if (!parseBackboneContent(eventType, xpp, res))
4340        return false;
4341    return true;
4342  }
4343
4344  protected ClaimResponse.AddedItemsDetailComponent parseClaimResponseAddedItemsDetailComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4345    ClaimResponse.AddedItemsDetailComponent res = new ClaimResponse.AddedItemsDetailComponent();
4346    parseBackboneAttributes(xpp, res);
4347    next(xpp);
4348    int eventType = nextNoWhitespace(xpp);
4349    while (eventType != XmlPullParser.END_TAG) {
4350  if (!parseClaimResponseAddedItemsDetailComponentContent(eventType, xpp, owner, res))
4351        unknownContent(xpp);
4352      eventType = nextNoWhitespace(xpp);
4353    }
4354    next(xpp);
4355    parseElementClose(res);
4356    return res;
4357  }
4358
4359  protected boolean parseClaimResponseAddedItemsDetailComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.AddedItemsDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4360      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
4361        res.setRevenue(parseCodeableConcept(xpp));
4362      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
4363        res.setCategory(parseCodeableConcept(xpp));
4364      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
4365        res.setService(parseCodeableConcept(xpp));
4366      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
4367        res.getModifier().add(parseCodeableConcept(xpp));
4368      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fee")) {
4369        res.setFee(parseMoney(xpp));
4370      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
4371        res.getNoteNumber().add(parsePositiveInt(xpp));
4372      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
4373        res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp, owner));
4374      } else if (!parseBackboneContent(eventType, xpp, res))
4375        return false;
4376    return true;
4377  }
4378
4379  protected ClaimResponse.ErrorComponent parseClaimResponseErrorComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4380    ClaimResponse.ErrorComponent res = new ClaimResponse.ErrorComponent();
4381    parseBackboneAttributes(xpp, res);
4382    next(xpp);
4383    int eventType = nextNoWhitespace(xpp);
4384    while (eventType != XmlPullParser.END_TAG) {
4385  if (!parseClaimResponseErrorComponentContent(eventType, xpp, owner, res))
4386        unknownContent(xpp);
4387      eventType = nextNoWhitespace(xpp);
4388    }
4389    next(xpp);
4390    parseElementClose(res);
4391    return res;
4392  }
4393
4394  protected boolean parseClaimResponseErrorComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.ErrorComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4395      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequenceLinkId")) {
4396        res.setSequenceLinkIdElement(parsePositiveInt(xpp));
4397      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detailSequenceLinkId")) {
4398        res.setDetailSequenceLinkIdElement(parsePositiveInt(xpp));
4399      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subdetailSequenceLinkId")) {
4400        res.setSubdetailSequenceLinkIdElement(parsePositiveInt(xpp));
4401      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4402        res.setCode(parseCodeableConcept(xpp));
4403      } else if (!parseBackboneContent(eventType, xpp, res))
4404        return false;
4405    return true;
4406  }
4407
4408  protected ClaimResponse.PaymentComponent parseClaimResponsePaymentComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4409    ClaimResponse.PaymentComponent res = new ClaimResponse.PaymentComponent();
4410    parseBackboneAttributes(xpp, res);
4411    next(xpp);
4412    int eventType = nextNoWhitespace(xpp);
4413    while (eventType != XmlPullParser.END_TAG) {
4414  if (!parseClaimResponsePaymentComponentContent(eventType, xpp, owner, res))
4415        unknownContent(xpp);
4416      eventType = nextNoWhitespace(xpp);
4417    }
4418    next(xpp);
4419    parseElementClose(res);
4420    return res;
4421  }
4422
4423  protected boolean parseClaimResponsePaymentComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.PaymentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4424      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
4425        res.setType(parseCodeableConcept(xpp));
4426      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjustment")) {
4427        res.setAdjustment(parseMoney(xpp));
4428      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjustmentReason")) {
4429        res.setAdjustmentReason(parseCodeableConcept(xpp));
4430      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
4431        res.setDateElement(parseDate(xpp));
4432      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("amount")) {
4433        res.setAmount(parseMoney(xpp));
4434      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4435        res.setIdentifier(parseIdentifier(xpp));
4436      } else if (!parseBackboneContent(eventType, xpp, res))
4437        return false;
4438    return true;
4439  }
4440
4441  protected ClaimResponse.NoteComponent parseClaimResponseNoteComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4442    ClaimResponse.NoteComponent res = new ClaimResponse.NoteComponent();
4443    parseBackboneAttributes(xpp, res);
4444    next(xpp);
4445    int eventType = nextNoWhitespace(xpp);
4446    while (eventType != XmlPullParser.END_TAG) {
4447  if (!parseClaimResponseNoteComponentContent(eventType, xpp, owner, res))
4448        unknownContent(xpp);
4449      eventType = nextNoWhitespace(xpp);
4450    }
4451    next(xpp);
4452    parseElementClose(res);
4453    return res;
4454  }
4455
4456  protected boolean parseClaimResponseNoteComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.NoteComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4457      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("number")) {
4458        res.setNumberElement(parsePositiveInt(xpp));
4459      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
4460        res.setType(parseCodeableConcept(xpp));
4461      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
4462        res.setTextElement(parseString(xpp));
4463      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
4464        res.setLanguage(parseCodeableConcept(xpp));
4465      } else if (!parseBackboneContent(eventType, xpp, res))
4466        return false;
4467    return true;
4468  }
4469
4470  protected ClaimResponse.InsuranceComponent parseClaimResponseInsuranceComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4471    ClaimResponse.InsuranceComponent res = new ClaimResponse.InsuranceComponent();
4472    parseBackboneAttributes(xpp, res);
4473    next(xpp);
4474    int eventType = nextNoWhitespace(xpp);
4475    while (eventType != XmlPullParser.END_TAG) {
4476  if (!parseClaimResponseInsuranceComponentContent(eventType, xpp, owner, res))
4477        unknownContent(xpp);
4478      eventType = nextNoWhitespace(xpp);
4479    }
4480    next(xpp);
4481    parseElementClose(res);
4482    return res;
4483  }
4484
4485  protected boolean parseClaimResponseInsuranceComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.InsuranceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4486      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
4487        res.setSequenceElement(parsePositiveInt(xpp));
4488      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("focal")) {
4489        res.setFocalElement(parseBoolean(xpp));
4490      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
4491        res.setCoverage(parseReference(xpp));
4492      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("businessArrangement")) {
4493        res.setBusinessArrangementElement(parseString(xpp));
4494      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("preAuthRef")) {
4495        res.getPreAuthRef().add(parseString(xpp));
4496      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("claimResponse")) {
4497        res.setClaimResponse(parseReference(xpp));
4498      } else if (!parseBackboneContent(eventType, xpp, res))
4499        return false;
4500    return true;
4501  }
4502
4503  protected ClinicalImpression parseClinicalImpression(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4504    ClinicalImpression res = new ClinicalImpression();
4505    parseDomainResourceAttributes(xpp, res);
4506    next(xpp);
4507    int eventType = nextNoWhitespace(xpp);
4508    while (eventType != XmlPullParser.END_TAG) {
4509  if (!parseClinicalImpressionContent(eventType, xpp, res))
4510        unknownContent(xpp);
4511      eventType = nextNoWhitespace(xpp);
4512    }
4513    next(xpp);
4514    parseElementClose(res);
4515    return res;
4516  }
4517
4518  protected boolean parseClinicalImpressionContent(int eventType, XmlPullParser xpp, ClinicalImpression res) throws XmlPullParserException, IOException, FHIRFormatError {
4519      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4520        res.getIdentifier().add(parseIdentifier(xpp));
4521      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
4522        res.setStatusElement(parseEnumeration(xpp, ClinicalImpression.ClinicalImpressionStatus.NULL, new ClinicalImpression.ClinicalImpressionStatusEnumFactory()));
4523      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4524        res.setCode(parseCodeableConcept(xpp));
4525      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
4526        res.setDescriptionElement(parseString(xpp));
4527      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
4528        res.setSubject(parseReference(xpp));
4529      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
4530        res.setContext(parseReference(xpp));
4531      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "effective")) {
4532        res.setEffective(parseType("effective", xpp));
4533      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
4534        res.setDateElement(parseDateTime(xpp));
4535      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("assessor")) {
4536        res.setAssessor(parseReference(xpp));
4537      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("previous")) {
4538        res.setPrevious(parseReference(xpp));
4539      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("problem")) {
4540        res.getProblem().add(parseReference(xpp));
4541      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("investigation")) {
4542        res.getInvestigation().add(parseClinicalImpressionClinicalImpressionInvestigationComponent(xpp, res));
4543      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("protocol")) {
4544        res.getProtocol().add(parseUri(xpp));
4545      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("summary")) {
4546        res.setSummaryElement(parseString(xpp));
4547      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("finding")) {
4548        res.getFinding().add(parseClinicalImpressionClinicalImpressionFindingComponent(xpp, res));
4549      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prognosisCodeableConcept")) {
4550        res.getPrognosisCodeableConcept().add(parseCodeableConcept(xpp));
4551      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prognosisReference")) {
4552        res.getPrognosisReference().add(parseReference(xpp));
4553      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
4554        res.getAction().add(parseReference(xpp));
4555      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
4556        res.getNote().add(parseAnnotation(xpp));
4557      } else if (!parseDomainResourceContent(eventType, xpp, res))
4558        return false;
4559    return true;
4560  }
4561
4562  protected ClinicalImpression.ClinicalImpressionInvestigationComponent parseClinicalImpressionClinicalImpressionInvestigationComponent(XmlPullParser xpp, ClinicalImpression owner) throws XmlPullParserException, IOException, FHIRFormatError {
4563    ClinicalImpression.ClinicalImpressionInvestigationComponent res = new ClinicalImpression.ClinicalImpressionInvestigationComponent();
4564    parseBackboneAttributes(xpp, res);
4565    next(xpp);
4566    int eventType = nextNoWhitespace(xpp);
4567    while (eventType != XmlPullParser.END_TAG) {
4568  if (!parseClinicalImpressionClinicalImpressionInvestigationComponentContent(eventType, xpp, owner, res))
4569        unknownContent(xpp);
4570      eventType = nextNoWhitespace(xpp);
4571    }
4572    next(xpp);
4573    parseElementClose(res);
4574    return res;
4575  }
4576
4577  protected boolean parseClinicalImpressionClinicalImpressionInvestigationComponentContent(int eventType, XmlPullParser xpp, ClinicalImpression owner, ClinicalImpression.ClinicalImpressionInvestigationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4578      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4579        res.setCode(parseCodeableConcept(xpp));
4580      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("item")) {
4581        res.getItem().add(parseReference(xpp));
4582      } else if (!parseBackboneContent(eventType, xpp, res))
4583        return false;
4584    return true;
4585  }
4586
4587  protected ClinicalImpression.ClinicalImpressionFindingComponent parseClinicalImpressionClinicalImpressionFindingComponent(XmlPullParser xpp, ClinicalImpression owner) throws XmlPullParserException, IOException, FHIRFormatError {
4588    ClinicalImpression.ClinicalImpressionFindingComponent res = new ClinicalImpression.ClinicalImpressionFindingComponent();
4589    parseBackboneAttributes(xpp, res);
4590    next(xpp);
4591    int eventType = nextNoWhitespace(xpp);
4592    while (eventType != XmlPullParser.END_TAG) {
4593  if (!parseClinicalImpressionClinicalImpressionFindingComponentContent(eventType, xpp, owner, res))
4594        unknownContent(xpp);
4595      eventType = nextNoWhitespace(xpp);
4596    }
4597    next(xpp);
4598    parseElementClose(res);
4599    return res;
4600  }
4601
4602  protected boolean parseClinicalImpressionClinicalImpressionFindingComponentContent(int eventType, XmlPullParser xpp, ClinicalImpression owner, ClinicalImpression.ClinicalImpressionFindingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4603      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "item")) {
4604        res.setItem(parseType("item", xpp));
4605      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basis")) {
4606        res.setBasisElement(parseString(xpp));
4607      } else if (!parseBackboneContent(eventType, xpp, res))
4608        return false;
4609    return true;
4610  }
4611
4612  protected CodeSystem parseCodeSystem(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4613    CodeSystem res = new CodeSystem();
4614    parseDomainResourceAttributes(xpp, res);
4615    next(xpp);
4616    int eventType = nextNoWhitespace(xpp);
4617    while (eventType != XmlPullParser.END_TAG) {
4618  if (!parseCodeSystemContent(eventType, xpp, res))
4619        unknownContent(xpp);
4620      eventType = nextNoWhitespace(xpp);
4621    }
4622    next(xpp);
4623    parseElementClose(res);
4624    return res;
4625  }
4626
4627  protected boolean parseCodeSystemContent(int eventType, XmlPullParser xpp, CodeSystem res) throws XmlPullParserException, IOException, FHIRFormatError {
4628      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
4629        res.setUrlElement(parseUri(xpp));
4630      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4631        res.setIdentifier(parseIdentifier(xpp));
4632      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
4633        res.setVersionElement(parseString(xpp));
4634      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
4635        res.setNameElement(parseString(xpp));
4636      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
4637        res.setTitleElement(parseString(xpp));
4638      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
4639        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
4640      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
4641        res.setExperimentalElement(parseBoolean(xpp));
4642      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
4643        res.setDateElement(parseDateTime(xpp));
4644      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
4645        res.setPublisherElement(parseString(xpp));
4646      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
4647        res.getContact().add(parseContactDetail(xpp));
4648      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
4649        res.setDescriptionElement(parseMarkdown(xpp));
4650      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
4651        res.getUseContext().add(parseUsageContext(xpp));
4652      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
4653        res.getJurisdiction().add(parseCodeableConcept(xpp));
4654      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
4655        res.setPurposeElement(parseMarkdown(xpp));
4656      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
4657        res.setCopyrightElement(parseMarkdown(xpp));
4658      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("caseSensitive")) {
4659        res.setCaseSensitiveElement(parseBoolean(xpp));
4660      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueSet")) {
4661        res.setValueSetElement(parseUri(xpp));
4662      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("hierarchyMeaning")) {
4663        res.setHierarchyMeaningElement(parseEnumeration(xpp, CodeSystem.CodeSystemHierarchyMeaning.NULL, new CodeSystem.CodeSystemHierarchyMeaningEnumFactory()));
4664      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("compositional")) {
4665        res.setCompositionalElement(parseBoolean(xpp));
4666      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("versionNeeded")) {
4667        res.setVersionNeededElement(parseBoolean(xpp));
4668      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("content")) {
4669        res.setContentElement(parseEnumeration(xpp, CodeSystem.CodeSystemContentMode.NULL, new CodeSystem.CodeSystemContentModeEnumFactory()));
4670      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("count")) {
4671        res.setCountElement(parseUnsignedInt(xpp));
4672      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("filter")) {
4673        res.getFilter().add(parseCodeSystemCodeSystemFilterComponent(xpp, res));
4674      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("property")) {
4675        res.getProperty().add(parseCodeSystemPropertyComponent(xpp, res));
4676      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("concept")) {
4677        res.getConcept().add(parseCodeSystemConceptDefinitionComponent(xpp, res));
4678      } else if (!parseDomainResourceContent(eventType, xpp, res))
4679        return false;
4680    return true;
4681  }
4682
4683  protected CodeSystem.CodeSystemFilterComponent parseCodeSystemCodeSystemFilterComponent(XmlPullParser xpp, CodeSystem owner) throws XmlPullParserException, IOException, FHIRFormatError {
4684    CodeSystem.CodeSystemFilterComponent res = new CodeSystem.CodeSystemFilterComponent();
4685    parseBackboneAttributes(xpp, res);
4686    next(xpp);
4687    int eventType = nextNoWhitespace(xpp);
4688    while (eventType != XmlPullParser.END_TAG) {
4689  if (!parseCodeSystemCodeSystemFilterComponentContent(eventType, xpp, owner, res))
4690        unknownContent(xpp);
4691      eventType = nextNoWhitespace(xpp);
4692    }
4693    next(xpp);
4694    parseElementClose(res);
4695    return res;
4696  }
4697
4698  protected boolean parseCodeSystemCodeSystemFilterComponentContent(int eventType, XmlPullParser xpp, CodeSystem owner, CodeSystem.CodeSystemFilterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4699      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4700        res.setCodeElement(parseCode(xpp));
4701      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
4702        res.setDescriptionElement(parseString(xpp));
4703      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operator")) {
4704        res.getOperator().add(parseEnumeration(xpp, CodeSystem.FilterOperator.NULL, new CodeSystem.FilterOperatorEnumFactory()));
4705      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
4706        res.setValueElement(parseString(xpp));
4707      } else if (!parseBackboneContent(eventType, xpp, res))
4708        return false;
4709    return true;
4710  }
4711
4712  protected CodeSystem.PropertyComponent parseCodeSystemPropertyComponent(XmlPullParser xpp, CodeSystem owner) throws XmlPullParserException, IOException, FHIRFormatError {
4713    CodeSystem.PropertyComponent res = new CodeSystem.PropertyComponent();
4714    parseBackboneAttributes(xpp, res);
4715    next(xpp);
4716    int eventType = nextNoWhitespace(xpp);
4717    while (eventType != XmlPullParser.END_TAG) {
4718  if (!parseCodeSystemPropertyComponentContent(eventType, xpp, owner, res))
4719        unknownContent(xpp);
4720      eventType = nextNoWhitespace(xpp);
4721    }
4722    next(xpp);
4723    parseElementClose(res);
4724    return res;
4725  }
4726
4727  protected boolean parseCodeSystemPropertyComponentContent(int eventType, XmlPullParser xpp, CodeSystem owner, CodeSystem.PropertyComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4728      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4729        res.setCodeElement(parseCode(xpp));
4730      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("uri")) {
4731        res.setUriElement(parseUri(xpp));
4732      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
4733        res.setDescriptionElement(parseString(xpp));
4734      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
4735        res.setTypeElement(parseEnumeration(xpp, CodeSystem.PropertyType.NULL, new CodeSystem.PropertyTypeEnumFactory()));
4736      } else if (!parseBackboneContent(eventType, xpp, res))
4737        return false;
4738    return true;
4739  }
4740
4741  protected CodeSystem.ConceptDefinitionComponent parseCodeSystemConceptDefinitionComponent(XmlPullParser xpp, CodeSystem owner) throws XmlPullParserException, IOException, FHIRFormatError {
4742    CodeSystem.ConceptDefinitionComponent res = new CodeSystem.ConceptDefinitionComponent();
4743    parseBackboneAttributes(xpp, res);
4744    next(xpp);
4745    int eventType = nextNoWhitespace(xpp);
4746    while (eventType != XmlPullParser.END_TAG) {
4747  if (!parseCodeSystemConceptDefinitionComponentContent(eventType, xpp, owner, res))
4748        unknownContent(xpp);
4749      eventType = nextNoWhitespace(xpp);
4750    }
4751    next(xpp);
4752    parseElementClose(res);
4753    return res;
4754  }
4755
4756  protected boolean parseCodeSystemConceptDefinitionComponentContent(int eventType, XmlPullParser xpp, CodeSystem owner, CodeSystem.ConceptDefinitionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4757      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4758        res.setCodeElement(parseCode(xpp));
4759      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
4760        res.setDisplayElement(parseString(xpp));
4761      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
4762        res.setDefinitionElement(parseString(xpp));
4763      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("designation")) {
4764        res.getDesignation().add(parseCodeSystemConceptDefinitionDesignationComponent(xpp, owner));
4765      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("property")) {
4766        res.getProperty().add(parseCodeSystemConceptPropertyComponent(xpp, owner));
4767      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("concept")) {
4768        res.getConcept().add(parseCodeSystemConceptDefinitionComponent(xpp, owner));
4769      } else if (!parseBackboneContent(eventType, xpp, res))
4770        return false;
4771    return true;
4772  }
4773
4774  protected CodeSystem.ConceptDefinitionDesignationComponent parseCodeSystemConceptDefinitionDesignationComponent(XmlPullParser xpp, CodeSystem owner) throws XmlPullParserException, IOException, FHIRFormatError {
4775    CodeSystem.ConceptDefinitionDesignationComponent res = new CodeSystem.ConceptDefinitionDesignationComponent();
4776    parseBackboneAttributes(xpp, res);
4777    next(xpp);
4778    int eventType = nextNoWhitespace(xpp);
4779    while (eventType != XmlPullParser.END_TAG) {
4780  if (!parseCodeSystemConceptDefinitionDesignationComponentContent(eventType, xpp, owner, res))
4781        unknownContent(xpp);
4782      eventType = nextNoWhitespace(xpp);
4783    }
4784    next(xpp);
4785    parseElementClose(res);
4786    return res;
4787  }
4788
4789  protected boolean parseCodeSystemConceptDefinitionDesignationComponentContent(int eventType, XmlPullParser xpp, CodeSystem owner, CodeSystem.ConceptDefinitionDesignationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4790      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
4791        res.setLanguageElement(parseCode(xpp));
4792      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
4793        res.setUse(parseCoding(xpp));
4794      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
4795        res.setValueElement(parseString(xpp));
4796      } else if (!parseBackboneContent(eventType, xpp, res))
4797        return false;
4798    return true;
4799  }
4800
4801  protected CodeSystem.ConceptPropertyComponent parseCodeSystemConceptPropertyComponent(XmlPullParser xpp, CodeSystem owner) throws XmlPullParserException, IOException, FHIRFormatError {
4802    CodeSystem.ConceptPropertyComponent res = new CodeSystem.ConceptPropertyComponent();
4803    parseBackboneAttributes(xpp, res);
4804    next(xpp);
4805    int eventType = nextNoWhitespace(xpp);
4806    while (eventType != XmlPullParser.END_TAG) {
4807  if (!parseCodeSystemConceptPropertyComponentContent(eventType, xpp, owner, res))
4808        unknownContent(xpp);
4809      eventType = nextNoWhitespace(xpp);
4810    }
4811    next(xpp);
4812    parseElementClose(res);
4813    return res;
4814  }
4815
4816  protected boolean parseCodeSystemConceptPropertyComponentContent(int eventType, XmlPullParser xpp, CodeSystem owner, CodeSystem.ConceptPropertyComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4817      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4818        res.setCodeElement(parseCode(xpp));
4819      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
4820        res.setValue(parseType("value", xpp));
4821      } else if (!parseBackboneContent(eventType, xpp, res))
4822        return false;
4823    return true;
4824  }
4825
4826  protected Communication parseCommunication(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4827    Communication res = new Communication();
4828    parseDomainResourceAttributes(xpp, res);
4829    next(xpp);
4830    int eventType = nextNoWhitespace(xpp);
4831    while (eventType != XmlPullParser.END_TAG) {
4832  if (!parseCommunicationContent(eventType, xpp, res))
4833        unknownContent(xpp);
4834      eventType = nextNoWhitespace(xpp);
4835    }
4836    next(xpp);
4837    parseElementClose(res);
4838    return res;
4839  }
4840
4841  protected boolean parseCommunicationContent(int eventType, XmlPullParser xpp, Communication res) throws XmlPullParserException, IOException, FHIRFormatError {
4842      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4843        res.getIdentifier().add(parseIdentifier(xpp));
4844      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
4845        res.getDefinition().add(parseReference(xpp));
4846      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
4847        res.getBasedOn().add(parseReference(xpp));
4848      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
4849        res.getPartOf().add(parseReference(xpp));
4850      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
4851        res.setStatusElement(parseEnumeration(xpp, Communication.CommunicationStatus.NULL, new Communication.CommunicationStatusEnumFactory()));
4852      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("notDone")) {
4853        res.setNotDoneElement(parseBoolean(xpp));
4854      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("notDoneReason")) {
4855        res.setNotDoneReason(parseCodeableConcept(xpp));
4856      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
4857        res.getCategory().add(parseCodeableConcept(xpp));
4858      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("medium")) {
4859        res.getMedium().add(parseCodeableConcept(xpp));
4860      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
4861        res.setSubject(parseReference(xpp));
4862      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recipient")) {
4863        res.getRecipient().add(parseReference(xpp));
4864      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("topic")) {
4865        res.getTopic().add(parseReference(xpp));
4866      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
4867        res.setContext(parseReference(xpp));
4868      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sent")) {
4869        res.setSentElement(parseDateTime(xpp));
4870      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("received")) {
4871        res.setReceivedElement(parseDateTime(xpp));
4872      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sender")) {
4873        res.setSender(parseReference(xpp));
4874      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonCode")) {
4875        res.getReasonCode().add(parseCodeableConcept(xpp));
4876      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonReference")) {
4877        res.getReasonReference().add(parseReference(xpp));
4878      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payload")) {
4879        res.getPayload().add(parseCommunicationCommunicationPayloadComponent(xpp, res));
4880      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
4881        res.getNote().add(parseAnnotation(xpp));
4882      } else if (!parseDomainResourceContent(eventType, xpp, res))
4883        return false;
4884    return true;
4885  }
4886
4887  protected Communication.CommunicationPayloadComponent parseCommunicationCommunicationPayloadComponent(XmlPullParser xpp, Communication owner) throws XmlPullParserException, IOException, FHIRFormatError {
4888    Communication.CommunicationPayloadComponent res = new Communication.CommunicationPayloadComponent();
4889    parseBackboneAttributes(xpp, res);
4890    next(xpp);
4891    int eventType = nextNoWhitespace(xpp);
4892    while (eventType != XmlPullParser.END_TAG) {
4893  if (!parseCommunicationCommunicationPayloadComponentContent(eventType, xpp, owner, res))
4894        unknownContent(xpp);
4895      eventType = nextNoWhitespace(xpp);
4896    }
4897    next(xpp);
4898    parseElementClose(res);
4899    return res;
4900  }
4901
4902  protected boolean parseCommunicationCommunicationPayloadComponentContent(int eventType, XmlPullParser xpp, Communication owner, Communication.CommunicationPayloadComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4903      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "content")) {
4904        res.setContent(parseType("content", xpp));
4905      } else if (!parseBackboneContent(eventType, xpp, res))
4906        return false;
4907    return true;
4908  }
4909
4910  protected CommunicationRequest parseCommunicationRequest(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4911    CommunicationRequest res = new CommunicationRequest();
4912    parseDomainResourceAttributes(xpp, res);
4913    next(xpp);
4914    int eventType = nextNoWhitespace(xpp);
4915    while (eventType != XmlPullParser.END_TAG) {
4916  if (!parseCommunicationRequestContent(eventType, xpp, res))
4917        unknownContent(xpp);
4918      eventType = nextNoWhitespace(xpp);
4919    }
4920    next(xpp);
4921    parseElementClose(res);
4922    return res;
4923  }
4924
4925  protected boolean parseCommunicationRequestContent(int eventType, XmlPullParser xpp, CommunicationRequest res) throws XmlPullParserException, IOException, FHIRFormatError {
4926      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4927        res.getIdentifier().add(parseIdentifier(xpp));
4928      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
4929        res.getBasedOn().add(parseReference(xpp));
4930      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("replaces")) {
4931        res.getReplaces().add(parseReference(xpp));
4932      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("groupIdentifier")) {
4933        res.setGroupIdentifier(parseIdentifier(xpp));
4934      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
4935        res.setStatusElement(parseEnumeration(xpp, CommunicationRequest.CommunicationRequestStatus.NULL, new CommunicationRequest.CommunicationRequestStatusEnumFactory()));
4936      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
4937        res.getCategory().add(parseCodeableConcept(xpp));
4938      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
4939        res.setPriorityElement(parseEnumeration(xpp, CommunicationRequest.CommunicationPriority.NULL, new CommunicationRequest.CommunicationPriorityEnumFactory()));
4940      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("medium")) {
4941        res.getMedium().add(parseCodeableConcept(xpp));
4942      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
4943        res.setSubject(parseReference(xpp));
4944      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recipient")) {
4945        res.getRecipient().add(parseReference(xpp));
4946      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("topic")) {
4947        res.getTopic().add(parseReference(xpp));
4948      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
4949        res.setContext(parseReference(xpp));
4950      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payload")) {
4951        res.getPayload().add(parseCommunicationRequestCommunicationRequestPayloadComponent(xpp, res));
4952      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "occurrence")) {
4953        res.setOccurrence(parseType("occurrence", xpp));
4954      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authoredOn")) {
4955        res.setAuthoredOnElement(parseDateTime(xpp));
4956      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sender")) {
4957        res.setSender(parseReference(xpp));
4958      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requester")) {
4959        res.setRequester(parseCommunicationRequestCommunicationRequestRequesterComponent(xpp, res));
4960      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonCode")) {
4961        res.getReasonCode().add(parseCodeableConcept(xpp));
4962      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonReference")) {
4963        res.getReasonReference().add(parseReference(xpp));
4964      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
4965        res.getNote().add(parseAnnotation(xpp));
4966      } else if (!parseDomainResourceContent(eventType, xpp, res))
4967        return false;
4968    return true;
4969  }
4970
4971  protected CommunicationRequest.CommunicationRequestPayloadComponent parseCommunicationRequestCommunicationRequestPayloadComponent(XmlPullParser xpp, CommunicationRequest owner) throws XmlPullParserException, IOException, FHIRFormatError {
4972    CommunicationRequest.CommunicationRequestPayloadComponent res = new CommunicationRequest.CommunicationRequestPayloadComponent();
4973    parseBackboneAttributes(xpp, res);
4974    next(xpp);
4975    int eventType = nextNoWhitespace(xpp);
4976    while (eventType != XmlPullParser.END_TAG) {
4977  if (!parseCommunicationRequestCommunicationRequestPayloadComponentContent(eventType, xpp, owner, res))
4978        unknownContent(xpp);
4979      eventType = nextNoWhitespace(xpp);
4980    }
4981    next(xpp);
4982    parseElementClose(res);
4983    return res;
4984  }
4985
4986  protected boolean parseCommunicationRequestCommunicationRequestPayloadComponentContent(int eventType, XmlPullParser xpp, CommunicationRequest owner, CommunicationRequest.CommunicationRequestPayloadComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4987      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "content")) {
4988        res.setContent(parseType("content", xpp));
4989      } else if (!parseBackboneContent(eventType, xpp, res))
4990        return false;
4991    return true;
4992  }
4993
4994  protected CommunicationRequest.CommunicationRequestRequesterComponent parseCommunicationRequestCommunicationRequestRequesterComponent(XmlPullParser xpp, CommunicationRequest owner) throws XmlPullParserException, IOException, FHIRFormatError {
4995    CommunicationRequest.CommunicationRequestRequesterComponent res = new CommunicationRequest.CommunicationRequestRequesterComponent();
4996    parseBackboneAttributes(xpp, res);
4997    next(xpp);
4998    int eventType = nextNoWhitespace(xpp);
4999    while (eventType != XmlPullParser.END_TAG) {
5000  if (!parseCommunicationRequestCommunicationRequestRequesterComponentContent(eventType, xpp, owner, res))
5001        unknownContent(xpp);
5002      eventType = nextNoWhitespace(xpp);
5003    }
5004    next(xpp);
5005    parseElementClose(res);
5006    return res;
5007  }
5008
5009  protected boolean parseCommunicationRequestCommunicationRequestRequesterComponentContent(int eventType, XmlPullParser xpp, CommunicationRequest owner, CommunicationRequest.CommunicationRequestRequesterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5010      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("agent")) {
5011        res.setAgent(parseReference(xpp));
5012      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onBehalfOf")) {
5013        res.setOnBehalfOf(parseReference(xpp));
5014      } else if (!parseBackboneContent(eventType, xpp, res))
5015        return false;
5016    return true;
5017  }
5018
5019  protected CompartmentDefinition parseCompartmentDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5020    CompartmentDefinition res = new CompartmentDefinition();
5021    parseDomainResourceAttributes(xpp, res);
5022    next(xpp);
5023    int eventType = nextNoWhitespace(xpp);
5024    while (eventType != XmlPullParser.END_TAG) {
5025  if (!parseCompartmentDefinitionContent(eventType, xpp, res))
5026        unknownContent(xpp);
5027      eventType = nextNoWhitespace(xpp);
5028    }
5029    next(xpp);
5030    parseElementClose(res);
5031    return res;
5032  }
5033
5034  protected boolean parseCompartmentDefinitionContent(int eventType, XmlPullParser xpp, CompartmentDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
5035      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
5036        res.setUrlElement(parseUri(xpp));
5037      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
5038        res.setNameElement(parseString(xpp));
5039      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
5040        res.setTitleElement(parseString(xpp));
5041      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
5042        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
5043      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
5044        res.setExperimentalElement(parseBoolean(xpp));
5045      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
5046        res.setDateElement(parseDateTime(xpp));
5047      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
5048        res.setPublisherElement(parseString(xpp));
5049      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
5050        res.getContact().add(parseContactDetail(xpp));
5051      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
5052        res.setDescriptionElement(parseMarkdown(xpp));
5053      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
5054        res.setPurposeElement(parseMarkdown(xpp));
5055      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
5056        res.getUseContext().add(parseUsageContext(xpp));
5057      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
5058        res.getJurisdiction().add(parseCodeableConcept(xpp));
5059      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5060        res.setCodeElement(parseEnumeration(xpp, CompartmentDefinition.CompartmentType.NULL, new CompartmentDefinition.CompartmentTypeEnumFactory()));
5061      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("search")) {
5062        res.setSearchElement(parseBoolean(xpp));
5063      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
5064        res.getResource().add(parseCompartmentDefinitionCompartmentDefinitionResourceComponent(xpp, res));
5065      } else if (!parseDomainResourceContent(eventType, xpp, res))
5066        return false;
5067    return true;
5068  }
5069
5070  protected CompartmentDefinition.CompartmentDefinitionResourceComponent parseCompartmentDefinitionCompartmentDefinitionResourceComponent(XmlPullParser xpp, CompartmentDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
5071    CompartmentDefinition.CompartmentDefinitionResourceComponent res = new CompartmentDefinition.CompartmentDefinitionResourceComponent();
5072    parseBackboneAttributes(xpp, res);
5073    next(xpp);
5074    int eventType = nextNoWhitespace(xpp);
5075    while (eventType != XmlPullParser.END_TAG) {
5076  if (!parseCompartmentDefinitionCompartmentDefinitionResourceComponentContent(eventType, xpp, owner, res))
5077        unknownContent(xpp);
5078      eventType = nextNoWhitespace(xpp);
5079    }
5080    next(xpp);
5081    parseElementClose(res);
5082    return res;
5083  }
5084
5085  protected boolean parseCompartmentDefinitionCompartmentDefinitionResourceComponentContent(int eventType, XmlPullParser xpp, CompartmentDefinition owner, CompartmentDefinition.CompartmentDefinitionResourceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5086      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5087        res.setCodeElement(parseCode(xpp));
5088      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("param")) {
5089        res.getParam().add(parseString(xpp));
5090      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
5091        res.setDocumentationElement(parseString(xpp));
5092      } else if (!parseBackboneContent(eventType, xpp, res))
5093        return false;
5094    return true;
5095  }
5096
5097  protected Composition parseComposition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5098    Composition res = new Composition();
5099    parseDomainResourceAttributes(xpp, res);
5100    next(xpp);
5101    int eventType = nextNoWhitespace(xpp);
5102    while (eventType != XmlPullParser.END_TAG) {
5103  if (!parseCompositionContent(eventType, xpp, res))
5104        unknownContent(xpp);
5105      eventType = nextNoWhitespace(xpp);
5106    }
5107    next(xpp);
5108    parseElementClose(res);
5109    return res;
5110  }
5111
5112  protected boolean parseCompositionContent(int eventType, XmlPullParser xpp, Composition res) throws XmlPullParserException, IOException, FHIRFormatError {
5113      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5114        res.setIdentifier(parseIdentifier(xpp));
5115      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
5116        res.setStatusElement(parseEnumeration(xpp, Composition.CompositionStatus.NULL, new Composition.CompositionStatusEnumFactory()));
5117      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5118        res.setType(parseCodeableConcept(xpp));
5119      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("class")) {
5120        res.setClass_(parseCodeableConcept(xpp));
5121      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
5122        res.setSubject(parseReference(xpp));
5123      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
5124        res.setEncounter(parseReference(xpp));
5125      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
5126        res.setDateElement(parseDateTime(xpp));
5127      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
5128        res.getAuthor().add(parseReference(xpp));
5129      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
5130        res.setTitleElement(parseString(xpp));
5131      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("confidentiality")) {
5132        res.setConfidentialityElement(parseEnumeration(xpp, Composition.DocumentConfidentiality.NULL, new Composition.DocumentConfidentialityEnumFactory()));
5133      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("attester")) {
5134        res.getAttester().add(parseCompositionCompositionAttesterComponent(xpp, res));
5135      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("custodian")) {
5136        res.setCustodian(parseReference(xpp));
5137      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatesTo")) {
5138        res.getRelatesTo().add(parseCompositionCompositionRelatesToComponent(xpp, res));
5139      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("event")) {
5140        res.getEvent().add(parseCompositionCompositionEventComponent(xpp, res));
5141      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("section")) {
5142        res.getSection().add(parseCompositionSectionComponent(xpp, res));
5143      } else if (!parseDomainResourceContent(eventType, xpp, res))
5144        return false;
5145    return true;
5146  }
5147
5148  protected Composition.CompositionAttesterComponent parseCompositionCompositionAttesterComponent(XmlPullParser xpp, Composition owner) throws XmlPullParserException, IOException, FHIRFormatError {
5149    Composition.CompositionAttesterComponent res = new Composition.CompositionAttesterComponent();
5150    parseBackboneAttributes(xpp, res);
5151    next(xpp);
5152    int eventType = nextNoWhitespace(xpp);
5153    while (eventType != XmlPullParser.END_TAG) {
5154  if (!parseCompositionCompositionAttesterComponentContent(eventType, xpp, owner, res))
5155        unknownContent(xpp);
5156      eventType = nextNoWhitespace(xpp);
5157    }
5158    next(xpp);
5159    parseElementClose(res);
5160    return res;
5161  }
5162
5163  protected boolean parseCompositionCompositionAttesterComponentContent(int eventType, XmlPullParser xpp, Composition owner, Composition.CompositionAttesterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5164      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
5165        res.getMode().add(parseEnumeration(xpp, Composition.CompositionAttestationMode.NULL, new Composition.CompositionAttestationModeEnumFactory()));
5166      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("time")) {
5167        res.setTimeElement(parseDateTime(xpp));
5168      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("party")) {
5169        res.setParty(parseReference(xpp));
5170      } else if (!parseBackboneContent(eventType, xpp, res))
5171        return false;
5172    return true;
5173  }
5174
5175  protected Composition.CompositionRelatesToComponent parseCompositionCompositionRelatesToComponent(XmlPullParser xpp, Composition owner) throws XmlPullParserException, IOException, FHIRFormatError {
5176    Composition.CompositionRelatesToComponent res = new Composition.CompositionRelatesToComponent();
5177    parseBackboneAttributes(xpp, res);
5178    next(xpp);
5179    int eventType = nextNoWhitespace(xpp);
5180    while (eventType != XmlPullParser.END_TAG) {
5181  if (!parseCompositionCompositionRelatesToComponentContent(eventType, xpp, owner, res))
5182        unknownContent(xpp);
5183      eventType = nextNoWhitespace(xpp);
5184    }
5185    next(xpp);
5186    parseElementClose(res);
5187    return res;
5188  }
5189
5190  protected boolean parseCompositionCompositionRelatesToComponentContent(int eventType, XmlPullParser xpp, Composition owner, Composition.CompositionRelatesToComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5191      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5192        res.setCodeElement(parseEnumeration(xpp, Composition.DocumentRelationshipType.NULL, new Composition.DocumentRelationshipTypeEnumFactory()));
5193      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "target")) {
5194        res.setTarget(parseType("target", xpp));
5195      } else if (!parseBackboneContent(eventType, xpp, res))
5196        return false;
5197    return true;
5198  }
5199
5200  protected Composition.CompositionEventComponent parseCompositionCompositionEventComponent(XmlPullParser xpp, Composition owner) throws XmlPullParserException, IOException, FHIRFormatError {
5201    Composition.CompositionEventComponent res = new Composition.CompositionEventComponent();
5202    parseBackboneAttributes(xpp, res);
5203    next(xpp);
5204    int eventType = nextNoWhitespace(xpp);
5205    while (eventType != XmlPullParser.END_TAG) {
5206  if (!parseCompositionCompositionEventComponentContent(eventType, xpp, owner, res))
5207        unknownContent(xpp);
5208      eventType = nextNoWhitespace(xpp);
5209    }
5210    next(xpp);
5211    parseElementClose(res);
5212    return res;
5213  }
5214
5215  protected boolean parseCompositionCompositionEventComponentContent(int eventType, XmlPullParser xpp, Composition owner, Composition.CompositionEventComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5216      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5217        res.getCode().add(parseCodeableConcept(xpp));
5218      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
5219        res.setPeriod(parsePeriod(xpp));
5220      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
5221        res.getDetail().add(parseReference(xpp));
5222      } else if (!parseBackboneContent(eventType, xpp, res))
5223        return false;
5224    return true;
5225  }
5226
5227  protected Composition.SectionComponent parseCompositionSectionComponent(XmlPullParser xpp, Composition owner) throws XmlPullParserException, IOException, FHIRFormatError {
5228    Composition.SectionComponent res = new Composition.SectionComponent();
5229    parseBackboneAttributes(xpp, res);
5230    next(xpp);
5231    int eventType = nextNoWhitespace(xpp);
5232    while (eventType != XmlPullParser.END_TAG) {
5233  if (!parseCompositionSectionComponentContent(eventType, xpp, owner, res))
5234        unknownContent(xpp);
5235      eventType = nextNoWhitespace(xpp);
5236    }
5237    next(xpp);
5238    parseElementClose(res);
5239    return res;
5240  }
5241
5242  protected boolean parseCompositionSectionComponentContent(int eventType, XmlPullParser xpp, Composition owner, Composition.SectionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5243      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
5244        res.setTitleElement(parseString(xpp));
5245      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5246        res.setCode(parseCodeableConcept(xpp));
5247      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
5248        res.setText(parseNarrative(xpp));
5249      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
5250        res.setModeElement(parseEnumeration(xpp, Composition.SectionMode.NULL, new Composition.SectionModeEnumFactory()));
5251      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("orderedBy")) {
5252        res.setOrderedBy(parseCodeableConcept(xpp));
5253      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("entry")) {
5254        res.getEntry().add(parseReference(xpp));
5255      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("emptyReason")) {
5256        res.setEmptyReason(parseCodeableConcept(xpp));
5257      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("section")) {
5258        res.getSection().add(parseCompositionSectionComponent(xpp, owner));
5259      } else if (!parseBackboneContent(eventType, xpp, res))
5260        return false;
5261    return true;
5262  }
5263
5264  protected ConceptMap parseConceptMap(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5265    ConceptMap res = new ConceptMap();
5266    parseDomainResourceAttributes(xpp, res);
5267    next(xpp);
5268    int eventType = nextNoWhitespace(xpp);
5269    while (eventType != XmlPullParser.END_TAG) {
5270  if (!parseConceptMapContent(eventType, xpp, res))
5271        unknownContent(xpp);
5272      eventType = nextNoWhitespace(xpp);
5273    }
5274    next(xpp);
5275    parseElementClose(res);
5276    return res;
5277  }
5278
5279  protected boolean parseConceptMapContent(int eventType, XmlPullParser xpp, ConceptMap res) throws XmlPullParserException, IOException, FHIRFormatError {
5280      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
5281        res.setUrlElement(parseUri(xpp));
5282      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5283        res.setIdentifier(parseIdentifier(xpp));
5284      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
5285        res.setVersionElement(parseString(xpp));
5286      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
5287        res.setNameElement(parseString(xpp));
5288      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
5289        res.setTitleElement(parseString(xpp));
5290      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
5291        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
5292      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
5293        res.setExperimentalElement(parseBoolean(xpp));
5294      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
5295        res.setDateElement(parseDateTime(xpp));
5296      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
5297        res.setPublisherElement(parseString(xpp));
5298      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
5299        res.getContact().add(parseContactDetail(xpp));
5300      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
5301        res.setDescriptionElement(parseMarkdown(xpp));
5302      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
5303        res.getUseContext().add(parseUsageContext(xpp));
5304      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
5305        res.getJurisdiction().add(parseCodeableConcept(xpp));
5306      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
5307        res.setPurposeElement(parseMarkdown(xpp));
5308      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
5309        res.setCopyrightElement(parseMarkdown(xpp));
5310      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "source")) {
5311        res.setSource(parseType("source", xpp));
5312      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "target")) {
5313        res.setTarget(parseType("target", xpp));
5314      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("group")) {
5315        res.getGroup().add(parseConceptMapConceptMapGroupComponent(xpp, res));
5316      } else if (!parseDomainResourceContent(eventType, xpp, res))
5317        return false;
5318    return true;
5319  }
5320
5321  protected ConceptMap.ConceptMapGroupComponent parseConceptMapConceptMapGroupComponent(XmlPullParser xpp, ConceptMap owner) throws XmlPullParserException, IOException, FHIRFormatError {
5322    ConceptMap.ConceptMapGroupComponent res = new ConceptMap.ConceptMapGroupComponent();
5323    parseBackboneAttributes(xpp, res);
5324    next(xpp);
5325    int eventType = nextNoWhitespace(xpp);
5326    while (eventType != XmlPullParser.END_TAG) {
5327  if (!parseConceptMapConceptMapGroupComponentContent(eventType, xpp, owner, res))
5328        unknownContent(xpp);
5329      eventType = nextNoWhitespace(xpp);
5330    }
5331    next(xpp);
5332    parseElementClose(res);
5333    return res;
5334  }
5335
5336  protected boolean parseConceptMapConceptMapGroupComponentContent(int eventType, XmlPullParser xpp, ConceptMap owner, ConceptMap.ConceptMapGroupComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5337      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
5338        res.setSourceElement(parseUri(xpp));
5339      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sourceVersion")) {
5340        res.setSourceVersionElement(parseString(xpp));
5341      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("target")) {
5342        res.setTargetElement(parseUri(xpp));
5343      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("targetVersion")) {
5344        res.setTargetVersionElement(parseString(xpp));
5345      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("element")) {
5346        res.getElement().add(parseConceptMapSourceElementComponent(xpp, owner));
5347      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unmapped")) {
5348        res.setUnmapped(parseConceptMapConceptMapGroupUnmappedComponent(xpp, owner));
5349      } else if (!parseBackboneContent(eventType, xpp, res))
5350        return false;
5351    return true;
5352  }
5353
5354  protected ConceptMap.SourceElementComponent parseConceptMapSourceElementComponent(XmlPullParser xpp, ConceptMap owner) throws XmlPullParserException, IOException, FHIRFormatError {
5355    ConceptMap.SourceElementComponent res = new ConceptMap.SourceElementComponent();
5356    parseBackboneAttributes(xpp, res);
5357    next(xpp);
5358    int eventType = nextNoWhitespace(xpp);
5359    while (eventType != XmlPullParser.END_TAG) {
5360  if (!parseConceptMapSourceElementComponentContent(eventType, xpp, owner, res))
5361        unknownContent(xpp);
5362      eventType = nextNoWhitespace(xpp);
5363    }
5364    next(xpp);
5365    parseElementClose(res);
5366    return res;
5367  }
5368
5369  protected boolean parseConceptMapSourceElementComponentContent(int eventType, XmlPullParser xpp, ConceptMap owner, ConceptMap.SourceElementComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5370      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5371        res.setCodeElement(parseCode(xpp));
5372      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
5373        res.setDisplayElement(parseString(xpp));
5374      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("target")) {
5375        res.getTarget().add(parseConceptMapTargetElementComponent(xpp, owner));
5376      } else if (!parseBackboneContent(eventType, xpp, res))
5377        return false;
5378    return true;
5379  }
5380
5381  protected ConceptMap.TargetElementComponent parseConceptMapTargetElementComponent(XmlPullParser xpp, ConceptMap owner) throws XmlPullParserException, IOException, FHIRFormatError {
5382    ConceptMap.TargetElementComponent res = new ConceptMap.TargetElementComponent();
5383    parseBackboneAttributes(xpp, res);
5384    next(xpp);
5385    int eventType = nextNoWhitespace(xpp);
5386    while (eventType != XmlPullParser.END_TAG) {
5387  if (!parseConceptMapTargetElementComponentContent(eventType, xpp, owner, res))
5388        unknownContent(xpp);
5389      eventType = nextNoWhitespace(xpp);
5390    }
5391    next(xpp);
5392    parseElementClose(res);
5393    return res;
5394  }
5395
5396  protected boolean parseConceptMapTargetElementComponentContent(int eventType, XmlPullParser xpp, ConceptMap owner, ConceptMap.TargetElementComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5397      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5398        res.setCodeElement(parseCode(xpp));
5399      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
5400        res.setDisplayElement(parseString(xpp));
5401      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("equivalence")) {
5402        res.setEquivalenceElement(parseEnumeration(xpp, Enumerations.ConceptMapEquivalence.NULL, new Enumerations.ConceptMapEquivalenceEnumFactory()));
5403      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
5404        res.setCommentElement(parseString(xpp));
5405      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dependsOn")) {
5406        res.getDependsOn().add(parseConceptMapOtherElementComponent(xpp, owner));
5407      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("product")) {
5408        res.getProduct().add(parseConceptMapOtherElementComponent(xpp, owner));
5409      } else if (!parseBackboneContent(eventType, xpp, res))
5410        return false;
5411    return true;
5412  }
5413
5414  protected ConceptMap.OtherElementComponent parseConceptMapOtherElementComponent(XmlPullParser xpp, ConceptMap owner) throws XmlPullParserException, IOException, FHIRFormatError {
5415    ConceptMap.OtherElementComponent res = new ConceptMap.OtherElementComponent();
5416    parseBackboneAttributes(xpp, res);
5417    next(xpp);
5418    int eventType = nextNoWhitespace(xpp);
5419    while (eventType != XmlPullParser.END_TAG) {
5420  if (!parseConceptMapOtherElementComponentContent(eventType, xpp, owner, res))
5421        unknownContent(xpp);
5422      eventType = nextNoWhitespace(xpp);
5423    }
5424    next(xpp);
5425    parseElementClose(res);
5426    return res;
5427  }
5428
5429  protected boolean parseConceptMapOtherElementComponentContent(int eventType, XmlPullParser xpp, ConceptMap owner, ConceptMap.OtherElementComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5430      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("property")) {
5431        res.setPropertyElement(parseUri(xpp));
5432      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
5433        res.setSystemElement(parseUri(xpp));
5434      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5435        res.setCodeElement(parseString(xpp));
5436      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
5437        res.setDisplayElement(parseString(xpp));
5438      } else if (!parseBackboneContent(eventType, xpp, res))
5439        return false;
5440    return true;
5441  }
5442
5443  protected ConceptMap.ConceptMapGroupUnmappedComponent parseConceptMapConceptMapGroupUnmappedComponent(XmlPullParser xpp, ConceptMap owner) throws XmlPullParserException, IOException, FHIRFormatError {
5444    ConceptMap.ConceptMapGroupUnmappedComponent res = new ConceptMap.ConceptMapGroupUnmappedComponent();
5445    parseBackboneAttributes(xpp, res);
5446    next(xpp);
5447    int eventType = nextNoWhitespace(xpp);
5448    while (eventType != XmlPullParser.END_TAG) {
5449  if (!parseConceptMapConceptMapGroupUnmappedComponentContent(eventType, xpp, owner, res))
5450        unknownContent(xpp);
5451      eventType = nextNoWhitespace(xpp);
5452    }
5453    next(xpp);
5454    parseElementClose(res);
5455    return res;
5456  }
5457
5458  protected boolean parseConceptMapConceptMapGroupUnmappedComponentContent(int eventType, XmlPullParser xpp, ConceptMap owner, ConceptMap.ConceptMapGroupUnmappedComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5459      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
5460        res.setModeElement(parseEnumeration(xpp, ConceptMap.ConceptMapGroupUnmappedMode.NULL, new ConceptMap.ConceptMapGroupUnmappedModeEnumFactory()));
5461      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5462        res.setCodeElement(parseCode(xpp));
5463      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
5464        res.setDisplayElement(parseString(xpp));
5465      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
5466        res.setUrlElement(parseUri(xpp));
5467      } else if (!parseBackboneContent(eventType, xpp, res))
5468        return false;
5469    return true;
5470  }
5471
5472  protected Condition parseCondition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5473    Condition res = new Condition();
5474    parseDomainResourceAttributes(xpp, res);
5475    next(xpp);
5476    int eventType = nextNoWhitespace(xpp);
5477    while (eventType != XmlPullParser.END_TAG) {
5478  if (!parseConditionContent(eventType, xpp, res))
5479        unknownContent(xpp);
5480      eventType = nextNoWhitespace(xpp);
5481    }
5482    next(xpp);
5483    parseElementClose(res);
5484    return res;
5485  }
5486
5487  protected boolean parseConditionContent(int eventType, XmlPullParser xpp, Condition res) throws XmlPullParserException, IOException, FHIRFormatError {
5488      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5489        res.getIdentifier().add(parseIdentifier(xpp));
5490      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("clinicalStatus")) {
5491        res.setClinicalStatusElement(parseEnumeration(xpp, Condition.ConditionClinicalStatus.NULL, new Condition.ConditionClinicalStatusEnumFactory()));
5492      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("verificationStatus")) {
5493        res.setVerificationStatusElement(parseEnumeration(xpp, Condition.ConditionVerificationStatus.NULL, new Condition.ConditionVerificationStatusEnumFactory()));
5494      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
5495        res.getCategory().add(parseCodeableConcept(xpp));
5496      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("severity")) {
5497        res.setSeverity(parseCodeableConcept(xpp));
5498      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5499        res.setCode(parseCodeableConcept(xpp));
5500      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodySite")) {
5501        res.getBodySite().add(parseCodeableConcept(xpp));
5502      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
5503        res.setSubject(parseReference(xpp));
5504      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
5505        res.setContext(parseReference(xpp));
5506      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "onset")) {
5507        res.setOnset(parseType("onset", xpp));
5508      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "abatement")) {
5509        res.setAbatement(parseType("abatement", xpp));
5510      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("assertedDate")) {
5511        res.setAssertedDateElement(parseDateTime(xpp));
5512      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("asserter")) {
5513        res.setAsserter(parseReference(xpp));
5514      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("stage")) {
5515        res.setStage(parseConditionConditionStageComponent(xpp, res));
5516      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("evidence")) {
5517        res.getEvidence().add(parseConditionConditionEvidenceComponent(xpp, res));
5518      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
5519        res.getNote().add(parseAnnotation(xpp));
5520      } else if (!parseDomainResourceContent(eventType, xpp, res))
5521        return false;
5522    return true;
5523  }
5524
5525  protected Condition.ConditionStageComponent parseConditionConditionStageComponent(XmlPullParser xpp, Condition owner) throws XmlPullParserException, IOException, FHIRFormatError {
5526    Condition.ConditionStageComponent res = new Condition.ConditionStageComponent();
5527    parseBackboneAttributes(xpp, res);
5528    next(xpp);
5529    int eventType = nextNoWhitespace(xpp);
5530    while (eventType != XmlPullParser.END_TAG) {
5531  if (!parseConditionConditionStageComponentContent(eventType, xpp, owner, res))
5532        unknownContent(xpp);
5533      eventType = nextNoWhitespace(xpp);
5534    }
5535    next(xpp);
5536    parseElementClose(res);
5537    return res;
5538  }
5539
5540  protected boolean parseConditionConditionStageComponentContent(int eventType, XmlPullParser xpp, Condition owner, Condition.ConditionStageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5541      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("summary")) {
5542        res.setSummary(parseCodeableConcept(xpp));
5543      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("assessment")) {
5544        res.getAssessment().add(parseReference(xpp));
5545      } else if (!parseBackboneContent(eventType, xpp, res))
5546        return false;
5547    return true;
5548  }
5549
5550  protected Condition.ConditionEvidenceComponent parseConditionConditionEvidenceComponent(XmlPullParser xpp, Condition owner) throws XmlPullParserException, IOException, FHIRFormatError {
5551    Condition.ConditionEvidenceComponent res = new Condition.ConditionEvidenceComponent();
5552    parseBackboneAttributes(xpp, res);
5553    next(xpp);
5554    int eventType = nextNoWhitespace(xpp);
5555    while (eventType != XmlPullParser.END_TAG) {
5556  if (!parseConditionConditionEvidenceComponentContent(eventType, xpp, owner, res))
5557        unknownContent(xpp);
5558      eventType = nextNoWhitespace(xpp);
5559    }
5560    next(xpp);
5561    parseElementClose(res);
5562    return res;
5563  }
5564
5565  protected boolean parseConditionConditionEvidenceComponentContent(int eventType, XmlPullParser xpp, Condition owner, Condition.ConditionEvidenceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5566      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5567        res.getCode().add(parseCodeableConcept(xpp));
5568      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
5569        res.getDetail().add(parseReference(xpp));
5570      } else if (!parseBackboneContent(eventType, xpp, res))
5571        return false;
5572    return true;
5573  }
5574
5575  protected Consent parseConsent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5576    Consent res = new Consent();
5577    parseDomainResourceAttributes(xpp, res);
5578    next(xpp);
5579    int eventType = nextNoWhitespace(xpp);
5580    while (eventType != XmlPullParser.END_TAG) {
5581  if (!parseConsentContent(eventType, xpp, res))
5582        unknownContent(xpp);
5583      eventType = nextNoWhitespace(xpp);
5584    }
5585    next(xpp);
5586    parseElementClose(res);
5587    return res;
5588  }
5589
5590  protected boolean parseConsentContent(int eventType, XmlPullParser xpp, Consent res) throws XmlPullParserException, IOException, FHIRFormatError {
5591      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5592        res.setIdentifier(parseIdentifier(xpp));
5593      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
5594        res.setStatusElement(parseEnumeration(xpp, Consent.ConsentState.NULL, new Consent.ConsentStateEnumFactory()));
5595      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
5596        res.getCategory().add(parseCodeableConcept(xpp));
5597      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
5598        res.setPatient(parseReference(xpp));
5599      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
5600        res.setPeriod(parsePeriod(xpp));
5601      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dateTime")) {
5602        res.setDateTimeElement(parseDateTime(xpp));
5603      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("consentingParty")) {
5604        res.getConsentingParty().add(parseReference(xpp));
5605      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
5606        res.getActor().add(parseConsentConsentActorComponent(xpp, res));
5607      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
5608        res.getAction().add(parseCodeableConcept(xpp));
5609      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("organization")) {
5610        res.getOrganization().add(parseReference(xpp));
5611      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "source")) {
5612        res.setSource(parseType("source", xpp));
5613      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("policy")) {
5614        res.getPolicy().add(parseConsentConsentPolicyComponent(xpp, res));
5615      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("policyRule")) {
5616        res.setPolicyRuleElement(parseUri(xpp));
5617      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("securityLabel")) {
5618        res.getSecurityLabel().add(parseCoding(xpp));
5619      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
5620        res.getPurpose().add(parseCoding(xpp));
5621      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dataPeriod")) {
5622        res.setDataPeriod(parsePeriod(xpp));
5623      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("data")) {
5624        res.getData().add(parseConsentConsentDataComponent(xpp, res));
5625      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("except")) {
5626        res.getExcept().add(parseConsentExceptComponent(xpp, res));
5627      } else if (!parseDomainResourceContent(eventType, xpp, res))
5628        return false;
5629    return true;
5630  }
5631
5632  protected Consent.ConsentActorComponent parseConsentConsentActorComponent(XmlPullParser xpp, Consent owner) throws XmlPullParserException, IOException, FHIRFormatError {
5633    Consent.ConsentActorComponent res = new Consent.ConsentActorComponent();
5634    parseBackboneAttributes(xpp, res);
5635    next(xpp);
5636    int eventType = nextNoWhitespace(xpp);
5637    while (eventType != XmlPullParser.END_TAG) {
5638  if (!parseConsentConsentActorComponentContent(eventType, xpp, owner, res))
5639        unknownContent(xpp);
5640      eventType = nextNoWhitespace(xpp);
5641    }
5642    next(xpp);
5643    parseElementClose(res);
5644    return res;
5645  }
5646
5647  protected boolean parseConsentConsentActorComponentContent(int eventType, XmlPullParser xpp, Consent owner, Consent.ConsentActorComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5648      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
5649        res.setRole(parseCodeableConcept(xpp));
5650      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
5651        res.setReference(parseReference(xpp));
5652      } else if (!parseBackboneContent(eventType, xpp, res))
5653        return false;
5654    return true;
5655  }
5656
5657  protected Consent.ConsentPolicyComponent parseConsentConsentPolicyComponent(XmlPullParser xpp, Consent owner) throws XmlPullParserException, IOException, FHIRFormatError {
5658    Consent.ConsentPolicyComponent res = new Consent.ConsentPolicyComponent();
5659    parseBackboneAttributes(xpp, res);
5660    next(xpp);
5661    int eventType = nextNoWhitespace(xpp);
5662    while (eventType != XmlPullParser.END_TAG) {
5663  if (!parseConsentConsentPolicyComponentContent(eventType, xpp, owner, res))
5664        unknownContent(xpp);
5665      eventType = nextNoWhitespace(xpp);
5666    }
5667    next(xpp);
5668    parseElementClose(res);
5669    return res;
5670  }
5671
5672  protected boolean parseConsentConsentPolicyComponentContent(int eventType, XmlPullParser xpp, Consent owner, Consent.ConsentPolicyComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5673      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authority")) {
5674        res.setAuthorityElement(parseUri(xpp));
5675      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("uri")) {
5676        res.setUriElement(parseUri(xpp));
5677      } else if (!parseBackboneContent(eventType, xpp, res))
5678        return false;
5679    return true;
5680  }
5681
5682  protected Consent.ConsentDataComponent parseConsentConsentDataComponent(XmlPullParser xpp, Consent owner) throws XmlPullParserException, IOException, FHIRFormatError {
5683    Consent.ConsentDataComponent res = new Consent.ConsentDataComponent();
5684    parseBackboneAttributes(xpp, res);
5685    next(xpp);
5686    int eventType = nextNoWhitespace(xpp);
5687    while (eventType != XmlPullParser.END_TAG) {
5688  if (!parseConsentConsentDataComponentContent(eventType, xpp, owner, res))
5689        unknownContent(xpp);
5690      eventType = nextNoWhitespace(xpp);
5691    }
5692    next(xpp);
5693    parseElementClose(res);
5694    return res;
5695  }
5696
5697  protected boolean parseConsentConsentDataComponentContent(int eventType, XmlPullParser xpp, Consent owner, Consent.ConsentDataComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5698      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("meaning")) {
5699        res.setMeaningElement(parseEnumeration(xpp, Consent.ConsentDataMeaning.NULL, new Consent.ConsentDataMeaningEnumFactory()));
5700      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
5701        res.setReference(parseReference(xpp));
5702      } else if (!parseBackboneContent(eventType, xpp, res))
5703        return false;
5704    return true;
5705  }
5706
5707  protected Consent.ExceptComponent parseConsentExceptComponent(XmlPullParser xpp, Consent owner) throws XmlPullParserException, IOException, FHIRFormatError {
5708    Consent.ExceptComponent res = new Consent.ExceptComponent();
5709    parseBackboneAttributes(xpp, res);
5710    next(xpp);
5711    int eventType = nextNoWhitespace(xpp);
5712    while (eventType != XmlPullParser.END_TAG) {
5713  if (!parseConsentExceptComponentContent(eventType, xpp, owner, res))
5714        unknownContent(xpp);
5715      eventType = nextNoWhitespace(xpp);
5716    }
5717    next(xpp);
5718    parseElementClose(res);
5719    return res;
5720  }
5721
5722  protected boolean parseConsentExceptComponentContent(int eventType, XmlPullParser xpp, Consent owner, Consent.ExceptComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5723      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5724        res.setTypeElement(parseEnumeration(xpp, Consent.ConsentExceptType.NULL, new Consent.ConsentExceptTypeEnumFactory()));
5725      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
5726        res.setPeriod(parsePeriod(xpp));
5727      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
5728        res.getActor().add(parseConsentExceptActorComponent(xpp, owner));
5729      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
5730        res.getAction().add(parseCodeableConcept(xpp));
5731      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("securityLabel")) {
5732        res.getSecurityLabel().add(parseCoding(xpp));
5733      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
5734        res.getPurpose().add(parseCoding(xpp));
5735      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("class")) {
5736        res.getClass_().add(parseCoding(xpp));
5737      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5738        res.getCode().add(parseCoding(xpp));
5739      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dataPeriod")) {
5740        res.setDataPeriod(parsePeriod(xpp));
5741      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("data")) {
5742        res.getData().add(parseConsentExceptDataComponent(xpp, owner));
5743      } else if (!parseBackboneContent(eventType, xpp, res))
5744        return false;
5745    return true;
5746  }
5747
5748  protected Consent.ExceptActorComponent parseConsentExceptActorComponent(XmlPullParser xpp, Consent owner) throws XmlPullParserException, IOException, FHIRFormatError {
5749    Consent.ExceptActorComponent res = new Consent.ExceptActorComponent();
5750    parseBackboneAttributes(xpp, res);
5751    next(xpp);
5752    int eventType = nextNoWhitespace(xpp);
5753    while (eventType != XmlPullParser.END_TAG) {
5754  if (!parseConsentExceptActorComponentContent(eventType, xpp, owner, res))
5755        unknownContent(xpp);
5756      eventType = nextNoWhitespace(xpp);
5757    }
5758    next(xpp);
5759    parseElementClose(res);
5760    return res;
5761  }
5762
5763  protected boolean parseConsentExceptActorComponentContent(int eventType, XmlPullParser xpp, Consent owner, Consent.ExceptActorComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5764      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
5765        res.setRole(parseCodeableConcept(xpp));
5766      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
5767        res.setReference(parseReference(xpp));
5768      } else if (!parseBackboneContent(eventType, xpp, res))
5769        return false;
5770    return true;
5771  }
5772
5773  protected Consent.ExceptDataComponent parseConsentExceptDataComponent(XmlPullParser xpp, Consent owner) throws XmlPullParserException, IOException, FHIRFormatError {
5774    Consent.ExceptDataComponent res = new Consent.ExceptDataComponent();
5775    parseBackboneAttributes(xpp, res);
5776    next(xpp);
5777    int eventType = nextNoWhitespace(xpp);
5778    while (eventType != XmlPullParser.END_TAG) {
5779  if (!parseConsentExceptDataComponentContent(eventType, xpp, owner, res))
5780        unknownContent(xpp);
5781      eventType = nextNoWhitespace(xpp);
5782    }
5783    next(xpp);
5784    parseElementClose(res);
5785    return res;
5786  }
5787
5788  protected boolean parseConsentExceptDataComponentContent(int eventType, XmlPullParser xpp, Consent owner, Consent.ExceptDataComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5789      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("meaning")) {
5790        res.setMeaningElement(parseEnumeration(xpp, Consent.ConsentDataMeaning.NULL, new Consent.ConsentDataMeaningEnumFactory()));
5791      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
5792        res.setReference(parseReference(xpp));
5793      } else if (!parseBackboneContent(eventType, xpp, res))
5794        return false;
5795    return true;
5796  }
5797
5798  protected Contract parseContract(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5799    Contract res = new Contract();
5800    parseDomainResourceAttributes(xpp, res);
5801    next(xpp);
5802    int eventType = nextNoWhitespace(xpp);
5803    while (eventType != XmlPullParser.END_TAG) {
5804  if (!parseContractContent(eventType, xpp, res))
5805        unknownContent(xpp);
5806      eventType = nextNoWhitespace(xpp);
5807    }
5808    next(xpp);
5809    parseElementClose(res);
5810    return res;
5811  }
5812
5813  protected boolean parseContractContent(int eventType, XmlPullParser xpp, Contract res) throws XmlPullParserException, IOException, FHIRFormatError {
5814      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5815        res.setIdentifier(parseIdentifier(xpp));
5816      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
5817        res.setStatusElement(parseEnumeration(xpp, Contract.ContractStatus.NULL, new Contract.ContractStatusEnumFactory()));
5818      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("issued")) {
5819        res.setIssuedElement(parseDateTime(xpp));
5820      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("applies")) {
5821        res.setApplies(parsePeriod(xpp));
5822      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
5823        res.getSubject().add(parseReference(xpp));
5824      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("topic")) {
5825        res.getTopic().add(parseReference(xpp));
5826      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authority")) {
5827        res.getAuthority().add(parseReference(xpp));
5828      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("domain")) {
5829        res.getDomain().add(parseReference(xpp));
5830      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5831        res.setType(parseCodeableConcept(xpp));
5832      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subType")) {
5833        res.getSubType().add(parseCodeableConcept(xpp));
5834      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
5835        res.getAction().add(parseCodeableConcept(xpp));
5836      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actionReason")) {
5837        res.getActionReason().add(parseCodeableConcept(xpp));
5838      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("decisionType")) {
5839        res.setDecisionType(parseCodeableConcept(xpp));
5840      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contentDerivative")) {
5841        res.setContentDerivative(parseCodeableConcept(xpp));
5842      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("securityLabel")) {
5843        res.getSecurityLabel().add(parseCoding(xpp));
5844      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("agent")) {
5845        res.getAgent().add(parseContractAgentComponent(xpp, res));
5846      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("signer")) {
5847        res.getSigner().add(parseContractSignatoryComponent(xpp, res));
5848      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valuedItem")) {
5849        res.getValuedItem().add(parseContractValuedItemComponent(xpp, res));
5850      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("term")) {
5851        res.getTerm().add(parseContractTermComponent(xpp, res));
5852      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "binding")) {
5853        res.setBinding(parseType("binding", xpp));
5854      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("friendly")) {
5855        res.getFriendly().add(parseContractFriendlyLanguageComponent(xpp, res));
5856      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("legal")) {
5857        res.getLegal().add(parseContractLegalLanguageComponent(xpp, res));
5858      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rule")) {
5859        res.getRule().add(parseContractComputableLanguageComponent(xpp, res));
5860      } else if (!parseDomainResourceContent(eventType, xpp, res))
5861        return false;
5862    return true;
5863  }
5864
5865  protected Contract.AgentComponent parseContractAgentComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
5866    Contract.AgentComponent res = new Contract.AgentComponent();
5867    parseBackboneAttributes(xpp, res);
5868    next(xpp);
5869    int eventType = nextNoWhitespace(xpp);
5870    while (eventType != XmlPullParser.END_TAG) {
5871  if (!parseContractAgentComponentContent(eventType, xpp, owner, res))
5872        unknownContent(xpp);
5873      eventType = nextNoWhitespace(xpp);
5874    }
5875    next(xpp);
5876    parseElementClose(res);
5877    return res;
5878  }
5879
5880  protected boolean parseContractAgentComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.AgentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5881      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
5882        res.setActor(parseReference(xpp));
5883      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
5884        res.getRole().add(parseCodeableConcept(xpp));
5885      } else if (!parseBackboneContent(eventType, xpp, res))
5886        return false;
5887    return true;
5888  }
5889
5890  protected Contract.SignatoryComponent parseContractSignatoryComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
5891    Contract.SignatoryComponent res = new Contract.SignatoryComponent();
5892    parseBackboneAttributes(xpp, res);
5893    next(xpp);
5894    int eventType = nextNoWhitespace(xpp);
5895    while (eventType != XmlPullParser.END_TAG) {
5896  if (!parseContractSignatoryComponentContent(eventType, xpp, owner, res))
5897        unknownContent(xpp);
5898      eventType = nextNoWhitespace(xpp);
5899    }
5900    next(xpp);
5901    parseElementClose(res);
5902    return res;
5903  }
5904
5905  protected boolean parseContractSignatoryComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.SignatoryComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5906      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5907        res.setType(parseCoding(xpp));
5908      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("party")) {
5909        res.setParty(parseReference(xpp));
5910      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("signature")) {
5911        res.getSignature().add(parseSignature(xpp));
5912      } else if (!parseBackboneContent(eventType, xpp, res))
5913        return false;
5914    return true;
5915  }
5916
5917  protected Contract.ValuedItemComponent parseContractValuedItemComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
5918    Contract.ValuedItemComponent res = new Contract.ValuedItemComponent();
5919    parseBackboneAttributes(xpp, res);
5920    next(xpp);
5921    int eventType = nextNoWhitespace(xpp);
5922    while (eventType != XmlPullParser.END_TAG) {
5923  if (!parseContractValuedItemComponentContent(eventType, xpp, owner, res))
5924        unknownContent(xpp);
5925      eventType = nextNoWhitespace(xpp);
5926    }
5927    next(xpp);
5928    parseElementClose(res);
5929    return res;
5930  }
5931
5932  protected boolean parseContractValuedItemComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.ValuedItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5933      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "entity")) {
5934        res.setEntity(parseType("entity", xpp));
5935      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5936        res.setIdentifier(parseIdentifier(xpp));
5937      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("effectiveTime")) {
5938        res.setEffectiveTimeElement(parseDateTime(xpp));
5939      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
5940        res.setQuantity(parseSimpleQuantity(xpp));
5941      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
5942        res.setUnitPrice(parseMoney(xpp));
5943      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
5944        res.setFactorElement(parseDecimal(xpp));
5945      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("points")) {
5946        res.setPointsElement(parseDecimal(xpp));
5947      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
5948        res.setNet(parseMoney(xpp));
5949      } else if (!parseBackboneContent(eventType, xpp, res))
5950        return false;
5951    return true;
5952  }
5953
5954  protected Contract.TermComponent parseContractTermComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
5955    Contract.TermComponent res = new Contract.TermComponent();
5956    parseBackboneAttributes(xpp, res);
5957    next(xpp);
5958    int eventType = nextNoWhitespace(xpp);
5959    while (eventType != XmlPullParser.END_TAG) {
5960  if (!parseContractTermComponentContent(eventType, xpp, owner, res))
5961        unknownContent(xpp);
5962      eventType = nextNoWhitespace(xpp);
5963    }
5964    next(xpp);
5965    parseElementClose(res);
5966    return res;
5967  }
5968
5969  protected boolean parseContractTermComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.TermComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5970      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5971        res.setIdentifier(parseIdentifier(xpp));
5972      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("issued")) {
5973        res.setIssuedElement(parseDateTime(xpp));
5974      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("applies")) {
5975        res.setApplies(parsePeriod(xpp));
5976      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5977        res.setType(parseCodeableConcept(xpp));
5978      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subType")) {
5979        res.setSubType(parseCodeableConcept(xpp));
5980      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("topic")) {
5981        res.getTopic().add(parseReference(xpp));
5982      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
5983        res.getAction().add(parseCodeableConcept(xpp));
5984      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actionReason")) {
5985        res.getActionReason().add(parseCodeableConcept(xpp));
5986      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("securityLabel")) {
5987        res.getSecurityLabel().add(parseCoding(xpp));
5988      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("agent")) {
5989        res.getAgent().add(parseContractTermAgentComponent(xpp, owner));
5990      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
5991        res.setTextElement(parseString(xpp));
5992      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valuedItem")) {
5993        res.getValuedItem().add(parseContractTermValuedItemComponent(xpp, owner));
5994      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("group")) {
5995        res.getGroup().add(parseContractTermComponent(xpp, owner));
5996      } else if (!parseBackboneContent(eventType, xpp, res))
5997        return false;
5998    return true;
5999  }
6000
6001  protected Contract.TermAgentComponent parseContractTermAgentComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
6002    Contract.TermAgentComponent res = new Contract.TermAgentComponent();
6003    parseBackboneAttributes(xpp, res);
6004    next(xpp);
6005    int eventType = nextNoWhitespace(xpp);
6006    while (eventType != XmlPullParser.END_TAG) {
6007  if (!parseContractTermAgentComponentContent(eventType, xpp, owner, res))
6008        unknownContent(xpp);
6009      eventType = nextNoWhitespace(xpp);
6010    }
6011    next(xpp);
6012    parseElementClose(res);
6013    return res;
6014  }
6015
6016  protected boolean parseContractTermAgentComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.TermAgentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6017      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
6018        res.setActor(parseReference(xpp));
6019      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
6020        res.getRole().add(parseCodeableConcept(xpp));
6021      } else if (!parseBackboneContent(eventType, xpp, res))
6022        return false;
6023    return true;
6024  }
6025
6026  protected Contract.TermValuedItemComponent parseContractTermValuedItemComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
6027    Contract.TermValuedItemComponent res = new Contract.TermValuedItemComponent();
6028    parseBackboneAttributes(xpp, res);
6029    next(xpp);
6030    int eventType = nextNoWhitespace(xpp);
6031    while (eventType != XmlPullParser.END_TAG) {
6032  if (!parseContractTermValuedItemComponentContent(eventType, xpp, owner, res))
6033        unknownContent(xpp);
6034      eventType = nextNoWhitespace(xpp);
6035    }
6036    next(xpp);
6037    parseElementClose(res);
6038    return res;
6039  }
6040
6041  protected boolean parseContractTermValuedItemComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.TermValuedItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6042      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "entity")) {
6043        res.setEntity(parseType("entity", xpp));
6044      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6045        res.setIdentifier(parseIdentifier(xpp));
6046      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("effectiveTime")) {
6047        res.setEffectiveTimeElement(parseDateTime(xpp));
6048      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
6049        res.setQuantity(parseSimpleQuantity(xpp));
6050      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
6051        res.setUnitPrice(parseMoney(xpp));
6052      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
6053        res.setFactorElement(parseDecimal(xpp));
6054      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("points")) {
6055        res.setPointsElement(parseDecimal(xpp));
6056      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
6057        res.setNet(parseMoney(xpp));
6058      } else if (!parseBackboneContent(eventType, xpp, res))
6059        return false;
6060    return true;
6061  }
6062
6063  protected Contract.FriendlyLanguageComponent parseContractFriendlyLanguageComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
6064    Contract.FriendlyLanguageComponent res = new Contract.FriendlyLanguageComponent();
6065    parseBackboneAttributes(xpp, res);
6066    next(xpp);
6067    int eventType = nextNoWhitespace(xpp);
6068    while (eventType != XmlPullParser.END_TAG) {
6069  if (!parseContractFriendlyLanguageComponentContent(eventType, xpp, owner, res))
6070        unknownContent(xpp);
6071      eventType = nextNoWhitespace(xpp);
6072    }
6073    next(xpp);
6074    parseElementClose(res);
6075    return res;
6076  }
6077
6078  protected boolean parseContractFriendlyLanguageComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.FriendlyLanguageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6079      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "content")) {
6080        res.setContent(parseType("content", xpp));
6081      } else if (!parseBackboneContent(eventType, xpp, res))
6082        return false;
6083    return true;
6084  }
6085
6086  protected Contract.LegalLanguageComponent parseContractLegalLanguageComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
6087    Contract.LegalLanguageComponent res = new Contract.LegalLanguageComponent();
6088    parseBackboneAttributes(xpp, res);
6089    next(xpp);
6090    int eventType = nextNoWhitespace(xpp);
6091    while (eventType != XmlPullParser.END_TAG) {
6092  if (!parseContractLegalLanguageComponentContent(eventType, xpp, owner, res))
6093        unknownContent(xpp);
6094      eventType = nextNoWhitespace(xpp);
6095    }
6096    next(xpp);
6097    parseElementClose(res);
6098    return res;
6099  }
6100
6101  protected boolean parseContractLegalLanguageComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.LegalLanguageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6102      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "content")) {
6103        res.setContent(parseType("content", xpp));
6104      } else if (!parseBackboneContent(eventType, xpp, res))
6105        return false;
6106    return true;
6107  }
6108
6109  protected Contract.ComputableLanguageComponent parseContractComputableLanguageComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
6110    Contract.ComputableLanguageComponent res = new Contract.ComputableLanguageComponent();
6111    parseBackboneAttributes(xpp, res);
6112    next(xpp);
6113    int eventType = nextNoWhitespace(xpp);
6114    while (eventType != XmlPullParser.END_TAG) {
6115  if (!parseContractComputableLanguageComponentContent(eventType, xpp, owner, res))
6116        unknownContent(xpp);
6117      eventType = nextNoWhitespace(xpp);
6118    }
6119    next(xpp);
6120    parseElementClose(res);
6121    return res;
6122  }
6123
6124  protected boolean parseContractComputableLanguageComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.ComputableLanguageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6125      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "content")) {
6126        res.setContent(parseType("content", xpp));
6127      } else if (!parseBackboneContent(eventType, xpp, res))
6128        return false;
6129    return true;
6130  }
6131
6132  protected Coverage parseCoverage(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6133    Coverage res = new Coverage();
6134    parseDomainResourceAttributes(xpp, res);
6135    next(xpp);
6136    int eventType = nextNoWhitespace(xpp);
6137    while (eventType != XmlPullParser.END_TAG) {
6138  if (!parseCoverageContent(eventType, xpp, res))
6139        unknownContent(xpp);
6140      eventType = nextNoWhitespace(xpp);
6141    }
6142    next(xpp);
6143    parseElementClose(res);
6144    return res;
6145  }
6146
6147  protected boolean parseCoverageContent(int eventType, XmlPullParser xpp, Coverage res) throws XmlPullParserException, IOException, FHIRFormatError {
6148      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6149        res.getIdentifier().add(parseIdentifier(xpp));
6150      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6151        res.setStatusElement(parseEnumeration(xpp, Coverage.CoverageStatus.NULL, new Coverage.CoverageStatusEnumFactory()));
6152      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6153        res.setType(parseCodeableConcept(xpp));
6154      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("policyHolder")) {
6155        res.setPolicyHolder(parseReference(xpp));
6156      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subscriber")) {
6157        res.setSubscriber(parseReference(xpp));
6158      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subscriberId")) {
6159        res.setSubscriberIdElement(parseString(xpp));
6160      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("beneficiary")) {
6161        res.setBeneficiary(parseReference(xpp));
6162      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relationship")) {
6163        res.setRelationship(parseCodeableConcept(xpp));
6164      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
6165        res.setPeriod(parsePeriod(xpp));
6166      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payor")) {
6167        res.getPayor().add(parseReference(xpp));
6168      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("grouping")) {
6169        res.setGrouping(parseCoverageGroupComponent(xpp, res));
6170      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dependent")) {
6171        res.setDependentElement(parseString(xpp));
6172      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
6173        res.setSequenceElement(parseString(xpp));
6174      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("order")) {
6175        res.setOrderElement(parsePositiveInt(xpp));
6176      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("network")) {
6177        res.setNetworkElement(parseString(xpp));
6178      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contract")) {
6179        res.getContract().add(parseReference(xpp));
6180      } else if (!parseDomainResourceContent(eventType, xpp, res))
6181        return false;
6182    return true;
6183  }
6184
6185  protected Coverage.GroupComponent parseCoverageGroupComponent(XmlPullParser xpp, Coverage owner) throws XmlPullParserException, IOException, FHIRFormatError {
6186    Coverage.GroupComponent res = new Coverage.GroupComponent();
6187    parseBackboneAttributes(xpp, res);
6188    next(xpp);
6189    int eventType = nextNoWhitespace(xpp);
6190    while (eventType != XmlPullParser.END_TAG) {
6191  if (!parseCoverageGroupComponentContent(eventType, xpp, owner, res))
6192        unknownContent(xpp);
6193      eventType = nextNoWhitespace(xpp);
6194    }
6195    next(xpp);
6196    parseElementClose(res);
6197    return res;
6198  }
6199
6200  protected boolean parseCoverageGroupComponentContent(int eventType, XmlPullParser xpp, Coverage owner, Coverage.GroupComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6201      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("group")) {
6202        res.setGroupElement(parseString(xpp));
6203      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("groupDisplay")) {
6204        res.setGroupDisplayElement(parseString(xpp));
6205      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subGroup")) {
6206        res.setSubGroupElement(parseString(xpp));
6207      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subGroupDisplay")) {
6208        res.setSubGroupDisplayElement(parseString(xpp));
6209      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("plan")) {
6210        res.setPlanElement(parseString(xpp));
6211      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("planDisplay")) {
6212        res.setPlanDisplayElement(parseString(xpp));
6213      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subPlan")) {
6214        res.setSubPlanElement(parseString(xpp));
6215      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subPlanDisplay")) {
6216        res.setSubPlanDisplayElement(parseString(xpp));
6217      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("class")) {
6218        res.setClass_Element(parseString(xpp));
6219      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("classDisplay")) {
6220        res.setClassDisplayElement(parseString(xpp));
6221      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subClass")) {
6222        res.setSubClassElement(parseString(xpp));
6223      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subClassDisplay")) {
6224        res.setSubClassDisplayElement(parseString(xpp));
6225      } else if (!parseBackboneContent(eventType, xpp, res))
6226        return false;
6227    return true;
6228  }
6229
6230  protected DataElement parseDataElement(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6231    DataElement res = new DataElement();
6232    parseDomainResourceAttributes(xpp, res);
6233    next(xpp);
6234    int eventType = nextNoWhitespace(xpp);
6235    while (eventType != XmlPullParser.END_TAG) {
6236  if (!parseDataElementContent(eventType, xpp, res))
6237        unknownContent(xpp);
6238      eventType = nextNoWhitespace(xpp);
6239    }
6240    next(xpp);
6241    parseElementClose(res);
6242    return res;
6243  }
6244
6245  protected boolean parseDataElementContent(int eventType, XmlPullParser xpp, DataElement res) throws XmlPullParserException, IOException, FHIRFormatError {
6246      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
6247        res.setUrlElement(parseUri(xpp));
6248      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6249        res.getIdentifier().add(parseIdentifier(xpp));
6250      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
6251        res.setVersionElement(parseString(xpp));
6252      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6253        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
6254      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
6255        res.setExperimentalElement(parseBoolean(xpp));
6256      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
6257        res.setDateElement(parseDateTime(xpp));
6258      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
6259        res.setPublisherElement(parseString(xpp));
6260      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
6261        res.setNameElement(parseString(xpp));
6262      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
6263        res.setTitleElement(parseString(xpp));
6264      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
6265        res.getContact().add(parseContactDetail(xpp));
6266      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
6267        res.getUseContext().add(parseUsageContext(xpp));
6268      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
6269        res.getJurisdiction().add(parseCodeableConcept(xpp));
6270      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
6271        res.setCopyrightElement(parseMarkdown(xpp));
6272      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("stringency")) {
6273        res.setStringencyElement(parseEnumeration(xpp, DataElement.DataElementStringency.NULL, new DataElement.DataElementStringencyEnumFactory()));
6274      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mapping")) {
6275        res.getMapping().add(parseDataElementDataElementMappingComponent(xpp, res));
6276      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("element")) {
6277        res.getElement().add(parseElementDefinition(xpp));
6278      } else if (!parseDomainResourceContent(eventType, xpp, res))
6279        return false;
6280    return true;
6281  }
6282
6283  protected DataElement.DataElementMappingComponent parseDataElementDataElementMappingComponent(XmlPullParser xpp, DataElement owner) throws XmlPullParserException, IOException, FHIRFormatError {
6284    DataElement.DataElementMappingComponent res = new DataElement.DataElementMappingComponent();
6285    parseBackboneAttributes(xpp, res);
6286    next(xpp);
6287    int eventType = nextNoWhitespace(xpp);
6288    while (eventType != XmlPullParser.END_TAG) {
6289  if (!parseDataElementDataElementMappingComponentContent(eventType, xpp, owner, res))
6290        unknownContent(xpp);
6291      eventType = nextNoWhitespace(xpp);
6292    }
6293    next(xpp);
6294    parseElementClose(res);
6295    return res;
6296  }
6297
6298  protected boolean parseDataElementDataElementMappingComponentContent(int eventType, XmlPullParser xpp, DataElement owner, DataElement.DataElementMappingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6299      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identity")) {
6300        res.setIdentityElement(parseId(xpp));
6301      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("uri")) {
6302        res.setUriElement(parseUri(xpp));
6303      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
6304        res.setNameElement(parseString(xpp));
6305      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
6306        res.setCommentElement(parseString(xpp));
6307      } else if (!parseBackboneContent(eventType, xpp, res))
6308        return false;
6309    return true;
6310  }
6311
6312  protected DetectedIssue parseDetectedIssue(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6313    DetectedIssue res = new DetectedIssue();
6314    parseDomainResourceAttributes(xpp, res);
6315    next(xpp);
6316    int eventType = nextNoWhitespace(xpp);
6317    while (eventType != XmlPullParser.END_TAG) {
6318  if (!parseDetectedIssueContent(eventType, xpp, res))
6319        unknownContent(xpp);
6320      eventType = nextNoWhitespace(xpp);
6321    }
6322    next(xpp);
6323    parseElementClose(res);
6324    return res;
6325  }
6326
6327  protected boolean parseDetectedIssueContent(int eventType, XmlPullParser xpp, DetectedIssue res) throws XmlPullParserException, IOException, FHIRFormatError {
6328      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6329        res.setIdentifier(parseIdentifier(xpp));
6330      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6331        res.setStatusElement(parseEnumeration(xpp, DetectedIssue.DetectedIssueStatus.NULL, new DetectedIssue.DetectedIssueStatusEnumFactory()));
6332      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
6333        res.setCategory(parseCodeableConcept(xpp));
6334      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("severity")) {
6335        res.setSeverityElement(parseEnumeration(xpp, DetectedIssue.DetectedIssueSeverity.NULL, new DetectedIssue.DetectedIssueSeverityEnumFactory()));
6336      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
6337        res.setPatient(parseReference(xpp));
6338      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
6339        res.setDateElement(parseDateTime(xpp));
6340      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
6341        res.setAuthor(parseReference(xpp));
6342      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("implicated")) {
6343        res.getImplicated().add(parseReference(xpp));
6344      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
6345        res.setDetailElement(parseString(xpp));
6346      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
6347        res.setReferenceElement(parseUri(xpp));
6348      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mitigation")) {
6349        res.getMitigation().add(parseDetectedIssueDetectedIssueMitigationComponent(xpp, res));
6350      } else if (!parseDomainResourceContent(eventType, xpp, res))
6351        return false;
6352    return true;
6353  }
6354
6355  protected DetectedIssue.DetectedIssueMitigationComponent parseDetectedIssueDetectedIssueMitigationComponent(XmlPullParser xpp, DetectedIssue owner) throws XmlPullParserException, IOException, FHIRFormatError {
6356    DetectedIssue.DetectedIssueMitigationComponent res = new DetectedIssue.DetectedIssueMitigationComponent();
6357    parseBackboneAttributes(xpp, res);
6358    next(xpp);
6359    int eventType = nextNoWhitespace(xpp);
6360    while (eventType != XmlPullParser.END_TAG) {
6361  if (!parseDetectedIssueDetectedIssueMitigationComponentContent(eventType, xpp, owner, res))
6362        unknownContent(xpp);
6363      eventType = nextNoWhitespace(xpp);
6364    }
6365    next(xpp);
6366    parseElementClose(res);
6367    return res;
6368  }
6369
6370  protected boolean parseDetectedIssueDetectedIssueMitigationComponentContent(int eventType, XmlPullParser xpp, DetectedIssue owner, DetectedIssue.DetectedIssueMitigationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6371      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
6372        res.setAction(parseCodeableConcept(xpp));
6373      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
6374        res.setDateElement(parseDateTime(xpp));
6375      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
6376        res.setAuthor(parseReference(xpp));
6377      } else if (!parseBackboneContent(eventType, xpp, res))
6378        return false;
6379    return true;
6380  }
6381
6382  protected Device parseDevice(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6383    Device res = new Device();
6384    parseDomainResourceAttributes(xpp, res);
6385    next(xpp);
6386    int eventType = nextNoWhitespace(xpp);
6387    while (eventType != XmlPullParser.END_TAG) {
6388  if (!parseDeviceContent(eventType, xpp, res))
6389        unknownContent(xpp);
6390      eventType = nextNoWhitespace(xpp);
6391    }
6392    next(xpp);
6393    parseElementClose(res);
6394    return res;
6395  }
6396
6397  protected boolean parseDeviceContent(int eventType, XmlPullParser xpp, Device res) throws XmlPullParserException, IOException, FHIRFormatError {
6398      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6399        res.getIdentifier().add(parseIdentifier(xpp));
6400      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("udi")) {
6401        res.setUdi(parseDeviceDeviceUdiComponent(xpp, res));
6402      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6403        res.setStatusElement(parseEnumeration(xpp, Device.FHIRDeviceStatus.NULL, new Device.FHIRDeviceStatusEnumFactory()));
6404      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6405        res.setType(parseCodeableConcept(xpp));
6406      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lotNumber")) {
6407        res.setLotNumberElement(parseString(xpp));
6408      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("manufacturer")) {
6409        res.setManufacturerElement(parseString(xpp));
6410      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("manufactureDate")) {
6411        res.setManufactureDateElement(parseDateTime(xpp));
6412      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expirationDate")) {
6413        res.setExpirationDateElement(parseDateTime(xpp));
6414      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("model")) {
6415        res.setModelElement(parseString(xpp));
6416      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
6417        res.setVersionElement(parseString(xpp));
6418      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
6419        res.setPatient(parseReference(xpp));
6420      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("owner")) {
6421        res.setOwner(parseReference(xpp));
6422      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
6423        res.getContact().add(parseContactPoint(xpp));
6424      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
6425        res.setLocation(parseReference(xpp));
6426      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
6427        res.setUrlElement(parseUri(xpp));
6428      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
6429        res.getNote().add(parseAnnotation(xpp));
6430      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("safety")) {
6431        res.getSafety().add(parseCodeableConcept(xpp));
6432      } else if (!parseDomainResourceContent(eventType, xpp, res))
6433        return false;
6434    return true;
6435  }
6436
6437  protected Device.DeviceUdiComponent parseDeviceDeviceUdiComponent(XmlPullParser xpp, Device owner) throws XmlPullParserException, IOException, FHIRFormatError {
6438    Device.DeviceUdiComponent res = new Device.DeviceUdiComponent();
6439    parseBackboneAttributes(xpp, res);
6440    next(xpp);
6441    int eventType = nextNoWhitespace(xpp);
6442    while (eventType != XmlPullParser.END_TAG) {
6443  if (!parseDeviceDeviceUdiComponentContent(eventType, xpp, owner, res))
6444        unknownContent(xpp);
6445      eventType = nextNoWhitespace(xpp);
6446    }
6447    next(xpp);
6448    parseElementClose(res);
6449    return res;
6450  }
6451
6452  protected boolean parseDeviceDeviceUdiComponentContent(int eventType, XmlPullParser xpp, Device owner, Device.DeviceUdiComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6453      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("deviceIdentifier")) {
6454        res.setDeviceIdentifierElement(parseString(xpp));
6455      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
6456        res.setNameElement(parseString(xpp));
6457      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
6458        res.setJurisdictionElement(parseUri(xpp));
6459      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("carrierHRF")) {
6460        res.setCarrierHRFElement(parseString(xpp));
6461      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("carrierAIDC")) {
6462        res.setCarrierAIDCElement(parseBase64Binary(xpp));
6463      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("issuer")) {
6464        res.setIssuerElement(parseUri(xpp));
6465      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("entryType")) {
6466        res.setEntryTypeElement(parseEnumeration(xpp, Device.UDIEntryType.NULL, new Device.UDIEntryTypeEnumFactory()));
6467      } else if (!parseBackboneContent(eventType, xpp, res))
6468        return false;
6469    return true;
6470  }
6471
6472  protected DeviceComponent parseDeviceComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6473    DeviceComponent res = new DeviceComponent();
6474    parseDomainResourceAttributes(xpp, res);
6475    next(xpp);
6476    int eventType = nextNoWhitespace(xpp);
6477    while (eventType != XmlPullParser.END_TAG) {
6478  if (!parseDeviceComponentContent(eventType, xpp, res))
6479        unknownContent(xpp);
6480      eventType = nextNoWhitespace(xpp);
6481    }
6482    next(xpp);
6483    parseElementClose(res);
6484    return res;
6485  }
6486
6487  protected boolean parseDeviceComponentContent(int eventType, XmlPullParser xpp, DeviceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6488      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6489        res.setIdentifier(parseIdentifier(xpp));
6490      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6491        res.setType(parseCodeableConcept(xpp));
6492      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastSystemChange")) {
6493        res.setLastSystemChangeElement(parseInstant(xpp));
6494      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
6495        res.setSource(parseReference(xpp));
6496      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("parent")) {
6497        res.setParent(parseReference(xpp));
6498      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operationalStatus")) {
6499        res.getOperationalStatus().add(parseCodeableConcept(xpp));
6500      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("parameterGroup")) {
6501        res.setParameterGroup(parseCodeableConcept(xpp));
6502      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("measurementPrinciple")) {
6503        res.setMeasurementPrincipleElement(parseEnumeration(xpp, DeviceComponent.MeasmntPrinciple.NULL, new DeviceComponent.MeasmntPrincipleEnumFactory()));
6504      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productionSpecification")) {
6505        res.getProductionSpecification().add(parseDeviceComponentDeviceComponentProductionSpecificationComponent(xpp, res));
6506      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("languageCode")) {
6507        res.setLanguageCode(parseCodeableConcept(xpp));
6508      } else if (!parseDomainResourceContent(eventType, xpp, res))
6509        return false;
6510    return true;
6511  }
6512
6513  protected DeviceComponent.DeviceComponentProductionSpecificationComponent parseDeviceComponentDeviceComponentProductionSpecificationComponent(XmlPullParser xpp, DeviceComponent owner) throws XmlPullParserException, IOException, FHIRFormatError {
6514    DeviceComponent.DeviceComponentProductionSpecificationComponent res = new DeviceComponent.DeviceComponentProductionSpecificationComponent();
6515    parseBackboneAttributes(xpp, res);
6516    next(xpp);
6517    int eventType = nextNoWhitespace(xpp);
6518    while (eventType != XmlPullParser.END_TAG) {
6519  if (!parseDeviceComponentDeviceComponentProductionSpecificationComponentContent(eventType, xpp, owner, res))
6520        unknownContent(xpp);
6521      eventType = nextNoWhitespace(xpp);
6522    }
6523    next(xpp);
6524    parseElementClose(res);
6525    return res;
6526  }
6527
6528  protected boolean parseDeviceComponentDeviceComponentProductionSpecificationComponentContent(int eventType, XmlPullParser xpp, DeviceComponent owner, DeviceComponent.DeviceComponentProductionSpecificationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6529      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specType")) {
6530        res.setSpecType(parseCodeableConcept(xpp));
6531      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("componentId")) {
6532        res.setComponentId(parseIdentifier(xpp));
6533      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productionSpec")) {
6534        res.setProductionSpecElement(parseString(xpp));
6535      } else if (!parseBackboneContent(eventType, xpp, res))
6536        return false;
6537    return true;
6538  }
6539
6540  protected DeviceMetric parseDeviceMetric(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6541    DeviceMetric res = new DeviceMetric();
6542    parseDomainResourceAttributes(xpp, res);
6543    next(xpp);
6544    int eventType = nextNoWhitespace(xpp);
6545    while (eventType != XmlPullParser.END_TAG) {
6546  if (!parseDeviceMetricContent(eventType, xpp, res))
6547        unknownContent(xpp);
6548      eventType = nextNoWhitespace(xpp);
6549    }
6550    next(xpp);
6551    parseElementClose(res);
6552    return res;
6553  }
6554
6555  protected boolean parseDeviceMetricContent(int eventType, XmlPullParser xpp, DeviceMetric res) throws XmlPullParserException, IOException, FHIRFormatError {
6556      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6557        res.setIdentifier(parseIdentifier(xpp));
6558      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6559        res.setType(parseCodeableConcept(xpp));
6560      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unit")) {
6561        res.setUnit(parseCodeableConcept(xpp));
6562      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
6563        res.setSource(parseReference(xpp));
6564      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("parent")) {
6565        res.setParent(parseReference(xpp));
6566      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operationalStatus")) {
6567        res.setOperationalStatusElement(parseEnumeration(xpp, DeviceMetric.DeviceMetricOperationalStatus.NULL, new DeviceMetric.DeviceMetricOperationalStatusEnumFactory()));
6568      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("color")) {
6569        res.setColorElement(parseEnumeration(xpp, DeviceMetric.DeviceMetricColor.NULL, new DeviceMetric.DeviceMetricColorEnumFactory()));
6570      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
6571        res.setCategoryElement(parseEnumeration(xpp, DeviceMetric.DeviceMetricCategory.NULL, new DeviceMetric.DeviceMetricCategoryEnumFactory()));
6572      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("measurementPeriod")) {
6573        res.setMeasurementPeriod(parseTiming(xpp));
6574      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("calibration")) {
6575        res.getCalibration().add(parseDeviceMetricDeviceMetricCalibrationComponent(xpp, res));
6576      } else if (!parseDomainResourceContent(eventType, xpp, res))
6577        return false;
6578    return true;
6579  }
6580
6581  protected DeviceMetric.DeviceMetricCalibrationComponent parseDeviceMetricDeviceMetricCalibrationComponent(XmlPullParser xpp, DeviceMetric owner) throws XmlPullParserException, IOException, FHIRFormatError {
6582    DeviceMetric.DeviceMetricCalibrationComponent res = new DeviceMetric.DeviceMetricCalibrationComponent();
6583    parseBackboneAttributes(xpp, res);
6584    next(xpp);
6585    int eventType = nextNoWhitespace(xpp);
6586    while (eventType != XmlPullParser.END_TAG) {
6587  if (!parseDeviceMetricDeviceMetricCalibrationComponentContent(eventType, xpp, owner, res))
6588        unknownContent(xpp);
6589      eventType = nextNoWhitespace(xpp);
6590    }
6591    next(xpp);
6592    parseElementClose(res);
6593    return res;
6594  }
6595
6596  protected boolean parseDeviceMetricDeviceMetricCalibrationComponentContent(int eventType, XmlPullParser xpp, DeviceMetric owner, DeviceMetric.DeviceMetricCalibrationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6597      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6598        res.setTypeElement(parseEnumeration(xpp, DeviceMetric.DeviceMetricCalibrationType.NULL, new DeviceMetric.DeviceMetricCalibrationTypeEnumFactory()));
6599      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("state")) {
6600        res.setStateElement(parseEnumeration(xpp, DeviceMetric.DeviceMetricCalibrationState.NULL, new DeviceMetric.DeviceMetricCalibrationStateEnumFactory()));
6601      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("time")) {
6602        res.setTimeElement(parseInstant(xpp));
6603      } else if (!parseBackboneContent(eventType, xpp, res))
6604        return false;
6605    return true;
6606  }
6607
6608  protected DeviceRequest parseDeviceRequest(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6609    DeviceRequest res = new DeviceRequest();
6610    parseDomainResourceAttributes(xpp, res);
6611    next(xpp);
6612    int eventType = nextNoWhitespace(xpp);
6613    while (eventType != XmlPullParser.END_TAG) {
6614  if (!parseDeviceRequestContent(eventType, xpp, res))
6615        unknownContent(xpp);
6616      eventType = nextNoWhitespace(xpp);
6617    }
6618    next(xpp);
6619    parseElementClose(res);
6620    return res;
6621  }
6622
6623  protected boolean parseDeviceRequestContent(int eventType, XmlPullParser xpp, DeviceRequest res) throws XmlPullParserException, IOException, FHIRFormatError {
6624      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6625        res.getIdentifier().add(parseIdentifier(xpp));
6626      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
6627        res.getDefinition().add(parseReference(xpp));
6628      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
6629        res.getBasedOn().add(parseReference(xpp));
6630      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priorRequest")) {
6631        res.getPriorRequest().add(parseReference(xpp));
6632      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("groupIdentifier")) {
6633        res.setGroupIdentifier(parseIdentifier(xpp));
6634      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6635        res.setStatusElement(parseEnumeration(xpp, DeviceRequest.DeviceRequestStatus.NULL, new DeviceRequest.DeviceRequestStatusEnumFactory()));
6636      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("intent")) {
6637        res.setIntent(parseCodeableConcept(xpp));
6638      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
6639        res.setPriorityElement(parseEnumeration(xpp, DeviceRequest.RequestPriority.NULL, new DeviceRequest.RequestPriorityEnumFactory()));
6640      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "code")) {
6641        res.setCode(parseType("code", xpp));
6642      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
6643        res.setSubject(parseReference(xpp));
6644      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
6645        res.setContext(parseReference(xpp));
6646      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "occurrence")) {
6647        res.setOccurrence(parseType("occurrence", xpp));
6648      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authoredOn")) {
6649        res.setAuthoredOnElement(parseDateTime(xpp));
6650      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requester")) {
6651        res.setRequester(parseDeviceRequestDeviceRequestRequesterComponent(xpp, res));
6652      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performerType")) {
6653        res.setPerformerType(parseCodeableConcept(xpp));
6654      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performer")) {
6655        res.setPerformer(parseReference(xpp));
6656      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonCode")) {
6657        res.getReasonCode().add(parseCodeableConcept(xpp));
6658      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonReference")) {
6659        res.getReasonReference().add(parseReference(xpp));
6660      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInfo")) {
6661        res.getSupportingInfo().add(parseReference(xpp));
6662      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
6663        res.getNote().add(parseAnnotation(xpp));
6664      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relevantHistory")) {
6665        res.getRelevantHistory().add(parseReference(xpp));
6666      } else if (!parseDomainResourceContent(eventType, xpp, res))
6667        return false;
6668    return true;
6669  }
6670
6671  protected DeviceRequest.DeviceRequestRequesterComponent parseDeviceRequestDeviceRequestRequesterComponent(XmlPullParser xpp, DeviceRequest owner) throws XmlPullParserException, IOException, FHIRFormatError {
6672    DeviceRequest.DeviceRequestRequesterComponent res = new DeviceRequest.DeviceRequestRequesterComponent();
6673    parseBackboneAttributes(xpp, res);
6674    next(xpp);
6675    int eventType = nextNoWhitespace(xpp);
6676    while (eventType != XmlPullParser.END_TAG) {
6677  if (!parseDeviceRequestDeviceRequestRequesterComponentContent(eventType, xpp, owner, res))
6678        unknownContent(xpp);
6679      eventType = nextNoWhitespace(xpp);
6680    }
6681    next(xpp);
6682    parseElementClose(res);
6683    return res;
6684  }
6685
6686  protected boolean parseDeviceRequestDeviceRequestRequesterComponentContent(int eventType, XmlPullParser xpp, DeviceRequest owner, DeviceRequest.DeviceRequestRequesterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6687      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("agent")) {
6688        res.setAgent(parseReference(xpp));
6689      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onBehalfOf")) {
6690        res.setOnBehalfOf(parseReference(xpp));
6691      } else if (!parseBackboneContent(eventType, xpp, res))
6692        return false;
6693    return true;
6694  }
6695
6696  protected DeviceUseStatement parseDeviceUseStatement(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6697    DeviceUseStatement res = new DeviceUseStatement();
6698    parseDomainResourceAttributes(xpp, res);
6699    next(xpp);
6700    int eventType = nextNoWhitespace(xpp);
6701    while (eventType != XmlPullParser.END_TAG) {
6702  if (!parseDeviceUseStatementContent(eventType, xpp, res))
6703        unknownContent(xpp);
6704      eventType = nextNoWhitespace(xpp);
6705    }
6706    next(xpp);
6707    parseElementClose(res);
6708    return res;
6709  }
6710
6711  protected boolean parseDeviceUseStatementContent(int eventType, XmlPullParser xpp, DeviceUseStatement res) throws XmlPullParserException, IOException, FHIRFormatError {
6712      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6713        res.getIdentifier().add(parseIdentifier(xpp));
6714      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6715        res.setStatusElement(parseEnumeration(xpp, DeviceUseStatement.DeviceUseStatementStatus.NULL, new DeviceUseStatement.DeviceUseStatementStatusEnumFactory()));
6716      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
6717        res.setSubject(parseReference(xpp));
6718      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("whenUsed")) {
6719        res.setWhenUsed(parsePeriod(xpp));
6720      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "timing")) {
6721        res.setTiming(parseType("timing", xpp));
6722      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recordedOn")) {
6723        res.setRecordedOnElement(parseDateTime(xpp));
6724      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
6725        res.setSource(parseReference(xpp));
6726      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("device")) {
6727        res.setDevice(parseReference(xpp));
6728      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("indication")) {
6729        res.getIndication().add(parseCodeableConcept(xpp));
6730      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodySite")) {
6731        res.setBodySite(parseCodeableConcept(xpp));
6732      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
6733        res.getNote().add(parseAnnotation(xpp));
6734      } else if (!parseDomainResourceContent(eventType, xpp, res))
6735        return false;
6736    return true;
6737  }
6738
6739  protected DiagnosticReport parseDiagnosticReport(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6740    DiagnosticReport res = new DiagnosticReport();
6741    parseDomainResourceAttributes(xpp, res);
6742    next(xpp);
6743    int eventType = nextNoWhitespace(xpp);
6744    while (eventType != XmlPullParser.END_TAG) {
6745  if (!parseDiagnosticReportContent(eventType, xpp, res))
6746        unknownContent(xpp);
6747      eventType = nextNoWhitespace(xpp);
6748    }
6749    next(xpp);
6750    parseElementClose(res);
6751    return res;
6752  }
6753
6754  protected boolean parseDiagnosticReportContent(int eventType, XmlPullParser xpp, DiagnosticReport res) throws XmlPullParserException, IOException, FHIRFormatError {
6755      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6756        res.getIdentifier().add(parseIdentifier(xpp));
6757      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
6758        res.getBasedOn().add(parseReference(xpp));
6759      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6760        res.setStatusElement(parseEnumeration(xpp, DiagnosticReport.DiagnosticReportStatus.NULL, new DiagnosticReport.DiagnosticReportStatusEnumFactory()));
6761      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
6762        res.setCategory(parseCodeableConcept(xpp));
6763      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
6764        res.setCode(parseCodeableConcept(xpp));
6765      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
6766        res.setSubject(parseReference(xpp));
6767      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
6768        res.setContext(parseReference(xpp));
6769      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "effective")) {
6770        res.setEffective(parseType("effective", xpp));
6771      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("issued")) {
6772        res.setIssuedElement(parseInstant(xpp));
6773      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performer")) {
6774        res.getPerformer().add(parseDiagnosticReportDiagnosticReportPerformerComponent(xpp, res));
6775      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specimen")) {
6776        res.getSpecimen().add(parseReference(xpp));
6777      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("result")) {
6778        res.getResult().add(parseReference(xpp));
6779      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("imagingStudy")) {
6780        res.getImagingStudy().add(parseReference(xpp));
6781      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("image")) {
6782        res.getImage().add(parseDiagnosticReportDiagnosticReportImageComponent(xpp, res));
6783      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("conclusion")) {
6784        res.setConclusionElement(parseString(xpp));
6785      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("codedDiagnosis")) {
6786        res.getCodedDiagnosis().add(parseCodeableConcept(xpp));
6787      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("presentedForm")) {
6788        res.getPresentedForm().add(parseAttachment(xpp));
6789      } else if (!parseDomainResourceContent(eventType, xpp, res))
6790        return false;
6791    return true;
6792  }
6793
6794  protected DiagnosticReport.DiagnosticReportPerformerComponent parseDiagnosticReportDiagnosticReportPerformerComponent(XmlPullParser xpp, DiagnosticReport owner) throws XmlPullParserException, IOException, FHIRFormatError {
6795    DiagnosticReport.DiagnosticReportPerformerComponent res = new DiagnosticReport.DiagnosticReportPerformerComponent();
6796    parseBackboneAttributes(xpp, res);
6797    next(xpp);
6798    int eventType = nextNoWhitespace(xpp);
6799    while (eventType != XmlPullParser.END_TAG) {
6800  if (!parseDiagnosticReportDiagnosticReportPerformerComponentContent(eventType, xpp, owner, res))
6801        unknownContent(xpp);
6802      eventType = nextNoWhitespace(xpp);
6803    }
6804    next(xpp);
6805    parseElementClose(res);
6806    return res;
6807  }
6808
6809  protected boolean parseDiagnosticReportDiagnosticReportPerformerComponentContent(int eventType, XmlPullParser xpp, DiagnosticReport owner, DiagnosticReport.DiagnosticReportPerformerComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6810      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
6811        res.setRole(parseCodeableConcept(xpp));
6812      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
6813        res.setActor(parseReference(xpp));
6814      } else if (!parseBackboneContent(eventType, xpp, res))
6815        return false;
6816    return true;
6817  }
6818
6819  protected DiagnosticReport.DiagnosticReportImageComponent parseDiagnosticReportDiagnosticReportImageComponent(XmlPullParser xpp, DiagnosticReport owner) throws XmlPullParserException, IOException, FHIRFormatError {
6820    DiagnosticReport.DiagnosticReportImageComponent res = new DiagnosticReport.DiagnosticReportImageComponent();
6821    parseBackboneAttributes(xpp, res);
6822    next(xpp);
6823    int eventType = nextNoWhitespace(xpp);
6824    while (eventType != XmlPullParser.END_TAG) {
6825  if (!parseDiagnosticReportDiagnosticReportImageComponentContent(eventType, xpp, owner, res))
6826        unknownContent(xpp);
6827      eventType = nextNoWhitespace(xpp);
6828    }
6829    next(xpp);
6830    parseElementClose(res);
6831    return res;
6832  }
6833
6834  protected boolean parseDiagnosticReportDiagnosticReportImageComponentContent(int eventType, XmlPullParser xpp, DiagnosticReport owner, DiagnosticReport.DiagnosticReportImageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6835      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
6836        res.setCommentElement(parseString(xpp));
6837      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("link")) {
6838        res.setLink(parseReference(xpp));
6839      } else if (!parseBackboneContent(eventType, xpp, res))
6840        return false;
6841    return true;
6842  }
6843
6844  protected DocumentManifest parseDocumentManifest(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6845    DocumentManifest res = new DocumentManifest();
6846    parseDomainResourceAttributes(xpp, res);
6847    next(xpp);
6848    int eventType = nextNoWhitespace(xpp);
6849    while (eventType != XmlPullParser.END_TAG) {
6850  if (!parseDocumentManifestContent(eventType, xpp, res))
6851        unknownContent(xpp);
6852      eventType = nextNoWhitespace(xpp);
6853    }
6854    next(xpp);
6855    parseElementClose(res);
6856    return res;
6857  }
6858
6859  protected boolean parseDocumentManifestContent(int eventType, XmlPullParser xpp, DocumentManifest res) throws XmlPullParserException, IOException, FHIRFormatError {
6860      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("masterIdentifier")) {
6861        res.setMasterIdentifier(parseIdentifier(xpp));
6862      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6863        res.getIdentifier().add(parseIdentifier(xpp));
6864      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6865        res.setStatusElement(parseEnumeration(xpp, Enumerations.DocumentReferenceStatus.NULL, new Enumerations.DocumentReferenceStatusEnumFactory()));
6866      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6867        res.setType(parseCodeableConcept(xpp));
6868      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
6869        res.setSubject(parseReference(xpp));
6870      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
6871        res.setCreatedElement(parseDateTime(xpp));
6872      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
6873        res.getAuthor().add(parseReference(xpp));
6874      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recipient")) {
6875        res.getRecipient().add(parseReference(xpp));
6876      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
6877        res.setSourceElement(parseUri(xpp));
6878      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
6879        res.setDescriptionElement(parseString(xpp));
6880      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("content")) {
6881        res.getContent().add(parseDocumentManifestDocumentManifestContentComponent(xpp, res));
6882      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("related")) {
6883        res.getRelated().add(parseDocumentManifestDocumentManifestRelatedComponent(xpp, res));
6884      } else if (!parseDomainResourceContent(eventType, xpp, res))
6885        return false;
6886    return true;
6887  }
6888
6889  protected DocumentManifest.DocumentManifestContentComponent parseDocumentManifestDocumentManifestContentComponent(XmlPullParser xpp, DocumentManifest owner) throws XmlPullParserException, IOException, FHIRFormatError {
6890    DocumentManifest.DocumentManifestContentComponent res = new DocumentManifest.DocumentManifestContentComponent();
6891    parseBackboneAttributes(xpp, res);
6892    next(xpp);
6893    int eventType = nextNoWhitespace(xpp);
6894    while (eventType != XmlPullParser.END_TAG) {
6895  if (!parseDocumentManifestDocumentManifestContentComponentContent(eventType, xpp, owner, res))
6896        unknownContent(xpp);
6897      eventType = nextNoWhitespace(xpp);
6898    }
6899    next(xpp);
6900    parseElementClose(res);
6901    return res;
6902  }
6903
6904  protected boolean parseDocumentManifestDocumentManifestContentComponentContent(int eventType, XmlPullParser xpp, DocumentManifest owner, DocumentManifest.DocumentManifestContentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6905      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "p")) {
6906        res.setP(parseType("p", xpp));
6907      } else if (!parseBackboneContent(eventType, xpp, res))
6908        return false;
6909    return true;
6910  }
6911
6912  protected DocumentManifest.DocumentManifestRelatedComponent parseDocumentManifestDocumentManifestRelatedComponent(XmlPullParser xpp, DocumentManifest owner) throws XmlPullParserException, IOException, FHIRFormatError {
6913    DocumentManifest.DocumentManifestRelatedComponent res = new DocumentManifest.DocumentManifestRelatedComponent();
6914    parseBackboneAttributes(xpp, res);
6915    next(xpp);
6916    int eventType = nextNoWhitespace(xpp);
6917    while (eventType != XmlPullParser.END_TAG) {
6918  if (!parseDocumentManifestDocumentManifestRelatedComponentContent(eventType, xpp, owner, res))
6919        unknownContent(xpp);
6920      eventType = nextNoWhitespace(xpp);
6921    }
6922    next(xpp);
6923    parseElementClose(res);
6924    return res;
6925  }
6926
6927  protected boolean parseDocumentManifestDocumentManifestRelatedComponentContent(int eventType, XmlPullParser xpp, DocumentManifest owner, DocumentManifest.DocumentManifestRelatedComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6928      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6929        res.setIdentifier(parseIdentifier(xpp));
6930      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ref")) {
6931        res.setRef(parseReference(xpp));
6932      } else if (!parseBackboneContent(eventType, xpp, res))
6933        return false;
6934    return true;
6935  }
6936
6937  protected DocumentReference parseDocumentReference(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6938    DocumentReference res = new DocumentReference();
6939    parseDomainResourceAttributes(xpp, res);
6940    next(xpp);
6941    int eventType = nextNoWhitespace(xpp);
6942    while (eventType != XmlPullParser.END_TAG) {
6943  if (!parseDocumentReferenceContent(eventType, xpp, res))
6944        unknownContent(xpp);
6945      eventType = nextNoWhitespace(xpp);
6946    }
6947    next(xpp);
6948    parseElementClose(res);
6949    return res;
6950  }
6951
6952  protected boolean parseDocumentReferenceContent(int eventType, XmlPullParser xpp, DocumentReference res) throws XmlPullParserException, IOException, FHIRFormatError {
6953      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("masterIdentifier")) {
6954        res.setMasterIdentifier(parseIdentifier(xpp));
6955      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6956        res.getIdentifier().add(parseIdentifier(xpp));
6957      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6958        res.setStatusElement(parseEnumeration(xpp, Enumerations.DocumentReferenceStatus.NULL, new Enumerations.DocumentReferenceStatusEnumFactory()));
6959      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("docStatus")) {
6960        res.setDocStatusElement(parseEnumeration(xpp, DocumentReference.ReferredDocumentStatus.NULL, new DocumentReference.ReferredDocumentStatusEnumFactory()));
6961      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6962        res.setType(parseCodeableConcept(xpp));
6963      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("class")) {
6964        res.setClass_(parseCodeableConcept(xpp));
6965      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
6966        res.setSubject(parseReference(xpp));
6967      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
6968        res.setCreatedElement(parseDateTime(xpp));
6969      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("indexed")) {
6970        res.setIndexedElement(parseInstant(xpp));
6971      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
6972        res.getAuthor().add(parseReference(xpp));
6973      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authenticator")) {
6974        res.setAuthenticator(parseReference(xpp));
6975      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("custodian")) {
6976        res.setCustodian(parseReference(xpp));
6977      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatesTo")) {
6978        res.getRelatesTo().add(parseDocumentReferenceDocumentReferenceRelatesToComponent(xpp, res));
6979      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
6980        res.setDescriptionElement(parseString(xpp));
6981      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("securityLabel")) {
6982        res.getSecurityLabel().add(parseCodeableConcept(xpp));
6983      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("content")) {
6984        res.getContent().add(parseDocumentReferenceDocumentReferenceContentComponent(xpp, res));
6985      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
6986        res.setContext(parseDocumentReferenceDocumentReferenceContextComponent(xpp, res));
6987      } else if (!parseDomainResourceContent(eventType, xpp, res))
6988        return false;
6989    return true;
6990  }
6991
6992  protected DocumentReference.DocumentReferenceRelatesToComponent parseDocumentReferenceDocumentReferenceRelatesToComponent(XmlPullParser xpp, DocumentReference owner) throws XmlPullParserException, IOException, FHIRFormatError {
6993    DocumentReference.DocumentReferenceRelatesToComponent res = new DocumentReference.DocumentReferenceRelatesToComponent();
6994    parseBackboneAttributes(xpp, res);
6995    next(xpp);
6996    int eventType = nextNoWhitespace(xpp);
6997    while (eventType != XmlPullParser.END_TAG) {
6998  if (!parseDocumentReferenceDocumentReferenceRelatesToComponentContent(eventType, xpp, owner, res))
6999        unknownContent(xpp);
7000      eventType = nextNoWhitespace(xpp);
7001    }
7002    next(xpp);
7003    parseElementClose(res);
7004    return res;
7005  }
7006
7007  protected boolean parseDocumentReferenceDocumentReferenceRelatesToComponentContent(int eventType, XmlPullParser xpp, DocumentReference owner, DocumentReference.DocumentReferenceRelatesToComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7008      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
7009        res.setCodeElement(parseEnumeration(xpp, DocumentReference.DocumentRelationshipType.NULL, new DocumentReference.DocumentRelationshipTypeEnumFactory()));
7010      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("target")) {
7011        res.setTarget(parseReference(xpp));
7012      } else if (!parseBackboneContent(eventType, xpp, res))
7013        return false;
7014    return true;
7015  }
7016
7017  protected DocumentReference.DocumentReferenceContentComponent parseDocumentReferenceDocumentReferenceContentComponent(XmlPullParser xpp, DocumentReference owner) throws XmlPullParserException, IOException, FHIRFormatError {
7018    DocumentReference.DocumentReferenceContentComponent res = new DocumentReference.DocumentReferenceContentComponent();
7019    parseBackboneAttributes(xpp, res);
7020    next(xpp);
7021    int eventType = nextNoWhitespace(xpp);
7022    while (eventType != XmlPullParser.END_TAG) {
7023  if (!parseDocumentReferenceDocumentReferenceContentComponentContent(eventType, xpp, owner, res))
7024        unknownContent(xpp);
7025      eventType = nextNoWhitespace(xpp);
7026    }
7027    next(xpp);
7028    parseElementClose(res);
7029    return res;
7030  }
7031
7032  protected boolean parseDocumentReferenceDocumentReferenceContentComponentContent(int eventType, XmlPullParser xpp, DocumentReference owner, DocumentReference.DocumentReferenceContentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7033      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("attachment")) {
7034        res.setAttachment(parseAttachment(xpp));
7035      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("format")) {
7036        res.setFormat(parseCoding(xpp));
7037      } else if (!parseBackboneContent(eventType, xpp, res))
7038        return false;
7039    return true;
7040  }
7041
7042  protected DocumentReference.DocumentReferenceContextComponent parseDocumentReferenceDocumentReferenceContextComponent(XmlPullParser xpp, DocumentReference owner) throws XmlPullParserException, IOException, FHIRFormatError {
7043    DocumentReference.DocumentReferenceContextComponent res = new DocumentReference.DocumentReferenceContextComponent();
7044    parseBackboneAttributes(xpp, res);
7045    next(xpp);
7046    int eventType = nextNoWhitespace(xpp);
7047    while (eventType != XmlPullParser.END_TAG) {
7048  if (!parseDocumentReferenceDocumentReferenceContextComponentContent(eventType, xpp, owner, res))
7049        unknownContent(xpp);
7050      eventType = nextNoWhitespace(xpp);
7051    }
7052    next(xpp);
7053    parseElementClose(res);
7054    return res;
7055  }
7056
7057  protected boolean parseDocumentReferenceDocumentReferenceContextComponentContent(int eventType, XmlPullParser xpp, DocumentReference owner, DocumentReference.DocumentReferenceContextComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7058      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
7059        res.setEncounter(parseReference(xpp));
7060      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("event")) {
7061        res.getEvent().add(parseCodeableConcept(xpp));
7062      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7063        res.setPeriod(parsePeriod(xpp));
7064      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("facilityType")) {
7065        res.setFacilityType(parseCodeableConcept(xpp));
7066      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("practiceSetting")) {
7067        res.setPracticeSetting(parseCodeableConcept(xpp));
7068      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sourcePatientInfo")) {
7069        res.setSourcePatientInfo(parseReference(xpp));
7070      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("related")) {
7071        res.getRelated().add(parseDocumentReferenceDocumentReferenceContextRelatedComponent(xpp, owner));
7072      } else if (!parseBackboneContent(eventType, xpp, res))
7073        return false;
7074    return true;
7075  }
7076
7077  protected DocumentReference.DocumentReferenceContextRelatedComponent parseDocumentReferenceDocumentReferenceContextRelatedComponent(XmlPullParser xpp, DocumentReference owner) throws XmlPullParserException, IOException, FHIRFormatError {
7078    DocumentReference.DocumentReferenceContextRelatedComponent res = new DocumentReference.DocumentReferenceContextRelatedComponent();
7079    parseBackboneAttributes(xpp, res);
7080    next(xpp);
7081    int eventType = nextNoWhitespace(xpp);
7082    while (eventType != XmlPullParser.END_TAG) {
7083  if (!parseDocumentReferenceDocumentReferenceContextRelatedComponentContent(eventType, xpp, owner, res))
7084        unknownContent(xpp);
7085      eventType = nextNoWhitespace(xpp);
7086    }
7087    next(xpp);
7088    parseElementClose(res);
7089    return res;
7090  }
7091
7092  protected boolean parseDocumentReferenceDocumentReferenceContextRelatedComponentContent(int eventType, XmlPullParser xpp, DocumentReference owner, DocumentReference.DocumentReferenceContextRelatedComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7093      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7094        res.setIdentifier(parseIdentifier(xpp));
7095      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ref")) {
7096        res.setRef(parseReference(xpp));
7097      } else if (!parseBackboneContent(eventType, xpp, res))
7098        return false;
7099    return true;
7100  }
7101
7102  protected EligibilityRequest parseEligibilityRequest(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7103    EligibilityRequest res = new EligibilityRequest();
7104    parseDomainResourceAttributes(xpp, res);
7105    next(xpp);
7106    int eventType = nextNoWhitespace(xpp);
7107    while (eventType != XmlPullParser.END_TAG) {
7108  if (!parseEligibilityRequestContent(eventType, xpp, res))
7109        unknownContent(xpp);
7110      eventType = nextNoWhitespace(xpp);
7111    }
7112    next(xpp);
7113    parseElementClose(res);
7114    return res;
7115  }
7116
7117  protected boolean parseEligibilityRequestContent(int eventType, XmlPullParser xpp, EligibilityRequest res) throws XmlPullParserException, IOException, FHIRFormatError {
7118      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7119        res.getIdentifier().add(parseIdentifier(xpp));
7120      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7121        res.setStatusElement(parseEnumeration(xpp, EligibilityRequest.EligibilityRequestStatus.NULL, new EligibilityRequest.EligibilityRequestStatusEnumFactory()));
7122      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
7123        res.setPriority(parseCodeableConcept(xpp));
7124      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
7125        res.setPatient(parseReference(xpp));
7126      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "serviced")) {
7127        res.setServiced(parseType("serviced", xpp));
7128      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
7129        res.setCreatedElement(parseDateTime(xpp));
7130      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("enterer")) {
7131        res.setEnterer(parseReference(xpp));
7132      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("provider")) {
7133        res.setProvider(parseReference(xpp));
7134      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("organization")) {
7135        res.setOrganization(parseReference(xpp));
7136      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurer")) {
7137        res.setInsurer(parseReference(xpp));
7138      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("facility")) {
7139        res.setFacility(parseReference(xpp));
7140      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
7141        res.setCoverage(parseReference(xpp));
7142      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("businessArrangement")) {
7143        res.setBusinessArrangementElement(parseString(xpp));
7144      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("benefitCategory")) {
7145        res.setBenefitCategory(parseCodeableConcept(xpp));
7146      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("benefitSubCategory")) {
7147        res.setBenefitSubCategory(parseCodeableConcept(xpp));
7148      } else if (!parseDomainResourceContent(eventType, xpp, res))
7149        return false;
7150    return true;
7151  }
7152
7153  protected EligibilityResponse parseEligibilityResponse(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7154    EligibilityResponse res = new EligibilityResponse();
7155    parseDomainResourceAttributes(xpp, res);
7156    next(xpp);
7157    int eventType = nextNoWhitespace(xpp);
7158    while (eventType != XmlPullParser.END_TAG) {
7159  if (!parseEligibilityResponseContent(eventType, xpp, res))
7160        unknownContent(xpp);
7161      eventType = nextNoWhitespace(xpp);
7162    }
7163    next(xpp);
7164    parseElementClose(res);
7165    return res;
7166  }
7167
7168  protected boolean parseEligibilityResponseContent(int eventType, XmlPullParser xpp, EligibilityResponse res) throws XmlPullParserException, IOException, FHIRFormatError {
7169      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7170        res.getIdentifier().add(parseIdentifier(xpp));
7171      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7172        res.setStatusElement(parseEnumeration(xpp, EligibilityResponse.EligibilityResponseStatus.NULL, new EligibilityResponse.EligibilityResponseStatusEnumFactory()));
7173      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
7174        res.setCreatedElement(parseDateTime(xpp));
7175      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestProvider")) {
7176        res.setRequestProvider(parseReference(xpp));
7177      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestOrganization")) {
7178        res.setRequestOrganization(parseReference(xpp));
7179      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
7180        res.setRequest(parseReference(xpp));
7181      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
7182        res.setOutcome(parseCodeableConcept(xpp));
7183      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("disposition")) {
7184        res.setDispositionElement(parseString(xpp));
7185      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurer")) {
7186        res.setInsurer(parseReference(xpp));
7187      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("inforce")) {
7188        res.setInforceElement(parseBoolean(xpp));
7189      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurance")) {
7190        res.getInsurance().add(parseEligibilityResponseInsuranceComponent(xpp, res));
7191      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("form")) {
7192        res.setForm(parseCodeableConcept(xpp));
7193      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("error")) {
7194        res.getError().add(parseEligibilityResponseErrorsComponent(xpp, res));
7195      } else if (!parseDomainResourceContent(eventType, xpp, res))
7196        return false;
7197    return true;
7198  }
7199
7200  protected EligibilityResponse.InsuranceComponent parseEligibilityResponseInsuranceComponent(XmlPullParser xpp, EligibilityResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
7201    EligibilityResponse.InsuranceComponent res = new EligibilityResponse.InsuranceComponent();
7202    parseBackboneAttributes(xpp, res);
7203    next(xpp);
7204    int eventType = nextNoWhitespace(xpp);
7205    while (eventType != XmlPullParser.END_TAG) {
7206  if (!parseEligibilityResponseInsuranceComponentContent(eventType, xpp, owner, res))
7207        unknownContent(xpp);
7208      eventType = nextNoWhitespace(xpp);
7209    }
7210    next(xpp);
7211    parseElementClose(res);
7212    return res;
7213  }
7214
7215  protected boolean parseEligibilityResponseInsuranceComponentContent(int eventType, XmlPullParser xpp, EligibilityResponse owner, EligibilityResponse.InsuranceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7216      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
7217        res.setCoverage(parseReference(xpp));
7218      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contract")) {
7219        res.setContract(parseReference(xpp));
7220      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("benefitBalance")) {
7221        res.getBenefitBalance().add(parseEligibilityResponseBenefitsComponent(xpp, owner));
7222      } else if (!parseBackboneContent(eventType, xpp, res))
7223        return false;
7224    return true;
7225  }
7226
7227  protected EligibilityResponse.BenefitsComponent parseEligibilityResponseBenefitsComponent(XmlPullParser xpp, EligibilityResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
7228    EligibilityResponse.BenefitsComponent res = new EligibilityResponse.BenefitsComponent();
7229    parseBackboneAttributes(xpp, res);
7230    next(xpp);
7231    int eventType = nextNoWhitespace(xpp);
7232    while (eventType != XmlPullParser.END_TAG) {
7233  if (!parseEligibilityResponseBenefitsComponentContent(eventType, xpp, owner, res))
7234        unknownContent(xpp);
7235      eventType = nextNoWhitespace(xpp);
7236    }
7237    next(xpp);
7238    parseElementClose(res);
7239    return res;
7240  }
7241
7242  protected boolean parseEligibilityResponseBenefitsComponentContent(int eventType, XmlPullParser xpp, EligibilityResponse owner, EligibilityResponse.BenefitsComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7243      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
7244        res.setCategory(parseCodeableConcept(xpp));
7245      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subCategory")) {
7246        res.setSubCategory(parseCodeableConcept(xpp));
7247      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("excluded")) {
7248        res.setExcludedElement(parseBoolean(xpp));
7249      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
7250        res.setNameElement(parseString(xpp));
7251      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
7252        res.setDescriptionElement(parseString(xpp));
7253      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("network")) {
7254        res.setNetwork(parseCodeableConcept(xpp));
7255      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unit")) {
7256        res.setUnit(parseCodeableConcept(xpp));
7257      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("term")) {
7258        res.setTerm(parseCodeableConcept(xpp));
7259      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("financial")) {
7260        res.getFinancial().add(parseEligibilityResponseBenefitComponent(xpp, owner));
7261      } else if (!parseBackboneContent(eventType, xpp, res))
7262        return false;
7263    return true;
7264  }
7265
7266  protected EligibilityResponse.BenefitComponent parseEligibilityResponseBenefitComponent(XmlPullParser xpp, EligibilityResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
7267    EligibilityResponse.BenefitComponent res = new EligibilityResponse.BenefitComponent();
7268    parseBackboneAttributes(xpp, res);
7269    next(xpp);
7270    int eventType = nextNoWhitespace(xpp);
7271    while (eventType != XmlPullParser.END_TAG) {
7272  if (!parseEligibilityResponseBenefitComponentContent(eventType, xpp, owner, res))
7273        unknownContent(xpp);
7274      eventType = nextNoWhitespace(xpp);
7275    }
7276    next(xpp);
7277    parseElementClose(res);
7278    return res;
7279  }
7280
7281  protected boolean parseEligibilityResponseBenefitComponentContent(int eventType, XmlPullParser xpp, EligibilityResponse owner, EligibilityResponse.BenefitComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7282      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
7283        res.setType(parseCodeableConcept(xpp));
7284      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "allowed")) {
7285        res.setAllowed(parseType("allowed", xpp));
7286      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "used")) {
7287        res.setUsed(parseType("used", xpp));
7288      } else if (!parseBackboneContent(eventType, xpp, res))
7289        return false;
7290    return true;
7291  }
7292
7293  protected EligibilityResponse.ErrorsComponent parseEligibilityResponseErrorsComponent(XmlPullParser xpp, EligibilityResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
7294    EligibilityResponse.ErrorsComponent res = new EligibilityResponse.ErrorsComponent();
7295    parseBackboneAttributes(xpp, res);
7296    next(xpp);
7297    int eventType = nextNoWhitespace(xpp);
7298    while (eventType != XmlPullParser.END_TAG) {
7299  if (!parseEligibilityResponseErrorsComponentContent(eventType, xpp, owner, res))
7300        unknownContent(xpp);
7301      eventType = nextNoWhitespace(xpp);
7302    }
7303    next(xpp);
7304    parseElementClose(res);
7305    return res;
7306  }
7307
7308  protected boolean parseEligibilityResponseErrorsComponentContent(int eventType, XmlPullParser xpp, EligibilityResponse owner, EligibilityResponse.ErrorsComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7309      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
7310        res.setCode(parseCodeableConcept(xpp));
7311      } else if (!parseBackboneContent(eventType, xpp, res))
7312        return false;
7313    return true;
7314  }
7315
7316  protected Encounter parseEncounter(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7317    Encounter res = new Encounter();
7318    parseDomainResourceAttributes(xpp, res);
7319    next(xpp);
7320    int eventType = nextNoWhitespace(xpp);
7321    while (eventType != XmlPullParser.END_TAG) {
7322  if (!parseEncounterContent(eventType, xpp, res))
7323        unknownContent(xpp);
7324      eventType = nextNoWhitespace(xpp);
7325    }
7326    next(xpp);
7327    parseElementClose(res);
7328    return res;
7329  }
7330
7331  protected boolean parseEncounterContent(int eventType, XmlPullParser xpp, Encounter res) throws XmlPullParserException, IOException, FHIRFormatError {
7332      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7333        res.getIdentifier().add(parseIdentifier(xpp));
7334      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7335        res.setStatusElement(parseEnumeration(xpp, Encounter.EncounterStatus.NULL, new Encounter.EncounterStatusEnumFactory()));
7336      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("statusHistory")) {
7337        res.getStatusHistory().add(parseEncounterStatusHistoryComponent(xpp, res));
7338      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("class")) {
7339        res.setClass_(parseCoding(xpp));
7340      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("classHistory")) {
7341        res.getClassHistory().add(parseEncounterClassHistoryComponent(xpp, res));
7342      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
7343        res.getType().add(parseCodeableConcept(xpp));
7344      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
7345        res.setPriority(parseCodeableConcept(xpp));
7346      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
7347        res.setSubject(parseReference(xpp));
7348      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("episodeOfCare")) {
7349        res.getEpisodeOfCare().add(parseReference(xpp));
7350      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("incomingReferral")) {
7351        res.getIncomingReferral().add(parseReference(xpp));
7352      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
7353        res.getParticipant().add(parseEncounterEncounterParticipantComponent(xpp, res));
7354      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("appointment")) {
7355        res.setAppointment(parseReference(xpp));
7356      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7357        res.setPeriod(parsePeriod(xpp));
7358      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("length")) {
7359        res.setLength(parseDuration(xpp));
7360      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
7361        res.getReason().add(parseCodeableConcept(xpp));
7362      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diagnosis")) {
7363        res.getDiagnosis().add(parseEncounterDiagnosisComponent(xpp, res));
7364      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("account")) {
7365        res.getAccount().add(parseReference(xpp));
7366      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("hospitalization")) {
7367        res.setHospitalization(parseEncounterEncounterHospitalizationComponent(xpp, res));
7368      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
7369        res.getLocation().add(parseEncounterEncounterLocationComponent(xpp, res));
7370      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("serviceProvider")) {
7371        res.setServiceProvider(parseReference(xpp));
7372      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
7373        res.setPartOf(parseReference(xpp));
7374      } else if (!parseDomainResourceContent(eventType, xpp, res))
7375        return false;
7376    return true;
7377  }
7378
7379  protected Encounter.StatusHistoryComponent parseEncounterStatusHistoryComponent(XmlPullParser xpp, Encounter owner) throws XmlPullParserException, IOException, FHIRFormatError {
7380    Encounter.StatusHistoryComponent res = new Encounter.StatusHistoryComponent();
7381    parseBackboneAttributes(xpp, res);
7382    next(xpp);
7383    int eventType = nextNoWhitespace(xpp);
7384    while (eventType != XmlPullParser.END_TAG) {
7385  if (!parseEncounterStatusHistoryComponentContent(eventType, xpp, owner, res))
7386        unknownContent(xpp);
7387      eventType = nextNoWhitespace(xpp);
7388    }
7389    next(xpp);
7390    parseElementClose(res);
7391    return res;
7392  }
7393
7394  protected boolean parseEncounterStatusHistoryComponentContent(int eventType, XmlPullParser xpp, Encounter owner, Encounter.StatusHistoryComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7395      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7396        res.setStatusElement(parseEnumeration(xpp, Encounter.EncounterStatus.NULL, new Encounter.EncounterStatusEnumFactory()));
7397      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7398        res.setPeriod(parsePeriod(xpp));
7399      } else if (!parseBackboneContent(eventType, xpp, res))
7400        return false;
7401    return true;
7402  }
7403
7404  protected Encounter.ClassHistoryComponent parseEncounterClassHistoryComponent(XmlPullParser xpp, Encounter owner) throws XmlPullParserException, IOException, FHIRFormatError {
7405    Encounter.ClassHistoryComponent res = new Encounter.ClassHistoryComponent();
7406    parseBackboneAttributes(xpp, res);
7407    next(xpp);
7408    int eventType = nextNoWhitespace(xpp);
7409    while (eventType != XmlPullParser.END_TAG) {
7410  if (!parseEncounterClassHistoryComponentContent(eventType, xpp, owner, res))
7411        unknownContent(xpp);
7412      eventType = nextNoWhitespace(xpp);
7413    }
7414    next(xpp);
7415    parseElementClose(res);
7416    return res;
7417  }
7418
7419  protected boolean parseEncounterClassHistoryComponentContent(int eventType, XmlPullParser xpp, Encounter owner, Encounter.ClassHistoryComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7420      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("class")) {
7421        res.setClass_(parseCoding(xpp));
7422      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7423        res.setPeriod(parsePeriod(xpp));
7424      } else if (!parseBackboneContent(eventType, xpp, res))
7425        return false;
7426    return true;
7427  }
7428
7429  protected Encounter.EncounterParticipantComponent parseEncounterEncounterParticipantComponent(XmlPullParser xpp, Encounter owner) throws XmlPullParserException, IOException, FHIRFormatError {
7430    Encounter.EncounterParticipantComponent res = new Encounter.EncounterParticipantComponent();
7431    parseBackboneAttributes(xpp, res);
7432    next(xpp);
7433    int eventType = nextNoWhitespace(xpp);
7434    while (eventType != XmlPullParser.END_TAG) {
7435  if (!parseEncounterEncounterParticipantComponentContent(eventType, xpp, owner, res))
7436        unknownContent(xpp);
7437      eventType = nextNoWhitespace(xpp);
7438    }
7439    next(xpp);
7440    parseElementClose(res);
7441    return res;
7442  }
7443
7444  protected boolean parseEncounterEncounterParticipantComponentContent(int eventType, XmlPullParser xpp, Encounter owner, Encounter.EncounterParticipantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7445      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
7446        res.getType().add(parseCodeableConcept(xpp));
7447      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7448        res.setPeriod(parsePeriod(xpp));
7449      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("individual")) {
7450        res.setIndividual(parseReference(xpp));
7451      } else if (!parseBackboneContent(eventType, xpp, res))
7452        return false;
7453    return true;
7454  }
7455
7456  protected Encounter.DiagnosisComponent parseEncounterDiagnosisComponent(XmlPullParser xpp, Encounter owner) throws XmlPullParserException, IOException, FHIRFormatError {
7457    Encounter.DiagnosisComponent res = new Encounter.DiagnosisComponent();
7458    parseBackboneAttributes(xpp, res);
7459    next(xpp);
7460    int eventType = nextNoWhitespace(xpp);
7461    while (eventType != XmlPullParser.END_TAG) {
7462  if (!parseEncounterDiagnosisComponentContent(eventType, xpp, owner, res))
7463        unknownContent(xpp);
7464      eventType = nextNoWhitespace(xpp);
7465    }
7466    next(xpp);
7467    parseElementClose(res);
7468    return res;
7469  }
7470
7471  protected boolean parseEncounterDiagnosisComponentContent(int eventType, XmlPullParser xpp, Encounter owner, Encounter.DiagnosisComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7472      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("condition")) {
7473        res.setCondition(parseReference(xpp));
7474      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
7475        res.setRole(parseCodeableConcept(xpp));
7476      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rank")) {
7477        res.setRankElement(parsePositiveInt(xpp));
7478      } else if (!parseBackboneContent(eventType, xpp, res))
7479        return false;
7480    return true;
7481  }
7482
7483  protected Encounter.EncounterHospitalizationComponent parseEncounterEncounterHospitalizationComponent(XmlPullParser xpp, Encounter owner) throws XmlPullParserException, IOException, FHIRFormatError {
7484    Encounter.EncounterHospitalizationComponent res = new Encounter.EncounterHospitalizationComponent();
7485    parseBackboneAttributes(xpp, res);
7486    next(xpp);
7487    int eventType = nextNoWhitespace(xpp);
7488    while (eventType != XmlPullParser.END_TAG) {
7489  if (!parseEncounterEncounterHospitalizationComponentContent(eventType, xpp, owner, res))
7490        unknownContent(xpp);
7491      eventType = nextNoWhitespace(xpp);
7492    }
7493    next(xpp);
7494    parseElementClose(res);
7495    return res;
7496  }
7497
7498  protected boolean parseEncounterEncounterHospitalizationComponentContent(int eventType, XmlPullParser xpp, Encounter owner, Encounter.EncounterHospitalizationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7499      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("preAdmissionIdentifier")) {
7500        res.setPreAdmissionIdentifier(parseIdentifier(xpp));
7501      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("origin")) {
7502        res.setOrigin(parseReference(xpp));
7503      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("admitSource")) {
7504        res.setAdmitSource(parseCodeableConcept(xpp));
7505      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reAdmission")) {
7506        res.setReAdmission(parseCodeableConcept(xpp));
7507      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dietPreference")) {
7508        res.getDietPreference().add(parseCodeableConcept(xpp));
7509      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specialCourtesy")) {
7510        res.getSpecialCourtesy().add(parseCodeableConcept(xpp));
7511      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specialArrangement")) {
7512        res.getSpecialArrangement().add(parseCodeableConcept(xpp));
7513      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("destination")) {
7514        res.setDestination(parseReference(xpp));
7515      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dischargeDisposition")) {
7516        res.setDischargeDisposition(parseCodeableConcept(xpp));
7517      } else if (!parseBackboneContent(eventType, xpp, res))
7518        return false;
7519    return true;
7520  }
7521
7522  protected Encounter.EncounterLocationComponent parseEncounterEncounterLocationComponent(XmlPullParser xpp, Encounter owner) throws XmlPullParserException, IOException, FHIRFormatError {
7523    Encounter.EncounterLocationComponent res = new Encounter.EncounterLocationComponent();
7524    parseBackboneAttributes(xpp, res);
7525    next(xpp);
7526    int eventType = nextNoWhitespace(xpp);
7527    while (eventType != XmlPullParser.END_TAG) {
7528  if (!parseEncounterEncounterLocationComponentContent(eventType, xpp, owner, res))
7529        unknownContent(xpp);
7530      eventType = nextNoWhitespace(xpp);
7531    }
7532    next(xpp);
7533    parseElementClose(res);
7534    return res;
7535  }
7536
7537  protected boolean parseEncounterEncounterLocationComponentContent(int eventType, XmlPullParser xpp, Encounter owner, Encounter.EncounterLocationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7538      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
7539        res.setLocation(parseReference(xpp));
7540      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7541        res.setStatusElement(parseEnumeration(xpp, Encounter.EncounterLocationStatus.NULL, new Encounter.EncounterLocationStatusEnumFactory()));
7542      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7543        res.setPeriod(parsePeriod(xpp));
7544      } else if (!parseBackboneContent(eventType, xpp, res))
7545        return false;
7546    return true;
7547  }
7548
7549  protected Endpoint parseEndpoint(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7550    Endpoint res = new Endpoint();
7551    parseDomainResourceAttributes(xpp, res);
7552    next(xpp);
7553    int eventType = nextNoWhitespace(xpp);
7554    while (eventType != XmlPullParser.END_TAG) {
7555  if (!parseEndpointContent(eventType, xpp, res))
7556        unknownContent(xpp);
7557      eventType = nextNoWhitespace(xpp);
7558    }
7559    next(xpp);
7560    parseElementClose(res);
7561    return res;
7562  }
7563
7564  protected boolean parseEndpointContent(int eventType, XmlPullParser xpp, Endpoint res) throws XmlPullParserException, IOException, FHIRFormatError {
7565      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7566        res.getIdentifier().add(parseIdentifier(xpp));
7567      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7568        res.setStatusElement(parseEnumeration(xpp, Endpoint.EndpointStatus.NULL, new Endpoint.EndpointStatusEnumFactory()));
7569      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("connectionType")) {
7570        res.setConnectionType(parseCoding(xpp));
7571      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
7572        res.setNameElement(parseString(xpp));
7573      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("managingOrganization")) {
7574        res.setManagingOrganization(parseReference(xpp));
7575      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
7576        res.getContact().add(parseContactPoint(xpp));
7577      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7578        res.setPeriod(parsePeriod(xpp));
7579      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payloadType")) {
7580        res.getPayloadType().add(parseCodeableConcept(xpp));
7581      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payloadMimeType")) {
7582        res.getPayloadMimeType().add(parseCode(xpp));
7583      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("address")) {
7584        res.setAddressElement(parseUri(xpp));
7585      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("header")) {
7586        res.getHeader().add(parseString(xpp));
7587      } else if (!parseDomainResourceContent(eventType, xpp, res))
7588        return false;
7589    return true;
7590  }
7591
7592  protected EnrollmentRequest parseEnrollmentRequest(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7593    EnrollmentRequest res = new EnrollmentRequest();
7594    parseDomainResourceAttributes(xpp, res);
7595    next(xpp);
7596    int eventType = nextNoWhitespace(xpp);
7597    while (eventType != XmlPullParser.END_TAG) {
7598  if (!parseEnrollmentRequestContent(eventType, xpp, res))
7599        unknownContent(xpp);
7600      eventType = nextNoWhitespace(xpp);
7601    }
7602    next(xpp);
7603    parseElementClose(res);
7604    return res;
7605  }
7606
7607  protected boolean parseEnrollmentRequestContent(int eventType, XmlPullParser xpp, EnrollmentRequest res) throws XmlPullParserException, IOException, FHIRFormatError {
7608      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7609        res.getIdentifier().add(parseIdentifier(xpp));
7610      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7611        res.setStatusElement(parseEnumeration(xpp, EnrollmentRequest.EnrollmentRequestStatus.NULL, new EnrollmentRequest.EnrollmentRequestStatusEnumFactory()));
7612      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
7613        res.setCreatedElement(parseDateTime(xpp));
7614      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurer")) {
7615        res.setInsurer(parseReference(xpp));
7616      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("provider")) {
7617        res.setProvider(parseReference(xpp));
7618      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("organization")) {
7619        res.setOrganization(parseReference(xpp));
7620      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
7621        res.setSubject(parseReference(xpp));
7622      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
7623        res.setCoverage(parseReference(xpp));
7624      } else if (!parseDomainResourceContent(eventType, xpp, res))
7625        return false;
7626    return true;
7627  }
7628
7629  protected EnrollmentResponse parseEnrollmentResponse(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7630    EnrollmentResponse res = new EnrollmentResponse();
7631    parseDomainResourceAttributes(xpp, res);
7632    next(xpp);
7633    int eventType = nextNoWhitespace(xpp);
7634    while (eventType != XmlPullParser.END_TAG) {
7635  if (!parseEnrollmentResponseContent(eventType, xpp, res))
7636        unknownContent(xpp);
7637      eventType = nextNoWhitespace(xpp);
7638    }
7639    next(xpp);
7640    parseElementClose(res);
7641    return res;
7642  }
7643
7644  protected boolean parseEnrollmentResponseContent(int eventType, XmlPullParser xpp, EnrollmentResponse res) throws XmlPullParserException, IOException, FHIRFormatError {
7645      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7646        res.getIdentifier().add(parseIdentifier(xpp));
7647      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7648        res.setStatusElement(parseEnumeration(xpp, EnrollmentResponse.EnrollmentResponseStatus.NULL, new EnrollmentResponse.EnrollmentResponseStatusEnumFactory()));
7649      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
7650        res.setRequest(parseReference(xpp));
7651      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
7652        res.setOutcome(parseCodeableConcept(xpp));
7653      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("disposition")) {
7654        res.setDispositionElement(parseString(xpp));
7655      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
7656        res.setCreatedElement(parseDateTime(xpp));
7657      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("organization")) {
7658        res.setOrganization(parseReference(xpp));
7659      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestProvider")) {
7660        res.setRequestProvider(parseReference(xpp));
7661      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestOrganization")) {
7662        res.setRequestOrganization(parseReference(xpp));
7663      } else if (!parseDomainResourceContent(eventType, xpp, res))
7664        return false;
7665    return true;
7666  }
7667
7668  protected EpisodeOfCare parseEpisodeOfCare(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7669    EpisodeOfCare res = new EpisodeOfCare();
7670    parseDomainResourceAttributes(xpp, res);
7671    next(xpp);
7672    int eventType = nextNoWhitespace(xpp);
7673    while (eventType != XmlPullParser.END_TAG) {
7674  if (!parseEpisodeOfCareContent(eventType, xpp, res))
7675        unknownContent(xpp);
7676      eventType = nextNoWhitespace(xpp);
7677    }
7678    next(xpp);
7679    parseElementClose(res);
7680    return res;
7681  }
7682
7683  protected boolean parseEpisodeOfCareContent(int eventType, XmlPullParser xpp, EpisodeOfCare res) throws XmlPullParserException, IOException, FHIRFormatError {
7684      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7685        res.getIdentifier().add(parseIdentifier(xpp));
7686      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7687        res.setStatusElement(parseEnumeration(xpp, EpisodeOfCare.EpisodeOfCareStatus.NULL, new EpisodeOfCare.EpisodeOfCareStatusEnumFactory()));
7688      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("statusHistory")) {
7689        res.getStatusHistory().add(parseEpisodeOfCareEpisodeOfCareStatusHistoryComponent(xpp, res));
7690      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
7691        res.getType().add(parseCodeableConcept(xpp));
7692      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diagnosis")) {
7693        res.getDiagnosis().add(parseEpisodeOfCareDiagnosisComponent(xpp, res));
7694      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
7695        res.setPatient(parseReference(xpp));
7696      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("managingOrganization")) {
7697        res.setManagingOrganization(parseReference(xpp));
7698      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7699        res.setPeriod(parsePeriod(xpp));
7700      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referralRequest")) {
7701        res.getReferralRequest().add(parseReference(xpp));
7702      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("careManager")) {
7703        res.setCareManager(parseReference(xpp));
7704      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("team")) {
7705        res.getTeam().add(parseReference(xpp));
7706      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("account")) {
7707        res.getAccount().add(parseReference(xpp));
7708      } else if (!parseDomainResourceContent(eventType, xpp, res))
7709        return false;
7710    return true;
7711  }
7712
7713  protected EpisodeOfCare.EpisodeOfCareStatusHistoryComponent parseEpisodeOfCareEpisodeOfCareStatusHistoryComponent(XmlPullParser xpp, EpisodeOfCare owner) throws XmlPullParserException, IOException, FHIRFormatError {
7714    EpisodeOfCare.EpisodeOfCareStatusHistoryComponent res = new EpisodeOfCare.EpisodeOfCareStatusHistoryComponent();
7715    parseBackboneAttributes(xpp, res);
7716    next(xpp);
7717    int eventType = nextNoWhitespace(xpp);
7718    while (eventType != XmlPullParser.END_TAG) {
7719  if (!parseEpisodeOfCareEpisodeOfCareStatusHistoryComponentContent(eventType, xpp, owner, res))
7720        unknownContent(xpp);
7721      eventType = nextNoWhitespace(xpp);
7722    }
7723    next(xpp);
7724    parseElementClose(res);
7725    return res;
7726  }
7727
7728  protected boolean parseEpisodeOfCareEpisodeOfCareStatusHistoryComponentContent(int eventType, XmlPullParser xpp, EpisodeOfCare owner, EpisodeOfCare.EpisodeOfCareStatusHistoryComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7729      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7730        res.setStatusElement(parseEnumeration(xpp, EpisodeOfCare.EpisodeOfCareStatus.NULL, new EpisodeOfCare.EpisodeOfCareStatusEnumFactory()));
7731      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7732        res.setPeriod(parsePeriod(xpp));
7733      } else if (!parseBackboneContent(eventType, xpp, res))
7734        return false;
7735    return true;
7736  }
7737
7738  protected EpisodeOfCare.DiagnosisComponent parseEpisodeOfCareDiagnosisComponent(XmlPullParser xpp, EpisodeOfCare owner) throws XmlPullParserException, IOException, FHIRFormatError {
7739    EpisodeOfCare.DiagnosisComponent res = new EpisodeOfCare.DiagnosisComponent();
7740    parseBackboneAttributes(xpp, res);
7741    next(xpp);
7742    int eventType = nextNoWhitespace(xpp);
7743    while (eventType != XmlPullParser.END_TAG) {
7744  if (!parseEpisodeOfCareDiagnosisComponentContent(eventType, xpp, owner, res))
7745        unknownContent(xpp);
7746      eventType = nextNoWhitespace(xpp);
7747    }
7748    next(xpp);
7749    parseElementClose(res);
7750    return res;
7751  }
7752
7753  protected boolean parseEpisodeOfCareDiagnosisComponentContent(int eventType, XmlPullParser xpp, EpisodeOfCare owner, EpisodeOfCare.DiagnosisComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7754      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("condition")) {
7755        res.setCondition(parseReference(xpp));
7756      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
7757        res.setRole(parseCodeableConcept(xpp));
7758      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rank")) {
7759        res.setRankElement(parsePositiveInt(xpp));
7760      } else if (!parseBackboneContent(eventType, xpp, res))
7761        return false;
7762    return true;
7763  }
7764
7765  protected ExpansionProfile parseExpansionProfile(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7766    ExpansionProfile res = new ExpansionProfile();
7767    parseDomainResourceAttributes(xpp, res);
7768    next(xpp);
7769    int eventType = nextNoWhitespace(xpp);
7770    while (eventType != XmlPullParser.END_TAG) {
7771  if (!parseExpansionProfileContent(eventType, xpp, res))
7772        unknownContent(xpp);
7773      eventType = nextNoWhitespace(xpp);
7774    }
7775    next(xpp);
7776    parseElementClose(res);
7777    return res;
7778  }
7779
7780  protected boolean parseExpansionProfileContent(int eventType, XmlPullParser xpp, ExpansionProfile res) throws XmlPullParserException, IOException, FHIRFormatError {
7781      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
7782        res.setUrlElement(parseUri(xpp));
7783      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7784        res.setIdentifier(parseIdentifier(xpp));
7785      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
7786        res.setVersionElement(parseString(xpp));
7787      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
7788        res.setNameElement(parseString(xpp));
7789      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7790        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
7791      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
7792        res.setExperimentalElement(parseBoolean(xpp));
7793      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
7794        res.setDateElement(parseDateTime(xpp));
7795      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
7796        res.setPublisherElement(parseString(xpp));
7797      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
7798        res.getContact().add(parseContactDetail(xpp));
7799      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
7800        res.setDescriptionElement(parseMarkdown(xpp));
7801      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
7802        res.getUseContext().add(parseUsageContext(xpp));
7803      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
7804        res.getJurisdiction().add(parseCodeableConcept(xpp));
7805      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fixedVersion")) {
7806        res.getFixedVersion().add(parseExpansionProfileExpansionProfileFixedVersionComponent(xpp, res));
7807      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("excludedSystem")) {
7808        res.setExcludedSystem(parseExpansionProfileExpansionProfileExcludedSystemComponent(xpp, res));
7809      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("includeDesignations")) {
7810        res.setIncludeDesignationsElement(parseBoolean(xpp));
7811      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("designation")) {
7812        res.setDesignation(parseExpansionProfileExpansionProfileDesignationComponent(xpp, res));
7813      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("includeDefinition")) {
7814        res.setIncludeDefinitionElement(parseBoolean(xpp));
7815      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("activeOnly")) {
7816        res.setActiveOnlyElement(parseBoolean(xpp));
7817      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("excludeNested")) {
7818        res.setExcludeNestedElement(parseBoolean(xpp));
7819      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("excludeNotForUI")) {
7820        res.setExcludeNotForUIElement(parseBoolean(xpp));
7821      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("excludePostCoordinated")) {
7822        res.setExcludePostCoordinatedElement(parseBoolean(xpp));
7823      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("displayLanguage")) {
7824        res.setDisplayLanguageElement(parseCode(xpp));
7825      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("limitedExpansion")) {
7826        res.setLimitedExpansionElement(parseBoolean(xpp));
7827      } else if (!parseDomainResourceContent(eventType, xpp, res))
7828        return false;
7829    return true;
7830  }
7831
7832  protected ExpansionProfile.ExpansionProfileFixedVersionComponent parseExpansionProfileExpansionProfileFixedVersionComponent(XmlPullParser xpp, ExpansionProfile owner) throws XmlPullParserException, IOException, FHIRFormatError {
7833    ExpansionProfile.ExpansionProfileFixedVersionComponent res = new ExpansionProfile.ExpansionProfileFixedVersionComponent();
7834    parseBackboneAttributes(xpp, res);
7835    next(xpp);
7836    int eventType = nextNoWhitespace(xpp);
7837    while (eventType != XmlPullParser.END_TAG) {
7838  if (!parseExpansionProfileExpansionProfileFixedVersionComponentContent(eventType, xpp, owner, res))
7839        unknownContent(xpp);
7840      eventType = nextNoWhitespace(xpp);
7841    }
7842    next(xpp);
7843    parseElementClose(res);
7844    return res;
7845  }
7846
7847  protected boolean parseExpansionProfileExpansionProfileFixedVersionComponentContent(int eventType, XmlPullParser xpp, ExpansionProfile owner, ExpansionProfile.ExpansionProfileFixedVersionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7848      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
7849        res.setSystemElement(parseUri(xpp));
7850      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
7851        res.setVersionElement(parseString(xpp));
7852      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
7853        res.setModeElement(parseEnumeration(xpp, ExpansionProfile.SystemVersionProcessingMode.NULL, new ExpansionProfile.SystemVersionProcessingModeEnumFactory()));
7854      } else if (!parseBackboneContent(eventType, xpp, res))
7855        return false;
7856    return true;
7857  }
7858
7859  protected ExpansionProfile.ExpansionProfileExcludedSystemComponent parseExpansionProfileExpansionProfileExcludedSystemComponent(XmlPullParser xpp, ExpansionProfile owner) throws XmlPullParserException, IOException, FHIRFormatError {
7860    ExpansionProfile.ExpansionProfileExcludedSystemComponent res = new ExpansionProfile.ExpansionProfileExcludedSystemComponent();
7861    parseBackboneAttributes(xpp, res);
7862    next(xpp);
7863    int eventType = nextNoWhitespace(xpp);
7864    while (eventType != XmlPullParser.END_TAG) {
7865  if (!parseExpansionProfileExpansionProfileExcludedSystemComponentContent(eventType, xpp, owner, res))
7866        unknownContent(xpp);
7867      eventType = nextNoWhitespace(xpp);
7868    }
7869    next(xpp);
7870    parseElementClose(res);
7871    return res;
7872  }
7873
7874  protected boolean parseExpansionProfileExpansionProfileExcludedSystemComponentContent(int eventType, XmlPullParser xpp, ExpansionProfile owner, ExpansionProfile.ExpansionProfileExcludedSystemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7875      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
7876        res.setSystemElement(parseUri(xpp));
7877      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
7878        res.setVersionElement(parseString(xpp));
7879      } else if (!parseBackboneContent(eventType, xpp, res))
7880        return false;
7881    return true;
7882  }
7883
7884  protected ExpansionProfile.ExpansionProfileDesignationComponent parseExpansionProfileExpansionProfileDesignationComponent(XmlPullParser xpp, ExpansionProfile owner) throws XmlPullParserException, IOException, FHIRFormatError {
7885    ExpansionProfile.ExpansionProfileDesignationComponent res = new ExpansionProfile.ExpansionProfileDesignationComponent();
7886    parseBackboneAttributes(xpp, res);
7887    next(xpp);
7888    int eventType = nextNoWhitespace(xpp);
7889    while (eventType != XmlPullParser.END_TAG) {
7890  if (!parseExpansionProfileExpansionProfileDesignationComponentContent(eventType, xpp, owner, res))
7891        unknownContent(xpp);
7892      eventType = nextNoWhitespace(xpp);
7893    }
7894    next(xpp);
7895    parseElementClose(res);
7896    return res;
7897  }
7898
7899  protected boolean parseExpansionProfileExpansionProfileDesignationComponentContent(int eventType, XmlPullParser xpp, ExpansionProfile owner, ExpansionProfile.ExpansionProfileDesignationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7900      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("include")) {
7901        res.setInclude(parseExpansionProfileDesignationIncludeComponent(xpp, owner));
7902      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("exclude")) {
7903        res.setExclude(parseExpansionProfileDesignationExcludeComponent(xpp, owner));
7904      } else if (!parseBackboneContent(eventType, xpp, res))
7905        return false;
7906    return true;
7907  }
7908
7909  protected ExpansionProfile.DesignationIncludeComponent parseExpansionProfileDesignationIncludeComponent(XmlPullParser xpp, ExpansionProfile owner) throws XmlPullParserException, IOException, FHIRFormatError {
7910    ExpansionProfile.DesignationIncludeComponent res = new ExpansionProfile.DesignationIncludeComponent();
7911    parseBackboneAttributes(xpp, res);
7912    next(xpp);
7913    int eventType = nextNoWhitespace(xpp);
7914    while (eventType != XmlPullParser.END_TAG) {
7915  if (!parseExpansionProfileDesignationIncludeComponentContent(eventType, xpp, owner, res))
7916        unknownContent(xpp);
7917      eventType = nextNoWhitespace(xpp);
7918    }
7919    next(xpp);
7920    parseElementClose(res);
7921    return res;
7922  }
7923
7924  protected boolean parseExpansionProfileDesignationIncludeComponentContent(int eventType, XmlPullParser xpp, ExpansionProfile owner, ExpansionProfile.DesignationIncludeComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7925      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("designation")) {
7926        res.getDesignation().add(parseExpansionProfileDesignationIncludeDesignationComponent(xpp, owner));
7927      } else if (!parseBackboneContent(eventType, xpp, res))
7928        return false;
7929    return true;
7930  }
7931
7932  protected ExpansionProfile.DesignationIncludeDesignationComponent parseExpansionProfileDesignationIncludeDesignationComponent(XmlPullParser xpp, ExpansionProfile owner) throws XmlPullParserException, IOException, FHIRFormatError {
7933    ExpansionProfile.DesignationIncludeDesignationComponent res = new ExpansionProfile.DesignationIncludeDesignationComponent();
7934    parseBackboneAttributes(xpp, res);
7935    next(xpp);
7936    int eventType = nextNoWhitespace(xpp);
7937    while (eventType != XmlPullParser.END_TAG) {
7938  if (!parseExpansionProfileDesignationIncludeDesignationComponentContent(eventType, xpp, owner, res))
7939        unknownContent(xpp);
7940      eventType = nextNoWhitespace(xpp);
7941    }
7942    next(xpp);
7943    parseElementClose(res);
7944    return res;
7945  }
7946
7947  protected boolean parseExpansionProfileDesignationIncludeDesignationComponentContent(int eventType, XmlPullParser xpp, ExpansionProfile owner, ExpansionProfile.DesignationIncludeDesignationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7948      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
7949        res.setLanguageElement(parseCode(xpp));
7950      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
7951        res.setUse(parseCoding(xpp));
7952      } else if (!parseBackboneContent(eventType, xpp, res))
7953        return false;
7954    return true;
7955  }
7956
7957  protected ExpansionProfile.DesignationExcludeComponent parseExpansionProfileDesignationExcludeComponent(XmlPullParser xpp, ExpansionProfile owner) throws XmlPullParserException, IOException, FHIRFormatError {
7958    ExpansionProfile.DesignationExcludeComponent res = new ExpansionProfile.DesignationExcludeComponent();
7959    parseBackboneAttributes(xpp, res);
7960    next(xpp);
7961    int eventType = nextNoWhitespace(xpp);
7962    while (eventType != XmlPullParser.END_TAG) {
7963  if (!parseExpansionProfileDesignationExcludeComponentContent(eventType, xpp, owner, res))
7964        unknownContent(xpp);
7965      eventType = nextNoWhitespace(xpp);
7966    }
7967    next(xpp);
7968    parseElementClose(res);
7969    return res;
7970  }
7971
7972  protected boolean parseExpansionProfileDesignationExcludeComponentContent(int eventType, XmlPullParser xpp, ExpansionProfile owner, ExpansionProfile.DesignationExcludeComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7973      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("designation")) {
7974        res.getDesignation().add(parseExpansionProfileDesignationExcludeDesignationComponent(xpp, owner));
7975      } else if (!parseBackboneContent(eventType, xpp, res))
7976        return false;
7977    return true;
7978  }
7979
7980  protected ExpansionProfile.DesignationExcludeDesignationComponent parseExpansionProfileDesignationExcludeDesignationComponent(XmlPullParser xpp, ExpansionProfile owner) throws XmlPullParserException, IOException, FHIRFormatError {
7981    ExpansionProfile.DesignationExcludeDesignationComponent res = new ExpansionProfile.DesignationExcludeDesignationComponent();
7982    parseBackboneAttributes(xpp, res);
7983    next(xpp);
7984    int eventType = nextNoWhitespace(xpp);
7985    while (eventType != XmlPullParser.END_TAG) {
7986  if (!parseExpansionProfileDesignationExcludeDesignationComponentContent(eventType, xpp, owner, res))
7987        unknownContent(xpp);
7988      eventType = nextNoWhitespace(xpp);
7989    }
7990    next(xpp);
7991    parseElementClose(res);
7992    return res;
7993  }
7994
7995  protected boolean parseExpansionProfileDesignationExcludeDesignationComponentContent(int eventType, XmlPullParser xpp, ExpansionProfile owner, ExpansionProfile.DesignationExcludeDesignationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7996      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
7997        res.setLanguageElement(parseCode(xpp));
7998      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
7999        res.setUse(parseCoding(xpp));
8000      } else if (!parseBackboneContent(eventType, xpp, res))
8001        return false;
8002    return true;
8003  }
8004
8005  protected ExplanationOfBenefit parseExplanationOfBenefit(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8006    ExplanationOfBenefit res = new ExplanationOfBenefit();
8007    parseDomainResourceAttributes(xpp, res);
8008    next(xpp);
8009    int eventType = nextNoWhitespace(xpp);
8010    while (eventType != XmlPullParser.END_TAG) {
8011  if (!parseExplanationOfBenefitContent(eventType, xpp, res))
8012        unknownContent(xpp);
8013      eventType = nextNoWhitespace(xpp);
8014    }
8015    next(xpp);
8016    parseElementClose(res);
8017    return res;
8018  }
8019
8020  protected boolean parseExplanationOfBenefitContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit res) throws XmlPullParserException, IOException, FHIRFormatError {
8021      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
8022        res.getIdentifier().add(parseIdentifier(xpp));
8023      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
8024        res.setStatusElement(parseEnumeration(xpp, ExplanationOfBenefit.ExplanationOfBenefitStatus.NULL, new ExplanationOfBenefit.ExplanationOfBenefitStatusEnumFactory()));
8025      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
8026        res.setType(parseCodeableConcept(xpp));
8027      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subType")) {
8028        res.getSubType().add(parseCodeableConcept(xpp));
8029      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
8030        res.setPatient(parseReference(xpp));
8031      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("billablePeriod")) {
8032        res.setBillablePeriod(parsePeriod(xpp));
8033      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
8034        res.setCreatedElement(parseDateTime(xpp));
8035      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("enterer")) {
8036        res.setEnterer(parseReference(xpp));
8037      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurer")) {
8038        res.setInsurer(parseReference(xpp));
8039      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("provider")) {
8040        res.setProvider(parseReference(xpp));
8041      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("organization")) {
8042        res.setOrganization(parseReference(xpp));
8043      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referral")) {
8044        res.setReferral(parseReference(xpp));
8045      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("facility")) {
8046        res.setFacility(parseReference(xpp));
8047      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("claim")) {
8048        res.setClaim(parseReference(xpp));
8049      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("claimResponse")) {
8050        res.setClaimResponse(parseReference(xpp));
8051      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
8052        res.setOutcome(parseCodeableConcept(xpp));
8053      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("disposition")) {
8054        res.setDispositionElement(parseString(xpp));
8055      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("related")) {
8056        res.getRelated().add(parseExplanationOfBenefitRelatedClaimComponent(xpp, res));
8057      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prescription")) {
8058        res.setPrescription(parseReference(xpp));
8059      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("originalPrescription")) {
8060        res.setOriginalPrescription(parseReference(xpp));
8061      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payee")) {
8062        res.setPayee(parseExplanationOfBenefitPayeeComponent(xpp, res));
8063      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("information")) {
8064        res.getInformation().add(parseExplanationOfBenefitSupportingInformationComponent(xpp, res));
8065      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("careTeam")) {
8066        res.getCareTeam().add(parseExplanationOfBenefitCareTeamComponent(xpp, res));
8067      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diagnosis")) {
8068        res.getDiagnosis().add(parseExplanationOfBenefitDiagnosisComponent(xpp, res));
8069      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("procedure")) {
8070        res.getProcedure().add(parseExplanationOfBenefitProcedureComponent(xpp, res));
8071      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("precedence")) {
8072        res.setPrecedenceElement(parsePositiveInt(xpp));
8073      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurance")) {
8074        res.setInsurance(parseExplanationOfBenefitInsuranceComponent(xpp, res));
8075      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("accident")) {
8076        res.setAccident(parseExplanationOfBenefitAccidentComponent(xpp, res));
8077      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("employmentImpacted")) {
8078        res.setEmploymentImpacted(parsePeriod(xpp));
8079      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("hospitalization")) {
8080        res.setHospitalization(parsePeriod(xpp));
8081      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("item")) {
8082        res.getItem().add(parseExplanationOfBenefitItemComponent(xpp, res));
8083      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("addItem")) {
8084        res.getAddItem().add(parseExplanationOfBenefitAddedItemComponent(xpp, res));
8085      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("totalCost")) {
8086        res.setTotalCost(parseMoney(xpp));
8087      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unallocDeductable")) {
8088        res.setUnallocDeductable(parseMoney(xpp));
8089      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("totalBenefit")) {
8090        res.setTotalBenefit(parseMoney(xpp));
8091      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payment")) {
8092        res.setPayment(parseExplanationOfBenefitPaymentComponent(xpp, res));
8093      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("form")) {
8094        res.setForm(parseCodeableConcept(xpp));
8095      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("processNote")) {
8096        res.getProcessNote().add(parseExplanationOfBenefitNoteComponent(xpp, res));
8097      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("benefitBalance")) {
8098        res.getBenefitBalance().add(parseExplanationOfBenefitBenefitBalanceComponent(xpp, res));
8099      } else if (!parseDomainResourceContent(eventType, xpp, res))
8100        return false;
8101    return true;
8102  }
8103
8104  protected ExplanationOfBenefit.RelatedClaimComponent parseExplanationOfBenefitRelatedClaimComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8105    ExplanationOfBenefit.RelatedClaimComponent res = new ExplanationOfBenefit.RelatedClaimComponent();
8106    parseBackboneAttributes(xpp, res);
8107    next(xpp);
8108    int eventType = nextNoWhitespace(xpp);
8109    while (eventType != XmlPullParser.END_TAG) {
8110  if (!parseExplanationOfBenefitRelatedClaimComponentContent(eventType, xpp, owner, res))
8111        unknownContent(xpp);
8112      eventType = nextNoWhitespace(xpp);
8113    }
8114    next(xpp);
8115    parseElementClose(res);
8116    return res;
8117  }
8118
8119  protected boolean parseExplanationOfBenefitRelatedClaimComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.RelatedClaimComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8120      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("claim")) {
8121        res.setClaim(parseReference(xpp));
8122      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relationship")) {
8123        res.setRelationship(parseCodeableConcept(xpp));
8124      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
8125        res.setReference(parseIdentifier(xpp));
8126      } else if (!parseBackboneContent(eventType, xpp, res))
8127        return false;
8128    return true;
8129  }
8130
8131  protected ExplanationOfBenefit.PayeeComponent parseExplanationOfBenefitPayeeComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8132    ExplanationOfBenefit.PayeeComponent res = new ExplanationOfBenefit.PayeeComponent();
8133    parseBackboneAttributes(xpp, res);
8134    next(xpp);
8135    int eventType = nextNoWhitespace(xpp);
8136    while (eventType != XmlPullParser.END_TAG) {
8137  if (!parseExplanationOfBenefitPayeeComponentContent(eventType, xpp, owner, res))
8138        unknownContent(xpp);
8139      eventType = nextNoWhitespace(xpp);
8140    }
8141    next(xpp);
8142    parseElementClose(res);
8143    return res;
8144  }
8145
8146  protected boolean parseExplanationOfBenefitPayeeComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.PayeeComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8147      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
8148        res.setType(parseCodeableConcept(xpp));
8149      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resourceType")) {
8150        res.setResourceType(parseCodeableConcept(xpp));
8151      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("party")) {
8152        res.setParty(parseReference(xpp));
8153      } else if (!parseBackboneContent(eventType, xpp, res))
8154        return false;
8155    return true;
8156  }
8157
8158  protected ExplanationOfBenefit.SupportingInformationComponent parseExplanationOfBenefitSupportingInformationComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8159    ExplanationOfBenefit.SupportingInformationComponent res = new ExplanationOfBenefit.SupportingInformationComponent();
8160    parseBackboneAttributes(xpp, res);
8161    next(xpp);
8162    int eventType = nextNoWhitespace(xpp);
8163    while (eventType != XmlPullParser.END_TAG) {
8164  if (!parseExplanationOfBenefitSupportingInformationComponentContent(eventType, xpp, owner, res))
8165        unknownContent(xpp);
8166      eventType = nextNoWhitespace(xpp);
8167    }
8168    next(xpp);
8169    parseElementClose(res);
8170    return res;
8171  }
8172
8173  protected boolean parseExplanationOfBenefitSupportingInformationComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.SupportingInformationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8174      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
8175        res.setSequenceElement(parsePositiveInt(xpp));
8176      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
8177        res.setCategory(parseCodeableConcept(xpp));
8178      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
8179        res.setCode(parseCodeableConcept(xpp));
8180      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "timing")) {
8181        res.setTiming(parseType("timing", xpp));
8182      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
8183        res.setValue(parseType("value", xpp));
8184      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
8185        res.setReason(parseCoding(xpp));
8186      } else if (!parseBackboneContent(eventType, xpp, res))
8187        return false;
8188    return true;
8189  }
8190
8191  protected ExplanationOfBenefit.CareTeamComponent parseExplanationOfBenefitCareTeamComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8192    ExplanationOfBenefit.CareTeamComponent res = new ExplanationOfBenefit.CareTeamComponent();
8193    parseBackboneAttributes(xpp, res);
8194    next(xpp);
8195    int eventType = nextNoWhitespace(xpp);
8196    while (eventType != XmlPullParser.END_TAG) {
8197  if (!parseExplanationOfBenefitCareTeamComponentContent(eventType, xpp, owner, res))
8198        unknownContent(xpp);
8199      eventType = nextNoWhitespace(xpp);
8200    }
8201    next(xpp);
8202    parseElementClose(res);
8203    return res;
8204  }
8205
8206  protected boolean parseExplanationOfBenefitCareTeamComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.CareTeamComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8207      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
8208        res.setSequenceElement(parsePositiveInt(xpp));
8209      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("provider")) {
8210        res.setProvider(parseReference(xpp));
8211      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("responsible")) {
8212        res.setResponsibleElement(parseBoolean(xpp));
8213      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
8214        res.setRole(parseCodeableConcept(xpp));
8215      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("qualification")) {
8216        res.setQualification(parseCodeableConcept(xpp));
8217      } else if (!parseBackboneContent(eventType, xpp, res))
8218        return false;
8219    return true;
8220  }
8221
8222  protected ExplanationOfBenefit.DiagnosisComponent parseExplanationOfBenefitDiagnosisComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8223    ExplanationOfBenefit.DiagnosisComponent res = new ExplanationOfBenefit.DiagnosisComponent();
8224    parseBackboneAttributes(xpp, res);
8225    next(xpp);
8226    int eventType = nextNoWhitespace(xpp);
8227    while (eventType != XmlPullParser.END_TAG) {
8228  if (!parseExplanationOfBenefitDiagnosisComponentContent(eventType, xpp, owner, res))
8229        unknownContent(xpp);
8230      eventType = nextNoWhitespace(xpp);
8231    }
8232    next(xpp);
8233    parseElementClose(res);
8234    return res;
8235  }
8236
8237  protected boolean parseExplanationOfBenefitDiagnosisComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.DiagnosisComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8238      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
8239        res.setSequenceElement(parsePositiveInt(xpp));
8240      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "diagnosis")) {
8241        res.setDiagnosis(parseType("diagnosis", xpp));
8242      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
8243        res.getType().add(parseCodeableConcept(xpp));
8244      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("packageCode")) {
8245        res.setPackageCode(parseCodeableConcept(xpp));
8246      } else if (!parseBackboneContent(eventType, xpp, res))
8247        return false;
8248    return true;
8249  }
8250
8251  protected ExplanationOfBenefit.ProcedureComponent parseExplanationOfBenefitProcedureComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8252    ExplanationOfBenefit.ProcedureComponent res = new ExplanationOfBenefit.ProcedureComponent();
8253    parseBackboneAttributes(xpp, res);
8254    next(xpp);
8255    int eventType = nextNoWhitespace(xpp);
8256    while (eventType != XmlPullParser.END_TAG) {
8257  if (!parseExplanationOfBenefitProcedureComponentContent(eventType, xpp, owner, res))
8258        unknownContent(xpp);
8259      eventType = nextNoWhitespace(xpp);
8260    }
8261    next(xpp);
8262    parseElementClose(res);
8263    return res;
8264  }
8265
8266  protected boolean parseExplanationOfBenefitProcedureComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.ProcedureComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8267      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
8268        res.setSequenceElement(parsePositiveInt(xpp));
8269      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
8270        res.setDateElement(parseDateTime(xpp));
8271      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "procedure")) {
8272        res.setProcedure(parseType("procedure", xpp));
8273      } else if (!parseBackboneContent(eventType, xpp, res))
8274        return false;
8275    return true;
8276  }
8277
8278  protected ExplanationOfBenefit.InsuranceComponent parseExplanationOfBenefitInsuranceComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8279    ExplanationOfBenefit.InsuranceComponent res = new ExplanationOfBenefit.InsuranceComponent();
8280    parseBackboneAttributes(xpp, res);
8281    next(xpp);
8282    int eventType = nextNoWhitespace(xpp);
8283    while (eventType != XmlPullParser.END_TAG) {
8284  if (!parseExplanationOfBenefitInsuranceComponentContent(eventType, xpp, owner, res))
8285        unknownContent(xpp);
8286      eventType = nextNoWhitespace(xpp);
8287    }
8288    next(xpp);
8289    parseElementClose(res);
8290    return res;
8291  }
8292
8293  protected boolean parseExplanationOfBenefitInsuranceComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.InsuranceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8294      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
8295        res.setCoverage(parseReference(xpp));
8296      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("preAuthRef")) {
8297        res.getPreAuthRef().add(parseString(xpp));
8298      } else if (!parseBackboneContent(eventType, xpp, res))
8299        return false;
8300    return true;
8301  }
8302
8303  protected ExplanationOfBenefit.AccidentComponent parseExplanationOfBenefitAccidentComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8304    ExplanationOfBenefit.AccidentComponent res = new ExplanationOfBenefit.AccidentComponent();
8305    parseBackboneAttributes(xpp, res);
8306    next(xpp);
8307    int eventType = nextNoWhitespace(xpp);
8308    while (eventType != XmlPullParser.END_TAG) {
8309  if (!parseExplanationOfBenefitAccidentComponentContent(eventType, xpp, owner, res))
8310        unknownContent(xpp);
8311      eventType = nextNoWhitespace(xpp);
8312    }
8313    next(xpp);
8314    parseElementClose(res);
8315    return res;
8316  }
8317
8318  protected boolean parseExplanationOfBenefitAccidentComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.AccidentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8319      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
8320        res.setDateElement(parseDate(xpp));
8321      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
8322        res.setType(parseCodeableConcept(xpp));
8323      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "location")) {
8324        res.setLocation(parseType("location", xpp));
8325      } else if (!parseBackboneContent(eventType, xpp, res))
8326        return false;
8327    return true;
8328  }
8329
8330  protected ExplanationOfBenefit.ItemComponent parseExplanationOfBenefitItemComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8331    ExplanationOfBenefit.ItemComponent res = new ExplanationOfBenefit.ItemComponent();
8332    parseBackboneAttributes(xpp, res);
8333    next(xpp);
8334    int eventType = nextNoWhitespace(xpp);
8335    while (eventType != XmlPullParser.END_TAG) {
8336  if (!parseExplanationOfBenefitItemComponentContent(eventType, xpp, owner, res))
8337        unknownContent(xpp);
8338      eventType = nextNoWhitespace(xpp);
8339    }
8340    next(xpp);
8341    parseElementClose(res);
8342    return res;
8343  }
8344
8345  protected boolean parseExplanationOfBenefitItemComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.ItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8346      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
8347        res.setSequenceElement(parsePositiveInt(xpp));
8348      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("careTeamLinkId")) {
8349        res.getCareTeamLinkId().add(parsePositiveInt(xpp));
8350      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diagnosisLinkId")) {